Home | History | Annotate | Download | only in tests
      1 #! /bin/sh
      2 # Generated from ../../../tests/local.at by GNU Autoconf 2.69.
      3 #
      4 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
      5 #
      6 # This test suite is free software; the Free Software Foundation gives
      7 # unlimited permission to copy, distribute and modify it.
      8 ## -------------------- ##
      9 ## M4sh Initialization. ##
     10 ## -------------------- ##
     11 
     12 # Be more Bourne compatible
     13 DUALCASE=1; export DUALCASE # for MKS sh
     14 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
     15   emulate sh
     16   NULLCMD=:
     17   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
     18   # is contrary to our usage.  Disable this feature.
     19   alias -g '${1+"$@"}'='"$@"'
     20   setopt NO_GLOB_SUBST
     21 else
     22   case `(set -o) 2>/dev/null` in #(
     23   *posix*) :
     24     set -o posix ;; #(
     25   *) :
     26      ;;
     27 esac
     28 fi
     29 
     30 
     31 as_nl='
     32 '
     33 export as_nl
     34 # Printing a long string crashes Solaris 7 /usr/bin/printf.
     35 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
     36 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
     37 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
     38 # Prefer a ksh shell builtin over an external printf program on Solaris,
     39 # but without wasting forks for bash or zsh.
     40 if test -z "$BASH_VERSION$ZSH_VERSION" \
     41     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
     42   as_echo='print -r --'
     43   as_echo_n='print -rn --'
     44 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
     45   as_echo='printf %s\n'
     46   as_echo_n='printf %s'
     47 else
     48   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
     49     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
     50     as_echo_n='/usr/ucb/echo -n'
     51   else
     52     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     53     as_echo_n_body='eval
     54       arg=$1;
     55       case $arg in #(
     56       *"$as_nl"*)
     57 	expr "X$arg" : "X\\(.*\\)$as_nl";
     58 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
     59       esac;
     60       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
     61     '
     62     export as_echo_n_body
     63     as_echo_n='sh -c $as_echo_n_body as_echo'
     64   fi
     65   export as_echo_body
     66   as_echo='sh -c $as_echo_body as_echo'
     67 fi
     68 
     69 # The user is always right.
     70 if test "${PATH_SEPARATOR+set}" != set; then
     71   PATH_SEPARATOR=:
     72   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
     73     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
     74       PATH_SEPARATOR=';'
     75   }
     76 fi
     77 
     78 
     79 # IFS
     80 # We need space, tab and new line, in precisely that order.  Quoting is
     81 # there to prevent editors from complaining about space-tab.
     82 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
     83 # splitting by setting IFS to empty value.)
     84 IFS=" ""	$as_nl"
     85 
     86 # Find who we are.  Look in the path if we contain no directory separator.
     87 as_myself=
     88 case $0 in #((
     89   *[\\/]* ) as_myself=$0 ;;
     90   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     91 for as_dir in $PATH
     92 do
     93   IFS=$as_save_IFS
     94   test -z "$as_dir" && as_dir=.
     95     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
     96   done
     97 IFS=$as_save_IFS
     98 
     99      ;;
    100 esac
    101 # We did not find ourselves, most probably we were run as `sh COMMAND'
    102 # in which case we are not to be found in the path.
    103 if test "x$as_myself" = x; then
    104   as_myself=$0
    105 fi
    106 if test ! -f "$as_myself"; then
    107   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
    108   exit 1
    109 fi
    110 
    111 # Unset variables that we do not need and which cause bugs (e.g. in
    112 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
    113 # suppresses any "Segmentation fault" message there.  '((' could
    114 # trigger a bug in pdksh 5.2.14.
    115 for as_var in BASH_ENV ENV MAIL MAILPATH
    116 do eval test x\${$as_var+set} = xset \
    117   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
    118 done
    119 PS1='$ '
    120 PS2='> '
    121 PS4='+ '
    122 
    123 # NLS nuisances.
    124 LC_ALL=C
    125 export LC_ALL
    126 LANGUAGE=C
    127 export LANGUAGE
    128 
    129 # CDPATH.
    130 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
    131 
    132 if test "x$CONFIG_SHELL" = x; then
    133   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
    134   emulate sh
    135   NULLCMD=:
    136   # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
    137   # is contrary to our usage.  Disable this feature.
    138   alias -g '\${1+\"\$@\"}'='\"\$@\"'
    139   setopt NO_GLOB_SUBST
    140 else
    141   case \`(set -o) 2>/dev/null\` in #(
    142   *posix*) :
    143     set -o posix ;; #(
    144   *) :
    145      ;;
    146 esac
    147 fi
    148 "
    149   as_required="as_fn_return () { (exit \$1); }
    150 as_fn_success () { as_fn_return 0; }
    151 as_fn_failure () { as_fn_return 1; }
    152 as_fn_ret_success () { return 0; }
    153 as_fn_ret_failure () { return 1; }
    154 
    155 exitcode=0
    156 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
    157 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
    158 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
    159 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
    160 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
    161 
    162 else
    163   exitcode=1; echo positional parameters were not saved.
    164 fi
    165 test x\$exitcode = x0 || exit 1
    166 test -x / || exit 1"
    167   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
    168   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
    169   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
    170   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
    171 test \$(( 1 + 1 )) = 2 || exit 1"
    172   if (eval "$as_required") 2>/dev/null; then :
    173   as_have_required=yes
    174 else
    175   as_have_required=no
    176 fi
    177   if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
    178 
    179 else
    180   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    181 as_found=false
    182 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
    183 do
    184   IFS=$as_save_IFS
    185   test -z "$as_dir" && as_dir=.
    186   as_found=:
    187   case $as_dir in #(
    188 	 /*)
    189 	   for as_base in sh bash ksh sh5; do
    190 	     # Try only shells that exist, to save several forks.
    191 	     as_shell=$as_dir/$as_base
    192 	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
    193 		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
    194   CONFIG_SHELL=$as_shell as_have_required=yes
    195 		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
    196   break 2
    197 fi
    198 fi
    199 	   done;;
    200        esac
    201   as_found=false
    202 done
    203 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
    204 	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
    205   CONFIG_SHELL=$SHELL as_have_required=yes
    206 fi; }
    207 IFS=$as_save_IFS
    208 
    209 
    210       if test "x$CONFIG_SHELL" != x; then :
    211   export CONFIG_SHELL
    212              # We cannot yet assume a decent shell, so we have to provide a
    213 # neutralization value for shells without unset; and this also
    214 # works around shells that cannot unset nonexistent variables.
    215 # Preserve -v and -x to the replacement shell.
    216 BASH_ENV=/dev/null
    217 ENV=/dev/null
    218 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
    219 case $- in # ((((
    220   *v*x* | *x*v* ) as_opts=-vx ;;
    221   *v* ) as_opts=-v ;;
    222   *x* ) as_opts=-x ;;
    223   * ) as_opts= ;;
    224 esac
    225 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
    226 # Admittedly, this is quite paranoid, since all the known shells bail
    227 # out after a failed `exec'.
    228 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
    229 exit 255
    230 fi
    231 
    232     if test x$as_have_required = xno; then :
    233   $as_echo "$0: This script requires a shell more modern than all"
    234   $as_echo "$0: the shells that I found on your system."
    235   if test x${ZSH_VERSION+set} = xset ; then
    236     $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
    237     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
    238   else
    239     $as_echo "$0: Please tell bug-autoconf (at] gnu.org about your system,
    240 $0: including any error possibly output before this
    241 $0: message. Then install a modern shell, or manually run
    242 $0: the script under such a shell if you do have one."
    243   fi
    244   exit 1
    245 fi
    246 fi
    247 fi
    248 SHELL=${CONFIG_SHELL-/bin/sh}
    249 export SHELL
    250 # Unset more variables known to interfere with behavior of common tools.
    251 CLICOLOR_FORCE= GREP_OPTIONS=
    252 unset CLICOLOR_FORCE GREP_OPTIONS
    253 
    254 ## --------------------- ##
    255 ## M4sh Shell Functions. ##
    256 ## --------------------- ##
    257 # as_fn_unset VAR
    258 # ---------------
    259 # Portably unset VAR.
    260 as_fn_unset ()
    261 {
    262   { eval $1=; unset $1;}
    263 }
    264 as_unset=as_fn_unset
    265 
    266 # as_fn_set_status STATUS
    267 # -----------------------
    268 # Set $? to STATUS, without forking.
    269 as_fn_set_status ()
    270 {
    271   return $1
    272 } # as_fn_set_status
    273 
    274 # as_fn_exit STATUS
    275 # -----------------
    276 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
    277 as_fn_exit ()
    278 {
    279   set +e
    280   as_fn_set_status $1
    281   exit $1
    282 } # as_fn_exit
    283 
    284 # as_fn_mkdir_p
    285 # -------------
    286 # Create "$as_dir" as a directory, including parents if necessary.
    287 as_fn_mkdir_p ()
    288 {
    289 
    290   case $as_dir in #(
    291   -*) as_dir=./$as_dir;;
    292   esac
    293   test -d "$as_dir" || eval $as_mkdir_p || {
    294     as_dirs=
    295     while :; do
    296       case $as_dir in #(
    297       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
    298       *) as_qdir=$as_dir;;
    299       esac
    300       as_dirs="'$as_qdir' $as_dirs"
    301       as_dir=`$as_dirname -- "$as_dir" ||
    302 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    303 	 X"$as_dir" : 'X\(//\)[^/]' \| \
    304 	 X"$as_dir" : 'X\(//\)$' \| \
    305 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
    306 $as_echo X"$as_dir" |
    307     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    308 	    s//\1/
    309 	    q
    310 	  }
    311 	  /^X\(\/\/\)[^/].*/{
    312 	    s//\1/
    313 	    q
    314 	  }
    315 	  /^X\(\/\/\)$/{
    316 	    s//\1/
    317 	    q
    318 	  }
    319 	  /^X\(\/\).*/{
    320 	    s//\1/
    321 	    q
    322 	  }
    323 	  s/.*/./; q'`
    324       test -d "$as_dir" && break
    325     done
    326     test -z "$as_dirs" || eval "mkdir $as_dirs"
    327   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
    328 
    329 
    330 } # as_fn_mkdir_p
    331 
    332 # as_fn_executable_p FILE
    333 # -----------------------
    334 # Test if FILE is an executable regular file.
    335 as_fn_executable_p ()
    336 {
    337   test -f "$1" && test -x "$1"
    338 } # as_fn_executable_p
    339 # as_fn_append VAR VALUE
    340 # ----------------------
    341 # Append the text in VALUE to the end of the definition contained in VAR. Take
    342 # advantage of any shell optimizations that allow amortized linear growth over
    343 # repeated appends, instead of the typical quadratic growth present in naive
    344 # implementations.
    345 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
    346   eval 'as_fn_append ()
    347   {
    348     eval $1+=\$2
    349   }'
    350 else
    351   as_fn_append ()
    352   {
    353     eval $1=\$$1\$2
    354   }
    355 fi # as_fn_append
    356 
    357 # as_fn_arith ARG...
    358 # ------------------
    359 # Perform arithmetic evaluation on the ARGs, and store the result in the
    360 # global $as_val. Take advantage of shells that can avoid forks. The arguments
    361 # must be portable across $(()) and expr.
    362 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
    363   eval 'as_fn_arith ()
    364   {
    365     as_val=$(( $* ))
    366   }'
    367 else
    368   as_fn_arith ()
    369   {
    370     as_val=`expr "$@" || test $? -eq 1`
    371   }
    372 fi # as_fn_arith
    373 
    374 
    375 # as_fn_error STATUS ERROR [LINENO LOG_FD]
    376 # ----------------------------------------
    377 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
    378 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
    379 # script with STATUS, using 1 if that was 0.
    380 as_fn_error ()
    381 {
    382   as_status=$1; test $as_status -eq 0 && as_status=1
    383   if test "$4"; then
    384     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    385     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
    386   fi
    387   $as_echo "$as_me: error: $2" >&2
    388   as_fn_exit $as_status
    389 } # as_fn_error
    390 
    391 if expr a : '\(a\)' >/dev/null 2>&1 &&
    392    test "X`expr 00001 : '.*\(...\)'`" = X001; then
    393   as_expr=expr
    394 else
    395   as_expr=false
    396 fi
    397 
    398 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
    399   as_basename=basename
    400 else
    401   as_basename=false
    402 fi
    403 
    404 as_me=`$as_basename -- "$0" ||
    405 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
    406 	 X"$0" : 'X\(//\)$' \| \
    407 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
    408 $as_echo X/"$0" |
    409     sed '/^.*\/\([^/][^/]*\)\/*$/{
    410 	    s//\1/
    411 	    q
    412 	  }
    413 	  /^X\/\(\/\/\)$/{
    414 	    s//\1/
    415 	    q
    416 	  }
    417 	  /^X\/\(\/\).*/{
    418 	    s//\1/
    419 	    q
    420 	  }
    421 	  s/.*/./; q'`
    422 
    423 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
    424   as_dirname=dirname
    425 else
    426   as_dirname=false
    427 fi
    428 
    429 # Avoid depending upon Character Ranges.
    430 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
    431 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    432 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
    433 as_cr_digits='0123456789'
    434 as_cr_alnum=$as_cr_Letters$as_cr_digits
    435 
    436 
    437   as_lineno_1=$LINENO as_lineno_1a=$LINENO
    438   as_lineno_2=$LINENO as_lineno_2a=$LINENO
    439   eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
    440   test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
    441   # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
    442   sed -n '
    443     p
    444     /[$]LINENO/=
    445   ' <$as_myself |
    446     sed '
    447       s/[$]LINENO.*/&-/
    448       t lineno
    449       b
    450       :lineno
    451       N
    452       :loop
    453       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
    454       t loop
    455       s/-\n.*//
    456     ' >$as_me.lineno &&
    457   chmod +x "$as_me.lineno" ||
    458     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
    459 
    460   # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
    461   # already done that, so ensure we don't try to do so again and fall
    462   # in an infinite loop.  This has already happened in practice.
    463   _as_can_reexec=no; export _as_can_reexec
    464   # Don't try to exec as it changes $[0], causing all sort of problems
    465   # (the dirname of $[0] is not the place where we might find the
    466   # original and so on.  Autoconf is especially sensitive to this).
    467   . "./$as_me.lineno"
    468   # Exit status is that of the last command.
    469   exit
    470 }
    471 
    472 ECHO_C= ECHO_N= ECHO_T=
    473 case `echo -n x` in #(((((
    474 -n*)
    475   case `echo 'xy\c'` in
    476   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
    477   xy)  ECHO_C='\c';;
    478   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
    479        ECHO_T='	';;
    480   esac;;
    481 *)
    482   ECHO_N='-n';;
    483 esac
    484 
    485 rm -f conf$$ conf$$.exe conf$$.file
    486 if test -d conf$$.dir; then
    487   rm -f conf$$.dir/conf$$.file
    488 else
    489   rm -f conf$$.dir
    490   mkdir conf$$.dir 2>/dev/null
    491 fi
    492 if (echo >conf$$.file) 2>/dev/null; then
    493   if ln -s conf$$.file conf$$ 2>/dev/null; then
    494     as_ln_s='ln -s'
    495     # ... but there are two gotchas:
    496     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    497     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    498     # In both cases, we have to default to `cp -pR'.
    499     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    500       as_ln_s='cp -pR'
    501   elif ln conf$$.file conf$$ 2>/dev/null; then
    502     as_ln_s=ln
    503   else
    504     as_ln_s='cp -pR'
    505   fi
    506 else
    507   as_ln_s='cp -pR'
    508 fi
    509 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
    510 rmdir conf$$.dir 2>/dev/null
    511 
    512 if mkdir -p . 2>/dev/null; then
    513   as_mkdir_p='mkdir -p "$as_dir"'
    514 else
    515   test -d ./-p && rmdir ./-p
    516   as_mkdir_p=false
    517 fi
    518 
    519 as_test_x='test -x'
    520 as_executable_p=as_fn_executable_p
    521 
    522 # Sed expression to map a string onto a valid CPP name.
    523 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
    524 
    525 # Sed expression to map a string onto a valid variable name.
    526 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
    527 
    528 
    529 
    530 
    531 
    532 SHELL=${CONFIG_SHELL-/bin/sh}
    533 
    534 # How were we run?
    535 at_cli_args="$@"
    536 
    537 
    538 # Not all shells have the 'times' builtin; the subshell is needed to make
    539 # sure we discard the 'times: not found' message from the shell.
    540 at_times_p=false
    541 (times) >/dev/null 2>&1 && at_times_p=:
    542 
    543 # CLI Arguments to pass to the debugging scripts.
    544 at_debug_args=
    545 # -e sets to true
    546 at_errexit_p=false
    547 # Shall we be verbose?  ':' means no, empty means yes.
    548 at_verbose=:
    549 at_quiet=
    550 # Running several jobs in parallel, 0 means as many as test groups.
    551 at_jobs=1
    552 at_traceon=:
    553 at_trace_echo=:
    554 at_check_filter_trace=:
    555 
    556 # Shall we keep the debug scripts?  Must be `:' when the suite is
    557 # run by a debug script, so that the script doesn't remove itself.
    558 at_debug_p=false
    559 # Display help message?
    560 at_help_p=false
    561 # Display the version message?
    562 at_version_p=false
    563 # List test groups?
    564 at_list_p=false
    565 # --clean
    566 at_clean=false
    567 # Test groups to run
    568 at_groups=
    569 # Whether to rerun failed tests.
    570 at_recheck=
    571 # Whether a write failure occurred
    572 at_write_fail=0
    573 
    574 # The directory we run the suite in.  Default to . if no -C option.
    575 at_dir=`pwd`
    576 # An absolute reference to this testsuite script.
    577 case $as_myself in
    578   [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
    579   * ) at_myself=$at_dir/$as_myself ;;
    580 esac
    581 # Whether -C is in effect.
    582 at_change_dir=false
    583 
    584 # Whether to enable colored test results.
    585 at_color=auto
    586 # List of the tested programs.
    587 at_tested='bison'
    588 # As many question marks as there are digits in the last test group number.
    589 # Used to normalize the test group numbers so that `ls' lists them in
    590 # numerical order.
    591 at_format='???'
    592 # Description of all the test groups.
    593 at_help_all="1;input.at:27;Invalid inputs;;
    594 2;input.at:57;Invalid inputs with {};;
    595 3;input.at:84;Invalid \$n and @n;;
    596 4;input.at:104;Type Clashes;;
    597 5;input.at:285;Unused values;;
    598 6;input.at:295;Unused values before symbol declarations;;
    599 7;input.at:305;Default %printer and %destructor redeclared;;
    600 8;input.at:365;Per-type %printer and %destructor redeclared;;
    601 9;input.at:408;Unused values with default %destructor;;
    602 10;input.at:450;Unused values with per-type %destructor;;
    603 11;input.at:475;Incompatible Aliases;;
    604 12;input.at:516;Torturing the Scanner;;
    605 13;input.at:674;Typed symbol aliases;;
    606 14;input.at:710;Require 1.0;;
    607 15;input.at:711;Require 2.7;;
    608 16;input.at:713;Require 100.0;;
    609 17;input.at:720;String aliases for character tokens;;
    610 18;input.at:741;Symbols;;
    611 19;input.at:807;Numbered tokens;;
    612 20;input.at:845;Unclosed constructs;;
    613 21;input.at:909;%start after first rule;;
    614 22;input.at:930;%prec takes a token;;
    615 23;input.at:951;%prec's token must be defined;;
    616 24;input.at:971;Reject unused %code qualifiers;;
    617 25;input.at:1060;%define errors;;
    618 26;input.at:1096;%define, --define, --force-define;;
    619 27;input.at:1161;%define Boolean variables;;
    620 28;input.at:1181;%define enum variables;;
    621 29;input.at:1216;%define backward compatibility;;
    622 30;input.at:1257;Unused %define api.pure;;
    623 31;input.at:1290;C++ namespace reference errors;;
    624 32;input.at:1346;Bad character literals;;
    625 33;input.at:1399;Bad escapes in literals;;
    626 34;input.at:1448;LAC: Errors for %define;;
    627 35;input.at:1471;-Werror is not affected by -Wnone and -Wall;;
    628 36;input.at:1505;%name-prefix and %define api.prefix are incompatible;;
    629 37;input.at:1534;Stray \$ or @;;
    630 38;input.at:1568;Code injection;;
    631 39;named-refs.at:21;Tutorial calculator;;
    632 40;named-refs.at:195;Undefined and ambiguous references;;
    633 41;named-refs.at:271;Misleading references;;
    634 42;named-refs.at:288;Many kinds of errors;;
    635 43;named-refs.at:521;Missing identifiers in brackets;;
    636 44;named-refs.at:535;Redundant words in brackets;;
    637 45;named-refs.at:549;Comments in brackets;;
    638 46;named-refs.at:563;Stray symbols in brackets;;
    639 47;named-refs.at:580;Redundant words in LHS brackets;;
    640 48;named-refs.at:595;Factored LHS;;
    641 49;named-refs.at:606;Unresolved references;;
    642 50;named-refs.at:671;\$ or @ followed by . or -;;
    643 51;output.at:44;Output files:  -dv ;;
    644 52;output.at:50;Output files:  -dv >&-;;
    645 53;output.at:55;Output files:  -dv -o foo.c ;;
    646 54;output.at:57;Output files:  -dv -o foo.tab.c ;;
    647 55;output.at:59;Output files:  -dv -y ;;
    648 56;output.at:61;Output files:  -dv -b bar ;;
    649 57;output.at:63;Output files:  -dv -g -o foo.c ;;
    650 58;output.at:67;Output files: %defines %verbose  ;;
    651 59;output.at:69;Output files: %defines %verbose %yacc  ;;
    652 60;output.at:72;Output files: %defines %verbose %yacc  ;;
    653 61;output.at:76;Output files: %file-prefix \"bar\" %defines %verbose  ;;
    654 62;output.at:78;Output files: %output=\"bar.c\" %defines %verbose %yacc  ;;
    655 63;output.at:80;Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc  ;;
    656 64;output.at:87;Output files: %defines %verbose  ;;
    657 65;output.at:90;Output files: %defines %verbose  -o foo.c ;;
    658 66;output.at:93;Output files:  --defines=foo.hpp -o foo.c++ ;;
    659 67;output.at:97;Output files: %defines \"foo.hpp\" -o foo.c++ ;;
    660 68;output.at:101;Output files:  -o foo.c++ --graph=foo.gph ;;
    661 69;output.at:116;Output files: %skeleton \"lalr1.cc\" %defines %verbose  ;;
    662 70;output.at:119;Output files: %skeleton \"lalr1.cc\" %defines %verbose  ;;
    663 71;output.at:123;Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc ;;
    664 72;output.at:128;Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\"  ;;
    665 73;output.at:158;Conflicting output files:  --graph=\"foo.tab.c\";;
    666 74;output.at:163;Conflicting output files: %defines \"foo.output\" -v;;
    667 75;output.at:168;Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\";;
    668 76;output.at:173;Conflicting output files:  -o foo.y;;
    669 77;output.at:219;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++;
    670 78;output.at:226;Output file name: (;c++;
    671 79;output.at:227;Output file name: );c++;
    672 80;output.at:228;Output file name: #;c++;
    673 81;output.at:229;Output file name: @@;c++;
    674 82;output.at:230;Output file name: @{;c++;
    675 83;output.at:231;Output file name: @};c++;
    676 84;output.at:232;Output file name: [;c++;
    677 85;output.at:233;Output file name: ];c++;
    678 86;output.at:260;Graph with no conflicts;graph;
    679 87;output.at:294;Graph with unsolved S/R;graph;
    680 88;output.at:358;Graph with solved S/R;graph;
    681 89;output.at:417;Graph with R/R;graph;
    682 90;output.at:449;Graph with reductions with multiple LAT;graph;
    683 91;output.at:508;Graph with a reduction rule both enabled and disabled;graph;
    684 92;skeletons.at:24;Relative skeleton file names;;
    685 93;skeletons.at:84;Installed skeleton file names;;
    686 94;skeletons.at:146;%define Boolean variables: invalid skeleton defaults;;
    687 95;skeletons.at:170;Complaining during macro argument expansion;;
    688 96;skeletons.at:252;Fatal errors make M4 exit immediately;;
    689 97;skeletons.at:306;Fatal errors but M4 continues producing output;;
    690 98;sets.at:66;Nullable;;
    691 99;sets.at:151;Broken Closure;;
    692 100;sets.at:193;Firsts;;
    693 101;sets.at:269;Accept;;
    694 102;reduce.at:25;Useless Terminals;;
    695 103;reduce.at:69;Useless Nonterminals;;
    696 104;reduce.at:124;Useless Rules;report;
    697 105;reduce.at:271;Reduced Automaton;report;
    698 106;reduce.at:381;Underivable Rules;report;
    699 107;reduce.at:423;Empty Language;;
    700 108;reduce.at:474;no %define lr.type: Single State Split;;
    701 109;reduce.at:474;%define lr.type lalr: Single State Split;;
    702 110;reduce.at:474;%define lr.type ielr: Single State Split;;
    703 111;reduce.at:474;%define lr.type canonical-lr: Single State Split;;
    704 112;reduce.at:707;no %define lr.type: Lane Split;;
    705 113;reduce.at:707;%define lr.type lalr: Lane Split;;
    706 114;reduce.at:707;%define lr.type ielr: Lane Split;;
    707 115;reduce.at:707;%define lr.type canonical-lr: Lane Split;;
    708 116;reduce.at:951;no %define lr.type: Complex Lane Split;;
    709 117;reduce.at:951;%define lr.type lalr: Complex Lane Split;;
    710 118;reduce.at:951;%define lr.type ielr: Complex Lane Split;;
    711 119;reduce.at:951;%define lr.type canonical-lr: Complex Lane Split;;
    712 120;reduce.at:1220;no %define lr.type: Split During Added Lookahead Propagation;;
    713 121;reduce.at:1220;%define lr.type lalr: Split During Added Lookahead Propagation;;
    714 122;reduce.at:1220;%define lr.type ielr: Split During Added Lookahead Propagation;;
    715 123;reduce.at:1220;%define lr.type canonical-lr: Split During Added Lookahead Propagation;;
    716 124;reduce.at:1550;no %define lr.default-reductions;;
    717 125;reduce.at:1550;%define lr.default-reductions most;;
    718 126;reduce.at:1550;%define lr.default-reductions consistent;;
    719 127;reduce.at:1550;%define lr.default-reductions accepting;;
    720 128;synclines.at:150;Prologue syncline;;
    721 129;synclines.at:168;%union syncline;;
    722 130;synclines.at:189;Postprologue syncline;;
    723 131;synclines.at:213;Action syncline;;
    724 132;synclines.at:232;Epilogue syncline;;
    725 133;synclines.at:249;%code top syncline;;
    726 134;synclines.at:290;%no-lines;;
    727 135;synclines.at:291;%no-lines;;
    728 136;synclines.at:292;%no-lines;;
    729 137;synclines.at:293;%no-lines;;
    730 138;headers.at:57;Invalid CPP guards:  --defines=input/input.h;;
    731 139;headers.at:58;Invalid CPP guards:  --defines=9foo.h;;
    732 140;headers.at:59;Invalid CPP guards: %glr-parser --defines=input/input.h;;
    733 141;headers.at:60;Invalid CPP guards: %glr-parser --defines=9foo.h;;
    734 142;headers.at:69;export YYLTYPE;;
    735 143;headers.at:125;Several parsers;c++;
    736 144;actions.at:24;Mid-rule actions;;
    737 145;actions.at:133;Initial location: yacc.c ;;
    738 146;actions.at:134;Initial location: yacc.c %define api.pure full;;
    739 147;actions.at:135;Initial location: yacc.c %define api.pure %parse-param { int x };;
    740 148;actions.at:136;Initial location: yacc.c %define api.push-pull both;;
    741 149;actions.at:137;Initial location: yacc.c %define api.push-pull both %define api.pure full;;
    742 150;actions.at:138;Initial location: glr.c ;;
    743 151;actions.at:139;Initial location: glr.c %define api.pure;;
    744 152;actions.at:140;Initial location: lalr1.cc ;c++;
    745 153;actions.at:141;Initial location: glr.cc ;c++;
    746 154;actions.at:150;Initial location: yacc.c %define api.pure full;;
    747 155;actions.at:161;Initial location: yacc.c %define api.pure full;;
    748 156;actions.at:244;Location print: yacc.c ;;
    749 157;actions.at:245;Location print: glr.c ;;
    750 158;actions.at:257;Exotic Dollars;;
    751 159;actions.at:751;Printers and Destructors;;
    752 160;actions.at:752;Printers and Destructors with union;;
    753 161;actions.at:754;Printers and Destructors: %defines %skeleton \"lalr1.cc\";c++;
    754 162;actions.at:755;Printers and Destructors with union: %defines %skeleton \"lalr1.cc\";c++;
    755 163;actions.at:757;Printers and Destructors: %glr-parser;;
    756 164;actions.at:758;Printers and Destructors with union: %glr-parser;;
    757 165;actions.at:769;Default tagless %printer and %destructor;;
    758 166;actions.at:867;Default tagged and per-type %printer and %destructor;;
    759 167;actions.at:991;Default %printer and %destructor for user-defined end token;;
    760 168;actions.at:1098;Default %printer and %destructor are not for error or \$undefined;;
    761 169;actions.at:1193;Default %printer and %destructor are not for \$accept;;
    762 170;actions.at:1258;Default %printer and %destructor for mid-rule values;;
    763 171;actions.at:1406;@\$ in %initial-action implies %locations;;
    764 172;actions.at:1407;@\$ in %destructor implies %locations;;
    765 173;actions.at:1408;@\$ in %printer implies %locations;;
    766 174;actions.at:1529;Qualified \$\$ in actions: yacc.c;;
    767 175;actions.at:1530;Qualified \$\$ in actions: glr.c;;
    768 176;actions.at:1531;Qualified \$\$ in actions: lalr1.cc;c++;
    769 177;actions.at:1532;Qualified \$\$ in actions: glr.cc;c++;
    770 178;actions.at:1540;Fix user actions without a trailing semicolon;;
    771 179;actions.at:1649;Destroying lookahead assigned by semantic action;;
    772 180;actions.at:1708;YYBACKUP;;
    773 181;conflicts.at:31;S/R in initial;;
    774 182;conflicts.at:57;%nonassoc and eof;;
    775 183;conflicts.at:155;%error-verbose and consistent errors;c++ java;
    776 184;conflicts.at:456;LAC: %nonassoc requires splitting canonical LR states;;
    777 185;conflicts.at:546;Unresolved SR Conflicts;report;
    778 186;conflicts.at:653;Resolved SR Conflicts;report;
    779 187;conflicts.at:775;Defaulted Conflicted Reduction;report;
    780 188;conflicts.at:894;%expect not enough;;
    781 189;conflicts.at:914;%expect right;;
    782 190;conflicts.at:931;%expect too much;;
    783 191;conflicts.at:951;%expect with reduce conflicts;;
    784 192;conflicts.at:971;%prec with user string;;
    785 193;conflicts.at:988;%no-default-prec without %prec;;
    786 194;conflicts.at:1014;%no-default-prec with %prec;;
    787 195;conflicts.at:1038;%default-prec;;
    788 196;conflicts.at:1062;Unreachable States After Conflict Resolution;;
    789 197;conflicts.at:1273;Solved conflicts report for multiple reductions in a state;;
    790 198;conflicts.at:1353;%nonassoc error actions for multiple reductions in a state;;
    791 199;conflicts.at:1422;-W versus %expect and %expect-rr;;
    792 200;calc.at:597;Calculator ;;
    793 201;calc.at:599;Calculator %defines;;
    794 202;calc.at:600;Calculator %locations;;
    795 203;calc.at:602;Calculator %name-prefix=\"calc\";;
    796 204;calc.at:603;Calculator %verbose;;
    797 205;calc.at:604;Calculator %yacc;;
    798 206;calc.at:605;Calculator %error-verbose;;
    799 207;calc.at:607;Calculator %define api.pure full %locations;;
    800 208;calc.at:608;Calculator %define api.push-pull both %define api.pure full %locations;;
    801 209;calc.at:609;Calculator %error-verbose %locations;;
    802 210;calc.at:611;Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;;
    803 211;calc.at:612;Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
    804 212;calc.at:614;Calculator %debug;;
    805 213;calc.at:615;Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
    806 214;calc.at:616;Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
    807 215;calc.at:618;Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
    808 216;calc.at:619;Calculator %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
    809 217;calc.at:621;Calculator %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
    810 218;calc.at:638;Calculator %glr-parser ;;
    811 219;calc.at:640;Calculator %glr-parser %defines;;
    812 220;calc.at:641;Calculator %glr-parser %locations;;
    813 221;calc.at:642;Calculator %glr-parser %name-prefix \"calc\";;
    814 222;calc.at:643;Calculator %glr-parser %define api.prefix \"calc\";;
    815 223;calc.at:644;Calculator %glr-parser %verbose;;
    816 224;calc.at:645;Calculator %glr-parser %yacc;;
    817 225;calc.at:646;Calculator %glr-parser %error-verbose;;
    818 226;calc.at:648;Calculator %glr-parser %define api.pure %locations;;
    819 227;calc.at:649;Calculator %glr-parser %error-verbose %locations;;
    820 228;calc.at:651;Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;;
    821 229;calc.at:653;Calculator %glr-parser %debug;;
    822 230;calc.at:654;Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
    823 231;calc.at:655;Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc;;
    824 232;calc.at:657;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
    825 233;calc.at:659;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
    826 234;calc.at:660;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
    827 235;calc.at:670;Calculator %skeleton \"lalr1.cc\" %defines %locations;c++;
    828 236;calc.at:679;Calculator %language \"C++\" %defines %locations ;c++;
    829 237;calc.at:680;Calculator %language \"C++\" %defines %locations %define api.location.type Span;c++;
    830 238;calc.at:681;Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++;
    831 239;calc.at:682;Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc;c++;
    832 240;calc.at:683;Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
    833 241;calc.at:685;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc;c++;
    834 242;calc.at:687;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
    835 243;calc.at:688;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
    836 244;calc.at:699;Calculator %skeleton \"glr.cc\" %defines %locations;c++;
    837 245;calc.at:708;Calculator %language \"C++\" %glr-parser %defines %locations ;c++;
    838 246;calc.at:709;Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span;c++;
    839 247;calc.at:710;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++;
    840 248;calc.at:711;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc;c++;
    841 249;calc.at:713;Calculator %language \"C++\" %glr-parser %defines %locations %debug;c++;
    842 250;calc.at:714;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
    843 251;calc.at:716;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
    844 252;calc.at:718;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
    845 253;calc.at:719;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
    846 254;torture.at:137;Big triangle;;
    847 255;torture.at:227;Big horizontal;;
    848 256;torture.at:364;Many lookahead tokens;;
    849 257;torture.at:466;Exploding the Stack Size with Alloca;;
    850 258;torture.at:512;Exploding the Stack Size with Malloc;;
    851 259;existing.at:79;GNU AWK 3.1.0 Grammar: LALR(1);;
    852 260;existing.at:79;GNU AWK 3.1.0 Grammar: IELR(1);;
    853 261;existing.at:79;GNU AWK 3.1.0 Grammar: Canonical LR(1);;
    854 262;existing.at:783;GNU Cim Grammar: LALR(1);;
    855 263;existing.at:783;GNU Cim Grammar: IELR(1);;
    856 264;existing.at:783;GNU Cim Grammar: Canonical LR(1);;
    857 265;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: LALR(1);;
    858 266;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: IELR(1);;
    859 267;existing.at:1403;GNU pic (Groff 1.18.1) Grammar: Canonical LR(1);;
    860 268;regression.at:25;Trivial grammars;;
    861 269;regression.at:55;YYSTYPE typedef;;
    862 270;regression.at:85;Early token definitions with --yacc;;
    863 271;regression.at:125;Early token definitions without --yacc;;
    864 272;regression.at:170;Braces parsing;;
    865 273;regression.at:194;Duplicate string;;
    866 274;regression.at:222;Rule Line Numbers;report;
    867 275;regression.at:368;Mixing %token styles;;
    868 276;regression.at:391;Invalid inputs;;
    869 277;regression.at:418;Invalid inputs with {};;
    870 278;regression.at:443;Token definitions;;
    871 279;regression.at:511;Characters Escapes;;
    872 280;regression.at:544;Web2c Report;report;
    873 281;regression.at:721;Web2c Actions;report;
    874 282;regression.at:936;Dancer ;;
    875 283;regression.at:937;Dancer %glr-parser;;
    876 284;regression.at:938;Dancer %skeleton \"lalr1.cc\";c++;
    877 285;regression.at:1020;Expecting two tokens ;;
    878 286;regression.at:1021;Expecting two tokens %glr-parser;;
    879 287;regression.at:1022;Expecting two tokens %skeleton \"lalr1.cc\";c++;
    880 288;regression.at:1030;Braced code in declaration in rules section;;
    881 289;regression.at:1097;String alias declared after use;;
    882 290;regression.at:1120;Extra lookahead sets in report;;
    883 291;regression.at:1161;Token number in precedence declaration;;
    884 292;regression.at:1219;parse-gram.y: LALR = IELR;;
    885 293;regression.at:1240;%error-verbose and YYSTACK_USE_ALLOCA;;
    886 294;regression.at:1319;%error-verbose overflow;;
    887 295;regression.at:1429;LAC: Exploratory stack;;
    888 296;regression.at:1523;LAC: Memory exhaustion;;
    889 297;regression.at:1664;Lex and parse params: yacc.c;;
    890 298;regression.at:1665;Lex and parse params: glr.c;;
    891 299;regression.at:1666;Lex and parse params: lalr1.cc;c++;
    892 300;regression.at:1667;Lex and parse params: glr.cc;c++;
    893 301;c++.at:101;Doxygen Public Documentation;;
    894 302;c++.at:102;Doxygen Private Documentation;;
    895 303;c++.at:160;Relative namespace references;c++;
    896 304;c++.at:166;Absolute namespace references;c++;
    897 305;c++.at:175;Syntactically invalid namespace references;;
    898 306;c++.at:190;Exception safety;c++;
    899 307;java.at:360;Calculator ;java;
    900 308;java.at:360;Calculator %error-verbose ;java;
    901 309;java.at:360;Calculator %locations ;java;
    902 310;java.at:360;Calculator %error-verbose %locations ;java;
    903 311;java.at:369;Calculator %lex-param { InputStream is } ;java;
    904 312;java.at:369;Calculator %error-verbose %lex-param { InputStream is } ;java;
    905 313;java.at:369;Calculator %locations %lex-param { InputStream is } ;java;
    906 314;java.at:369;Calculator %error-verbose %locations %lex-param { InputStream is } ;java;
    907 315;java.at:455;Java parser class and package names;java;
    908 316;java.at:476;Java parser class modifiers;java;
    909 317;java.at:534;Java parser class extends and implements;java;
    910 318;java.at:554;Java %parse-param and %lex-param;java;
    911 319;java.at:628;Java throws specifications;java;
    912 320;java.at:717;Java stype, position_class and location_class;java;
    913 321;java.at:748;Java syntax error handling without error token;java;
    914 322;cxx-type.at:394;GLR: Resolve ambiguity, impure, no locations;;
    915 323;cxx-type.at:401;GLR: Resolve ambiguity, impure, locations;;
    916 324;cxx-type.at:407;GLR: Resolve ambiguity, pure, no locations;;
    917 325;cxx-type.at:414;GLR: Resolve ambiguity, pure, locations;;
    918 326;cxx-type.at:421;GLR: Merge conflicting parses, impure, no locations;;
    919 327;cxx-type.at:428;GLR: Merge conflicting parses, impure, locations;;
    920 328;cxx-type.at:435;GLR: Merge conflicting parses, pure, no locations;;
    921 329;cxx-type.at:441;GLR: Merge conflicting parses, pure, locations;;
    922 330;cxx-type.at:448;GLR: Verbose messages, resolve ambiguity, impure, no locations;;
    923 331;glr-regression.at:25;Badly Collapsed GLR States;;
    924 332;glr-regression.at:112;Improper handling of embedded actions and dollar(-N) in GLR parsers;;
    925 333;glr-regression.at:244;Improper merging of GLR delayed action sets;;
    926 334;glr-regression.at:364;Duplicate representation of merged trees;;
    927 335;glr-regression.at:455;User destructor for unresolved GLR semantic value;;
    928 336;glr-regression.at:515;User destructor after an error during a split parse;;
    929 337;glr-regression.at:569;Duplicated user destructor for lookahead;;
    930 338;glr-regression.at:658;Incorrectly initialized location for empty right-hand side in GLR;;
    931 339;glr-regression.at:752;No users destructors if stack 0 deleted;;
    932 340;glr-regression.at:829;Corrupted semantic options if user action cuts parse;;
    933 341;glr-regression.at:883;Undesirable destructors if user action cuts parse;;
    934 342;glr-regression.at:941;Leaked semantic values if user action cuts parse;;
    935 343;glr-regression.at:1064;Incorrect lookahead during deterministic GLR;;
    936 344;glr-regression.at:1188;Incorrect lookahead during nondeterministic GLR;;
    937 345;glr-regression.at:1405;Leaked semantic values when reporting ambiguity;;
    938 346;glr-regression.at:1487;Leaked lookahead after nondeterministic parse syntax error;;
    939 347;glr-regression.at:1547;Uninitialized location when reporting ambiguity;;
    940 348;glr-regression.at:1625;Missed %merge type warnings when LHS type is declared later;;
    941 349;glr-regression.at:1678;Ambiguity reports;;
    942 350;push.at:24;Memory Leak for Early Deletion;;
    943 351;push.at:83;Multiple impure instances;;
    944 352;push.at:144;Unsupported Skeletons;;
    945 "
    946 # List of the all the test groups.
    947 at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
    948 
    949 # at_fn_validate_ranges NAME...
    950 # -----------------------------
    951 # Validate and normalize the test group number contained in each variable
    952 # NAME. Leading zeroes are treated as decimal.
    953 at_fn_validate_ranges ()
    954 {
    955   for at_grp
    956   do
    957     eval at_value=\$$at_grp
    958     if test $at_value -lt 1 || test $at_value -gt 352; then
    959       $as_echo "invalid test group: $at_value" >&2
    960       exit 1
    961     fi
    962     case $at_value in
    963       0*) # We want to treat leading 0 as decimal, like expr and test, but
    964 	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
    965 	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
    966 	  # expr fork, but it is not worth the effort to determine if the
    967 	  # shell supports XSI when the user can just avoid leading 0.
    968 	  eval $at_grp='`expr $at_value + 0`' ;;
    969     esac
    970   done
    971 }
    972 
    973 ##
    974 ## Set up package specific options.
    975 ##
    976 
    977 at_arg_compile_c_with_cxx=false
    978 at_arg_given_compile_c_with_cxx=false
    979 
    980 
    981 at_prev=
    982 for at_option
    983 do
    984   # If the previous option needs an argument, assign it.
    985   if test -n "$at_prev"; then
    986     at_option=$at_prev=$at_option
    987     at_prev=
    988   fi
    989 
    990   case $at_option in
    991   *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
    992   *)    at_optarg= ;;
    993   esac
    994 
    995   # Accept the important Cygnus configure options, so we can diagnose typos.
    996 
    997   case $at_option in
    998     --help | -h )
    999 	at_help_p=:
   1000 	;;
   1001 
   1002     --list | -l )
   1003 	at_list_p=:
   1004 	;;
   1005 
   1006     --version | -V )
   1007 	at_version_p=:
   1008 	;;
   1009 
   1010     --clean | -c )
   1011 	at_clean=:
   1012 	;;
   1013 
   1014     --color )
   1015 	at_color=always
   1016 	;;
   1017     --color=* )
   1018 	case $at_optarg in
   1019 	no | never | none) at_color=never ;;
   1020 	auto | tty | if-tty) at_color=auto ;;
   1021 	always | yes | force) at_color=always ;;
   1022 	*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
   1023 	   as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
   1024 	esac
   1025 	;;
   1026 
   1027     --debug | -d )
   1028 	at_debug_p=:
   1029 	;;
   1030 
   1031     --errexit | -e )
   1032 	at_debug_p=:
   1033 	at_errexit_p=:
   1034 	;;
   1035 
   1036     --verbose | -v )
   1037 	at_verbose=; at_quiet=:
   1038 	;;
   1039 
   1040     --trace | -x )
   1041 	at_traceon='set -x'
   1042 	at_trace_echo=echo
   1043 	at_check_filter_trace=at_fn_filter_trace
   1044 	;;
   1045 
   1046     [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
   1047 	at_fn_validate_ranges at_option
   1048 	as_fn_append at_groups "$at_option$as_nl"
   1049 	;;
   1050 
   1051     # Ranges
   1052     [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
   1053 	at_range_start=`echo $at_option |tr -d X-`
   1054 	at_fn_validate_ranges at_range_start
   1055 	at_range=`$as_echo "$at_groups_all" | \
   1056 	  sed -ne '/^'$at_range_start'$/,$p'`
   1057 	as_fn_append at_groups "$at_range$as_nl"
   1058 	;;
   1059 
   1060     -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
   1061 	at_range_end=`echo $at_option |tr -d X-`
   1062 	at_fn_validate_ranges at_range_end
   1063 	at_range=`$as_echo "$at_groups_all" | \
   1064 	  sed -ne '1,/^'$at_range_end'$/p'`
   1065 	as_fn_append at_groups "$at_range$as_nl"
   1066 	;;
   1067 
   1068     [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
   1069     [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
   1070     [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
   1071     [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
   1072     [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
   1073     [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
   1074 	at_range_start=`expr $at_option : '\(.*\)-'`
   1075 	at_range_end=`expr $at_option : '.*-\(.*\)'`
   1076 	if test $at_range_start -gt $at_range_end; then
   1077 	  at_tmp=$at_range_end
   1078 	  at_range_end=$at_range_start
   1079 	  at_range_start=$at_tmp
   1080 	fi
   1081 	at_fn_validate_ranges at_range_start at_range_end
   1082 	at_range=`$as_echo "$at_groups_all" | \
   1083 	  sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
   1084 	as_fn_append at_groups "$at_range$as_nl"
   1085 	;;
   1086 
   1087     # Directory selection.
   1088     --directory | -C )
   1089 	at_prev=--directory
   1090 	;;
   1091     --directory=* )
   1092 	at_change_dir=:
   1093 	at_dir=$at_optarg
   1094 	if test x- = "x$at_dir" ; then
   1095 	  at_dir=./-
   1096 	fi
   1097 	;;
   1098 
   1099     # Parallel execution.
   1100     --jobs | -j )
   1101 	at_jobs=0
   1102 	;;
   1103     --jobs=* | -j[0-9]* )
   1104 	if test -n "$at_optarg"; then
   1105 	  at_jobs=$at_optarg
   1106 	else
   1107 	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
   1108 	fi
   1109 	case $at_jobs in *[!0-9]*)
   1110 	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
   1111 	  as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
   1112 	esac
   1113 	;;
   1114 
   1115     # Keywords.
   1116     --keywords | -k )
   1117 	at_prev=--keywords
   1118 	;;
   1119     --keywords=* )
   1120 	at_groups_selected=$at_help_all
   1121 	at_save_IFS=$IFS
   1122 	IFS=,
   1123 	set X $at_optarg
   1124 	shift
   1125 	IFS=$at_save_IFS
   1126 	for at_keyword
   1127 	do
   1128 	  at_invert=
   1129 	  case $at_keyword in
   1130 	  '!'*)
   1131 	    at_invert="-v"
   1132 	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
   1133 	    ;;
   1134 	  esac
   1135 	  # It is on purpose that we match the test group titles too.
   1136 	  at_groups_selected=`$as_echo "$at_groups_selected" |
   1137 	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
   1138 	done
   1139 	# Smash the keywords.
   1140 	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'`
   1141 	as_fn_append at_groups "$at_groups_selected$as_nl"
   1142 	;;
   1143     --recheck)
   1144 	at_recheck=:
   1145 	;;
   1146     --compile-c-with-cxx )
   1147 	at_optarg=:
   1148 	at_arg_compile_c_with_cxx=:
   1149 	at_arg_given_compile_c_with_cxx=:
   1150 		;;
   1151     --no-compile-c-with-cxx )
   1152 	at_optarg=false
   1153 	at_arg_compile_c_with_cxx=false
   1154 	at_arg_given_compile_c_with_cxx=:
   1155 		;;
   1156 
   1157 
   1158     *=*)
   1159 	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
   1160 	# Reject names that are not valid shell variable names.
   1161 	case $at_envvar in
   1162 	  '' | [0-9]* | *[!_$as_cr_alnum]* )
   1163 	    as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
   1164 	esac
   1165 	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
   1166 	# Export now, but save eval for later and for debug scripts.
   1167 	export $at_envvar
   1168 	as_fn_append at_debug_args " $at_envvar='$at_value'"
   1169 	;;
   1170 
   1171      *) $as_echo "$as_me: invalid option: $at_option" >&2
   1172 	$as_echo "Try \`$0 --help' for more information." >&2
   1173 	exit 1
   1174 	;;
   1175   esac
   1176 done
   1177 
   1178 # Verify our last option didn't require an argument
   1179 if test -n "$at_prev"; then :
   1180   as_fn_error $? "\`$at_prev' requires an argument"
   1181 fi
   1182 
   1183 # The file containing the suite.
   1184 at_suite_log=$at_dir/$as_me.log
   1185 
   1186 # Selected test groups.
   1187 if test -z "$at_groups$at_recheck"; then
   1188   at_groups=$at_groups_all
   1189 else
   1190   if test -n "$at_recheck" && test -r "$at_suite_log"; then
   1191     at_oldfails=`sed -n '
   1192       /^Failed tests:$/,/^Skipped tests:$/{
   1193 	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
   1194       }
   1195       /^Unexpected passes:$/,/^## Detailed failed tests/{
   1196 	s/^[ ]*\([1-9][0-9]*\):.*/\1/p
   1197       }
   1198       /^## Detailed failed tests/q
   1199       ' "$at_suite_log"`
   1200     as_fn_append at_groups "$at_oldfails$as_nl"
   1201   fi
   1202   # Sort the tests, removing duplicates.
   1203   at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'`
   1204 fi
   1205 
   1206 if test x"$at_color" = xalways \
   1207    || { test x"$at_color" = xauto && test -t 1; }; then
   1208   at_red=`printf '\033[0;31m'`
   1209   at_grn=`printf '\033[0;32m'`
   1210   at_lgn=`printf '\033[1;32m'`
   1211   at_blu=`printf '\033[1;34m'`
   1212   at_std=`printf '\033[m'`
   1213 else
   1214   at_red= at_grn= at_lgn= at_blu= at_std=
   1215 fi
   1216 
   1217 # Help message.
   1218 if $at_help_p; then
   1219   cat <<_ATEOF || at_write_fail=1
   1220 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
   1221 
   1222 Run all the tests, or the selected TESTS, given by numeric ranges, and
   1223 save a detailed log file.  Upon failure, create debugging scripts.
   1224 
   1225 Do not change environment variables directly.  Instead, set them via
   1226 command line arguments.  Set \`AUTOTEST_PATH' to select the executables
   1227 to exercise.  Each relative directory is expanded as build and source
   1228 directories relative to the top level of this distribution.
   1229 E.g., from within the build directory /tmp/foo-1.0, invoking this:
   1230 
   1231   $ $0 AUTOTEST_PATH=bin
   1232 
   1233 is equivalent to the following, assuming the source directory is /src/foo-1.0:
   1234 
   1235   PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
   1236 _ATEOF
   1237 cat <<_ATEOF || at_write_fail=1
   1238 
   1239 Operation modes:
   1240   -h, --help     print the help message, then exit
   1241   -V, --version  print version number, then exit
   1242   -c, --clean    remove all the files this test suite might create and exit
   1243   -l, --list     describes all the tests, or the selected TESTS
   1244 _ATEOF
   1245 cat <<_ATEOF || at_write_fail=1
   1246 
   1247 Execution tuning:
   1248   -C, --directory=DIR
   1249                  change to directory DIR before starting
   1250       --color[=never|auto|always]
   1251                  disable colored test results, or enable even without terminal
   1252   -j, --jobs[=N]
   1253                  Allow N jobs at once; infinite jobs with no arg (default 1)
   1254   -k, --keywords=KEYWORDS
   1255                  select the tests matching all the comma-separated KEYWORDS
   1256                  multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
   1257       --recheck  select all tests that failed or passed unexpectedly last time
   1258   -e, --errexit  abort as soon as a test fails; implies --debug
   1259   -v, --verbose  force more detailed output
   1260                  default for debugging scripts
   1261   -d, --debug    inhibit clean up and top-level logging
   1262                  default for debugging scripts
   1263   -x, --trace    enable tests shell tracing
   1264 _ATEOF
   1265 cat <<_ATEOF || at_write_fail=1
   1266 
   1267 Other options:
   1268 _ATEOF
   1269 
   1270 cat <<_ATEOF || at_write_fail=1
   1271 compile C parsers with the C++ compiler
   1272 _ATEOF
   1273 cat <<_ATEOF || at_write_fail=1
   1274 
   1275 Report bugs to <bug-bison@gnu.org>.
   1276 General help using GNU software: <http://www.gnu.org/gethelp/>.
   1277 _ATEOF
   1278   exit $at_write_fail
   1279 fi
   1280 
   1281 # List of tests.
   1282 if $at_list_p; then
   1283   cat <<_ATEOF || at_write_fail=1
   1284 GNU Bison 2.7 test suite test groups:
   1285 
   1286  NUM: FILE-NAME:LINE     TEST-GROUP-NAME
   1287       KEYWORDS
   1288 
   1289 _ATEOF
   1290   # Pass an empty line as separator between selected groups and help.
   1291   $as_echo "$at_groups$as_nl$as_nl$at_help_all" |
   1292     awk 'NF == 1 && FS != ";" {
   1293 	   selected[$ 1] = 1
   1294 	   next
   1295 	 }
   1296 	 /^$/ { FS = ";" }
   1297 	 NF > 0 {
   1298 	   if (selected[$ 1]) {
   1299 	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
   1300 	     if ($ 4) {
   1301 	       lmax = 79
   1302 	       indent = "     "
   1303 	       line = indent
   1304 	       len = length (line)
   1305 	       n = split ($ 4, a, " ")
   1306 	       for (i = 1; i <= n; i++) {
   1307 		 l = length (a[i]) + 1
   1308 		 if (i > 1 && len + l > lmax) {
   1309 		   print line
   1310 		   line = indent " " a[i]
   1311 		   len = length (line)
   1312 		 } else {
   1313 		   line = line " " a[i]
   1314 		   len += l
   1315 		 }
   1316 	       }
   1317 	       if (n)
   1318 		 print line
   1319 	     }
   1320 	   }
   1321 	 }' || at_write_fail=1
   1322   exit $at_write_fail
   1323 fi
   1324 if $at_version_p; then
   1325   $as_echo "$as_me (GNU Bison 2.7)" &&
   1326   cat <<\_ATEOF || at_write_fail=1
   1327 
   1328 Copyright (C) 2012 Free Software Foundation, Inc.
   1329 This test suite is free software; the Free Software Foundation gives
   1330 unlimited permission to copy, distribute and modify it.
   1331 _ATEOF
   1332   exit $at_write_fail
   1333 fi
   1334 
   1335 # Should we print banners?  Yes if more than one test is run.
   1336 case $at_groups in #(
   1337   *$as_nl* )
   1338       at_print_banners=: ;; #(
   1339   * ) at_print_banners=false ;;
   1340 esac
   1341 # Text for banner N, set to a single space once printed.
   1342 # Banner 1. input.at:18
   1343 # Category starts at test group 1.
   1344 at_banner_text_1="Input Processing."
   1345 # Banner 2. named-refs.at:19
   1346 # Category starts at test group 39.
   1347 at_banner_text_2="Named references tests."
   1348 # Banner 3. output.at:18
   1349 # Category starts at test group 51.
   1350 at_banner_text_3="Output file names."
   1351 # Banner 4. skeletons.at:18
   1352 # Category starts at test group 92.
   1353 at_banner_text_4="Skeleton Support."
   1354 # Banner 5. sets.at:59
   1355 # Category starts at test group 98.
   1356 at_banner_text_5="Grammar Sets (Firsts etc.)."
   1357 # Banner 6. reduce.at:18
   1358 # Category starts at test group 102.
   1359 at_banner_text_6="Grammar Reduction."
   1360 # Banner 7. synclines.at:19
   1361 # Category starts at test group 128.
   1362 at_banner_text_7="User Actions."
   1363 # Banner 8. headers.at:19
   1364 # Category starts at test group 138.
   1365 at_banner_text_8="Parser Headers."
   1366 # Banner 9. actions.at:18
   1367 # Category starts at test group 144.
   1368 at_banner_text_9="User Actions."
   1369 # Banner 10. conflicts.at:19
   1370 # Category starts at test group 181.
   1371 at_banner_text_10="Conflicts."
   1372 # Banner 11. calc.at:588
   1373 # Category starts at test group 200.
   1374 at_banner_text_11="Simple LALR(1) Calculator."
   1375 # Banner 12. calc.at:628
   1376 # Category starts at test group 218.
   1377 at_banner_text_12="Simple GLR Calculator."
   1378 # Banner 13. calc.at:667
   1379 # Category starts at test group 235.
   1380 at_banner_text_13="Simple LALR(1) C++ Calculator."
   1381 # Banner 14. calc.at:696
   1382 # Category starts at test group 244.
   1383 at_banner_text_14="Simple GLR C++ Calculator."
   1384 # Banner 15. torture.at:19
   1385 # Category starts at test group 254.
   1386 at_banner_text_15="Torture Tests."
   1387 # Banner 16. existing.at:19
   1388 # Category starts at test group 259.
   1389 at_banner_text_16="Existing Grammars."
   1390 # Banner 17. regression.at:18
   1391 # Category starts at test group 268.
   1392 at_banner_text_17="Regression tests."
   1393 # Banner 18. c++.at:19
   1394 # Category starts at test group 301.
   1395 at_banner_text_18="C++ Features."
   1396 # Banner 19. java.at:18
   1397 # Category starts at test group 307.
   1398 at_banner_text_19="Java Calculator."
   1399 # Banner 20. java.at:382
   1400 # Category starts at test group 315.
   1401 at_banner_text_20="Java Parameters."
   1402 # Banner 21. cxx-type.at:18
   1403 # Category starts at test group 322.
   1404 at_banner_text_21="C++ Type Syntax (GLR)."
   1405 # Banner 22. glr-regression.at:19
   1406 # Category starts at test group 331.
   1407 at_banner_text_22="GLR Regression Tests"
   1408 # Banner 23. push.at:18
   1409 # Category starts at test group 350.
   1410 at_banner_text_23="Push Parsing Tests"
   1411 
   1412 # Take any -C into account.
   1413 if $at_change_dir ; then
   1414   test x != "x$at_dir" && cd "$at_dir" \
   1415     || as_fn_error $? "unable to change directory"
   1416   at_dir=`pwd`
   1417 fi
   1418 
   1419 # Load the config files for any default variable assignments.
   1420 for at_file in atconfig atlocal
   1421 do
   1422   test -r $at_file || continue
   1423   . ./$at_file || as_fn_error $? "invalid content: $at_file"
   1424 done
   1425 
   1426 # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
   1427 : "${at_top_build_prefix=$at_top_builddir}"
   1428 
   1429 # Perform any assignments requested during argument parsing.
   1430 eval "$at_debug_args"
   1431 
   1432 # atconfig delivers names relative to the directory the test suite is
   1433 # in, but the groups themselves are run in testsuite-dir/group-dir.
   1434 if test -n "$at_top_srcdir"; then
   1435   builddir=../..
   1436   for at_dir_var in srcdir top_srcdir top_build_prefix
   1437   do
   1438     eval at_val=\$at_$at_dir_var
   1439     case $at_val in
   1440       [\\/$]* | ?:[\\/]* ) at_prefix= ;;
   1441       *) at_prefix=../../ ;;
   1442     esac
   1443     eval "$at_dir_var=\$at_prefix\$at_val"
   1444   done
   1445 fi
   1446 
   1447 ## -------------------- ##
   1448 ## Directory structure. ##
   1449 ## -------------------- ##
   1450 
   1451 # This is the set of directories and files used by this script
   1452 # (non-literals are capitalized):
   1453 #
   1454 # TESTSUITE         - the testsuite
   1455 # TESTSUITE.log     - summarizes the complete testsuite run
   1456 # TESTSUITE.dir/    - created during a run, remains after -d or failed test
   1457 # + at-groups/      - during a run: status of all groups in run
   1458 # | + NNN/          - during a run: meta-data about test group NNN
   1459 # | | + check-line  - location (source file and line) of current AT_CHECK
   1460 # | | + status      - exit status of current AT_CHECK
   1461 # | | + stdout      - stdout of current AT_CHECK
   1462 # | | + stder1      - stderr, including trace
   1463 # | | + stderr      - stderr, with trace filtered out
   1464 # | | + test-source - portion of testsuite that defines group
   1465 # | | + times       - timestamps for computing duration
   1466 # | | + pass        - created if group passed
   1467 # | | + xpass       - created if group xpassed
   1468 # | | + fail        - created if group failed
   1469 # | | + xfail       - created if group xfailed
   1470 # | | + skip        - created if group skipped
   1471 # + at-stop         - during a run: end the run if this file exists
   1472 # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
   1473 # + 0..NNN/         - created for each group NNN, remains after -d or failed test
   1474 # | + TESTSUITE.log - summarizes the group results
   1475 # | + ...           - files created during the group
   1476 
   1477 # The directory the whole suite works in.
   1478 # Should be absolute to let the user `cd' at will.
   1479 at_suite_dir=$at_dir/$as_me.dir
   1480 # The file containing the suite ($at_dir might have changed since earlier).
   1481 at_suite_log=$at_dir/$as_me.log
   1482 # The directory containing helper files per test group.
   1483 at_helper_dir=$at_suite_dir/at-groups
   1484 # Stop file: if it exists, do not start new jobs.
   1485 at_stop_file=$at_suite_dir/at-stop
   1486 # The fifo used for the job dispatcher.
   1487 at_job_fifo=$at_suite_dir/at-job-fifo
   1488 
   1489 if $at_clean; then
   1490   test -d "$at_suite_dir" &&
   1491     find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
   1492   rm -f -r "$at_suite_dir" "$at_suite_log"
   1493   exit $?
   1494 fi
   1495 
   1496 # Don't take risks: use only absolute directories in PATH.
   1497 #
   1498 # For stand-alone test suites (ie. atconfig was not found),
   1499 # AUTOTEST_PATH is relative to `.'.
   1500 #
   1501 # For embedded test suites, AUTOTEST_PATH is relative to the top level
   1502 # of the package.  Then expand it into build/src parts, since users
   1503 # may create executables in both places.
   1504 AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
   1505 at_path=
   1506 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1507 for as_dir in $AUTOTEST_PATH $PATH
   1508 do
   1509   IFS=$as_save_IFS
   1510   test -z "$as_dir" && as_dir=.
   1511     test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
   1512 case $as_dir in
   1513   [\\/]* | ?:[\\/]* )
   1514     as_fn_append at_path "$as_dir"
   1515     ;;
   1516   * )
   1517     if test -z "$at_top_build_prefix"; then
   1518       # Stand-alone test suite.
   1519       as_fn_append at_path "$as_dir"
   1520     else
   1521       # Embedded test suite.
   1522       as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
   1523       as_fn_append at_path "$at_top_srcdir/$as_dir"
   1524     fi
   1525     ;;
   1526 esac
   1527   done
   1528 IFS=$as_save_IFS
   1529 
   1530 
   1531 # Now build and simplify PATH.
   1532 #
   1533 # There might be directories that don't exist, but don't redirect
   1534 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
   1535 at_new_path=
   1536 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1537 for as_dir in $at_path
   1538 do
   1539   IFS=$as_save_IFS
   1540   test -z "$as_dir" && as_dir=.
   1541     test -d "$as_dir" || continue
   1542 case $as_dir in
   1543   [\\/]* | ?:[\\/]* ) ;;
   1544   * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
   1545 esac
   1546 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
   1547   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
   1548   $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
   1549   *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
   1550 esac
   1551   done
   1552 IFS=$as_save_IFS
   1553 
   1554 PATH=$at_new_path
   1555 export PATH
   1556 
   1557 # Setting up the FDs.
   1558 
   1559 
   1560 
   1561 # 5 is the log file.  Not to be overwritten if `-d'.
   1562 if $at_debug_p; then
   1563   at_suite_log=/dev/null
   1564 else
   1565   : >"$at_suite_log"
   1566 fi
   1567 exec 5>>"$at_suite_log"
   1568 
   1569 # Banners and logs.
   1570 $as_echo "## ------------------------- ##
   1571 ## GNU Bison 2.7 test suite. ##
   1572 ## ------------------------- ##"
   1573 {
   1574   $as_echo "## ------------------------- ##
   1575 ## GNU Bison 2.7 test suite. ##
   1576 ## ------------------------- ##"
   1577   echo
   1578 
   1579   $as_echo "$as_me: command line was:"
   1580   $as_echo "  \$ $0 $at_cli_args"
   1581   echo
   1582 
   1583   # If ChangeLog exists, list a few lines in case it might help determining
   1584   # the exact version.
   1585   if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
   1586     $as_echo "## ---------- ##
   1587 ## ChangeLog. ##
   1588 ## ---------- ##"
   1589     echo
   1590     sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
   1591     echo
   1592   fi
   1593 
   1594   {
   1595 cat <<_ASUNAME
   1596 ## --------- ##
   1597 ## Platform. ##
   1598 ## --------- ##
   1599 
   1600 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
   1601 uname -m = `(uname -m) 2>/dev/null || echo unknown`
   1602 uname -r = `(uname -r) 2>/dev/null || echo unknown`
   1603 uname -s = `(uname -s) 2>/dev/null || echo unknown`
   1604 uname -v = `(uname -v) 2>/dev/null || echo unknown`
   1605 
   1606 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
   1607 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
   1608 
   1609 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
   1610 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
   1611 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
   1612 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
   1613 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
   1614 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
   1615 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
   1616 
   1617 _ASUNAME
   1618 
   1619 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1620 for as_dir in $PATH
   1621 do
   1622   IFS=$as_save_IFS
   1623   test -z "$as_dir" && as_dir=.
   1624     $as_echo "PATH: $as_dir"
   1625   done
   1626 IFS=$as_save_IFS
   1627 
   1628 }
   1629   echo
   1630 
   1631   # Contents of the config files.
   1632   for at_file in atconfig atlocal
   1633   do
   1634     test -r $at_file || continue
   1635     $as_echo "$as_me: $at_file:"
   1636     sed 's/^/| /' $at_file
   1637     echo
   1638   done
   1639 } >&5
   1640 
   1641 at_save_special_files ()
   1642 {
   1643   for at_save_file in stderr experr expout
   1644   do
   1645     test ! -f at-bison-check-$at_save_file.bak ||
   1646       as_fn_error 1 "fatal error: back-up on top of a back-up"
   1647     test ! -f $at_save_file || mv $at_save_file at-bison-check-$at_save_file.bak
   1648   done
   1649 }
   1650 
   1651 at_restore_special_files ()
   1652 {
   1653   for at_save_file in stderr experr expout
   1654   do
   1655     test ! -f at-bison-check-$at_save_file.bak ||
   1656       mv at-bison-check-$at_save_file.bak $at_save_file
   1657   done
   1658 }
   1659 
   1660 
   1661 ## ------------------------- ##
   1662 ## Autotest shell functions. ##
   1663 ## ------------------------- ##
   1664 
   1665 # at_fn_banner NUMBER
   1666 # -------------------
   1667 # Output banner NUMBER, provided the testsuite is running multiple groups and
   1668 # this particular banner has not yet been printed.
   1669 at_fn_banner ()
   1670 {
   1671   $at_print_banners || return 0
   1672   eval at_banner_text=\$at_banner_text_$1
   1673   test "x$at_banner_text" = "x " && return 0
   1674   eval "at_banner_text_$1=\" \""
   1675   if test -z "$at_banner_text"; then
   1676     $at_first || echo
   1677   else
   1678     $as_echo "$as_nl$at_banner_text$as_nl"
   1679   fi
   1680 } # at_fn_banner
   1681 
   1682 # at_fn_check_prepare_notrace REASON LINE
   1683 # ---------------------------------------
   1684 # Perform AT_CHECK preparations for the command at LINE for an untraceable
   1685 # command; REASON is the reason for disabling tracing.
   1686 at_fn_check_prepare_notrace ()
   1687 {
   1688   $at_trace_echo "Not enabling shell tracing (command contains $1)"
   1689   $as_echo "$2" >"$at_check_line_file"
   1690   at_check_trace=: at_check_filter=:
   1691   : >"$at_stdout"; : >"$at_stderr"
   1692 }
   1693 
   1694 # at_fn_check_prepare_trace LINE
   1695 # ------------------------------
   1696 # Perform AT_CHECK preparations for the command at LINE for a traceable
   1697 # command.
   1698 at_fn_check_prepare_trace ()
   1699 {
   1700   $as_echo "$1" >"$at_check_line_file"
   1701   at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
   1702   : >"$at_stdout"; : >"$at_stderr"
   1703 }
   1704 
   1705 # at_fn_check_prepare_dynamic COMMAND LINE
   1706 # ----------------------------------------
   1707 # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
   1708 # preparation function.
   1709 at_fn_check_prepare_dynamic ()
   1710 {
   1711   case $1 in
   1712     *$as_nl*)
   1713       at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
   1714     *)
   1715       at_fn_check_prepare_trace "$2" ;;
   1716   esac
   1717 }
   1718 
   1719 # at_fn_filter_trace
   1720 # ------------------
   1721 # Remove the lines in the file "$at_stderr" generated by "set -x" and print
   1722 # them to stderr.
   1723 at_fn_filter_trace ()
   1724 {
   1725   mv "$at_stderr" "$at_stder1"
   1726   grep '^ *+' "$at_stder1" >&2
   1727   grep -v '^ *+' "$at_stder1" >"$at_stderr"
   1728 }
   1729 
   1730 # at_fn_log_failure FILE-LIST
   1731 # ---------------------------
   1732 # Copy the files in the list on stdout with a "> " prefix, and exit the shell
   1733 # with a failure exit code.
   1734 at_fn_log_failure ()
   1735 {
   1736   for file
   1737     do $as_echo "$file:"; sed 's/^/> /' "$file"; done
   1738   echo 1 > "$at_status_file"
   1739   exit 1
   1740 }
   1741 
   1742 # at_fn_check_skip EXIT-CODE LINE
   1743 # -------------------------------
   1744 # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
   1745 # the test group subshell with that same exit code. Use LINE in any report
   1746 # about test failure.
   1747 at_fn_check_skip ()
   1748 {
   1749   case $1 in
   1750     99) echo 99 > "$at_status_file"; at_failed=:
   1751 	$as_echo "$2: hard failure"; exit 99;;
   1752     77) echo 77 > "$at_status_file"; exit 77;;
   1753   esac
   1754 }
   1755 
   1756 # at_fn_check_status EXPECTED EXIT-CODE LINE
   1757 # ------------------------------------------
   1758 # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
   1759 # Otherwise, if it is 77 or 99, exit the test group subshell with that same
   1760 # exit code; if it is anything else print an error message referring to LINE,
   1761 # and fail the test.
   1762 at_fn_check_status ()
   1763 {
   1764   case $2 in
   1765     $1 ) ;;
   1766     77) echo 77 > "$at_status_file"; exit 77;;
   1767     99) echo 99 > "$at_status_file"; at_failed=:
   1768 	$as_echo "$3: hard failure"; exit 99;;
   1769     *) $as_echo "$3: exit code was $2, expected $1"
   1770       at_failed=:;;
   1771   esac
   1772 }
   1773 
   1774 # at_fn_diff_devnull FILE
   1775 # -----------------------
   1776 # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
   1777 # invocations.
   1778 at_fn_diff_devnull ()
   1779 {
   1780   test -s "$1" || return 0
   1781   $at_diff "$at_devnull" "$1"
   1782 }
   1783 
   1784 # at_fn_test NUMBER
   1785 # -----------------
   1786 # Parse out test NUMBER from the tail of this file.
   1787 at_fn_test ()
   1788 {
   1789   eval at_sed=\$at_sed$1
   1790   sed "$at_sed" "$at_myself" > "$at_test_source"
   1791 }
   1792 
   1793 # at_fn_create_debugging_script
   1794 # -----------------------------
   1795 # Create the debugging script $at_group_dir/run which will reproduce the
   1796 # current test group.
   1797 at_fn_create_debugging_script ()
   1798 {
   1799   {
   1800     echo "#! /bin/sh" &&
   1801     echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
   1802     $as_echo "cd '$at_dir'" &&
   1803     $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
   1804     echo 'exit 1'
   1805   } >"$at_group_dir/run" &&
   1806   chmod +x "$at_group_dir/run"
   1807 }
   1808 
   1809 ## -------------------------------- ##
   1810 ## End of autotest shell functions. ##
   1811 ## -------------------------------- ##
   1812 {
   1813   $as_echo "## ---------------- ##
   1814 ## Tested programs. ##
   1815 ## ---------------- ##"
   1816   echo
   1817 } >&5
   1818 
   1819 # Report what programs are being tested.
   1820 for at_program in : $at_tested
   1821 do
   1822   test "$at_program" = : && continue
   1823   case $at_program in
   1824     [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
   1825     * )
   1826     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1827 for as_dir in $PATH
   1828 do
   1829   IFS=$as_save_IFS
   1830   test -z "$as_dir" && as_dir=.
   1831     test -f "$as_dir/$at_program" && break
   1832   done
   1833 IFS=$as_save_IFS
   1834 
   1835     at_program_=$as_dir/$at_program ;;
   1836   esac
   1837   if test -f "$at_program_"; then
   1838     {
   1839       $as_echo "$at_srcdir/local.at:913: $at_program_ --version"
   1840       "$at_program_" --version </dev/null
   1841       echo
   1842     } >&5 2>&1
   1843   else
   1844     as_fn_error $? "cannot find $at_program" "$LINENO" 5
   1845   fi
   1846 done
   1847 
   1848 {
   1849   $as_echo "## ------------------ ##
   1850 ## Running the tests. ##
   1851 ## ------------------ ##"
   1852 } >&5
   1853 
   1854 at_start_date=`date`
   1855 at_start_time=`date +%s 2>/dev/null`
   1856 $as_echo "$as_me: starting at: $at_start_date" >&5
   1857 
   1858 # Create the master directory if it doesn't already exist.
   1859 as_dir="$at_suite_dir"; as_fn_mkdir_p ||
   1860   as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
   1861 
   1862 # Can we diff with `/dev/null'?  DU 5.0 refuses.
   1863 if diff /dev/null /dev/null >/dev/null 2>&1; then
   1864   at_devnull=/dev/null
   1865 else
   1866   at_devnull=$at_suite_dir/devnull
   1867   >"$at_devnull"
   1868 fi
   1869 
   1870 # Use `diff -u' when possible.
   1871 if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
   1872 then
   1873   at_diff='diff -u'
   1874 else
   1875   at_diff=diff
   1876 fi
   1877 
   1878 # Get the last needed group.
   1879 for at_group in : $at_groups; do :; done
   1880 
   1881 # Extract the start and end lines of each test group at the tail
   1882 # of this file
   1883 awk '
   1884 BEGIN { FS="" }
   1885 /^#AT_START_/ {
   1886   start = NR
   1887 }
   1888 /^#AT_STOP_/ {
   1889   test = substr ($ 0, 10)
   1890   print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
   1891   if (test == "'"$at_group"'") exit
   1892 }' "$at_myself" > "$at_suite_dir/at-source-lines" &&
   1893 . "$at_suite_dir/at-source-lines" ||
   1894   as_fn_error $? "cannot create test line number cache" "$LINENO" 5
   1895 rm -f "$at_suite_dir/at-source-lines"
   1896 
   1897 # Set number of jobs for `-j'; avoid more jobs than test groups.
   1898 set X $at_groups; shift; at_max_jobs=$#
   1899 if test $at_max_jobs -eq 0; then
   1900   at_jobs=1
   1901 fi
   1902 if test $at_jobs -ne 1 &&
   1903    { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
   1904   at_jobs=$at_max_jobs
   1905 fi
   1906 
   1907 # If parallel mode, don't output banners, don't split summary lines.
   1908 if test $at_jobs -ne 1; then
   1909   at_print_banners=false
   1910   at_quiet=:
   1911 fi
   1912 
   1913 # Set up helper dirs.
   1914 rm -rf "$at_helper_dir" &&
   1915 mkdir "$at_helper_dir" &&
   1916 cd "$at_helper_dir" &&
   1917 { test -z "$at_groups" || mkdir $at_groups; } ||
   1918 as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
   1919 
   1920 # Functions for running a test group.  We leave the actual
   1921 # test group execution outside of a shell function in order
   1922 # to avoid hitting zsh 4.x exit status bugs.
   1923 
   1924 # at_fn_group_prepare
   1925 # -------------------
   1926 # Prepare for running a test group.
   1927 at_fn_group_prepare ()
   1928 {
   1929   # The directory for additional per-group helper files.
   1930   at_job_dir=$at_helper_dir/$at_group
   1931   # The file containing the location of the last AT_CHECK.
   1932   at_check_line_file=$at_job_dir/check-line
   1933   # The file containing the exit status of the last command.
   1934   at_status_file=$at_job_dir/status
   1935   # The files containing the output of the tested commands.
   1936   at_stdout=$at_job_dir/stdout
   1937   at_stder1=$at_job_dir/stder1
   1938   at_stderr=$at_job_dir/stderr
   1939   # The file containing the code for a test group.
   1940   at_test_source=$at_job_dir/test-source
   1941   # The file containing dates.
   1942   at_times_file=$at_job_dir/times
   1943 
   1944   # Be sure to come back to the top test directory.
   1945   cd "$at_suite_dir"
   1946 
   1947   # Clearly separate the test groups when verbose.
   1948   $at_first || $at_verbose echo
   1949 
   1950   at_group_normalized=$at_group
   1951 
   1952   eval 'while :; do
   1953     case $at_group_normalized in #(
   1954     '"$at_format"'*) break;;
   1955     esac
   1956     at_group_normalized=0$at_group_normalized
   1957   done'
   1958 
   1959 
   1960   # Create a fresh directory for the next test group, and enter.
   1961   # If one already exists, the user may have invoked ./run from
   1962   # within that directory; we remove the contents, but not the
   1963   # directory itself, so that we aren't pulling the rug out from
   1964   # under the shell's notion of the current directory.
   1965   at_group_dir=$at_suite_dir/$at_group_normalized
   1966   at_group_log=$at_group_dir/$as_me.log
   1967   if test -d "$at_group_dir"; then
   1968   find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
   1969   rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
   1970 fi ||
   1971     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
   1972 $as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
   1973   # Be tolerant if the above `rm' was not able to remove the directory.
   1974   as_dir="$at_group_dir"; as_fn_mkdir_p
   1975 
   1976   echo 0 > "$at_status_file"
   1977 
   1978   # In verbose mode, append to the log file *and* show on
   1979   # the standard output; in quiet mode only write to the log.
   1980   if test -z "$at_verbose"; then
   1981     at_tee_pipe='tee -a "$at_group_log"'
   1982   else
   1983     at_tee_pipe='cat >> "$at_group_log"'
   1984   fi
   1985 }
   1986 
   1987 # at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
   1988 # -------------------------------------------------
   1989 # Declare the test group ORDINAL, located at LINE with group description DESC,
   1990 # and residing under BANNER. Use PAD to align the status column.
   1991 at_fn_group_banner ()
   1992 {
   1993   at_setup_line="$2"
   1994   test -n "$5" && at_fn_banner $5
   1995   at_desc="$3"
   1996   case $1 in
   1997     [0-9])      at_desc_line="  $1: ";;
   1998     [0-9][0-9]) at_desc_line=" $1: " ;;
   1999     *)          at_desc_line="$1: "  ;;
   2000   esac
   2001   as_fn_append at_desc_line "$3$4"
   2002   $at_quiet $as_echo_n "$at_desc_line"
   2003   echo "#                             -*- compilation -*-" >> "$at_group_log"
   2004 }
   2005 
   2006 # at_fn_group_postprocess
   2007 # -----------------------
   2008 # Perform cleanup after running a test group.
   2009 at_fn_group_postprocess ()
   2010 {
   2011   # Be sure to come back to the suite directory, in particular
   2012   # since below we might `rm' the group directory we are in currently.
   2013   cd "$at_suite_dir"
   2014 
   2015   if test ! -f "$at_check_line_file"; then
   2016     sed "s/^ */$as_me: WARNING: /" <<_ATEOF
   2017       A failure happened in a test group before any test could be
   2018       run. This means that test suite is improperly designed.  Please
   2019       report this failure to <bug-bison@gnu.org>.
   2020 _ATEOF
   2021     $as_echo "$at_setup_line" >"$at_check_line_file"
   2022     at_status=99
   2023   fi
   2024   $at_verbose $as_echo_n "$at_group. $at_setup_line: "
   2025   $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
   2026   case $at_xfail:$at_status in
   2027     yes:0)
   2028 	at_msg="UNEXPECTED PASS"
   2029 	at_res=xpass
   2030 	at_errexit=$at_errexit_p
   2031 	at_color=$at_red
   2032 	;;
   2033     no:0)
   2034 	at_msg="ok"
   2035 	at_res=pass
   2036 	at_errexit=false
   2037 	at_color=$at_grn
   2038 	;;
   2039     *:77)
   2040 	at_msg='skipped ('`cat "$at_check_line_file"`')'
   2041 	at_res=skip
   2042 	at_errexit=false
   2043 	at_color=$at_blu
   2044 	;;
   2045     no:* | *:99)
   2046 	at_msg='FAILED ('`cat "$at_check_line_file"`')'
   2047 	at_res=fail
   2048 	at_errexit=$at_errexit_p
   2049 	at_color=$at_red
   2050 	;;
   2051     yes:*)
   2052 	at_msg='expected failure ('`cat "$at_check_line_file"`')'
   2053 	at_res=xfail
   2054 	at_errexit=false
   2055 	at_color=$at_lgn
   2056 	;;
   2057   esac
   2058   echo "$at_res" > "$at_job_dir/$at_res"
   2059   # In parallel mode, output the summary line only afterwards.
   2060   if test $at_jobs -ne 1 && test -n "$at_verbose"; then
   2061     $as_echo "$at_desc_line $at_color$at_msg$at_std"
   2062   else
   2063     # Make sure there is a separator even with long titles.
   2064     $as_echo " $at_color$at_msg$at_std"
   2065   fi
   2066   at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
   2067   case $at_status in
   2068     0|77)
   2069       # $at_times_file is only available if the group succeeded.
   2070       # We're not including the group log, so the success message
   2071       # is written in the global log separately.  But we also
   2072       # write to the group log in case they're using -d.
   2073       if test -f "$at_times_file"; then
   2074 	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
   2075 	rm -f "$at_times_file"
   2076       fi
   2077       $as_echo "$at_log_msg" >> "$at_group_log"
   2078       $as_echo "$at_log_msg" >&5
   2079 
   2080       # Cleanup the group directory, unless the user wants the files
   2081       # or the success was unexpected.
   2082       if $at_debug_p || test $at_res = xpass; then
   2083 	at_fn_create_debugging_script
   2084 	if test $at_res = xpass && $at_errexit; then
   2085 	  echo stop > "$at_stop_file"
   2086 	fi
   2087       else
   2088 	if test -d "$at_group_dir"; then
   2089 	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
   2090 	  rm -fr "$at_group_dir"
   2091 	fi
   2092 	rm -f "$at_test_source"
   2093       fi
   2094       ;;
   2095     *)
   2096       # Upon failure, include the log into the testsuite's global
   2097       # log.  The failure message is written in the group log.  It
   2098       # is later included in the global log.
   2099       $as_echo "$at_log_msg" >> "$at_group_log"
   2100 
   2101       # Upon failure, keep the group directory for autopsy, and create
   2102       # the debugging script.  With -e, do not start any further tests.
   2103       at_fn_create_debugging_script
   2104       if $at_errexit; then
   2105 	echo stop > "$at_stop_file"
   2106       fi
   2107       ;;
   2108   esac
   2109 }
   2110 
   2111 
   2112 ## ------------ ##
   2113 ## Driver loop. ##
   2114 ## ------------ ##
   2115 
   2116 
   2117 if (set -m && set +m && set +b) >/dev/null 2>&1; then
   2118   set +b
   2119   at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
   2120 else
   2121   at_job_control_on=: at_job_control_off=: at_job_group=
   2122 fi
   2123 
   2124 for at_signal in 1 2 15; do
   2125   trap 'set +x; set +e
   2126 	$at_job_control_off
   2127 	at_signal='"$at_signal"'
   2128 	echo stop > "$at_stop_file"
   2129 	trap "" $at_signal
   2130 	at_pgids=
   2131 	for at_pgid in `jobs -p 2>/dev/null`; do
   2132 	  at_pgids="$at_pgids $at_job_group$at_pgid"
   2133 	done
   2134 	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
   2135 	wait
   2136 	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
   2137 	  echo >&2
   2138 	fi
   2139 	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
   2140 	set x $at_signame
   2141 	test 0 -gt 2 && at_signame=$at_signal
   2142 	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
   2143 $as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
   2144 	as_fn_arith 128 + $at_signal && exit_status=$as_val
   2145 	as_fn_exit $exit_status' $at_signal
   2146 done
   2147 
   2148 rm -f "$at_stop_file"
   2149 at_first=:
   2150 
   2151 if test $at_jobs -ne 1 &&
   2152      rm -f "$at_job_fifo" &&
   2153      test -n "$at_job_group" &&
   2154      ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
   2155 then
   2156   # FIFO job dispatcher.
   2157 
   2158   trap 'at_pids=
   2159 	for at_pid in `jobs -p`; do
   2160 	  at_pids="$at_pids $at_job_group$at_pid"
   2161 	done
   2162 	if test -n "$at_pids"; then
   2163 	  at_sig=TSTP
   2164 	  test "${TMOUT+set}" = set && at_sig=STOP
   2165 	  kill -$at_sig $at_pids 2>/dev/null
   2166 	fi
   2167 	kill -STOP $$
   2168 	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
   2169 
   2170   echo
   2171   # Turn jobs into a list of numbers, starting from 1.
   2172   at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p`
   2173 
   2174   set X $at_joblist
   2175   shift
   2176   for at_group in $at_groups; do
   2177     $at_job_control_on 2>/dev/null
   2178     (
   2179       # Start one test group.
   2180       $at_job_control_off
   2181       if $at_first; then
   2182 	exec 7>"$at_job_fifo"
   2183       else
   2184 	exec 6<&-
   2185       fi
   2186       trap 'set +x; set +e
   2187 	    trap "" PIPE
   2188 	    echo stop > "$at_stop_file"
   2189 	    echo >&7
   2190 	    as_fn_exit 141' PIPE
   2191       at_fn_group_prepare
   2192       if cd "$at_group_dir" &&
   2193 	 at_fn_test $at_group &&
   2194 	 . "$at_test_source"
   2195       then :; else
   2196 	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
   2197 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
   2198 	at_failed=:
   2199       fi
   2200       at_fn_group_postprocess
   2201       echo >&7
   2202     ) &
   2203     $at_job_control_off
   2204     if $at_first; then
   2205       at_first=false
   2206       exec 6<"$at_job_fifo" 7>"$at_job_fifo"
   2207     fi
   2208     shift # Consume one token.
   2209     if test $# -gt 0; then :; else
   2210       read at_token <&6 || break
   2211       set x $*
   2212     fi
   2213     test -f "$at_stop_file" && break
   2214   done
   2215   exec 7>&-
   2216   # Read back the remaining ($at_jobs - 1) tokens.
   2217   set X $at_joblist
   2218   shift
   2219   if test $# -gt 0; then
   2220     shift
   2221     for at_job
   2222     do
   2223       read at_token
   2224     done <&6
   2225   fi
   2226   exec 6<&-
   2227   wait
   2228 else
   2229   # Run serially, avoid forks and other potential surprises.
   2230   for at_group in $at_groups; do
   2231     at_fn_group_prepare
   2232     if cd "$at_group_dir" &&
   2233        at_fn_test $at_group &&
   2234        . "$at_test_source"; then :; else
   2235       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
   2236 $as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
   2237       at_failed=:
   2238     fi
   2239     at_fn_group_postprocess
   2240     test -f "$at_stop_file" && break
   2241     at_first=false
   2242   done
   2243 fi
   2244 
   2245 # Wrap up the test suite with summary statistics.
   2246 cd "$at_helper_dir"
   2247 
   2248 # Use ?..???? when the list must remain sorted, the faster * otherwise.
   2249 at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
   2250 at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
   2251 at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
   2252 at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
   2253 		 echo $f; done | sed '/?/d; s,/xpass,,'`
   2254 at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
   2255 		echo $f; done | sed '/?/d; s,/fail,,'`
   2256 
   2257 set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
   2258 shift; at_group_count=$#
   2259 set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
   2260 set X $at_xfail_list; shift; at_xfail_count=$#
   2261 set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
   2262 set X $at_skip_list; shift; at_skip_count=$#
   2263 
   2264 as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
   2265 as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
   2266 as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
   2267 
   2268 # Back to the top directory.
   2269 cd "$at_dir"
   2270 rm -rf "$at_helper_dir"
   2271 
   2272 # Compute the duration of the suite.
   2273 at_stop_date=`date`
   2274 at_stop_time=`date +%s 2>/dev/null`
   2275 $as_echo "$as_me: ending at: $at_stop_date" >&5
   2276 case $at_start_time,$at_stop_time in
   2277   [0-9]*,[0-9]*)
   2278     as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
   2279     as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
   2280     as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
   2281     as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
   2282     as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
   2283     at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
   2284     $as_echo "$as_me: test suite duration: $at_duration" >&5
   2285     ;;
   2286 esac
   2287 
   2288 echo
   2289 $as_echo "## ------------- ##
   2290 ## Test results. ##
   2291 ## ------------- ##"
   2292 echo
   2293 {
   2294   echo
   2295   $as_echo "## ------------- ##
   2296 ## Test results. ##
   2297 ## ------------- ##"
   2298   echo
   2299 } >&5
   2300 
   2301 if test $at_run_count = 1; then
   2302   at_result="1 test"
   2303   at_were=was
   2304 else
   2305   at_result="$at_run_count tests"
   2306   at_were=were
   2307 fi
   2308 if $at_errexit_p && test $at_unexpected_count != 0; then
   2309   if test $at_xpass_count = 1; then
   2310     at_result="$at_result $at_were run, one passed"
   2311   else
   2312     at_result="$at_result $at_were run, one failed"
   2313   fi
   2314   at_result="$at_result unexpectedly and inhibited subsequent tests."
   2315   at_color=$at_red
   2316 else
   2317   # Don't you just love exponential explosion of the number of cases?
   2318   at_color=$at_red
   2319   case $at_xpass_count:$at_fail_count:$at_xfail_count in
   2320     # So far, so good.
   2321     0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
   2322     0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
   2323 
   2324     # Some unexpected failures
   2325     0:*:0) at_result="$at_result $at_were run,
   2326 $at_fail_count failed unexpectedly." ;;
   2327 
   2328     # Some failures, both expected and unexpected
   2329     0:*:1) at_result="$at_result $at_were run,
   2330 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
   2331     0:*:*) at_result="$at_result $at_were run,
   2332 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
   2333 
   2334     # No unexpected failures, but some xpasses
   2335     *:0:*) at_result="$at_result $at_were run,
   2336 $at_xpass_count passed unexpectedly." ;;
   2337 
   2338     # No expected failures, but failures and xpasses
   2339     *:1:0) at_result="$at_result $at_were run,
   2340 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
   2341     *:*:0) at_result="$at_result $at_were run,
   2342 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
   2343 
   2344     # All of them.
   2345     *:*:1) at_result="$at_result $at_were run,
   2346 $at_xpass_count passed unexpectedly,
   2347 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
   2348     *:*:*) at_result="$at_result $at_were run,
   2349 $at_xpass_count passed unexpectedly,
   2350 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
   2351   esac
   2352 
   2353   if test $at_skip_count = 0 && test $at_run_count -gt 1; then
   2354     at_result="All $at_result"
   2355   fi
   2356 fi
   2357 
   2358 # Now put skips in the mix.
   2359 case $at_skip_count in
   2360   0) ;;
   2361   1) at_result="$at_result
   2362 1 test was skipped." ;;
   2363   *) at_result="$at_result
   2364 $at_skip_count tests were skipped." ;;
   2365 esac
   2366 
   2367 if test $at_unexpected_count = 0; then
   2368   echo "$at_color$at_result$at_std"
   2369   echo "$at_result" >&5
   2370 else
   2371   echo "${at_color}ERROR: $at_result$at_std" >&2
   2372   echo "ERROR: $at_result" >&5
   2373   {
   2374     echo
   2375     $as_echo "## ------------------------ ##
   2376 ## Summary of the failures. ##
   2377 ## ------------------------ ##"
   2378 
   2379     # Summary of failed and skipped tests.
   2380     if test $at_fail_count != 0; then
   2381       echo "Failed tests:"
   2382       $SHELL "$at_myself" $at_fail_list --list
   2383       echo
   2384     fi
   2385     if test $at_skip_count != 0; then
   2386       echo "Skipped tests:"
   2387       $SHELL "$at_myself" $at_skip_list --list
   2388       echo
   2389     fi
   2390     if test $at_xpass_count != 0; then
   2391       echo "Unexpected passes:"
   2392       $SHELL "$at_myself" $at_xpass_list --list
   2393       echo
   2394     fi
   2395     if test $at_fail_count != 0; then
   2396       $as_echo "## ---------------------- ##
   2397 ## Detailed failed tests. ##
   2398 ## ---------------------- ##"
   2399       echo
   2400       for at_group in $at_fail_list
   2401       do
   2402 	at_group_normalized=$at_group
   2403 
   2404   eval 'while :; do
   2405     case $at_group_normalized in #(
   2406     '"$at_format"'*) break;;
   2407     esac
   2408     at_group_normalized=0$at_group_normalized
   2409   done'
   2410 
   2411 	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
   2412 	echo
   2413       done
   2414       echo
   2415     fi
   2416     if test -n "$at_top_srcdir"; then
   2417       sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
   2418 ## ${at_top_build_prefix}config.log ##
   2419 _ASBOX
   2420       sed 's/^/| /' ${at_top_build_prefix}config.log
   2421       echo
   2422     fi
   2423   } >&5
   2424 
   2425   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
   2426 ## $as_me.log was created. ##
   2427 _ASBOX
   2428 
   2429   echo
   2430   if $at_debug_p; then
   2431     at_msg='per-test log files'
   2432   else
   2433     at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
   2434   fi
   2435   $as_echo "Please send $at_msg and all information you think might help:
   2436 
   2437    To: <bug-bison (at] gnu.org>
   2438    Subject: [GNU Bison 2.7] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
   2439 
   2440 You may investigate any problem if you feel able to do so, in which
   2441 case the test suite provides a good starting point.  Its output may
   2442 be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
   2443 "
   2444   exit 1
   2445 fi
   2446 
   2447 exit 0
   2448 
   2449 ## ------------- ##
   2450 ## Actual tests. ##
   2451 ## ------------- ##
   2452 #AT_START_1
   2453 at_fn_group_banner 1 'input.at:27' \
   2454   "Invalid inputs" "                                 " 1
   2455 at_xfail=no
   2456 (
   2457   $as_echo "1. $at_setup_line: testing $at_desc ..."
   2458   $at_traceon
   2459 
   2460 
   2461 cat >input.y <<'_ATEOF'
   2462 \000\001\002\377?
   2463 %%
   2464 ?
   2465 default: 'a' }
   2466 %&
   2467 %a-does-not-exist
   2468 %-
   2469 %{
   2470 _ATEOF
   2471 
   2472 { set +x
   2473 $as_echo "$at_srcdir/input.at:39: \$PERL -pi -e 's/\\\\(\\d{3})/chr(oct(\$1))/ge' input.y || exit 77"
   2474 at_fn_check_prepare_dynamic "$PERL -pi -e 's/\\\\(\\d{3})/chr(oct($1))/ge' input.y || exit 77" "input.at:39"
   2475 ( $at_check_trace; $PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' input.y || exit 77
   2476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2477 at_status=$? at_failed=false
   2478 $at_check_filter
   2479 at_fn_diff_devnull "$at_stderr" || at_failed=:
   2480 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2481 at_fn_check_status 0 $at_status "$at_srcdir/input.at:39"
   2482 $at_failed && at_fn_log_failure
   2483 $at_traceon; }
   2484 
   2485 
   2486 
   2487 { set +x
   2488 $as_echo "$at_srcdir/input.at:41: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   2489 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:41"
   2490 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   2491 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2492 at_status=$? at_failed=false
   2493 $at_check_filter
   2494 echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: invalid characters: '\\0\\001\\002\\377?'
   2495 input.y:3.1: error: invalid character: '?'
   2496 input.y:4.14: error: invalid character: '}'
   2497 input.y:5.1: error: invalid character: '%'
   2498 input.y:5.2: error: invalid character: '&'
   2499 input.y:6.1-17: error: invalid directive: '%a-does-not-exist'
   2500 input.y:7.1: error: invalid character: '%'
   2501 input.y:7.2: error: invalid character: '-'
   2502 input.y:8.1-9.0: error: missing '%}' at end of file
   2503 input.y:8.1-9.0: error: syntax error, unexpected %{...%}
   2504 " | \
   2505   $at_diff - "$at_stderr" || at_failed=:
   2506 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2507 at_fn_check_status 1 $at_status "$at_srcdir/input.at:41"
   2508 $at_failed && at_fn_log_failure
   2509 $at_traceon; }
   2510 
   2511 
   2512 
   2513   set +x
   2514   $at_times_p && times >"$at_times_file"
   2515 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   2516 read at_status <"$at_status_file"
   2517 #AT_STOP_1
   2518 #AT_START_2
   2519 at_fn_group_banner 2 'input.at:57' \
   2520   "Invalid inputs with {}" "                         " 1
   2521 at_xfail=no
   2522 (
   2523   $as_echo "2. $at_setup_line: testing $at_desc ..."
   2524   $at_traceon
   2525 
   2526 
   2527 # We used to SEGV here.  See
   2528 # http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html
   2529 
   2530 cat >input.y <<'_ATEOF'
   2531 
   2532 %destructor
   2533 %initial-action
   2534 %lex-param
   2535 %parse-param
   2536 %printer
   2537 %union
   2538 _ATEOF
   2539 
   2540 
   2541 
   2542 { set +x
   2543 $as_echo "$at_srcdir/input.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   2544 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:72"
   2545 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   2546 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2547 at_status=$? at_failed=false
   2548 $at_check_filter
   2549 echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
   2550 " | \
   2551   $at_diff - "$at_stderr" || at_failed=:
   2552 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2553 at_fn_check_status 1 $at_status "$at_srcdir/input.at:72"
   2554 $at_failed && at_fn_log_failure
   2555 $at_traceon; }
   2556 
   2557 
   2558 
   2559   set +x
   2560   $at_times_p && times >"$at_times_file"
   2561 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   2562 read at_status <"$at_status_file"
   2563 #AT_STOP_2
   2564 #AT_START_3
   2565 at_fn_group_banner 3 'input.at:84' \
   2566   "Invalid \$n and @n" "                              " 1
   2567 at_xfail=no
   2568 (
   2569   $as_echo "3. $at_setup_line: testing $at_desc ..."
   2570   $at_traceon
   2571 
   2572 
   2573 cat >input.y <<'_ATEOF'
   2574 %%
   2575 exp: { $$ = $1 ; };
   2576 exp: { @$ = @1 ; };
   2577 _ATEOF
   2578 
   2579 
   2580 
   2581 { set +x
   2582 $as_echo "$at_srcdir/input.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   2583 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:92"
   2584 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   2585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2586 at_status=$? at_failed=false
   2587 $at_check_filter
   2588 echo >>"$at_stderr"; $as_echo "input.y:2.13-14: error: integer out of range: '\$1'
   2589 input.y:3.13-14: error: integer out of range: '@1'
   2590 " | \
   2591   $at_diff - "$at_stderr" || at_failed=:
   2592 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2593 at_fn_check_status 1 $at_status "$at_srcdir/input.at:92"
   2594 $at_failed && at_fn_log_failure
   2595 $at_traceon; }
   2596 
   2597 
   2598 
   2599   set +x
   2600   $at_times_p && times >"$at_times_file"
   2601 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   2602 read at_status <"$at_status_file"
   2603 #AT_STOP_3
   2604 #AT_START_4
   2605 at_fn_group_banner 4 'input.at:104' \
   2606   "Type Clashes" "                                   " 1
   2607 at_xfail=no
   2608 (
   2609   $as_echo "4. $at_setup_line: testing $at_desc ..."
   2610   $at_traceon
   2611 
   2612 
   2613 cat >input.y <<'_ATEOF'
   2614 %union { int bar; }
   2615 %token foo
   2616 %type <bar> exp
   2617 %%
   2618 exp: foo { $$; } foo { $2; } foo
   2619    | foo
   2620    | /* Empty. */
   2621    ;
   2622 _ATEOF
   2623 
   2624 
   2625 
   2626 { set +x
   2627 $as_echo "$at_srcdir/input.at:117: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   2628 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:117"
   2629 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   2630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2631 at_status=$? at_failed=false
   2632 $at_check_filter
   2633 echo >>"$at_stderr"; $as_echo "input.y:5.12-13: error: \$\$ for the midrule at \$2 of 'exp' has no declared type
   2634 input.y:5.24-25: error: \$2 of 'exp' has no declared type
   2635 input.y:5.6-32: warning: type clash on default action: <bar> != <>
   2636 input.y:6.6-8: warning: type clash on default action: <bar> != <>
   2637 input.y:7.5: warning: empty rule for typed nonterminal, and no action
   2638 " | \
   2639   $at_diff - "$at_stderr" || at_failed=:
   2640 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2641 at_fn_check_status 1 $at_status "$at_srcdir/input.at:117"
   2642 $at_failed && at_fn_log_failure
   2643 $at_traceon; }
   2644 
   2645 
   2646 
   2647   set +x
   2648   $at_times_p && times >"$at_times_file"
   2649 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   2650 read at_status <"$at_status_file"
   2651 #AT_STOP_4
   2652 #AT_START_5
   2653 at_fn_group_banner 5 'input.at:285' \
   2654   "Unused values" "                                  " 1
   2655 at_xfail=no
   2656 (
   2657   $as_echo "5. $at_setup_line: testing $at_desc ..."
   2658   $at_traceon
   2659 
   2660 cat >input.y <<'_ATEOF'
   2661 %token <integer> INT;
   2662 %type <integer> a b c d e f g h i j k l;
   2663 %destructor { destroy ($$); } INT a b c d e f g h i j k l;
   2664 %%
   2665 start:
   2666   'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
   2667 | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
   2668 | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
   2669 ;
   2670 
   2671 a: INT | INT { } INT { } INT { };
   2672 b: INT | /* empty */;
   2673 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   2674 d: INT | INT { } INT { $1; } INT { $<integer>2; };
   2675 e: INT | INT { } INT {  } INT { $1; };
   2676 f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
   2677 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   2678 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   2679 i: INT | INT INT { } { $$ = $1 + $2; };
   2680 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   2681 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   2682 l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
   2683 _ATEOF
   2684 
   2685 
   2686 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   2687   at_save_special_files
   2688   mkdir xml-tests
   2689     # Don't combine these Bison invocations since we want to be sure that
   2690   # --report=all isn't required to get the full XML file.
   2691   { set +x
   2692 $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   2693                   --graph=xml-tests/test.dot -fcaret input.y"
   2694 at_fn_check_prepare_notrace 'an embedded newline' "input.at:286"
   2695 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   2696                   --graph=xml-tests/test.dot -fcaret input.y
   2697 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2698 at_status=$? at_failed=false
   2699 $at_check_filter
   2700 echo stderr:; cat "$at_stderr"
   2701 echo stdout:; cat "$at_stdout"
   2702 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   2703 $at_failed && at_fn_log_failure
   2704 $at_traceon; }
   2705 
   2706   { set +x
   2707 $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y"
   2708 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" "input.at:286"
   2709 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y
   2710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2711 at_status=$? at_failed=false
   2712 $at_check_filter
   2713 echo stderr:; cat "$at_stderr"
   2714 echo stdout:; cat "$at_stdout"
   2715 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   2716 $at_failed && at_fn_log_failure
   2717 $at_traceon; }
   2718 
   2719     cp xml-tests/test.output expout
   2720   { set +x
   2721 $as_echo "$at_srcdir/input.at:286: \$XSLTPROC \\
   2722              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   2723              xml-tests/test.xml"
   2724 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:286"
   2725 ( $at_check_trace; $XSLTPROC \
   2726              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   2727              xml-tests/test.xml
   2728 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2729 at_status=$? at_failed=false
   2730 $at_check_filter
   2731 at_fn_diff_devnull "$at_stderr" || at_failed=:
   2732 $at_diff expout "$at_stdout" || at_failed=:
   2733 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   2734 $at_failed && at_fn_log_failure
   2735 $at_traceon; }
   2736 
   2737   sort xml-tests/test.dot > expout
   2738   { set +x
   2739 $as_echo "$at_srcdir/input.at:286: \$XSLTPROC \\
   2740              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   2741              xml-tests/test.xml | sort"
   2742 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:286"
   2743 ( $at_check_trace; $XSLTPROC \
   2744              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   2745              xml-tests/test.xml | sort
   2746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2747 at_status=$? at_failed=false
   2748 $at_check_filter
   2749 at_fn_diff_devnull "$at_stderr" || at_failed=:
   2750 $at_diff expout "$at_stdout" || at_failed=:
   2751 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   2752 $at_failed && at_fn_log_failure
   2753 $at_traceon; }
   2754 
   2755   rm -rf xml-tests expout
   2756   at_restore_special_files
   2757 fi
   2758 { set +x
   2759 $as_echo "$at_srcdir/input.at:286: bison -fcaret input.y"
   2760 at_fn_check_prepare_trace "input.at:286"
   2761 ( $at_check_trace; bison -fcaret input.y
   2762 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2763 at_status=$? at_failed=false
   2764 $at_check_filter
   2765 echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
   2766  a: INT | INT { } INT { } INT { };
   2767           ^^^^^^^^^^^^^^^^^^^^^^^
   2768 input.y:11.10-12: warning: unused value: \$1
   2769  a: INT | INT { } INT { } INT { };
   2770           ^^^
   2771 input.y:11.18-20: warning: unused value: \$3
   2772  a: INT | INT { } INT { } INT { };
   2773                   ^^^
   2774 input.y:11.26-28: warning: unused value: \$5
   2775  a: INT | INT { } INT { } INT { };
   2776                           ^^^
   2777 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   2778  b: INT | /* empty */;
   2779          ^
   2780 input.y:13.10-62: warning: unset value: \$\$
   2781  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   2782           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2783 input.y:13.22-24: warning: unused value: \$3
   2784  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   2785                       ^^^
   2786 input.y:13.43-45: warning: unused value: \$5
   2787  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   2788                                            ^^^
   2789 input.y:14.10-49: warning: unset value: \$\$
   2790  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   2791           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2792 input.y:14.18-20: warning: unused value: \$3
   2793  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   2794                   ^^^
   2795 input.y:14.30-32: warning: unused value: \$5
   2796  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   2797                               ^^^
   2798 input.y:15.10-37: warning: unset value: \$\$
   2799  e: INT | INT { } INT {  } INT { \$1; };
   2800           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2801 input.y:15.18-20: warning: unused value: \$3
   2802  e: INT | INT { } INT {  } INT { \$1; };
   2803                   ^^^
   2804 input.y:15.27-29: warning: unused value: \$5
   2805  e: INT | INT { } INT {  } INT { \$1; };
   2806                            ^^^
   2807 input.y:17.10-58: warning: unset value: \$\$
   2808  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   2809           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2810 input.y:17.10-12: warning: unused value: \$1
   2811  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   2812           ^^^
   2813 input.y:17.31-33: warning: unused value: \$3
   2814  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   2815                                ^^^
   2816 input.y:17.52-54: warning: unused value: \$5
   2817  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   2818                                                     ^^^
   2819 input.y:18.10-72: warning: unset value: \$\$
   2820  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   2821           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2822 input.y:18.10-12: warning: unused value: \$1
   2823  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   2824           ^^^
   2825 input.y:18.31-33: warning: unused value: \$3
   2826  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   2827                                ^^^
   2828 input.y:18.66-68: warning: unused value: \$5
   2829  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   2830                                                                   ^^^
   2831 input.y:21.10-68: warning: unset value: \$\$
   2832  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   2833           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2834 input.y:21.10-12: warning: unused value: \$1
   2835  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   2836           ^^^
   2837 input.y:21.14-16: warning: unused value: \$2
   2838  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   2839               ^^^
   2840 " | \
   2841   $at_diff - "$at_stderr" || at_failed=:
   2842 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2843 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   2844 $at_failed && at_fn_log_failure
   2845 $at_traceon; }
   2846 
   2847 # Defining POSIXLY_CORRECT causes bison to complain if options are
   2848 # added after the grammar file name, so skip these checks in that
   2849 # case.
   2850 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   2851   at_save_special_files
   2852 
   2853   # To avoid expanding it repeatedly, store specified stdout.
   2854   : >expout
   2855 
   2856   # Run with -Werror.
   2857   { set +x
   2858 $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror"
   2859 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" "input.at:286"
   2860 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Werror
   2861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2862 at_status=$? at_failed=false
   2863 $at_check_filter
   2864 echo stderr:; tee stderr <"$at_stderr"
   2865 $at_diff expout "$at_stdout" || at_failed=:
   2866 at_fn_check_status 1 $at_status "$at_srcdir/input.at:286"
   2867 $at_failed && at_fn_log_failure
   2868 $at_traceon; }
   2869 
   2870 
   2871   # Build expected stderr up to and including the "warnings being
   2872   # treated as errors" message.
   2873   cat >at-bison-check-warnings <<'_ATEOF'
   2874 input.y:11.10-32: warning: unset value: $$
   2875  a: INT | INT { } INT { } INT { };
   2876           ^^^^^^^^^^^^^^^^^^^^^^^
   2877 input.y:11.10-12: warning: unused value: $1
   2878  a: INT | INT { } INT { } INT { };
   2879           ^^^
   2880 input.y:11.18-20: warning: unused value: $3
   2881  a: INT | INT { } INT { } INT { };
   2882                   ^^^
   2883 input.y:11.26-28: warning: unused value: $5
   2884  a: INT | INT { } INT { } INT { };
   2885                           ^^^
   2886 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   2887  b: INT | /* empty */;
   2888          ^
   2889 input.y:13.10-62: warning: unset value: $$
   2890  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   2891           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2892 input.y:13.22-24: warning: unused value: $3
   2893  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   2894                       ^^^
   2895 input.y:13.43-45: warning: unused value: $5
   2896  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   2897                                            ^^^
   2898 input.y:14.10-49: warning: unset value: $$
   2899  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   2900           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2901 input.y:14.18-20: warning: unused value: $3
   2902  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   2903                   ^^^
   2904 input.y:14.30-32: warning: unused value: $5
   2905  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   2906                               ^^^
   2907 input.y:15.10-37: warning: unset value: $$
   2908  e: INT | INT { } INT {  } INT { $1; };
   2909           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2910 input.y:15.18-20: warning: unused value: $3
   2911  e: INT | INT { } INT {  } INT { $1; };
   2912                   ^^^
   2913 input.y:15.27-29: warning: unused value: $5
   2914  e: INT | INT { } INT {  } INT { $1; };
   2915                            ^^^
   2916 input.y:17.10-58: warning: unset value: $$
   2917  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   2918           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2919 input.y:17.10-12: warning: unused value: $1
   2920  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   2921           ^^^
   2922 input.y:17.31-33: warning: unused value: $3
   2923  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   2924                                ^^^
   2925 input.y:17.52-54: warning: unused value: $5
   2926  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   2927                                                     ^^^
   2928 input.y:18.10-72: warning: unset value: $$
   2929  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   2930           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2931 input.y:18.10-12: warning: unused value: $1
   2932  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   2933           ^^^
   2934 input.y:18.31-33: warning: unused value: $3
   2935  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   2936                                ^^^
   2937 input.y:18.66-68: warning: unused value: $5
   2938  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   2939                                                                   ^^^
   2940 input.y:21.10-68: warning: unset value: $$
   2941  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   2942           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   2943 input.y:21.10-12: warning: unused value: $1
   2944  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   2945           ^^^
   2946 input.y:21.14-16: warning: unused value: $2
   2947  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   2948               ^^^
   2949 _ATEOF
   2950 
   2951   at_bison_check_first=`sed -n \
   2952     '/: warning: /{=;q;}' at-bison-check-warnings`
   2953   : ${at_bison_check_first:=1}
   2954   at_bison_check_first_tmp=`sed -n \
   2955     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   2956   : ${at_bison_check_first_tmp:=1}
   2957   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   2958     at_bison_check_first=$at_bison_check_first_tmp
   2959   fi
   2960   if test $at_bison_check_first -gt 1; then
   2961     sed -n "1,`expr $at_bison_check_first - 1`"p \
   2962       at-bison-check-warnings > experr
   2963   fi
   2964   echo 'bison: warnings being treated as errors' >> experr
   2965 
   2966   # Finish building expected stderr and check.  Unlike warnings,
   2967   # complaints cause bison to exit early.  Thus, with -Werror, bison
   2968   # does not necessarily report all warnings that it does without
   2969   # -Werror, but it at least reports one.
   2970   at_bison_check_last=`sed -n '$=' stderr`
   2971   : ${at_bison_check_last:=1}
   2972   at_bison_check_last=`expr $at_bison_check_last - 1`
   2973   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   2974     at-bison-check-warnings >> experr
   2975   { set +x
   2976 $as_echo "$at_srcdir/input.at:286: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   2977               stderr 1>&2"
   2978 at_fn_check_prepare_notrace 'an embedded newline' "input.at:286"
   2979 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   2980               stderr 1>&2
   2981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2982 at_status=$? at_failed=false
   2983 $at_check_filter
   2984 $at_diff experr "$at_stderr" || at_failed=:
   2985 at_fn_diff_devnull "$at_stdout" || at_failed=:
   2986 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   2987 $at_failed && at_fn_log_failure
   2988 $at_traceon; }
   2989 
   2990 
   2991   # Now check --warnings=error.
   2992   cp stderr experr
   2993   { set +x
   2994 $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error"
   2995 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" "input.at:286"
   2996 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error
   2997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   2998 at_status=$? at_failed=false
   2999 $at_check_filter
   3000 $at_diff experr "$at_stderr" || at_failed=:
   3001 $at_diff expout "$at_stdout" || at_failed=:
   3002 at_fn_check_status 1 $at_status "$at_srcdir/input.at:286"
   3003 $at_failed && at_fn_log_failure
   3004 $at_traceon; }
   3005 
   3006 
   3007   # Now check -Wnone and --warnings=none by making sure that
   3008   # -Werror doesn't change the exit status when -Wnone or
   3009   # --warnings=none is specified.
   3010   { set +x
   3011 $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror"
   3012 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" "input.at:286"
   3013 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror
   3014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3015 at_status=$? at_failed=false
   3016 $at_check_filter
   3017 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3018 $at_diff expout "$at_stdout" || at_failed=:
   3019 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   3020 $at_failed && at_fn_log_failure
   3021 $at_traceon; }
   3022 
   3023   { set +x
   3024 $as_echo "$at_srcdir/input.at:286: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror"
   3025 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" "input.at:286"
   3026 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror
   3027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3028 at_status=$? at_failed=false
   3029 $at_check_filter
   3030 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3031 $at_diff expout "$at_stdout" || at_failed=:
   3032 at_fn_check_status 0 $at_status "$at_srcdir/input.at:286"
   3033 $at_failed && at_fn_log_failure
   3034 $at_traceon; }
   3035 
   3036 
   3037   at_restore_special_files
   3038 fi
   3039 
   3040 cat >input.y <<'_ATEOF'
   3041 %token <integer> INT;
   3042 %type <integer> a b c d e f g h i j k l;
   3043 %destructor { destroy ($$); } INT a b c d e f g h i j k l;
   3044 %%
   3045 start:
   3046   'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
   3047 | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
   3048 | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
   3049 ;
   3050 
   3051 a: INT | INT { } INT { } INT { };
   3052 b: INT | /* empty */;
   3053 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3054 d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3055 e: INT | INT { } INT {  } INT { $1; };
   3056 f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
   3057 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3058 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3059 i: INT | INT INT { } { $$ = $1 + $2; };
   3060 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   3061 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3062 l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
   3063 _ATEOF
   3064 
   3065 
   3066 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   3067   at_save_special_files
   3068   mkdir xml-tests
   3069     # Don't combine these Bison invocations since we want to be sure that
   3070   # --report=all isn't required to get the full XML file.
   3071   { set +x
   3072 $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   3073                   --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y"
   3074 at_fn_check_prepare_notrace 'an embedded newline' "input.at:287"
   3075 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   3076                   --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y
   3077 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3078 at_status=$? at_failed=false
   3079 $at_check_filter
   3080 echo stderr:; cat "$at_stderr"
   3081 echo stdout:; cat "$at_stdout"
   3082 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3083 $at_failed && at_fn_log_failure
   3084 $at_traceon; }
   3085 
   3086   { set +x
   3087 $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y"
   3088 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:287"
   3089 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y
   3090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3091 at_status=$? at_failed=false
   3092 $at_check_filter
   3093 echo stderr:; cat "$at_stderr"
   3094 echo stdout:; cat "$at_stdout"
   3095 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3096 $at_failed && at_fn_log_failure
   3097 $at_traceon; }
   3098 
   3099     cp xml-tests/test.output expout
   3100   { set +x
   3101 $as_echo "$at_srcdir/input.at:287: \$XSLTPROC \\
   3102              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   3103              xml-tests/test.xml"
   3104 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:287"
   3105 ( $at_check_trace; $XSLTPROC \
   3106              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   3107              xml-tests/test.xml
   3108 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3109 at_status=$? at_failed=false
   3110 $at_check_filter
   3111 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3112 $at_diff expout "$at_stdout" || at_failed=:
   3113 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3114 $at_failed && at_fn_log_failure
   3115 $at_traceon; }
   3116 
   3117   sort xml-tests/test.dot > expout
   3118   { set +x
   3119 $as_echo "$at_srcdir/input.at:287: \$XSLTPROC \\
   3120              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   3121              xml-tests/test.xml | sort"
   3122 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:287"
   3123 ( $at_check_trace; $XSLTPROC \
   3124              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   3125              xml-tests/test.xml | sort
   3126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3127 at_status=$? at_failed=false
   3128 $at_check_filter
   3129 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3130 $at_diff expout "$at_stdout" || at_failed=:
   3131 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3132 $at_failed && at_fn_log_failure
   3133 $at_traceon; }
   3134 
   3135   rm -rf xml-tests expout
   3136   at_restore_special_files
   3137 fi
   3138 { set +x
   3139 $as_echo "$at_srcdir/input.at:287: bison --warnings=midrule-values -fcaret input.y"
   3140 at_fn_check_prepare_trace "input.at:287"
   3141 ( $at_check_trace; bison --warnings=midrule-values -fcaret input.y
   3142 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3143 at_status=$? at_failed=false
   3144 $at_check_filter
   3145 echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
   3146  a: INT | INT { } INT { } INT { };
   3147           ^^^^^^^^^^^^^^^^^^^^^^^
   3148 input.y:11.10-12: warning: unused value: \$1
   3149  a: INT | INT { } INT { } INT { };
   3150           ^^^
   3151 input.y:11.18-20: warning: unused value: \$3
   3152  a: INT | INT { } INT { } INT { };
   3153                   ^^^
   3154 input.y:11.26-28: warning: unused value: \$5
   3155  a: INT | INT { } INT { } INT { };
   3156                           ^^^
   3157 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   3158  b: INT | /* empty */;
   3159          ^
   3160 input.y:13.14-20: warning: unset value: \$\$
   3161  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3162               ^^^^^^^
   3163 input.y:13.26-41: warning: unset value: \$\$
   3164  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3165                           ^^^^^^^^^^^^^^^^
   3166 input.y:13.10-62: warning: unset value: \$\$
   3167  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3168           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3169 input.y:13.22-24: warning: unused value: \$3
   3170  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3171                       ^^^
   3172 input.y:13.43-45: warning: unused value: \$5
   3173  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3174                                            ^^^
   3175 input.y:14.14-16: warning: unset value: \$\$
   3176  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3177               ^^^
   3178 input.y:14.10-49: warning: unset value: \$\$
   3179  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3180           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3181 input.y:14.18-20: warning: unused value: \$3
   3182  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3183                   ^^^
   3184 input.y:14.30-32: warning: unused value: \$5
   3185  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3186                               ^^^
   3187 input.y:15.10-37: warning: unset value: \$\$
   3188  e: INT | INT { } INT {  } INT { \$1; };
   3189           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3190 input.y:15.18-20: warning: unused value: \$3
   3191  e: INT | INT { } INT {  } INT { \$1; };
   3192                   ^^^
   3193 input.y:15.27-29: warning: unused value: \$5
   3194  e: INT | INT { } INT {  } INT { \$1; };
   3195                            ^^^
   3196 input.y:17.10-58: warning: unset value: \$\$
   3197  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3198           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3199 input.y:17.10-12: warning: unused value: \$1
   3200  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3201           ^^^
   3202 input.y:17.14-29: warning: unused value: \$2
   3203  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3204               ^^^^^^^^^^^^^^^^
   3205 input.y:17.31-33: warning: unused value: \$3
   3206  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3207                                ^^^
   3208 input.y:17.35-50: warning: unused value: \$4
   3209  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3210                                    ^^^^^^^^^^^^^^^^
   3211 input.y:17.52-54: warning: unused value: \$5
   3212  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3213                                                     ^^^
   3214 input.y:18.10-72: warning: unset value: \$\$
   3215  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3216           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3217 input.y:18.10-12: warning: unused value: \$1
   3218  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3219           ^^^
   3220 input.y:18.31-33: warning: unused value: \$3
   3221  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3222                                ^^^
   3223 input.y:18.35-64: warning: unused value: \$4
   3224  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3225                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3226 input.y:18.66-68: warning: unused value: \$5
   3227  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3228                                                                   ^^^
   3229 input.y:20.18-37: warning: unused value: \$3
   3230  j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
   3231                   ^^^^^^^^^^^^^^^^^^^^
   3232 input.y:21.10-68: warning: unset value: \$\$
   3233  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3234           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3235 input.y:21.10-12: warning: unused value: \$1
   3236  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3237           ^^^
   3238 input.y:21.14-16: warning: unused value: \$2
   3239  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3240               ^^^
   3241 input.y:21.35-64: warning: unused value: \$4
   3242  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3243                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3244 " | \
   3245   $at_diff - "$at_stderr" || at_failed=:
   3246 at_fn_diff_devnull "$at_stdout" || at_failed=:
   3247 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3248 $at_failed && at_fn_log_failure
   3249 $at_traceon; }
   3250 
   3251 # Defining POSIXLY_CORRECT causes bison to complain if options are
   3252 # added after the grammar file name, so skip these checks in that
   3253 # case.
   3254 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   3255   at_save_special_files
   3256 
   3257   # To avoid expanding it repeatedly, store specified stdout.
   3258   : >expout
   3259 
   3260   # Run with -Werror.
   3261   { set +x
   3262 $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror"
   3263 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror" "input.at:287"
   3264 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror
   3265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3266 at_status=$? at_failed=false
   3267 $at_check_filter
   3268 echo stderr:; tee stderr <"$at_stderr"
   3269 $at_diff expout "$at_stdout" || at_failed=:
   3270 at_fn_check_status 1 $at_status "$at_srcdir/input.at:287"
   3271 $at_failed && at_fn_log_failure
   3272 $at_traceon; }
   3273 
   3274 
   3275   # Build expected stderr up to and including the "warnings being
   3276   # treated as errors" message.
   3277   cat >at-bison-check-warnings <<'_ATEOF'
   3278 input.y:11.10-32: warning: unset value: $$
   3279  a: INT | INT { } INT { } INT { };
   3280           ^^^^^^^^^^^^^^^^^^^^^^^
   3281 input.y:11.10-12: warning: unused value: $1
   3282  a: INT | INT { } INT { } INT { };
   3283           ^^^
   3284 input.y:11.18-20: warning: unused value: $3
   3285  a: INT | INT { } INT { } INT { };
   3286                   ^^^
   3287 input.y:11.26-28: warning: unused value: $5
   3288  a: INT | INT { } INT { } INT { };
   3289                           ^^^
   3290 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   3291  b: INT | /* empty */;
   3292          ^
   3293 input.y:13.14-20: warning: unset value: $$
   3294  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3295               ^^^^^^^
   3296 input.y:13.26-41: warning: unset value: $$
   3297  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3298                           ^^^^^^^^^^^^^^^^
   3299 input.y:13.10-62: warning: unset value: $$
   3300  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3301           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3302 input.y:13.22-24: warning: unused value: $3
   3303  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3304                       ^^^
   3305 input.y:13.43-45: warning: unused value: $5
   3306  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3307                                            ^^^
   3308 input.y:14.14-16: warning: unset value: $$
   3309  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3310               ^^^
   3311 input.y:14.10-49: warning: unset value: $$
   3312  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3313           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3314 input.y:14.18-20: warning: unused value: $3
   3315  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3316                   ^^^
   3317 input.y:14.30-32: warning: unused value: $5
   3318  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3319                               ^^^
   3320 input.y:15.10-37: warning: unset value: $$
   3321  e: INT | INT { } INT {  } INT { $1; };
   3322           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3323 input.y:15.18-20: warning: unused value: $3
   3324  e: INT | INT { } INT {  } INT { $1; };
   3325                   ^^^
   3326 input.y:15.27-29: warning: unused value: $5
   3327  e: INT | INT { } INT {  } INT { $1; };
   3328                            ^^^
   3329 input.y:17.10-58: warning: unset value: $$
   3330  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3331           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3332 input.y:17.10-12: warning: unused value: $1
   3333  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3334           ^^^
   3335 input.y:17.14-29: warning: unused value: $2
   3336  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3337               ^^^^^^^^^^^^^^^^
   3338 input.y:17.31-33: warning: unused value: $3
   3339  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3340                                ^^^
   3341 input.y:17.35-50: warning: unused value: $4
   3342  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3343                                    ^^^^^^^^^^^^^^^^
   3344 input.y:17.52-54: warning: unused value: $5
   3345  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3346                                                     ^^^
   3347 input.y:18.10-72: warning: unset value: $$
   3348  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3349           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3350 input.y:18.10-12: warning: unused value: $1
   3351  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3352           ^^^
   3353 input.y:18.31-33: warning: unused value: $3
   3354  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3355                                ^^^
   3356 input.y:18.35-64: warning: unused value: $4
   3357  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3358                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3359 input.y:18.66-68: warning: unused value: $5
   3360  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3361                                                                   ^^^
   3362 input.y:20.18-37: warning: unused value: $3
   3363  j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   3364                   ^^^^^^^^^^^^^^^^^^^^
   3365 input.y:21.10-68: warning: unset value: $$
   3366  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3367           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3368 input.y:21.10-12: warning: unused value: $1
   3369  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3370           ^^^
   3371 input.y:21.14-16: warning: unused value: $2
   3372  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3373               ^^^
   3374 input.y:21.35-64: warning: unused value: $4
   3375  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3376                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3377 _ATEOF
   3378 
   3379   at_bison_check_first=`sed -n \
   3380     '/: warning: /{=;q;}' at-bison-check-warnings`
   3381   : ${at_bison_check_first:=1}
   3382   at_bison_check_first_tmp=`sed -n \
   3383     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   3384   : ${at_bison_check_first_tmp:=1}
   3385   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   3386     at_bison_check_first=$at_bison_check_first_tmp
   3387   fi
   3388   if test $at_bison_check_first -gt 1; then
   3389     sed -n "1,`expr $at_bison_check_first - 1`"p \
   3390       at-bison-check-warnings > experr
   3391   fi
   3392   echo 'bison: warnings being treated as errors' >> experr
   3393 
   3394   # Finish building expected stderr and check.  Unlike warnings,
   3395   # complaints cause bison to exit early.  Thus, with -Werror, bison
   3396   # does not necessarily report all warnings that it does without
   3397   # -Werror, but it at least reports one.
   3398   at_bison_check_last=`sed -n '$=' stderr`
   3399   : ${at_bison_check_last:=1}
   3400   at_bison_check_last=`expr $at_bison_check_last - 1`
   3401   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   3402     at-bison-check-warnings >> experr
   3403   { set +x
   3404 $as_echo "$at_srcdir/input.at:287: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   3405               stderr 1>&2"
   3406 at_fn_check_prepare_notrace 'an embedded newline' "input.at:287"
   3407 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   3408               stderr 1>&2
   3409 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3410 at_status=$? at_failed=false
   3411 $at_check_filter
   3412 $at_diff experr "$at_stderr" || at_failed=:
   3413 at_fn_diff_devnull "$at_stdout" || at_failed=:
   3414 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3415 $at_failed && at_fn_log_failure
   3416 $at_traceon; }
   3417 
   3418 
   3419   # Now check --warnings=error.
   3420   cp stderr experr
   3421   { set +x
   3422 $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error"
   3423 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:287"
   3424 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error
   3425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3426 at_status=$? at_failed=false
   3427 $at_check_filter
   3428 $at_diff experr "$at_stderr" || at_failed=:
   3429 $at_diff expout "$at_stdout" || at_failed=:
   3430 at_fn_check_status 1 $at_status "$at_srcdir/input.at:287"
   3431 $at_failed && at_fn_log_failure
   3432 $at_traceon; }
   3433 
   3434 
   3435   # Now check -Wnone and --warnings=none by making sure that
   3436   # -Werror doesn't change the exit status when -Wnone or
   3437   # --warnings=none is specified.
   3438   { set +x
   3439 $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror"
   3440 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror" "input.at:287"
   3441 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror
   3442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3443 at_status=$? at_failed=false
   3444 $at_check_filter
   3445 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3446 $at_diff expout "$at_stdout" || at_failed=:
   3447 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3448 $at_failed && at_fn_log_failure
   3449 $at_traceon; }
   3450 
   3451   { set +x
   3452 $as_echo "$at_srcdir/input.at:287: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror"
   3453 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror" "input.at:287"
   3454 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror
   3455 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3456 at_status=$? at_failed=false
   3457 $at_check_filter
   3458 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3459 $at_diff expout "$at_stdout" || at_failed=:
   3460 at_fn_check_status 0 $at_status "$at_srcdir/input.at:287"
   3461 $at_failed && at_fn_log_failure
   3462 $at_traceon; }
   3463 
   3464 
   3465   at_restore_special_files
   3466 fi
   3467 
   3468   set +x
   3469   $at_times_p && times >"$at_times_file"
   3470 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   3471 read at_status <"$at_status_file"
   3472 #AT_STOP_5
   3473 #AT_START_6
   3474 at_fn_group_banner 6 'input.at:295' \
   3475   "Unused values before symbol declarations" "       " 1
   3476 at_xfail=no
   3477 (
   3478   $as_echo "6. $at_setup_line: testing $at_desc ..."
   3479   $at_traceon
   3480 
   3481 cat >input.y <<'_ATEOF'
   3482 
   3483 
   3484 
   3485 %%
   3486 start:
   3487   'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
   3488 | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
   3489 | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
   3490 ;
   3491 
   3492 a: INT | INT { } INT { } INT { };
   3493 b: INT | /* empty */;
   3494 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3495 d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3496 e: INT | INT { } INT {  } INT { $1; };
   3497 f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
   3498 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3499 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3500 i: INT | INT INT { } { $$ = $1 + $2; };
   3501 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   3502 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3503 l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
   3504 %token <integer> INT;
   3505 %type <integer> a b c d e f g h i j k l;
   3506 %destructor { destroy ($$); } INT a b c d e f g h i j k l;
   3507 _ATEOF
   3508 
   3509 
   3510 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   3511   at_save_special_files
   3512   mkdir xml-tests
   3513     # Don't combine these Bison invocations since we want to be sure that
   3514   # --report=all isn't required to get the full XML file.
   3515   { set +x
   3516 $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   3517                   --graph=xml-tests/test.dot -fcaret input.y"
   3518 at_fn_check_prepare_notrace 'an embedded newline' "input.at:296"
   3519 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   3520                   --graph=xml-tests/test.dot -fcaret input.y
   3521 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3522 at_status=$? at_failed=false
   3523 $at_check_filter
   3524 echo stderr:; cat "$at_stderr"
   3525 echo stdout:; cat "$at_stdout"
   3526 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3527 $at_failed && at_fn_log_failure
   3528 $at_traceon; }
   3529 
   3530   { set +x
   3531 $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y"
   3532 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" "input.at:296"
   3533 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y
   3534 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3535 at_status=$? at_failed=false
   3536 $at_check_filter
   3537 echo stderr:; cat "$at_stderr"
   3538 echo stdout:; cat "$at_stdout"
   3539 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3540 $at_failed && at_fn_log_failure
   3541 $at_traceon; }
   3542 
   3543     cp xml-tests/test.output expout
   3544   { set +x
   3545 $as_echo "$at_srcdir/input.at:296: \$XSLTPROC \\
   3546              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   3547              xml-tests/test.xml"
   3548 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:296"
   3549 ( $at_check_trace; $XSLTPROC \
   3550              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   3551              xml-tests/test.xml
   3552 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3553 at_status=$? at_failed=false
   3554 $at_check_filter
   3555 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3556 $at_diff expout "$at_stdout" || at_failed=:
   3557 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3558 $at_failed && at_fn_log_failure
   3559 $at_traceon; }
   3560 
   3561   sort xml-tests/test.dot > expout
   3562   { set +x
   3563 $as_echo "$at_srcdir/input.at:296: \$XSLTPROC \\
   3564              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   3565              xml-tests/test.xml | sort"
   3566 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:296"
   3567 ( $at_check_trace; $XSLTPROC \
   3568              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   3569              xml-tests/test.xml | sort
   3570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3571 at_status=$? at_failed=false
   3572 $at_check_filter
   3573 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3574 $at_diff expout "$at_stdout" || at_failed=:
   3575 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3576 $at_failed && at_fn_log_failure
   3577 $at_traceon; }
   3578 
   3579   rm -rf xml-tests expout
   3580   at_restore_special_files
   3581 fi
   3582 { set +x
   3583 $as_echo "$at_srcdir/input.at:296: bison -fcaret input.y"
   3584 at_fn_check_prepare_trace "input.at:296"
   3585 ( $at_check_trace; bison -fcaret input.y
   3586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3587 at_status=$? at_failed=false
   3588 $at_check_filter
   3589 echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
   3590  a: INT | INT { } INT { } INT { };
   3591           ^^^^^^^^^^^^^^^^^^^^^^^
   3592 input.y:11.10-12: warning: unused value: \$1
   3593  a: INT | INT { } INT { } INT { };
   3594           ^^^
   3595 input.y:11.18-20: warning: unused value: \$3
   3596  a: INT | INT { } INT { } INT { };
   3597                   ^^^
   3598 input.y:11.26-28: warning: unused value: \$5
   3599  a: INT | INT { } INT { } INT { };
   3600                           ^^^
   3601 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   3602  b: INT | /* empty */;
   3603          ^
   3604 input.y:13.10-62: warning: unset value: \$\$
   3605  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3606           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3607 input.y:13.22-24: warning: unused value: \$3
   3608  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3609                       ^^^
   3610 input.y:13.43-45: warning: unused value: \$5
   3611  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3612                                            ^^^
   3613 input.y:14.10-49: warning: unset value: \$\$
   3614  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3615           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3616 input.y:14.18-20: warning: unused value: \$3
   3617  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3618                   ^^^
   3619 input.y:14.30-32: warning: unused value: \$5
   3620  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   3621                               ^^^
   3622 input.y:15.10-37: warning: unset value: \$\$
   3623  e: INT | INT { } INT {  } INT { \$1; };
   3624           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3625 input.y:15.18-20: warning: unused value: \$3
   3626  e: INT | INT { } INT {  } INT { \$1; };
   3627                   ^^^
   3628 input.y:15.27-29: warning: unused value: \$5
   3629  e: INT | INT { } INT {  } INT { \$1; };
   3630                            ^^^
   3631 input.y:17.10-58: warning: unset value: \$\$
   3632  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3633           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3634 input.y:17.10-12: warning: unused value: \$1
   3635  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3636           ^^^
   3637 input.y:17.31-33: warning: unused value: \$3
   3638  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3639                                ^^^
   3640 input.y:17.52-54: warning: unused value: \$5
   3641  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   3642                                                     ^^^
   3643 input.y:18.10-72: warning: unset value: \$\$
   3644  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3645           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3646 input.y:18.10-12: warning: unused value: \$1
   3647  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3648           ^^^
   3649 input.y:18.31-33: warning: unused value: \$3
   3650  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3651                                ^^^
   3652 input.y:18.66-68: warning: unused value: \$5
   3653  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   3654                                                                   ^^^
   3655 input.y:21.10-68: warning: unset value: \$\$
   3656  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3657           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3658 input.y:21.10-12: warning: unused value: \$1
   3659  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3660           ^^^
   3661 input.y:21.14-16: warning: unused value: \$2
   3662  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   3663               ^^^
   3664 " | \
   3665   $at_diff - "$at_stderr" || at_failed=:
   3666 at_fn_diff_devnull "$at_stdout" || at_failed=:
   3667 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3668 $at_failed && at_fn_log_failure
   3669 $at_traceon; }
   3670 
   3671 # Defining POSIXLY_CORRECT causes bison to complain if options are
   3672 # added after the grammar file name, so skip these checks in that
   3673 # case.
   3674 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   3675   at_save_special_files
   3676 
   3677   # To avoid expanding it repeatedly, store specified stdout.
   3678   : >expout
   3679 
   3680   # Run with -Werror.
   3681   { set +x
   3682 $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror"
   3683 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" "input.at:296"
   3684 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Werror
   3685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3686 at_status=$? at_failed=false
   3687 $at_check_filter
   3688 echo stderr:; tee stderr <"$at_stderr"
   3689 $at_diff expout "$at_stdout" || at_failed=:
   3690 at_fn_check_status 1 $at_status "$at_srcdir/input.at:296"
   3691 $at_failed && at_fn_log_failure
   3692 $at_traceon; }
   3693 
   3694 
   3695   # Build expected stderr up to and including the "warnings being
   3696   # treated as errors" message.
   3697   cat >at-bison-check-warnings <<'_ATEOF'
   3698 input.y:11.10-32: warning: unset value: $$
   3699  a: INT | INT { } INT { } INT { };
   3700           ^^^^^^^^^^^^^^^^^^^^^^^
   3701 input.y:11.10-12: warning: unused value: $1
   3702  a: INT | INT { } INT { } INT { };
   3703           ^^^
   3704 input.y:11.18-20: warning: unused value: $3
   3705  a: INT | INT { } INT { } INT { };
   3706                   ^^^
   3707 input.y:11.26-28: warning: unused value: $5
   3708  a: INT | INT { } INT { } INT { };
   3709                           ^^^
   3710 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   3711  b: INT | /* empty */;
   3712          ^
   3713 input.y:13.10-62: warning: unset value: $$
   3714  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3715           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3716 input.y:13.22-24: warning: unused value: $3
   3717  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3718                       ^^^
   3719 input.y:13.43-45: warning: unused value: $5
   3720  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3721                                            ^^^
   3722 input.y:14.10-49: warning: unset value: $$
   3723  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3724           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3725 input.y:14.18-20: warning: unused value: $3
   3726  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3727                   ^^^
   3728 input.y:14.30-32: warning: unused value: $5
   3729  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3730                               ^^^
   3731 input.y:15.10-37: warning: unset value: $$
   3732  e: INT | INT { } INT {  } INT { $1; };
   3733           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3734 input.y:15.18-20: warning: unused value: $3
   3735  e: INT | INT { } INT {  } INT { $1; };
   3736                   ^^^
   3737 input.y:15.27-29: warning: unused value: $5
   3738  e: INT | INT { } INT {  } INT { $1; };
   3739                            ^^^
   3740 input.y:17.10-58: warning: unset value: $$
   3741  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3742           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3743 input.y:17.10-12: warning: unused value: $1
   3744  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3745           ^^^
   3746 input.y:17.31-33: warning: unused value: $3
   3747  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3748                                ^^^
   3749 input.y:17.52-54: warning: unused value: $5
   3750  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3751                                                     ^^^
   3752 input.y:18.10-72: warning: unset value: $$
   3753  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3754           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3755 input.y:18.10-12: warning: unused value: $1
   3756  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3757           ^^^
   3758 input.y:18.31-33: warning: unused value: $3
   3759  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3760                                ^^^
   3761 input.y:18.66-68: warning: unused value: $5
   3762  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3763                                                                   ^^^
   3764 input.y:21.10-68: warning: unset value: $$
   3765  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3766           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3767 input.y:21.10-12: warning: unused value: $1
   3768  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3769           ^^^
   3770 input.y:21.14-16: warning: unused value: $2
   3771  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3772               ^^^
   3773 _ATEOF
   3774 
   3775   at_bison_check_first=`sed -n \
   3776     '/: warning: /{=;q;}' at-bison-check-warnings`
   3777   : ${at_bison_check_first:=1}
   3778   at_bison_check_first_tmp=`sed -n \
   3779     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   3780   : ${at_bison_check_first_tmp:=1}
   3781   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   3782     at_bison_check_first=$at_bison_check_first_tmp
   3783   fi
   3784   if test $at_bison_check_first -gt 1; then
   3785     sed -n "1,`expr $at_bison_check_first - 1`"p \
   3786       at-bison-check-warnings > experr
   3787   fi
   3788   echo 'bison: warnings being treated as errors' >> experr
   3789 
   3790   # Finish building expected stderr and check.  Unlike warnings,
   3791   # complaints cause bison to exit early.  Thus, with -Werror, bison
   3792   # does not necessarily report all warnings that it does without
   3793   # -Werror, but it at least reports one.
   3794   at_bison_check_last=`sed -n '$=' stderr`
   3795   : ${at_bison_check_last:=1}
   3796   at_bison_check_last=`expr $at_bison_check_last - 1`
   3797   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   3798     at-bison-check-warnings >> experr
   3799   { set +x
   3800 $as_echo "$at_srcdir/input.at:296: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   3801               stderr 1>&2"
   3802 at_fn_check_prepare_notrace 'an embedded newline' "input.at:296"
   3803 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   3804               stderr 1>&2
   3805 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3806 at_status=$? at_failed=false
   3807 $at_check_filter
   3808 $at_diff experr "$at_stderr" || at_failed=:
   3809 at_fn_diff_devnull "$at_stdout" || at_failed=:
   3810 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3811 $at_failed && at_fn_log_failure
   3812 $at_traceon; }
   3813 
   3814 
   3815   # Now check --warnings=error.
   3816   cp stderr experr
   3817   { set +x
   3818 $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error"
   3819 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" "input.at:296"
   3820 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error
   3821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3822 at_status=$? at_failed=false
   3823 $at_check_filter
   3824 $at_diff experr "$at_stderr" || at_failed=:
   3825 $at_diff expout "$at_stdout" || at_failed=:
   3826 at_fn_check_status 1 $at_status "$at_srcdir/input.at:296"
   3827 $at_failed && at_fn_log_failure
   3828 $at_traceon; }
   3829 
   3830 
   3831   # Now check -Wnone and --warnings=none by making sure that
   3832   # -Werror doesn't change the exit status when -Wnone or
   3833   # --warnings=none is specified.
   3834   { set +x
   3835 $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror"
   3836 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" "input.at:296"
   3837 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror
   3838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3839 at_status=$? at_failed=false
   3840 $at_check_filter
   3841 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3842 $at_diff expout "$at_stdout" || at_failed=:
   3843 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3844 $at_failed && at_fn_log_failure
   3845 $at_traceon; }
   3846 
   3847   { set +x
   3848 $as_echo "$at_srcdir/input.at:296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror"
   3849 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" "input.at:296"
   3850 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror
   3851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3852 at_status=$? at_failed=false
   3853 $at_check_filter
   3854 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3855 $at_diff expout "$at_stdout" || at_failed=:
   3856 at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
   3857 $at_failed && at_fn_log_failure
   3858 $at_traceon; }
   3859 
   3860 
   3861   at_restore_special_files
   3862 fi
   3863 
   3864 cat >input.y <<'_ATEOF'
   3865 
   3866 
   3867 
   3868 %%
   3869 start:
   3870   'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
   3871 | 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
   3872 | 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
   3873 ;
   3874 
   3875 a: INT | INT { } INT { } INT { };
   3876 b: INT | /* empty */;
   3877 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   3878 d: INT | INT { } INT { $1; } INT { $<integer>2; };
   3879 e: INT | INT { } INT {  } INT { $1; };
   3880 f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
   3881 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   3882 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   3883 i: INT | INT INT { } { $$ = $1 + $2; };
   3884 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   3885 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   3886 l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
   3887 %token <integer> INT;
   3888 %type <integer> a b c d e f g h i j k l;
   3889 %destructor { destroy ($$); } INT a b c d e f g h i j k l;
   3890 _ATEOF
   3891 
   3892 
   3893 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   3894   at_save_special_files
   3895   mkdir xml-tests
   3896     # Don't combine these Bison invocations since we want to be sure that
   3897   # --report=all isn't required to get the full XML file.
   3898   { set +x
   3899 $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   3900                   --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y"
   3901 at_fn_check_prepare_notrace 'an embedded newline' "input.at:297"
   3902 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   3903                   --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y
   3904 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3905 at_status=$? at_failed=false
   3906 $at_check_filter
   3907 echo stderr:; cat "$at_stderr"
   3908 echo stdout:; cat "$at_stdout"
   3909 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   3910 $at_failed && at_fn_log_failure
   3911 $at_traceon; }
   3912 
   3913   { set +x
   3914 $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y"
   3915 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:297"
   3916 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y
   3917 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3918 at_status=$? at_failed=false
   3919 $at_check_filter
   3920 echo stderr:; cat "$at_stderr"
   3921 echo stdout:; cat "$at_stdout"
   3922 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   3923 $at_failed && at_fn_log_failure
   3924 $at_traceon; }
   3925 
   3926     cp xml-tests/test.output expout
   3927   { set +x
   3928 $as_echo "$at_srcdir/input.at:297: \$XSLTPROC \\
   3929              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   3930              xml-tests/test.xml"
   3931 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:297"
   3932 ( $at_check_trace; $XSLTPROC \
   3933              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   3934              xml-tests/test.xml
   3935 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3936 at_status=$? at_failed=false
   3937 $at_check_filter
   3938 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3939 $at_diff expout "$at_stdout" || at_failed=:
   3940 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   3941 $at_failed && at_fn_log_failure
   3942 $at_traceon; }
   3943 
   3944   sort xml-tests/test.dot > expout
   3945   { set +x
   3946 $as_echo "$at_srcdir/input.at:297: \$XSLTPROC \\
   3947              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   3948              xml-tests/test.xml | sort"
   3949 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:297"
   3950 ( $at_check_trace; $XSLTPROC \
   3951              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   3952              xml-tests/test.xml | sort
   3953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3954 at_status=$? at_failed=false
   3955 $at_check_filter
   3956 at_fn_diff_devnull "$at_stderr" || at_failed=:
   3957 $at_diff expout "$at_stdout" || at_failed=:
   3958 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   3959 $at_failed && at_fn_log_failure
   3960 $at_traceon; }
   3961 
   3962   rm -rf xml-tests expout
   3963   at_restore_special_files
   3964 fi
   3965 { set +x
   3966 $as_echo "$at_srcdir/input.at:297: bison --warnings=midrule-values -fcaret input.y"
   3967 at_fn_check_prepare_trace "input.at:297"
   3968 ( $at_check_trace; bison --warnings=midrule-values -fcaret input.y
   3969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   3970 at_status=$? at_failed=false
   3971 $at_check_filter
   3972 echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
   3973  a: INT | INT { } INT { } INT { };
   3974           ^^^^^^^^^^^^^^^^^^^^^^^
   3975 input.y:11.10-12: warning: unused value: \$1
   3976  a: INT | INT { } INT { } INT { };
   3977           ^^^
   3978 input.y:11.18-20: warning: unused value: \$3
   3979  a: INT | INT { } INT { } INT { };
   3980                   ^^^
   3981 input.y:11.26-28: warning: unused value: \$5
   3982  a: INT | INT { } INT { } INT { };
   3983                           ^^^
   3984 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   3985  b: INT | /* empty */;
   3986          ^
   3987 input.y:13.14-20: warning: unset value: \$\$
   3988  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3989               ^^^^^^^
   3990 input.y:13.26-41: warning: unset value: \$\$
   3991  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3992                           ^^^^^^^^^^^^^^^^
   3993 input.y:13.10-62: warning: unset value: \$\$
   3994  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3995           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   3996 input.y:13.22-24: warning: unused value: \$3
   3997  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   3998                       ^^^
   3999 input.y:13.43-45: warning: unused value: \$5
   4000  c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
   4001                                            ^^^
   4002 input.y:14.14-16: warning: unset value: \$\$
   4003  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   4004               ^^^
   4005 input.y:14.10-49: warning: unset value: \$\$
   4006  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   4007           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4008 input.y:14.18-20: warning: unused value: \$3
   4009  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   4010                   ^^^
   4011 input.y:14.30-32: warning: unused value: \$5
   4012  d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
   4013                               ^^^
   4014 input.y:15.10-37: warning: unset value: \$\$
   4015  e: INT | INT { } INT {  } INT { \$1; };
   4016           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4017 input.y:15.18-20: warning: unused value: \$3
   4018  e: INT | INT { } INT {  } INT { \$1; };
   4019                   ^^^
   4020 input.y:15.27-29: warning: unused value: \$5
   4021  e: INT | INT { } INT {  } INT { \$1; };
   4022                            ^^^
   4023 input.y:17.10-58: warning: unset value: \$\$
   4024  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   4025           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4026 input.y:17.10-12: warning: unused value: \$1
   4027  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   4028           ^^^
   4029 input.y:17.14-29: warning: unused value: \$2
   4030  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   4031               ^^^^^^^^^^^^^^^^
   4032 input.y:17.31-33: warning: unused value: \$3
   4033  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   4034                                ^^^
   4035 input.y:17.35-50: warning: unused value: \$4
   4036  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   4037                                    ^^^^^^^^^^^^^^^^
   4038 input.y:17.52-54: warning: unused value: \$5
   4039  g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
   4040                                                     ^^^
   4041 input.y:18.10-72: warning: unset value: \$\$
   4042  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   4043           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4044 input.y:18.10-12: warning: unused value: \$1
   4045  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   4046           ^^^
   4047 input.y:18.31-33: warning: unused value: \$3
   4048  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   4049                                ^^^
   4050 input.y:18.35-64: warning: unused value: \$4
   4051  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   4052                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4053 input.y:18.66-68: warning: unused value: \$5
   4054  h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
   4055                                                                   ^^^
   4056 input.y:20.18-37: warning: unused value: \$3
   4057  j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
   4058                   ^^^^^^^^^^^^^^^^^^^^
   4059 input.y:21.10-68: warning: unset value: \$\$
   4060  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   4061           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4062 input.y:21.10-12: warning: unused value: \$1
   4063  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   4064           ^^^
   4065 input.y:21.14-16: warning: unused value: \$2
   4066  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   4067               ^^^
   4068 input.y:21.35-64: warning: unused value: \$4
   4069  k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
   4070                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4071 " | \
   4072   $at_diff - "$at_stderr" || at_failed=:
   4073 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4074 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   4075 $at_failed && at_fn_log_failure
   4076 $at_traceon; }
   4077 
   4078 # Defining POSIXLY_CORRECT causes bison to complain if options are
   4079 # added after the grammar file name, so skip these checks in that
   4080 # case.
   4081 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   4082   at_save_special_files
   4083 
   4084   # To avoid expanding it repeatedly, store specified stdout.
   4085   : >expout
   4086 
   4087   # Run with -Werror.
   4088   { set +x
   4089 $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror"
   4090 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror" "input.at:297"
   4091 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Werror
   4092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4093 at_status=$? at_failed=false
   4094 $at_check_filter
   4095 echo stderr:; tee stderr <"$at_stderr"
   4096 $at_diff expout "$at_stdout" || at_failed=:
   4097 at_fn_check_status 1 $at_status "$at_srcdir/input.at:297"
   4098 $at_failed && at_fn_log_failure
   4099 $at_traceon; }
   4100 
   4101 
   4102   # Build expected stderr up to and including the "warnings being
   4103   # treated as errors" message.
   4104   cat >at-bison-check-warnings <<'_ATEOF'
   4105 input.y:11.10-32: warning: unset value: $$
   4106  a: INT | INT { } INT { } INT { };
   4107           ^^^^^^^^^^^^^^^^^^^^^^^
   4108 input.y:11.10-12: warning: unused value: $1
   4109  a: INT | INT { } INT { } INT { };
   4110           ^^^
   4111 input.y:11.18-20: warning: unused value: $3
   4112  a: INT | INT { } INT { } INT { };
   4113                   ^^^
   4114 input.y:11.26-28: warning: unused value: $5
   4115  a: INT | INT { } INT { } INT { };
   4116                           ^^^
   4117 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   4118  b: INT | /* empty */;
   4119          ^
   4120 input.y:13.14-20: warning: unset value: $$
   4121  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   4122               ^^^^^^^
   4123 input.y:13.26-41: warning: unset value: $$
   4124  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   4125                           ^^^^^^^^^^^^^^^^
   4126 input.y:13.10-62: warning: unset value: $$
   4127  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   4128           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4129 input.y:13.22-24: warning: unused value: $3
   4130  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   4131                       ^^^
   4132 input.y:13.43-45: warning: unused value: $5
   4133  c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
   4134                                            ^^^
   4135 input.y:14.14-16: warning: unset value: $$
   4136  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   4137               ^^^
   4138 input.y:14.10-49: warning: unset value: $$
   4139  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   4140           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4141 input.y:14.18-20: warning: unused value: $3
   4142  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   4143                   ^^^
   4144 input.y:14.30-32: warning: unused value: $5
   4145  d: INT | INT { } INT { $1; } INT { $<integer>2; };
   4146                               ^^^
   4147 input.y:15.10-37: warning: unset value: $$
   4148  e: INT | INT { } INT {  } INT { $1; };
   4149           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4150 input.y:15.18-20: warning: unused value: $3
   4151  e: INT | INT { } INT {  } INT { $1; };
   4152                   ^^^
   4153 input.y:15.27-29: warning: unused value: $5
   4154  e: INT | INT { } INT {  } INT { $1; };
   4155                            ^^^
   4156 input.y:17.10-58: warning: unset value: $$
   4157  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   4158           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4159 input.y:17.10-12: warning: unused value: $1
   4160  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   4161           ^^^
   4162 input.y:17.14-29: warning: unused value: $2
   4163  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   4164               ^^^^^^^^^^^^^^^^
   4165 input.y:17.31-33: warning: unused value: $3
   4166  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   4167                                ^^^
   4168 input.y:17.35-50: warning: unused value: $4
   4169  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   4170                                    ^^^^^^^^^^^^^^^^
   4171 input.y:17.52-54: warning: unused value: $5
   4172  g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
   4173                                                     ^^^
   4174 input.y:18.10-72: warning: unset value: $$
   4175  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   4176           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4177 input.y:18.10-12: warning: unused value: $1
   4178  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   4179           ^^^
   4180 input.y:18.31-33: warning: unused value: $3
   4181  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   4182                                ^^^
   4183 input.y:18.35-64: warning: unused value: $4
   4184  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   4185                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4186 input.y:18.66-68: warning: unused value: $5
   4187  h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
   4188                                                                   ^^^
   4189 input.y:20.18-37: warning: unused value: $3
   4190  j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   4191                   ^^^^^^^^^^^^^^^^^^^^
   4192 input.y:21.10-68: warning: unset value: $$
   4193  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   4194           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4195 input.y:21.10-12: warning: unused value: $1
   4196  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   4197           ^^^
   4198 input.y:21.14-16: warning: unused value: $2
   4199  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   4200               ^^^
   4201 input.y:21.35-64: warning: unused value: $4
   4202  k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
   4203                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   4204 _ATEOF
   4205 
   4206   at_bison_check_first=`sed -n \
   4207     '/: warning: /{=;q;}' at-bison-check-warnings`
   4208   : ${at_bison_check_first:=1}
   4209   at_bison_check_first_tmp=`sed -n \
   4210     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   4211   : ${at_bison_check_first_tmp:=1}
   4212   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   4213     at_bison_check_first=$at_bison_check_first_tmp
   4214   fi
   4215   if test $at_bison_check_first -gt 1; then
   4216     sed -n "1,`expr $at_bison_check_first - 1`"p \
   4217       at-bison-check-warnings > experr
   4218   fi
   4219   echo 'bison: warnings being treated as errors' >> experr
   4220 
   4221   # Finish building expected stderr and check.  Unlike warnings,
   4222   # complaints cause bison to exit early.  Thus, with -Werror, bison
   4223   # does not necessarily report all warnings that it does without
   4224   # -Werror, but it at least reports one.
   4225   at_bison_check_last=`sed -n '$=' stderr`
   4226   : ${at_bison_check_last:=1}
   4227   at_bison_check_last=`expr $at_bison_check_last - 1`
   4228   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   4229     at-bison-check-warnings >> experr
   4230   { set +x
   4231 $as_echo "$at_srcdir/input.at:297: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   4232               stderr 1>&2"
   4233 at_fn_check_prepare_notrace 'an embedded newline' "input.at:297"
   4234 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   4235               stderr 1>&2
   4236 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4237 at_status=$? at_failed=false
   4238 $at_check_filter
   4239 $at_diff experr "$at_stderr" || at_failed=:
   4240 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4241 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   4242 $at_failed && at_fn_log_failure
   4243 $at_traceon; }
   4244 
   4245 
   4246   # Now check --warnings=error.
   4247   cp stderr experr
   4248   { set +x
   4249 $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error"
   4250 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:297"
   4251 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=error
   4252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4253 at_status=$? at_failed=false
   4254 $at_check_filter
   4255 $at_diff experr "$at_stderr" || at_failed=:
   4256 $at_diff expout "$at_stdout" || at_failed=:
   4257 at_fn_check_status 1 $at_status "$at_srcdir/input.at:297"
   4258 $at_failed && at_fn_log_failure
   4259 $at_traceon; }
   4260 
   4261 
   4262   # Now check -Wnone and --warnings=none by making sure that
   4263   # -Werror doesn't change the exit status when -Wnone or
   4264   # --warnings=none is specified.
   4265   { set +x
   4266 $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror"
   4267 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror" "input.at:297"
   4268 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y -Wnone -Werror
   4269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4270 at_status=$? at_failed=false
   4271 $at_check_filter
   4272 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4273 $at_diff expout "$at_stdout" || at_failed=:
   4274 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   4275 $at_failed && at_fn_log_failure
   4276 $at_traceon; }
   4277 
   4278   { set +x
   4279 $as_echo "$at_srcdir/input.at:297: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror"
   4280 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror" "input.at:297"
   4281 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --warnings=midrule-values -fcaret input.y --warnings=none -Werror
   4282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4283 at_status=$? at_failed=false
   4284 $at_check_filter
   4285 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4286 $at_diff expout "$at_stdout" || at_failed=:
   4287 at_fn_check_status 0 $at_status "$at_srcdir/input.at:297"
   4288 $at_failed && at_fn_log_failure
   4289 $at_traceon; }
   4290 
   4291 
   4292   at_restore_special_files
   4293 fi
   4294 
   4295   set +x
   4296   $at_times_p && times >"$at_times_file"
   4297 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   4298 read at_status <"$at_status_file"
   4299 #AT_STOP_6
   4300 #AT_START_7
   4301 at_fn_group_banner 7 'input.at:305' \
   4302   "Default %printer and %destructor redeclared" "    " 1
   4303 at_xfail=no
   4304 (
   4305   $as_echo "7. $at_setup_line: testing $at_desc ..."
   4306   $at_traceon
   4307 
   4308 
   4309 cat >input.y <<'_ATEOF'
   4310 %destructor { destroy ($$); } <*> <*>
   4311 %printer { print ($$); } <*> <*>
   4312 
   4313 %destructor { destroy ($$); } <*>
   4314 %printer { print ($$); } <*>
   4315 
   4316 %destructor { destroy ($$); } <> <>
   4317 %printer { print ($$); } <> <>
   4318 
   4319 %destructor { destroy ($$); } <>
   4320 %printer { print ($$); } <>
   4321 
   4322 %%
   4323 
   4324 start: ;
   4325 
   4326 %destructor { destroy ($$); } <*>;
   4327 %printer { print ($$); } <*>;
   4328 
   4329 %destructor { destroy ($$); } <>;
   4330 %printer { print ($$); } <>;
   4331 _ATEOF
   4332 
   4333 
   4334 
   4335 { set +x
   4336 $as_echo "$at_srcdir/input.at:331: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   4337 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:331"
   4338 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   4339 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4340 at_status=$? at_failed=false
   4341 $at_check_filter
   4342 echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: redeclaration for default tagged %destructor
   4343 input.y:1.13-29:     previous declaration
   4344 input.y:2.10-24: error: redeclaration for default tagged %printer
   4345 input.y:2.10-24:     previous declaration
   4346 input.y:4.13-29: error: redeclaration for default tagged %destructor
   4347 input.y:1.13-29:     previous declaration
   4348 input.y:5.10-24: error: redeclaration for default tagged %printer
   4349 input.y:2.10-24:     previous declaration
   4350 input.y:7.13-29: error: redeclaration for default tagless %destructor
   4351 input.y:7.13-29:     previous declaration
   4352 input.y:8.10-24: error: redeclaration for default tagless %printer
   4353 input.y:8.10-24:     previous declaration
   4354 input.y:10.13-29: error: redeclaration for default tagless %destructor
   4355 input.y:7.13-29:      previous declaration
   4356 input.y:11.10-24: error: redeclaration for default tagless %printer
   4357 input.y:8.10-24:      previous declaration
   4358 input.y:17.13-29: error: redeclaration for default tagged %destructor
   4359 input.y:4.13-29:      previous declaration
   4360 input.y:18.10-24: error: redeclaration for default tagged %printer
   4361 input.y:5.10-24:      previous declaration
   4362 input.y:20.13-29: error: redeclaration for default tagless %destructor
   4363 input.y:10.13-29:     previous declaration
   4364 input.y:21.10-24: error: redeclaration for default tagless %printer
   4365 input.y:11.10-24:     previous declaration
   4366 " | \
   4367   $at_diff - "$at_stderr" || at_failed=:
   4368 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4369 at_fn_check_status 1 $at_status "$at_srcdir/input.at:331"
   4370 $at_failed && at_fn_log_failure
   4371 $at_traceon; }
   4372 
   4373 
   4374 
   4375   set +x
   4376   $at_times_p && times >"$at_times_file"
   4377 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   4378 read at_status <"$at_status_file"
   4379 #AT_STOP_7
   4380 #AT_START_8
   4381 at_fn_group_banner 8 'input.at:365' \
   4382   "Per-type %printer and %destructor redeclared" "   " 1
   4383 at_xfail=no
   4384 (
   4385   $as_echo "8. $at_setup_line: testing $at_desc ..."
   4386   $at_traceon
   4387 
   4388 
   4389 cat >input.y <<'_ATEOF'
   4390 %destructor { destroy ($$); } <field1> <field2>
   4391 %printer { print ($$); } <field1> <field2>
   4392 
   4393 %destructor { destroy ($$); } <field1> <field1>
   4394 %printer { print ($$); } <field2> <field2>
   4395 
   4396 %%
   4397 
   4398 start: ;
   4399 
   4400 %destructor { destroy ($$); } <field2> <field1>;
   4401 %printer { print ($$); } <field2> <field1>;
   4402 _ATEOF
   4403 
   4404 
   4405 
   4406 { set +x
   4407 $as_echo "$at_srcdir/input.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   4408 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:382"
   4409 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   4410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4411 at_status=$? at_failed=false
   4412 $at_check_filter
   4413 echo >>"$at_stderr"; $as_echo "input.y:4.13-29: error: %destructor redeclaration for <field1>
   4414 input.y:1.13-29:     previous declaration
   4415 input.y:4.13-29: error: %destructor redeclaration for <field1>
   4416 input.y:4.13-29:     previous declaration
   4417 input.y:5.10-24: error: %printer redeclaration for <field2>
   4418 input.y:2.10-24:     previous declaration
   4419 input.y:5.10-24: error: %printer redeclaration for <field2>
   4420 input.y:5.10-24:     previous declaration
   4421 input.y:11.13-29: error: %destructor redeclaration for <field1>
   4422 input.y:4.13-29:      previous declaration
   4423 input.y:11.13-29: error: %destructor redeclaration for <field2>
   4424 input.y:1.13-29:      previous declaration
   4425 input.y:12.10-24: error: %printer redeclaration for <field1>
   4426 input.y:2.10-24:      previous declaration
   4427 input.y:12.10-24: error: %printer redeclaration for <field2>
   4428 input.y:5.10-24:      previous declaration
   4429 " | \
   4430   $at_diff - "$at_stderr" || at_failed=:
   4431 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4432 at_fn_check_status 1 $at_status "$at_srcdir/input.at:382"
   4433 $at_failed && at_fn_log_failure
   4434 $at_traceon; }
   4435 
   4436 
   4437 
   4438   set +x
   4439   $at_times_p && times >"$at_times_file"
   4440 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   4441 read at_status <"$at_status_file"
   4442 #AT_STOP_8
   4443 #AT_START_9
   4444 at_fn_group_banner 9 'input.at:408' \
   4445   "Unused values with default %destructor" "         " 1
   4446 at_xfail=no
   4447 (
   4448   $as_echo "9. $at_setup_line: testing $at_desc ..."
   4449   $at_traceon
   4450 
   4451 
   4452 cat >input.y <<'_ATEOF'
   4453 %destructor { destroy ($$); } <>
   4454 %type <tag> tagged
   4455 
   4456 %%
   4457 
   4458 start: end end tagged tagged { $<tag>1; $3; } ;
   4459 end: { } ;
   4460 tagged: { } ;
   4461 _ATEOF
   4462 
   4463 
   4464 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   4465   at_save_special_files
   4466   mkdir xml-tests
   4467     # Don't combine these Bison invocations since we want to be sure that
   4468   # --report=all isn't required to get the full XML file.
   4469   { set +x
   4470 $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   4471                   --graph=xml-tests/test.dot input.y"
   4472 at_fn_check_prepare_notrace 'an embedded newline' "input.at:421"
   4473 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   4474                   --graph=xml-tests/test.dot input.y
   4475 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4476 at_status=$? at_failed=false
   4477 $at_check_filter
   4478 echo stderr:; cat "$at_stderr"
   4479 echo stdout:; cat "$at_stdout"
   4480 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4481 $at_failed && at_fn_log_failure
   4482 $at_traceon; }
   4483 
   4484   { set +x
   4485 $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   4486 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:421"
   4487 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   4488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4489 at_status=$? at_failed=false
   4490 $at_check_filter
   4491 echo stderr:; cat "$at_stderr"
   4492 echo stdout:; cat "$at_stdout"
   4493 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4494 $at_failed && at_fn_log_failure
   4495 $at_traceon; }
   4496 
   4497     cp xml-tests/test.output expout
   4498   { set +x
   4499 $as_echo "$at_srcdir/input.at:421: \$XSLTPROC \\
   4500              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   4501              xml-tests/test.xml"
   4502 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:421"
   4503 ( $at_check_trace; $XSLTPROC \
   4504              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   4505              xml-tests/test.xml
   4506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4507 at_status=$? at_failed=false
   4508 $at_check_filter
   4509 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4510 $at_diff expout "$at_stdout" || at_failed=:
   4511 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4512 $at_failed && at_fn_log_failure
   4513 $at_traceon; }
   4514 
   4515   sort xml-tests/test.dot > expout
   4516   { set +x
   4517 $as_echo "$at_srcdir/input.at:421: \$XSLTPROC \\
   4518              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   4519              xml-tests/test.xml | sort"
   4520 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:421"
   4521 ( $at_check_trace; $XSLTPROC \
   4522              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   4523              xml-tests/test.xml | sort
   4524 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4525 at_status=$? at_failed=false
   4526 $at_check_filter
   4527 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4528 $at_diff expout "$at_stdout" || at_failed=:
   4529 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4530 $at_failed && at_fn_log_failure
   4531 $at_traceon; }
   4532 
   4533   rm -rf xml-tests expout
   4534   at_restore_special_files
   4535 fi
   4536 { set +x
   4537 $as_echo "$at_srcdir/input.at:421: bison input.y"
   4538 at_fn_check_prepare_trace "input.at:421"
   4539 ( $at_check_trace; bison input.y
   4540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4541 at_status=$? at_failed=false
   4542 $at_check_filter
   4543 echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unset value: \$\$
   4544 input.y:6.12-14: warning: unused value: \$2
   4545 input.y:7.6-8: warning: unset value: \$\$
   4546 " | \
   4547   $at_diff - "$at_stderr" || at_failed=:
   4548 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4549 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4550 $at_failed && at_fn_log_failure
   4551 $at_traceon; }
   4552 
   4553 # Defining POSIXLY_CORRECT causes bison to complain if options are
   4554 # added after the grammar file name, so skip these checks in that
   4555 # case.
   4556 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   4557   at_save_special_files
   4558 
   4559   # To avoid expanding it repeatedly, store specified stdout.
   4560   : >expout
   4561 
   4562   # Run with -Werror.
   4563   { set +x
   4564 $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   4565 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:421"
   4566 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   4567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4568 at_status=$? at_failed=false
   4569 $at_check_filter
   4570 echo stderr:; tee stderr <"$at_stderr"
   4571 $at_diff expout "$at_stdout" || at_failed=:
   4572 at_fn_check_status 1 $at_status "$at_srcdir/input.at:421"
   4573 $at_failed && at_fn_log_failure
   4574 $at_traceon; }
   4575 
   4576 
   4577   # Build expected stderr up to and including the "warnings being
   4578   # treated as errors" message.
   4579   cat >at-bison-check-warnings <<'_ATEOF'
   4580 input.y:6.8-45: warning: unset value: $$
   4581 input.y:6.12-14: warning: unused value: $2
   4582 input.y:7.6-8: warning: unset value: $$
   4583 _ATEOF
   4584 
   4585   at_bison_check_first=`sed -n \
   4586     '/: warning: /{=;q;}' at-bison-check-warnings`
   4587   : ${at_bison_check_first:=1}
   4588   at_bison_check_first_tmp=`sed -n \
   4589     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   4590   : ${at_bison_check_first_tmp:=1}
   4591   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   4592     at_bison_check_first=$at_bison_check_first_tmp
   4593   fi
   4594   if test $at_bison_check_first -gt 1; then
   4595     sed -n "1,`expr $at_bison_check_first - 1`"p \
   4596       at-bison-check-warnings > experr
   4597   fi
   4598   echo 'bison: warnings being treated as errors' >> experr
   4599 
   4600   # Finish building expected stderr and check.  Unlike warnings,
   4601   # complaints cause bison to exit early.  Thus, with -Werror, bison
   4602   # does not necessarily report all warnings that it does without
   4603   # -Werror, but it at least reports one.
   4604   at_bison_check_last=`sed -n '$=' stderr`
   4605   : ${at_bison_check_last:=1}
   4606   at_bison_check_last=`expr $at_bison_check_last - 1`
   4607   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   4608     at-bison-check-warnings >> experr
   4609   { set +x
   4610 $as_echo "$at_srcdir/input.at:421: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   4611               stderr 1>&2"
   4612 at_fn_check_prepare_notrace 'an embedded newline' "input.at:421"
   4613 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   4614               stderr 1>&2
   4615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4616 at_status=$? at_failed=false
   4617 $at_check_filter
   4618 $at_diff experr "$at_stderr" || at_failed=:
   4619 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4620 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4621 $at_failed && at_fn_log_failure
   4622 $at_traceon; }
   4623 
   4624 
   4625   # Now check --warnings=error.
   4626   cp stderr experr
   4627   { set +x
   4628 $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   4629 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:421"
   4630 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   4631 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4632 at_status=$? at_failed=false
   4633 $at_check_filter
   4634 $at_diff experr "$at_stderr" || at_failed=:
   4635 $at_diff expout "$at_stdout" || at_failed=:
   4636 at_fn_check_status 1 $at_status "$at_srcdir/input.at:421"
   4637 $at_failed && at_fn_log_failure
   4638 $at_traceon; }
   4639 
   4640 
   4641   # Now check -Wnone and --warnings=none by making sure that
   4642   # -Werror doesn't change the exit status when -Wnone or
   4643   # --warnings=none is specified.
   4644   { set +x
   4645 $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   4646 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:421"
   4647 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   4648 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4649 at_status=$? at_failed=false
   4650 $at_check_filter
   4651 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4652 $at_diff expout "$at_stdout" || at_failed=:
   4653 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4654 $at_failed && at_fn_log_failure
   4655 $at_traceon; }
   4656 
   4657   { set +x
   4658 $as_echo "$at_srcdir/input.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   4659 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:421"
   4660 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   4661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4662 at_status=$? at_failed=false
   4663 $at_check_filter
   4664 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4665 $at_diff expout "$at_stdout" || at_failed=:
   4666 at_fn_check_status 0 $at_status "$at_srcdir/input.at:421"
   4667 $at_failed && at_fn_log_failure
   4668 $at_traceon; }
   4669 
   4670 
   4671   at_restore_special_files
   4672 fi
   4673 
   4674 cat >input.y <<'_ATEOF'
   4675 %destructor { destroy ($$); } <*>
   4676 %type <tag> tagged
   4677 
   4678 %%
   4679 
   4680 start: end end tagged tagged { $<tag>1; $3; } ;
   4681 end: { } ;
   4682 tagged: { } ;
   4683 _ATEOF
   4684 
   4685 
   4686 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   4687   at_save_special_files
   4688   mkdir xml-tests
   4689     # Don't combine these Bison invocations since we want to be sure that
   4690   # --report=all isn't required to get the full XML file.
   4691   { set +x
   4692 $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   4693                   --graph=xml-tests/test.dot input.y"
   4694 at_fn_check_prepare_notrace 'an embedded newline' "input.at:438"
   4695 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   4696                   --graph=xml-tests/test.dot input.y
   4697 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4698 at_status=$? at_failed=false
   4699 $at_check_filter
   4700 echo stderr:; cat "$at_stderr"
   4701 echo stdout:; cat "$at_stdout"
   4702 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4703 $at_failed && at_fn_log_failure
   4704 $at_traceon; }
   4705 
   4706   { set +x
   4707 $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   4708 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:438"
   4709 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   4710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4711 at_status=$? at_failed=false
   4712 $at_check_filter
   4713 echo stderr:; cat "$at_stderr"
   4714 echo stdout:; cat "$at_stdout"
   4715 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4716 $at_failed && at_fn_log_failure
   4717 $at_traceon; }
   4718 
   4719     cp xml-tests/test.output expout
   4720   { set +x
   4721 $as_echo "$at_srcdir/input.at:438: \$XSLTPROC \\
   4722              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   4723              xml-tests/test.xml"
   4724 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:438"
   4725 ( $at_check_trace; $XSLTPROC \
   4726              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   4727              xml-tests/test.xml
   4728 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4729 at_status=$? at_failed=false
   4730 $at_check_filter
   4731 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4732 $at_diff expout "$at_stdout" || at_failed=:
   4733 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4734 $at_failed && at_fn_log_failure
   4735 $at_traceon; }
   4736 
   4737   sort xml-tests/test.dot > expout
   4738   { set +x
   4739 $as_echo "$at_srcdir/input.at:438: \$XSLTPROC \\
   4740              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   4741              xml-tests/test.xml | sort"
   4742 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:438"
   4743 ( $at_check_trace; $XSLTPROC \
   4744              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   4745              xml-tests/test.xml | sort
   4746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4747 at_status=$? at_failed=false
   4748 $at_check_filter
   4749 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4750 $at_diff expout "$at_stdout" || at_failed=:
   4751 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4752 $at_failed && at_fn_log_failure
   4753 $at_traceon; }
   4754 
   4755   rm -rf xml-tests expout
   4756   at_restore_special_files
   4757 fi
   4758 { set +x
   4759 $as_echo "$at_srcdir/input.at:438: bison input.y"
   4760 at_fn_check_prepare_trace "input.at:438"
   4761 ( $at_check_trace; bison input.y
   4762 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4763 at_status=$? at_failed=false
   4764 $at_check_filter
   4765 echo >>"$at_stderr"; $as_echo "input.y:6.23-28: warning: unused value: \$4
   4766 input.y:8.9-11: warning: unset value: \$\$
   4767 " | \
   4768   $at_diff - "$at_stderr" || at_failed=:
   4769 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4770 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4771 $at_failed && at_fn_log_failure
   4772 $at_traceon; }
   4773 
   4774 # Defining POSIXLY_CORRECT causes bison to complain if options are
   4775 # added after the grammar file name, so skip these checks in that
   4776 # case.
   4777 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   4778   at_save_special_files
   4779 
   4780   # To avoid expanding it repeatedly, store specified stdout.
   4781   : >expout
   4782 
   4783   # Run with -Werror.
   4784   { set +x
   4785 $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   4786 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:438"
   4787 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   4788 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4789 at_status=$? at_failed=false
   4790 $at_check_filter
   4791 echo stderr:; tee stderr <"$at_stderr"
   4792 $at_diff expout "$at_stdout" || at_failed=:
   4793 at_fn_check_status 1 $at_status "$at_srcdir/input.at:438"
   4794 $at_failed && at_fn_log_failure
   4795 $at_traceon; }
   4796 
   4797 
   4798   # Build expected stderr up to and including the "warnings being
   4799   # treated as errors" message.
   4800   cat >at-bison-check-warnings <<'_ATEOF'
   4801 input.y:6.23-28: warning: unused value: $4
   4802 input.y:8.9-11: warning: unset value: $$
   4803 _ATEOF
   4804 
   4805   at_bison_check_first=`sed -n \
   4806     '/: warning: /{=;q;}' at-bison-check-warnings`
   4807   : ${at_bison_check_first:=1}
   4808   at_bison_check_first_tmp=`sed -n \
   4809     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   4810   : ${at_bison_check_first_tmp:=1}
   4811   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   4812     at_bison_check_first=$at_bison_check_first_tmp
   4813   fi
   4814   if test $at_bison_check_first -gt 1; then
   4815     sed -n "1,`expr $at_bison_check_first - 1`"p \
   4816       at-bison-check-warnings > experr
   4817   fi
   4818   echo 'bison: warnings being treated as errors' >> experr
   4819 
   4820   # Finish building expected stderr and check.  Unlike warnings,
   4821   # complaints cause bison to exit early.  Thus, with -Werror, bison
   4822   # does not necessarily report all warnings that it does without
   4823   # -Werror, but it at least reports one.
   4824   at_bison_check_last=`sed -n '$=' stderr`
   4825   : ${at_bison_check_last:=1}
   4826   at_bison_check_last=`expr $at_bison_check_last - 1`
   4827   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   4828     at-bison-check-warnings >> experr
   4829   { set +x
   4830 $as_echo "$at_srcdir/input.at:438: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   4831               stderr 1>&2"
   4832 at_fn_check_prepare_notrace 'an embedded newline' "input.at:438"
   4833 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   4834               stderr 1>&2
   4835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4836 at_status=$? at_failed=false
   4837 $at_check_filter
   4838 $at_diff experr "$at_stderr" || at_failed=:
   4839 at_fn_diff_devnull "$at_stdout" || at_failed=:
   4840 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4841 $at_failed && at_fn_log_failure
   4842 $at_traceon; }
   4843 
   4844 
   4845   # Now check --warnings=error.
   4846   cp stderr experr
   4847   { set +x
   4848 $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   4849 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:438"
   4850 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   4851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4852 at_status=$? at_failed=false
   4853 $at_check_filter
   4854 $at_diff experr "$at_stderr" || at_failed=:
   4855 $at_diff expout "$at_stdout" || at_failed=:
   4856 at_fn_check_status 1 $at_status "$at_srcdir/input.at:438"
   4857 $at_failed && at_fn_log_failure
   4858 $at_traceon; }
   4859 
   4860 
   4861   # Now check -Wnone and --warnings=none by making sure that
   4862   # -Werror doesn't change the exit status when -Wnone or
   4863   # --warnings=none is specified.
   4864   { set +x
   4865 $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   4866 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:438"
   4867 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   4868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4869 at_status=$? at_failed=false
   4870 $at_check_filter
   4871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4872 $at_diff expout "$at_stdout" || at_failed=:
   4873 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4874 $at_failed && at_fn_log_failure
   4875 $at_traceon; }
   4876 
   4877   { set +x
   4878 $as_echo "$at_srcdir/input.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   4879 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:438"
   4880 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   4881 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4882 at_status=$? at_failed=false
   4883 $at_check_filter
   4884 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4885 $at_diff expout "$at_stdout" || at_failed=:
   4886 at_fn_check_status 0 $at_status "$at_srcdir/input.at:438"
   4887 $at_failed && at_fn_log_failure
   4888 $at_traceon; }
   4889 
   4890 
   4891   at_restore_special_files
   4892 fi
   4893 
   4894   set +x
   4895   $at_times_p && times >"$at_times_file"
   4896 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   4897 read at_status <"$at_status_file"
   4898 #AT_STOP_9
   4899 #AT_START_10
   4900 at_fn_group_banner 10 'input.at:450' \
   4901   "Unused values with per-type %destructor" "        " 1
   4902 at_xfail=no
   4903 (
   4904   $as_echo "10. $at_setup_line: testing $at_desc ..."
   4905   $at_traceon
   4906 
   4907 
   4908 cat >input.y <<'_ATEOF'
   4909 %destructor { destroy ($$); } <field1>
   4910 %type <field1> start end
   4911 
   4912 %%
   4913 
   4914 start: end end { $1; } ;
   4915 end: { }  ;
   4916 _ATEOF
   4917 
   4918 
   4919 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   4920   at_save_special_files
   4921   mkdir xml-tests
   4922     # Don't combine these Bison invocations since we want to be sure that
   4923   # --report=all isn't required to get the full XML file.
   4924   { set +x
   4925 $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   4926                   --graph=xml-tests/test.dot input.y"
   4927 at_fn_check_prepare_notrace 'an embedded newline' "input.at:462"
   4928 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   4929                   --graph=xml-tests/test.dot input.y
   4930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4931 at_status=$? at_failed=false
   4932 $at_check_filter
   4933 echo stderr:; cat "$at_stderr"
   4934 echo stdout:; cat "$at_stdout"
   4935 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   4936 $at_failed && at_fn_log_failure
   4937 $at_traceon; }
   4938 
   4939   { set +x
   4940 $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   4941 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:462"
   4942 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   4943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4944 at_status=$? at_failed=false
   4945 $at_check_filter
   4946 echo stderr:; cat "$at_stderr"
   4947 echo stdout:; cat "$at_stdout"
   4948 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   4949 $at_failed && at_fn_log_failure
   4950 $at_traceon; }
   4951 
   4952     cp xml-tests/test.output expout
   4953   { set +x
   4954 $as_echo "$at_srcdir/input.at:462: \$XSLTPROC \\
   4955              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   4956              xml-tests/test.xml"
   4957 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:462"
   4958 ( $at_check_trace; $XSLTPROC \
   4959              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   4960              xml-tests/test.xml
   4961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4962 at_status=$? at_failed=false
   4963 $at_check_filter
   4964 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4965 $at_diff expout "$at_stdout" || at_failed=:
   4966 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   4967 $at_failed && at_fn_log_failure
   4968 $at_traceon; }
   4969 
   4970   sort xml-tests/test.dot > expout
   4971   { set +x
   4972 $as_echo "$at_srcdir/input.at:462: \$XSLTPROC \\
   4973              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   4974              xml-tests/test.xml | sort"
   4975 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:462"
   4976 ( $at_check_trace; $XSLTPROC \
   4977              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   4978              xml-tests/test.xml | sort
   4979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4980 at_status=$? at_failed=false
   4981 $at_check_filter
   4982 at_fn_diff_devnull "$at_stderr" || at_failed=:
   4983 $at_diff expout "$at_stdout" || at_failed=:
   4984 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   4985 $at_failed && at_fn_log_failure
   4986 $at_traceon; }
   4987 
   4988   rm -rf xml-tests expout
   4989   at_restore_special_files
   4990 fi
   4991 { set +x
   4992 $as_echo "$at_srcdir/input.at:462: bison input.y"
   4993 at_fn_check_prepare_trace "input.at:462"
   4994 ( $at_check_trace; bison input.y
   4995 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   4996 at_status=$? at_failed=false
   4997 $at_check_filter
   4998 echo >>"$at_stderr"; $as_echo "input.y:6.8-22: warning: unset value: \$\$
   4999 input.y:6.12-14: warning: unused value: \$2
   5000 input.y:7.6-8: warning: unset value: \$\$
   5001 " | \
   5002   $at_diff - "$at_stderr" || at_failed=:
   5003 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5004 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   5005 $at_failed && at_fn_log_failure
   5006 $at_traceon; }
   5007 
   5008 # Defining POSIXLY_CORRECT causes bison to complain if options are
   5009 # added after the grammar file name, so skip these checks in that
   5010 # case.
   5011 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   5012   at_save_special_files
   5013 
   5014   # To avoid expanding it repeatedly, store specified stdout.
   5015   : >expout
   5016 
   5017   # Run with -Werror.
   5018   { set +x
   5019 $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   5020 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:462"
   5021 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   5022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5023 at_status=$? at_failed=false
   5024 $at_check_filter
   5025 echo stderr:; tee stderr <"$at_stderr"
   5026 $at_diff expout "$at_stdout" || at_failed=:
   5027 at_fn_check_status 1 $at_status "$at_srcdir/input.at:462"
   5028 $at_failed && at_fn_log_failure
   5029 $at_traceon; }
   5030 
   5031 
   5032   # Build expected stderr up to and including the "warnings being
   5033   # treated as errors" message.
   5034   cat >at-bison-check-warnings <<'_ATEOF'
   5035 input.y:6.8-22: warning: unset value: $$
   5036 input.y:6.12-14: warning: unused value: $2
   5037 input.y:7.6-8: warning: unset value: $$
   5038 _ATEOF
   5039 
   5040   at_bison_check_first=`sed -n \
   5041     '/: warning: /{=;q;}' at-bison-check-warnings`
   5042   : ${at_bison_check_first:=1}
   5043   at_bison_check_first_tmp=`sed -n \
   5044     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   5045   : ${at_bison_check_first_tmp:=1}
   5046   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   5047     at_bison_check_first=$at_bison_check_first_tmp
   5048   fi
   5049   if test $at_bison_check_first -gt 1; then
   5050     sed -n "1,`expr $at_bison_check_first - 1`"p \
   5051       at-bison-check-warnings > experr
   5052   fi
   5053   echo 'bison: warnings being treated as errors' >> experr
   5054 
   5055   # Finish building expected stderr and check.  Unlike warnings,
   5056   # complaints cause bison to exit early.  Thus, with -Werror, bison
   5057   # does not necessarily report all warnings that it does without
   5058   # -Werror, but it at least reports one.
   5059   at_bison_check_last=`sed -n '$=' stderr`
   5060   : ${at_bison_check_last:=1}
   5061   at_bison_check_last=`expr $at_bison_check_last - 1`
   5062   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   5063     at-bison-check-warnings >> experr
   5064   { set +x
   5065 $as_echo "$at_srcdir/input.at:462: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   5066               stderr 1>&2"
   5067 at_fn_check_prepare_notrace 'an embedded newline' "input.at:462"
   5068 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   5069               stderr 1>&2
   5070 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5071 at_status=$? at_failed=false
   5072 $at_check_filter
   5073 $at_diff experr "$at_stderr" || at_failed=:
   5074 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5075 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   5076 $at_failed && at_fn_log_failure
   5077 $at_traceon; }
   5078 
   5079 
   5080   # Now check --warnings=error.
   5081   cp stderr experr
   5082   { set +x
   5083 $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   5084 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:462"
   5085 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   5086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5087 at_status=$? at_failed=false
   5088 $at_check_filter
   5089 $at_diff experr "$at_stderr" || at_failed=:
   5090 $at_diff expout "$at_stdout" || at_failed=:
   5091 at_fn_check_status 1 $at_status "$at_srcdir/input.at:462"
   5092 $at_failed && at_fn_log_failure
   5093 $at_traceon; }
   5094 
   5095 
   5096   # Now check -Wnone and --warnings=none by making sure that
   5097   # -Werror doesn't change the exit status when -Wnone or
   5098   # --warnings=none is specified.
   5099   { set +x
   5100 $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   5101 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:462"
   5102 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   5103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5104 at_status=$? at_failed=false
   5105 $at_check_filter
   5106 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5107 $at_diff expout "$at_stdout" || at_failed=:
   5108 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   5109 $at_failed && at_fn_log_failure
   5110 $at_traceon; }
   5111 
   5112   { set +x
   5113 $as_echo "$at_srcdir/input.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   5114 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:462"
   5115 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   5116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5117 at_status=$? at_failed=false
   5118 $at_check_filter
   5119 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5120 $at_diff expout "$at_stdout" || at_failed=:
   5121 at_fn_check_status 0 $at_status "$at_srcdir/input.at:462"
   5122 $at_failed && at_fn_log_failure
   5123 $at_traceon; }
   5124 
   5125 
   5126   at_restore_special_files
   5127 fi
   5128 
   5129   set +x
   5130   $at_times_p && times >"$at_times_file"
   5131 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5132 read at_status <"$at_status_file"
   5133 #AT_STOP_10
   5134 #AT_START_11
   5135 at_fn_group_banner 11 'input.at:475' \
   5136   "Incompatible Aliases" "                           " 1
   5137 at_xfail=no
   5138 (
   5139   $as_echo "11. $at_setup_line: testing $at_desc ..."
   5140   $at_traceon
   5141 
   5142 
   5143 cat >input.y <<'_ATEOF'
   5144 %token foo "foo"
   5145 
   5146 %type <bar>       foo
   5147 %printer {bar}    foo
   5148 %destructor {bar} foo
   5149 %left             foo
   5150 
   5151 %type <baz>       "foo"
   5152 %printer {baz}    "foo"
   5153 %destructor {baz} "foo"
   5154 %left             "foo"
   5155 
   5156 %%
   5157 exp: foo;
   5158 _ATEOF
   5159 
   5160 
   5161 
   5162 { set +x
   5163 $as_echo "$at_srcdir/input.at:494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   5164 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:494"
   5165 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   5166 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5167 at_status=$? at_failed=false
   5168 $at_check_filter
   5169 echo >>"$at_stderr"; $as_echo "input.y:8.7-11: error: %type redeclaration for foo
   5170 input.y:3.7-11:     previous declaration
   5171 input.y:10.13-17: error: %destructor redeclaration for foo
   5172 input.y:5.13-17:      previous declaration
   5173 input.y:9.10-14: error: %printer redeclaration for foo
   5174 input.y:4.10-14:     previous declaration
   5175 input.y:11.1-5: error: %left redeclaration for foo
   5176 input.y:6.1-5:      previous declaration
   5177 " | \
   5178   $at_diff - "$at_stderr" || at_failed=:
   5179 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5180 at_fn_check_status 1 $at_status "$at_srcdir/input.at:494"
   5181 $at_failed && at_fn_log_failure
   5182 $at_traceon; }
   5183 
   5184 
   5185 
   5186   set +x
   5187   $at_times_p && times >"$at_times_file"
   5188 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5189 read at_status <"$at_status_file"
   5190 #AT_STOP_11
   5191 #AT_START_12
   5192 at_fn_group_banner 12 'input.at:516' \
   5193   "Torturing the Scanner" "                          " 1
   5194 at_xfail=no
   5195 (
   5196   $as_echo "12. $at_setup_line: testing $at_desc ..."
   5197   $at_traceon
   5198 
   5199 
   5200 
   5201 : >input.y
   5202 
   5203 { set +x
   5204 $as_echo "$at_srcdir/input.at:520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   5205 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:520"
   5206 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   5207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5208 at_status=$? at_failed=false
   5209 $at_check_filter
   5210 echo >>"$at_stderr"; $as_echo "input.y:1.1: error: syntax error, unexpected end of file
   5211 " | \
   5212   $at_diff - "$at_stderr" || at_failed=:
   5213 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5214 at_fn_check_status 1 $at_status "$at_srcdir/input.at:520"
   5215 $at_failed && at_fn_log_failure
   5216 $at_traceon; }
   5217 
   5218 
   5219 
   5220 
   5221 cat >input.y <<'_ATEOF'
   5222 {}
   5223 _ATEOF
   5224 
   5225 
   5226 { set +x
   5227 $as_echo "$at_srcdir/input.at:528: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   5228 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:528"
   5229 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   5230 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5231 at_status=$? at_failed=false
   5232 $at_check_filter
   5233 echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: syntax error, unexpected {...}
   5234 " | \
   5235   $at_diff - "$at_stderr" || at_failed=:
   5236 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5237 at_fn_check_status 1 $at_status "$at_srcdir/input.at:528"
   5238 $at_failed && at_fn_log_failure
   5239 $at_traceon; }
   5240 
   5241 
   5242 
   5243 
   5244 cat >input.y <<'_ATEOF'
   5245 %code top {
   5246 #include <config.h>
   5247 /* We don't need perfect functions for these tests. */
   5248 #undef malloc
   5249 #undef memcmp
   5250 #undef realloc
   5251 }
   5252 
   5253 %{
   5254 /* This is seen in GCC: a %{ and %} in middle of a comment. */
   5255 const char *foo = "So %{ and %} can be here too.";
   5256 
   5257 #if 0
   5258 /* These examples test Bison while not stressing C compilers too much.
   5259    Many C compilers mishandle backslash-newlines, so this part of the
   5260    test is inside "#if 0".  The comment and string are written so that
   5261    the "#endif" will be seen regardless of the C compiler bugs that we
   5262    know about, namely:
   5263 
   5264      HP C (as of late 2002) mishandles *\[newline]\[newline]/ within a
   5265      comment.
   5266 
   5267      The Apple Darwin compiler (as of late 2002) mishandles
   5268      \\[newline]' within a character constant.
   5269 
   5270    */
   5271 
   5272 /\
   5273 * A comment with backslash-newlines in it. %} *\
   5274 \
   5275 /
   5276 /* { Close the above comment, if the C compiler mishandled it.  */
   5277 
   5278 char str[] = "\\
   5279 " A string with backslash-newlines in it %{ %} \\
   5280 \
   5281 "";
   5282 
   5283 char apostrophe = '\'';
   5284 #endif
   5285 
   5286 #include <stdio.h>
   5287 #include <stdlib.h>
   5288 #include <assert.h>
   5289 %}
   5290 /* %{ and %} can be here too. */
   5291 
   5292 %{
   5293 /* Exercise pre-prologue dependency to %union.  */
   5294 typedef int value;
   5295 %}
   5296 
   5297 /* Exercise M4 quoting: ']]', 0.  */
   5298 
   5299 /* Also exercise %union. */
   5300 %union
   5301 {
   5302   value ival; /* A comment to exercise an old bug. */
   5303 };
   5304 
   5305 
   5306 /* Exercise post-prologue dependency to %union.  */
   5307 %{
   5308 static YYSTYPE value_as_yystype (value val);
   5309 
   5310 /* Exercise quotes in declarations.  */
   5311 char quote[] = "]],";
   5312 %}
   5313 
   5314 %{
   5315 static void yyerror ( const char *msg);
   5316 static int yylex (void);
   5317 %}
   5318 
   5319 %type <ival> '['
   5320 
   5321 /* Exercise quotes in strings.  */
   5322 %token FAKE "fake [] \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"
   5323 
   5324 %%
   5325 /* Exercise M4 quoting: ']]', [, 1.  */
   5326 exp: '[' '\1' two '$' '@' '{' oline output.or.oline.opt
   5327   {
   5328     /* Exercise quotes in braces.  */
   5329     char tmp[] = "[%c],\n";
   5330     printf (tmp, $1);
   5331   }
   5332 ;
   5333 
   5334 two: '\x000000000000000000000000000000000000000000000000000000000000000000002';
   5335 oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_';
   5336 output.or.oline.opt: ;|oline;;|output;;;
   5337 output: '#' 'o' 'u' 't' 'p' 'u' 't' ' ';
   5338 %%
   5339 /* Exercise M4 quoting: ']]', [, 2.  */
   5340 
   5341 static YYSTYPE
   5342 value_as_yystype (value val)
   5343 {
   5344   YYSTYPE res;
   5345   res.ival = val;
   5346   return res;
   5347 }
   5348 #include <stdio.h>
   5349 /* A C error reporting function.  */
   5350 static
   5351 void yyerror ( const char *msg)
   5352 {
   5353   fprintf (stderr, "%s\n", msg);
   5354 }
   5355 static int
   5356 yylex (void)
   5357 {
   5358   static char const input[] = "[\1\2$@{@oline@__oline__\
   5359 #output "; /* "
   5360   */
   5361   static size_t toknum;
   5362   assert (toknum < sizeof input);
   5363   yylval = value_as_yystype (input[toknum]);
   5364   return input[toknum++];
   5365 }
   5366 _ATEOF
   5367 
   5368 
   5369 
   5370 # Pacify Emacs' font-lock-mode: "
   5371 
   5372 cat >main.c <<'_ATEOF'
   5373 typedef int value;
   5374 #include "input.h"
   5375 
   5376 int yyparse (void);
   5377 
   5378 int
   5379 main (void)
   5380 {
   5381   return yyparse ();
   5382 }
   5383 _ATEOF
   5384 
   5385 
   5386 
   5387 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   5388   at_save_special_files
   5389   mkdir xml-tests
   5390     # Don't combine these Bison invocations since we want to be sure that
   5391   # --report=all isn't required to get the full XML file.
   5392   { set +x
   5393 $as_echo "$at_srcdir/input.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   5394                   --graph=xml-tests/test.dot -d -v -o input.c input.y"
   5395 at_fn_check_prepare_notrace 'an embedded newline' "input.at:659"
   5396 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   5397                   --graph=xml-tests/test.dot -d -v -o input.c input.y
   5398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5399 at_status=$? at_failed=false
   5400 $at_check_filter
   5401 echo stderr:; cat "$at_stderr"
   5402 echo stdout:; cat "$at_stdout"
   5403 at_fn_check_status 0 $at_status "$at_srcdir/input.at:659"
   5404 $at_failed && at_fn_log_failure
   5405 $at_traceon; }
   5406 
   5407   { set +x
   5408 $as_echo "$at_srcdir/input.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y"
   5409 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" "input.at:659"
   5410 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y
   5411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5412 at_status=$? at_failed=false
   5413 $at_check_filter
   5414 echo stderr:; cat "$at_stderr"
   5415 echo stdout:; cat "$at_stdout"
   5416 at_fn_check_status 0 $at_status "$at_srcdir/input.at:659"
   5417 $at_failed && at_fn_log_failure
   5418 $at_traceon; }
   5419 
   5420     cp xml-tests/test.output expout
   5421   { set +x
   5422 $as_echo "$at_srcdir/input.at:659: \$XSLTPROC \\
   5423              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   5424              xml-tests/test.xml"
   5425 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:659"
   5426 ( $at_check_trace; $XSLTPROC \
   5427              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   5428              xml-tests/test.xml
   5429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5430 at_status=$? at_failed=false
   5431 $at_check_filter
   5432 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5433 $at_diff expout "$at_stdout" || at_failed=:
   5434 at_fn_check_status 0 $at_status "$at_srcdir/input.at:659"
   5435 $at_failed && at_fn_log_failure
   5436 $at_traceon; }
   5437 
   5438   sort xml-tests/test.dot > expout
   5439   { set +x
   5440 $as_echo "$at_srcdir/input.at:659: \$XSLTPROC \\
   5441              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   5442              xml-tests/test.xml | sort"
   5443 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:659"
   5444 ( $at_check_trace; $XSLTPROC \
   5445              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   5446              xml-tests/test.xml | sort
   5447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5448 at_status=$? at_failed=false
   5449 $at_check_filter
   5450 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5451 $at_diff expout "$at_stdout" || at_failed=:
   5452 at_fn_check_status 0 $at_status "$at_srcdir/input.at:659"
   5453 $at_failed && at_fn_log_failure
   5454 $at_traceon; }
   5455 
   5456   rm -rf xml-tests expout
   5457   at_restore_special_files
   5458 fi
   5459 { set +x
   5460 $as_echo "$at_srcdir/input.at:659: bison -d -v -o input.c input.y"
   5461 at_fn_check_prepare_trace "input.at:659"
   5462 ( $at_check_trace; bison -d -v -o input.c input.y
   5463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5464 at_status=$? at_failed=false
   5465 $at_check_filter
   5466 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5467 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5468 at_fn_check_status 0 $at_status "$at_srcdir/input.at:659"
   5469 $at_failed && at_fn_log_failure
   5470 $at_traceon; }
   5471 
   5472 
   5473 { set +x
   5474 $as_echo "$at_srcdir/input.at:660: \$BISON_C_WORKS"
   5475 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:660"
   5476 ( $at_check_trace; $BISON_C_WORKS
   5477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5478 at_status=$? at_failed=false
   5479 $at_check_filter
   5480 echo stderr:; cat "$at_stderr"
   5481 echo stdout:; cat "$at_stdout"
   5482 at_fn_check_status 0 $at_status "$at_srcdir/input.at:660"
   5483 $at_failed && at_fn_log_failure
   5484 $at_traceon; }
   5485 
   5486 { set +x
   5487 $as_echo "$at_srcdir/input.at:660: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   5488 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "input.at:660"
   5489 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   5490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5491 at_status=$? at_failed=false
   5492 $at_check_filter
   5493 echo stderr:; cat "$at_stderr"
   5494 echo stdout:; cat "$at_stdout"
   5495 at_fn_check_status 0 $at_status "$at_srcdir/input.at:660"
   5496 $at_failed && at_fn_log_failure
   5497 $at_traceon; }
   5498 
   5499 { set +x
   5500 $as_echo "$at_srcdir/input.at:661: \$BISON_C_WORKS"
   5501 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:661"
   5502 ( $at_check_trace; $BISON_C_WORKS
   5503 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5504 at_status=$? at_failed=false
   5505 $at_check_filter
   5506 echo stderr:; cat "$at_stderr"
   5507 echo stdout:; cat "$at_stdout"
   5508 at_fn_check_status 0 $at_status "$at_srcdir/input.at:661"
   5509 $at_failed && at_fn_log_failure
   5510 $at_traceon; }
   5511 
   5512 { set +x
   5513 $as_echo "$at_srcdir/input.at:661: \$CC \$CFLAGS \$CPPFLAGS -c -o main.o main.c "
   5514 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o main.o main.c " "input.at:661"
   5515 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o main.o main.c
   5516 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5517 at_status=$? at_failed=false
   5518 $at_check_filter
   5519 echo stderr:; cat "$at_stderr"
   5520 echo stdout:; cat "$at_stdout"
   5521 at_fn_check_status 0 $at_status "$at_srcdir/input.at:661"
   5522 $at_failed && at_fn_log_failure
   5523 $at_traceon; }
   5524 
   5525 { set +x
   5526 $as_echo "$at_srcdir/input.at:662: \$BISON_C_WORKS"
   5527 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:662"
   5528 ( $at_check_trace; $BISON_C_WORKS
   5529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5530 at_status=$? at_failed=false
   5531 $at_check_filter
   5532 echo stderr:; cat "$at_stderr"
   5533 echo stdout:; cat "$at_stdout"
   5534 at_fn_check_status 0 $at_status "$at_srcdir/input.at:662"
   5535 $at_failed && at_fn_log_failure
   5536 $at_traceon; }
   5537 
   5538 { set +x
   5539 $as_echo "$at_srcdir/input.at:662: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.o main.o \$LIBS"
   5540 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS" "input.at:662"
   5541 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS
   5542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5543 at_status=$? at_failed=false
   5544 $at_check_filter
   5545 echo stderr:; cat "$at_stderr"
   5546 echo stdout:; cat "$at_stdout"
   5547 at_fn_check_status 0 $at_status "$at_srcdir/input.at:662"
   5548 $at_failed && at_fn_log_failure
   5549 $at_traceon; }
   5550 
   5551 { set +x
   5552 $as_echo "$at_srcdir/input.at:663:  \$PREPARSER ./input"
   5553 at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:663"
   5554 ( $at_check_trace;  $PREPARSER ./input
   5555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5556 at_status=$? at_failed=false
   5557 $at_check_filter
   5558 echo stderr:; tee stderr <"$at_stderr"
   5559 echo >>"$at_stdout"; $as_echo "[[],
   5560 " | \
   5561   $at_diff - "$at_stdout" || at_failed=:
   5562 at_fn_check_status 0 $at_status "$at_srcdir/input.at:663"
   5563 $at_failed && at_fn_log_failure
   5564 $at_traceon; }
   5565 
   5566 { set +x
   5567 $as_echo "$at_srcdir/input.at:663: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   5568 at_fn_check_prepare_trace "input.at:663"
   5569 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   5570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5571 at_status=$? at_failed=false
   5572 $at_check_filter
   5573 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5574 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5575 at_fn_check_status 0 $at_status "$at_srcdir/input.at:663"
   5576 $at_failed && at_fn_log_failure
   5577 $at_traceon; }
   5578 
   5579 
   5580 
   5581   set +x
   5582   $at_times_p && times >"$at_times_file"
   5583 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5584 read at_status <"$at_status_file"
   5585 #AT_STOP_12
   5586 #AT_START_13
   5587 at_fn_group_banner 13 'input.at:674' \
   5588   "Typed symbol aliases" "                           " 1
   5589 at_xfail=no
   5590 (
   5591   $as_echo "13. $at_setup_line: testing $at_desc ..."
   5592   $at_traceon
   5593 
   5594 
   5595 # Bison 2.0 broke typed symbol aliases - ensure they work.
   5596 
   5597 cat >input.y <<'_ATEOF'
   5598 %code top {
   5599 #include <config.h>
   5600 /* We don't need perfect functions for these tests. */
   5601 #undef malloc
   5602 #undef memcmp
   5603 #undef realloc
   5604 }
   5605 
   5606 %union
   5607 {
   5608   int val;
   5609 };
   5610 %token <val> MY_TOKEN "MY TOKEN"
   5611 %type <val> exp
   5612 %%
   5613 exp: "MY TOKEN";
   5614 %%
   5615 _ATEOF
   5616 
   5617 
   5618 
   5619 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   5620   at_save_special_files
   5621   mkdir xml-tests
   5622     # Don't combine these Bison invocations since we want to be sure that
   5623   # --report=all isn't required to get the full XML file.
   5624   { set +x
   5625 $as_echo "$at_srcdir/input.at:690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   5626                   --graph=xml-tests/test.dot -o input.c input.y"
   5627 at_fn_check_prepare_notrace 'an embedded newline' "input.at:690"
   5628 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   5629                   --graph=xml-tests/test.dot -o input.c input.y
   5630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5631 at_status=$? at_failed=false
   5632 $at_check_filter
   5633 echo stderr:; cat "$at_stderr"
   5634 echo stdout:; cat "$at_stdout"
   5635 at_fn_check_status 0 $at_status "$at_srcdir/input.at:690"
   5636 $at_failed && at_fn_log_failure
   5637 $at_traceon; }
   5638 
   5639   { set +x
   5640 $as_echo "$at_srcdir/input.at:690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   5641 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:690"
   5642 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   5643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5644 at_status=$? at_failed=false
   5645 $at_check_filter
   5646 echo stderr:; cat "$at_stderr"
   5647 echo stdout:; cat "$at_stdout"
   5648 at_fn_check_status 0 $at_status "$at_srcdir/input.at:690"
   5649 $at_failed && at_fn_log_failure
   5650 $at_traceon; }
   5651 
   5652     cp xml-tests/test.output expout
   5653   { set +x
   5654 $as_echo "$at_srcdir/input.at:690: \$XSLTPROC \\
   5655              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   5656              xml-tests/test.xml"
   5657 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:690"
   5658 ( $at_check_trace; $XSLTPROC \
   5659              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   5660              xml-tests/test.xml
   5661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5662 at_status=$? at_failed=false
   5663 $at_check_filter
   5664 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5665 $at_diff expout "$at_stdout" || at_failed=:
   5666 at_fn_check_status 0 $at_status "$at_srcdir/input.at:690"
   5667 $at_failed && at_fn_log_failure
   5668 $at_traceon; }
   5669 
   5670   sort xml-tests/test.dot > expout
   5671   { set +x
   5672 $as_echo "$at_srcdir/input.at:690: \$XSLTPROC \\
   5673              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   5674              xml-tests/test.xml | sort"
   5675 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:690"
   5676 ( $at_check_trace; $XSLTPROC \
   5677              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   5678              xml-tests/test.xml | sort
   5679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5680 at_status=$? at_failed=false
   5681 $at_check_filter
   5682 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5683 $at_diff expout "$at_stdout" || at_failed=:
   5684 at_fn_check_status 0 $at_status "$at_srcdir/input.at:690"
   5685 $at_failed && at_fn_log_failure
   5686 $at_traceon; }
   5687 
   5688   rm -rf xml-tests expout
   5689   at_restore_special_files
   5690 fi
   5691 { set +x
   5692 $as_echo "$at_srcdir/input.at:690: bison -o input.c input.y"
   5693 at_fn_check_prepare_trace "input.at:690"
   5694 ( $at_check_trace; bison -o input.c input.y
   5695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5696 at_status=$? at_failed=false
   5697 $at_check_filter
   5698 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5699 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5700 at_fn_check_status 0 $at_status "$at_srcdir/input.at:690"
   5701 $at_failed && at_fn_log_failure
   5702 $at_traceon; }
   5703 
   5704 
   5705 
   5706   set +x
   5707   $at_times_p && times >"$at_times_file"
   5708 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5709 read at_status <"$at_status_file"
   5710 #AT_STOP_13
   5711 #AT_START_14
   5712 at_fn_group_banner 14 'input.at:710' \
   5713   "Require 1.0" "                                    " 1
   5714 at_xfail=no
   5715 (
   5716   $as_echo "14. $at_setup_line: testing $at_desc ..."
   5717   $at_traceon
   5718 
   5719 cat >input.y <<'_ATEOF'
   5720 %code top {
   5721 #include <config.h>
   5722 /* We don't need perfect functions for these tests. */
   5723 #undef malloc
   5724 #undef memcmp
   5725 #undef realloc
   5726 }
   5727 
   5728 %require "1.0";
   5729 %%
   5730 empty_file:;
   5731 _ATEOF
   5732 
   5733 
   5734 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   5735   at_save_special_files
   5736   mkdir xml-tests
   5737     # Don't combine these Bison invocations since we want to be sure that
   5738   # --report=all isn't required to get the full XML file.
   5739   { set +x
   5740 $as_echo "$at_srcdir/input.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   5741                   --graph=xml-tests/test.dot -o input.c input.y"
   5742 at_fn_check_prepare_notrace 'an embedded newline' "input.at:710"
   5743 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   5744                   --graph=xml-tests/test.dot -o input.c input.y
   5745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5746 at_status=$? at_failed=false
   5747 $at_check_filter
   5748 echo stderr:; cat "$at_stderr"
   5749 echo stdout:; cat "$at_stdout"
   5750 at_fn_check_status 0 $at_status "$at_srcdir/input.at:710"
   5751 $at_failed && at_fn_log_failure
   5752 $at_traceon; }
   5753 
   5754   { set +x
   5755 $as_echo "$at_srcdir/input.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   5756 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:710"
   5757 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   5758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5759 at_status=$? at_failed=false
   5760 $at_check_filter
   5761 echo stderr:; cat "$at_stderr"
   5762 echo stdout:; cat "$at_stdout"
   5763 at_fn_check_status 0 $at_status "$at_srcdir/input.at:710"
   5764 $at_failed && at_fn_log_failure
   5765 $at_traceon; }
   5766 
   5767     cp xml-tests/test.output expout
   5768   { set +x
   5769 $as_echo "$at_srcdir/input.at:710: \$XSLTPROC \\
   5770              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   5771              xml-tests/test.xml"
   5772 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:710"
   5773 ( $at_check_trace; $XSLTPROC \
   5774              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   5775              xml-tests/test.xml
   5776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5777 at_status=$? at_failed=false
   5778 $at_check_filter
   5779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5780 $at_diff expout "$at_stdout" || at_failed=:
   5781 at_fn_check_status 0 $at_status "$at_srcdir/input.at:710"
   5782 $at_failed && at_fn_log_failure
   5783 $at_traceon; }
   5784 
   5785   sort xml-tests/test.dot > expout
   5786   { set +x
   5787 $as_echo "$at_srcdir/input.at:710: \$XSLTPROC \\
   5788              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   5789              xml-tests/test.xml | sort"
   5790 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:710"
   5791 ( $at_check_trace; $XSLTPROC \
   5792              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   5793              xml-tests/test.xml | sort
   5794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5795 at_status=$? at_failed=false
   5796 $at_check_filter
   5797 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5798 $at_diff expout "$at_stdout" || at_failed=:
   5799 at_fn_check_status 0 $at_status "$at_srcdir/input.at:710"
   5800 $at_failed && at_fn_log_failure
   5801 $at_traceon; }
   5802 
   5803   rm -rf xml-tests expout
   5804   at_restore_special_files
   5805 fi
   5806 { set +x
   5807 $as_echo "$at_srcdir/input.at:710: bison -o input.c input.y"
   5808 at_fn_check_prepare_trace "input.at:710"
   5809 ( $at_check_trace; bison -o input.c input.y
   5810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5811 at_status=$? at_failed=false
   5812 $at_check_filter
   5813 echo stderr:; cat "$at_stderr"
   5814 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5815 at_fn_check_status 0 $at_status "$at_srcdir/input.at:710"
   5816 $at_failed && at_fn_log_failure
   5817 $at_traceon; }
   5818 
   5819 
   5820   set +x
   5821   $at_times_p && times >"$at_times_file"
   5822 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5823 read at_status <"$at_status_file"
   5824 #AT_STOP_14
   5825 #AT_START_15
   5826 at_fn_group_banner 15 'input.at:711' \
   5827   "Require 2.7" "                                    " 1
   5828 at_xfail=no
   5829 (
   5830   $as_echo "15. $at_setup_line: testing $at_desc ..."
   5831   $at_traceon
   5832 
   5833 cat >input.y <<'_ATEOF'
   5834 %code top {
   5835 #include <config.h>
   5836 /* We don't need perfect functions for these tests. */
   5837 #undef malloc
   5838 #undef memcmp
   5839 #undef realloc
   5840 }
   5841 
   5842 %require "2.7";
   5843 %%
   5844 empty_file:;
   5845 _ATEOF
   5846 
   5847 
   5848 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   5849   at_save_special_files
   5850   mkdir xml-tests
   5851     # Don't combine these Bison invocations since we want to be sure that
   5852   # --report=all isn't required to get the full XML file.
   5853   { set +x
   5854 $as_echo "$at_srcdir/input.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   5855                   --graph=xml-tests/test.dot -o input.c input.y"
   5856 at_fn_check_prepare_notrace 'an embedded newline' "input.at:711"
   5857 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   5858                   --graph=xml-tests/test.dot -o input.c input.y
   5859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5860 at_status=$? at_failed=false
   5861 $at_check_filter
   5862 echo stderr:; cat "$at_stderr"
   5863 echo stdout:; cat "$at_stdout"
   5864 at_fn_check_status 0 $at_status "$at_srcdir/input.at:711"
   5865 $at_failed && at_fn_log_failure
   5866 $at_traceon; }
   5867 
   5868   { set +x
   5869 $as_echo "$at_srcdir/input.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   5870 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:711"
   5871 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   5872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5873 at_status=$? at_failed=false
   5874 $at_check_filter
   5875 echo stderr:; cat "$at_stderr"
   5876 echo stdout:; cat "$at_stdout"
   5877 at_fn_check_status 0 $at_status "$at_srcdir/input.at:711"
   5878 $at_failed && at_fn_log_failure
   5879 $at_traceon; }
   5880 
   5881     cp xml-tests/test.output expout
   5882   { set +x
   5883 $as_echo "$at_srcdir/input.at:711: \$XSLTPROC \\
   5884              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   5885              xml-tests/test.xml"
   5886 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:711"
   5887 ( $at_check_trace; $XSLTPROC \
   5888              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   5889              xml-tests/test.xml
   5890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5891 at_status=$? at_failed=false
   5892 $at_check_filter
   5893 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5894 $at_diff expout "$at_stdout" || at_failed=:
   5895 at_fn_check_status 0 $at_status "$at_srcdir/input.at:711"
   5896 $at_failed && at_fn_log_failure
   5897 $at_traceon; }
   5898 
   5899   sort xml-tests/test.dot > expout
   5900   { set +x
   5901 $as_echo "$at_srcdir/input.at:711: \$XSLTPROC \\
   5902              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   5903              xml-tests/test.xml | sort"
   5904 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:711"
   5905 ( $at_check_trace; $XSLTPROC \
   5906              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   5907              xml-tests/test.xml | sort
   5908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5909 at_status=$? at_failed=false
   5910 $at_check_filter
   5911 at_fn_diff_devnull "$at_stderr" || at_failed=:
   5912 $at_diff expout "$at_stdout" || at_failed=:
   5913 at_fn_check_status 0 $at_status "$at_srcdir/input.at:711"
   5914 $at_failed && at_fn_log_failure
   5915 $at_traceon; }
   5916 
   5917   rm -rf xml-tests expout
   5918   at_restore_special_files
   5919 fi
   5920 { set +x
   5921 $as_echo "$at_srcdir/input.at:711: bison -o input.c input.y"
   5922 at_fn_check_prepare_trace "input.at:711"
   5923 ( $at_check_trace; bison -o input.c input.y
   5924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5925 at_status=$? at_failed=false
   5926 $at_check_filter
   5927 echo stderr:; cat "$at_stderr"
   5928 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5929 at_fn_check_status 0 $at_status "$at_srcdir/input.at:711"
   5930 $at_failed && at_fn_log_failure
   5931 $at_traceon; }
   5932 
   5933 
   5934   set +x
   5935   $at_times_p && times >"$at_times_file"
   5936 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5937 read at_status <"$at_status_file"
   5938 #AT_STOP_15
   5939 #AT_START_16
   5940 at_fn_group_banner 16 'input.at:713' \
   5941   "Require 100.0" "                                  " 1
   5942 at_xfail=no
   5943 (
   5944   $as_echo "16. $at_setup_line: testing $at_desc ..."
   5945   $at_traceon
   5946 
   5947 cat >input.y <<'_ATEOF'
   5948 %code top {
   5949 #include <config.h>
   5950 /* We don't need perfect functions for these tests. */
   5951 #undef malloc
   5952 #undef memcmp
   5953 #undef realloc
   5954 }
   5955 
   5956 %require "100.0";
   5957 %%
   5958 empty_file:;
   5959 _ATEOF
   5960 
   5961 
   5962 
   5963 { set +x
   5964 $as_echo "$at_srcdir/input.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
   5965 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:713"
   5966 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
   5967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   5968 at_status=$? at_failed=false
   5969 $at_check_filter
   5970 echo stderr:; cat "$at_stderr"
   5971 at_fn_diff_devnull "$at_stdout" || at_failed=:
   5972 at_fn_check_status 63 $at_status "$at_srcdir/input.at:713"
   5973 $at_failed && at_fn_log_failure
   5974 $at_traceon; }
   5975 
   5976 
   5977   set +x
   5978   $at_times_p && times >"$at_times_file"
   5979 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   5980 read at_status <"$at_status_file"
   5981 #AT_STOP_16
   5982 #AT_START_17
   5983 at_fn_group_banner 17 'input.at:720' \
   5984   "String aliases for character tokens" "            " 1
   5985 at_xfail=no
   5986 (
   5987   $as_echo "17. $at_setup_line: testing $at_desc ..."
   5988   $at_traceon
   5989 
   5990 
   5991 # Bison once thought a character token and its alias were different symbols
   5992 # with the same user token number.
   5993 
   5994 cat >input.y <<'_ATEOF'
   5995 %code top {
   5996 #include <config.h>
   5997 /* We don't need perfect functions for these tests. */
   5998 #undef malloc
   5999 #undef memcmp
   6000 #undef realloc
   6001 }
   6002 
   6003 %token 'a' "a"
   6004 %%
   6005 start: 'a';
   6006 %%
   6007 _ATEOF
   6008 
   6009 
   6010 
   6011 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   6012   at_save_special_files
   6013   mkdir xml-tests
   6014     # Don't combine these Bison invocations since we want to be sure that
   6015   # --report=all isn't required to get the full XML file.
   6016   { set +x
   6017 $as_echo "$at_srcdir/input.at:732: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   6018                   --graph=xml-tests/test.dot -o input.c input.y"
   6019 at_fn_check_prepare_notrace 'an embedded newline' "input.at:732"
   6020 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   6021                   --graph=xml-tests/test.dot -o input.c input.y
   6022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6023 at_status=$? at_failed=false
   6024 $at_check_filter
   6025 echo stderr:; cat "$at_stderr"
   6026 echo stdout:; cat "$at_stdout"
   6027 at_fn_check_status 0 $at_status "$at_srcdir/input.at:732"
   6028 $at_failed && at_fn_log_failure
   6029 $at_traceon; }
   6030 
   6031   { set +x
   6032 $as_echo "$at_srcdir/input.at:732: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   6033 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:732"
   6034 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   6035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6036 at_status=$? at_failed=false
   6037 $at_check_filter
   6038 echo stderr:; cat "$at_stderr"
   6039 echo stdout:; cat "$at_stdout"
   6040 at_fn_check_status 0 $at_status "$at_srcdir/input.at:732"
   6041 $at_failed && at_fn_log_failure
   6042 $at_traceon; }
   6043 
   6044     cp xml-tests/test.output expout
   6045   { set +x
   6046 $as_echo "$at_srcdir/input.at:732: \$XSLTPROC \\
   6047              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   6048              xml-tests/test.xml"
   6049 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:732"
   6050 ( $at_check_trace; $XSLTPROC \
   6051              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   6052              xml-tests/test.xml
   6053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6054 at_status=$? at_failed=false
   6055 $at_check_filter
   6056 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6057 $at_diff expout "$at_stdout" || at_failed=:
   6058 at_fn_check_status 0 $at_status "$at_srcdir/input.at:732"
   6059 $at_failed && at_fn_log_failure
   6060 $at_traceon; }
   6061 
   6062   sort xml-tests/test.dot > expout
   6063   { set +x
   6064 $as_echo "$at_srcdir/input.at:732: \$XSLTPROC \\
   6065              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   6066              xml-tests/test.xml | sort"
   6067 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:732"
   6068 ( $at_check_trace; $XSLTPROC \
   6069              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   6070              xml-tests/test.xml | sort
   6071 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6072 at_status=$? at_failed=false
   6073 $at_check_filter
   6074 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6075 $at_diff expout "$at_stdout" || at_failed=:
   6076 at_fn_check_status 0 $at_status "$at_srcdir/input.at:732"
   6077 $at_failed && at_fn_log_failure
   6078 $at_traceon; }
   6079 
   6080   rm -rf xml-tests expout
   6081   at_restore_special_files
   6082 fi
   6083 { set +x
   6084 $as_echo "$at_srcdir/input.at:732: bison -o input.c input.y"
   6085 at_fn_check_prepare_trace "input.at:732"
   6086 ( $at_check_trace; bison -o input.c input.y
   6087 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6088 at_status=$? at_failed=false
   6089 $at_check_filter
   6090 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6091 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6092 at_fn_check_status 0 $at_status "$at_srcdir/input.at:732"
   6093 $at_failed && at_fn_log_failure
   6094 $at_traceon; }
   6095 
   6096 
   6097 
   6098   set +x
   6099   $at_times_p && times >"$at_times_file"
   6100 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   6101 read at_status <"$at_status_file"
   6102 #AT_STOP_17
   6103 #AT_START_18
   6104 at_fn_group_banner 18 'input.at:741' \
   6105   "Symbols" "                                        " 1
   6106 at_xfail=no
   6107 (
   6108   $as_echo "18. $at_setup_line: testing $at_desc ..."
   6109   $at_traceon
   6110 
   6111 
   6112 
   6113 cat >input.y <<'_ATEOF'
   6114 %code top {
   6115 #include <config.h>
   6116 /* We don't need perfect functions for these tests. */
   6117 #undef malloc
   6118 #undef memcmp
   6119 #undef realloc
   6120 }
   6121 
   6122 %token WITH-DASH
   6123 %token WITHOUT_DASH "WITHOUT-DASH"
   6124 %token WITH.PERIOD
   6125 %token WITHOUT_PERIOD "WITHOUT.PERIOD"
   6126 %code {
   6127   static void yyerror ( const char *msg);
   6128   static int yylex (void);
   6129 }
   6130 %%
   6131 start: with-dash without_dash with.period without_period;
   6132 with-dash: WITH-DASH;
   6133 without_dash: "WITHOUT-DASH";
   6134 with.period: WITH.PERIOD;
   6135 without_period: "WITHOUT.PERIOD";
   6136 %%
   6137 #include <stdio.h>
   6138 /* A C error reporting function.  */
   6139 static
   6140 void yyerror ( const char *msg)
   6141 {
   6142   fprintf (stderr, "%s\n", msg);
   6143 }
   6144 #include <assert.h>
   6145 static
   6146 int yylex (void)
   6147 {
   6148   static char const input[] = "";
   6149   static size_t toknum = 0;
   6150   int res;
   6151   ;
   6152   assert (toknum < sizeof input / sizeof input[0]);
   6153   res = input[toknum++];
   6154   ;
   6155   return res;
   6156 }
   6157 _ATEOF
   6158 
   6159 
   6160 
   6161 
   6162 # POSIX Yacc accept periods, but not dashes.
   6163 
   6164 { set +x
   6165 $as_echo "$at_srcdir/input.at:766: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --yacc input.y"
   6166 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --yacc input.y" "input.at:766"
   6167 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --yacc input.y
   6168 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6169 at_status=$? at_failed=false
   6170 $at_check_filter
   6171 echo >>"$at_stderr"; $as_echo "input.y:9.8-16: POSIX Yacc forbids dashes in symbol names: WITH-DASH
   6172 input.y:18.8-16: POSIX Yacc forbids dashes in symbol names: with-dash
   6173 " | \
   6174   $at_diff - "$at_stderr" || at_failed=:
   6175 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6176 at_fn_check_status 1 $at_status "$at_srcdir/input.at:766"
   6177 $at_failed && at_fn_log_failure
   6178 $at_traceon; }
   6179 
   6180 
   6181 
   6182 # So warn about them.
   6183 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   6184   at_save_special_files
   6185   mkdir xml-tests
   6186     # Don't combine these Bison invocations since we want to be sure that
   6187   # --report=all isn't required to get the full XML file.
   6188   { set +x
   6189 $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   6190                   --graph=xml-tests/test.dot -Wyacc input.y"
   6191 at_fn_check_prepare_notrace 'an embedded newline' "input.at:772"
   6192 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   6193                   --graph=xml-tests/test.dot -Wyacc input.y
   6194 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6195 at_status=$? at_failed=false
   6196 $at_check_filter
   6197 echo stderr:; cat "$at_stderr"
   6198 echo stdout:; cat "$at_stdout"
   6199 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6200 $at_failed && at_fn_log_failure
   6201 $at_traceon; }
   6202 
   6203   { set +x
   6204 $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wyacc input.y"
   6205 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wyacc input.y" "input.at:772"
   6206 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wyacc input.y
   6207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6208 at_status=$? at_failed=false
   6209 $at_check_filter
   6210 echo stderr:; cat "$at_stderr"
   6211 echo stdout:; cat "$at_stdout"
   6212 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6213 $at_failed && at_fn_log_failure
   6214 $at_traceon; }
   6215 
   6216     cp xml-tests/test.output expout
   6217   { set +x
   6218 $as_echo "$at_srcdir/input.at:772: \$XSLTPROC \\
   6219              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   6220              xml-tests/test.xml"
   6221 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:772"
   6222 ( $at_check_trace; $XSLTPROC \
   6223              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   6224              xml-tests/test.xml
   6225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6226 at_status=$? at_failed=false
   6227 $at_check_filter
   6228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6229 $at_diff expout "$at_stdout" || at_failed=:
   6230 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6231 $at_failed && at_fn_log_failure
   6232 $at_traceon; }
   6233 
   6234   sort xml-tests/test.dot > expout
   6235   { set +x
   6236 $as_echo "$at_srcdir/input.at:772: \$XSLTPROC \\
   6237              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   6238              xml-tests/test.xml | sort"
   6239 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:772"
   6240 ( $at_check_trace; $XSLTPROC \
   6241              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   6242              xml-tests/test.xml | sort
   6243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6244 at_status=$? at_failed=false
   6245 $at_check_filter
   6246 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6247 $at_diff expout "$at_stdout" || at_failed=:
   6248 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6249 $at_failed && at_fn_log_failure
   6250 $at_traceon; }
   6251 
   6252   rm -rf xml-tests expout
   6253   at_restore_special_files
   6254 fi
   6255 { set +x
   6256 $as_echo "$at_srcdir/input.at:772: bison -Wyacc input.y"
   6257 at_fn_check_prepare_trace "input.at:772"
   6258 ( $at_check_trace; bison -Wyacc input.y
   6259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6260 at_status=$? at_failed=false
   6261 $at_check_filter
   6262 echo >>"$at_stderr"; $as_echo "input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH
   6263 input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash
   6264 " | \
   6265   $at_diff - "$at_stderr" || at_failed=:
   6266 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6267 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6268 $at_failed && at_fn_log_failure
   6269 $at_traceon; }
   6270 
   6271 # Defining POSIXLY_CORRECT causes bison to complain if options are
   6272 # added after the grammar file name, so skip these checks in that
   6273 # case.
   6274 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   6275   at_save_special_files
   6276 
   6277   # To avoid expanding it repeatedly, store specified stdout.
   6278   : >expout
   6279 
   6280   # Run with -Werror.
   6281   { set +x
   6282 $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Werror"
   6283 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Werror" "input.at:772"
   6284 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y -Werror
   6285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6286 at_status=$? at_failed=false
   6287 $at_check_filter
   6288 echo stderr:; tee stderr <"$at_stderr"
   6289 $at_diff expout "$at_stdout" || at_failed=:
   6290 at_fn_check_status 1 $at_status "$at_srcdir/input.at:772"
   6291 $at_failed && at_fn_log_failure
   6292 $at_traceon; }
   6293 
   6294 
   6295   # Build expected stderr up to and including the "warnings being
   6296   # treated as errors" message.
   6297   cat >at-bison-check-warnings <<'_ATEOF'
   6298 input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH
   6299 input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash
   6300 _ATEOF
   6301 
   6302   at_bison_check_first=`sed -n \
   6303     '/: warning: /{=;q;}' at-bison-check-warnings`
   6304   : ${at_bison_check_first:=1}
   6305   at_bison_check_first_tmp=`sed -n \
   6306     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   6307   : ${at_bison_check_first_tmp:=1}
   6308   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   6309     at_bison_check_first=$at_bison_check_first_tmp
   6310   fi
   6311   if test $at_bison_check_first -gt 1; then
   6312     sed -n "1,`expr $at_bison_check_first - 1`"p \
   6313       at-bison-check-warnings > experr
   6314   fi
   6315   echo 'bison: warnings being treated as errors' >> experr
   6316 
   6317   # Finish building expected stderr and check.  Unlike warnings,
   6318   # complaints cause bison to exit early.  Thus, with -Werror, bison
   6319   # does not necessarily report all warnings that it does without
   6320   # -Werror, but it at least reports one.
   6321   at_bison_check_last=`sed -n '$=' stderr`
   6322   : ${at_bison_check_last:=1}
   6323   at_bison_check_last=`expr $at_bison_check_last - 1`
   6324   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   6325     at-bison-check-warnings >> experr
   6326   { set +x
   6327 $as_echo "$at_srcdir/input.at:772: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   6328               stderr 1>&2"
   6329 at_fn_check_prepare_notrace 'an embedded newline' "input.at:772"
   6330 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   6331               stderr 1>&2
   6332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6333 at_status=$? at_failed=false
   6334 $at_check_filter
   6335 $at_diff experr "$at_stderr" || at_failed=:
   6336 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6337 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6338 $at_failed && at_fn_log_failure
   6339 $at_traceon; }
   6340 
   6341 
   6342   # Now check --warnings=error.
   6343   cp stderr experr
   6344   { set +x
   6345 $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=error"
   6346 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=error" "input.at:772"
   6347 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=error
   6348 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6349 at_status=$? at_failed=false
   6350 $at_check_filter
   6351 $at_diff experr "$at_stderr" || at_failed=:
   6352 $at_diff expout "$at_stdout" || at_failed=:
   6353 at_fn_check_status 1 $at_status "$at_srcdir/input.at:772"
   6354 $at_failed && at_fn_log_failure
   6355 $at_traceon; }
   6356 
   6357 
   6358   # Now check -Wnone and --warnings=none by making sure that
   6359   # -Werror doesn't change the exit status when -Wnone or
   6360   # --warnings=none is specified.
   6361   { set +x
   6362 $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Wnone -Werror"
   6363 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y -Wnone -Werror" "input.at:772"
   6364 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y -Wnone -Werror
   6365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6366 at_status=$? at_failed=false
   6367 $at_check_filter
   6368 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6369 $at_diff expout "$at_stdout" || at_failed=:
   6370 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6371 $at_failed && at_fn_log_failure
   6372 $at_traceon; }
   6373 
   6374   { set +x
   6375 $as_echo "$at_srcdir/input.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=none -Werror"
   6376 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=none -Werror" "input.at:772"
   6377 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wyacc input.y --warnings=none -Werror
   6378 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6379 at_status=$? at_failed=false
   6380 $at_check_filter
   6381 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6382 $at_diff expout "$at_stdout" || at_failed=:
   6383 at_fn_check_status 0 $at_status "$at_srcdir/input.at:772"
   6384 $at_failed && at_fn_log_failure
   6385 $at_traceon; }
   6386 
   6387 
   6388   at_restore_special_files
   6389 fi
   6390 
   6391 # Dashes are fine for GNU Bison.
   6392 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   6393   at_save_special_files
   6394   mkdir xml-tests
   6395     # Don't combine these Bison invocations since we want to be sure that
   6396   # --report=all isn't required to get the full XML file.
   6397   { set +x
   6398 $as_echo "$at_srcdir/input.at:778: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   6399                   --graph=xml-tests/test.dot -o input.c input.y"
   6400 at_fn_check_prepare_notrace 'an embedded newline' "input.at:778"
   6401 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   6402                   --graph=xml-tests/test.dot -o input.c input.y
   6403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6404 at_status=$? at_failed=false
   6405 $at_check_filter
   6406 echo stderr:; cat "$at_stderr"
   6407 echo stdout:; cat "$at_stdout"
   6408 at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
   6409 $at_failed && at_fn_log_failure
   6410 $at_traceon; }
   6411 
   6412   { set +x
   6413 $as_echo "$at_srcdir/input.at:778: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   6414 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:778"
   6415 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   6416 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6417 at_status=$? at_failed=false
   6418 $at_check_filter
   6419 echo stderr:; cat "$at_stderr"
   6420 echo stdout:; cat "$at_stdout"
   6421 at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
   6422 $at_failed && at_fn_log_failure
   6423 $at_traceon; }
   6424 
   6425     cp xml-tests/test.output expout
   6426   { set +x
   6427 $as_echo "$at_srcdir/input.at:778: \$XSLTPROC \\
   6428              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   6429              xml-tests/test.xml"
   6430 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:778"
   6431 ( $at_check_trace; $XSLTPROC \
   6432              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   6433              xml-tests/test.xml
   6434 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6435 at_status=$? at_failed=false
   6436 $at_check_filter
   6437 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6438 $at_diff expout "$at_stdout" || at_failed=:
   6439 at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
   6440 $at_failed && at_fn_log_failure
   6441 $at_traceon; }
   6442 
   6443   sort xml-tests/test.dot > expout
   6444   { set +x
   6445 $as_echo "$at_srcdir/input.at:778: \$XSLTPROC \\
   6446              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   6447              xml-tests/test.xml | sort"
   6448 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:778"
   6449 ( $at_check_trace; $XSLTPROC \
   6450              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   6451              xml-tests/test.xml | sort
   6452 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6453 at_status=$? at_failed=false
   6454 $at_check_filter
   6455 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6456 $at_diff expout "$at_stdout" || at_failed=:
   6457 at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
   6458 $at_failed && at_fn_log_failure
   6459 $at_traceon; }
   6460 
   6461   rm -rf xml-tests expout
   6462   at_restore_special_files
   6463 fi
   6464 { set +x
   6465 $as_echo "$at_srcdir/input.at:778: bison -o input.c input.y"
   6466 at_fn_check_prepare_trace "input.at:778"
   6467 ( $at_check_trace; bison -o input.c input.y
   6468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6469 at_status=$? at_failed=false
   6470 $at_check_filter
   6471 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6472 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6473 at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
   6474 $at_failed && at_fn_log_failure
   6475 $at_traceon; }
   6476 
   6477 
   6478 
   6479 # Make sure we don't export silly token identifiers with periods or dashes.
   6480 { set +x
   6481 $as_echo "$at_srcdir/input.at:781: \$BISON_C_WORKS"
   6482 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:781"
   6483 ( $at_check_trace; $BISON_C_WORKS
   6484 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6485 at_status=$? at_failed=false
   6486 $at_check_filter
   6487 echo stderr:; cat "$at_stderr"
   6488 echo stdout:; cat "$at_stdout"
   6489 at_fn_check_status 0 $at_status "$at_srcdir/input.at:781"
   6490 $at_failed && at_fn_log_failure
   6491 $at_traceon; }
   6492 
   6493 { set +x
   6494 $as_echo "$at_srcdir/input.at:781: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   6495 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "input.at:781"
   6496 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   6497 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6498 at_status=$? at_failed=false
   6499 $at_check_filter
   6500 echo stderr:; cat "$at_stderr"
   6501 echo stdout:; cat "$at_stdout"
   6502 at_fn_check_status 0 $at_status "$at_srcdir/input.at:781"
   6503 $at_failed && at_fn_log_failure
   6504 $at_traceon; }
   6505 
   6506 
   6507 
   6508 # Periods are genuine letters, they can start identifiers.
   6509 # Digits and dashes cannot.
   6510 cat >input.y <<'_ATEOF'
   6511 %code top {
   6512 #include <config.h>
   6513 /* We don't need perfect functions for these tests. */
   6514 #undef malloc
   6515 #undef memcmp
   6516 #undef realloc
   6517 }
   6518 
   6519 %token .GOOD
   6520          -GOOD
   6521          1NV4L1D
   6522          -123
   6523 %%
   6524 start: .GOOD GOOD
   6525 _ATEOF
   6526 
   6527 
   6528 
   6529 { set +x
   6530 $as_echo "$at_srcdir/input.at:794: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
   6531 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:794"
   6532 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
   6533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6534 at_status=$? at_failed=false
   6535 $at_check_filter
   6536 echo >>"$at_stderr"; $as_echo "input.y:10.10: error: invalid character: '-'
   6537 input.y:11.10-16: error: invalid identifier: '1NV4L1D'
   6538 input.y:12.10: error: invalid character: '-'
   6539 " | \
   6540   $at_diff - "$at_stderr" || at_failed=:
   6541 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6542 at_fn_check_status 1 $at_status "$at_srcdir/input.at:794"
   6543 $at_failed && at_fn_log_failure
   6544 $at_traceon; }
   6545 
   6546 
   6547 
   6548   set +x
   6549   $at_times_p && times >"$at_times_file"
   6550 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   6551 read at_status <"$at_status_file"
   6552 #AT_STOP_18
   6553 #AT_START_19
   6554 at_fn_group_banner 19 'input.at:807' \
   6555   "Numbered tokens" "                                " 1
   6556 at_xfail=no
   6557 (
   6558   $as_echo "19. $at_setup_line: testing $at_desc ..."
   6559   $at_traceon
   6560 
   6561 
   6562 cat >redecl.y <<'_ATEOF'
   6563 %code top {
   6564 #include <config.h>
   6565 /* We don't need perfect functions for these tests. */
   6566 #undef malloc
   6567 #undef memcmp
   6568 #undef realloc
   6569 }
   6570 
   6571 %token DECIMAL_1     11259375
   6572          HEXADECIMAL_1 0xabcdef
   6573          HEXADECIMAL_2 0xFEDCBA
   6574          DECIMAL_2     16702650
   6575 %%
   6576 start: DECIMAL_1 HEXADECIMAL_2;
   6577 _ATEOF
   6578 
   6579 
   6580 
   6581 
   6582 { set +x
   6583 $as_echo "$at_srcdir/input.at:818: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison redecl.y"
   6584 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison redecl.y" "input.at:818"
   6585 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison redecl.y
   6586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6587 at_status=$? at_failed=false
   6588 $at_check_filter
   6589 echo >>"$at_stderr"; $as_echo "redecl.y:10.10-22: error: user token number 11259375 redeclaration for HEXADECIMAL_1
   6590 redecl.y:9.8-16:       previous declaration for DECIMAL_1
   6591 redecl.y:12.10-18: error: user token number 16702650 redeclaration for DECIMAL_2
   6592 redecl.y:11.10-22:     previous declaration for HEXADECIMAL_2
   6593 " | \
   6594   $at_diff - "$at_stderr" || at_failed=:
   6595 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6596 at_fn_check_status 1 $at_status "$at_srcdir/input.at:818"
   6597 $at_failed && at_fn_log_failure
   6598 $at_traceon; }
   6599 
   6600 
   6601 
   6602 cat >too-large.y <<'_ATEOF'
   6603 %code top {
   6604 #include <config.h>
   6605 /* We don't need perfect functions for these tests. */
   6606 #undef malloc
   6607 #undef memcmp
   6608 #undef realloc
   6609 }
   6610 
   6611 %token TOO_LARGE_DEC 999999999999999999999
   6612          TOO_LARGE_HEX 0xFFFFFFFFFFFFFFFFFFF
   6613 %%
   6614 start: TOO_LARGE_DEC TOO_LARGE_HEX
   6615 %%
   6616 _ATEOF
   6617 
   6618 
   6619 
   6620 
   6621 { set +x
   6622 $as_echo "$at_srcdir/input.at:833: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison too-large.y"
   6623 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison too-large.y" "input.at:833"
   6624 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison too-large.y
   6625 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6626 at_status=$? at_failed=false
   6627 $at_check_filter
   6628 echo >>"$at_stderr"; $as_echo "too-large.y:9.22-42: error: integer out of range: '999999999999999999999'
   6629 too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF'
   6630 " | \
   6631   $at_diff - "$at_stderr" || at_failed=:
   6632 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6633 at_fn_check_status 1 $at_status "$at_srcdir/input.at:833"
   6634 $at_failed && at_fn_log_failure
   6635 $at_traceon; }
   6636 
   6637 
   6638 
   6639   set +x
   6640   $at_times_p && times >"$at_times_file"
   6641 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   6642 read at_status <"$at_status_file"
   6643 #AT_STOP_19
   6644 #AT_START_20
   6645 at_fn_group_banner 20 'input.at:845' \
   6646   "Unclosed constructs" "                            " 1
   6647 at_xfail=no
   6648 (
   6649   $as_echo "20. $at_setup_line: testing $at_desc ..."
   6650   $at_traceon
   6651 
   6652 
   6653 # Bison's scan-gram.l once forgot to STRING_FINISH some unclosed constructs, so
   6654 # they were prepended to whatever it STRING_GROW'ed next.  It also threw them
   6655 # away rather than returning them to the parser.  The effect was confusing
   6656 # subsequent error messages.
   6657 
   6658 cat >input.y <<'_ATEOF'
   6659 %token A "a
   6660 %token B "b"
   6661 %token AB "ab" // Used to complain that "ab" was already used.
   6662 %token C '1
   6663 %token TWO "2"
   6664 %token TICK_TWELVE "'12" // Used to complain that "'12" was already used.
   6665 
   6666 %%
   6667 
   6668 start: ;
   6669 
   6670 // Used to report a syntax error because it didn't see any kind of symbol
   6671 // identifier.
   6672 %type <f> 'a
   6673 ;
   6674 %type <f> "a
   6675 ;
   6676 // Used to report a syntax error because it didn't see braced code.
   6677 %destructor { free ($$)
   6678 _ATEOF
   6679 
   6680 
   6681 
   6682 { set +x
   6683 $as_echo "$at_srcdir/input.at:874: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
   6684 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:874"
   6685 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
   6686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6687 at_status=$? at_failed=false
   6688 $at_check_filter
   6689 echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line
   6690 input.y:4.10-5.0: error: missing \"'\" at end of line
   6691 input.y:14.11-15.0: error: missing \"'\" at end of line
   6692 input.y:16.11-17.0: error: missing '\"' at end of line
   6693 input.y:19.13-20.0: error: missing '}' at end of file
   6694 input.y:20.1: error: syntax error, unexpected end of file
   6695 " | \
   6696   $at_diff - "$at_stderr" || at_failed=:
   6697 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6698 at_fn_check_status 1 $at_status "$at_srcdir/input.at:874"
   6699 $at_failed && at_fn_log_failure
   6700 $at_traceon; }
   6701 
   6702 
   6703 
   6704 
   6705 { set +x
   6706 $as_echo "$at_srcdir/input.at:883: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y"
   6707 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y" "input.at:883"
   6708 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y
   6709 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6710 at_status=$? at_failed=false
   6711 $at_check_filter
   6712 echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line
   6713  %token A \"a
   6714           ^^
   6715 input.y:4.10-5.0: error: missing \"'\" at end of line
   6716  %token C '1
   6717           ^^
   6718 input.y:14.11-15.0: error: missing \"'\" at end of line
   6719  %type <f> 'a
   6720            ^^
   6721 input.y:16.11-17.0: error: missing '\"' at end of line
   6722  %type <f> \"a
   6723            ^^
   6724 input.y:19.13-20.0: error: missing '}' at end of file
   6725  %destructor { free (\$\$)
   6726              ^^^^^^^^^^^
   6727 input.y:20.1: error: syntax error, unexpected end of file
   6728 " | \
   6729   $at_diff - "$at_stderr" || at_failed=:
   6730 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6731 at_fn_check_status 1 $at_status "$at_srcdir/input.at:883"
   6732 $at_failed && at_fn_log_failure
   6733 $at_traceon; }
   6734 
   6735 
   6736 
   6737   set +x
   6738   $at_times_p && times >"$at_times_file"
   6739 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   6740 read at_status <"$at_status_file"
   6741 #AT_STOP_20
   6742 #AT_START_21
   6743 at_fn_group_banner 21 'input.at:909' \
   6744   "%start after first rule" "                        " 1
   6745 at_xfail=no
   6746 (
   6747   $as_echo "21. $at_setup_line: testing $at_desc ..."
   6748   $at_traceon
   6749 
   6750 
   6751 # Bison once complained that a %start after the first rule was a redeclaration
   6752 # of the start symbol.
   6753 
   6754 cat >input.y <<'_ATEOF'
   6755 %%
   6756 false_start: ;
   6757 start: false_start ;
   6758 %start start;
   6759 _ATEOF
   6760 
   6761 
   6762 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   6763   at_save_special_files
   6764   mkdir xml-tests
   6765     # Don't combine these Bison invocations since we want to be sure that
   6766   # --report=all isn't required to get the full XML file.
   6767   { set +x
   6768 $as_echo "$at_srcdir/input.at:921: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   6769                   --graph=xml-tests/test.dot -o input.c input.y"
   6770 at_fn_check_prepare_notrace 'an embedded newline' "input.at:921"
   6771 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   6772                   --graph=xml-tests/test.dot -o input.c input.y
   6773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6774 at_status=$? at_failed=false
   6775 $at_check_filter
   6776 echo stderr:; cat "$at_stderr"
   6777 echo stdout:; cat "$at_stdout"
   6778 at_fn_check_status 0 $at_status "$at_srcdir/input.at:921"
   6779 $at_failed && at_fn_log_failure
   6780 $at_traceon; }
   6781 
   6782   { set +x
   6783 $as_echo "$at_srcdir/input.at:921: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   6784 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "input.at:921"
   6785 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   6786 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6787 at_status=$? at_failed=false
   6788 $at_check_filter
   6789 echo stderr:; cat "$at_stderr"
   6790 echo stdout:; cat "$at_stdout"
   6791 at_fn_check_status 0 $at_status "$at_srcdir/input.at:921"
   6792 $at_failed && at_fn_log_failure
   6793 $at_traceon; }
   6794 
   6795     cp xml-tests/test.output expout
   6796   { set +x
   6797 $as_echo "$at_srcdir/input.at:921: \$XSLTPROC \\
   6798              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   6799              xml-tests/test.xml"
   6800 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:921"
   6801 ( $at_check_trace; $XSLTPROC \
   6802              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   6803              xml-tests/test.xml
   6804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6805 at_status=$? at_failed=false
   6806 $at_check_filter
   6807 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6808 $at_diff expout "$at_stdout" || at_failed=:
   6809 at_fn_check_status 0 $at_status "$at_srcdir/input.at:921"
   6810 $at_failed && at_fn_log_failure
   6811 $at_traceon; }
   6812 
   6813   sort xml-tests/test.dot > expout
   6814   { set +x
   6815 $as_echo "$at_srcdir/input.at:921: \$XSLTPROC \\
   6816              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   6817              xml-tests/test.xml | sort"
   6818 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:921"
   6819 ( $at_check_trace; $XSLTPROC \
   6820              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   6821              xml-tests/test.xml | sort
   6822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6823 at_status=$? at_failed=false
   6824 $at_check_filter
   6825 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6826 $at_diff expout "$at_stdout" || at_failed=:
   6827 at_fn_check_status 0 $at_status "$at_srcdir/input.at:921"
   6828 $at_failed && at_fn_log_failure
   6829 $at_traceon; }
   6830 
   6831   rm -rf xml-tests expout
   6832   at_restore_special_files
   6833 fi
   6834 { set +x
   6835 $as_echo "$at_srcdir/input.at:921: bison -o input.c input.y"
   6836 at_fn_check_prepare_trace "input.at:921"
   6837 ( $at_check_trace; bison -o input.c input.y
   6838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6839 at_status=$? at_failed=false
   6840 $at_check_filter
   6841 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6842 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6843 at_fn_check_status 0 $at_status "$at_srcdir/input.at:921"
   6844 $at_failed && at_fn_log_failure
   6845 $at_traceon; }
   6846 
   6847 
   6848 
   6849   set +x
   6850   $at_times_p && times >"$at_times_file"
   6851 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   6852 read at_status <"$at_status_file"
   6853 #AT_STOP_21
   6854 #AT_START_22
   6855 at_fn_group_banner 22 'input.at:930' \
   6856   "%prec takes a token" "                            " 1
   6857 at_xfail=no
   6858 (
   6859   $as_echo "22. $at_setup_line: testing $at_desc ..."
   6860   $at_traceon
   6861 
   6862 
   6863 # Bison once allowed %prec sym where sym was a nonterminal.
   6864 
   6865 cat >input.y <<'_ATEOF'
   6866 %%
   6867 start: PREC %prec PREC ;
   6868 PREC: ;
   6869 _ATEOF
   6870 
   6871 
   6872 
   6873 { set +x
   6874 $as_echo "$at_srcdir/input.at:940: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   6875 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:940"
   6876 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   6877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6878 at_status=$? at_failed=false
   6879 $at_check_filter
   6880 echo >>"$at_stderr"; $as_echo "input.y:3.1-4: error: rule given for PREC, which is a token
   6881 " | \
   6882   $at_diff - "$at_stderr" || at_failed=:
   6883 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6884 at_fn_check_status 1 $at_status "$at_srcdir/input.at:940"
   6885 $at_failed && at_fn_log_failure
   6886 $at_traceon; }
   6887 
   6888 
   6889 
   6890   set +x
   6891   $at_times_p && times >"$at_times_file"
   6892 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   6893 read at_status <"$at_status_file"
   6894 #AT_STOP_22
   6895 #AT_START_23
   6896 at_fn_group_banner 23 'input.at:951' \
   6897   "%prec's token must be defined" "                  " 1
   6898 at_xfail=no
   6899 (
   6900   $as_echo "23. $at_setup_line: testing $at_desc ..."
   6901   $at_traceon
   6902 
   6903 
   6904 # According to POSIX, a %prec token must be defined separately.
   6905 
   6906 cat >input.y <<'_ATEOF'
   6907 %%
   6908 start: %prec PREC ;
   6909 _ATEOF
   6910 
   6911 
   6912 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   6913   at_save_special_files
   6914   mkdir xml-tests
   6915     # Don't combine these Bison invocations since we want to be sure that
   6916   # --report=all isn't required to get the full XML file.
   6917   { set +x
   6918 $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   6919                   --graph=xml-tests/test.dot input.y"
   6920 at_fn_check_prepare_notrace 'an embedded newline' "input.at:960"
   6921 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   6922                   --graph=xml-tests/test.dot input.y
   6923 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6924 at_status=$? at_failed=false
   6925 $at_check_filter
   6926 echo stderr:; cat "$at_stderr"
   6927 echo stdout:; cat "$at_stdout"
   6928 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   6929 $at_failed && at_fn_log_failure
   6930 $at_traceon; }
   6931 
   6932   { set +x
   6933 $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   6934 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:960"
   6935 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   6936 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6937 at_status=$? at_failed=false
   6938 $at_check_filter
   6939 echo stderr:; cat "$at_stderr"
   6940 echo stdout:; cat "$at_stdout"
   6941 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   6942 $at_failed && at_fn_log_failure
   6943 $at_traceon; }
   6944 
   6945     cp xml-tests/test.output expout
   6946   { set +x
   6947 $as_echo "$at_srcdir/input.at:960: \$XSLTPROC \\
   6948              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   6949              xml-tests/test.xml"
   6950 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:960"
   6951 ( $at_check_trace; $XSLTPROC \
   6952              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   6953              xml-tests/test.xml
   6954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6955 at_status=$? at_failed=false
   6956 $at_check_filter
   6957 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6958 $at_diff expout "$at_stdout" || at_failed=:
   6959 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   6960 $at_failed && at_fn_log_failure
   6961 $at_traceon; }
   6962 
   6963   sort xml-tests/test.dot > expout
   6964   { set +x
   6965 $as_echo "$at_srcdir/input.at:960: \$XSLTPROC \\
   6966              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   6967              xml-tests/test.xml | sort"
   6968 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:960"
   6969 ( $at_check_trace; $XSLTPROC \
   6970              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   6971              xml-tests/test.xml | sort
   6972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6973 at_status=$? at_failed=false
   6974 $at_check_filter
   6975 at_fn_diff_devnull "$at_stderr" || at_failed=:
   6976 $at_diff expout "$at_stdout" || at_failed=:
   6977 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   6978 $at_failed && at_fn_log_failure
   6979 $at_traceon; }
   6980 
   6981   rm -rf xml-tests expout
   6982   at_restore_special_files
   6983 fi
   6984 { set +x
   6985 $as_echo "$at_srcdir/input.at:960: bison input.y"
   6986 at_fn_check_prepare_trace "input.at:960"
   6987 ( $at_check_trace; bison input.y
   6988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   6989 at_status=$? at_failed=false
   6990 $at_check_filter
   6991 echo >>"$at_stderr"; $as_echo "input.y:2.8-17: warning: token for %prec is not defined: PREC
   6992 " | \
   6993   $at_diff - "$at_stderr" || at_failed=:
   6994 at_fn_diff_devnull "$at_stdout" || at_failed=:
   6995 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   6996 $at_failed && at_fn_log_failure
   6997 $at_traceon; }
   6998 
   6999 # Defining POSIXLY_CORRECT causes bison to complain if options are
   7000 # added after the grammar file name, so skip these checks in that
   7001 # case.
   7002 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   7003   at_save_special_files
   7004 
   7005   # To avoid expanding it repeatedly, store specified stdout.
   7006   : >expout
   7007 
   7008   # Run with -Werror.
   7009   { set +x
   7010 $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   7011 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:960"
   7012 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   7013 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7014 at_status=$? at_failed=false
   7015 $at_check_filter
   7016 echo stderr:; tee stderr <"$at_stderr"
   7017 $at_diff expout "$at_stdout" || at_failed=:
   7018 at_fn_check_status 1 $at_status "$at_srcdir/input.at:960"
   7019 $at_failed && at_fn_log_failure
   7020 $at_traceon; }
   7021 
   7022 
   7023   # Build expected stderr up to and including the "warnings being
   7024   # treated as errors" message.
   7025   cat >at-bison-check-warnings <<'_ATEOF'
   7026 input.y:2.8-17: warning: token for %prec is not defined: PREC
   7027 _ATEOF
   7028 
   7029   at_bison_check_first=`sed -n \
   7030     '/: warning: /{=;q;}' at-bison-check-warnings`
   7031   : ${at_bison_check_first:=1}
   7032   at_bison_check_first_tmp=`sed -n \
   7033     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   7034   : ${at_bison_check_first_tmp:=1}
   7035   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   7036     at_bison_check_first=$at_bison_check_first_tmp
   7037   fi
   7038   if test $at_bison_check_first -gt 1; then
   7039     sed -n "1,`expr $at_bison_check_first - 1`"p \
   7040       at-bison-check-warnings > experr
   7041   fi
   7042   echo 'bison: warnings being treated as errors' >> experr
   7043 
   7044   # Finish building expected stderr and check.  Unlike warnings,
   7045   # complaints cause bison to exit early.  Thus, with -Werror, bison
   7046   # does not necessarily report all warnings that it does without
   7047   # -Werror, but it at least reports one.
   7048   at_bison_check_last=`sed -n '$=' stderr`
   7049   : ${at_bison_check_last:=1}
   7050   at_bison_check_last=`expr $at_bison_check_last - 1`
   7051   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   7052     at-bison-check-warnings >> experr
   7053   { set +x
   7054 $as_echo "$at_srcdir/input.at:960: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   7055               stderr 1>&2"
   7056 at_fn_check_prepare_notrace 'an embedded newline' "input.at:960"
   7057 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   7058               stderr 1>&2
   7059 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7060 at_status=$? at_failed=false
   7061 $at_check_filter
   7062 $at_diff experr "$at_stderr" || at_failed=:
   7063 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7064 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   7065 $at_failed && at_fn_log_failure
   7066 $at_traceon; }
   7067 
   7068 
   7069   # Now check --warnings=error.
   7070   cp stderr experr
   7071   { set +x
   7072 $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   7073 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:960"
   7074 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   7075 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7076 at_status=$? at_failed=false
   7077 $at_check_filter
   7078 $at_diff experr "$at_stderr" || at_failed=:
   7079 $at_diff expout "$at_stdout" || at_failed=:
   7080 at_fn_check_status 1 $at_status "$at_srcdir/input.at:960"
   7081 $at_failed && at_fn_log_failure
   7082 $at_traceon; }
   7083 
   7084 
   7085   # Now check -Wnone and --warnings=none by making sure that
   7086   # -Werror doesn't change the exit status when -Wnone or
   7087   # --warnings=none is specified.
   7088   { set +x
   7089 $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   7090 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:960"
   7091 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   7092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7093 at_status=$? at_failed=false
   7094 $at_check_filter
   7095 at_fn_diff_devnull "$at_stderr" || at_failed=:
   7096 $at_diff expout "$at_stdout" || at_failed=:
   7097 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   7098 $at_failed && at_fn_log_failure
   7099 $at_traceon; }
   7100 
   7101   { set +x
   7102 $as_echo "$at_srcdir/input.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   7103 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:960"
   7104 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   7105 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7106 at_status=$? at_failed=false
   7107 $at_check_filter
   7108 at_fn_diff_devnull "$at_stderr" || at_failed=:
   7109 $at_diff expout "$at_stdout" || at_failed=:
   7110 at_fn_check_status 0 $at_status "$at_srcdir/input.at:960"
   7111 $at_failed && at_fn_log_failure
   7112 $at_traceon; }
   7113 
   7114 
   7115   at_restore_special_files
   7116 fi
   7117 
   7118   set +x
   7119   $at_times_p && times >"$at_times_file"
   7120 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7121 read at_status <"$at_status_file"
   7122 #AT_STOP_23
   7123 #AT_START_24
   7124 at_fn_group_banner 24 'input.at:971' \
   7125   "Reject unused %code qualifiers" "                 " 1
   7126 at_xfail=no
   7127 (
   7128   $as_echo "24. $at_setup_line: testing $at_desc ..."
   7129   $at_traceon
   7130 
   7131 
   7132 cat >input-c.y <<'_ATEOF'
   7133 %code q {}
   7134 %code bad {}
   7135 %code bad {}
   7136 %code format {}
   7137 %%
   7138 start: ;
   7139 _ATEOF
   7140 
   7141 
   7142 { set +x
   7143 $as_echo "$at_srcdir/input.at:981: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c.y"
   7144 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c.y" "input.at:981"
   7145 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c.y
   7146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7147 at_status=$? at_failed=false
   7148 $at_check_filter
   7149 echo >>"$at_stderr"; $as_echo "input-c.y:1.7: error: %code qualifier 'q' is not used
   7150 input-c.y:2.7-9: error: %code qualifier 'bad' is not used
   7151 input-c.y:3.7-9: error: %code qualifier 'bad' is not used
   7152 input-c.y:4.7-12: error: %code qualifier 'format' is not used
   7153 " | \
   7154   $at_diff - "$at_stderr" || at_failed=:
   7155 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7156 at_fn_check_status 1 $at_status "$at_srcdir/input.at:981"
   7157 $at_failed && at_fn_log_failure
   7158 $at_traceon; }
   7159 
   7160 
   7161 
   7162 cat >input-c-glr.y <<'_ATEOF'
   7163 %code q {}
   7164 %code bad {}
   7165  %code bad {}
   7166 %%
   7167 start: ;
   7168 _ATEOF
   7169 
   7170 
   7171 { set +x
   7172 $as_echo "$at_srcdir/input.at:995: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c-glr.y"
   7173 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c-glr.y" "input.at:995"
   7174 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c-glr.y
   7175 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7176 at_status=$? at_failed=false
   7177 $at_check_filter
   7178 echo >>"$at_stderr"; $as_echo "input-c-glr.y:1.7: error: %code qualifier 'q' is not used
   7179 input-c-glr.y:2.7-9: error: %code qualifier 'bad' is not used
   7180 input-c-glr.y:3.8-10: error: %code qualifier 'bad' is not used
   7181 " | \
   7182   $at_diff - "$at_stderr" || at_failed=:
   7183 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7184 at_fn_check_status 1 $at_status "$at_srcdir/input.at:995"
   7185 $at_failed && at_fn_log_failure
   7186 $at_traceon; }
   7187 
   7188 
   7189 
   7190 cat >input-c++.y <<'_ATEOF'
   7191 %code q {}
   7192 %code bad {}
   7193  %code q {}
   7194 %%
   7195 start: ;
   7196 _ATEOF
   7197 
   7198 
   7199 { set +x
   7200 $as_echo "$at_srcdir/input.at:1008: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++.y"
   7201 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++.y" "input.at:1008"
   7202 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c++.y
   7203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7204 at_status=$? at_failed=false
   7205 $at_check_filter
   7206 echo >>"$at_stderr"; $as_echo "input-c++.y:1.7: error: %code qualifier 'q' is not used
   7207 input-c++.y:2.7-9: error: %code qualifier 'bad' is not used
   7208 input-c++.y:3.8: error: %code qualifier 'q' is not used
   7209 " | \
   7210   $at_diff - "$at_stderr" || at_failed=:
   7211 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7212 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1008"
   7213 $at_failed && at_fn_log_failure
   7214 $at_traceon; }
   7215 
   7216 
   7217 
   7218 cat >input-c++-glr.y <<'_ATEOF'
   7219 %code bad {}
   7220 %code q {}
   7221 %code q {}
   7222 %%
   7223 start: ;
   7224 _ATEOF
   7225 
   7226 
   7227 { set +x
   7228 $as_echo "$at_srcdir/input.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++-glr.y"
   7229 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-c++-glr.y" "input.at:1021"
   7230 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-c++-glr.y
   7231 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7232 at_status=$? at_failed=false
   7233 $at_check_filter
   7234 echo >>"$at_stderr"; $as_echo "input-c++-glr.y:1.7-9: error: %code qualifier 'bad' is not used
   7235 input-c++-glr.y:2.7: error: %code qualifier 'q' is not used
   7236 input-c++-glr.y:3.7: error: %code qualifier 'q' is not used
   7237 " | \
   7238   $at_diff - "$at_stderr" || at_failed=:
   7239 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7240 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1021"
   7241 $at_failed && at_fn_log_failure
   7242 $at_traceon; }
   7243 
   7244 
   7245 
   7246 cat >special-char-@@.y <<'_ATEOF'
   7247 %code bad {}
   7248 %code q {}
   7249 %code q {}
   7250 %%
   7251 start: ;
   7252 _ATEOF
   7253 
   7254 
   7255 { set +x
   7256 $as_echo "$at_srcdir/input.at:1034: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-@@.y"
   7257 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-@@.y" "input.at:1034"
   7258 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison special-char-@@.y
   7259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7260 at_status=$? at_failed=false
   7261 $at_check_filter
   7262 echo >>"$at_stderr"; $as_echo "special-char-@@.y:1.7-9: error: %code qualifier 'bad' is not used
   7263 special-char-@@.y:2.7: error: %code qualifier 'q' is not used
   7264 special-char-@@.y:3.7: error: %code qualifier 'q' is not used
   7265 " | \
   7266   $at_diff - "$at_stderr" || at_failed=:
   7267 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7268 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1034"
   7269 $at_failed && at_fn_log_failure
   7270 $at_traceon; }
   7271 
   7272 
   7273 
   7274 cat >special-char-].y <<'_ATEOF'
   7275 %code bad {}
   7276 %code q {}
   7277 %code q {}
   7278 %%
   7279 start: ;
   7280 _ATEOF
   7281 
   7282 
   7283 { set +x
   7284 $as_echo "$at_srcdir/input.at:1047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-].y"
   7285 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison special-char-].y" "input.at:1047"
   7286 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison special-char-].y
   7287 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7288 at_status=$? at_failed=false
   7289 $at_check_filter
   7290 echo >>"$at_stderr"; $as_echo "special-char-].y:1.7-9: error: %code qualifier 'bad' is not used
   7291 special-char-].y:2.7: error: %code qualifier 'q' is not used
   7292 special-char-].y:3.7: error: %code qualifier 'q' is not used
   7293 " | \
   7294   $at_diff - "$at_stderr" || at_failed=:
   7295 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7296 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1047"
   7297 $at_failed && at_fn_log_failure
   7298 $at_traceon; }
   7299 
   7300 
   7301 
   7302   set +x
   7303   $at_times_p && times >"$at_times_file"
   7304 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7305 read at_status <"$at_status_file"
   7306 #AT_STOP_24
   7307 #AT_START_25
   7308 at_fn_group_banner 25 'input.at:1060' \
   7309   "%define errors" "                                 " 1
   7310 at_xfail=no
   7311 (
   7312   $as_echo "25. $at_setup_line: testing $at_desc ..."
   7313   $at_traceon
   7314 
   7315 
   7316 cat >input-redefined.y <<'_ATEOF'
   7317 %define var "value1"
   7318 %define var "value1"
   7319  %define var "value2"
   7320 %define special1 "]"
   7321 %define special2 "["
   7322 %%
   7323 start: ;
   7324 _ATEOF
   7325 
   7326 
   7327 
   7328 { set +x
   7329 $as_echo "$at_srcdir/input.at:1072: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-redefined.y"
   7330 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-redefined.y" "input.at:1072"
   7331 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-redefined.y
   7332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7333 at_status=$? at_failed=false
   7334 $at_check_filter
   7335 echo >>"$at_stderr"; $as_echo "input-redefined.y:2.9-11: error: %define variable 'var' redefined
   7336 input-redefined.y:1.9-11:     previous definition
   7337 input-redefined.y:3.10-12: error: %define variable 'var' redefined
   7338 input-redefined.y:2.9-11:      previous definition
   7339 " | \
   7340   $at_diff - "$at_stderr" || at_failed=:
   7341 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7342 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1072"
   7343 $at_failed && at_fn_log_failure
   7344 $at_traceon; }
   7345 
   7346 
   7347 
   7348 cat >input-unused.y <<'_ATEOF'
   7349 %define var "value"
   7350 %%
   7351 start: ;
   7352 _ATEOF
   7353 
   7354 
   7355 
   7356 { set +x
   7357 $as_echo "$at_srcdir/input.at:1085: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-unused.y"
   7358 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-unused.y" "input.at:1085"
   7359 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-unused.y
   7360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7361 at_status=$? at_failed=false
   7362 $at_check_filter
   7363 echo >>"$at_stderr"; $as_echo "input-unused.y:1.9-11: error: %define variable 'var' is not used
   7364 " | \
   7365   $at_diff - "$at_stderr" || at_failed=:
   7366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7367 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1085"
   7368 $at_failed && at_fn_log_failure
   7369 $at_traceon; }
   7370 
   7371 
   7372 
   7373   set +x
   7374   $at_times_p && times >"$at_times_file"
   7375 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7376 read at_status <"$at_status_file"
   7377 #AT_STOP_25
   7378 #AT_START_26
   7379 at_fn_group_banner 26 'input.at:1096' \
   7380   "%define, --define, --force-define" "              " 1
   7381 at_xfail=no
   7382 (
   7383   $as_echo "26. $at_setup_line: testing $at_desc ..."
   7384   $at_traceon
   7385 
   7386 
   7387 cat >skel.c <<'_ATEOF'
   7388 m4_divert_push(0)@
   7389 @output(b4_parser_file_name@)@
   7390 [var-dd: ]b4_percent_define_get([[var-dd]])[
   7391 var-ff: ]b4_percent_define_get([[var-ff]])[
   7392 var-dfg: ]b4_percent_define_get([[var-dfg]])[
   7393 var-fd: ]b4_percent_define_get([[var-fd]])
   7394 m4_divert_pop(0)
   7395 _ATEOF
   7396 
   7397 cat >input.y <<'_ATEOF'
   7398 %define var-dfg "gram"
   7399 %%
   7400 start: ;
   7401 _ATEOF
   7402 
   7403 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   7404   at_save_special_files
   7405   mkdir xml-tests
   7406     # Don't combine these Bison invocations since we want to be sure that
   7407   # --report=all isn't required to get the full XML file.
   7408   { set +x
   7409 $as_echo "$at_srcdir/input.at:1112: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   7410                   --graph=xml-tests/test.dot -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\
   7411                  -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\
   7412                  -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\
   7413                  -Fvar-fd=cmd-f -Dvar-fd=cmd-d   \\
   7414                  --skeleton ./skel.c input.y"
   7415 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1112"
   7416 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   7417                   --graph=xml-tests/test.dot -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
   7418                  -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
   7419                  -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
   7420                  -Fvar-fd=cmd-f -Dvar-fd=cmd-d   \
   7421                  --skeleton ./skel.c input.y
   7422 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7423 at_status=$? at_failed=false
   7424 $at_check_filter
   7425 echo stderr:; cat "$at_stderr"
   7426 echo stdout:; cat "$at_stdout"
   7427 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112"
   7428 $at_failed && at_fn_log_failure
   7429 $at_traceon; }
   7430 
   7431   { set +x
   7432 $as_echo "$at_srcdir/input.at:1112: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\
   7433                  -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\
   7434                  -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\
   7435                  -Fvar-fd=cmd-f -Dvar-fd=cmd-d   \\
   7436                  --skeleton ./skel.c input.y"
   7437 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1112"
   7438 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
   7439                  -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
   7440                  -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
   7441                  -Fvar-fd=cmd-f -Dvar-fd=cmd-d   \
   7442                  --skeleton ./skel.c input.y
   7443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7444 at_status=$? at_failed=false
   7445 $at_check_filter
   7446 echo stderr:; cat "$at_stderr"
   7447 echo stdout:; cat "$at_stdout"
   7448 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112"
   7449 $at_failed && at_fn_log_failure
   7450 $at_traceon; }
   7451 
   7452     cp xml-tests/test.output expout
   7453   { set +x
   7454 $as_echo "$at_srcdir/input.at:1112: \$XSLTPROC \\
   7455              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   7456              xml-tests/test.xml"
   7457 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1112"
   7458 ( $at_check_trace; $XSLTPROC \
   7459              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   7460              xml-tests/test.xml
   7461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7462 at_status=$? at_failed=false
   7463 $at_check_filter
   7464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   7465 $at_diff expout "$at_stdout" || at_failed=:
   7466 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112"
   7467 $at_failed && at_fn_log_failure
   7468 $at_traceon; }
   7469 
   7470   sort xml-tests/test.dot > expout
   7471   { set +x
   7472 $as_echo "$at_srcdir/input.at:1112: \$XSLTPROC \\
   7473              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   7474              xml-tests/test.xml | sort"
   7475 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1112"
   7476 ( $at_check_trace; $XSLTPROC \
   7477              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   7478              xml-tests/test.xml | sort
   7479 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7480 at_status=$? at_failed=false
   7481 $at_check_filter
   7482 at_fn_diff_devnull "$at_stderr" || at_failed=:
   7483 $at_diff expout "$at_stdout" || at_failed=:
   7484 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112"
   7485 $at_failed && at_fn_log_failure
   7486 $at_traceon; }
   7487 
   7488   rm -rf xml-tests expout
   7489   at_restore_special_files
   7490 fi
   7491 { set +x
   7492 $as_echo "$at_srcdir/input.at:1112: bison -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\
   7493                  -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\
   7494                  -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\
   7495                  -Fvar-fd=cmd-f -Dvar-fd=cmd-d   \\
   7496                  --skeleton ./skel.c input.y"
   7497 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1112"
   7498 ( $at_check_trace; bison -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
   7499                  -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
   7500                  -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
   7501                  -Fvar-fd=cmd-f -Dvar-fd=cmd-d   \
   7502                  --skeleton ./skel.c input.y
   7503 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7504 at_status=$? at_failed=false
   7505 $at_check_filter
   7506 at_fn_diff_devnull "$at_stderr" || at_failed=:
   7507 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7508 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1112"
   7509 $at_failed && at_fn_log_failure
   7510 $at_traceon; }
   7511 
   7512 
   7513 { set +x
   7514 $as_echo "$at_srcdir/input.at:1117: cat input.tab.c"
   7515 at_fn_check_prepare_trace "input.at:1117"
   7516 ( $at_check_trace; cat input.tab.c
   7517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7518 at_status=$? at_failed=false
   7519 $at_check_filter
   7520 at_fn_diff_devnull "$at_stderr" || at_failed=:
   7521 echo >>"$at_stdout"; $as_echo "var-dd: cmd-d2
   7522 var-ff: cmd-f2
   7523 var-dfg: cmd-f
   7524 var-fd: cmd-d
   7525 " | \
   7526   $at_diff - "$at_stdout" || at_failed=:
   7527 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1117"
   7528 $at_failed && at_fn_log_failure
   7529 $at_traceon; }
   7530 
   7531 
   7532 cat >input-dg.y <<'_ATEOF'
   7533 %define var "gram"
   7534 %%
   7535 start: ;
   7536 _ATEOF
   7537 
   7538 
   7539 { set +x
   7540 $as_echo "$at_srcdir/input.at:1129: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dvar=cmd-d input-dg.y"
   7541 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dvar=cmd-d input-dg.y" "input.at:1129"
   7542 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dvar=cmd-d input-dg.y
   7543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7544 at_status=$? at_failed=false
   7545 $at_check_filter
   7546 echo >>"$at_stderr"; $as_echo "input-dg.y:1.9-11: error: %define variable 'var' redefined
   7547 <command line>:1:      previous definition
   7548 " | \
   7549   $at_diff - "$at_stderr" || at_failed=:
   7550 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7551 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1129"
   7552 $at_failed && at_fn_log_failure
   7553 $at_traceon; }
   7554 
   7555 
   7556 
   7557 cat >input-dg.y <<'_ATEOF'
   7558 %define var "gram"
   7559 %%
   7560 start: ;
   7561 _ATEOF
   7562 
   7563 
   7564 { set +x
   7565 $as_echo "$at_srcdir/input.at:1139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -Dvar=cmd-d input-dg.y"
   7566 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -Dvar=cmd-d input-dg.y" "input.at:1139"
   7567 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -Dvar=cmd-d input-dg.y
   7568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7569 at_status=$? at_failed=false
   7570 $at_check_filter
   7571 echo >>"$at_stderr"; $as_echo "input-dg.y:1.9-11: error: %define variable 'var' redefined
   7572  %define var \"gram\"
   7573          ^^^
   7574 <command line>:2:      previous definition
   7575 " | \
   7576   $at_diff - "$at_stderr" || at_failed=:
   7577 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7578 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1139"
   7579 $at_failed && at_fn_log_failure
   7580 $at_traceon; }
   7581 
   7582 
   7583 
   7584 cat >input-unused.y <<'_ATEOF'
   7585 %%
   7586 start: ;
   7587 _ATEOF
   7588 
   7589 
   7590 { set +x
   7591 $as_echo "$at_srcdir/input.at:1150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dunused-d -Funused-f input-unused.y"
   7592 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dunused-d -Funused-f input-unused.y" "input.at:1150"
   7593 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dunused-d -Funused-f input-unused.y
   7594 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7595 at_status=$? at_failed=false
   7596 $at_check_filter
   7597 echo >>"$at_stderr"; $as_echo "<command line>:1: error: %define variable 'unused-d' is not used
   7598 <command line>:2: error: %define variable 'unused-f' is not used
   7599 " | \
   7600   $at_diff - "$at_stderr" || at_failed=:
   7601 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7602 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1150"
   7603 $at_failed && at_fn_log_failure
   7604 $at_traceon; }
   7605 
   7606 
   7607 
   7608   set +x
   7609   $at_times_p && times >"$at_times_file"
   7610 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7611 read at_status <"$at_status_file"
   7612 #AT_STOP_26
   7613 #AT_START_27
   7614 at_fn_group_banner 27 'input.at:1161' \
   7615   "%define Boolean variables" "                      " 1
   7616 at_xfail=no
   7617 (
   7618   $as_echo "27. $at_setup_line: testing $at_desc ..."
   7619   $at_traceon
   7620 
   7621 
   7622 cat >Input.y <<'_ATEOF'
   7623 %language "Java"
   7624 %define public "maybe"
   7625 %define parser_class_name "Input"
   7626 %%
   7627 start: ;
   7628 _ATEOF
   7629 
   7630 
   7631 
   7632 { set +x
   7633 $as_echo "$at_srcdir/input.at:1171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison Input.y"
   7634 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison Input.y" "input.at:1171"
   7635 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison Input.y
   7636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7637 at_status=$? at_failed=false
   7638 $at_check_filter
   7639 echo >>"$at_stderr"; $as_echo "Input.y:2.9-14: error: invalid value for %define Boolean variable 'public'
   7640 " | \
   7641   $at_diff - "$at_stderr" || at_failed=:
   7642 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7643 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1171"
   7644 $at_failed && at_fn_log_failure
   7645 $at_traceon; }
   7646 
   7647 
   7648 
   7649   set +x
   7650   $at_times_p && times >"$at_times_file"
   7651 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7652 read at_status <"$at_status_file"
   7653 #AT_STOP_27
   7654 #AT_START_28
   7655 at_fn_group_banner 28 'input.at:1181' \
   7656   "%define enum variables" "                         " 1
   7657 at_xfail=no
   7658 (
   7659   $as_echo "28. $at_setup_line: testing $at_desc ..."
   7660   $at_traceon
   7661 
   7662 
   7663 # Front-end.
   7664 cat >input.y <<'_ATEOF'
   7665 %define lr.default-reductions bogus
   7666 %%
   7667 start: ;
   7668 _ATEOF
   7669 
   7670 
   7671 { set +x
   7672 $as_echo "$at_srcdir/input.at:1189: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7673 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1189"
   7674 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7676 at_status=$? at_failed=false
   7677 $at_check_filter
   7678 echo >>"$at_stderr"; $as_echo "input.y:1.9-29: error: invalid value for %define variable 'lr.default-reductions': 'bogus'
   7679 input.y:1.9-29:     accepted value: 'most'
   7680 input.y:1.9-29:     accepted value: 'consistent'
   7681 input.y:1.9-29:     accepted value: 'accepting'
   7682 " | \
   7683   $at_diff - "$at_stderr" || at_failed=:
   7684 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7685 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1189"
   7686 $at_failed && at_fn_log_failure
   7687 $at_traceon; }
   7688 
   7689 
   7690 
   7691 # Back-end.
   7692 # FIXME: these should be indented, but we shouldn't mess with the m4 yet
   7693 cat >input.y <<'_ATEOF'
   7694 %define api.push-pull neither
   7695 %%
   7696 start: ;
   7697 _ATEOF
   7698 
   7699 
   7700 { set +x
   7701 $as_echo "$at_srcdir/input.at:1203: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7702 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1203"
   7703 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7705 at_status=$? at_failed=false
   7706 $at_check_filter
   7707 echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
   7708 input.y:1.9-21: error: accepted value: 'pull'
   7709 input.y:1.9-21: error: accepted value: 'push'
   7710 input.y:1.9-21: error: accepted value: 'both'
   7711 " | \
   7712   $at_diff - "$at_stderr" || at_failed=:
   7713 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7714 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1203"
   7715 $at_failed && at_fn_log_failure
   7716 $at_traceon; }
   7717 
   7718 
   7719 
   7720   set +x
   7721   $at_times_p && times >"$at_times_file"
   7722 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7723 read at_status <"$at_status_file"
   7724 #AT_STOP_28
   7725 #AT_START_29
   7726 at_fn_group_banner 29 'input.at:1216' \
   7727   "%define backward compatibility" "                 " 1
   7728 at_xfail=no
   7729 (
   7730   $as_echo "29. $at_setup_line: testing $at_desc ..."
   7731   $at_traceon
   7732 
   7733 
   7734 # The error messages tell us whether underscores in these variables are
   7735 # being converted to dashes.
   7736 
   7737 cat >input.y <<'_ATEOF'
   7738 %define api.push_pull "neither"
   7739 %%
   7740 start: ;
   7741 _ATEOF
   7742 
   7743 
   7744 { set +x
   7745 $as_echo "$at_srcdir/input.at:1226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7746 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1226"
   7747 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7748 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7749 at_status=$? at_failed=false
   7750 $at_check_filter
   7751 echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
   7752 input.y:1.9-21: error: accepted value: 'pull'
   7753 input.y:1.9-21: error: accepted value: 'push'
   7754 input.y:1.9-21: error: accepted value: 'both'
   7755 " | \
   7756   $at_diff - "$at_stderr" || at_failed=:
   7757 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7758 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1226"
   7759 $at_failed && at_fn_log_failure
   7760 $at_traceon; }
   7761 
   7762 
   7763 
   7764 cat >input.y <<'_ATEOF'
   7765 %define lr.keep_unreachable_states maybe
   7766 %%
   7767 start: ;
   7768 _ATEOF
   7769 
   7770 
   7771 { set +x
   7772 $as_echo "$at_srcdir/input.at:1238: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7773 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1238"
   7774 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7775 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7776 at_status=$? at_failed=false
   7777 $at_check_filter
   7778 echo >>"$at_stderr"; $as_echo "input.y:1.9-34: error: invalid value for %define Boolean variable 'lr.keep-unreachable-states'
   7779 " | \
   7780   $at_diff - "$at_stderr" || at_failed=:
   7781 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7782 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1238"
   7783 $at_failed && at_fn_log_failure
   7784 $at_traceon; }
   7785 
   7786 
   7787 
   7788 cat >input.y <<'_ATEOF'
   7789 %define foo_bar "baz"
   7790 %%
   7791 start: ;
   7792 _ATEOF
   7793 
   7794 
   7795 { set +x
   7796 $as_echo "$at_srcdir/input.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7797 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1247"
   7798 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7799 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7800 at_status=$? at_failed=false
   7801 $at_check_filter
   7802 echo >>"$at_stderr"; $as_echo "input.y:1.9-15: error: %define variable 'foo_bar' is not used
   7803 " | \
   7804   $at_diff - "$at_stderr" || at_failed=:
   7805 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7806 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1247"
   7807 $at_failed && at_fn_log_failure
   7808 $at_traceon; }
   7809 
   7810 
   7811 
   7812   set +x
   7813   $at_times_p && times >"$at_times_file"
   7814 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7815 read at_status <"$at_status_file"
   7816 #AT_STOP_29
   7817 #AT_START_30
   7818 at_fn_group_banner 30 'input.at:1257' \
   7819   "Unused %define api.pure" "                        " 1
   7820 at_xfail=no
   7821 (
   7822   $as_echo "30. $at_setup_line: testing $at_desc ..."
   7823   $at_traceon
   7824 
   7825 
   7826 # AT_CHECK_API_PURE(DECLS, VALUE)
   7827 # -------------------------------
   7828 # Make sure Bison reports that `%define api.pure VALUE' is unused when DECLS
   7829 # are specified.
   7830 
   7831 
   7832 
   7833 cat >input.y <<'_ATEOF'
   7834 %define api.pure
   7835 %language "c++" %defines
   7836 %%
   7837 start: ;
   7838 _ATEOF
   7839 
   7840 
   7841 
   7842 { set +x
   7843 $as_echo "$at_srcdir/input.at:1277: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7844 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1277"
   7845 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7846 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7847 at_status=$? at_failed=false
   7848 $at_check_filter
   7849 echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used
   7850 " | \
   7851   $at_diff - "$at_stderr" || at_failed=:
   7852 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7853 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1277"
   7854 $at_failed && at_fn_log_failure
   7855 $at_traceon; }
   7856 
   7857 
   7858 
   7859 
   7860 cat >input.y <<'_ATEOF'
   7861 %define api.pure false
   7862 %language "c++" %defines
   7863 %%
   7864 start: ;
   7865 _ATEOF
   7866 
   7867 
   7868 
   7869 { set +x
   7870 $as_echo "$at_srcdir/input.at:1278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7871 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1278"
   7872 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7874 at_status=$? at_failed=false
   7875 $at_check_filter
   7876 echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used
   7877 " | \
   7878   $at_diff - "$at_stderr" || at_failed=:
   7879 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7880 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1278"
   7881 $at_failed && at_fn_log_failure
   7882 $at_traceon; }
   7883 
   7884 
   7885 
   7886 
   7887 cat >input.y <<'_ATEOF'
   7888 %define api.pure ""
   7889 %language "c++" %defines %glr-parser
   7890 %%
   7891 start: ;
   7892 _ATEOF
   7893 
   7894 
   7895 
   7896 { set +x
   7897 $as_echo "$at_srcdir/input.at:1279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7898 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1279"
   7899 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7901 at_status=$? at_failed=false
   7902 $at_check_filter
   7903 echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used
   7904 " | \
   7905   $at_diff - "$at_stderr" || at_failed=:
   7906 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7907 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1279"
   7908 $at_failed && at_fn_log_failure
   7909 $at_traceon; }
   7910 
   7911 
   7912 
   7913 
   7914 cat >input.y <<'_ATEOF'
   7915 %define api.pure false
   7916 %language "c++" %defines %glr-parser
   7917 %%
   7918 start: ;
   7919 _ATEOF
   7920 
   7921 
   7922 
   7923 { set +x
   7924 $as_echo "$at_srcdir/input.at:1280: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7925 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1280"
   7926 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7927 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7928 at_status=$? at_failed=false
   7929 $at_check_filter
   7930 echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used
   7931 " | \
   7932   $at_diff - "$at_stderr" || at_failed=:
   7933 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7934 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1280"
   7935 $at_failed && at_fn_log_failure
   7936 $at_traceon; }
   7937 
   7938 
   7939 
   7940 
   7941 cat >input.y <<'_ATEOF'
   7942 %define api.pure true
   7943 %language "java"
   7944 %%
   7945 start: ;
   7946 _ATEOF
   7947 
   7948 
   7949 
   7950 { set +x
   7951 $as_echo "$at_srcdir/input.at:1281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7952 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1281"
   7953 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7955 at_status=$? at_failed=false
   7956 $at_check_filter
   7957 echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used
   7958 " | \
   7959   $at_diff - "$at_stderr" || at_failed=:
   7960 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7961 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1281"
   7962 $at_failed && at_fn_log_failure
   7963 $at_traceon; }
   7964 
   7965 
   7966 
   7967 
   7968 cat >input.y <<'_ATEOF'
   7969 %define api.pure false
   7970 %language "java"
   7971 %%
   7972 start: ;
   7973 _ATEOF
   7974 
   7975 
   7976 
   7977 { set +x
   7978 $as_echo "$at_srcdir/input.at:1282: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   7979 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1282"
   7980 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   7981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   7982 at_status=$? at_failed=false
   7983 $at_check_filter
   7984 echo >>"$at_stderr"; $as_echo "input.y:1.9-16: error: %define variable 'api.pure' is not used
   7985 " | \
   7986   $at_diff - "$at_stderr" || at_failed=:
   7987 at_fn_diff_devnull "$at_stdout" || at_failed=:
   7988 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1282"
   7989 $at_failed && at_fn_log_failure
   7990 $at_traceon; }
   7991 
   7992 
   7993 
   7994 
   7995   set +x
   7996   $at_times_p && times >"$at_times_file"
   7997 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   7998 read at_status <"$at_status_file"
   7999 #AT_STOP_30
   8000 #AT_START_31
   8001 at_fn_group_banner 31 'input.at:1290' \
   8002   "C++ namespace reference errors" "                 " 1
   8003 at_xfail=no
   8004 (
   8005   $as_echo "31. $at_setup_line: testing $at_desc ..."
   8006   $at_traceon
   8007 
   8008 
   8009 # AT_CHECK_NAMESPACE_ERROR(NAMESPACE-DECL, ERROR, [ERROR], ...)
   8010 # -------------------------------------------------------------
   8011 # Make sure Bison reports all ERROR's for %define namespace "NAMESPACE-DECL".
   8012 
   8013 
   8014 
   8015 cat >input.y <<'_ATEOF'
   8016 %language "C++"
   8017 %defines
   8018 %define namespace ""
   8019 %%
   8020 start: ;
   8021 _ATEOF
   8022 
   8023 
   8024 
   8025 { set +x
   8026 $as_echo "$at_srcdir/input.at:1311: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8027 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1311"
   8028 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8030 at_status=$? at_failed=false
   8031 $at_check_filter
   8032 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference is empty
   8033 " | \
   8034   $at_diff - "$at_stderr" || at_failed=:
   8035 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8036 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1311"
   8037 $at_failed && at_fn_log_failure
   8038 $at_traceon; }
   8039 
   8040 
   8041 
   8042 
   8043 cat >input.y <<'_ATEOF'
   8044 %language "C++"
   8045 %defines
   8046 %define namespace " 		  	 	"
   8047 %%
   8048 start: ;
   8049 _ATEOF
   8050 
   8051 
   8052 
   8053 { set +x
   8054 $as_echo "$at_srcdir/input.at:1313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8055 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1313"
   8056 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8057 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8058 at_status=$? at_failed=false
   8059 $at_check_filter
   8060 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference is empty
   8061 " | \
   8062   $at_diff - "$at_stderr" || at_failed=:
   8063 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8064 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1313"
   8065 $at_failed && at_fn_log_failure
   8066 $at_traceon; }
   8067 
   8068 
   8069 
   8070 
   8071 cat >input.y <<'_ATEOF'
   8072 %language "C++"
   8073 %defines
   8074 %define namespace "foo::::bar"
   8075 %%
   8076 start: ;
   8077 _ATEOF
   8078 
   8079 
   8080 
   8081 { set +x
   8082 $as_echo "$at_srcdir/input.at:1315: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8083 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1315"
   8084 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8086 at_status=$? at_failed=false
   8087 $at_check_filter
   8088 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
   8089 " | \
   8090   $at_diff - "$at_stderr" || at_failed=:
   8091 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8092 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1315"
   8093 $at_failed && at_fn_log_failure
   8094 $at_traceon; }
   8095 
   8096 
   8097 
   8098 
   8099 cat >input.y <<'_ATEOF'
   8100 %language "C++"
   8101 %defines
   8102 %define namespace "foo:: 	::bar"
   8103 %%
   8104 start: ;
   8105 _ATEOF
   8106 
   8107 
   8108 
   8109 { set +x
   8110 $as_echo "$at_srcdir/input.at:1317: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8111 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1317"
   8112 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8113 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8114 at_status=$? at_failed=false
   8115 $at_check_filter
   8116 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
   8117 " | \
   8118   $at_diff - "$at_stderr" || at_failed=:
   8119 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8120 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1317"
   8121 $at_failed && at_fn_log_failure
   8122 $at_traceon; }
   8123 
   8124 
   8125 
   8126 
   8127 cat >input.y <<'_ATEOF'
   8128 %language "C++"
   8129 %defines
   8130 %define namespace "::::bar"
   8131 %%
   8132 start: ;
   8133 _ATEOF
   8134 
   8135 
   8136 
   8137 { set +x
   8138 $as_echo "$at_srcdir/input.at:1319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8139 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1319"
   8140 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8141 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8142 at_status=$? at_failed=false
   8143 $at_check_filter
   8144 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
   8145 " | \
   8146   $at_diff - "$at_stderr" || at_failed=:
   8147 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8148 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1319"
   8149 $at_failed && at_fn_log_failure
   8150 $at_traceon; }
   8151 
   8152 
   8153 
   8154 
   8155 cat >input.y <<'_ATEOF'
   8156 %language "C++"
   8157 %defines
   8158 %define namespace ":: ::bar"
   8159 %%
   8160 start: ;
   8161 _ATEOF
   8162 
   8163 
   8164 
   8165 { set +x
   8166 $as_echo "$at_srcdir/input.at:1321: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8167 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1321"
   8168 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8170 at_status=$? at_failed=false
   8171 $at_check_filter
   8172 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
   8173 " | \
   8174   $at_diff - "$at_stderr" || at_failed=:
   8175 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8176 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1321"
   8177 $at_failed && at_fn_log_failure
   8178 $at_traceon; }
   8179 
   8180 
   8181 
   8182 
   8183 cat >input.y <<'_ATEOF'
   8184 %language "C++"
   8185 %defines
   8186 %define namespace "foo::bar::	::"
   8187 %%
   8188 start: ;
   8189 _ATEOF
   8190 
   8191 
   8192 
   8193 { set +x
   8194 $as_echo "$at_srcdir/input.at:1323: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8195 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1323"
   8196 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8198 at_status=$? at_failed=false
   8199 $at_check_filter
   8200 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has consecutive \"::\"
   8201 input.y:3.9-17: error: namespace reference has a trailing \"::\"
   8202 " | \
   8203   $at_diff - "$at_stderr" || at_failed=:
   8204 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8205 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1323"
   8206 $at_failed && at_fn_log_failure
   8207 $at_traceon; }
   8208 
   8209 
   8210 
   8211 
   8212 cat >input.y <<'_ATEOF'
   8213 %language "C++"
   8214 %defines
   8215 %define namespace "foo::bar::"
   8216 %%
   8217 start: ;
   8218 _ATEOF
   8219 
   8220 
   8221 
   8222 { set +x
   8223 $as_echo "$at_srcdir/input.at:1326: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8224 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1326"
   8225 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8226 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8227 at_status=$? at_failed=false
   8228 $at_check_filter
   8229 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\"
   8230 " | \
   8231   $at_diff - "$at_stderr" || at_failed=:
   8232 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8233 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1326"
   8234 $at_failed && at_fn_log_failure
   8235 $at_traceon; }
   8236 
   8237 
   8238 
   8239 
   8240 cat >input.y <<'_ATEOF'
   8241 %language "C++"
   8242 %defines
   8243 %define namespace "foo::bar:: 	"
   8244 %%
   8245 start: ;
   8246 _ATEOF
   8247 
   8248 
   8249 
   8250 { set +x
   8251 $as_echo "$at_srcdir/input.at:1328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8252 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1328"
   8253 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8255 at_status=$? at_failed=false
   8256 $at_check_filter
   8257 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\"
   8258 " | \
   8259   $at_diff - "$at_stderr" || at_failed=:
   8260 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8261 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1328"
   8262 $at_failed && at_fn_log_failure
   8263 $at_traceon; }
   8264 
   8265 
   8266 
   8267 
   8268 cat >input.y <<'_ATEOF'
   8269 %language "C++"
   8270 %defines
   8271 %define namespace "::"
   8272 %%
   8273 start: ;
   8274 _ATEOF
   8275 
   8276 
   8277 
   8278 { set +x
   8279 $as_echo "$at_srcdir/input.at:1330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8280 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1330"
   8281 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8283 at_status=$? at_failed=false
   8284 $at_check_filter
   8285 echo >>"$at_stderr"; $as_echo "input.y:3.9-17: error: namespace reference has a trailing \"::\"
   8286 " | \
   8287   $at_diff - "$at_stderr" || at_failed=:
   8288 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8289 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1330"
   8290 $at_failed && at_fn_log_failure
   8291 $at_traceon; }
   8292 
   8293 
   8294 
   8295 
   8296   set +x
   8297   $at_times_p && times >"$at_times_file"
   8298 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   8299 read at_status <"$at_status_file"
   8300 #AT_STOP_31
   8301 #AT_START_32
   8302 at_fn_group_banner 32 'input.at:1346' \
   8303   "Bad character literals" "                         " 1
   8304 at_xfail=no
   8305 (
   8306   $as_echo "32. $at_setup_line: testing $at_desc ..."
   8307   $at_traceon
   8308 
   8309 
   8310 cat >empty.y <<'_ATEOF'
   8311 %%
   8312 start: '';
   8313 start: '
   8314 _ATEOF
   8315 
   8316 { set +x
   8317 $as_echo "$at_srcdir/input.at:1353: \$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77"
   8318 at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77" "input.at:1353"
   8319 ( $at_check_trace; $PERL -e "print 'start: \'';" >> empty.y || exit 77
   8320 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8321 at_status=$? at_failed=false
   8322 $at_check_filter
   8323 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8324 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8325 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1353"
   8326 $at_failed && at_fn_log_failure
   8327 $at_traceon; }
   8328 
   8329 
   8330 
   8331 { set +x
   8332 $as_echo "$at_srcdir/input.at:1355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison empty.y"
   8333 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison empty.y" "input.at:1355"
   8334 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison empty.y
   8335 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8336 at_status=$? at_failed=false
   8337 $at_check_filter
   8338 echo >>"$at_stderr"; $as_echo "empty.y:2.8-9: warning: empty character literal
   8339 empty.y:3.8-4.0: warning: empty character literal
   8340 empty.y:3.8-4.0: error: missing \"'\" at end of line
   8341 empty.y:4.8: warning: empty character literal
   8342 empty.y:4.8: error: missing \"'\" at end of file
   8343 " | \
   8344   $at_diff - "$at_stderr" || at_failed=:
   8345 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8346 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1355"
   8347 $at_failed && at_fn_log_failure
   8348 $at_traceon; }
   8349 
   8350 
   8351 
   8352 cat >two.y <<'_ATEOF'
   8353 %%
   8354 start: 'ab';
   8355 start: 'ab
   8356 _ATEOF
   8357 
   8358 { set +x
   8359 $as_echo "$at_srcdir/input.at:1368: \$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77"
   8360 at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77" "input.at:1368"
   8361 ( $at_check_trace; $PERL -e "print 'start: \'ab';" >> two.y || exit 77
   8362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8363 at_status=$? at_failed=false
   8364 $at_check_filter
   8365 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8367 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1368"
   8368 $at_failed && at_fn_log_failure
   8369 $at_traceon; }
   8370 
   8371 
   8372 
   8373 { set +x
   8374 $as_echo "$at_srcdir/input.at:1370: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison two.y"
   8375 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison two.y" "input.at:1370"
   8376 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison two.y
   8377 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8378 at_status=$? at_failed=false
   8379 $at_check_filter
   8380 echo >>"$at_stderr"; $as_echo "two.y:2.8-11: warning: extra characters in character literal
   8381 two.y:3.8-4.0: warning: extra characters in character literal
   8382 two.y:3.8-4.0: error: missing \"'\" at end of line
   8383 two.y:4.8-10: warning: extra characters in character literal
   8384 two.y:4.8-10: error: missing \"'\" at end of file
   8385 " | \
   8386   $at_diff - "$at_stderr" || at_failed=:
   8387 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8388 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1370"
   8389 $at_failed && at_fn_log_failure
   8390 $at_traceon; }
   8391 
   8392 
   8393 
   8394 cat >three.y <<'_ATEOF'
   8395 %%
   8396 start: 'abc';
   8397 start: 'abc
   8398 _ATEOF
   8399 
   8400 { set +x
   8401 $as_echo "$at_srcdir/input.at:1383: \$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77"
   8402 at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77" "input.at:1383"
   8403 ( $at_check_trace; $PERL -e "print 'start: \'abc';" >> three.y || exit 77
   8404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8405 at_status=$? at_failed=false
   8406 $at_check_filter
   8407 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8408 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8409 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1383"
   8410 $at_failed && at_fn_log_failure
   8411 $at_traceon; }
   8412 
   8413 
   8414 
   8415 { set +x
   8416 $as_echo "$at_srcdir/input.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison three.y"
   8417 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison three.y" "input.at:1385"
   8418 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison three.y
   8419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8420 at_status=$? at_failed=false
   8421 $at_check_filter
   8422 echo >>"$at_stderr"; $as_echo "three.y:2.8-12: warning: extra characters in character literal
   8423 three.y:3.8-4.0: warning: extra characters in character literal
   8424 three.y:3.8-4.0: error: missing \"'\" at end of line
   8425 three.y:4.8-11: warning: extra characters in character literal
   8426 three.y:4.8-11: error: missing \"'\" at end of file
   8427 " | \
   8428   $at_diff - "$at_stderr" || at_failed=:
   8429 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8430 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1385"
   8431 $at_failed && at_fn_log_failure
   8432 $at_traceon; }
   8433 
   8434 
   8435 
   8436   set +x
   8437   $at_times_p && times >"$at_times_file"
   8438 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   8439 read at_status <"$at_status_file"
   8440 #AT_STOP_32
   8441 #AT_START_33
   8442 at_fn_group_banner 33 'input.at:1399' \
   8443   "Bad escapes in literals" "                        " 1
   8444 at_xfail=no
   8445 (
   8446   $as_echo "33. $at_setup_line: testing $at_desc ..."
   8447   $at_traceon
   8448 
   8449 
   8450 cat >input.y <<'_ATEOF'
   8451 %%
   8452 start: '\777' '\0' '\xfff' '\x0'
   8453        '\uffff' '\u0000' '\Uffffffff' '\U00000000'
   8454        '\ ' '\A';
   8455 _ATEOF
   8456 
   8457 
   8458 # It is not easy to create special characters, we cannot even trust tr.
   8459 # Beside we cannot even expect "echo '\0'" to output two characters
   8460 # (well three with \n): at least Bash 3.2 converts the two-character
   8461 # sequence "\0" into a single NUL character.
   8462 { set +x
   8463 $as_echo "$at_srcdir/input.at:1412: \$PERL -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y \\
   8464            || exit 77"
   8465 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1412"
   8466 ( $at_check_trace; $PERL -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \
   8467            || exit 77
   8468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8469 at_status=$? at_failed=false
   8470 $at_check_filter
   8471 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8472 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8473 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1412"
   8474 $at_failed && at_fn_log_failure
   8475 $at_traceon; }
   8476 
   8477 
   8478 
   8479 { set +x
   8480 $as_echo "$at_srcdir/input.at:1415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   8481 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:1415"
   8482 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   8483 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8484 at_status=$? at_failed=false
   8485 $at_check_filter
   8486 echo >>"$at_stderr"; $as_echo "input.y:2.9-12: error: invalid number after \\-escape: 777
   8487 input.y:2.8-13: warning: empty character literal
   8488 input.y:2.16-17: error: invalid number after \\-escape: 0
   8489 input.y:2.15-18: warning: empty character literal
   8490 input.y:2.21-25: error: invalid number after \\-escape: xfff
   8491 input.y:2.20-26: warning: empty character literal
   8492 input.y:2.29-31: error: invalid number after \\-escape: x0
   8493 input.y:2.28-32: warning: empty character literal
   8494 input.y:3.9-14: error: invalid number after \\-escape: uffff
   8495 input.y:3.8-15: warning: empty character literal
   8496 input.y:3.18-23: error: invalid number after \\-escape: u0000
   8497 input.y:3.17-24: warning: empty character literal
   8498 input.y:3.27-36: error: invalid number after \\-escape: Uffffffff
   8499 input.y:3.26-37: warning: empty character literal
   8500 input.y:3.40-49: error: invalid number after \\-escape: U00000000
   8501 input.y:3.39-50: warning: empty character literal
   8502 input.y:4.9-10: error: invalid character after \\-escape: ' '
   8503 input.y:4.8-11: warning: empty character literal
   8504 input.y:4.14-15: error: invalid character after \\-escape: A
   8505 input.y:4.13-16: warning: empty character literal
   8506 input.y:5.9-16: error: invalid character after \\-escape: \\t
   8507 input.y:5.17: error: invalid character after \\-escape: \\f
   8508 input.y:5.18: error: invalid character after \\-escape: \\0
   8509 input.y:5.19: error: invalid character after \\-escape: \\001
   8510 " | \
   8511   $at_diff - "$at_stderr" || at_failed=:
   8512 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8513 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1415"
   8514 $at_failed && at_fn_log_failure
   8515 $at_traceon; }
   8516 
   8517 
   8518 
   8519   set +x
   8520   $at_times_p && times >"$at_times_file"
   8521 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   8522 read at_status <"$at_status_file"
   8523 #AT_STOP_33
   8524 #AT_START_34
   8525 at_fn_group_banner 34 'input.at:1448' \
   8526   "LAC: Errors for %define" "                        " 1
   8527 at_xfail=no
   8528 (
   8529   $as_echo "34. $at_setup_line: testing $at_desc ..."
   8530   $at_traceon
   8531 
   8532 
   8533 cat >input.y <<'_ATEOF'
   8534 %%
   8535 start: ;
   8536 _ATEOF
   8537 
   8538 
   8539 # parse.lac.* options are useless if LAC isn't actually activated.
   8540 
   8541 { set +x
   8542 $as_echo "$at_srcdir/input.at:1456: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.es-capacity-initial=1 input.y"
   8543 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.es-capacity-initial=1 input.y" "input.at:1456"
   8544 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dparse.lac.es-capacity-initial=1 input.y
   8545 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8546 at_status=$? at_failed=false
   8547 $at_check_filter
   8548 echo >>"$at_stderr"; $as_echo "<command line>:1: error: %define variable 'parse.lac.es-capacity-initial' is not used
   8549 " | \
   8550   $at_diff - "$at_stderr" || at_failed=:
   8551 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8552 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1456"
   8553 $at_failed && at_fn_log_failure
   8554 $at_traceon; }
   8555 
   8556 
   8557 
   8558 { set +x
   8559 $as_echo "$at_srcdir/input.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.memory-trace=full input.y"
   8560 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dparse.lac.memory-trace=full input.y" "input.at:1460"
   8561 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dparse.lac.memory-trace=full input.y
   8562 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8563 at_status=$? at_failed=false
   8564 $at_check_filter
   8565 echo >>"$at_stderr"; $as_echo "<command line>:1: error: %define variable 'parse.lac.memory-trace' is not used
   8566 " | \
   8567   $at_diff - "$at_stderr" || at_failed=:
   8568 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8569 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1460"
   8570 $at_failed && at_fn_log_failure
   8571 $at_traceon; }
   8572 
   8573 
   8574 
   8575   set +x
   8576   $at_times_p && times >"$at_times_file"
   8577 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   8578 read at_status <"$at_status_file"
   8579 #AT_STOP_34
   8580 #AT_START_35
   8581 at_fn_group_banner 35 'input.at:1471' \
   8582   "-Werror is not affected by -Wnone and -Wall" "    " 1
   8583 at_xfail=no
   8584 (
   8585   $as_echo "35. $at_setup_line: testing $at_desc ..."
   8586   $at_traceon
   8587 
   8588 
   8589 cat >input.y <<'_ATEOF'
   8590 %%
   8591 foo-bar: ;
   8592 _ATEOF
   8593 
   8594 
   8595 # -Werror is not enabled by -Wall or equivalent.
   8596 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   8597   at_save_special_files
   8598   mkdir xml-tests
   8599     # Don't combine these Bison invocations since we want to be sure that
   8600   # --report=all isn't required to get the full XML file.
   8601   { set +x
   8602 $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   8603                   --graph=xml-tests/test.dot -Wall input.y"
   8604 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1479"
   8605 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   8606                   --graph=xml-tests/test.dot -Wall input.y
   8607 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8608 at_status=$? at_failed=false
   8609 $at_check_filter
   8610 echo stderr:; cat "$at_stderr"
   8611 echo stdout:; cat "$at_stdout"
   8612 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8613 $at_failed && at_fn_log_failure
   8614 $at_traceon; }
   8615 
   8616   { set +x
   8617 $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wall input.y"
   8618 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wall input.y" "input.at:1479"
   8619 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wall input.y
   8620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8621 at_status=$? at_failed=false
   8622 $at_check_filter
   8623 echo stderr:; cat "$at_stderr"
   8624 echo stdout:; cat "$at_stdout"
   8625 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8626 $at_failed && at_fn_log_failure
   8627 $at_traceon; }
   8628 
   8629     cp xml-tests/test.output expout
   8630   { set +x
   8631 $as_echo "$at_srcdir/input.at:1479: \$XSLTPROC \\
   8632              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   8633              xml-tests/test.xml"
   8634 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1479"
   8635 ( $at_check_trace; $XSLTPROC \
   8636              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   8637              xml-tests/test.xml
   8638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8639 at_status=$? at_failed=false
   8640 $at_check_filter
   8641 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8642 $at_diff expout "$at_stdout" || at_failed=:
   8643 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8644 $at_failed && at_fn_log_failure
   8645 $at_traceon; }
   8646 
   8647   sort xml-tests/test.dot > expout
   8648   { set +x
   8649 $as_echo "$at_srcdir/input.at:1479: \$XSLTPROC \\
   8650              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   8651              xml-tests/test.xml | sort"
   8652 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1479"
   8653 ( $at_check_trace; $XSLTPROC \
   8654              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   8655              xml-tests/test.xml | sort
   8656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8657 at_status=$? at_failed=false
   8658 $at_check_filter
   8659 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8660 $at_diff expout "$at_stdout" || at_failed=:
   8661 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8662 $at_failed && at_fn_log_failure
   8663 $at_traceon; }
   8664 
   8665   rm -rf xml-tests expout
   8666   at_restore_special_files
   8667 fi
   8668 { set +x
   8669 $as_echo "$at_srcdir/input.at:1479: bison -Wall input.y"
   8670 at_fn_check_prepare_trace "input.at:1479"
   8671 ( $at_check_trace; bison -Wall input.y
   8672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8673 at_status=$? at_failed=false
   8674 $at_check_filter
   8675 echo >>"$at_stderr"; $as_echo "input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   8676 " | \
   8677   $at_diff - "$at_stderr" || at_failed=:
   8678 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8679 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8680 $at_failed && at_fn_log_failure
   8681 $at_traceon; }
   8682 
   8683 # Defining POSIXLY_CORRECT causes bison to complain if options are
   8684 # added after the grammar file name, so skip these checks in that
   8685 # case.
   8686 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   8687   at_save_special_files
   8688 
   8689   # To avoid expanding it repeatedly, store specified stdout.
   8690   : >expout
   8691 
   8692   # Run with -Werror.
   8693   { set +x
   8694 $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Werror"
   8695 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Werror" "input.at:1479"
   8696 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y -Werror
   8697 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8698 at_status=$? at_failed=false
   8699 $at_check_filter
   8700 echo stderr:; tee stderr <"$at_stderr"
   8701 $at_diff expout "$at_stdout" || at_failed=:
   8702 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1479"
   8703 $at_failed && at_fn_log_failure
   8704 $at_traceon; }
   8705 
   8706 
   8707   # Build expected stderr up to and including the "warnings being
   8708   # treated as errors" message.
   8709   cat >at-bison-check-warnings <<'_ATEOF'
   8710 input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   8711 _ATEOF
   8712 
   8713   at_bison_check_first=`sed -n \
   8714     '/: warning: /{=;q;}' at-bison-check-warnings`
   8715   : ${at_bison_check_first:=1}
   8716   at_bison_check_first_tmp=`sed -n \
   8717     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   8718   : ${at_bison_check_first_tmp:=1}
   8719   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   8720     at_bison_check_first=$at_bison_check_first_tmp
   8721   fi
   8722   if test $at_bison_check_first -gt 1; then
   8723     sed -n "1,`expr $at_bison_check_first - 1`"p \
   8724       at-bison-check-warnings > experr
   8725   fi
   8726   echo 'bison: warnings being treated as errors' >> experr
   8727 
   8728   # Finish building expected stderr and check.  Unlike warnings,
   8729   # complaints cause bison to exit early.  Thus, with -Werror, bison
   8730   # does not necessarily report all warnings that it does without
   8731   # -Werror, but it at least reports one.
   8732   at_bison_check_last=`sed -n '$=' stderr`
   8733   : ${at_bison_check_last:=1}
   8734   at_bison_check_last=`expr $at_bison_check_last - 1`
   8735   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   8736     at-bison-check-warnings >> experr
   8737   { set +x
   8738 $as_echo "$at_srcdir/input.at:1479: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   8739               stderr 1>&2"
   8740 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1479"
   8741 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   8742               stderr 1>&2
   8743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8744 at_status=$? at_failed=false
   8745 $at_check_filter
   8746 $at_diff experr "$at_stderr" || at_failed=:
   8747 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8748 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8749 $at_failed && at_fn_log_failure
   8750 $at_traceon; }
   8751 
   8752 
   8753   # Now check --warnings=error.
   8754   cp stderr experr
   8755   { set +x
   8756 $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=error"
   8757 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=error" "input.at:1479"
   8758 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y --warnings=error
   8759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8760 at_status=$? at_failed=false
   8761 $at_check_filter
   8762 $at_diff experr "$at_stderr" || at_failed=:
   8763 $at_diff expout "$at_stdout" || at_failed=:
   8764 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1479"
   8765 $at_failed && at_fn_log_failure
   8766 $at_traceon; }
   8767 
   8768 
   8769   # Now check -Wnone and --warnings=none by making sure that
   8770   # -Werror doesn't change the exit status when -Wnone or
   8771   # --warnings=none is specified.
   8772   { set +x
   8773 $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Wnone -Werror"
   8774 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y -Wnone -Werror" "input.at:1479"
   8775 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y -Wnone -Werror
   8776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8777 at_status=$? at_failed=false
   8778 $at_check_filter
   8779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8780 $at_diff expout "$at_stdout" || at_failed=:
   8781 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8782 $at_failed && at_fn_log_failure
   8783 $at_traceon; }
   8784 
   8785   { set +x
   8786 $as_echo "$at_srcdir/input.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=none -Werror"
   8787 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wall input.y --warnings=none -Werror" "input.at:1479"
   8788 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wall input.y --warnings=none -Werror
   8789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8790 at_status=$? at_failed=false
   8791 $at_check_filter
   8792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8793 $at_diff expout "$at_stdout" || at_failed=:
   8794 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1479"
   8795 $at_failed && at_fn_log_failure
   8796 $at_traceon; }
   8797 
   8798 
   8799   at_restore_special_files
   8800 fi
   8801 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   8802   at_save_special_files
   8803   mkdir xml-tests
   8804     # Don't combine these Bison invocations since we want to be sure that
   8805   # --report=all isn't required to get the full XML file.
   8806   { set +x
   8807 $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   8808                   --graph=xml-tests/test.dot -W input.y"
   8809 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1482"
   8810 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   8811                   --graph=xml-tests/test.dot -W input.y
   8812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8813 at_status=$? at_failed=false
   8814 $at_check_filter
   8815 echo stderr:; cat "$at_stderr"
   8816 echo stdout:; cat "$at_stdout"
   8817 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8818 $at_failed && at_fn_log_failure
   8819 $at_traceon; }
   8820 
   8821   { set +x
   8822 $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -W input.y"
   8823 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -W input.y" "input.at:1482"
   8824 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -W input.y
   8825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8826 at_status=$? at_failed=false
   8827 $at_check_filter
   8828 echo stderr:; cat "$at_stderr"
   8829 echo stdout:; cat "$at_stdout"
   8830 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8831 $at_failed && at_fn_log_failure
   8832 $at_traceon; }
   8833 
   8834     cp xml-tests/test.output expout
   8835   { set +x
   8836 $as_echo "$at_srcdir/input.at:1482: \$XSLTPROC \\
   8837              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   8838              xml-tests/test.xml"
   8839 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1482"
   8840 ( $at_check_trace; $XSLTPROC \
   8841              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   8842              xml-tests/test.xml
   8843 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8844 at_status=$? at_failed=false
   8845 $at_check_filter
   8846 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8847 $at_diff expout "$at_stdout" || at_failed=:
   8848 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8849 $at_failed && at_fn_log_failure
   8850 $at_traceon; }
   8851 
   8852   sort xml-tests/test.dot > expout
   8853   { set +x
   8854 $as_echo "$at_srcdir/input.at:1482: \$XSLTPROC \\
   8855              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   8856              xml-tests/test.xml | sort"
   8857 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1482"
   8858 ( $at_check_trace; $XSLTPROC \
   8859              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   8860              xml-tests/test.xml | sort
   8861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8862 at_status=$? at_failed=false
   8863 $at_check_filter
   8864 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8865 $at_diff expout "$at_stdout" || at_failed=:
   8866 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8867 $at_failed && at_fn_log_failure
   8868 $at_traceon; }
   8869 
   8870   rm -rf xml-tests expout
   8871   at_restore_special_files
   8872 fi
   8873 { set +x
   8874 $as_echo "$at_srcdir/input.at:1482: bison -W input.y"
   8875 at_fn_check_prepare_trace "input.at:1482"
   8876 ( $at_check_trace; bison -W input.y
   8877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8878 at_status=$? at_failed=false
   8879 $at_check_filter
   8880 echo >>"$at_stderr"; $as_echo "input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   8881 " | \
   8882   $at_diff - "$at_stderr" || at_failed=:
   8883 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8884 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8885 $at_failed && at_fn_log_failure
   8886 $at_traceon; }
   8887 
   8888 # Defining POSIXLY_CORRECT causes bison to complain if options are
   8889 # added after the grammar file name, so skip these checks in that
   8890 # case.
   8891 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   8892   at_save_special_files
   8893 
   8894   # To avoid expanding it repeatedly, store specified stdout.
   8895   : >expout
   8896 
   8897   # Run with -Werror.
   8898   { set +x
   8899 $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Werror"
   8900 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Werror" "input.at:1482"
   8901 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y -Werror
   8902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8903 at_status=$? at_failed=false
   8904 $at_check_filter
   8905 echo stderr:; tee stderr <"$at_stderr"
   8906 $at_diff expout "$at_stdout" || at_failed=:
   8907 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1482"
   8908 $at_failed && at_fn_log_failure
   8909 $at_traceon; }
   8910 
   8911 
   8912   # Build expected stderr up to and including the "warnings being
   8913   # treated as errors" message.
   8914   cat >at-bison-check-warnings <<'_ATEOF'
   8915 input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   8916 _ATEOF
   8917 
   8918   at_bison_check_first=`sed -n \
   8919     '/: warning: /{=;q;}' at-bison-check-warnings`
   8920   : ${at_bison_check_first:=1}
   8921   at_bison_check_first_tmp=`sed -n \
   8922     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   8923   : ${at_bison_check_first_tmp:=1}
   8924   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   8925     at_bison_check_first=$at_bison_check_first_tmp
   8926   fi
   8927   if test $at_bison_check_first -gt 1; then
   8928     sed -n "1,`expr $at_bison_check_first - 1`"p \
   8929       at-bison-check-warnings > experr
   8930   fi
   8931   echo 'bison: warnings being treated as errors' >> experr
   8932 
   8933   # Finish building expected stderr and check.  Unlike warnings,
   8934   # complaints cause bison to exit early.  Thus, with -Werror, bison
   8935   # does not necessarily report all warnings that it does without
   8936   # -Werror, but it at least reports one.
   8937   at_bison_check_last=`sed -n '$=' stderr`
   8938   : ${at_bison_check_last:=1}
   8939   at_bison_check_last=`expr $at_bison_check_last - 1`
   8940   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   8941     at-bison-check-warnings >> experr
   8942   { set +x
   8943 $as_echo "$at_srcdir/input.at:1482: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   8944               stderr 1>&2"
   8945 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1482"
   8946 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   8947               stderr 1>&2
   8948 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8949 at_status=$? at_failed=false
   8950 $at_check_filter
   8951 $at_diff experr "$at_stderr" || at_failed=:
   8952 at_fn_diff_devnull "$at_stdout" || at_failed=:
   8953 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8954 $at_failed && at_fn_log_failure
   8955 $at_traceon; }
   8956 
   8957 
   8958   # Now check --warnings=error.
   8959   cp stderr experr
   8960   { set +x
   8961 $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=error"
   8962 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=error" "input.at:1482"
   8963 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y --warnings=error
   8964 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8965 at_status=$? at_failed=false
   8966 $at_check_filter
   8967 $at_diff experr "$at_stderr" || at_failed=:
   8968 $at_diff expout "$at_stdout" || at_failed=:
   8969 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1482"
   8970 $at_failed && at_fn_log_failure
   8971 $at_traceon; }
   8972 
   8973 
   8974   # Now check -Wnone and --warnings=none by making sure that
   8975   # -Werror doesn't change the exit status when -Wnone or
   8976   # --warnings=none is specified.
   8977   { set +x
   8978 $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Wnone -Werror"
   8979 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y -Wnone -Werror" "input.at:1482"
   8980 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y -Wnone -Werror
   8981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8982 at_status=$? at_failed=false
   8983 $at_check_filter
   8984 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8985 $at_diff expout "$at_stdout" || at_failed=:
   8986 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   8987 $at_failed && at_fn_log_failure
   8988 $at_traceon; }
   8989 
   8990   { set +x
   8991 $as_echo "$at_srcdir/input.at:1482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=none -Werror"
   8992 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -W input.y --warnings=none -Werror" "input.at:1482"
   8993 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -W input.y --warnings=none -Werror
   8994 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   8995 at_status=$? at_failed=false
   8996 $at_check_filter
   8997 at_fn_diff_devnull "$at_stderr" || at_failed=:
   8998 $at_diff expout "$at_stdout" || at_failed=:
   8999 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1482"
   9000 $at_failed && at_fn_log_failure
   9001 $at_traceon; }
   9002 
   9003 
   9004   at_restore_special_files
   9005 fi
   9006 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   9007   at_save_special_files
   9008   mkdir xml-tests
   9009     # Don't combine these Bison invocations since we want to be sure that
   9010   # --report=all isn't required to get the full XML file.
   9011   { set +x
   9012 $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   9013                   --graph=xml-tests/test.dot -Wno-none input.y"
   9014 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1485"
   9015 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   9016                   --graph=xml-tests/test.dot -Wno-none input.y
   9017 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9018 at_status=$? at_failed=false
   9019 $at_check_filter
   9020 echo stderr:; cat "$at_stderr"
   9021 echo stdout:; cat "$at_stdout"
   9022 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9023 $at_failed && at_fn_log_failure
   9024 $at_traceon; }
   9025 
   9026   { set +x
   9027 $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-none input.y"
   9028 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-none input.y" "input.at:1485"
   9029 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-none input.y
   9030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9031 at_status=$? at_failed=false
   9032 $at_check_filter
   9033 echo stderr:; cat "$at_stderr"
   9034 echo stdout:; cat "$at_stdout"
   9035 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9036 $at_failed && at_fn_log_failure
   9037 $at_traceon; }
   9038 
   9039     cp xml-tests/test.output expout
   9040   { set +x
   9041 $as_echo "$at_srcdir/input.at:1485: \$XSLTPROC \\
   9042              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   9043              xml-tests/test.xml"
   9044 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1485"
   9045 ( $at_check_trace; $XSLTPROC \
   9046              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   9047              xml-tests/test.xml
   9048 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9049 at_status=$? at_failed=false
   9050 $at_check_filter
   9051 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9052 $at_diff expout "$at_stdout" || at_failed=:
   9053 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9054 $at_failed && at_fn_log_failure
   9055 $at_traceon; }
   9056 
   9057   sort xml-tests/test.dot > expout
   9058   { set +x
   9059 $as_echo "$at_srcdir/input.at:1485: \$XSLTPROC \\
   9060              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   9061              xml-tests/test.xml | sort"
   9062 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1485"
   9063 ( $at_check_trace; $XSLTPROC \
   9064              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   9065              xml-tests/test.xml | sort
   9066 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9067 at_status=$? at_failed=false
   9068 $at_check_filter
   9069 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9070 $at_diff expout "$at_stdout" || at_failed=:
   9071 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9072 $at_failed && at_fn_log_failure
   9073 $at_traceon; }
   9074 
   9075   rm -rf xml-tests expout
   9076   at_restore_special_files
   9077 fi
   9078 { set +x
   9079 $as_echo "$at_srcdir/input.at:1485: bison -Wno-none input.y"
   9080 at_fn_check_prepare_trace "input.at:1485"
   9081 ( $at_check_trace; bison -Wno-none input.y
   9082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9083 at_status=$? at_failed=false
   9084 $at_check_filter
   9085 echo >>"$at_stderr"; $as_echo "input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   9086 " | \
   9087   $at_diff - "$at_stderr" || at_failed=:
   9088 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9089 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9090 $at_failed && at_fn_log_failure
   9091 $at_traceon; }
   9092 
   9093 # Defining POSIXLY_CORRECT causes bison to complain if options are
   9094 # added after the grammar file name, so skip these checks in that
   9095 # case.
   9096 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   9097   at_save_special_files
   9098 
   9099   # To avoid expanding it repeatedly, store specified stdout.
   9100   : >expout
   9101 
   9102   # Run with -Werror.
   9103   { set +x
   9104 $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Werror"
   9105 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Werror" "input.at:1485"
   9106 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y -Werror
   9107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9108 at_status=$? at_failed=false
   9109 $at_check_filter
   9110 echo stderr:; tee stderr <"$at_stderr"
   9111 $at_diff expout "$at_stdout" || at_failed=:
   9112 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1485"
   9113 $at_failed && at_fn_log_failure
   9114 $at_traceon; }
   9115 
   9116 
   9117   # Build expected stderr up to and including the "warnings being
   9118   # treated as errors" message.
   9119   cat >at-bison-check-warnings <<'_ATEOF'
   9120 input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   9121 _ATEOF
   9122 
   9123   at_bison_check_first=`sed -n \
   9124     '/: warning: /{=;q;}' at-bison-check-warnings`
   9125   : ${at_bison_check_first:=1}
   9126   at_bison_check_first_tmp=`sed -n \
   9127     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   9128   : ${at_bison_check_first_tmp:=1}
   9129   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   9130     at_bison_check_first=$at_bison_check_first_tmp
   9131   fi
   9132   if test $at_bison_check_first -gt 1; then
   9133     sed -n "1,`expr $at_bison_check_first - 1`"p \
   9134       at-bison-check-warnings > experr
   9135   fi
   9136   echo 'bison: warnings being treated as errors' >> experr
   9137 
   9138   # Finish building expected stderr and check.  Unlike warnings,
   9139   # complaints cause bison to exit early.  Thus, with -Werror, bison
   9140   # does not necessarily report all warnings that it does without
   9141   # -Werror, but it at least reports one.
   9142   at_bison_check_last=`sed -n '$=' stderr`
   9143   : ${at_bison_check_last:=1}
   9144   at_bison_check_last=`expr $at_bison_check_last - 1`
   9145   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   9146     at-bison-check-warnings >> experr
   9147   { set +x
   9148 $as_echo "$at_srcdir/input.at:1485: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   9149               stderr 1>&2"
   9150 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1485"
   9151 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   9152               stderr 1>&2
   9153 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9154 at_status=$? at_failed=false
   9155 $at_check_filter
   9156 $at_diff experr "$at_stderr" || at_failed=:
   9157 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9158 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9159 $at_failed && at_fn_log_failure
   9160 $at_traceon; }
   9161 
   9162 
   9163   # Now check --warnings=error.
   9164   cp stderr experr
   9165   { set +x
   9166 $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=error"
   9167 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=error" "input.at:1485"
   9168 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=error
   9169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9170 at_status=$? at_failed=false
   9171 $at_check_filter
   9172 $at_diff experr "$at_stderr" || at_failed=:
   9173 $at_diff expout "$at_stdout" || at_failed=:
   9174 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1485"
   9175 $at_failed && at_fn_log_failure
   9176 $at_traceon; }
   9177 
   9178 
   9179   # Now check -Wnone and --warnings=none by making sure that
   9180   # -Werror doesn't change the exit status when -Wnone or
   9181   # --warnings=none is specified.
   9182   { set +x
   9183 $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Wnone -Werror"
   9184 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y -Wnone -Werror" "input.at:1485"
   9185 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y -Wnone -Werror
   9186 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9187 at_status=$? at_failed=false
   9188 $at_check_filter
   9189 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9190 $at_diff expout "$at_stdout" || at_failed=:
   9191 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9192 $at_failed && at_fn_log_failure
   9193 $at_traceon; }
   9194 
   9195   { set +x
   9196 $as_echo "$at_srcdir/input.at:1485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=none -Werror"
   9197 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=none -Werror" "input.at:1485"
   9198 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wno-none input.y --warnings=none -Werror
   9199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9200 at_status=$? at_failed=false
   9201 $at_check_filter
   9202 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9203 $at_diff expout "$at_stdout" || at_failed=:
   9204 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1485"
   9205 $at_failed && at_fn_log_failure
   9206 $at_traceon; }
   9207 
   9208 
   9209   at_restore_special_files
   9210 fi
   9211 
   9212 # -Werror is not disabled by -Wnone or equivalent.
   9213 
   9214 { set +x
   9215 $as_echo "$at_srcdir/input.at:1490: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,none,yacc input.y"
   9216 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,none,yacc input.y" "input.at:1490"
   9217 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror,none,yacc input.y
   9218 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9219 at_status=$? at_failed=false
   9220 $at_check_filter
   9221 echo stderr:; tee stderr <"$at_stderr"
   9222 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9223 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1490"
   9224 $at_failed && at_fn_log_failure
   9225 $at_traceon; }
   9226 
   9227 
   9228 { set +x
   9229 $as_echo "$at_srcdir/input.at:1491: sed 's/^.*bison:/bison:/' stderr"
   9230 at_fn_check_prepare_trace "input.at:1491"
   9231 ( $at_check_trace; sed 's/^.*bison:/bison:/' stderr
   9232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9233 at_status=$? at_failed=false
   9234 $at_check_filter
   9235 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9236 echo >>"$at_stdout"; $as_echo "bison: warnings being treated as errors
   9237 input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
   9238 " | \
   9239   $at_diff - "$at_stdout" || at_failed=:
   9240 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1491"
   9241 $at_failed && at_fn_log_failure
   9242 $at_traceon; }
   9243 
   9244 mv stderr experr
   9245 
   9246 { set +x
   9247 $as_echo "$at_srcdir/input.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,no-all,yacc input.y"
   9248 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror,no-all,yacc input.y" "input.at:1496"
   9249 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror,no-all,yacc input.y
   9250 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9251 at_status=$? at_failed=false
   9252 $at_check_filter
   9253 $at_diff experr "$at_stderr" || at_failed=:
   9254 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9255 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1496"
   9256 $at_failed && at_fn_log_failure
   9257 $at_traceon; }
   9258 
   9259 
   9260 
   9261   set +x
   9262   $at_times_p && times >"$at_times_file"
   9263 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   9264 read at_status <"$at_status_file"
   9265 #AT_STOP_35
   9266 #AT_START_36
   9267 at_fn_group_banner 36 'input.at:1505' \
   9268   "%name-prefix and %define api.prefix are incompatible" "" 1
   9269 at_xfail=no
   9270 (
   9271   $as_echo "36. $at_setup_line: testing $at_desc ..."
   9272   $at_traceon
   9273 
   9274 
   9275 # AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION)
   9276 # --------------------------------------------
   9277 
   9278 
   9279 cat >input.y <<'_ATEOF'
   9280 %define api.prefix foo %name-prefix "bar"
   9281 %%
   9282 exp:;
   9283 _ATEOF
   9284 
   9285 
   9286 { set +x
   9287 $as_echo "$at_srcdir/input.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison  input.y"
   9288 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison  input.y" "input.at:1520"
   9289 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison  input.y
   9290 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9291 at_status=$? at_failed=false
   9292 $at_check_filter
   9293 echo >>"$at_stderr"; $as_echo "input.y:1.9-18: error: '%name-prefix' and '%define api.prefix' cannot be used together
   9294 " | \
   9295   $at_diff - "$at_stderr" || at_failed=:
   9296 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9297 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1520"
   9298 $at_failed && at_fn_log_failure
   9299 $at_traceon; }
   9300 
   9301 
   9302 
   9303 cat >input.y <<'_ATEOF'
   9304 
   9305 %%
   9306 exp:;
   9307 _ATEOF
   9308 
   9309 
   9310 { set +x
   9311 $as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo -p bar input.y"
   9312 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo -p bar input.y" "input.at:1521"
   9313 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dapi.prefix=foo -p bar input.y
   9314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9315 at_status=$? at_failed=false
   9316 $at_check_filter
   9317 echo >>"$at_stderr"; $as_echo "<command line>:1: error: '%name-prefix' and '%define api.prefix' cannot be used together
   9318 " | \
   9319   $at_diff - "$at_stderr" || at_failed=:
   9320 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9321 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1521"
   9322 $at_failed && at_fn_log_failure
   9323 $at_traceon; }
   9324 
   9325 
   9326 
   9327 cat >input.y <<'_ATEOF'
   9328 %name-prefix "bar"
   9329 %%
   9330 exp:;
   9331 _ATEOF
   9332 
   9333 
   9334 { set +x
   9335 $as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo input.y"
   9336 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Dapi.prefix=foo input.y" "input.at:1522"
   9337 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Dapi.prefix=foo input.y
   9338 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9339 at_status=$? at_failed=false
   9340 $at_check_filter
   9341 echo >>"$at_stderr"; $as_echo "<command line>:1: error: '%name-prefix' and '%define api.prefix' cannot be used together
   9342 " | \
   9343   $at_diff - "$at_stderr" || at_failed=:
   9344 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9345 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1522"
   9346 $at_failed && at_fn_log_failure
   9347 $at_traceon; }
   9348 
   9349 
   9350 
   9351 cat >input.y <<'_ATEOF'
   9352 %define api.prefix foo
   9353 %%
   9354 exp:;
   9355 _ATEOF
   9356 
   9357 
   9358 { set +x
   9359 $as_echo "$at_srcdir/input.at:1523: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -p bar input.y"
   9360 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -p bar input.y" "input.at:1523"
   9361 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -p bar input.y
   9362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9363 at_status=$? at_failed=false
   9364 $at_check_filter
   9365 echo >>"$at_stderr"; $as_echo "input.y:1.9-18: error: '%name-prefix' and '%define api.prefix' cannot be used together
   9366 " | \
   9367   $at_diff - "$at_stderr" || at_failed=:
   9368 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9369 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1523"
   9370 $at_failed && at_fn_log_failure
   9371 $at_traceon; }
   9372 
   9373 
   9374 
   9375 
   9376 
   9377 
   9378   set +x
   9379   $at_times_p && times >"$at_times_file"
   9380 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   9381 read at_status <"$at_status_file"
   9382 #AT_STOP_36
   9383 #AT_START_37
   9384 at_fn_group_banner 37 'input.at:1534' \
   9385   "Stray \$ or @" "                                   " 1
   9386 at_xfail=no
   9387 (
   9388   $as_echo "37. $at_setup_line: testing $at_desc ..."
   9389   $at_traceon
   9390 
   9391 
   9392 # Give %printer and %destructor "<*> exp TOK" instead of "<*>" to
   9393 # check that the warnings are reported once, not three times.
   9394 
   9395 cat >input.y <<'_ATEOF'
   9396 %code top {
   9397 #include <config.h>
   9398 /* We don't need perfect functions for these tests. */
   9399 #undef malloc
   9400 #undef memcmp
   9401 #undef realloc
   9402 }
   9403 
   9404 %token TOK
   9405 %destructor     { $%; @%; } <*> exp TOK;
   9406 %initial-action { $%; @%; };
   9407 %printer        { $%; @%; } <*> exp TOK;
   9408 %%
   9409 exp: TOK        { $%; @%; $$ = $1; };
   9410 _ATEOF
   9411 
   9412 
   9413 
   9414 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   9415   at_save_special_files
   9416   mkdir xml-tests
   9417     # Don't combine these Bison invocations since we want to be sure that
   9418   # --report=all isn't required to get the full XML file.
   9419   { set +x
   9420 $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   9421                   --graph=xml-tests/test.dot input.y"
   9422 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1548"
   9423 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   9424                   --graph=xml-tests/test.dot input.y
   9425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9426 at_status=$? at_failed=false
   9427 $at_check_filter
   9428 echo stderr:; cat "$at_stderr"
   9429 echo stdout:; cat "$at_stdout"
   9430 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9431 $at_failed && at_fn_log_failure
   9432 $at_traceon; }
   9433 
   9434   { set +x
   9435 $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   9436 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "input.at:1548"
   9437 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   9438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9439 at_status=$? at_failed=false
   9440 $at_check_filter
   9441 echo stderr:; cat "$at_stderr"
   9442 echo stdout:; cat "$at_stdout"
   9443 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9444 $at_failed && at_fn_log_failure
   9445 $at_traceon; }
   9446 
   9447     cp xml-tests/test.output expout
   9448   { set +x
   9449 $as_echo "$at_srcdir/input.at:1548: \$XSLTPROC \\
   9450              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   9451              xml-tests/test.xml"
   9452 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1548"
   9453 ( $at_check_trace; $XSLTPROC \
   9454              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   9455              xml-tests/test.xml
   9456 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9457 at_status=$? at_failed=false
   9458 $at_check_filter
   9459 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9460 $at_diff expout "$at_stdout" || at_failed=:
   9461 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9462 $at_failed && at_fn_log_failure
   9463 $at_traceon; }
   9464 
   9465   sort xml-tests/test.dot > expout
   9466   { set +x
   9467 $as_echo "$at_srcdir/input.at:1548: \$XSLTPROC \\
   9468              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   9469              xml-tests/test.xml | sort"
   9470 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1548"
   9471 ( $at_check_trace; $XSLTPROC \
   9472              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   9473              xml-tests/test.xml | sort
   9474 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9475 at_status=$? at_failed=false
   9476 $at_check_filter
   9477 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9478 $at_diff expout "$at_stdout" || at_failed=:
   9479 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9480 $at_failed && at_fn_log_failure
   9481 $at_traceon; }
   9482 
   9483   rm -rf xml-tests expout
   9484   at_restore_special_files
   9485 fi
   9486 { set +x
   9487 $as_echo "$at_srcdir/input.at:1548: bison input.y"
   9488 at_fn_check_prepare_trace "input.at:1548"
   9489 ( $at_check_trace; bison input.y
   9490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9491 at_status=$? at_failed=false
   9492 $at_check_filter
   9493 echo >>"$at_stderr"; $as_echo "input.y:10.19: warning: stray '\$'
   9494 input.y:10.23: warning: stray '@'
   9495 input.y:11.19: warning: stray '\$'
   9496 input.y:11.23: warning: stray '@'
   9497 input.y:12.19: warning: stray '\$'
   9498 input.y:12.23: warning: stray '@'
   9499 input.y:14.19: warning: stray '\$'
   9500 input.y:14.23: warning: stray '@'
   9501 " | \
   9502   $at_diff - "$at_stderr" || at_failed=:
   9503 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9504 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9505 $at_failed && at_fn_log_failure
   9506 $at_traceon; }
   9507 
   9508 # Defining POSIXLY_CORRECT causes bison to complain if options are
   9509 # added after the grammar file name, so skip these checks in that
   9510 # case.
   9511 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   9512   at_save_special_files
   9513 
   9514   # To avoid expanding it repeatedly, store specified stdout.
   9515   : >expout
   9516 
   9517   # Run with -Werror.
   9518   { set +x
   9519 $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   9520 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "input.at:1548"
   9521 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   9522 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9523 at_status=$? at_failed=false
   9524 $at_check_filter
   9525 echo stderr:; tee stderr <"$at_stderr"
   9526 $at_diff expout "$at_stdout" || at_failed=:
   9527 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1548"
   9528 $at_failed && at_fn_log_failure
   9529 $at_traceon; }
   9530 
   9531 
   9532   # Build expected stderr up to and including the "warnings being
   9533   # treated as errors" message.
   9534   cat >at-bison-check-warnings <<'_ATEOF'
   9535 input.y:10.19: warning: stray '$'
   9536 input.y:10.23: warning: stray '@'
   9537 input.y:11.19: warning: stray '$'
   9538 input.y:11.23: warning: stray '@'
   9539 input.y:12.19: warning: stray '$'
   9540 input.y:12.23: warning: stray '@'
   9541 input.y:14.19: warning: stray '$'
   9542 input.y:14.23: warning: stray '@'
   9543 _ATEOF
   9544 
   9545   at_bison_check_first=`sed -n \
   9546     '/: warning: /{=;q;}' at-bison-check-warnings`
   9547   : ${at_bison_check_first:=1}
   9548   at_bison_check_first_tmp=`sed -n \
   9549     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   9550   : ${at_bison_check_first_tmp:=1}
   9551   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   9552     at_bison_check_first=$at_bison_check_first_tmp
   9553   fi
   9554   if test $at_bison_check_first -gt 1; then
   9555     sed -n "1,`expr $at_bison_check_first - 1`"p \
   9556       at-bison-check-warnings > experr
   9557   fi
   9558   echo 'bison: warnings being treated as errors' >> experr
   9559 
   9560   # Finish building expected stderr and check.  Unlike warnings,
   9561   # complaints cause bison to exit early.  Thus, with -Werror, bison
   9562   # does not necessarily report all warnings that it does without
   9563   # -Werror, but it at least reports one.
   9564   at_bison_check_last=`sed -n '$=' stderr`
   9565   : ${at_bison_check_last:=1}
   9566   at_bison_check_last=`expr $at_bison_check_last - 1`
   9567   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   9568     at-bison-check-warnings >> experr
   9569   { set +x
   9570 $as_echo "$at_srcdir/input.at:1548: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   9571               stderr 1>&2"
   9572 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1548"
   9573 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   9574               stderr 1>&2
   9575 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9576 at_status=$? at_failed=false
   9577 $at_check_filter
   9578 $at_diff experr "$at_stderr" || at_failed=:
   9579 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9580 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9581 $at_failed && at_fn_log_failure
   9582 $at_traceon; }
   9583 
   9584 
   9585   # Now check --warnings=error.
   9586   cp stderr experr
   9587   { set +x
   9588 $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   9589 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "input.at:1548"
   9590 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   9591 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9592 at_status=$? at_failed=false
   9593 $at_check_filter
   9594 $at_diff experr "$at_stderr" || at_failed=:
   9595 $at_diff expout "$at_stdout" || at_failed=:
   9596 at_fn_check_status 1 $at_status "$at_srcdir/input.at:1548"
   9597 $at_failed && at_fn_log_failure
   9598 $at_traceon; }
   9599 
   9600 
   9601   # Now check -Wnone and --warnings=none by making sure that
   9602   # -Werror doesn't change the exit status when -Wnone or
   9603   # --warnings=none is specified.
   9604   { set +x
   9605 $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   9606 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "input.at:1548"
   9607 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   9608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9609 at_status=$? at_failed=false
   9610 $at_check_filter
   9611 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9612 $at_diff expout "$at_stdout" || at_failed=:
   9613 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9614 $at_failed && at_fn_log_failure
   9615 $at_traceon; }
   9616 
   9617   { set +x
   9618 $as_echo "$at_srcdir/input.at:1548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   9619 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "input.at:1548"
   9620 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   9621 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9622 at_status=$? at_failed=false
   9623 $at_check_filter
   9624 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9625 $at_diff expout "$at_stdout" || at_failed=:
   9626 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1548"
   9627 $at_failed && at_fn_log_failure
   9628 $at_traceon; }
   9629 
   9630 
   9631   at_restore_special_files
   9632 fi
   9633 
   9634   set +x
   9635   $at_times_p && times >"$at_times_file"
   9636 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   9637 read at_status <"$at_status_file"
   9638 #AT_STOP_37
   9639 #AT_START_38
   9640 at_fn_group_banner 38 'input.at:1568' \
   9641   "Code injection" "                                 " 1
   9642 at_xfail=no
   9643 (
   9644   $as_echo "38. $at_setup_line: testing $at_desc ..."
   9645   $at_traceon
   9646 
   9647 
   9648 
   9649 
   9650 # AT_TEST([MACRO])
   9651 # ----------------
   9652 # Try to have MACRO be run by bison.
   9653 
   9654 
   9655 cat >input.y <<'_ATEOF'
   9656 %type <m4_errprintn(DEAD %type)> exp
   9657 %token <m4_errprintn(DEAD %token)> a
   9658 %initial-action
   9659 {
   9660   $$;
   9661   $<m4_errprintn(DEAD %initial-action)>$
   9662 };
   9663 %printer
   9664 {
   9665   $$
   9666   $<m4_errprintn(DEAD %printer)>$
   9667 } <> <*>;
   9668 %lex-param
   9669 {
   9670   m4_errprintn(DEAD %lex-param)
   9671 };
   9672 %parse-param
   9673 {
   9674   m4_errprintn(DEAD %parse-param)
   9675 };
   9676 %%
   9677 exp:
   9678   a a[last]
   9679   {
   9680     $$;
   9681     $1;
   9682     $<m4_errprintn(DEAD action 1)>$
   9683     $<m4_errprintn(DEAD action 2)>1
   9684     $<m4_errprintn(DEAD action 3)>last
   9685     $<m4_errprintn(DEAD action 4)>0
   9686     ;
   9687   };
   9688 _ATEOF
   9689 
   9690 
   9691 # FIXME: Provide a means to iterate over all the skeletons.
   9692 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   9693   at_save_special_files
   9694   mkdir xml-tests
   9695     # Don't combine these Bison invocations since we want to be sure that
   9696   # --report=all isn't required to get the full XML file.
   9697   { set +x
   9698 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   9699                   --graph=xml-tests/test.dot -d               input.y"
   9700 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619"
   9701 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   9702                   --graph=xml-tests/test.dot -d               input.y
   9703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9704 at_status=$? at_failed=false
   9705 $at_check_filter
   9706 echo stderr:; cat "$at_stderr"
   9707 echo stdout:; cat "$at_stdout"
   9708 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9709 $at_failed && at_fn_log_failure
   9710 $at_traceon; }
   9711 
   9712   { set +x
   9713 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d               input.y"
   9714 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d               input.y" "input.at:1619"
   9715 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d               input.y
   9716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9717 at_status=$? at_failed=false
   9718 $at_check_filter
   9719 echo stderr:; cat "$at_stderr"
   9720 echo stdout:; cat "$at_stdout"
   9721 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9722 $at_failed && at_fn_log_failure
   9723 $at_traceon; }
   9724 
   9725     cp xml-tests/test.output expout
   9726   { set +x
   9727 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9728              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   9729              xml-tests/test.xml"
   9730 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9731 ( $at_check_trace; $XSLTPROC \
   9732              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   9733              xml-tests/test.xml
   9734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9735 at_status=$? at_failed=false
   9736 $at_check_filter
   9737 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9738 $at_diff expout "$at_stdout" || at_failed=:
   9739 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9740 $at_failed && at_fn_log_failure
   9741 $at_traceon; }
   9742 
   9743   sort xml-tests/test.dot > expout
   9744   { set +x
   9745 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9746              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   9747              xml-tests/test.xml | sort"
   9748 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9749 ( $at_check_trace; $XSLTPROC \
   9750              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   9751              xml-tests/test.xml | sort
   9752 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9753 at_status=$? at_failed=false
   9754 $at_check_filter
   9755 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9756 $at_diff expout "$at_stdout" || at_failed=:
   9757 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9758 $at_failed && at_fn_log_failure
   9759 $at_traceon; }
   9760 
   9761   rm -rf xml-tests expout
   9762   at_restore_special_files
   9763 fi
   9764 { set +x
   9765 $as_echo "$at_srcdir/input.at:1619: bison -d               input.y"
   9766 at_fn_check_prepare_trace "input.at:1619"
   9767 ( $at_check_trace; bison -d               input.y
   9768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9769 at_status=$? at_failed=false
   9770 $at_check_filter
   9771 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9772 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9773 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9774 $at_failed && at_fn_log_failure
   9775 $at_traceon; }
   9776 
   9777 
   9778 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   9779   at_save_special_files
   9780   mkdir xml-tests
   9781     # Don't combine these Bison invocations since we want to be sure that
   9782   # --report=all isn't required to get the full XML file.
   9783   { set +x
   9784 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   9785                   --graph=xml-tests/test.dot -d -S glr.c      input.y"
   9786 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619"
   9787 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   9788                   --graph=xml-tests/test.dot -d -S glr.c      input.y
   9789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9790 at_status=$? at_failed=false
   9791 $at_check_filter
   9792 echo stderr:; cat "$at_stderr"
   9793 echo stdout:; cat "$at_stdout"
   9794 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9795 $at_failed && at_fn_log_failure
   9796 $at_traceon; }
   9797 
   9798   { set +x
   9799 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c      input.y"
   9800 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c      input.y" "input.at:1619"
   9801 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c      input.y
   9802 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9803 at_status=$? at_failed=false
   9804 $at_check_filter
   9805 echo stderr:; cat "$at_stderr"
   9806 echo stdout:; cat "$at_stdout"
   9807 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9808 $at_failed && at_fn_log_failure
   9809 $at_traceon; }
   9810 
   9811     cp xml-tests/test.output expout
   9812   { set +x
   9813 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9814              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   9815              xml-tests/test.xml"
   9816 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9817 ( $at_check_trace; $XSLTPROC \
   9818              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   9819              xml-tests/test.xml
   9820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9821 at_status=$? at_failed=false
   9822 $at_check_filter
   9823 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9824 $at_diff expout "$at_stdout" || at_failed=:
   9825 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9826 $at_failed && at_fn_log_failure
   9827 $at_traceon; }
   9828 
   9829   sort xml-tests/test.dot > expout
   9830   { set +x
   9831 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9832              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   9833              xml-tests/test.xml | sort"
   9834 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9835 ( $at_check_trace; $XSLTPROC \
   9836              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   9837              xml-tests/test.xml | sort
   9838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9839 at_status=$? at_failed=false
   9840 $at_check_filter
   9841 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9842 $at_diff expout "$at_stdout" || at_failed=:
   9843 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9844 $at_failed && at_fn_log_failure
   9845 $at_traceon; }
   9846 
   9847   rm -rf xml-tests expout
   9848   at_restore_special_files
   9849 fi
   9850 { set +x
   9851 $as_echo "$at_srcdir/input.at:1619: bison -d -S glr.c      input.y"
   9852 at_fn_check_prepare_trace "input.at:1619"
   9853 ( $at_check_trace; bison -d -S glr.c      input.y
   9854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9855 at_status=$? at_failed=false
   9856 $at_check_filter
   9857 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9858 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9859 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9860 $at_failed && at_fn_log_failure
   9861 $at_traceon; }
   9862 
   9863 
   9864 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   9865   at_save_special_files
   9866   mkdir xml-tests
   9867     # Don't combine these Bison invocations since we want to be sure that
   9868   # --report=all isn't required to get the full XML file.
   9869   { set +x
   9870 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   9871                   --graph=xml-tests/test.dot -d -S lalr1.cc   input.y"
   9872 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619"
   9873 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   9874                   --graph=xml-tests/test.dot -d -S lalr1.cc   input.y
   9875 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9876 at_status=$? at_failed=false
   9877 $at_check_filter
   9878 echo stderr:; cat "$at_stderr"
   9879 echo stdout:; cat "$at_stdout"
   9880 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9881 $at_failed && at_fn_log_failure
   9882 $at_traceon; }
   9883 
   9884   { set +x
   9885 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc   input.y"
   9886 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc   input.y" "input.at:1619"
   9887 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc   input.y
   9888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9889 at_status=$? at_failed=false
   9890 $at_check_filter
   9891 echo stderr:; cat "$at_stderr"
   9892 echo stdout:; cat "$at_stdout"
   9893 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9894 $at_failed && at_fn_log_failure
   9895 $at_traceon; }
   9896 
   9897     cp xml-tests/test.output expout
   9898   { set +x
   9899 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9900              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   9901              xml-tests/test.xml"
   9902 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9903 ( $at_check_trace; $XSLTPROC \
   9904              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   9905              xml-tests/test.xml
   9906 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9907 at_status=$? at_failed=false
   9908 $at_check_filter
   9909 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9910 $at_diff expout "$at_stdout" || at_failed=:
   9911 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9912 $at_failed && at_fn_log_failure
   9913 $at_traceon; }
   9914 
   9915   sort xml-tests/test.dot > expout
   9916   { set +x
   9917 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9918              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   9919              xml-tests/test.xml | sort"
   9920 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9921 ( $at_check_trace; $XSLTPROC \
   9922              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   9923              xml-tests/test.xml | sort
   9924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9925 at_status=$? at_failed=false
   9926 $at_check_filter
   9927 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9928 $at_diff expout "$at_stdout" || at_failed=:
   9929 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9930 $at_failed && at_fn_log_failure
   9931 $at_traceon; }
   9932 
   9933   rm -rf xml-tests expout
   9934   at_restore_special_files
   9935 fi
   9936 { set +x
   9937 $as_echo "$at_srcdir/input.at:1619: bison -d -S lalr1.cc   input.y"
   9938 at_fn_check_prepare_trace "input.at:1619"
   9939 ( $at_check_trace; bison -d -S lalr1.cc   input.y
   9940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9941 at_status=$? at_failed=false
   9942 $at_check_filter
   9943 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9944 at_fn_diff_devnull "$at_stdout" || at_failed=:
   9945 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9946 $at_failed && at_fn_log_failure
   9947 $at_traceon; }
   9948 
   9949 
   9950 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   9951   at_save_special_files
   9952   mkdir xml-tests
   9953     # Don't combine these Bison invocations since we want to be sure that
   9954   # --report=all isn't required to get the full XML file.
   9955   { set +x
   9956 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   9957                   --graph=xml-tests/test.dot -d -S glr.cc     input.y"
   9958 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619"
   9959 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   9960                   --graph=xml-tests/test.dot -d -S glr.cc     input.y
   9961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9962 at_status=$? at_failed=false
   9963 $at_check_filter
   9964 echo stderr:; cat "$at_stderr"
   9965 echo stdout:; cat "$at_stdout"
   9966 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9967 $at_failed && at_fn_log_failure
   9968 $at_traceon; }
   9969 
   9970   { set +x
   9971 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc     input.y"
   9972 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc     input.y" "input.at:1619"
   9973 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc     input.y
   9974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9975 at_status=$? at_failed=false
   9976 $at_check_filter
   9977 echo stderr:; cat "$at_stderr"
   9978 echo stdout:; cat "$at_stdout"
   9979 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9980 $at_failed && at_fn_log_failure
   9981 $at_traceon; }
   9982 
   9983     cp xml-tests/test.output expout
   9984   { set +x
   9985 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   9986              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   9987              xml-tests/test.xml"
   9988 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   9989 ( $at_check_trace; $XSLTPROC \
   9990              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   9991              xml-tests/test.xml
   9992 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   9993 at_status=$? at_failed=false
   9994 $at_check_filter
   9995 at_fn_diff_devnull "$at_stderr" || at_failed=:
   9996 $at_diff expout "$at_stdout" || at_failed=:
   9997 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   9998 $at_failed && at_fn_log_failure
   9999 $at_traceon; }
   10000 
   10001   sort xml-tests/test.dot > expout
   10002   { set +x
   10003 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   10004              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10005              xml-tests/test.xml | sort"
   10006 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   10007 ( $at_check_trace; $XSLTPROC \
   10008              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10009              xml-tests/test.xml | sort
   10010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10011 at_status=$? at_failed=false
   10012 $at_check_filter
   10013 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10014 $at_diff expout "$at_stdout" || at_failed=:
   10015 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10016 $at_failed && at_fn_log_failure
   10017 $at_traceon; }
   10018 
   10019   rm -rf xml-tests expout
   10020   at_restore_special_files
   10021 fi
   10022 { set +x
   10023 $as_echo "$at_srcdir/input.at:1619: bison -d -S glr.cc     input.y"
   10024 at_fn_check_prepare_trace "input.at:1619"
   10025 ( $at_check_trace; bison -d -S glr.cc     input.y
   10026 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10027 at_status=$? at_failed=false
   10028 $at_check_filter
   10029 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10030 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10031 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10032 $at_failed && at_fn_log_failure
   10033 $at_traceon; }
   10034 
   10035 
   10036 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10037   at_save_special_files
   10038   mkdir xml-tests
   10039     # Don't combine these Bison invocations since we want to be sure that
   10040   # --report=all isn't required to get the full XML file.
   10041   { set +x
   10042 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10043                   --graph=xml-tests/test.dot    -S lalr1.java input.y"
   10044 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1619"
   10045 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10046                   --graph=xml-tests/test.dot    -S lalr1.java input.y
   10047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10048 at_status=$? at_failed=false
   10049 $at_check_filter
   10050 echo stderr:; cat "$at_stderr"
   10051 echo stdout:; cat "$at_stdout"
   10052 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10053 $at_failed && at_fn_log_failure
   10054 $at_traceon; }
   10055 
   10056   { set +x
   10057 $as_echo "$at_srcdir/input.at:1619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml    -S lalr1.java input.y"
   10058 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml    -S lalr1.java input.y" "input.at:1619"
   10059 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml    -S lalr1.java input.y
   10060 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10061 at_status=$? at_failed=false
   10062 $at_check_filter
   10063 echo stderr:; cat "$at_stderr"
   10064 echo stdout:; cat "$at_stdout"
   10065 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10066 $at_failed && at_fn_log_failure
   10067 $at_traceon; }
   10068 
   10069     cp xml-tests/test.output expout
   10070   { set +x
   10071 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   10072              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10073              xml-tests/test.xml"
   10074 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   10075 ( $at_check_trace; $XSLTPROC \
   10076              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10077              xml-tests/test.xml
   10078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10079 at_status=$? at_failed=false
   10080 $at_check_filter
   10081 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10082 $at_diff expout "$at_stdout" || at_failed=:
   10083 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10084 $at_failed && at_fn_log_failure
   10085 $at_traceon; }
   10086 
   10087   sort xml-tests/test.dot > expout
   10088   { set +x
   10089 $as_echo "$at_srcdir/input.at:1619: \$XSLTPROC \\
   10090              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10091              xml-tests/test.xml | sort"
   10092 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1619"
   10093 ( $at_check_trace; $XSLTPROC \
   10094              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10095              xml-tests/test.xml | sort
   10096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10097 at_status=$? at_failed=false
   10098 $at_check_filter
   10099 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10100 $at_diff expout "$at_stdout" || at_failed=:
   10101 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10102 $at_failed && at_fn_log_failure
   10103 $at_traceon; }
   10104 
   10105   rm -rf xml-tests expout
   10106   at_restore_special_files
   10107 fi
   10108 { set +x
   10109 $as_echo "$at_srcdir/input.at:1619: bison    -S lalr1.java input.y"
   10110 at_fn_check_prepare_trace "input.at:1619"
   10111 ( $at_check_trace; bison    -S lalr1.java input.y
   10112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10113 at_status=$? at_failed=false
   10114 $at_check_filter
   10115 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10116 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10117 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1619"
   10118 $at_failed && at_fn_log_failure
   10119 $at_traceon; }
   10120 
   10121 
   10122 
   10123 cat >input.y <<'_ATEOF'
   10124 %type <]m4_errprintn(DEAD %type)> exp
   10125 %token <]m4_errprintn(DEAD %token)> a
   10126 %initial-action
   10127 {
   10128   $$;
   10129   $<]m4_errprintn(DEAD %initial-action)>$
   10130 };
   10131 %printer
   10132 {
   10133   $$
   10134   $<]m4_errprintn(DEAD %printer)>$
   10135 } <> <*>;
   10136 %lex-param
   10137 {
   10138   ]m4_errprintn(DEAD %lex-param)
   10139 };
   10140 %parse-param
   10141 {
   10142   ]m4_errprintn(DEAD %parse-param)
   10143 };
   10144 %%
   10145 exp:
   10146   a a[last]
   10147   {
   10148     $$;
   10149     $1;
   10150     $<]m4_errprintn(DEAD action 1)>$
   10151     $<]m4_errprintn(DEAD action 2)>1
   10152     $<]m4_errprintn(DEAD action 3)>last
   10153     $<]m4_errprintn(DEAD action 4)>0
   10154     ;
   10155   };
   10156 _ATEOF
   10157 
   10158 
   10159 # FIXME: Provide a means to iterate over all the skeletons.
   10160 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10161   at_save_special_files
   10162   mkdir xml-tests
   10163     # Don't combine these Bison invocations since we want to be sure that
   10164   # --report=all isn't required to get the full XML file.
   10165   { set +x
   10166 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10167                   --graph=xml-tests/test.dot -d               input.y"
   10168 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620"
   10169 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10170                   --graph=xml-tests/test.dot -d               input.y
   10171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10172 at_status=$? at_failed=false
   10173 $at_check_filter
   10174 echo stderr:; cat "$at_stderr"
   10175 echo stdout:; cat "$at_stdout"
   10176 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10177 $at_failed && at_fn_log_failure
   10178 $at_traceon; }
   10179 
   10180   { set +x
   10181 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d               input.y"
   10182 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d               input.y" "input.at:1620"
   10183 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d               input.y
   10184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10185 at_status=$? at_failed=false
   10186 $at_check_filter
   10187 echo stderr:; cat "$at_stderr"
   10188 echo stdout:; cat "$at_stdout"
   10189 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10190 $at_failed && at_fn_log_failure
   10191 $at_traceon; }
   10192 
   10193     cp xml-tests/test.output expout
   10194   { set +x
   10195 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10196              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10197              xml-tests/test.xml"
   10198 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10199 ( $at_check_trace; $XSLTPROC \
   10200              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10201              xml-tests/test.xml
   10202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10203 at_status=$? at_failed=false
   10204 $at_check_filter
   10205 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10206 $at_diff expout "$at_stdout" || at_failed=:
   10207 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10208 $at_failed && at_fn_log_failure
   10209 $at_traceon; }
   10210 
   10211   sort xml-tests/test.dot > expout
   10212   { set +x
   10213 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10214              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10215              xml-tests/test.xml | sort"
   10216 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10217 ( $at_check_trace; $XSLTPROC \
   10218              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10219              xml-tests/test.xml | sort
   10220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10221 at_status=$? at_failed=false
   10222 $at_check_filter
   10223 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10224 $at_diff expout "$at_stdout" || at_failed=:
   10225 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10226 $at_failed && at_fn_log_failure
   10227 $at_traceon; }
   10228 
   10229   rm -rf xml-tests expout
   10230   at_restore_special_files
   10231 fi
   10232 { set +x
   10233 $as_echo "$at_srcdir/input.at:1620: bison -d               input.y"
   10234 at_fn_check_prepare_trace "input.at:1620"
   10235 ( $at_check_trace; bison -d               input.y
   10236 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10237 at_status=$? at_failed=false
   10238 $at_check_filter
   10239 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10240 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10241 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10242 $at_failed && at_fn_log_failure
   10243 $at_traceon; }
   10244 
   10245 
   10246 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10247   at_save_special_files
   10248   mkdir xml-tests
   10249     # Don't combine these Bison invocations since we want to be sure that
   10250   # --report=all isn't required to get the full XML file.
   10251   { set +x
   10252 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10253                   --graph=xml-tests/test.dot -d -S glr.c      input.y"
   10254 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620"
   10255 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10256                   --graph=xml-tests/test.dot -d -S glr.c      input.y
   10257 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10258 at_status=$? at_failed=false
   10259 $at_check_filter
   10260 echo stderr:; cat "$at_stderr"
   10261 echo stdout:; cat "$at_stdout"
   10262 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10263 $at_failed && at_fn_log_failure
   10264 $at_traceon; }
   10265 
   10266   { set +x
   10267 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c      input.y"
   10268 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c      input.y" "input.at:1620"
   10269 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.c      input.y
   10270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10271 at_status=$? at_failed=false
   10272 $at_check_filter
   10273 echo stderr:; cat "$at_stderr"
   10274 echo stdout:; cat "$at_stdout"
   10275 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10276 $at_failed && at_fn_log_failure
   10277 $at_traceon; }
   10278 
   10279     cp xml-tests/test.output expout
   10280   { set +x
   10281 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10282              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10283              xml-tests/test.xml"
   10284 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10285 ( $at_check_trace; $XSLTPROC \
   10286              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10287              xml-tests/test.xml
   10288 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10289 at_status=$? at_failed=false
   10290 $at_check_filter
   10291 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10292 $at_diff expout "$at_stdout" || at_failed=:
   10293 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10294 $at_failed && at_fn_log_failure
   10295 $at_traceon; }
   10296 
   10297   sort xml-tests/test.dot > expout
   10298   { set +x
   10299 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10300              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10301              xml-tests/test.xml | sort"
   10302 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10303 ( $at_check_trace; $XSLTPROC \
   10304              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10305              xml-tests/test.xml | sort
   10306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10307 at_status=$? at_failed=false
   10308 $at_check_filter
   10309 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10310 $at_diff expout "$at_stdout" || at_failed=:
   10311 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10312 $at_failed && at_fn_log_failure
   10313 $at_traceon; }
   10314 
   10315   rm -rf xml-tests expout
   10316   at_restore_special_files
   10317 fi
   10318 { set +x
   10319 $as_echo "$at_srcdir/input.at:1620: bison -d -S glr.c      input.y"
   10320 at_fn_check_prepare_trace "input.at:1620"
   10321 ( $at_check_trace; bison -d -S glr.c      input.y
   10322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10323 at_status=$? at_failed=false
   10324 $at_check_filter
   10325 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10326 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10327 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10328 $at_failed && at_fn_log_failure
   10329 $at_traceon; }
   10330 
   10331 
   10332 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10333   at_save_special_files
   10334   mkdir xml-tests
   10335     # Don't combine these Bison invocations since we want to be sure that
   10336   # --report=all isn't required to get the full XML file.
   10337   { set +x
   10338 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10339                   --graph=xml-tests/test.dot -d -S lalr1.cc   input.y"
   10340 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620"
   10341 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10342                   --graph=xml-tests/test.dot -d -S lalr1.cc   input.y
   10343 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10344 at_status=$? at_failed=false
   10345 $at_check_filter
   10346 echo stderr:; cat "$at_stderr"
   10347 echo stdout:; cat "$at_stdout"
   10348 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10349 $at_failed && at_fn_log_failure
   10350 $at_traceon; }
   10351 
   10352   { set +x
   10353 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc   input.y"
   10354 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc   input.y" "input.at:1620"
   10355 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S lalr1.cc   input.y
   10356 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10357 at_status=$? at_failed=false
   10358 $at_check_filter
   10359 echo stderr:; cat "$at_stderr"
   10360 echo stdout:; cat "$at_stdout"
   10361 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10362 $at_failed && at_fn_log_failure
   10363 $at_traceon; }
   10364 
   10365     cp xml-tests/test.output expout
   10366   { set +x
   10367 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10368              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10369              xml-tests/test.xml"
   10370 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10371 ( $at_check_trace; $XSLTPROC \
   10372              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10373              xml-tests/test.xml
   10374 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10375 at_status=$? at_failed=false
   10376 $at_check_filter
   10377 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10378 $at_diff expout "$at_stdout" || at_failed=:
   10379 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10380 $at_failed && at_fn_log_failure
   10381 $at_traceon; }
   10382 
   10383   sort xml-tests/test.dot > expout
   10384   { set +x
   10385 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10386              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10387              xml-tests/test.xml | sort"
   10388 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10389 ( $at_check_trace; $XSLTPROC \
   10390              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10391              xml-tests/test.xml | sort
   10392 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10393 at_status=$? at_failed=false
   10394 $at_check_filter
   10395 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10396 $at_diff expout "$at_stdout" || at_failed=:
   10397 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10398 $at_failed && at_fn_log_failure
   10399 $at_traceon; }
   10400 
   10401   rm -rf xml-tests expout
   10402   at_restore_special_files
   10403 fi
   10404 { set +x
   10405 $as_echo "$at_srcdir/input.at:1620: bison -d -S lalr1.cc   input.y"
   10406 at_fn_check_prepare_trace "input.at:1620"
   10407 ( $at_check_trace; bison -d -S lalr1.cc   input.y
   10408 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10409 at_status=$? at_failed=false
   10410 $at_check_filter
   10411 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10412 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10413 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10414 $at_failed && at_fn_log_failure
   10415 $at_traceon; }
   10416 
   10417 
   10418 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10419   at_save_special_files
   10420   mkdir xml-tests
   10421     # Don't combine these Bison invocations since we want to be sure that
   10422   # --report=all isn't required to get the full XML file.
   10423   { set +x
   10424 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10425                   --graph=xml-tests/test.dot -d -S glr.cc     input.y"
   10426 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620"
   10427 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10428                   --graph=xml-tests/test.dot -d -S glr.cc     input.y
   10429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10430 at_status=$? at_failed=false
   10431 $at_check_filter
   10432 echo stderr:; cat "$at_stderr"
   10433 echo stdout:; cat "$at_stdout"
   10434 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10435 $at_failed && at_fn_log_failure
   10436 $at_traceon; }
   10437 
   10438   { set +x
   10439 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc     input.y"
   10440 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc     input.y" "input.at:1620"
   10441 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -S glr.cc     input.y
   10442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10443 at_status=$? at_failed=false
   10444 $at_check_filter
   10445 echo stderr:; cat "$at_stderr"
   10446 echo stdout:; cat "$at_stdout"
   10447 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10448 $at_failed && at_fn_log_failure
   10449 $at_traceon; }
   10450 
   10451     cp xml-tests/test.output expout
   10452   { set +x
   10453 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10454              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10455              xml-tests/test.xml"
   10456 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10457 ( $at_check_trace; $XSLTPROC \
   10458              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10459              xml-tests/test.xml
   10460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10461 at_status=$? at_failed=false
   10462 $at_check_filter
   10463 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10464 $at_diff expout "$at_stdout" || at_failed=:
   10465 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10466 $at_failed && at_fn_log_failure
   10467 $at_traceon; }
   10468 
   10469   sort xml-tests/test.dot > expout
   10470   { set +x
   10471 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10472              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10473              xml-tests/test.xml | sort"
   10474 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10475 ( $at_check_trace; $XSLTPROC \
   10476              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10477              xml-tests/test.xml | sort
   10478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10479 at_status=$? at_failed=false
   10480 $at_check_filter
   10481 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10482 $at_diff expout "$at_stdout" || at_failed=:
   10483 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10484 $at_failed && at_fn_log_failure
   10485 $at_traceon; }
   10486 
   10487   rm -rf xml-tests expout
   10488   at_restore_special_files
   10489 fi
   10490 { set +x
   10491 $as_echo "$at_srcdir/input.at:1620: bison -d -S glr.cc     input.y"
   10492 at_fn_check_prepare_trace "input.at:1620"
   10493 ( $at_check_trace; bison -d -S glr.cc     input.y
   10494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10495 at_status=$? at_failed=false
   10496 $at_check_filter
   10497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10498 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10499 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10500 $at_failed && at_fn_log_failure
   10501 $at_traceon; }
   10502 
   10503 
   10504 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10505   at_save_special_files
   10506   mkdir xml-tests
   10507     # Don't combine these Bison invocations since we want to be sure that
   10508   # --report=all isn't required to get the full XML file.
   10509   { set +x
   10510 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10511                   --graph=xml-tests/test.dot    -S lalr1.java input.y"
   10512 at_fn_check_prepare_notrace 'an embedded newline' "input.at:1620"
   10513 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10514                   --graph=xml-tests/test.dot    -S lalr1.java input.y
   10515 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10516 at_status=$? at_failed=false
   10517 $at_check_filter
   10518 echo stderr:; cat "$at_stderr"
   10519 echo stdout:; cat "$at_stdout"
   10520 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10521 $at_failed && at_fn_log_failure
   10522 $at_traceon; }
   10523 
   10524   { set +x
   10525 $as_echo "$at_srcdir/input.at:1620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml    -S lalr1.java input.y"
   10526 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml    -S lalr1.java input.y" "input.at:1620"
   10527 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml    -S lalr1.java input.y
   10528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10529 at_status=$? at_failed=false
   10530 $at_check_filter
   10531 echo stderr:; cat "$at_stderr"
   10532 echo stdout:; cat "$at_stdout"
   10533 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10534 $at_failed && at_fn_log_failure
   10535 $at_traceon; }
   10536 
   10537     cp xml-tests/test.output expout
   10538   { set +x
   10539 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10540              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10541              xml-tests/test.xml"
   10542 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10543 ( $at_check_trace; $XSLTPROC \
   10544              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10545              xml-tests/test.xml
   10546 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10547 at_status=$? at_failed=false
   10548 $at_check_filter
   10549 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10550 $at_diff expout "$at_stdout" || at_failed=:
   10551 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10552 $at_failed && at_fn_log_failure
   10553 $at_traceon; }
   10554 
   10555   sort xml-tests/test.dot > expout
   10556   { set +x
   10557 $as_echo "$at_srcdir/input.at:1620: \$XSLTPROC \\
   10558              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10559              xml-tests/test.xml | sort"
   10560 at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1620"
   10561 ( $at_check_trace; $XSLTPROC \
   10562              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10563              xml-tests/test.xml | sort
   10564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10565 at_status=$? at_failed=false
   10566 $at_check_filter
   10567 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10568 $at_diff expout "$at_stdout" || at_failed=:
   10569 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10570 $at_failed && at_fn_log_failure
   10571 $at_traceon; }
   10572 
   10573   rm -rf xml-tests expout
   10574   at_restore_special_files
   10575 fi
   10576 { set +x
   10577 $as_echo "$at_srcdir/input.at:1620: bison    -S lalr1.java input.y"
   10578 at_fn_check_prepare_trace "input.at:1620"
   10579 ( $at_check_trace; bison    -S lalr1.java input.y
   10580 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10581 at_status=$? at_failed=false
   10582 $at_check_filter
   10583 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10584 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10585 at_fn_check_status 0 $at_status "$at_srcdir/input.at:1620"
   10586 $at_failed && at_fn_log_failure
   10587 $at_traceon; }
   10588 
   10589 
   10590 
   10591 
   10592 
   10593 
   10594   set +x
   10595   $at_times_p && times >"$at_times_file"
   10596 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   10597 read at_status <"$at_status_file"
   10598 #AT_STOP_38
   10599 #AT_START_39
   10600 at_fn_group_banner 39 'named-refs.at:21' \
   10601   "Tutorial calculator" "                            " 2
   10602 at_xfail=no
   10603 (
   10604   $as_echo "39. $at_setup_line: testing $at_desc ..."
   10605   $at_traceon
   10606 
   10607 
   10608 cat >test.y <<'_ATEOF'
   10609 %code top {
   10610 #include <config.h>
   10611 /* We don't need perfect functions for these tests. */
   10612 #undef malloc
   10613 #undef memcmp
   10614 #undef realloc
   10615 }
   10616 
   10617 
   10618 %{
   10619 #include <assert.h>
   10620 #include <stdio.h>
   10621 #include <stdlib.h>
   10622 #include <string.h>
   10623 #include <ctype.h>
   10624 typedef int semantic_value;
   10625 FILE *input;
   10626 static semantic_value global_result = 0;
   10627 static int global_count = 0;
   10628 static int power (int base, int exponent);
   10629 static void yyerror ( const char *msg);
   10630 static int yylex (void);
   10631 %}
   10632 
   10633 %union
   10634 {
   10635   semantic_value ival;
   10636 };
   10637 
   10638 %token CALC_EOF 0 "end of input"
   10639 %token <ival> NUM "number"
   10640 %type  <ival> exp
   10641 
   10642 %nonassoc '='   /* comparison	       */
   10643 %left '-' '+'
   10644 %left '*' '/'
   10645 %left NEG       /* negation--unary minus */
   10646 %right '^'      /* exponentiation        */
   10647 
   10648 %%
   10649 input:
   10650   line
   10651 | input line         {}
   10652 ;
   10653 
   10654 line:
   10655   '\n'
   10656 | exp '\n'           {}
   10657 ;
   10658 
   10659 exp:
   10660   NUM                { $$ = $NUM; }
   10661 | exp[l] '=' exp[r]
   10662   {
   10663     if ($l != $r)
   10664       fprintf (stderr, "calc: error: %d != %d\n", $l, $r);
   10665     $$ = $l;
   10666   }
   10667 | exp[x] '+' { $<ival>$ = $x; } [l] exp[r]  { $$ = $<ival>l + $r;    }
   10668 | exp[l] '-' exp[r]  { $$ = $l - $r;        }
   10669 | exp[l] '*' exp[r]  { $$ = $l * $r;        }
   10670 | exp[l] '/' exp[r]  { $$ = $l / $r;        }
   10671 | '-' exp  %prec NEG { $$ = -$2;            }
   10672 | exp[l] '^' exp[r]  { $$ = power ($l, $r); }
   10673 | '(' exp[e] ')'     { $$ = $e;           }
   10674 | '(' error ')'      { $$ = 1111; yyerrok;  }
   10675 | '!'                { $$ = 0; YYERROR;     }
   10676 | '-' error          { $$ = 0; YYERROR;     }
   10677 ;
   10678 %%
   10679 #include <stdio.h>
   10680 /* A C error reporting function.  */
   10681 static
   10682 void yyerror ( const char *msg)
   10683 {
   10684   fprintf (stderr, "%s\n", msg);
   10685 }
   10686 static int get_char (void)
   10687 {
   10688   int res = getc (input);
   10689   return res;
   10690 }
   10691 
   10692 static void unget_char (int c)
   10693 {
   10694   ungetc (c, input);
   10695 }
   10696 
   10697 static int read_signed_integer (void)
   10698 {
   10699   int c = get_char ();
   10700   int sign = 1;
   10701   int n = 0;
   10702   if (c == '-')
   10703     {
   10704       c = get_char ();
   10705       sign = -1;
   10706     }
   10707   while (isdigit (c))
   10708     {
   10709       n = 10 * n + (c - '0');
   10710       c = get_char ();
   10711     }
   10712   unget_char ( c);
   10713   return sign * n;
   10714 }
   10715 
   10716 static int
   10717 yylex (void)
   10718 {
   10719   int c;
   10720   /* Skip white space.  */
   10721   while ((c = get_char ()) == ' ' || c == '\t') {}
   10722 
   10723   /* process numbers   */
   10724   if (c == '.' || isdigit (c))
   10725     {
   10726       unget_char ( c);
   10727       (yylval).ival = read_signed_integer ();
   10728       return NUM;
   10729     }
   10730 
   10731   /* Return end-of-file.  */
   10732   if (c == EOF)
   10733     return CALC_EOF;
   10734 
   10735   /* Return single chars. */
   10736   return c;
   10737 }
   10738 
   10739 static int power (int base, int exponent)
   10740 {
   10741   int res = 1;
   10742   assert (0 <= exponent);
   10743   for (/* Niente */; exponent; --exponent)
   10744     res *= base;
   10745   return res;
   10746 }
   10747 
   10748 int main (int argc, const char **argv)
   10749 {
   10750   semantic_value result = 0;
   10751   int count = 0;
   10752   int status;
   10753   if (argc == 2)
   10754     input = fopen (argv[1], "r");
   10755   else
   10756     input = stdin;
   10757   if (!input)
   10758     {
   10759       perror (argv[1]);
   10760       return 3;
   10761     }
   10762   status = yyparse ();
   10763   fclose (input);
   10764   assert (global_result == result);
   10765   assert (global_count == count);
   10766   return status;
   10767 }
   10768 _ATEOF
   10769 
   10770 
   10771 
   10772 cat >input.txt <<'_ATEOF'
   10773 
   10774 1 + 2 * 3 = 7
   10775 1 + 2 * -3 = -5
   10776 -1^2 = -1
   10777 (-1)^2 = 1
   10778 ---1 = -1
   10779 1 - 2 - 3 = -4
   10780 1 - (2 - 3) = 2
   10781 2^2^3 = 256
   10782 (2^2)^3 = 64
   10783 _ATEOF
   10784 
   10785 
   10786 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   10787   at_save_special_files
   10788   mkdir xml-tests
   10789     # Don't combine these Bison invocations since we want to be sure that
   10790   # --report=all isn't required to get the full XML file.
   10791   { set +x
   10792 $as_echo "$at_srcdir/named-refs.at:184: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   10793                   --graph=xml-tests/test.dot -o test.c test.y"
   10794 at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:184"
   10795 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   10796                   --graph=xml-tests/test.dot -o test.c test.y
   10797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10798 at_status=$? at_failed=false
   10799 $at_check_filter
   10800 echo stderr:; cat "$at_stderr"
   10801 echo stdout:; cat "$at_stdout"
   10802 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
   10803 $at_failed && at_fn_log_failure
   10804 $at_traceon; }
   10805 
   10806   { set +x
   10807 $as_echo "$at_srcdir/named-refs.at:184: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y"
   10808 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:184"
   10809 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y
   10810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10811 at_status=$? at_failed=false
   10812 $at_check_filter
   10813 echo stderr:; cat "$at_stderr"
   10814 echo stdout:; cat "$at_stdout"
   10815 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
   10816 $at_failed && at_fn_log_failure
   10817 $at_traceon; }
   10818 
   10819     cp xml-tests/test.output expout
   10820   { set +x
   10821 $as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\
   10822              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   10823              xml-tests/test.xml"
   10824 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184"
   10825 ( $at_check_trace; $XSLTPROC \
   10826              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   10827              xml-tests/test.xml
   10828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10829 at_status=$? at_failed=false
   10830 $at_check_filter
   10831 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10832 $at_diff expout "$at_stdout" || at_failed=:
   10833 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
   10834 $at_failed && at_fn_log_failure
   10835 $at_traceon; }
   10836 
   10837   sort xml-tests/test.dot > expout
   10838   { set +x
   10839 $as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\
   10840              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   10841              xml-tests/test.xml | sort"
   10842 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184"
   10843 ( $at_check_trace; $XSLTPROC \
   10844              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   10845              xml-tests/test.xml | sort
   10846 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10847 at_status=$? at_failed=false
   10848 $at_check_filter
   10849 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10850 $at_diff expout "$at_stdout" || at_failed=:
   10851 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
   10852 $at_failed && at_fn_log_failure
   10853 $at_traceon; }
   10854 
   10855   rm -rf xml-tests expout
   10856   at_restore_special_files
   10857 fi
   10858 { set +x
   10859 $as_echo "$at_srcdir/named-refs.at:184: bison -o test.c test.y"
   10860 at_fn_check_prepare_trace "named-refs.at:184"
   10861 ( $at_check_trace; bison -o test.c test.y
   10862 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10863 at_status=$? at_failed=false
   10864 $at_check_filter
   10865 at_fn_diff_devnull "$at_stderr" || at_failed=:
   10866 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10867 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
   10868 $at_failed && at_fn_log_failure
   10869 $at_traceon; }
   10870 
   10871 
   10872 { set +x
   10873 $as_echo "$at_srcdir/named-refs.at:185: \$BISON_C_WORKS"
   10874 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "named-refs.at:185"
   10875 ( $at_check_trace; $BISON_C_WORKS
   10876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10877 at_status=$? at_failed=false
   10878 $at_check_filter
   10879 echo stderr:; cat "$at_stderr"
   10880 echo stdout:; cat "$at_stdout"
   10881 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185"
   10882 $at_failed && at_fn_log_failure
   10883 $at_traceon; }
   10884 
   10885 { set +x
   10886 $as_echo "$at_srcdir/named-refs.at:185: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
   10887 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "named-refs.at:185"
   10888 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
   10889 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10890 at_status=$? at_failed=false
   10891 $at_check_filter
   10892 echo stderr:; cat "$at_stderr"
   10893 echo stdout:; cat "$at_stdout"
   10894 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185"
   10895 $at_failed && at_fn_log_failure
   10896 $at_traceon; }
   10897 
   10898 { set +x
   10899 $as_echo "$at_srcdir/named-refs.at:186:  \$PREPARSER ./test input.txt"
   10900 at_fn_check_prepare_dynamic " $PREPARSER ./test input.txt" "named-refs.at:186"
   10901 ( $at_check_trace;  $PREPARSER ./test input.txt
   10902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10903 at_status=$? at_failed=false
   10904 $at_check_filter
   10905 echo stderr:; tee stderr <"$at_stderr"
   10906 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10907 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:186"
   10908 $at_failed && at_fn_log_failure
   10909 $at_traceon; }
   10910 
   10911 { set +x
   10912 $as_echo "$at_srcdir/named-refs.at:186: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   10913 at_fn_check_prepare_trace "named-refs.at:186"
   10914 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   10915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   10916 at_status=$? at_failed=false
   10917 $at_check_filter
   10918 echo stderr:; tee stderr <"$at_stderr"
   10919 at_fn_diff_devnull "$at_stdout" || at_failed=:
   10920 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:186"
   10921 $at_failed && at_fn_log_failure
   10922 $at_traceon; }
   10923 
   10924 
   10925 
   10926   set +x
   10927   $at_times_p && times >"$at_times_file"
   10928 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   10929 read at_status <"$at_status_file"
   10930 #AT_STOP_39
   10931 #AT_START_40
   10932 at_fn_group_banner 40 'named-refs.at:195' \
   10933   "Undefined and ambiguous references" "             " 2
   10934 at_xfail=no
   10935 (
   10936   $as_echo "40. $at_setup_line: testing $at_desc ..."
   10937   $at_traceon
   10938 
   10939 
   10940 cat >test.y <<'_ATEOF'
   10941 %code top {
   10942 #include <config.h>
   10943 /* We don't need perfect functions for these tests. */
   10944 #undef malloc
   10945 #undef memcmp
   10946 #undef realloc
   10947 }
   10948 
   10949 
   10950 %{
   10951 static int power (int base, int exponent);
   10952 static void yyerror ( const char *msg);
   10953 static int yylex (void);
   10954 %}
   10955 
   10956 %union
   10957 {
   10958   int ival;
   10959 };
   10960 
   10961 %token CALC_EOF 0 "end of input"
   10962 %token <ival> NUM "number"
   10963 %type  <ival> exp
   10964 
   10965 %nonassoc '='   /* comparison	       */
   10966 %left '-' '+'
   10967 %left '*' '/'
   10968 %left NEG       /* negation--unary minus */
   10969 %right '^'      /* exponentiation        */
   10970 
   10971 %%
   10972 input:
   10973   line
   10974 | input line         {}
   10975 ;
   10976 
   10977 line:
   10978   '\n'
   10979 | exp '\n'           {}
   10980 ;
   10981 
   10982 exp:
   10983   NUM { $$ = $NUM; }
   10984 | exp[l] '=' exp[r]
   10985   {
   10986     if ($l != $r)
   10987       fprintf (stderr, "calc: error: %d != %d\n", $l, $r);
   10988     $$ = $l;
   10989   }
   10990 | exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; }
   10991 | exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; }
   10992 | exp[x] '*' { $<ival>$ = $x; } [l] exp[r] { $$ = $l * $r; }
   10993 | exp[l] '/' exp[r]  { $$ = $l / $r;        }
   10994 | '-' exp  %prec NEG { $$ = -$2;            }
   10995 | exp[l] '^' exp[r]  { $$ = power ($l, $r12); }
   10996 | '(' exp ')'        { $$ = $expo;           }
   10997 | '(' error ')'      { $$ = 1111; yyerrok;  }
   10998 | '!'                { $$ = 0; YYERROR;     }
   10999 | '-' error          { $$ = 0; YYERROR;     }
   11000 ;
   11001 %%
   11002 _ATEOF
   11003 
   11004 
   11005 
   11006 
   11007 { set +x
   11008 $as_echo "$at_srcdir/named-refs.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11009 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:253"
   11010 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11011 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11012 at_status=$? at_failed=false
   11013 $at_check_filter
   11014 echo >>"$at_stderr"; $as_echo "test.y:50.51-60: error: invalid reference: '\$<ival>lo9'
   11015 test.y:50.3-68:      symbol not found in production: lo9
   11016 test.y:51.51-60: warning: misleading reference: '\$<ival>exp'
   11017 test.y:42.1-3:       refers to: \$exp at \$\$
   11018 test.y:51.7:         possibly meant: \$x, hiding \$exp at \$1
   11019 test.y:51.41:        possibly meant: \$r, hiding \$exp at \$4
   11020 test.y:52.51-52: error: \$l of 'exp' has no declared type
   11021 test.y:55.40-43: error: invalid reference: '\$r12'
   11022 test.y:55.3-47:      symbol not found in production: r12
   11023 test.y:56.29-33: error: invalid reference: '\$expo'
   11024 test.y:56.3-46:      symbol not found in production: expo
   11025 " | \
   11026   $at_diff - "$at_stderr" || at_failed=:
   11027 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11028 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:253"
   11029 $at_failed && at_fn_log_failure
   11030 $at_traceon; }
   11031 
   11032 
   11033 
   11034   set +x
   11035   $at_times_p && times >"$at_times_file"
   11036 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11037 read at_status <"$at_status_file"
   11038 #AT_STOP_40
   11039 #AT_START_41
   11040 at_fn_group_banner 41 'named-refs.at:271' \
   11041   "Misleading references" "                          " 2
   11042 at_xfail=no
   11043 (
   11044   $as_echo "41. $at_setup_line: testing $at_desc ..."
   11045   $at_traceon
   11046 
   11047 cat >test.y <<'_ATEOF'
   11048 %code top {
   11049 #include <config.h>
   11050 /* We don't need perfect functions for these tests. */
   11051 #undef malloc
   11052 #undef memcmp
   11053 #undef realloc
   11054 }
   11055 
   11056 
   11057 %%
   11058 start: foo foo.bar { $foo.bar; }
   11059 foo: '1'
   11060 foo.bar: '2'
   11061 _ATEOF
   11062 
   11063 
   11064 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   11065   at_save_special_files
   11066   mkdir xml-tests
   11067     # Don't combine these Bison invocations since we want to be sure that
   11068   # --report=all isn't required to get the full XML file.
   11069   { set +x
   11070 $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   11071                   --graph=xml-tests/test.dot -o test.c test.y"
   11072 at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:279"
   11073 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   11074                   --graph=xml-tests/test.dot -o test.c test.y
   11075 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11076 at_status=$? at_failed=false
   11077 $at_check_filter
   11078 echo stderr:; cat "$at_stderr"
   11079 echo stdout:; cat "$at_stdout"
   11080 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11081 $at_failed && at_fn_log_failure
   11082 $at_traceon; }
   11083 
   11084   { set +x
   11085 $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y"
   11086 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:279"
   11087 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y
   11088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11089 at_status=$? at_failed=false
   11090 $at_check_filter
   11091 echo stderr:; cat "$at_stderr"
   11092 echo stdout:; cat "$at_stdout"
   11093 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11094 $at_failed && at_fn_log_failure
   11095 $at_traceon; }
   11096 
   11097     cp xml-tests/test.output expout
   11098   { set +x
   11099 $as_echo "$at_srcdir/named-refs.at:279: \$XSLTPROC \\
   11100              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   11101              xml-tests/test.xml"
   11102 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:279"
   11103 ( $at_check_trace; $XSLTPROC \
   11104              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   11105              xml-tests/test.xml
   11106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11107 at_status=$? at_failed=false
   11108 $at_check_filter
   11109 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11110 $at_diff expout "$at_stdout" || at_failed=:
   11111 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11112 $at_failed && at_fn_log_failure
   11113 $at_traceon; }
   11114 
   11115   sort xml-tests/test.dot > expout
   11116   { set +x
   11117 $as_echo "$at_srcdir/named-refs.at:279: \$XSLTPROC \\
   11118              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   11119              xml-tests/test.xml | sort"
   11120 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:279"
   11121 ( $at_check_trace; $XSLTPROC \
   11122              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   11123              xml-tests/test.xml | sort
   11124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11125 at_status=$? at_failed=false
   11126 $at_check_filter
   11127 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11128 $at_diff expout "$at_stdout" || at_failed=:
   11129 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11130 $at_failed && at_fn_log_failure
   11131 $at_traceon; }
   11132 
   11133   rm -rf xml-tests expout
   11134   at_restore_special_files
   11135 fi
   11136 { set +x
   11137 $as_echo "$at_srcdir/named-refs.at:279: bison -o test.c test.y"
   11138 at_fn_check_prepare_trace "named-refs.at:279"
   11139 ( $at_check_trace; bison -o test.c test.y
   11140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11141 at_status=$? at_failed=false
   11142 $at_check_filter
   11143 echo >>"$at_stderr"; $as_echo "test.y:11.22-29: warning: misleading reference: '\$foo.bar'
   11144 test.y:11.8-10:      refers to: \$foo at \$1
   11145 test.y:11.12-18:     possibly meant: \$[foo.bar] at \$2
   11146 " | \
   11147   $at_diff - "$at_stderr" || at_failed=:
   11148 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11149 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11150 $at_failed && at_fn_log_failure
   11151 $at_traceon; }
   11152 
   11153 # Defining POSIXLY_CORRECT causes bison to complain if options are
   11154 # added after the grammar file name, so skip these checks in that
   11155 # case.
   11156 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   11157   at_save_special_files
   11158 
   11159   # To avoid expanding it repeatedly, store specified stdout.
   11160   : >expout
   11161 
   11162   # Run with -Werror.
   11163   { set +x
   11164 $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Werror"
   11165 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Werror" "named-refs.at:279"
   11166 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y -Werror
   11167 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11168 at_status=$? at_failed=false
   11169 $at_check_filter
   11170 echo stderr:; tee stderr <"$at_stderr"
   11171 $at_diff expout "$at_stdout" || at_failed=:
   11172 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:279"
   11173 $at_failed && at_fn_log_failure
   11174 $at_traceon; }
   11175 
   11176 
   11177   # Build expected stderr up to and including the "warnings being
   11178   # treated as errors" message.
   11179   cat >at-bison-check-warnings <<'_ATEOF'
   11180 test.y:11.22-29: warning: misleading reference: '$foo.bar'
   11181 test.y:11.8-10:      refers to: $foo at $1
   11182 test.y:11.12-18:     possibly meant: $[foo.bar] at $2
   11183 _ATEOF
   11184 
   11185   at_bison_check_first=`sed -n \
   11186     '/: warning: /{=;q;}' at-bison-check-warnings`
   11187   : ${at_bison_check_first:=1}
   11188   at_bison_check_first_tmp=`sed -n \
   11189     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   11190   : ${at_bison_check_first_tmp:=1}
   11191   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   11192     at_bison_check_first=$at_bison_check_first_tmp
   11193   fi
   11194   if test $at_bison_check_first -gt 1; then
   11195     sed -n "1,`expr $at_bison_check_first - 1`"p \
   11196       at-bison-check-warnings > experr
   11197   fi
   11198   echo 'bison: warnings being treated as errors' >> experr
   11199 
   11200   # Finish building expected stderr and check.  Unlike warnings,
   11201   # complaints cause bison to exit early.  Thus, with -Werror, bison
   11202   # does not necessarily report all warnings that it does without
   11203   # -Werror, but it at least reports one.
   11204   at_bison_check_last=`sed -n '$=' stderr`
   11205   : ${at_bison_check_last:=1}
   11206   at_bison_check_last=`expr $at_bison_check_last - 1`
   11207   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   11208     at-bison-check-warnings >> experr
   11209   { set +x
   11210 $as_echo "$at_srcdir/named-refs.at:279: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   11211               stderr 1>&2"
   11212 at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:279"
   11213 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   11214               stderr 1>&2
   11215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11216 at_status=$? at_failed=false
   11217 $at_check_filter
   11218 $at_diff experr "$at_stderr" || at_failed=:
   11219 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11220 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11221 $at_failed && at_fn_log_failure
   11222 $at_traceon; }
   11223 
   11224 
   11225   # Now check --warnings=error.
   11226   cp stderr experr
   11227   { set +x
   11228 $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=error"
   11229 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=error" "named-refs.at:279"
   11230 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=error
   11231 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11232 at_status=$? at_failed=false
   11233 $at_check_filter
   11234 $at_diff experr "$at_stderr" || at_failed=:
   11235 $at_diff expout "$at_stdout" || at_failed=:
   11236 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:279"
   11237 $at_failed && at_fn_log_failure
   11238 $at_traceon; }
   11239 
   11240 
   11241   # Now check -Wnone and --warnings=none by making sure that
   11242   # -Werror doesn't change the exit status when -Wnone or
   11243   # --warnings=none is specified.
   11244   { set +x
   11245 $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Wnone -Werror"
   11246 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y -Wnone -Werror" "named-refs.at:279"
   11247 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y -Wnone -Werror
   11248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11249 at_status=$? at_failed=false
   11250 $at_check_filter
   11251 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11252 $at_diff expout "$at_stdout" || at_failed=:
   11253 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11254 $at_failed && at_fn_log_failure
   11255 $at_traceon; }
   11256 
   11257   { set +x
   11258 $as_echo "$at_srcdir/named-refs.at:279: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=none -Werror"
   11259 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=none -Werror" "named-refs.at:279"
   11260 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y --warnings=none -Werror
   11261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11262 at_status=$? at_failed=false
   11263 $at_check_filter
   11264 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11265 $at_diff expout "$at_stdout" || at_failed=:
   11266 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:279"
   11267 $at_failed && at_fn_log_failure
   11268 $at_traceon; }
   11269 
   11270 
   11271   at_restore_special_files
   11272 fi
   11273   set +x
   11274   $at_times_p && times >"$at_times_file"
   11275 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11276 read at_status <"$at_status_file"
   11277 #AT_STOP_41
   11278 #AT_START_42
   11279 at_fn_group_banner 42 'named-refs.at:288' \
   11280   "Many kinds of errors" "                           " 2
   11281 at_xfail=no
   11282 (
   11283   $as_echo "42. $at_setup_line: testing $at_desc ..."
   11284   $at_traceon
   11285 
   11286 cat >test.y <<'_ATEOF'
   11287 %code top {
   11288 #include <config.h>
   11289 /* We don't need perfect functions for these tests. */
   11290 #undef malloc
   11291 #undef memcmp
   11292 #undef realloc
   11293 }
   11294 
   11295 
   11296 %token IDENT
   11297 %token NUMBER
   11298 %token ASSIGNOP
   11299 %token IF
   11300 %token IF1
   11301 %token THEN
   11302 %token ELSE
   11303 %token FI
   11304 %token WHILE
   11305 %token DO
   11306 %token OD
   11307 %start program
   11308 %%
   11309 if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
   11310           { $if_stmt1 = new IfStmt($cond1, $then.f1, $else); };
   11311 if_stmt2: IF expr[cond] THEN stmt[then] FI
   11312           { $if_stmt2 = new IfStmt($cond, $stmt.field, 0); };
   11313 if_stmt3: IF expr[cond] THEN stmt.list FI
   11314           { $if_stmt3 = new IfStmt($cond, $stmt.list, 0); };
   11315 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
   11316           { $if_stmt4 = new IfStmt($cond, $xyz, $cond); };
   11317 if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11318           { $if_stmt5 = new IfStmt($cond, $stmt.list, $else); };
   11319 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11320           { $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); };
   11321 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11322           { $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); };
   11323 if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
   11324           { $if_stmt8 = new IfStmt($cond, $then.1, $else); };
   11325 if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
   11326           { $if_stmt9 = new IfStmt($cond, $then.1.field, $else); };
   11327 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
   11328           { $if_stmt10 = new IfStmt($cond, $stmt.x, 0); };
   11329 if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11330           { $if-stmt-a = new IfStmt($cond, $then, $else); };
   11331 if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
   11332           { $[if-stmt-b] = new IfStmt($cond, $then-a.f, $else); };
   11333 program: stmt.list;
   11334 stmt.list:  stmt ';' stmt.list { $3->insert($stmt); $$ = $3; }
   11335         |   stmt ';' { SL = new StmtList();  SL->insert($1); $$ = SL; }
   11336         ;
   11337 stmt:  assign_stmt { $$ = $1; }
   11338     |  if_stmt { $$ = $1; }
   11339     |  if_stmt1 { $$ = $1; }
   11340     |  while_stmt { $$ = $1; }
   11341     ;
   11342 assign_stmt: IDENT ASSIGNOP expr
   11343        { $$ = new AssignStmt(string($1),$3); };
   11344 if_stmt: IF expr[cond] THEN stmt.list FI
   11345        { $if_stmt = new IfStmt($cond, $[stmt.list], 0); };
   11346 while_stmt[res]: WHILE expr DO stmt.list OD
   11347        { $res = new WhileStmt($[expr], $[stmt.list]); };
   11348 expr: expr '+' term   { $$ = new Plus($1,$3); }
   11349     | expr '-' term   { $$ = new Minus($1,$3); }
   11350     | term            { $$ = $1; }
   11351     ;
   11352 term: term '*' factor   { $$ = new Times($1,$3); }
   11353     | factor            { $$ = $1; }
   11354     ;
   11355 factor:     '(' expr ')'  { $$ = $2; }
   11356     |       NUMBER { $$ = new Number($1); }
   11357     |       IDENT { $$ = new Ident(string($1)); }
   11358     ;
   11359 _ATEOF
   11360 
   11361 
   11362 
   11363 { set +x
   11364 $as_echo "$at_srcdir/named-refs.at:355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11365 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:355"
   11366 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11368 at_status=$? at_failed=false
   11369 $at_check_filter
   11370 echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1'
   11371 test.y:23.11-24.62:  symbol not found in production: cond1
   11372 test.y:26.43-53: error: invalid reference: '\$stmt.field'
   11373 test.y:25.11-26.60:  symbol not found in production: stmt
   11374 test.y:25.35-38:     possibly meant: \$then.field, hiding \$stmt.field at \$4
   11375 test.y:28.43-52: error: invalid reference: '\$stmt.list'
   11376 test.y:27.11-28.59:  symbol not found in production: stmt
   11377 test.y:27.30-38:     possibly meant: \$[stmt.list] at \$4
   11378 test.y:30.43-46: error: ambiguous reference: '\$xyz'
   11379 test.y:29.35-37:     refers to: \$xyz at \$4
   11380 test.y:29.50-52:     refers to: \$xyz at \$6
   11381 test.y:32.43-52: error: invalid reference: '\$stmt.list'
   11382 test.y:31.11-32.63:  symbol not found in production: stmt
   11383 test.y:31.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
   11384 test.y:31.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
   11385 test.y:34.43-58: error: invalid reference: '\$stmt.list.field'
   11386 test.y:33.11-34.69:  symbol not found in production: stmt
   11387 test.y:33.40-43:     possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
   11388 test.y:33.61-64:     possibly meant: \$else.field, hiding \$[stmt.list].field at \$6
   11389 test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
   11390 test.y:35.11-36.71:  symbol not found in production: stmt.list
   11391 test.y:35.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
   11392 test.y:35.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
   11393 test.y:38.43-49: error: invalid reference: '\$then.1'
   11394 test.y:37.11-38.60:  symbol not found in production: then
   11395 test.y:37.40-45:     possibly meant: \$[then.1] at \$4
   11396 test.y:40.43-55: error: invalid reference: '\$then.1.field'
   11397 test.y:39.11-40.66:  symbol not found in production: then
   11398 test.y:39.40-45:     possibly meant: \$[then.1].field at \$4
   11399 test.y:42.44-50: error: invalid reference: '\$stmt.x'
   11400 test.y:41.12-42.57:  symbol not found in production: stmt
   11401 test.y:41.36-41:     possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
   11402 test.y:41.36-41:     possibly meant: \$[stmt.x] at \$4
   11403 test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
   11404 test.y:43.12-44.59:  symbol not found in production: if
   11405 test.y:43.1-9:       possibly meant: \$[if-stmt-a] at \$\$
   11406 test.y:46.46-54: error: invalid reference: '\$then-a.f'
   11407 test.y:45.12-46.65:  symbol not found in production: then
   11408 test.y:45.41-46:     possibly meant: \$[then-a].f at \$4
   11409 " | \
   11410   $at_diff - "$at_stderr" || at_failed=:
   11411 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11412 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:355"
   11413 $at_failed && at_fn_log_failure
   11414 $at_traceon; }
   11415 
   11416 
   11417 
   11418 
   11419 { set +x
   11420 $as_echo "$at_srcdir/named-refs.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o test.c test.y"
   11421 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o test.c test.y" "named-refs.at:397"
   11422 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o test.c test.y
   11423 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11424 at_status=$? at_failed=false
   11425 $at_check_filter
   11426 echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1'
   11427            { \$if_stmt1 = new IfStmt(\$cond1, \$then.f1, \$else); };
   11428                                     ^^^^^^
   11429 test.y:23.11-24.62:  symbol not found in production: cond1
   11430  if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
   11431            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11432 test.y:26.43-53: error: invalid reference: '\$stmt.field'
   11433            { \$if_stmt2 = new IfStmt(\$cond, \$stmt.field, 0); };
   11434                                            ^^^^^^^^^^^
   11435 test.y:25.11-26.60:  symbol not found in production: stmt
   11436  if_stmt2: IF expr[cond] THEN stmt[then] FI
   11437            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11438 test.y:25.35-38:     possibly meant: \$then.field, hiding \$stmt.field at \$4
   11439  if_stmt2: IF expr[cond] THEN stmt[then] FI
   11440                                    ^^^^
   11441 test.y:28.43-52: error: invalid reference: '\$stmt.list'
   11442            { \$if_stmt3 = new IfStmt(\$cond, \$stmt.list, 0); };
   11443                                            ^^^^^^^^^^
   11444 test.y:27.11-28.59:  symbol not found in production: stmt
   11445  if_stmt3: IF expr[cond] THEN stmt.list FI
   11446            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11447 test.y:27.30-38:     possibly meant: \$[stmt.list] at \$4
   11448  if_stmt3: IF expr[cond] THEN stmt.list FI
   11449                               ^^^^^^^^^
   11450 test.y:30.43-46: error: ambiguous reference: '\$xyz'
   11451            { \$if_stmt4 = new IfStmt(\$cond, \$xyz, \$cond); };
   11452                                            ^^^^
   11453 test.y:29.35-37:     refers to: \$xyz at \$4
   11454  if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
   11455                                    ^^^
   11456 test.y:29.50-52:     refers to: \$xyz at \$6
   11457  if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
   11458                                                   ^^^
   11459 test.y:32.43-52: error: invalid reference: '\$stmt.list'
   11460            { \$if_stmt5 = new IfStmt(\$cond, \$stmt.list, \$else); };
   11461                                            ^^^^^^^^^^
   11462 test.y:31.11-32.63:  symbol not found in production: stmt
   11463  if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11464            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11465 test.y:31.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
   11466  if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11467                                         ^^^^
   11468 test.y:31.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
   11469  if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11470                                                              ^^^^
   11471 test.y:34.43-58: error: invalid reference: '\$stmt.list.field'
   11472            { \$if_stmt6 = new IfStmt(\$cond, \$stmt.list.field, \$else); };
   11473                                            ^^^^^^^^^^^^^^^^
   11474 test.y:33.11-34.69:  symbol not found in production: stmt
   11475  if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11476            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11477 test.y:33.40-43:     possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
   11478  if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11479                                         ^^^^
   11480 test.y:33.61-64:     possibly meant: \$else.field, hiding \$[stmt.list].field at \$6
   11481  if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11482                                                              ^^^^
   11483 test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
   11484            { \$if_stmt7 = new IfStmt(\$cond, \$[stmt.list].field, \$else); };
   11485                                            ^^^^^^^^^^^^
   11486 test.y:35.11-36.71:  symbol not found in production: stmt.list
   11487  if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11488            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11489 test.y:35.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
   11490  if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11491                                         ^^^^
   11492 test.y:35.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
   11493  if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11494                                                              ^^^^
   11495 test.y:38.43-49: error: invalid reference: '\$then.1'
   11496            { \$if_stmt8 = new IfStmt(\$cond, \$then.1, \$else); };
   11497                                            ^^^^^^^
   11498 test.y:37.11-38.60:  symbol not found in production: then
   11499  if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
   11500            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11501 test.y:37.40-45:     possibly meant: \$[then.1] at \$4
   11502  if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
   11503                                         ^^^^^^
   11504 test.y:40.43-55: error: invalid reference: '\$then.1.field'
   11505            { \$if_stmt9 = new IfStmt(\$cond, \$then.1.field, \$else); };
   11506                                            ^^^^^^^^^^^^^
   11507 test.y:39.11-40.66:  symbol not found in production: then
   11508  if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
   11509            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11510 test.y:39.40-45:     possibly meant: \$[then.1].field at \$4
   11511  if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
   11512                                         ^^^^^^
   11513 test.y:42.44-50: error: invalid reference: '\$stmt.x'
   11514            { \$if_stmt10 = new IfStmt(\$cond, \$stmt.x, 0); };
   11515                                             ^^^^^^^
   11516 test.y:41.12-42.57:  symbol not found in production: stmt
   11517  if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
   11518             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11519 test.y:41.36-41:     possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
   11520  if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
   11521                                     ^^^^^^
   11522 test.y:41.36-41:     possibly meant: \$[stmt.x] at \$4
   11523  if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
   11524                                     ^^^^^^
   11525 test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
   11526            { \$if-stmt-a = new IfStmt(\$cond, \$then, \$else); };
   11527              ^^^^^^^^^^
   11528 test.y:43.12-44.59:  symbol not found in production: if
   11529  if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11530             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11531 test.y:43.1-9:       possibly meant: \$[if-stmt-a] at \$\$
   11532  if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
   11533  ^^^^^^^^^
   11534 test.y:46.46-54: error: invalid reference: '\$then-a.f'
   11535            { \$[if-stmt-b] = new IfStmt(\$cond, \$then-a.f, \$else); };
   11536                                               ^^^^^^^^^
   11537 test.y:45.12-46.65:  symbol not found in production: then
   11538  if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
   11539             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   11540 test.y:45.41-46:     possibly meant: \$[then-a].f at \$4
   11541  if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
   11542                                          ^^^^^^
   11543 " | \
   11544   $at_diff - "$at_stderr" || at_failed=:
   11545 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11546 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:397"
   11547 $at_failed && at_fn_log_failure
   11548 $at_traceon; }
   11549 
   11550 
   11551 
   11552   set +x
   11553   $at_times_p && times >"$at_times_file"
   11554 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11555 read at_status <"$at_status_file"
   11556 #AT_STOP_42
   11557 #AT_START_43
   11558 at_fn_group_banner 43 'named-refs.at:521' \
   11559   "Missing identifiers in brackets" "                " 2
   11560 at_xfail=no
   11561 (
   11562   $as_echo "43. $at_setup_line: testing $at_desc ..."
   11563   $at_traceon
   11564 
   11565 cat >test.y <<'_ATEOF'
   11566 %code top {
   11567 #include <config.h>
   11568 /* We don't need perfect functions for these tests. */
   11569 #undef malloc
   11570 #undef memcmp
   11571 #undef realloc
   11572 }
   11573 
   11574 
   11575 %%
   11576 start: foo[] bar
   11577   { s = $foo; }
   11578 _ATEOF
   11579 
   11580 
   11581 
   11582 { set +x
   11583 $as_echo "$at_srcdir/named-refs.at:528: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11584 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:528"
   11585 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11587 at_status=$? at_failed=false
   11588 $at_check_filter
   11589 echo >>"$at_stderr"; $as_echo "test.y:11.12: error: an identifier expected
   11590 " | \
   11591   $at_diff - "$at_stderr" || at_failed=:
   11592 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11593 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:528"
   11594 $at_failed && at_fn_log_failure
   11595 $at_traceon; }
   11596 
   11597 
   11598   set +x
   11599   $at_times_p && times >"$at_times_file"
   11600 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11601 read at_status <"$at_status_file"
   11602 #AT_STOP_43
   11603 #AT_START_44
   11604 at_fn_group_banner 44 'named-refs.at:535' \
   11605   "Redundant words in brackets" "                    " 2
   11606 at_xfail=no
   11607 (
   11608   $as_echo "44. $at_setup_line: testing $at_desc ..."
   11609   $at_traceon
   11610 
   11611 cat >test.y <<'_ATEOF'
   11612 %code top {
   11613 #include <config.h>
   11614 /* We don't need perfect functions for these tests. */
   11615 #undef malloc
   11616 #undef memcmp
   11617 #undef realloc
   11618 }
   11619 
   11620 
   11621 %%
   11622 start: foo[ a d ] bar
   11623   { s = $foo; }
   11624 _ATEOF
   11625 
   11626 
   11627 
   11628 { set +x
   11629 $as_echo "$at_srcdir/named-refs.at:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11630 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:542"
   11631 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11633 at_status=$? at_failed=false
   11634 $at_check_filter
   11635 echo >>"$at_stderr"; $as_echo "test.y:11.15: error: unexpected identifier in bracketed name: 'd'
   11636 " | \
   11637   $at_diff - "$at_stderr" || at_failed=:
   11638 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11639 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:542"
   11640 $at_failed && at_fn_log_failure
   11641 $at_traceon; }
   11642 
   11643 
   11644   set +x
   11645   $at_times_p && times >"$at_times_file"
   11646 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11647 read at_status <"$at_status_file"
   11648 #AT_STOP_44
   11649 #AT_START_45
   11650 at_fn_group_banner 45 'named-refs.at:549' \
   11651   "Comments in brackets" "                           " 2
   11652 at_xfail=no
   11653 (
   11654   $as_echo "45. $at_setup_line: testing $at_desc ..."
   11655   $at_traceon
   11656 
   11657 cat >test.y <<'_ATEOF'
   11658 %code top {
   11659 #include <config.h>
   11660 /* We don't need perfect functions for these tests. */
   11661 #undef malloc
   11662 #undef memcmp
   11663 #undef realloc
   11664 }
   11665 
   11666 
   11667 %%
   11668 start: foo[/* comment */] bar
   11669   { s = $foo; }
   11670 _ATEOF
   11671 
   11672 
   11673 
   11674 { set +x
   11675 $as_echo "$at_srcdir/named-refs.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11676 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:556"
   11677 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11678 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11679 at_status=$? at_failed=false
   11680 $at_check_filter
   11681 echo >>"$at_stderr"; $as_echo "test.y:11.25: error: an identifier expected
   11682 " | \
   11683   $at_diff - "$at_stderr" || at_failed=:
   11684 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11685 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:556"
   11686 $at_failed && at_fn_log_failure
   11687 $at_traceon; }
   11688 
   11689 
   11690   set +x
   11691   $at_times_p && times >"$at_times_file"
   11692 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11693 read at_status <"$at_status_file"
   11694 #AT_STOP_45
   11695 #AT_START_46
   11696 at_fn_group_banner 46 'named-refs.at:563' \
   11697   "Stray symbols in brackets" "                      " 2
   11698 at_xfail=no
   11699 (
   11700   $as_echo "46. $at_setup_line: testing $at_desc ..."
   11701   $at_traceon
   11702 
   11703 cat >test.y <<'_ATEOF'
   11704 %code top {
   11705 #include <config.h>
   11706 /* We don't need perfect functions for these tests. */
   11707 #undef malloc
   11708 #undef memcmp
   11709 #undef realloc
   11710 }
   11711 
   11712 
   11713 %%
   11714 start: foo[ % /* aaa */ *&-.+\000\001\002\377 ] bar
   11715   { s = $foo; }
   11716 _ATEOF
   11717 
   11718 
   11719 { set +x
   11720 $as_echo "$at_srcdir/named-refs.at:570: \$PERL -pi -e 's/\\\\(\\d{3})/chr(oct(\$1))/ge' test.y || exit 77"
   11721 at_fn_check_prepare_dynamic "$PERL -pi -e 's/\\\\(\\d{3})/chr(oct($1))/ge' test.y || exit 77" "named-refs.at:570"
   11722 ( $at_check_trace; $PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' test.y || exit 77
   11723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11724 at_status=$? at_failed=false
   11725 $at_check_filter
   11726 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11727 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11728 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:570"
   11729 $at_failed && at_fn_log_failure
   11730 $at_traceon; }
   11731 
   11732 
   11733 { set +x
   11734 $as_echo "$at_srcdir/named-refs.at:571: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11735 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:571"
   11736 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11737 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11738 at_status=$? at_failed=false
   11739 $at_check_filter
   11740 echo >>"$at_stderr"; $as_echo "test.y:11.13: error: invalid character in bracketed name: '%'
   11741 test.y:11.25-27: error: invalid characters in bracketed name: '*&-'
   11742 test.y:11.29-30: error: invalid characters in bracketed name: '+\\0\\001\\002\\377'
   11743 " | \
   11744   $at_diff - "$at_stderr" || at_failed=:
   11745 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11746 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:571"
   11747 $at_failed && at_fn_log_failure
   11748 $at_traceon; }
   11749 
   11750 
   11751   set +x
   11752   $at_times_p && times >"$at_times_file"
   11753 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11754 read at_status <"$at_status_file"
   11755 #AT_STOP_46
   11756 #AT_START_47
   11757 at_fn_group_banner 47 'named-refs.at:580' \
   11758   "Redundant words in LHS brackets" "                " 2
   11759 at_xfail=no
   11760 (
   11761   $as_echo "47. $at_setup_line: testing $at_desc ..."
   11762   $at_traceon
   11763 
   11764 cat >test.y <<'_ATEOF'
   11765 %code top {
   11766 #include <config.h>
   11767 /* We don't need perfect functions for these tests. */
   11768 #undef malloc
   11769 #undef memcmp
   11770 #undef realloc
   11771 }
   11772 
   11773 
   11774 %%
   11775 start[a s]: foo;
   11776 _ATEOF
   11777 
   11778 
   11779 
   11780 { set +x
   11781 $as_echo "$at_srcdir/named-refs.at:586: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11782 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:586"
   11783 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11785 at_status=$? at_failed=false
   11786 $at_check_filter
   11787 echo >>"$at_stderr"; $as_echo "test.y:11.9: error: unexpected identifier in bracketed name: 's'
   11788 " | \
   11789   $at_diff - "$at_stderr" || at_failed=:
   11790 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11791 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:586"
   11792 $at_failed && at_fn_log_failure
   11793 $at_traceon; }
   11794 
   11795 
   11796   set +x
   11797   $at_times_p && times >"$at_times_file"
   11798 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11799 read at_status <"$at_status_file"
   11800 #AT_STOP_47
   11801 #AT_START_48
   11802 at_fn_group_banner 48 'named-refs.at:595' \
   11803   "Factored LHS" "                                   " 2
   11804 at_xfail=no
   11805 (
   11806   $as_echo "48. $at_setup_line: testing $at_desc ..."
   11807   $at_traceon
   11808 
   11809 cat >test.y <<'_ATEOF'
   11810 %code top {
   11811 #include <config.h>
   11812 /* We don't need perfect functions for these tests. */
   11813 #undef malloc
   11814 #undef memcmp
   11815 #undef realloc
   11816 }
   11817 
   11818 
   11819 %%
   11820 start[a]: "foo" | "bar";
   11821 _ATEOF
   11822 
   11823 
   11824 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   11825   at_save_special_files
   11826   mkdir xml-tests
   11827     # Don't combine these Bison invocations since we want to be sure that
   11828   # --report=all isn't required to get the full XML file.
   11829   { set +x
   11830 $as_echo "$at_srcdir/named-refs.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   11831                   --graph=xml-tests/test.dot -o test.c test.y"
   11832 at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:601"
   11833 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   11834                   --graph=xml-tests/test.dot -o test.c test.y
   11835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11836 at_status=$? at_failed=false
   11837 $at_check_filter
   11838 echo stderr:; cat "$at_stderr"
   11839 echo stdout:; cat "$at_stdout"
   11840 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601"
   11841 $at_failed && at_fn_log_failure
   11842 $at_traceon; }
   11843 
   11844   { set +x
   11845 $as_echo "$at_srcdir/named-refs.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y"
   11846 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:601"
   11847 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o test.c test.y
   11848 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11849 at_status=$? at_failed=false
   11850 $at_check_filter
   11851 echo stderr:; cat "$at_stderr"
   11852 echo stdout:; cat "$at_stdout"
   11853 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601"
   11854 $at_failed && at_fn_log_failure
   11855 $at_traceon; }
   11856 
   11857     cp xml-tests/test.output expout
   11858   { set +x
   11859 $as_echo "$at_srcdir/named-refs.at:601: \$XSLTPROC \\
   11860              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   11861              xml-tests/test.xml"
   11862 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:601"
   11863 ( $at_check_trace; $XSLTPROC \
   11864              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   11865              xml-tests/test.xml
   11866 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11867 at_status=$? at_failed=false
   11868 $at_check_filter
   11869 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11870 $at_diff expout "$at_stdout" || at_failed=:
   11871 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601"
   11872 $at_failed && at_fn_log_failure
   11873 $at_traceon; }
   11874 
   11875   sort xml-tests/test.dot > expout
   11876   { set +x
   11877 $as_echo "$at_srcdir/named-refs.at:601: \$XSLTPROC \\
   11878              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   11879              xml-tests/test.xml | sort"
   11880 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:601"
   11881 ( $at_check_trace; $XSLTPROC \
   11882              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   11883              xml-tests/test.xml | sort
   11884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11885 at_status=$? at_failed=false
   11886 $at_check_filter
   11887 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11888 $at_diff expout "$at_stdout" || at_failed=:
   11889 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601"
   11890 $at_failed && at_fn_log_failure
   11891 $at_traceon; }
   11892 
   11893   rm -rf xml-tests expout
   11894   at_restore_special_files
   11895 fi
   11896 { set +x
   11897 $as_echo "$at_srcdir/named-refs.at:601: bison -o test.c test.y"
   11898 at_fn_check_prepare_trace "named-refs.at:601"
   11899 ( $at_check_trace; bison -o test.c test.y
   11900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11901 at_status=$? at_failed=false
   11902 $at_check_filter
   11903 at_fn_diff_devnull "$at_stderr" || at_failed=:
   11904 at_fn_diff_devnull "$at_stdout" || at_failed=:
   11905 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:601"
   11906 $at_failed && at_fn_log_failure
   11907 $at_traceon; }
   11908 
   11909 
   11910   set +x
   11911   $at_times_p && times >"$at_times_file"
   11912 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   11913 read at_status <"$at_status_file"
   11914 #AT_STOP_48
   11915 #AT_START_49
   11916 at_fn_group_banner 49 'named-refs.at:606' \
   11917   "Unresolved references" "                          " 2
   11918 at_xfail=no
   11919 (
   11920   $as_echo "49. $at_setup_line: testing $at_desc ..."
   11921   $at_traceon
   11922 
   11923 cat >test.y <<'_ATEOF'
   11924 %code top {
   11925 #include <config.h>
   11926 /* We don't need perfect functions for these tests. */
   11927 #undef malloc
   11928 #undef memcmp
   11929 #undef realloc
   11930 }
   11931 
   11932 
   11933 %%
   11934 stat:
   11935   sym_a sym_b { func($sym.field); }
   11936 | sym_a sym_b { func($<aa>sym.field); }
   11937 | sym_a sym_b { func($[sym.field]); }
   11938 | sym_a sym_b { func($<aa>[sym.field]); }
   11939 | sym_a sym_b { func($sym); }
   11940 | sym_a sym_b { func($<aa>sym); }
   11941 | sym_a sym_b { func($[sym]); } sym_a sym_b { func($<aa>[sym]); }
   11942 ;
   11943 
   11944 stat1:
   11945   sym_a sym_b { func($sym-field); }
   11946 | sym_a sym_b { func($<aa>sym-field); }
   11947 | sym_a sym_b { func($[sym-field]); }
   11948 | sym_a sym_b { func($<aa>[sym-field]); }
   11949 | sym_a sym_b { func($sym); }
   11950 | sym_a sym_b { func($<aa>sym); }
   11951 | sym_a sym_b { func($[sym]); } sym_a sym_b { func($<aa>[sym]); }
   11952 ;
   11953 
   11954 sym_a: 'a';
   11955 sym_b: 'b';
   11956 _ATEOF
   11957 
   11958 
   11959 
   11960 { set +x
   11961 $as_echo "$at_srcdir/named-refs.at:633: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y"
   11962 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o test.c test.y" "named-refs.at:633"
   11963 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o test.c test.y
   11964 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   11965 at_status=$? at_failed=false
   11966 $at_check_filter
   11967 echo >>"$at_stderr"; $as_echo "test.y:12.22-31: error: invalid reference: '\$sym.field'
   11968 test.y:12.3-35:      symbol not found in production: sym
   11969 test.y:13.22-35: error: invalid reference: '\$<aa>sym.field'
   11970 test.y:13.3-39:      symbol not found in production: sym
   11971 test.y:14.22-33: error: invalid reference: '\$[sym.field]'
   11972 test.y:14.3-37:      symbol not found in production: sym.field
   11973 test.y:15.22-37: error: invalid reference: '\$<aa>[sym.field]'
   11974 test.y:15.3-41:      symbol not found in production: sym.field
   11975 test.y:16.22-25: error: invalid reference: '\$sym'
   11976 test.y:16.3-29:      symbol not found in production: sym
   11977 test.y:17.22-29: error: invalid reference: '\$<aa>sym'
   11978 test.y:17.3-33:      symbol not found in production: sym
   11979 test.y:18.22-27: error: invalid reference: '\$[sym]'
   11980 test.y:18.3-65:      symbol not found in production before \$3: sym
   11981 test.y:18.52-61: error: invalid reference: '\$<aa>[sym]'
   11982 test.y:18.3-65:      symbol not found in production: sym
   11983 test.y:22.22-31: error: invalid reference: '\$sym-field'
   11984 test.y:22.3-35:      symbol not found in production: sym
   11985 test.y:23.22-35: error: invalid reference: '\$<aa>sym-field'
   11986 test.y:23.3-39:      symbol not found in production: sym
   11987 test.y:24.22-33: error: invalid reference: '\$[sym-field]'
   11988 test.y:24.3-37:      symbol not found in production: sym-field
   11989 test.y:25.22-37: error: invalid reference: '\$<aa>[sym-field]'
   11990 test.y:25.3-41:      symbol not found in production: sym-field
   11991 test.y:26.22-25: error: invalid reference: '\$sym'
   11992 test.y:26.3-29:      symbol not found in production: sym
   11993 test.y:27.22-29: error: invalid reference: '\$<aa>sym'
   11994 test.y:27.3-33:      symbol not found in production: sym
   11995 test.y:28.22-27: error: invalid reference: '\$[sym]'
   11996 test.y:28.3-65:      symbol not found in production before \$3: sym
   11997 test.y:28.52-61: error: invalid reference: '\$<aa>[sym]'
   11998 test.y:28.3-65:      symbol not found in production: sym
   11999 " | \
   12000   $at_diff - "$at_stderr" || at_failed=:
   12001 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12002 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:633"
   12003 $at_failed && at_fn_log_failure
   12004 $at_traceon; }
   12005 
   12006 
   12007   set +x
   12008   $at_times_p && times >"$at_times_file"
   12009 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12010 read at_status <"$at_status_file"
   12011 #AT_STOP_49
   12012 #AT_START_50
   12013 at_fn_group_banner 50 'named-refs.at:671' \
   12014   "\$ or @ followed by . or -" "                      " 2
   12015 at_xfail=no
   12016 (
   12017   $as_echo "50. $at_setup_line: testing $at_desc ..."
   12018   $at_traceon
   12019 
   12020 cat >test.y <<'_ATEOF'
   12021 
   12022 %%
   12023 start:
   12024   .field { $.field; }
   12025 | 'a'    { @.field; }
   12026 ;
   12027 .field: ;
   12028 _ATEOF
   12029 
   12030 
   12031 { set +x
   12032 $as_echo "$at_srcdir/named-refs.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y"
   12033 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y" "named-refs.at:681"
   12034 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y
   12035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12036 at_status=$? at_failed=false
   12037 $at_check_filter
   12038 echo >>"$at_stderr"; $as_echo "test.y:4.12-18: error: invalid reference: '\$.field'
   12039 test.y:4.13:        syntax error after '\$', expecting integer, letter, '_', '[', or '\$'
   12040 test.y:4.3-8:       possibly meant: \$[.field] at \$1
   12041 test.y:5.12-18: error: invalid reference: '@.field'
   12042 test.y:5.13:        syntax error after '@', expecting integer, letter, '_', '[', or '\$'
   12043 " | \
   12044   $at_diff - "$at_stderr" || at_failed=:
   12045 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12046 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:681"
   12047 $at_failed && at_fn_log_failure
   12048 $at_traceon; }
   12049 
   12050 
   12051 cat >test.y <<'_ATEOF'
   12052 
   12053 %%
   12054 start:
   12055   'a' { $-field; }
   12056 | 'b' { @-field; }
   12057 ;
   12058 _ATEOF
   12059 
   12060 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12061   at_save_special_files
   12062   mkdir xml-tests
   12063     # Don't combine these Bison invocations since we want to be sure that
   12064   # --report=all isn't required to get the full XML file.
   12065   { set +x
   12066 $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12067                   --graph=xml-tests/test.dot test.y"
   12068 at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:696"
   12069 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12070                   --graph=xml-tests/test.dot test.y
   12071 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12072 at_status=$? at_failed=false
   12073 $at_check_filter
   12074 echo stderr:; cat "$at_stderr"
   12075 echo stdout:; cat "$at_stdout"
   12076 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12077 $at_failed && at_fn_log_failure
   12078 $at_traceon; }
   12079 
   12080   { set +x
   12081 $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml test.y"
   12082 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml test.y" "named-refs.at:696"
   12083 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml test.y
   12084 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12085 at_status=$? at_failed=false
   12086 $at_check_filter
   12087 echo stderr:; cat "$at_stderr"
   12088 echo stdout:; cat "$at_stdout"
   12089 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12090 $at_failed && at_fn_log_failure
   12091 $at_traceon; }
   12092 
   12093     cp xml-tests/test.output expout
   12094   { set +x
   12095 $as_echo "$at_srcdir/named-refs.at:696: \$XSLTPROC \\
   12096              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12097              xml-tests/test.xml"
   12098 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:696"
   12099 ( $at_check_trace; $XSLTPROC \
   12100              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12101              xml-tests/test.xml
   12102 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12103 at_status=$? at_failed=false
   12104 $at_check_filter
   12105 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12106 $at_diff expout "$at_stdout" || at_failed=:
   12107 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12108 $at_failed && at_fn_log_failure
   12109 $at_traceon; }
   12110 
   12111   sort xml-tests/test.dot > expout
   12112   { set +x
   12113 $as_echo "$at_srcdir/named-refs.at:696: \$XSLTPROC \\
   12114              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12115              xml-tests/test.xml | sort"
   12116 at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:696"
   12117 ( $at_check_trace; $XSLTPROC \
   12118              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12119              xml-tests/test.xml | sort
   12120 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12121 at_status=$? at_failed=false
   12122 $at_check_filter
   12123 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12124 $at_diff expout "$at_stdout" || at_failed=:
   12125 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12126 $at_failed && at_fn_log_failure
   12127 $at_traceon; }
   12128 
   12129   rm -rf xml-tests expout
   12130   at_restore_special_files
   12131 fi
   12132 { set +x
   12133 $as_echo "$at_srcdir/named-refs.at:696: bison test.y"
   12134 at_fn_check_prepare_trace "named-refs.at:696"
   12135 ( $at_check_trace; bison test.y
   12136 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12137 at_status=$? at_failed=false
   12138 $at_check_filter
   12139 echo >>"$at_stderr"; $as_echo "test.y:4.9: warning: stray '\$'
   12140 test.y:5.9: warning: stray '@'
   12141 " | \
   12142   $at_diff - "$at_stderr" || at_failed=:
   12143 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12144 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12145 $at_failed && at_fn_log_failure
   12146 $at_traceon; }
   12147 
   12148 # Defining POSIXLY_CORRECT causes bison to complain if options are
   12149 # added after the grammar file name, so skip these checks in that
   12150 # case.
   12151 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   12152   at_save_special_files
   12153 
   12154   # To avoid expanding it repeatedly, store specified stdout.
   12155   : >expout
   12156 
   12157   # Run with -Werror.
   12158   { set +x
   12159 $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Werror"
   12160 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Werror" "named-refs.at:696"
   12161 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y -Werror
   12162 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12163 at_status=$? at_failed=false
   12164 $at_check_filter
   12165 echo stderr:; tee stderr <"$at_stderr"
   12166 $at_diff expout "$at_stdout" || at_failed=:
   12167 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:696"
   12168 $at_failed && at_fn_log_failure
   12169 $at_traceon; }
   12170 
   12171 
   12172   # Build expected stderr up to and including the "warnings being
   12173   # treated as errors" message.
   12174   cat >at-bison-check-warnings <<'_ATEOF'
   12175 test.y:4.9: warning: stray '$'
   12176 test.y:5.9: warning: stray '@'
   12177 _ATEOF
   12178 
   12179   at_bison_check_first=`sed -n \
   12180     '/: warning: /{=;q;}' at-bison-check-warnings`
   12181   : ${at_bison_check_first:=1}
   12182   at_bison_check_first_tmp=`sed -n \
   12183     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   12184   : ${at_bison_check_first_tmp:=1}
   12185   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   12186     at_bison_check_first=$at_bison_check_first_tmp
   12187   fi
   12188   if test $at_bison_check_first -gt 1; then
   12189     sed -n "1,`expr $at_bison_check_first - 1`"p \
   12190       at-bison-check-warnings > experr
   12191   fi
   12192   echo 'bison: warnings being treated as errors' >> experr
   12193 
   12194   # Finish building expected stderr and check.  Unlike warnings,
   12195   # complaints cause bison to exit early.  Thus, with -Werror, bison
   12196   # does not necessarily report all warnings that it does without
   12197   # -Werror, but it at least reports one.
   12198   at_bison_check_last=`sed -n '$=' stderr`
   12199   : ${at_bison_check_last:=1}
   12200   at_bison_check_last=`expr $at_bison_check_last - 1`
   12201   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   12202     at-bison-check-warnings >> experr
   12203   { set +x
   12204 $as_echo "$at_srcdir/named-refs.at:696: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   12205               stderr 1>&2"
   12206 at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:696"
   12207 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   12208               stderr 1>&2
   12209 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12210 at_status=$? at_failed=false
   12211 $at_check_filter
   12212 $at_diff experr "$at_stderr" || at_failed=:
   12213 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12214 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12215 $at_failed && at_fn_log_failure
   12216 $at_traceon; }
   12217 
   12218 
   12219   # Now check --warnings=error.
   12220   cp stderr experr
   12221   { set +x
   12222 $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=error"
   12223 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=error" "named-refs.at:696"
   12224 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y --warnings=error
   12225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12226 at_status=$? at_failed=false
   12227 $at_check_filter
   12228 $at_diff experr "$at_stderr" || at_failed=:
   12229 $at_diff expout "$at_stdout" || at_failed=:
   12230 at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:696"
   12231 $at_failed && at_fn_log_failure
   12232 $at_traceon; }
   12233 
   12234 
   12235   # Now check -Wnone and --warnings=none by making sure that
   12236   # -Werror doesn't change the exit status when -Wnone or
   12237   # --warnings=none is specified.
   12238   { set +x
   12239 $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Wnone -Werror"
   12240 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y -Wnone -Werror" "named-refs.at:696"
   12241 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y -Wnone -Werror
   12242 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12243 at_status=$? at_failed=false
   12244 $at_check_filter
   12245 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12246 $at_diff expout "$at_stdout" || at_failed=:
   12247 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12248 $at_failed && at_fn_log_failure
   12249 $at_traceon; }
   12250 
   12251   { set +x
   12252 $as_echo "$at_srcdir/named-refs.at:696: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=none -Werror"
   12253 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison test.y --warnings=none -Werror" "named-refs.at:696"
   12254 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison test.y --warnings=none -Werror
   12255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12256 at_status=$? at_failed=false
   12257 $at_check_filter
   12258 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12259 $at_diff expout "$at_stdout" || at_failed=:
   12260 at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:696"
   12261 $at_failed && at_fn_log_failure
   12262 $at_traceon; }
   12263 
   12264 
   12265   at_restore_special_files
   12266 fi
   12267   set +x
   12268   $at_times_p && times >"$at_times_file"
   12269 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12270 read at_status <"$at_status_file"
   12271 #AT_STOP_50
   12272 #AT_START_51
   12273 at_fn_group_banner 51 'output.at:44' \
   12274   "Output files:  -dv " "                            " 3
   12275 at_xfail=no
   12276 (
   12277   $as_echo "51. $at_setup_line: testing $at_desc ..."
   12278   $at_traceon
   12279 
   12280 
   12281 for file in foo.y foo.output foo.tab.c foo.tab.h; do
   12282   case "$file" in
   12283     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   12284   esac
   12285 done
   12286 cat >foo.y <<'_ATEOF'
   12287 
   12288 %%
   12289 foo: {};
   12290 _ATEOF
   12291 
   12292 
   12293 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12294   at_save_special_files
   12295   mkdir xml-tests
   12296     # Don't combine these Bison invocations since we want to be sure that
   12297   # --report=all isn't required to get the full XML file.
   12298   { set +x
   12299 $as_echo "$at_srcdir/output.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12300                   --graph=xml-tests/test.dot -dv foo.y "
   12301 at_fn_check_prepare_notrace 'an embedded newline' "output.at:44"
   12302 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12303                   --graph=xml-tests/test.dot -dv foo.y
   12304 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12305 at_status=$? at_failed=false
   12306 $at_check_filter
   12307 echo stderr:; cat "$at_stderr"
   12308 echo stdout:; cat "$at_stdout"
   12309 at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
   12310 $at_failed && at_fn_log_failure
   12311 $at_traceon; }
   12312 
   12313   { set +x
   12314 $as_echo "$at_srcdir/output.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y "
   12315 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y " "output.at:44"
   12316 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y
   12317 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12318 at_status=$? at_failed=false
   12319 $at_check_filter
   12320 echo stderr:; cat "$at_stderr"
   12321 echo stdout:; cat "$at_stdout"
   12322 at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
   12323 $at_failed && at_fn_log_failure
   12324 $at_traceon; }
   12325 
   12326     cp xml-tests/test.output expout
   12327   { set +x
   12328 $as_echo "$at_srcdir/output.at:44: \$XSLTPROC \\
   12329              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12330              xml-tests/test.xml"
   12331 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:44"
   12332 ( $at_check_trace; $XSLTPROC \
   12333              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12334              xml-tests/test.xml
   12335 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12336 at_status=$? at_failed=false
   12337 $at_check_filter
   12338 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12339 $at_diff expout "$at_stdout" || at_failed=:
   12340 at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
   12341 $at_failed && at_fn_log_failure
   12342 $at_traceon; }
   12343 
   12344   sort xml-tests/test.dot > expout
   12345   { set +x
   12346 $as_echo "$at_srcdir/output.at:44: \$XSLTPROC \\
   12347              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12348              xml-tests/test.xml | sort"
   12349 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:44"
   12350 ( $at_check_trace; $XSLTPROC \
   12351              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12352              xml-tests/test.xml | sort
   12353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12354 at_status=$? at_failed=false
   12355 $at_check_filter
   12356 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12357 $at_diff expout "$at_stdout" || at_failed=:
   12358 at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
   12359 $at_failed && at_fn_log_failure
   12360 $at_traceon; }
   12361 
   12362   rm -rf xml-tests expout
   12363   at_restore_special_files
   12364 fi
   12365 { set +x
   12366 $as_echo "$at_srcdir/output.at:44: bison -dv foo.y "
   12367 at_fn_check_prepare_trace "output.at:44"
   12368 ( $at_check_trace; bison -dv foo.y
   12369 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12370 at_status=$? at_failed=false
   12371 $at_check_filter
   12372 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12373 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12374 at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
   12375 $at_failed && at_fn_log_failure
   12376 $at_traceon; }
   12377 
   12378 
   12379 { set +x
   12380 $as_echo "$at_srcdir/output.at:44: ls foo.output foo.tab.c foo.tab.h"
   12381 at_fn_check_prepare_trace "output.at:44"
   12382 ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
   12383 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12384 at_status=$? at_failed=false
   12385 $at_check_filter
   12386 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12387 echo stdout:; cat "$at_stdout"
   12388 at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
   12389 $at_failed && at_fn_log_failure
   12390 $at_traceon; }
   12391 
   12392 
   12393   set +x
   12394   $at_times_p && times >"$at_times_file"
   12395 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12396 read at_status <"$at_status_file"
   12397 #AT_STOP_51
   12398 #AT_START_52
   12399 at_fn_group_banner 52 'output.at:50' \
   12400   "Output files:  -dv >&-" "                         " 3
   12401 at_xfail=no
   12402 (
   12403   $as_echo "52. $at_setup_line: testing $at_desc ..."
   12404   $at_traceon
   12405 
   12406 { set +x
   12407 $as_echo "$at_srcdir/output.at:50: case \"\$PREBISON\" in *valgrind*) exit 77;; esac"
   12408 at_fn_check_prepare_dynamic "case \"$PREBISON\" in *valgrind*) exit 77;; esac" "output.at:50"
   12409 ( $at_check_trace; case "$PREBISON" in *valgrind*) exit 77;; esac
   12410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12411 at_status=$? at_failed=false
   12412 $at_check_filter
   12413 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12414 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12415 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12416 $at_failed && at_fn_log_failure
   12417 $at_traceon; }
   12418 
   12419 for file in foo.y foo.output foo.tab.c foo.tab.h; do
   12420   case "$file" in
   12421     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   12422   esac
   12423 done
   12424 cat >foo.y <<'_ATEOF'
   12425 
   12426 %%
   12427 foo: {};
   12428 _ATEOF
   12429 
   12430 
   12431 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12432   at_save_special_files
   12433   mkdir xml-tests
   12434     # Don't combine these Bison invocations since we want to be sure that
   12435   # --report=all isn't required to get the full XML file.
   12436   { set +x
   12437 $as_echo "$at_srcdir/output.at:50: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12438                   --graph=xml-tests/test.dot -dv foo.y >&-"
   12439 at_fn_check_prepare_notrace 'an embedded newline' "output.at:50"
   12440 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12441                   --graph=xml-tests/test.dot -dv foo.y >&-
   12442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12443 at_status=$? at_failed=false
   12444 $at_check_filter
   12445 echo stderr:; cat "$at_stderr"
   12446 echo stdout:; cat "$at_stdout"
   12447 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12448 $at_failed && at_fn_log_failure
   12449 $at_traceon; }
   12450 
   12451   { set +x
   12452 $as_echo "$at_srcdir/output.at:50: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y >&-"
   12453 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y >&-" "output.at:50"
   12454 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv foo.y >&-
   12455 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12456 at_status=$? at_failed=false
   12457 $at_check_filter
   12458 echo stderr:; cat "$at_stderr"
   12459 echo stdout:; cat "$at_stdout"
   12460 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12461 $at_failed && at_fn_log_failure
   12462 $at_traceon; }
   12463 
   12464     cp xml-tests/test.output expout
   12465   { set +x
   12466 $as_echo "$at_srcdir/output.at:50: \$XSLTPROC \\
   12467              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12468              xml-tests/test.xml"
   12469 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:50"
   12470 ( $at_check_trace; $XSLTPROC \
   12471              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12472              xml-tests/test.xml
   12473 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12474 at_status=$? at_failed=false
   12475 $at_check_filter
   12476 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12477 $at_diff expout "$at_stdout" || at_failed=:
   12478 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12479 $at_failed && at_fn_log_failure
   12480 $at_traceon; }
   12481 
   12482   sort xml-tests/test.dot > expout
   12483   { set +x
   12484 $as_echo "$at_srcdir/output.at:50: \$XSLTPROC \\
   12485              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12486              xml-tests/test.xml | sort"
   12487 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:50"
   12488 ( $at_check_trace; $XSLTPROC \
   12489              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12490              xml-tests/test.xml | sort
   12491 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12492 at_status=$? at_failed=false
   12493 $at_check_filter
   12494 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12495 $at_diff expout "$at_stdout" || at_failed=:
   12496 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12497 $at_failed && at_fn_log_failure
   12498 $at_traceon; }
   12499 
   12500   rm -rf xml-tests expout
   12501   at_restore_special_files
   12502 fi
   12503 { set +x
   12504 $as_echo "$at_srcdir/output.at:50: bison -dv foo.y >&-"
   12505 at_fn_check_prepare_trace "output.at:50"
   12506 ( $at_check_trace; bison -dv foo.y >&-
   12507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12508 at_status=$? at_failed=false
   12509 $at_check_filter
   12510 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12511 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12512 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12513 $at_failed && at_fn_log_failure
   12514 $at_traceon; }
   12515 
   12516 
   12517 { set +x
   12518 $as_echo "$at_srcdir/output.at:50: ls foo.output foo.tab.c foo.tab.h"
   12519 at_fn_check_prepare_trace "output.at:50"
   12520 ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
   12521 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12522 at_status=$? at_failed=false
   12523 $at_check_filter
   12524 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12525 echo stdout:; cat "$at_stdout"
   12526 at_fn_check_status 0 $at_status "$at_srcdir/output.at:50"
   12527 $at_failed && at_fn_log_failure
   12528 $at_traceon; }
   12529 
   12530 
   12531   set +x
   12532   $at_times_p && times >"$at_times_file"
   12533 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12534 read at_status <"$at_status_file"
   12535 #AT_STOP_52
   12536 #AT_START_53
   12537 at_fn_group_banner 53 'output.at:55' \
   12538   "Output files:  -dv -o foo.c " "                   " 3
   12539 at_xfail=no
   12540 (
   12541   $as_echo "53. $at_setup_line: testing $at_desc ..."
   12542   $at_traceon
   12543 
   12544 
   12545 for file in foo.y foo.c foo.h foo.output; do
   12546   case "$file" in
   12547     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   12548   esac
   12549 done
   12550 cat >foo.y <<'_ATEOF'
   12551 
   12552 %%
   12553 foo: {};
   12554 _ATEOF
   12555 
   12556 
   12557 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12558   at_save_special_files
   12559   mkdir xml-tests
   12560     # Don't combine these Bison invocations since we want to be sure that
   12561   # --report=all isn't required to get the full XML file.
   12562   { set +x
   12563 $as_echo "$at_srcdir/output.at:55: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12564                   --graph=xml-tests/test.dot -dv -o foo.c foo.y "
   12565 at_fn_check_prepare_notrace 'an embedded newline' "output.at:55"
   12566 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12567                   --graph=xml-tests/test.dot -dv -o foo.c foo.y
   12568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12569 at_status=$? at_failed=false
   12570 $at_check_filter
   12571 echo stderr:; cat "$at_stderr"
   12572 echo stdout:; cat "$at_stdout"
   12573 at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
   12574 $at_failed && at_fn_log_failure
   12575 $at_traceon; }
   12576 
   12577   { set +x
   12578 $as_echo "$at_srcdir/output.at:55: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y "
   12579 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y " "output.at:55"
   12580 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y
   12581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12582 at_status=$? at_failed=false
   12583 $at_check_filter
   12584 echo stderr:; cat "$at_stderr"
   12585 echo stdout:; cat "$at_stdout"
   12586 at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
   12587 $at_failed && at_fn_log_failure
   12588 $at_traceon; }
   12589 
   12590     cp xml-tests/test.output expout
   12591   { set +x
   12592 $as_echo "$at_srcdir/output.at:55: \$XSLTPROC \\
   12593              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12594              xml-tests/test.xml"
   12595 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:55"
   12596 ( $at_check_trace; $XSLTPROC \
   12597              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12598              xml-tests/test.xml
   12599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12600 at_status=$? at_failed=false
   12601 $at_check_filter
   12602 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12603 $at_diff expout "$at_stdout" || at_failed=:
   12604 at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
   12605 $at_failed && at_fn_log_failure
   12606 $at_traceon; }
   12607 
   12608   sort xml-tests/test.dot > expout
   12609   { set +x
   12610 $as_echo "$at_srcdir/output.at:55: \$XSLTPROC \\
   12611              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12612              xml-tests/test.xml | sort"
   12613 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:55"
   12614 ( $at_check_trace; $XSLTPROC \
   12615              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12616              xml-tests/test.xml | sort
   12617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12618 at_status=$? at_failed=false
   12619 $at_check_filter
   12620 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12621 $at_diff expout "$at_stdout" || at_failed=:
   12622 at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
   12623 $at_failed && at_fn_log_failure
   12624 $at_traceon; }
   12625 
   12626   rm -rf xml-tests expout
   12627   at_restore_special_files
   12628 fi
   12629 { set +x
   12630 $as_echo "$at_srcdir/output.at:55: bison -dv -o foo.c foo.y "
   12631 at_fn_check_prepare_trace "output.at:55"
   12632 ( $at_check_trace; bison -dv -o foo.c foo.y
   12633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12634 at_status=$? at_failed=false
   12635 $at_check_filter
   12636 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12637 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12638 at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
   12639 $at_failed && at_fn_log_failure
   12640 $at_traceon; }
   12641 
   12642 
   12643 { set +x
   12644 $as_echo "$at_srcdir/output.at:55: ls foo.c foo.h foo.output"
   12645 at_fn_check_prepare_trace "output.at:55"
   12646 ( $at_check_trace; ls foo.c foo.h foo.output
   12647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12648 at_status=$? at_failed=false
   12649 $at_check_filter
   12650 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12651 echo stdout:; cat "$at_stdout"
   12652 at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
   12653 $at_failed && at_fn_log_failure
   12654 $at_traceon; }
   12655 
   12656 
   12657   set +x
   12658   $at_times_p && times >"$at_times_file"
   12659 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12660 read at_status <"$at_status_file"
   12661 #AT_STOP_53
   12662 #AT_START_54
   12663 at_fn_group_banner 54 'output.at:57' \
   12664   "Output files:  -dv -o foo.tab.c " "               " 3
   12665 at_xfail=no
   12666 (
   12667   $as_echo "54. $at_setup_line: testing $at_desc ..."
   12668   $at_traceon
   12669 
   12670 
   12671 for file in foo.y foo.output foo.tab.c foo.tab.h; do
   12672   case "$file" in
   12673     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   12674   esac
   12675 done
   12676 cat >foo.y <<'_ATEOF'
   12677 
   12678 %%
   12679 foo: {};
   12680 _ATEOF
   12681 
   12682 
   12683 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12684   at_save_special_files
   12685   mkdir xml-tests
   12686     # Don't combine these Bison invocations since we want to be sure that
   12687   # --report=all isn't required to get the full XML file.
   12688   { set +x
   12689 $as_echo "$at_srcdir/output.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12690                   --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y "
   12691 at_fn_check_prepare_notrace 'an embedded newline' "output.at:57"
   12692 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12693                   --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y
   12694 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12695 at_status=$? at_failed=false
   12696 $at_check_filter
   12697 echo stderr:; cat "$at_stderr"
   12698 echo stdout:; cat "$at_stdout"
   12699 at_fn_check_status 0 $at_status "$at_srcdir/output.at:57"
   12700 $at_failed && at_fn_log_failure
   12701 $at_traceon; }
   12702 
   12703   { set +x
   12704 $as_echo "$at_srcdir/output.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y "
   12705 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y " "output.at:57"
   12706 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y
   12707 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12708 at_status=$? at_failed=false
   12709 $at_check_filter
   12710 echo stderr:; cat "$at_stderr"
   12711 echo stdout:; cat "$at_stdout"
   12712 at_fn_check_status 0 $at_status "$at_srcdir/output.at:57"
   12713 $at_failed && at_fn_log_failure
   12714 $at_traceon; }
   12715 
   12716     cp xml-tests/test.output expout
   12717   { set +x
   12718 $as_echo "$at_srcdir/output.at:57: \$XSLTPROC \\
   12719              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12720              xml-tests/test.xml"
   12721 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:57"
   12722 ( $at_check_trace; $XSLTPROC \
   12723              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12724              xml-tests/test.xml
   12725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12726 at_status=$? at_failed=false
   12727 $at_check_filter
   12728 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12729 $at_diff expout "$at_stdout" || at_failed=:
   12730 at_fn_check_status 0 $at_status "$at_srcdir/output.at:57"
   12731 $at_failed && at_fn_log_failure
   12732 $at_traceon; }
   12733 
   12734   sort xml-tests/test.dot > expout
   12735   { set +x
   12736 $as_echo "$at_srcdir/output.at:57: \$XSLTPROC \\
   12737              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12738              xml-tests/test.xml | sort"
   12739 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:57"
   12740 ( $at_check_trace; $XSLTPROC \
   12741              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12742              xml-tests/test.xml | sort
   12743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12744 at_status=$? at_failed=false
   12745 $at_check_filter
   12746 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12747 $at_diff expout "$at_stdout" || at_failed=:
   12748 at_fn_check_status 0 $at_status "$at_srcdir/output.at:57"
   12749 $at_failed && at_fn_log_failure
   12750 $at_traceon; }
   12751 
   12752   rm -rf xml-tests expout
   12753   at_restore_special_files
   12754 fi
   12755 { set +x
   12756 $as_echo "$at_srcdir/output.at:57: bison -dv -o foo.tab.c foo.y "
   12757 at_fn_check_prepare_trace "output.at:57"
   12758 ( $at_check_trace; bison -dv -o foo.tab.c foo.y
   12759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12760 at_status=$? at_failed=false
   12761 $at_check_filter
   12762 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12763 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12764 at_fn_check_status 0 $at_status "$at_srcdir/output.at:57"
   12765 $at_failed && at_fn_log_failure
   12766 $at_traceon; }
   12767 
   12768 
   12769 { set +x
   12770 $as_echo "$at_srcdir/output.at:57: ls foo.output foo.tab.c foo.tab.h"
   12771 at_fn_check_prepare_trace "output.at:57"
   12772 ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
   12773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12774 at_status=$? at_failed=false
   12775 $at_check_filter
   12776 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12777 echo stdout:; cat "$at_stdout"
   12778 at_fn_check_status 0 $at_status "$at_srcdir/output.at:57"
   12779 $at_failed && at_fn_log_failure
   12780 $at_traceon; }
   12781 
   12782 
   12783   set +x
   12784   $at_times_p && times >"$at_times_file"
   12785 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12786 read at_status <"$at_status_file"
   12787 #AT_STOP_54
   12788 #AT_START_55
   12789 at_fn_group_banner 55 'output.at:59' \
   12790   "Output files:  -dv -y " "                         " 3
   12791 at_xfail=no
   12792 (
   12793   $as_echo "55. $at_setup_line: testing $at_desc ..."
   12794   $at_traceon
   12795 
   12796 
   12797 for file in foo.y y.output y.tab.c y.tab.h; do
   12798   case "$file" in
   12799     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   12800   esac
   12801 done
   12802 cat >foo.y <<'_ATEOF'
   12803 
   12804 %%
   12805 foo: {};
   12806 _ATEOF
   12807 
   12808 
   12809 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12810   at_save_special_files
   12811   mkdir xml-tests
   12812     # Don't combine these Bison invocations since we want to be sure that
   12813   # --report=all isn't required to get the full XML file.
   12814   { set +x
   12815 $as_echo "$at_srcdir/output.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12816                   --graph=xml-tests/test.dot -dv -y foo.y "
   12817 at_fn_check_prepare_notrace 'an embedded newline' "output.at:59"
   12818 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12819                   --graph=xml-tests/test.dot -dv -y foo.y
   12820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12821 at_status=$? at_failed=false
   12822 $at_check_filter
   12823 echo stderr:; cat "$at_stderr"
   12824 echo stdout:; cat "$at_stdout"
   12825 at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
   12826 $at_failed && at_fn_log_failure
   12827 $at_traceon; }
   12828 
   12829   { set +x
   12830 $as_echo "$at_srcdir/output.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -y foo.y "
   12831 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -y foo.y " "output.at:59"
   12832 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -y foo.y
   12833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12834 at_status=$? at_failed=false
   12835 $at_check_filter
   12836 echo stderr:; cat "$at_stderr"
   12837 echo stdout:; cat "$at_stdout"
   12838 at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
   12839 $at_failed && at_fn_log_failure
   12840 $at_traceon; }
   12841 
   12842     cp xml-tests/test.output expout
   12843   { set +x
   12844 $as_echo "$at_srcdir/output.at:59: \$XSLTPROC \\
   12845              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12846              xml-tests/test.xml"
   12847 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:59"
   12848 ( $at_check_trace; $XSLTPROC \
   12849              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12850              xml-tests/test.xml
   12851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12852 at_status=$? at_failed=false
   12853 $at_check_filter
   12854 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12855 $at_diff expout "$at_stdout" || at_failed=:
   12856 at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
   12857 $at_failed && at_fn_log_failure
   12858 $at_traceon; }
   12859 
   12860   sort xml-tests/test.dot > expout
   12861   { set +x
   12862 $as_echo "$at_srcdir/output.at:59: \$XSLTPROC \\
   12863              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12864              xml-tests/test.xml | sort"
   12865 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:59"
   12866 ( $at_check_trace; $XSLTPROC \
   12867              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12868              xml-tests/test.xml | sort
   12869 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12870 at_status=$? at_failed=false
   12871 $at_check_filter
   12872 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12873 $at_diff expout "$at_stdout" || at_failed=:
   12874 at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
   12875 $at_failed && at_fn_log_failure
   12876 $at_traceon; }
   12877 
   12878   rm -rf xml-tests expout
   12879   at_restore_special_files
   12880 fi
   12881 { set +x
   12882 $as_echo "$at_srcdir/output.at:59: bison -dv -y foo.y "
   12883 at_fn_check_prepare_trace "output.at:59"
   12884 ( $at_check_trace; bison -dv -y foo.y
   12885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12886 at_status=$? at_failed=false
   12887 $at_check_filter
   12888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12889 at_fn_diff_devnull "$at_stdout" || at_failed=:
   12890 at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
   12891 $at_failed && at_fn_log_failure
   12892 $at_traceon; }
   12893 
   12894 
   12895 { set +x
   12896 $as_echo "$at_srcdir/output.at:59: ls y.output y.tab.c y.tab.h"
   12897 at_fn_check_prepare_trace "output.at:59"
   12898 ( $at_check_trace; ls y.output y.tab.c y.tab.h
   12899 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12900 at_status=$? at_failed=false
   12901 $at_check_filter
   12902 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12903 echo stdout:; cat "$at_stdout"
   12904 at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
   12905 $at_failed && at_fn_log_failure
   12906 $at_traceon; }
   12907 
   12908 
   12909   set +x
   12910   $at_times_p && times >"$at_times_file"
   12911 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   12912 read at_status <"$at_status_file"
   12913 #AT_STOP_55
   12914 #AT_START_56
   12915 at_fn_group_banner 56 'output.at:61' \
   12916   "Output files:  -dv -b bar " "                     " 3
   12917 at_xfail=no
   12918 (
   12919   $as_echo "56. $at_setup_line: testing $at_desc ..."
   12920   $at_traceon
   12921 
   12922 
   12923 for file in foo.y bar.output bar.tab.c bar.tab.h; do
   12924   case "$file" in
   12925     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   12926   esac
   12927 done
   12928 cat >foo.y <<'_ATEOF'
   12929 
   12930 %%
   12931 foo: {};
   12932 _ATEOF
   12933 
   12934 
   12935 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   12936   at_save_special_files
   12937   mkdir xml-tests
   12938     # Don't combine these Bison invocations since we want to be sure that
   12939   # --report=all isn't required to get the full XML file.
   12940   { set +x
   12941 $as_echo "$at_srcdir/output.at:61: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   12942                   --graph=xml-tests/test.dot -dv -b bar foo.y "
   12943 at_fn_check_prepare_notrace 'an embedded newline' "output.at:61"
   12944 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   12945                   --graph=xml-tests/test.dot -dv -b bar foo.y
   12946 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12947 at_status=$? at_failed=false
   12948 $at_check_filter
   12949 echo stderr:; cat "$at_stderr"
   12950 echo stdout:; cat "$at_stdout"
   12951 at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
   12952 $at_failed && at_fn_log_failure
   12953 $at_traceon; }
   12954 
   12955   { set +x
   12956 $as_echo "$at_srcdir/output.at:61: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -b bar foo.y "
   12957 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -b bar foo.y " "output.at:61"
   12958 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -b bar foo.y
   12959 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12960 at_status=$? at_failed=false
   12961 $at_check_filter
   12962 echo stderr:; cat "$at_stderr"
   12963 echo stdout:; cat "$at_stdout"
   12964 at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
   12965 $at_failed && at_fn_log_failure
   12966 $at_traceon; }
   12967 
   12968     cp xml-tests/test.output expout
   12969   { set +x
   12970 $as_echo "$at_srcdir/output.at:61: \$XSLTPROC \\
   12971              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   12972              xml-tests/test.xml"
   12973 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:61"
   12974 ( $at_check_trace; $XSLTPROC \
   12975              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   12976              xml-tests/test.xml
   12977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12978 at_status=$? at_failed=false
   12979 $at_check_filter
   12980 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12981 $at_diff expout "$at_stdout" || at_failed=:
   12982 at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
   12983 $at_failed && at_fn_log_failure
   12984 $at_traceon; }
   12985 
   12986   sort xml-tests/test.dot > expout
   12987   { set +x
   12988 $as_echo "$at_srcdir/output.at:61: \$XSLTPROC \\
   12989              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   12990              xml-tests/test.xml | sort"
   12991 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:61"
   12992 ( $at_check_trace; $XSLTPROC \
   12993              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   12994              xml-tests/test.xml | sort
   12995 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   12996 at_status=$? at_failed=false
   12997 $at_check_filter
   12998 at_fn_diff_devnull "$at_stderr" || at_failed=:
   12999 $at_diff expout "$at_stdout" || at_failed=:
   13000 at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
   13001 $at_failed && at_fn_log_failure
   13002 $at_traceon; }
   13003 
   13004   rm -rf xml-tests expout
   13005   at_restore_special_files
   13006 fi
   13007 { set +x
   13008 $as_echo "$at_srcdir/output.at:61: bison -dv -b bar foo.y "
   13009 at_fn_check_prepare_trace "output.at:61"
   13010 ( $at_check_trace; bison -dv -b bar foo.y
   13011 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13012 at_status=$? at_failed=false
   13013 $at_check_filter
   13014 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13015 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13016 at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
   13017 $at_failed && at_fn_log_failure
   13018 $at_traceon; }
   13019 
   13020 
   13021 { set +x
   13022 $as_echo "$at_srcdir/output.at:61: ls bar.output bar.tab.c bar.tab.h"
   13023 at_fn_check_prepare_trace "output.at:61"
   13024 ( $at_check_trace; ls bar.output bar.tab.c bar.tab.h
   13025 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13026 at_status=$? at_failed=false
   13027 $at_check_filter
   13028 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13029 echo stdout:; cat "$at_stdout"
   13030 at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
   13031 $at_failed && at_fn_log_failure
   13032 $at_traceon; }
   13033 
   13034 
   13035   set +x
   13036   $at_times_p && times >"$at_times_file"
   13037 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13038 read at_status <"$at_status_file"
   13039 #AT_STOP_56
   13040 #AT_START_57
   13041 at_fn_group_banner 57 'output.at:63' \
   13042   "Output files:  -dv -g -o foo.c " "                " 3
   13043 at_xfail=no
   13044 (
   13045   $as_echo "57. $at_setup_line: testing $at_desc ..."
   13046   $at_traceon
   13047 
   13048 
   13049 for file in foo.y foo.c foo.dot foo.h foo.output; do
   13050   case "$file" in
   13051     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13052   esac
   13053 done
   13054 cat >foo.y <<'_ATEOF'
   13055 
   13056 %%
   13057 foo: {};
   13058 _ATEOF
   13059 
   13060 
   13061 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13062   at_save_special_files
   13063   mkdir xml-tests
   13064     # Don't combine these Bison invocations since we want to be sure that
   13065   # --report=all isn't required to get the full XML file.
   13066   { set +x
   13067 $as_echo "$at_srcdir/output.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13068                   --graph=xml-tests/test.dot -dv -g -o foo.c foo.y "
   13069 at_fn_check_prepare_notrace 'an embedded newline' "output.at:63"
   13070 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13071                   --graph=xml-tests/test.dot -dv -g -o foo.c foo.y
   13072 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13073 at_status=$? at_failed=false
   13074 $at_check_filter
   13075 echo stderr:; cat "$at_stderr"
   13076 echo stdout:; cat "$at_stdout"
   13077 at_fn_check_status 0 $at_status "$at_srcdir/output.at:63"
   13078 $at_failed && at_fn_log_failure
   13079 $at_traceon; }
   13080 
   13081   { set +x
   13082 $as_echo "$at_srcdir/output.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y "
   13083 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y " "output.at:63"
   13084 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y
   13085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13086 at_status=$? at_failed=false
   13087 $at_check_filter
   13088 echo stderr:; cat "$at_stderr"
   13089 echo stdout:; cat "$at_stdout"
   13090 at_fn_check_status 0 $at_status "$at_srcdir/output.at:63"
   13091 $at_failed && at_fn_log_failure
   13092 $at_traceon; }
   13093 
   13094     cp xml-tests/test.output expout
   13095   { set +x
   13096 $as_echo "$at_srcdir/output.at:63: \$XSLTPROC \\
   13097              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13098              xml-tests/test.xml"
   13099 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:63"
   13100 ( $at_check_trace; $XSLTPROC \
   13101              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13102              xml-tests/test.xml
   13103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13104 at_status=$? at_failed=false
   13105 $at_check_filter
   13106 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13107 $at_diff expout "$at_stdout" || at_failed=:
   13108 at_fn_check_status 0 $at_status "$at_srcdir/output.at:63"
   13109 $at_failed && at_fn_log_failure
   13110 $at_traceon; }
   13111 
   13112   sort xml-tests/test.dot > expout
   13113   { set +x
   13114 $as_echo "$at_srcdir/output.at:63: \$XSLTPROC \\
   13115              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13116              xml-tests/test.xml | sort"
   13117 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:63"
   13118 ( $at_check_trace; $XSLTPROC \
   13119              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13120              xml-tests/test.xml | sort
   13121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13122 at_status=$? at_failed=false
   13123 $at_check_filter
   13124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13125 $at_diff expout "$at_stdout" || at_failed=:
   13126 at_fn_check_status 0 $at_status "$at_srcdir/output.at:63"
   13127 $at_failed && at_fn_log_failure
   13128 $at_traceon; }
   13129 
   13130   rm -rf xml-tests expout
   13131   at_restore_special_files
   13132 fi
   13133 { set +x
   13134 $as_echo "$at_srcdir/output.at:63: bison -dv -g -o foo.c foo.y "
   13135 at_fn_check_prepare_trace "output.at:63"
   13136 ( $at_check_trace; bison -dv -g -o foo.c foo.y
   13137 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13138 at_status=$? at_failed=false
   13139 $at_check_filter
   13140 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13141 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13142 at_fn_check_status 0 $at_status "$at_srcdir/output.at:63"
   13143 $at_failed && at_fn_log_failure
   13144 $at_traceon; }
   13145 
   13146 
   13147 { set +x
   13148 $as_echo "$at_srcdir/output.at:63: ls foo.c foo.dot foo.h foo.output"
   13149 at_fn_check_prepare_trace "output.at:63"
   13150 ( $at_check_trace; ls foo.c foo.dot foo.h foo.output
   13151 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13152 at_status=$? at_failed=false
   13153 $at_check_filter
   13154 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13155 echo stdout:; cat "$at_stdout"
   13156 at_fn_check_status 0 $at_status "$at_srcdir/output.at:63"
   13157 $at_failed && at_fn_log_failure
   13158 $at_traceon; }
   13159 
   13160 
   13161   set +x
   13162   $at_times_p && times >"$at_times_file"
   13163 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13164 read at_status <"$at_status_file"
   13165 #AT_STOP_57
   13166 #AT_START_58
   13167 at_fn_group_banner 58 'output.at:67' \
   13168   "Output files: %defines %verbose  " "              " 3
   13169 at_xfail=no
   13170 (
   13171   $as_echo "58. $at_setup_line: testing $at_desc ..."
   13172   $at_traceon
   13173 
   13174 
   13175 for file in foo.y foo.output foo.tab.c foo.tab.h; do
   13176   case "$file" in
   13177     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13178   esac
   13179 done
   13180 cat >foo.y <<'_ATEOF'
   13181 %defines %verbose
   13182 %%
   13183 foo: {};
   13184 _ATEOF
   13185 
   13186 
   13187 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13188   at_save_special_files
   13189   mkdir xml-tests
   13190     # Don't combine these Bison invocations since we want to be sure that
   13191   # --report=all isn't required to get the full XML file.
   13192   { set +x
   13193 $as_echo "$at_srcdir/output.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13194                   --graph=xml-tests/test.dot  foo.y "
   13195 at_fn_check_prepare_notrace 'an embedded newline' "output.at:67"
   13196 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13197                   --graph=xml-tests/test.dot  foo.y
   13198 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13199 at_status=$? at_failed=false
   13200 $at_check_filter
   13201 echo stderr:; cat "$at_stderr"
   13202 echo stdout:; cat "$at_stdout"
   13203 at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
   13204 $at_failed && at_fn_log_failure
   13205 $at_traceon; }
   13206 
   13207   { set +x
   13208 $as_echo "$at_srcdir/output.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y "
   13209 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y " "output.at:67"
   13210 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y
   13211 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13212 at_status=$? at_failed=false
   13213 $at_check_filter
   13214 echo stderr:; cat "$at_stderr"
   13215 echo stdout:; cat "$at_stdout"
   13216 at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
   13217 $at_failed && at_fn_log_failure
   13218 $at_traceon; }
   13219 
   13220     cp xml-tests/test.output expout
   13221   { set +x
   13222 $as_echo "$at_srcdir/output.at:67: \$XSLTPROC \\
   13223              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13224              xml-tests/test.xml"
   13225 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:67"
   13226 ( $at_check_trace; $XSLTPROC \
   13227              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13228              xml-tests/test.xml
   13229 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13230 at_status=$? at_failed=false
   13231 $at_check_filter
   13232 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13233 $at_diff expout "$at_stdout" || at_failed=:
   13234 at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
   13235 $at_failed && at_fn_log_failure
   13236 $at_traceon; }
   13237 
   13238   sort xml-tests/test.dot > expout
   13239   { set +x
   13240 $as_echo "$at_srcdir/output.at:67: \$XSLTPROC \\
   13241              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13242              xml-tests/test.xml | sort"
   13243 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:67"
   13244 ( $at_check_trace; $XSLTPROC \
   13245              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13246              xml-tests/test.xml | sort
   13247 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13248 at_status=$? at_failed=false
   13249 $at_check_filter
   13250 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13251 $at_diff expout "$at_stdout" || at_failed=:
   13252 at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
   13253 $at_failed && at_fn_log_failure
   13254 $at_traceon; }
   13255 
   13256   rm -rf xml-tests expout
   13257   at_restore_special_files
   13258 fi
   13259 { set +x
   13260 $as_echo "$at_srcdir/output.at:67: bison  foo.y "
   13261 at_fn_check_prepare_trace "output.at:67"
   13262 ( $at_check_trace; bison  foo.y
   13263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13264 at_status=$? at_failed=false
   13265 $at_check_filter
   13266 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13267 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13268 at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
   13269 $at_failed && at_fn_log_failure
   13270 $at_traceon; }
   13271 
   13272 
   13273 { set +x
   13274 $as_echo "$at_srcdir/output.at:67: ls foo.output foo.tab.c foo.tab.h"
   13275 at_fn_check_prepare_trace "output.at:67"
   13276 ( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
   13277 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13278 at_status=$? at_failed=false
   13279 $at_check_filter
   13280 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13281 echo stdout:; cat "$at_stdout"
   13282 at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
   13283 $at_failed && at_fn_log_failure
   13284 $at_traceon; }
   13285 
   13286 
   13287   set +x
   13288   $at_times_p && times >"$at_times_file"
   13289 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13290 read at_status <"$at_status_file"
   13291 #AT_STOP_58
   13292 #AT_START_59
   13293 at_fn_group_banner 59 'output.at:69' \
   13294   "Output files: %defines %verbose %yacc  " "        " 3
   13295 at_xfail=no
   13296 (
   13297   $as_echo "59. $at_setup_line: testing $at_desc ..."
   13298   $at_traceon
   13299 
   13300 
   13301 for file in foo.y y.output y.tab.c y.tab.h; do
   13302   case "$file" in
   13303     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13304   esac
   13305 done
   13306 cat >foo.y <<'_ATEOF'
   13307 %defines %verbose %yacc
   13308 %%
   13309 foo: {};
   13310 _ATEOF
   13311 
   13312 
   13313 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13314   at_save_special_files
   13315   mkdir xml-tests
   13316     # Don't combine these Bison invocations since we want to be sure that
   13317   # --report=all isn't required to get the full XML file.
   13318   { set +x
   13319 $as_echo "$at_srcdir/output.at:69: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13320                   --graph=xml-tests/test.dot  foo.y "
   13321 at_fn_check_prepare_notrace 'an embedded newline' "output.at:69"
   13322 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13323                   --graph=xml-tests/test.dot  foo.y
   13324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13325 at_status=$? at_failed=false
   13326 $at_check_filter
   13327 echo stderr:; cat "$at_stderr"
   13328 echo stdout:; cat "$at_stdout"
   13329 at_fn_check_status 0 $at_status "$at_srcdir/output.at:69"
   13330 $at_failed && at_fn_log_failure
   13331 $at_traceon; }
   13332 
   13333   { set +x
   13334 $as_echo "$at_srcdir/output.at:69: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y "
   13335 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y " "output.at:69"
   13336 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y
   13337 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13338 at_status=$? at_failed=false
   13339 $at_check_filter
   13340 echo stderr:; cat "$at_stderr"
   13341 echo stdout:; cat "$at_stdout"
   13342 at_fn_check_status 0 $at_status "$at_srcdir/output.at:69"
   13343 $at_failed && at_fn_log_failure
   13344 $at_traceon; }
   13345 
   13346     cp xml-tests/test.output expout
   13347   { set +x
   13348 $as_echo "$at_srcdir/output.at:69: \$XSLTPROC \\
   13349              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13350              xml-tests/test.xml"
   13351 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:69"
   13352 ( $at_check_trace; $XSLTPROC \
   13353              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13354              xml-tests/test.xml
   13355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13356 at_status=$? at_failed=false
   13357 $at_check_filter
   13358 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13359 $at_diff expout "$at_stdout" || at_failed=:
   13360 at_fn_check_status 0 $at_status "$at_srcdir/output.at:69"
   13361 $at_failed && at_fn_log_failure
   13362 $at_traceon; }
   13363 
   13364   sort xml-tests/test.dot > expout
   13365   { set +x
   13366 $as_echo "$at_srcdir/output.at:69: \$XSLTPROC \\
   13367              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13368              xml-tests/test.xml | sort"
   13369 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:69"
   13370 ( $at_check_trace; $XSLTPROC \
   13371              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13372              xml-tests/test.xml | sort
   13373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13374 at_status=$? at_failed=false
   13375 $at_check_filter
   13376 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13377 $at_diff expout "$at_stdout" || at_failed=:
   13378 at_fn_check_status 0 $at_status "$at_srcdir/output.at:69"
   13379 $at_failed && at_fn_log_failure
   13380 $at_traceon; }
   13381 
   13382   rm -rf xml-tests expout
   13383   at_restore_special_files
   13384 fi
   13385 { set +x
   13386 $as_echo "$at_srcdir/output.at:69: bison  foo.y "
   13387 at_fn_check_prepare_trace "output.at:69"
   13388 ( $at_check_trace; bison  foo.y
   13389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13390 at_status=$? at_failed=false
   13391 $at_check_filter
   13392 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13393 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13394 at_fn_check_status 0 $at_status "$at_srcdir/output.at:69"
   13395 $at_failed && at_fn_log_failure
   13396 $at_traceon; }
   13397 
   13398 
   13399 { set +x
   13400 $as_echo "$at_srcdir/output.at:69: ls y.output y.tab.c y.tab.h"
   13401 at_fn_check_prepare_trace "output.at:69"
   13402 ( $at_check_trace; ls y.output y.tab.c y.tab.h
   13403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13404 at_status=$? at_failed=false
   13405 $at_check_filter
   13406 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13407 echo stdout:; cat "$at_stdout"
   13408 at_fn_check_status 0 $at_status "$at_srcdir/output.at:69"
   13409 $at_failed && at_fn_log_failure
   13410 $at_traceon; }
   13411 
   13412 
   13413   set +x
   13414   $at_times_p && times >"$at_times_file"
   13415 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13416 read at_status <"$at_status_file"
   13417 #AT_STOP_59
   13418 #AT_START_60
   13419 at_fn_group_banner 60 'output.at:72' \
   13420   "Output files: %defines %verbose %yacc  " "        " 3
   13421 at_xfail=no
   13422 (
   13423   $as_echo "60. $at_setup_line: testing $at_desc ..."
   13424   $at_traceon
   13425 
   13426 
   13427 for file in foo.yy y.output y.tab.c y.tab.h; do
   13428   case "$file" in
   13429     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13430   esac
   13431 done
   13432 cat >foo.yy <<'_ATEOF'
   13433 %defines %verbose %yacc
   13434 %%
   13435 foo: {};
   13436 _ATEOF
   13437 
   13438 
   13439 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13440   at_save_special_files
   13441   mkdir xml-tests
   13442     # Don't combine these Bison invocations since we want to be sure that
   13443   # --report=all isn't required to get the full XML file.
   13444   { set +x
   13445 $as_echo "$at_srcdir/output.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13446                   --graph=xml-tests/test.dot  foo.yy "
   13447 at_fn_check_prepare_notrace 'an embedded newline' "output.at:72"
   13448 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13449                   --graph=xml-tests/test.dot  foo.yy
   13450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13451 at_status=$? at_failed=false
   13452 $at_check_filter
   13453 echo stderr:; cat "$at_stderr"
   13454 echo stdout:; cat "$at_stdout"
   13455 at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
   13456 $at_failed && at_fn_log_failure
   13457 $at_traceon; }
   13458 
   13459   { set +x
   13460 $as_echo "$at_srcdir/output.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy "
   13461 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy " "output.at:72"
   13462 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy
   13463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13464 at_status=$? at_failed=false
   13465 $at_check_filter
   13466 echo stderr:; cat "$at_stderr"
   13467 echo stdout:; cat "$at_stdout"
   13468 at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
   13469 $at_failed && at_fn_log_failure
   13470 $at_traceon; }
   13471 
   13472     cp xml-tests/test.output expout
   13473   { set +x
   13474 $as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\
   13475              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13476              xml-tests/test.xml"
   13477 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72"
   13478 ( $at_check_trace; $XSLTPROC \
   13479              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13480              xml-tests/test.xml
   13481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13482 at_status=$? at_failed=false
   13483 $at_check_filter
   13484 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13485 $at_diff expout "$at_stdout" || at_failed=:
   13486 at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
   13487 $at_failed && at_fn_log_failure
   13488 $at_traceon; }
   13489 
   13490   sort xml-tests/test.dot > expout
   13491   { set +x
   13492 $as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\
   13493              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13494              xml-tests/test.xml | sort"
   13495 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72"
   13496 ( $at_check_trace; $XSLTPROC \
   13497              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13498              xml-tests/test.xml | sort
   13499 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13500 at_status=$? at_failed=false
   13501 $at_check_filter
   13502 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13503 $at_diff expout "$at_stdout" || at_failed=:
   13504 at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
   13505 $at_failed && at_fn_log_failure
   13506 $at_traceon; }
   13507 
   13508   rm -rf xml-tests expout
   13509   at_restore_special_files
   13510 fi
   13511 { set +x
   13512 $as_echo "$at_srcdir/output.at:72: bison  foo.yy "
   13513 at_fn_check_prepare_trace "output.at:72"
   13514 ( $at_check_trace; bison  foo.yy
   13515 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13516 at_status=$? at_failed=false
   13517 $at_check_filter
   13518 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13519 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13520 at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
   13521 $at_failed && at_fn_log_failure
   13522 $at_traceon; }
   13523 
   13524 
   13525 { set +x
   13526 $as_echo "$at_srcdir/output.at:72: ls y.output y.tab.c y.tab.h"
   13527 at_fn_check_prepare_trace "output.at:72"
   13528 ( $at_check_trace; ls y.output y.tab.c y.tab.h
   13529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13530 at_status=$? at_failed=false
   13531 $at_check_filter
   13532 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13533 echo stdout:; cat "$at_stdout"
   13534 at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
   13535 $at_failed && at_fn_log_failure
   13536 $at_traceon; }
   13537 
   13538 
   13539   set +x
   13540   $at_times_p && times >"$at_times_file"
   13541 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13542 read at_status <"$at_status_file"
   13543 #AT_STOP_60
   13544 #AT_START_61
   13545 at_fn_group_banner 61 'output.at:76' \
   13546   "Output files: %file-prefix \"bar\" %defines %verbose  " "" 3
   13547 at_xfail=no
   13548 (
   13549   $as_echo "61. $at_setup_line: testing $at_desc ..."
   13550   $at_traceon
   13551 
   13552 
   13553 for file in foo.y bar.output bar.tab.c bar.tab.h; do
   13554   case "$file" in
   13555     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13556   esac
   13557 done
   13558 cat >foo.y <<'_ATEOF'
   13559 %file-prefix "bar" %defines %verbose
   13560 %%
   13561 foo: {};
   13562 _ATEOF
   13563 
   13564 
   13565 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13566   at_save_special_files
   13567   mkdir xml-tests
   13568     # Don't combine these Bison invocations since we want to be sure that
   13569   # --report=all isn't required to get the full XML file.
   13570   { set +x
   13571 $as_echo "$at_srcdir/output.at:76: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13572                   --graph=xml-tests/test.dot  foo.y "
   13573 at_fn_check_prepare_notrace 'an embedded newline' "output.at:76"
   13574 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13575                   --graph=xml-tests/test.dot  foo.y
   13576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13577 at_status=$? at_failed=false
   13578 $at_check_filter
   13579 echo stderr:; cat "$at_stderr"
   13580 echo stdout:; cat "$at_stdout"
   13581 at_fn_check_status 0 $at_status "$at_srcdir/output.at:76"
   13582 $at_failed && at_fn_log_failure
   13583 $at_traceon; }
   13584 
   13585   { set +x
   13586 $as_echo "$at_srcdir/output.at:76: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y "
   13587 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y " "output.at:76"
   13588 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y
   13589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13590 at_status=$? at_failed=false
   13591 $at_check_filter
   13592 echo stderr:; cat "$at_stderr"
   13593 echo stdout:; cat "$at_stdout"
   13594 at_fn_check_status 0 $at_status "$at_srcdir/output.at:76"
   13595 $at_failed && at_fn_log_failure
   13596 $at_traceon; }
   13597 
   13598     cp xml-tests/test.output expout
   13599   { set +x
   13600 $as_echo "$at_srcdir/output.at:76: \$XSLTPROC \\
   13601              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13602              xml-tests/test.xml"
   13603 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:76"
   13604 ( $at_check_trace; $XSLTPROC \
   13605              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13606              xml-tests/test.xml
   13607 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13608 at_status=$? at_failed=false
   13609 $at_check_filter
   13610 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13611 $at_diff expout "$at_stdout" || at_failed=:
   13612 at_fn_check_status 0 $at_status "$at_srcdir/output.at:76"
   13613 $at_failed && at_fn_log_failure
   13614 $at_traceon; }
   13615 
   13616   sort xml-tests/test.dot > expout
   13617   { set +x
   13618 $as_echo "$at_srcdir/output.at:76: \$XSLTPROC \\
   13619              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13620              xml-tests/test.xml | sort"
   13621 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:76"
   13622 ( $at_check_trace; $XSLTPROC \
   13623              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13624              xml-tests/test.xml | sort
   13625 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13626 at_status=$? at_failed=false
   13627 $at_check_filter
   13628 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13629 $at_diff expout "$at_stdout" || at_failed=:
   13630 at_fn_check_status 0 $at_status "$at_srcdir/output.at:76"
   13631 $at_failed && at_fn_log_failure
   13632 $at_traceon; }
   13633 
   13634   rm -rf xml-tests expout
   13635   at_restore_special_files
   13636 fi
   13637 { set +x
   13638 $as_echo "$at_srcdir/output.at:76: bison  foo.y "
   13639 at_fn_check_prepare_trace "output.at:76"
   13640 ( $at_check_trace; bison  foo.y
   13641 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13642 at_status=$? at_failed=false
   13643 $at_check_filter
   13644 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13645 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13646 at_fn_check_status 0 $at_status "$at_srcdir/output.at:76"
   13647 $at_failed && at_fn_log_failure
   13648 $at_traceon; }
   13649 
   13650 
   13651 { set +x
   13652 $as_echo "$at_srcdir/output.at:76: ls bar.output bar.tab.c bar.tab.h"
   13653 at_fn_check_prepare_trace "output.at:76"
   13654 ( $at_check_trace; ls bar.output bar.tab.c bar.tab.h
   13655 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13656 at_status=$? at_failed=false
   13657 $at_check_filter
   13658 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13659 echo stdout:; cat "$at_stdout"
   13660 at_fn_check_status 0 $at_status "$at_srcdir/output.at:76"
   13661 $at_failed && at_fn_log_failure
   13662 $at_traceon; }
   13663 
   13664 
   13665   set +x
   13666   $at_times_p && times >"$at_times_file"
   13667 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13668 read at_status <"$at_status_file"
   13669 #AT_STOP_61
   13670 #AT_START_62
   13671 at_fn_group_banner 62 'output.at:78' \
   13672   "Output files: %output=\"bar.c\" %defines %verbose %yacc  " "" 3
   13673 at_xfail=no
   13674 (
   13675   $as_echo "62. $at_setup_line: testing $at_desc ..."
   13676   $at_traceon
   13677 
   13678 
   13679 for file in foo.y bar.output bar.c bar.h; do
   13680   case "$file" in
   13681     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13682   esac
   13683 done
   13684 cat >foo.y <<'_ATEOF'
   13685 %output="bar.c" %defines %verbose %yacc
   13686 %%
   13687 foo: {};
   13688 _ATEOF
   13689 
   13690 
   13691 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13692   at_save_special_files
   13693   mkdir xml-tests
   13694     # Don't combine these Bison invocations since we want to be sure that
   13695   # --report=all isn't required to get the full XML file.
   13696   { set +x
   13697 $as_echo "$at_srcdir/output.at:78: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13698                   --graph=xml-tests/test.dot  foo.y "
   13699 at_fn_check_prepare_notrace 'an embedded newline' "output.at:78"
   13700 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13701                   --graph=xml-tests/test.dot  foo.y
   13702 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13703 at_status=$? at_failed=false
   13704 $at_check_filter
   13705 echo stderr:; cat "$at_stderr"
   13706 echo stdout:; cat "$at_stdout"
   13707 at_fn_check_status 0 $at_status "$at_srcdir/output.at:78"
   13708 $at_failed && at_fn_log_failure
   13709 $at_traceon; }
   13710 
   13711   { set +x
   13712 $as_echo "$at_srcdir/output.at:78: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y "
   13713 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y " "output.at:78"
   13714 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y
   13715 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13716 at_status=$? at_failed=false
   13717 $at_check_filter
   13718 echo stderr:; cat "$at_stderr"
   13719 echo stdout:; cat "$at_stdout"
   13720 at_fn_check_status 0 $at_status "$at_srcdir/output.at:78"
   13721 $at_failed && at_fn_log_failure
   13722 $at_traceon; }
   13723 
   13724     cp xml-tests/test.output expout
   13725   { set +x
   13726 $as_echo "$at_srcdir/output.at:78: \$XSLTPROC \\
   13727              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13728              xml-tests/test.xml"
   13729 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:78"
   13730 ( $at_check_trace; $XSLTPROC \
   13731              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13732              xml-tests/test.xml
   13733 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13734 at_status=$? at_failed=false
   13735 $at_check_filter
   13736 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13737 $at_diff expout "$at_stdout" || at_failed=:
   13738 at_fn_check_status 0 $at_status "$at_srcdir/output.at:78"
   13739 $at_failed && at_fn_log_failure
   13740 $at_traceon; }
   13741 
   13742   sort xml-tests/test.dot > expout
   13743   { set +x
   13744 $as_echo "$at_srcdir/output.at:78: \$XSLTPROC \\
   13745              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13746              xml-tests/test.xml | sort"
   13747 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:78"
   13748 ( $at_check_trace; $XSLTPROC \
   13749              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13750              xml-tests/test.xml | sort
   13751 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13752 at_status=$? at_failed=false
   13753 $at_check_filter
   13754 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13755 $at_diff expout "$at_stdout" || at_failed=:
   13756 at_fn_check_status 0 $at_status "$at_srcdir/output.at:78"
   13757 $at_failed && at_fn_log_failure
   13758 $at_traceon; }
   13759 
   13760   rm -rf xml-tests expout
   13761   at_restore_special_files
   13762 fi
   13763 { set +x
   13764 $as_echo "$at_srcdir/output.at:78: bison  foo.y "
   13765 at_fn_check_prepare_trace "output.at:78"
   13766 ( $at_check_trace; bison  foo.y
   13767 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13768 at_status=$? at_failed=false
   13769 $at_check_filter
   13770 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13771 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13772 at_fn_check_status 0 $at_status "$at_srcdir/output.at:78"
   13773 $at_failed && at_fn_log_failure
   13774 $at_traceon; }
   13775 
   13776 
   13777 { set +x
   13778 $as_echo "$at_srcdir/output.at:78: ls bar.output bar.c bar.h"
   13779 at_fn_check_prepare_trace "output.at:78"
   13780 ( $at_check_trace; ls bar.output bar.c bar.h
   13781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13782 at_status=$? at_failed=false
   13783 $at_check_filter
   13784 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13785 echo stdout:; cat "$at_stdout"
   13786 at_fn_check_status 0 $at_status "$at_srcdir/output.at:78"
   13787 $at_failed && at_fn_log_failure
   13788 $at_traceon; }
   13789 
   13790 
   13791   set +x
   13792   $at_times_p && times >"$at_times_file"
   13793 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13794 read at_status <"$at_status_file"
   13795 #AT_STOP_62
   13796 #AT_START_63
   13797 at_fn_group_banner 63 'output.at:80' \
   13798   "Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc  " "" 3
   13799 at_xfail=no
   13800 (
   13801   $as_echo "63. $at_setup_line: testing $at_desc ..."
   13802   $at_traceon
   13803 
   13804 
   13805 for file in foo.y bar.output bar.c bar.h; do
   13806   case "$file" in
   13807     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13808   esac
   13809 done
   13810 cat >foo.y <<'_ATEOF'
   13811 %file-prefix="baz" %output "bar.c" %defines %verbose %yacc
   13812 %%
   13813 foo: {};
   13814 _ATEOF
   13815 
   13816 
   13817 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13818   at_save_special_files
   13819   mkdir xml-tests
   13820     # Don't combine these Bison invocations since we want to be sure that
   13821   # --report=all isn't required to get the full XML file.
   13822   { set +x
   13823 $as_echo "$at_srcdir/output.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13824                   --graph=xml-tests/test.dot  foo.y "
   13825 at_fn_check_prepare_notrace 'an embedded newline' "output.at:80"
   13826 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13827                   --graph=xml-tests/test.dot  foo.y
   13828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13829 at_status=$? at_failed=false
   13830 $at_check_filter
   13831 echo stderr:; cat "$at_stderr"
   13832 echo stdout:; cat "$at_stdout"
   13833 at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
   13834 $at_failed && at_fn_log_failure
   13835 $at_traceon; }
   13836 
   13837   { set +x
   13838 $as_echo "$at_srcdir/output.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y "
   13839 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y " "output.at:80"
   13840 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.y
   13841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13842 at_status=$? at_failed=false
   13843 $at_check_filter
   13844 echo stderr:; cat "$at_stderr"
   13845 echo stdout:; cat "$at_stdout"
   13846 at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
   13847 $at_failed && at_fn_log_failure
   13848 $at_traceon; }
   13849 
   13850     cp xml-tests/test.output expout
   13851   { set +x
   13852 $as_echo "$at_srcdir/output.at:80: \$XSLTPROC \\
   13853              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13854              xml-tests/test.xml"
   13855 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:80"
   13856 ( $at_check_trace; $XSLTPROC \
   13857              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13858              xml-tests/test.xml
   13859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13860 at_status=$? at_failed=false
   13861 $at_check_filter
   13862 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13863 $at_diff expout "$at_stdout" || at_failed=:
   13864 at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
   13865 $at_failed && at_fn_log_failure
   13866 $at_traceon; }
   13867 
   13868   sort xml-tests/test.dot > expout
   13869   { set +x
   13870 $as_echo "$at_srcdir/output.at:80: \$XSLTPROC \\
   13871              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13872              xml-tests/test.xml | sort"
   13873 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:80"
   13874 ( $at_check_trace; $XSLTPROC \
   13875              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   13876              xml-tests/test.xml | sort
   13877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13878 at_status=$? at_failed=false
   13879 $at_check_filter
   13880 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13881 $at_diff expout "$at_stdout" || at_failed=:
   13882 at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
   13883 $at_failed && at_fn_log_failure
   13884 $at_traceon; }
   13885 
   13886   rm -rf xml-tests expout
   13887   at_restore_special_files
   13888 fi
   13889 { set +x
   13890 $as_echo "$at_srcdir/output.at:80: bison  foo.y "
   13891 at_fn_check_prepare_trace "output.at:80"
   13892 ( $at_check_trace; bison  foo.y
   13893 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13894 at_status=$? at_failed=false
   13895 $at_check_filter
   13896 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13897 at_fn_diff_devnull "$at_stdout" || at_failed=:
   13898 at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
   13899 $at_failed && at_fn_log_failure
   13900 $at_traceon; }
   13901 
   13902 
   13903 { set +x
   13904 $as_echo "$at_srcdir/output.at:80: ls bar.output bar.c bar.h"
   13905 at_fn_check_prepare_trace "output.at:80"
   13906 ( $at_check_trace; ls bar.output bar.c bar.h
   13907 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13908 at_status=$? at_failed=false
   13909 $at_check_filter
   13910 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13911 echo stdout:; cat "$at_stdout"
   13912 at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
   13913 $at_failed && at_fn_log_failure
   13914 $at_traceon; }
   13915 
   13916 
   13917   set +x
   13918   $at_times_p && times >"$at_times_file"
   13919 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   13920 read at_status <"$at_status_file"
   13921 #AT_STOP_63
   13922 #AT_START_64
   13923 at_fn_group_banner 64 'output.at:87' \
   13924   "Output files: %defines %verbose  " "              " 3
   13925 at_xfail=no
   13926 (
   13927   $as_echo "64. $at_setup_line: testing $at_desc ..."
   13928   $at_traceon
   13929 
   13930 
   13931 for file in foo.yy foo.output foo.tab.cc foo.tab.hh; do
   13932   case "$file" in
   13933     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   13934   esac
   13935 done
   13936 cat >foo.yy <<'_ATEOF'
   13937 %defines %verbose
   13938 %%
   13939 foo: {};
   13940 _ATEOF
   13941 
   13942 
   13943 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   13944   at_save_special_files
   13945   mkdir xml-tests
   13946     # Don't combine these Bison invocations since we want to be sure that
   13947   # --report=all isn't required to get the full XML file.
   13948   { set +x
   13949 $as_echo "$at_srcdir/output.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   13950                   --graph=xml-tests/test.dot  foo.yy "
   13951 at_fn_check_prepare_notrace 'an embedded newline' "output.at:87"
   13952 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   13953                   --graph=xml-tests/test.dot  foo.yy
   13954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13955 at_status=$? at_failed=false
   13956 $at_check_filter
   13957 echo stderr:; cat "$at_stderr"
   13958 echo stdout:; cat "$at_stdout"
   13959 at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
   13960 $at_failed && at_fn_log_failure
   13961 $at_traceon; }
   13962 
   13963   { set +x
   13964 $as_echo "$at_srcdir/output.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy "
   13965 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy " "output.at:87"
   13966 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy
   13967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13968 at_status=$? at_failed=false
   13969 $at_check_filter
   13970 echo stderr:; cat "$at_stderr"
   13971 echo stdout:; cat "$at_stdout"
   13972 at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
   13973 $at_failed && at_fn_log_failure
   13974 $at_traceon; }
   13975 
   13976     cp xml-tests/test.output expout
   13977   { set +x
   13978 $as_echo "$at_srcdir/output.at:87: \$XSLTPROC \\
   13979              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   13980              xml-tests/test.xml"
   13981 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:87"
   13982 ( $at_check_trace; $XSLTPROC \
   13983              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   13984              xml-tests/test.xml
   13985 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   13986 at_status=$? at_failed=false
   13987 $at_check_filter
   13988 at_fn_diff_devnull "$at_stderr" || at_failed=:
   13989 $at_diff expout "$at_stdout" || at_failed=:
   13990 at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
   13991 $at_failed && at_fn_log_failure
   13992 $at_traceon; }
   13993 
   13994   sort xml-tests/test.dot > expout
   13995   { set +x
   13996 $as_echo "$at_srcdir/output.at:87: \$XSLTPROC \\
   13997              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   13998              xml-tests/test.xml | sort"
   13999 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:87"
   14000 ( $at_check_trace; $XSLTPROC \
   14001              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14002              xml-tests/test.xml | sort
   14003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14004 at_status=$? at_failed=false
   14005 $at_check_filter
   14006 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14007 $at_diff expout "$at_stdout" || at_failed=:
   14008 at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
   14009 $at_failed && at_fn_log_failure
   14010 $at_traceon; }
   14011 
   14012   rm -rf xml-tests expout
   14013   at_restore_special_files
   14014 fi
   14015 { set +x
   14016 $as_echo "$at_srcdir/output.at:87: bison  foo.yy "
   14017 at_fn_check_prepare_trace "output.at:87"
   14018 ( $at_check_trace; bison  foo.yy
   14019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14020 at_status=$? at_failed=false
   14021 $at_check_filter
   14022 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14023 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14024 at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
   14025 $at_failed && at_fn_log_failure
   14026 $at_traceon; }
   14027 
   14028 
   14029 { set +x
   14030 $as_echo "$at_srcdir/output.at:87: ls foo.output foo.tab.cc foo.tab.hh"
   14031 at_fn_check_prepare_trace "output.at:87"
   14032 ( $at_check_trace; ls foo.output foo.tab.cc foo.tab.hh
   14033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14034 at_status=$? at_failed=false
   14035 $at_check_filter
   14036 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14037 echo stdout:; cat "$at_stdout"
   14038 at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
   14039 $at_failed && at_fn_log_failure
   14040 $at_traceon; }
   14041 
   14042 
   14043   set +x
   14044   $at_times_p && times >"$at_times_file"
   14045 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14046 read at_status <"$at_status_file"
   14047 #AT_STOP_64
   14048 #AT_START_65
   14049 at_fn_group_banner 65 'output.at:90' \
   14050   "Output files: %defines %verbose  -o foo.c " "     " 3
   14051 at_xfail=no
   14052 (
   14053   $as_echo "65. $at_setup_line: testing $at_desc ..."
   14054   $at_traceon
   14055 
   14056 
   14057 for file in foo.yy foo.c foo.h foo.output; do
   14058   case "$file" in
   14059     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14060   esac
   14061 done
   14062 cat >foo.yy <<'_ATEOF'
   14063 %defines %verbose
   14064 %%
   14065 foo: {};
   14066 _ATEOF
   14067 
   14068 
   14069 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14070   at_save_special_files
   14071   mkdir xml-tests
   14072     # Don't combine these Bison invocations since we want to be sure that
   14073   # --report=all isn't required to get the full XML file.
   14074   { set +x
   14075 $as_echo "$at_srcdir/output.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14076                   --graph=xml-tests/test.dot -o foo.c foo.yy "
   14077 at_fn_check_prepare_notrace 'an embedded newline' "output.at:90"
   14078 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14079                   --graph=xml-tests/test.dot -o foo.c foo.yy
   14080 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14081 at_status=$? at_failed=false
   14082 $at_check_filter
   14083 echo stderr:; cat "$at_stderr"
   14084 echo stdout:; cat "$at_stdout"
   14085 at_fn_check_status 0 $at_status "$at_srcdir/output.at:90"
   14086 $at_failed && at_fn_log_failure
   14087 $at_traceon; }
   14088 
   14089   { set +x
   14090 $as_echo "$at_srcdir/output.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c foo.yy "
   14091 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c foo.yy " "output.at:90"
   14092 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c foo.yy
   14093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14094 at_status=$? at_failed=false
   14095 $at_check_filter
   14096 echo stderr:; cat "$at_stderr"
   14097 echo stdout:; cat "$at_stdout"
   14098 at_fn_check_status 0 $at_status "$at_srcdir/output.at:90"
   14099 $at_failed && at_fn_log_failure
   14100 $at_traceon; }
   14101 
   14102     cp xml-tests/test.output expout
   14103   { set +x
   14104 $as_echo "$at_srcdir/output.at:90: \$XSLTPROC \\
   14105              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14106              xml-tests/test.xml"
   14107 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:90"
   14108 ( $at_check_trace; $XSLTPROC \
   14109              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14110              xml-tests/test.xml
   14111 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14112 at_status=$? at_failed=false
   14113 $at_check_filter
   14114 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14115 $at_diff expout "$at_stdout" || at_failed=:
   14116 at_fn_check_status 0 $at_status "$at_srcdir/output.at:90"
   14117 $at_failed && at_fn_log_failure
   14118 $at_traceon; }
   14119 
   14120   sort xml-tests/test.dot > expout
   14121   { set +x
   14122 $as_echo "$at_srcdir/output.at:90: \$XSLTPROC \\
   14123              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14124              xml-tests/test.xml | sort"
   14125 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:90"
   14126 ( $at_check_trace; $XSLTPROC \
   14127              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14128              xml-tests/test.xml | sort
   14129 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14130 at_status=$? at_failed=false
   14131 $at_check_filter
   14132 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14133 $at_diff expout "$at_stdout" || at_failed=:
   14134 at_fn_check_status 0 $at_status "$at_srcdir/output.at:90"
   14135 $at_failed && at_fn_log_failure
   14136 $at_traceon; }
   14137 
   14138   rm -rf xml-tests expout
   14139   at_restore_special_files
   14140 fi
   14141 { set +x
   14142 $as_echo "$at_srcdir/output.at:90: bison -o foo.c foo.yy "
   14143 at_fn_check_prepare_trace "output.at:90"
   14144 ( $at_check_trace; bison -o foo.c foo.yy
   14145 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14146 at_status=$? at_failed=false
   14147 $at_check_filter
   14148 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14149 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14150 at_fn_check_status 0 $at_status "$at_srcdir/output.at:90"
   14151 $at_failed && at_fn_log_failure
   14152 $at_traceon; }
   14153 
   14154 
   14155 { set +x
   14156 $as_echo "$at_srcdir/output.at:90: ls foo.c foo.h foo.output"
   14157 at_fn_check_prepare_trace "output.at:90"
   14158 ( $at_check_trace; ls foo.c foo.h foo.output
   14159 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14160 at_status=$? at_failed=false
   14161 $at_check_filter
   14162 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14163 echo stdout:; cat "$at_stdout"
   14164 at_fn_check_status 0 $at_status "$at_srcdir/output.at:90"
   14165 $at_failed && at_fn_log_failure
   14166 $at_traceon; }
   14167 
   14168 
   14169   set +x
   14170   $at_times_p && times >"$at_times_file"
   14171 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14172 read at_status <"$at_status_file"
   14173 #AT_STOP_65
   14174 #AT_START_66
   14175 at_fn_group_banner 66 'output.at:93' \
   14176   "Output files:  --defines=foo.hpp -o foo.c++ " "   " 3
   14177 at_xfail=no
   14178 (
   14179   $as_echo "66. $at_setup_line: testing $at_desc ..."
   14180   $at_traceon
   14181 
   14182 
   14183 for file in foo.yy foo.c++ foo.hpp; do
   14184   case "$file" in
   14185     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14186   esac
   14187 done
   14188 cat >foo.yy <<'_ATEOF'
   14189 
   14190 %%
   14191 foo: {};
   14192 _ATEOF
   14193 
   14194 
   14195 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14196   at_save_special_files
   14197   mkdir xml-tests
   14198     # Don't combine these Bison invocations since we want to be sure that
   14199   # --report=all isn't required to get the full XML file.
   14200   { set +x
   14201 $as_echo "$at_srcdir/output.at:93: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14202                   --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy "
   14203 at_fn_check_prepare_notrace 'an embedded newline' "output.at:93"
   14204 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14205                   --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy
   14206 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14207 at_status=$? at_failed=false
   14208 $at_check_filter
   14209 echo stderr:; cat "$at_stderr"
   14210 echo stdout:; cat "$at_stdout"
   14211 at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
   14212 $at_failed && at_fn_log_failure
   14213 $at_traceon; }
   14214 
   14215   { set +x
   14216 $as_echo "$at_srcdir/output.at:93: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy "
   14217 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy " "output.at:93"
   14218 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy
   14219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14220 at_status=$? at_failed=false
   14221 $at_check_filter
   14222 echo stderr:; cat "$at_stderr"
   14223 echo stdout:; cat "$at_stdout"
   14224 at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
   14225 $at_failed && at_fn_log_failure
   14226 $at_traceon; }
   14227 
   14228     cp xml-tests/test.output expout
   14229   { set +x
   14230 $as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\
   14231              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14232              xml-tests/test.xml"
   14233 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93"
   14234 ( $at_check_trace; $XSLTPROC \
   14235              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14236              xml-tests/test.xml
   14237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14238 at_status=$? at_failed=false
   14239 $at_check_filter
   14240 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14241 $at_diff expout "$at_stdout" || at_failed=:
   14242 at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
   14243 $at_failed && at_fn_log_failure
   14244 $at_traceon; }
   14245 
   14246   sort xml-tests/test.dot > expout
   14247   { set +x
   14248 $as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\
   14249              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14250              xml-tests/test.xml | sort"
   14251 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93"
   14252 ( $at_check_trace; $XSLTPROC \
   14253              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14254              xml-tests/test.xml | sort
   14255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14256 at_status=$? at_failed=false
   14257 $at_check_filter
   14258 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14259 $at_diff expout "$at_stdout" || at_failed=:
   14260 at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
   14261 $at_failed && at_fn_log_failure
   14262 $at_traceon; }
   14263 
   14264   rm -rf xml-tests expout
   14265   at_restore_special_files
   14266 fi
   14267 { set +x
   14268 $as_echo "$at_srcdir/output.at:93: bison --defines=foo.hpp -o foo.c++ foo.yy "
   14269 at_fn_check_prepare_trace "output.at:93"
   14270 ( $at_check_trace; bison --defines=foo.hpp -o foo.c++ foo.yy
   14271 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14272 at_status=$? at_failed=false
   14273 $at_check_filter
   14274 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14275 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14276 at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
   14277 $at_failed && at_fn_log_failure
   14278 $at_traceon; }
   14279 
   14280 
   14281 { set +x
   14282 $as_echo "$at_srcdir/output.at:93: ls foo.c++ foo.hpp"
   14283 at_fn_check_prepare_trace "output.at:93"
   14284 ( $at_check_trace; ls foo.c++ foo.hpp
   14285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14286 at_status=$? at_failed=false
   14287 $at_check_filter
   14288 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14289 echo stdout:; cat "$at_stdout"
   14290 at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
   14291 $at_failed && at_fn_log_failure
   14292 $at_traceon; }
   14293 
   14294 
   14295   set +x
   14296   $at_times_p && times >"$at_times_file"
   14297 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14298 read at_status <"$at_status_file"
   14299 #AT_STOP_66
   14300 #AT_START_67
   14301 at_fn_group_banner 67 'output.at:97' \
   14302   "Output files: %defines \"foo.hpp\" -o foo.c++ " "   " 3
   14303 at_xfail=no
   14304 (
   14305   $as_echo "67. $at_setup_line: testing $at_desc ..."
   14306   $at_traceon
   14307 
   14308 
   14309 for file in foo.yy foo.c++ foo.hpp; do
   14310   case "$file" in
   14311     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14312   esac
   14313 done
   14314 cat >foo.yy <<'_ATEOF'
   14315 %defines "foo.hpp"
   14316 %%
   14317 foo: {};
   14318 _ATEOF
   14319 
   14320 
   14321 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14322   at_save_special_files
   14323   mkdir xml-tests
   14324     # Don't combine these Bison invocations since we want to be sure that
   14325   # --report=all isn't required to get the full XML file.
   14326   { set +x
   14327 $as_echo "$at_srcdir/output.at:97: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14328                   --graph=xml-tests/test.dot -o foo.c++ foo.yy "
   14329 at_fn_check_prepare_notrace 'an embedded newline' "output.at:97"
   14330 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14331                   --graph=xml-tests/test.dot -o foo.c++ foo.yy
   14332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14333 at_status=$? at_failed=false
   14334 $at_check_filter
   14335 echo stderr:; cat "$at_stderr"
   14336 echo stdout:; cat "$at_stdout"
   14337 at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
   14338 $at_failed && at_fn_log_failure
   14339 $at_traceon; }
   14340 
   14341   { set +x
   14342 $as_echo "$at_srcdir/output.at:97: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy "
   14343 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy " "output.at:97"
   14344 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy
   14345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14346 at_status=$? at_failed=false
   14347 $at_check_filter
   14348 echo stderr:; cat "$at_stderr"
   14349 echo stdout:; cat "$at_stdout"
   14350 at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
   14351 $at_failed && at_fn_log_failure
   14352 $at_traceon; }
   14353 
   14354     cp xml-tests/test.output expout
   14355   { set +x
   14356 $as_echo "$at_srcdir/output.at:97: \$XSLTPROC \\
   14357              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14358              xml-tests/test.xml"
   14359 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97"
   14360 ( $at_check_trace; $XSLTPROC \
   14361              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14362              xml-tests/test.xml
   14363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14364 at_status=$? at_failed=false
   14365 $at_check_filter
   14366 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14367 $at_diff expout "$at_stdout" || at_failed=:
   14368 at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
   14369 $at_failed && at_fn_log_failure
   14370 $at_traceon; }
   14371 
   14372   sort xml-tests/test.dot > expout
   14373   { set +x
   14374 $as_echo "$at_srcdir/output.at:97: \$XSLTPROC \\
   14375              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14376              xml-tests/test.xml | sort"
   14377 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97"
   14378 ( $at_check_trace; $XSLTPROC \
   14379              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14380              xml-tests/test.xml | sort
   14381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14382 at_status=$? at_failed=false
   14383 $at_check_filter
   14384 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14385 $at_diff expout "$at_stdout" || at_failed=:
   14386 at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
   14387 $at_failed && at_fn_log_failure
   14388 $at_traceon; }
   14389 
   14390   rm -rf xml-tests expout
   14391   at_restore_special_files
   14392 fi
   14393 { set +x
   14394 $as_echo "$at_srcdir/output.at:97: bison -o foo.c++ foo.yy "
   14395 at_fn_check_prepare_trace "output.at:97"
   14396 ( $at_check_trace; bison -o foo.c++ foo.yy
   14397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14398 at_status=$? at_failed=false
   14399 $at_check_filter
   14400 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14401 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14402 at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
   14403 $at_failed && at_fn_log_failure
   14404 $at_traceon; }
   14405 
   14406 
   14407 { set +x
   14408 $as_echo "$at_srcdir/output.at:97: ls foo.c++ foo.hpp"
   14409 at_fn_check_prepare_trace "output.at:97"
   14410 ( $at_check_trace; ls foo.c++ foo.hpp
   14411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14412 at_status=$? at_failed=false
   14413 $at_check_filter
   14414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14415 echo stdout:; cat "$at_stdout"
   14416 at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
   14417 $at_failed && at_fn_log_failure
   14418 $at_traceon; }
   14419 
   14420 
   14421   set +x
   14422   $at_times_p && times >"$at_times_file"
   14423 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14424 read at_status <"$at_status_file"
   14425 #AT_STOP_67
   14426 #AT_START_68
   14427 at_fn_group_banner 68 'output.at:101' \
   14428   "Output files:  -o foo.c++ --graph=foo.gph " "     " 3
   14429 at_xfail=no
   14430 (
   14431   $as_echo "68. $at_setup_line: testing $at_desc ..."
   14432   $at_traceon
   14433 
   14434 
   14435 for file in foo.yy foo.c++ foo.gph; do
   14436   case "$file" in
   14437     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14438   esac
   14439 done
   14440 cat >foo.yy <<'_ATEOF'
   14441 
   14442 %%
   14443 foo: {};
   14444 _ATEOF
   14445 
   14446 
   14447 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14448   at_save_special_files
   14449   mkdir xml-tests
   14450     # Don't combine these Bison invocations since we want to be sure that
   14451   # --report=all isn't required to get the full XML file.
   14452   { set +x
   14453 $as_echo "$at_srcdir/output.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14454                   --graph=xml-tests/test.dot -o foo.c++  foo.yy "
   14455 at_fn_check_prepare_notrace 'an embedded newline' "output.at:101"
   14456 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14457                   --graph=xml-tests/test.dot -o foo.c++  foo.yy
   14458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14459 at_status=$? at_failed=false
   14460 $at_check_filter
   14461 echo stderr:; cat "$at_stderr"
   14462 echo stdout:; cat "$at_stdout"
   14463 at_fn_check_status 0 $at_status "$at_srcdir/output.at:101"
   14464 $at_failed && at_fn_log_failure
   14465 $at_traceon; }
   14466 
   14467   { set +x
   14468 $as_echo "$at_srcdir/output.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++  foo.yy "
   14469 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++  foo.yy " "output.at:101"
   14470 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o foo.c++  foo.yy
   14471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14472 at_status=$? at_failed=false
   14473 $at_check_filter
   14474 echo stderr:; cat "$at_stderr"
   14475 echo stdout:; cat "$at_stdout"
   14476 at_fn_check_status 0 $at_status "$at_srcdir/output.at:101"
   14477 $at_failed && at_fn_log_failure
   14478 $at_traceon; }
   14479 
   14480     cp xml-tests/test.output expout
   14481   { set +x
   14482 $as_echo "$at_srcdir/output.at:101: \$XSLTPROC \\
   14483              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14484              xml-tests/test.xml"
   14485 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:101"
   14486 ( $at_check_trace; $XSLTPROC \
   14487              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14488              xml-tests/test.xml
   14489 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14490 at_status=$? at_failed=false
   14491 $at_check_filter
   14492 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14493 $at_diff expout "$at_stdout" || at_failed=:
   14494 at_fn_check_status 0 $at_status "$at_srcdir/output.at:101"
   14495 $at_failed && at_fn_log_failure
   14496 $at_traceon; }
   14497 
   14498   sort xml-tests/test.dot > expout
   14499   { set +x
   14500 $as_echo "$at_srcdir/output.at:101: \$XSLTPROC \\
   14501              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14502              xml-tests/test.xml | sort"
   14503 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:101"
   14504 ( $at_check_trace; $XSLTPROC \
   14505              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14506              xml-tests/test.xml | sort
   14507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14508 at_status=$? at_failed=false
   14509 $at_check_filter
   14510 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14511 $at_diff expout "$at_stdout" || at_failed=:
   14512 at_fn_check_status 0 $at_status "$at_srcdir/output.at:101"
   14513 $at_failed && at_fn_log_failure
   14514 $at_traceon; }
   14515 
   14516   rm -rf xml-tests expout
   14517   at_restore_special_files
   14518 fi
   14519 { set +x
   14520 $as_echo "$at_srcdir/output.at:101: bison -o foo.c++ --graph=foo.gph foo.yy "
   14521 at_fn_check_prepare_trace "output.at:101"
   14522 ( $at_check_trace; bison -o foo.c++ --graph=foo.gph foo.yy
   14523 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14524 at_status=$? at_failed=false
   14525 $at_check_filter
   14526 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14527 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14528 at_fn_check_status 0 $at_status "$at_srcdir/output.at:101"
   14529 $at_failed && at_fn_log_failure
   14530 $at_traceon; }
   14531 
   14532 
   14533 { set +x
   14534 $as_echo "$at_srcdir/output.at:101: ls foo.c++ foo.gph"
   14535 at_fn_check_prepare_trace "output.at:101"
   14536 ( $at_check_trace; ls foo.c++ foo.gph
   14537 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14538 at_status=$? at_failed=false
   14539 $at_check_filter
   14540 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14541 echo stdout:; cat "$at_stdout"
   14542 at_fn_check_status 0 $at_status "$at_srcdir/output.at:101"
   14543 $at_failed && at_fn_log_failure
   14544 $at_traceon; }
   14545 
   14546 
   14547   set +x
   14548   $at_times_p && times >"$at_times_file"
   14549 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14550 read at_status <"$at_status_file"
   14551 #AT_STOP_68
   14552 #AT_START_69
   14553 at_fn_group_banner 69 'output.at:116' \
   14554   "Output files: %skeleton \"lalr1.cc\" %defines %verbose  " "" 3
   14555 at_xfail=no
   14556 (
   14557   $as_echo "69. $at_setup_line: testing $at_desc ..."
   14558   $at_traceon
   14559 
   14560 
   14561 for file in foo.yy foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh; do
   14562   case "$file" in
   14563     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14564   esac
   14565 done
   14566 cat >foo.yy <<'_ATEOF'
   14567 %skeleton "lalr1.cc" %defines %verbose
   14568 %%
   14569 foo: {};
   14570 _ATEOF
   14571 
   14572 
   14573 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14574   at_save_special_files
   14575   mkdir xml-tests
   14576     # Don't combine these Bison invocations since we want to be sure that
   14577   # --report=all isn't required to get the full XML file.
   14578   { set +x
   14579 $as_echo "$at_srcdir/output.at:116: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14580                   --graph=xml-tests/test.dot  foo.yy "
   14581 at_fn_check_prepare_notrace 'an embedded newline' "output.at:116"
   14582 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14583                   --graph=xml-tests/test.dot  foo.yy
   14584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14585 at_status=$? at_failed=false
   14586 $at_check_filter
   14587 echo stderr:; cat "$at_stderr"
   14588 echo stdout:; cat "$at_stdout"
   14589 at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
   14590 $at_failed && at_fn_log_failure
   14591 $at_traceon; }
   14592 
   14593   { set +x
   14594 $as_echo "$at_srcdir/output.at:116: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy "
   14595 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy " "output.at:116"
   14596 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  foo.yy
   14597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14598 at_status=$? at_failed=false
   14599 $at_check_filter
   14600 echo stderr:; cat "$at_stderr"
   14601 echo stdout:; cat "$at_stdout"
   14602 at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
   14603 $at_failed && at_fn_log_failure
   14604 $at_traceon; }
   14605 
   14606     cp xml-tests/test.output expout
   14607   { set +x
   14608 $as_echo "$at_srcdir/output.at:116: \$XSLTPROC \\
   14609              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14610              xml-tests/test.xml"
   14611 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:116"
   14612 ( $at_check_trace; $XSLTPROC \
   14613              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14614              xml-tests/test.xml
   14615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14616 at_status=$? at_failed=false
   14617 $at_check_filter
   14618 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14619 $at_diff expout "$at_stdout" || at_failed=:
   14620 at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
   14621 $at_failed && at_fn_log_failure
   14622 $at_traceon; }
   14623 
   14624   sort xml-tests/test.dot > expout
   14625   { set +x
   14626 $as_echo "$at_srcdir/output.at:116: \$XSLTPROC \\
   14627              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14628              xml-tests/test.xml | sort"
   14629 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:116"
   14630 ( $at_check_trace; $XSLTPROC \
   14631              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14632              xml-tests/test.xml | sort
   14633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14634 at_status=$? at_failed=false
   14635 $at_check_filter
   14636 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14637 $at_diff expout "$at_stdout" || at_failed=:
   14638 at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
   14639 $at_failed && at_fn_log_failure
   14640 $at_traceon; }
   14641 
   14642   rm -rf xml-tests expout
   14643   at_restore_special_files
   14644 fi
   14645 { set +x
   14646 $as_echo "$at_srcdir/output.at:116: bison  foo.yy "
   14647 at_fn_check_prepare_trace "output.at:116"
   14648 ( $at_check_trace; bison  foo.yy
   14649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14650 at_status=$? at_failed=false
   14651 $at_check_filter
   14652 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14653 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14654 at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
   14655 $at_failed && at_fn_log_failure
   14656 $at_traceon; }
   14657 
   14658 
   14659 { set +x
   14660 $as_echo "$at_srcdir/output.at:116: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh"
   14661 at_fn_check_prepare_trace "output.at:116"
   14662 ( $at_check_trace; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh
   14663 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14664 at_status=$? at_failed=false
   14665 $at_check_filter
   14666 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14667 echo stdout:; cat "$at_stdout"
   14668 at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
   14669 $at_failed && at_fn_log_failure
   14670 $at_traceon; }
   14671 
   14672 
   14673   set +x
   14674   $at_times_p && times >"$at_times_file"
   14675 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14676 read at_status <"$at_status_file"
   14677 #AT_STOP_69
   14678 #AT_START_70
   14679 at_fn_group_banner 70 'output.at:119' \
   14680   "Output files: %skeleton \"lalr1.cc\" %defines %verbose  " "" 3
   14681 at_xfail=no
   14682 (
   14683   $as_echo "70. $at_setup_line: testing $at_desc ..."
   14684   $at_traceon
   14685 
   14686 
   14687 for file in subdir/foo.yy foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh; do
   14688   case "$file" in
   14689     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14690   esac
   14691 done
   14692 cat >subdir/foo.yy <<'_ATEOF'
   14693 %skeleton "lalr1.cc" %defines %verbose
   14694 %%
   14695 foo: {};
   14696 _ATEOF
   14697 
   14698 
   14699 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14700   at_save_special_files
   14701   mkdir xml-tests
   14702     # Don't combine these Bison invocations since we want to be sure that
   14703   # --report=all isn't required to get the full XML file.
   14704   { set +x
   14705 $as_echo "$at_srcdir/output.at:119: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14706                   --graph=xml-tests/test.dot  subdir/foo.yy "
   14707 at_fn_check_prepare_notrace 'an embedded newline' "output.at:119"
   14708 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14709                   --graph=xml-tests/test.dot  subdir/foo.yy
   14710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14711 at_status=$? at_failed=false
   14712 $at_check_filter
   14713 echo stderr:; cat "$at_stderr"
   14714 echo stdout:; cat "$at_stdout"
   14715 at_fn_check_status 0 $at_status "$at_srcdir/output.at:119"
   14716 $at_failed && at_fn_log_failure
   14717 $at_traceon; }
   14718 
   14719   { set +x
   14720 $as_echo "$at_srcdir/output.at:119: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  subdir/foo.yy "
   14721 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  subdir/foo.yy " "output.at:119"
   14722 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  subdir/foo.yy
   14723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14724 at_status=$? at_failed=false
   14725 $at_check_filter
   14726 echo stderr:; cat "$at_stderr"
   14727 echo stdout:; cat "$at_stdout"
   14728 at_fn_check_status 0 $at_status "$at_srcdir/output.at:119"
   14729 $at_failed && at_fn_log_failure
   14730 $at_traceon; }
   14731 
   14732     cp xml-tests/test.output expout
   14733   { set +x
   14734 $as_echo "$at_srcdir/output.at:119: \$XSLTPROC \\
   14735              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14736              xml-tests/test.xml"
   14737 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:119"
   14738 ( $at_check_trace; $XSLTPROC \
   14739              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14740              xml-tests/test.xml
   14741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14742 at_status=$? at_failed=false
   14743 $at_check_filter
   14744 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14745 $at_diff expout "$at_stdout" || at_failed=:
   14746 at_fn_check_status 0 $at_status "$at_srcdir/output.at:119"
   14747 $at_failed && at_fn_log_failure
   14748 $at_traceon; }
   14749 
   14750   sort xml-tests/test.dot > expout
   14751   { set +x
   14752 $as_echo "$at_srcdir/output.at:119: \$XSLTPROC \\
   14753              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14754              xml-tests/test.xml | sort"
   14755 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:119"
   14756 ( $at_check_trace; $XSLTPROC \
   14757              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14758              xml-tests/test.xml | sort
   14759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14760 at_status=$? at_failed=false
   14761 $at_check_filter
   14762 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14763 $at_diff expout "$at_stdout" || at_failed=:
   14764 at_fn_check_status 0 $at_status "$at_srcdir/output.at:119"
   14765 $at_failed && at_fn_log_failure
   14766 $at_traceon; }
   14767 
   14768   rm -rf xml-tests expout
   14769   at_restore_special_files
   14770 fi
   14771 { set +x
   14772 $as_echo "$at_srcdir/output.at:119: bison  subdir/foo.yy "
   14773 at_fn_check_prepare_trace "output.at:119"
   14774 ( $at_check_trace; bison  subdir/foo.yy
   14775 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14776 at_status=$? at_failed=false
   14777 $at_check_filter
   14778 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14779 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14780 at_fn_check_status 0 $at_status "$at_srcdir/output.at:119"
   14781 $at_failed && at_fn_log_failure
   14782 $at_traceon; }
   14783 
   14784 
   14785 { set +x
   14786 $as_echo "$at_srcdir/output.at:119: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh"
   14787 at_fn_check_prepare_trace "output.at:119"
   14788 ( $at_check_trace; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh
   14789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14790 at_status=$? at_failed=false
   14791 $at_check_filter
   14792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14793 echo stdout:; cat "$at_stdout"
   14794 at_fn_check_status 0 $at_status "$at_srcdir/output.at:119"
   14795 $at_failed && at_fn_log_failure
   14796 $at_traceon; }
   14797 
   14798 # Also make sure that the includes do not refer to the subdirectory.
   14799 { set +x
   14800 $as_echo "$at_srcdir/output.at:119: grep 'include .subdir/' foo.tab.cc"
   14801 at_fn_check_prepare_trace "output.at:119"
   14802 ( $at_check_trace; grep 'include .subdir/' foo.tab.cc
   14803 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14804 at_status=$? at_failed=false
   14805 $at_check_filter
   14806 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14807 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14808 at_fn_check_status 1 $at_status "$at_srcdir/output.at:119"
   14809 $at_failed && at_fn_log_failure
   14810 $at_traceon; }
   14811 
   14812 { set +x
   14813 $as_echo "$at_srcdir/output.at:119: grep 'include .subdir/' foo.tab.hh"
   14814 at_fn_check_prepare_trace "output.at:119"
   14815 ( $at_check_trace; grep 'include .subdir/' foo.tab.hh
   14816 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14817 at_status=$? at_failed=false
   14818 $at_check_filter
   14819 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14820 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14821 at_fn_check_status 1 $at_status "$at_srcdir/output.at:119"
   14822 $at_failed && at_fn_log_failure
   14823 $at_traceon; }
   14824 
   14825 
   14826   set +x
   14827   $at_times_p && times >"$at_times_file"
   14828 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14829 read at_status <"$at_status_file"
   14830 #AT_STOP_70
   14831 #AT_START_71
   14832 at_fn_group_banner 71 'output.at:123' \
   14833   "Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc " "" 3
   14834 at_xfail=no
   14835 (
   14836   $as_echo "71. $at_setup_line: testing $at_desc ..."
   14837   $at_traceon
   14838 
   14839 
   14840 for file in subdir/foo.yy subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh; do
   14841   case "$file" in
   14842     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14843   esac
   14844 done
   14845 cat >subdir/foo.yy <<'_ATEOF'
   14846 %skeleton "lalr1.cc" %defines %verbose
   14847 %%
   14848 foo: {};
   14849 _ATEOF
   14850 
   14851 
   14852 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   14853   at_save_special_files
   14854   mkdir xml-tests
   14855     # Don't combine these Bison invocations since we want to be sure that
   14856   # --report=all isn't required to get the full XML file.
   14857   { set +x
   14858 $as_echo "$at_srcdir/output.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   14859                   --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy "
   14860 at_fn_check_prepare_notrace 'an embedded newline' "output.at:123"
   14861 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   14862                   --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy
   14863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14864 at_status=$? at_failed=false
   14865 $at_check_filter
   14866 echo stderr:; cat "$at_stderr"
   14867 echo stdout:; cat "$at_stdout"
   14868 at_fn_check_status 0 $at_status "$at_srcdir/output.at:123"
   14869 $at_failed && at_fn_log_failure
   14870 $at_traceon; }
   14871 
   14872   { set +x
   14873 $as_echo "$at_srcdir/output.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy "
   14874 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy " "output.at:123"
   14875 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy
   14876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14877 at_status=$? at_failed=false
   14878 $at_check_filter
   14879 echo stderr:; cat "$at_stderr"
   14880 echo stdout:; cat "$at_stdout"
   14881 at_fn_check_status 0 $at_status "$at_srcdir/output.at:123"
   14882 $at_failed && at_fn_log_failure
   14883 $at_traceon; }
   14884 
   14885     cp xml-tests/test.output expout
   14886   { set +x
   14887 $as_echo "$at_srcdir/output.at:123: \$XSLTPROC \\
   14888              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   14889              xml-tests/test.xml"
   14890 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:123"
   14891 ( $at_check_trace; $XSLTPROC \
   14892              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   14893              xml-tests/test.xml
   14894 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14895 at_status=$? at_failed=false
   14896 $at_check_filter
   14897 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14898 $at_diff expout "$at_stdout" || at_failed=:
   14899 at_fn_check_status 0 $at_status "$at_srcdir/output.at:123"
   14900 $at_failed && at_fn_log_failure
   14901 $at_traceon; }
   14902 
   14903   sort xml-tests/test.dot > expout
   14904   { set +x
   14905 $as_echo "$at_srcdir/output.at:123: \$XSLTPROC \\
   14906              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   14907              xml-tests/test.xml | sort"
   14908 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:123"
   14909 ( $at_check_trace; $XSLTPROC \
   14910              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   14911              xml-tests/test.xml | sort
   14912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14913 at_status=$? at_failed=false
   14914 $at_check_filter
   14915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14916 $at_diff expout "$at_stdout" || at_failed=:
   14917 at_fn_check_status 0 $at_status "$at_srcdir/output.at:123"
   14918 $at_failed && at_fn_log_failure
   14919 $at_traceon; }
   14920 
   14921   rm -rf xml-tests expout
   14922   at_restore_special_files
   14923 fi
   14924 { set +x
   14925 $as_echo "$at_srcdir/output.at:123: bison -o subdir/foo.cc subdir/foo.yy "
   14926 at_fn_check_prepare_trace "output.at:123"
   14927 ( $at_check_trace; bison -o subdir/foo.cc subdir/foo.yy
   14928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14929 at_status=$? at_failed=false
   14930 $at_check_filter
   14931 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14932 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14933 at_fn_check_status 0 $at_status "$at_srcdir/output.at:123"
   14934 $at_failed && at_fn_log_failure
   14935 $at_traceon; }
   14936 
   14937 
   14938 { set +x
   14939 $as_echo "$at_srcdir/output.at:123: ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh"
   14940 at_fn_check_prepare_trace "output.at:123"
   14941 ( $at_check_trace; ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh
   14942 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14943 at_status=$? at_failed=false
   14944 $at_check_filter
   14945 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14946 echo stdout:; cat "$at_stdout"
   14947 at_fn_check_status 0 $at_status "$at_srcdir/output.at:123"
   14948 $at_failed && at_fn_log_failure
   14949 $at_traceon; }
   14950 
   14951 # Also make sure that the includes do not refer to the subdirectory.
   14952 { set +x
   14953 $as_echo "$at_srcdir/output.at:123: grep 'include .subdir/' subdir/foo.cc"
   14954 at_fn_check_prepare_trace "output.at:123"
   14955 ( $at_check_trace; grep 'include .subdir/' subdir/foo.cc
   14956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14957 at_status=$? at_failed=false
   14958 $at_check_filter
   14959 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14960 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14961 at_fn_check_status 1 $at_status "$at_srcdir/output.at:123"
   14962 $at_failed && at_fn_log_failure
   14963 $at_traceon; }
   14964 
   14965 { set +x
   14966 $as_echo "$at_srcdir/output.at:123: grep 'include .subdir/' subdir/foo.hh"
   14967 at_fn_check_prepare_trace "output.at:123"
   14968 ( $at_check_trace; grep 'include .subdir/' subdir/foo.hh
   14969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   14970 at_status=$? at_failed=false
   14971 $at_check_filter
   14972 at_fn_diff_devnull "$at_stderr" || at_failed=:
   14973 at_fn_diff_devnull "$at_stdout" || at_failed=:
   14974 at_fn_check_status 1 $at_status "$at_srcdir/output.at:123"
   14975 $at_failed && at_fn_log_failure
   14976 $at_traceon; }
   14977 
   14978 
   14979   set +x
   14980   $at_times_p && times >"$at_times_file"
   14981 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   14982 read at_status <"$at_status_file"
   14983 #AT_STOP_71
   14984 #AT_START_72
   14985 at_fn_group_banner 72 'output.at:128' \
   14986   "Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\"  " "" 3
   14987 at_xfail=no
   14988 (
   14989   $as_echo "72. $at_setup_line: testing $at_desc ..."
   14990   $at_traceon
   14991 
   14992 
   14993 for file in gram_dir/foo.yy output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh; do
   14994   case "$file" in
   14995     */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
   14996   esac
   14997 done
   14998 cat >gram_dir/foo.yy <<'_ATEOF'
   14999 %skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo"
   15000 %%
   15001 foo: {};
   15002 _ATEOF
   15003 
   15004 
   15005 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   15006   at_save_special_files
   15007   mkdir xml-tests
   15008     # Don't combine these Bison invocations since we want to be sure that
   15009   # --report=all isn't required to get the full XML file.
   15010   { set +x
   15011 $as_echo "$at_srcdir/output.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   15012                   --graph=xml-tests/test.dot  gram_dir/foo.yy "
   15013 at_fn_check_prepare_notrace 'an embedded newline' "output.at:128"
   15014 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   15015                   --graph=xml-tests/test.dot  gram_dir/foo.yy
   15016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15017 at_status=$? at_failed=false
   15018 $at_check_filter
   15019 echo stderr:; cat "$at_stderr"
   15020 echo stdout:; cat "$at_stdout"
   15021 at_fn_check_status 0 $at_status "$at_srcdir/output.at:128"
   15022 $at_failed && at_fn_log_failure
   15023 $at_traceon; }
   15024 
   15025   { set +x
   15026 $as_echo "$at_srcdir/output.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  gram_dir/foo.yy "
   15027 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  gram_dir/foo.yy " "output.at:128"
   15028 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  gram_dir/foo.yy
   15029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15030 at_status=$? at_failed=false
   15031 $at_check_filter
   15032 echo stderr:; cat "$at_stderr"
   15033 echo stdout:; cat "$at_stdout"
   15034 at_fn_check_status 0 $at_status "$at_srcdir/output.at:128"
   15035 $at_failed && at_fn_log_failure
   15036 $at_traceon; }
   15037 
   15038     cp xml-tests/test.output expout
   15039   { set +x
   15040 $as_echo "$at_srcdir/output.at:128: \$XSLTPROC \\
   15041              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   15042              xml-tests/test.xml"
   15043 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:128"
   15044 ( $at_check_trace; $XSLTPROC \
   15045              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   15046              xml-tests/test.xml
   15047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15048 at_status=$? at_failed=false
   15049 $at_check_filter
   15050 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15051 $at_diff expout "$at_stdout" || at_failed=:
   15052 at_fn_check_status 0 $at_status "$at_srcdir/output.at:128"
   15053 $at_failed && at_fn_log_failure
   15054 $at_traceon; }
   15055 
   15056   sort xml-tests/test.dot > expout
   15057   { set +x
   15058 $as_echo "$at_srcdir/output.at:128: \$XSLTPROC \\
   15059              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   15060              xml-tests/test.xml | sort"
   15061 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:128"
   15062 ( $at_check_trace; $XSLTPROC \
   15063              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   15064              xml-tests/test.xml | sort
   15065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15066 at_status=$? at_failed=false
   15067 $at_check_filter
   15068 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15069 $at_diff expout "$at_stdout" || at_failed=:
   15070 at_fn_check_status 0 $at_status "$at_srcdir/output.at:128"
   15071 $at_failed && at_fn_log_failure
   15072 $at_traceon; }
   15073 
   15074   rm -rf xml-tests expout
   15075   at_restore_special_files
   15076 fi
   15077 { set +x
   15078 $as_echo "$at_srcdir/output.at:128: bison  gram_dir/foo.yy "
   15079 at_fn_check_prepare_trace "output.at:128"
   15080 ( $at_check_trace; bison  gram_dir/foo.yy
   15081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15082 at_status=$? at_failed=false
   15083 $at_check_filter
   15084 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15085 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15086 at_fn_check_status 0 $at_status "$at_srcdir/output.at:128"
   15087 $at_failed && at_fn_log_failure
   15088 $at_traceon; }
   15089 
   15090 
   15091 { set +x
   15092 $as_echo "$at_srcdir/output.at:128: ls output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh"
   15093 at_fn_check_prepare_trace "output.at:128"
   15094 ( $at_check_trace; ls output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh
   15095 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15096 at_status=$? at_failed=false
   15097 $at_check_filter
   15098 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15099 echo stdout:; cat "$at_stdout"
   15100 at_fn_check_status 0 $at_status "$at_srcdir/output.at:128"
   15101 $at_failed && at_fn_log_failure
   15102 $at_traceon; }
   15103 
   15104 
   15105   set +x
   15106   $at_times_p && times >"$at_times_file"
   15107 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   15108 read at_status <"$at_status_file"
   15109 #AT_STOP_72
   15110 #AT_START_73
   15111 at_fn_group_banner 73 'output.at:158' \
   15112   "Conflicting output files:  --graph=\"foo.tab.c\"" " " 3
   15113 at_xfail=no
   15114 (
   15115   $as_echo "73. $at_setup_line: testing $at_desc ..."
   15116   $at_traceon
   15117 
   15118 case "foo.y" in
   15119   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   15120 esac
   15121 cat >foo.y <<'_ATEOF'
   15122 
   15123 %%
   15124 foo: {};
   15125 _ATEOF
   15126 
   15127 
   15128 cp foo.y expout
   15129 # Because an output file name conflict is still a warning, Bison exits
   15130 # with status 0, so AT_BISON_CHECK does not realize that there may be no
   15131 # output file against which to check the XML.  AT_BISON_CHECK_NO_XML
   15132 # avoids that problem.
   15133 { set +x
   15134 $as_echo "$at_srcdir/output.at:158: bison --graph=\"foo.tab.c\" foo.y"
   15135 at_fn_check_prepare_trace "output.at:158"
   15136 ( $at_check_trace; bison --graph="foo.tab.c" foo.y
   15137 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15138 at_status=$? at_failed=false
   15139 $at_check_filter
   15140 echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.tab.c'
   15141 " | \
   15142   $at_diff - "$at_stderr" || at_failed=:
   15143 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15144 at_fn_check_status 0 $at_status "$at_srcdir/output.at:158"
   15145 $at_failed && at_fn_log_failure
   15146 $at_traceon; }
   15147 
   15148 # Defining POSIXLY_CORRECT causes bison to complain if options are
   15149 # added after the grammar file name, so skip these checks in that
   15150 # case.
   15151 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   15152   at_save_special_files
   15153 
   15154   # To avoid expanding it repeatedly, store specified stdout.
   15155   : >expout
   15156 
   15157   # Run with -Werror.
   15158   { set +x
   15159 $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Werror"
   15160 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Werror" "output.at:158"
   15161 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y -Werror
   15162 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15163 at_status=$? at_failed=false
   15164 $at_check_filter
   15165 echo stderr:; tee stderr <"$at_stderr"
   15166 $at_diff expout "$at_stdout" || at_failed=:
   15167 at_fn_check_status 1 $at_status "$at_srcdir/output.at:158"
   15168 $at_failed && at_fn_log_failure
   15169 $at_traceon; }
   15170 
   15171 
   15172   # Build expected stderr up to and including the "warnings being
   15173   # treated as errors" message.
   15174   cat >at-bison-check-warnings <<'_ATEOF'
   15175 foo.y: warning: conflicting outputs to file 'foo.tab.c'
   15176 _ATEOF
   15177 
   15178   at_bison_check_first=`sed -n \
   15179     '/: warning: /{=;q;}' at-bison-check-warnings`
   15180   : ${at_bison_check_first:=1}
   15181   at_bison_check_first_tmp=`sed -n \
   15182     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   15183   : ${at_bison_check_first_tmp:=1}
   15184   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   15185     at_bison_check_first=$at_bison_check_first_tmp
   15186   fi
   15187   if test $at_bison_check_first -gt 1; then
   15188     sed -n "1,`expr $at_bison_check_first - 1`"p \
   15189       at-bison-check-warnings > experr
   15190   fi
   15191   echo 'bison: warnings being treated as errors' >> experr
   15192 
   15193   # Finish building expected stderr and check.  Unlike warnings,
   15194   # complaints cause bison to exit early.  Thus, with -Werror, bison
   15195   # does not necessarily report all warnings that it does without
   15196   # -Werror, but it at least reports one.
   15197   at_bison_check_last=`sed -n '$=' stderr`
   15198   : ${at_bison_check_last:=1}
   15199   at_bison_check_last=`expr $at_bison_check_last - 1`
   15200   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   15201     at-bison-check-warnings >> experr
   15202   { set +x
   15203 $as_echo "$at_srcdir/output.at:158: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   15204               stderr 1>&2"
   15205 at_fn_check_prepare_notrace 'an embedded newline' "output.at:158"
   15206 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   15207               stderr 1>&2
   15208 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15209 at_status=$? at_failed=false
   15210 $at_check_filter
   15211 $at_diff experr "$at_stderr" || at_failed=:
   15212 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15213 at_fn_check_status 0 $at_status "$at_srcdir/output.at:158"
   15214 $at_failed && at_fn_log_failure
   15215 $at_traceon; }
   15216 
   15217 
   15218   # Now check --warnings=error.
   15219   cp stderr experr
   15220   { set +x
   15221 $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=error"
   15222 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=error" "output.at:158"
   15223 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y --warnings=error
   15224 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15225 at_status=$? at_failed=false
   15226 $at_check_filter
   15227 $at_diff experr "$at_stderr" || at_failed=:
   15228 $at_diff expout "$at_stdout" || at_failed=:
   15229 at_fn_check_status 1 $at_status "$at_srcdir/output.at:158"
   15230 $at_failed && at_fn_log_failure
   15231 $at_traceon; }
   15232 
   15233 
   15234   # Now check -Wnone and --warnings=none by making sure that
   15235   # -Werror doesn't change the exit status when -Wnone or
   15236   # --warnings=none is specified.
   15237   { set +x
   15238 $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Wnone -Werror"
   15239 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y -Wnone -Werror" "output.at:158"
   15240 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y -Wnone -Werror
   15241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15242 at_status=$? at_failed=false
   15243 $at_check_filter
   15244 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15245 $at_diff expout "$at_stdout" || at_failed=:
   15246 at_fn_check_status 0 $at_status "$at_srcdir/output.at:158"
   15247 $at_failed && at_fn_log_failure
   15248 $at_traceon; }
   15249 
   15250   { set +x
   15251 $as_echo "$at_srcdir/output.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=none -Werror"
   15252 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"foo.tab.c\" foo.y --warnings=none -Werror" "output.at:158"
   15253 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="foo.tab.c" foo.y --warnings=none -Werror
   15254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15255 at_status=$? at_failed=false
   15256 $at_check_filter
   15257 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15258 $at_diff expout "$at_stdout" || at_failed=:
   15259 at_fn_check_status 0 $at_status "$at_srcdir/output.at:158"
   15260 $at_failed && at_fn_log_failure
   15261 $at_traceon; }
   15262 
   15263 
   15264   at_restore_special_files
   15265 fi
   15266 { set +x
   15267 $as_echo "$at_srcdir/output.at:158: cat foo.y"
   15268 at_fn_check_prepare_trace "output.at:158"
   15269 ( $at_check_trace; cat foo.y
   15270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15271 at_status=$? at_failed=false
   15272 $at_check_filter
   15273 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15274 $at_diff expout "$at_stdout" || at_failed=:
   15275 at_fn_check_status 0 $at_status "$at_srcdir/output.at:158"
   15276 $at_failed && at_fn_log_failure
   15277 $at_traceon; }
   15278 
   15279   set +x
   15280   $at_times_p && times >"$at_times_file"
   15281 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   15282 read at_status <"$at_status_file"
   15283 #AT_STOP_73
   15284 #AT_START_74
   15285 at_fn_group_banner 74 'output.at:163' \
   15286   "Conflicting output files: %defines \"foo.output\" -v" "" 3
   15287 at_xfail=no
   15288 (
   15289   $as_echo "74. $at_setup_line: testing $at_desc ..."
   15290   $at_traceon
   15291 
   15292 case "foo.y" in
   15293   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   15294 esac
   15295 cat >foo.y <<'_ATEOF'
   15296 %defines "foo.output"
   15297 %%
   15298 foo: {};
   15299 _ATEOF
   15300 
   15301 
   15302 cp foo.y expout
   15303 # Because an output file name conflict is still a warning, Bison exits
   15304 # with status 0, so AT_BISON_CHECK does not realize that there may be no
   15305 # output file against which to check the XML.  AT_BISON_CHECK_NO_XML
   15306 # avoids that problem.
   15307 { set +x
   15308 $as_echo "$at_srcdir/output.at:163: bison -v foo.y"
   15309 at_fn_check_prepare_trace "output.at:163"
   15310 ( $at_check_trace; bison -v foo.y
   15311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15312 at_status=$? at_failed=false
   15313 $at_check_filter
   15314 echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.output'
   15315 " | \
   15316   $at_diff - "$at_stderr" || at_failed=:
   15317 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15318 at_fn_check_status 0 $at_status "$at_srcdir/output.at:163"
   15319 $at_failed && at_fn_log_failure
   15320 $at_traceon; }
   15321 
   15322 # Defining POSIXLY_CORRECT causes bison to complain if options are
   15323 # added after the grammar file name, so skip these checks in that
   15324 # case.
   15325 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   15326   at_save_special_files
   15327 
   15328   # To avoid expanding it repeatedly, store specified stdout.
   15329   : >expout
   15330 
   15331   # Run with -Werror.
   15332   { set +x
   15333 $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Werror"
   15334 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Werror" "output.at:163"
   15335 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y -Werror
   15336 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15337 at_status=$? at_failed=false
   15338 $at_check_filter
   15339 echo stderr:; tee stderr <"$at_stderr"
   15340 $at_diff expout "$at_stdout" || at_failed=:
   15341 at_fn_check_status 1 $at_status "$at_srcdir/output.at:163"
   15342 $at_failed && at_fn_log_failure
   15343 $at_traceon; }
   15344 
   15345 
   15346   # Build expected stderr up to and including the "warnings being
   15347   # treated as errors" message.
   15348   cat >at-bison-check-warnings <<'_ATEOF'
   15349 foo.y: warning: conflicting outputs to file 'foo.output'
   15350 _ATEOF
   15351 
   15352   at_bison_check_first=`sed -n \
   15353     '/: warning: /{=;q;}' at-bison-check-warnings`
   15354   : ${at_bison_check_first:=1}
   15355   at_bison_check_first_tmp=`sed -n \
   15356     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   15357   : ${at_bison_check_first_tmp:=1}
   15358   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   15359     at_bison_check_first=$at_bison_check_first_tmp
   15360   fi
   15361   if test $at_bison_check_first -gt 1; then
   15362     sed -n "1,`expr $at_bison_check_first - 1`"p \
   15363       at-bison-check-warnings > experr
   15364   fi
   15365   echo 'bison: warnings being treated as errors' >> experr
   15366 
   15367   # Finish building expected stderr and check.  Unlike warnings,
   15368   # complaints cause bison to exit early.  Thus, with -Werror, bison
   15369   # does not necessarily report all warnings that it does without
   15370   # -Werror, but it at least reports one.
   15371   at_bison_check_last=`sed -n '$=' stderr`
   15372   : ${at_bison_check_last:=1}
   15373   at_bison_check_last=`expr $at_bison_check_last - 1`
   15374   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   15375     at-bison-check-warnings >> experr
   15376   { set +x
   15377 $as_echo "$at_srcdir/output.at:163: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   15378               stderr 1>&2"
   15379 at_fn_check_prepare_notrace 'an embedded newline' "output.at:163"
   15380 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   15381               stderr 1>&2
   15382 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15383 at_status=$? at_failed=false
   15384 $at_check_filter
   15385 $at_diff experr "$at_stderr" || at_failed=:
   15386 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15387 at_fn_check_status 0 $at_status "$at_srcdir/output.at:163"
   15388 $at_failed && at_fn_log_failure
   15389 $at_traceon; }
   15390 
   15391 
   15392   # Now check --warnings=error.
   15393   cp stderr experr
   15394   { set +x
   15395 $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=error"
   15396 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=error" "output.at:163"
   15397 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y --warnings=error
   15398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15399 at_status=$? at_failed=false
   15400 $at_check_filter
   15401 $at_diff experr "$at_stderr" || at_failed=:
   15402 $at_diff expout "$at_stdout" || at_failed=:
   15403 at_fn_check_status 1 $at_status "$at_srcdir/output.at:163"
   15404 $at_failed && at_fn_log_failure
   15405 $at_traceon; }
   15406 
   15407 
   15408   # Now check -Wnone and --warnings=none by making sure that
   15409   # -Werror doesn't change the exit status when -Wnone or
   15410   # --warnings=none is specified.
   15411   { set +x
   15412 $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Wnone -Werror"
   15413 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y -Wnone -Werror" "output.at:163"
   15414 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y -Wnone -Werror
   15415 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15416 at_status=$? at_failed=false
   15417 $at_check_filter
   15418 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15419 $at_diff expout "$at_stdout" || at_failed=:
   15420 at_fn_check_status 0 $at_status "$at_srcdir/output.at:163"
   15421 $at_failed && at_fn_log_failure
   15422 $at_traceon; }
   15423 
   15424   { set +x
   15425 $as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=none -Werror"
   15426 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v foo.y --warnings=none -Werror" "output.at:163"
   15427 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v foo.y --warnings=none -Werror
   15428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15429 at_status=$? at_failed=false
   15430 $at_check_filter
   15431 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15432 $at_diff expout "$at_stdout" || at_failed=:
   15433 at_fn_check_status 0 $at_status "$at_srcdir/output.at:163"
   15434 $at_failed && at_fn_log_failure
   15435 $at_traceon; }
   15436 
   15437 
   15438   at_restore_special_files
   15439 fi
   15440 { set +x
   15441 $as_echo "$at_srcdir/output.at:163: cat foo.y"
   15442 at_fn_check_prepare_trace "output.at:163"
   15443 ( $at_check_trace; cat foo.y
   15444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15445 at_status=$? at_failed=false
   15446 $at_check_filter
   15447 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15448 $at_diff expout "$at_stdout" || at_failed=:
   15449 at_fn_check_status 0 $at_status "$at_srcdir/output.at:163"
   15450 $at_failed && at_fn_log_failure
   15451 $at_traceon; }
   15452 
   15453   set +x
   15454   $at_times_p && times >"$at_times_file"
   15455 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   15456 read at_status <"$at_status_file"
   15457 #AT_STOP_74
   15458 #AT_START_75
   15459 at_fn_group_banner 75 'output.at:168' \
   15460   "Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\"" "" 3
   15461 at_xfail=no
   15462 (
   15463   $as_echo "75. $at_setup_line: testing $at_desc ..."
   15464   $at_traceon
   15465 
   15466 case "foo.y" in
   15467   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   15468 esac
   15469 cat >foo.y <<'_ATEOF'
   15470 %skeleton "lalr1.cc" %defines
   15471 %%
   15472 foo: {};
   15473 _ATEOF
   15474 
   15475 
   15476 cp foo.y expout
   15477 # Because an output file name conflict is still a warning, Bison exits
   15478 # with status 0, so AT_BISON_CHECK does not realize that there may be no
   15479 # output file against which to check the XML.  AT_BISON_CHECK_NO_XML
   15480 # avoids that problem.
   15481 { set +x
   15482 $as_echo "$at_srcdir/output.at:168: bison --graph=\"location.hh\" foo.y"
   15483 at_fn_check_prepare_trace "output.at:168"
   15484 ( $at_check_trace; bison --graph="location.hh" foo.y
   15485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15486 at_status=$? at_failed=false
   15487 $at_check_filter
   15488 echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'location.hh'
   15489 " | \
   15490   $at_diff - "$at_stderr" || at_failed=:
   15491 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15492 at_fn_check_status 0 $at_status "$at_srcdir/output.at:168"
   15493 $at_failed && at_fn_log_failure
   15494 $at_traceon; }
   15495 
   15496 # Defining POSIXLY_CORRECT causes bison to complain if options are
   15497 # added after the grammar file name, so skip these checks in that
   15498 # case.
   15499 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   15500   at_save_special_files
   15501 
   15502   # To avoid expanding it repeatedly, store specified stdout.
   15503   : >expout
   15504 
   15505   # Run with -Werror.
   15506   { set +x
   15507 $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Werror"
   15508 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Werror" "output.at:168"
   15509 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y -Werror
   15510 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15511 at_status=$? at_failed=false
   15512 $at_check_filter
   15513 echo stderr:; tee stderr <"$at_stderr"
   15514 $at_diff expout "$at_stdout" || at_failed=:
   15515 at_fn_check_status 1 $at_status "$at_srcdir/output.at:168"
   15516 $at_failed && at_fn_log_failure
   15517 $at_traceon; }
   15518 
   15519 
   15520   # Build expected stderr up to and including the "warnings being
   15521   # treated as errors" message.
   15522   cat >at-bison-check-warnings <<'_ATEOF'
   15523 foo.y: warning: conflicting outputs to file 'location.hh'
   15524 _ATEOF
   15525 
   15526   at_bison_check_first=`sed -n \
   15527     '/: warning: /{=;q;}' at-bison-check-warnings`
   15528   : ${at_bison_check_first:=1}
   15529   at_bison_check_first_tmp=`sed -n \
   15530     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   15531   : ${at_bison_check_first_tmp:=1}
   15532   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   15533     at_bison_check_first=$at_bison_check_first_tmp
   15534   fi
   15535   if test $at_bison_check_first -gt 1; then
   15536     sed -n "1,`expr $at_bison_check_first - 1`"p \
   15537       at-bison-check-warnings > experr
   15538   fi
   15539   echo 'bison: warnings being treated as errors' >> experr
   15540 
   15541   # Finish building expected stderr and check.  Unlike warnings,
   15542   # complaints cause bison to exit early.  Thus, with -Werror, bison
   15543   # does not necessarily report all warnings that it does without
   15544   # -Werror, but it at least reports one.
   15545   at_bison_check_last=`sed -n '$=' stderr`
   15546   : ${at_bison_check_last:=1}
   15547   at_bison_check_last=`expr $at_bison_check_last - 1`
   15548   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   15549     at-bison-check-warnings >> experr
   15550   { set +x
   15551 $as_echo "$at_srcdir/output.at:168: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   15552               stderr 1>&2"
   15553 at_fn_check_prepare_notrace 'an embedded newline' "output.at:168"
   15554 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   15555               stderr 1>&2
   15556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15557 at_status=$? at_failed=false
   15558 $at_check_filter
   15559 $at_diff experr "$at_stderr" || at_failed=:
   15560 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15561 at_fn_check_status 0 $at_status "$at_srcdir/output.at:168"
   15562 $at_failed && at_fn_log_failure
   15563 $at_traceon; }
   15564 
   15565 
   15566   # Now check --warnings=error.
   15567   cp stderr experr
   15568   { set +x
   15569 $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=error"
   15570 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=error" "output.at:168"
   15571 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y --warnings=error
   15572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15573 at_status=$? at_failed=false
   15574 $at_check_filter
   15575 $at_diff experr "$at_stderr" || at_failed=:
   15576 $at_diff expout "$at_stdout" || at_failed=:
   15577 at_fn_check_status 1 $at_status "$at_srcdir/output.at:168"
   15578 $at_failed && at_fn_log_failure
   15579 $at_traceon; }
   15580 
   15581 
   15582   # Now check -Wnone and --warnings=none by making sure that
   15583   # -Werror doesn't change the exit status when -Wnone or
   15584   # --warnings=none is specified.
   15585   { set +x
   15586 $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Wnone -Werror"
   15587 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y -Wnone -Werror" "output.at:168"
   15588 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y -Wnone -Werror
   15589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15590 at_status=$? at_failed=false
   15591 $at_check_filter
   15592 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15593 $at_diff expout "$at_stdout" || at_failed=:
   15594 at_fn_check_status 0 $at_status "$at_srcdir/output.at:168"
   15595 $at_failed && at_fn_log_failure
   15596 $at_traceon; }
   15597 
   15598   { set +x
   15599 $as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=none -Werror"
   15600 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --graph=\"location.hh\" foo.y --warnings=none -Werror" "output.at:168"
   15601 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --graph="location.hh" foo.y --warnings=none -Werror
   15602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15603 at_status=$? at_failed=false
   15604 $at_check_filter
   15605 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15606 $at_diff expout "$at_stdout" || at_failed=:
   15607 at_fn_check_status 0 $at_status "$at_srcdir/output.at:168"
   15608 $at_failed && at_fn_log_failure
   15609 $at_traceon; }
   15610 
   15611 
   15612   at_restore_special_files
   15613 fi
   15614 { set +x
   15615 $as_echo "$at_srcdir/output.at:168: cat foo.y"
   15616 at_fn_check_prepare_trace "output.at:168"
   15617 ( $at_check_trace; cat foo.y
   15618 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15619 at_status=$? at_failed=false
   15620 $at_check_filter
   15621 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15622 $at_diff expout "$at_stdout" || at_failed=:
   15623 at_fn_check_status 0 $at_status "$at_srcdir/output.at:168"
   15624 $at_failed && at_fn_log_failure
   15625 $at_traceon; }
   15626 
   15627   set +x
   15628   $at_times_p && times >"$at_times_file"
   15629 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   15630 read at_status <"$at_status_file"
   15631 #AT_STOP_75
   15632 #AT_START_76
   15633 at_fn_group_banner 76 'output.at:173' \
   15634   "Conflicting output files:  -o foo.y" "            " 3
   15635 at_xfail=no
   15636 (
   15637   $as_echo "76. $at_setup_line: testing $at_desc ..."
   15638   $at_traceon
   15639 
   15640 case "foo.y" in
   15641   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   15642 esac
   15643 cat >foo.y <<'_ATEOF'
   15644 
   15645 %%
   15646 foo: {};
   15647 _ATEOF
   15648 
   15649 
   15650 cp foo.y expout
   15651 # Because an output file name conflict is still a warning, Bison exits
   15652 # with status 0, so AT_BISON_CHECK does not realize that there may be no
   15653 # output file against which to check the XML.  AT_BISON_CHECK_NO_XML
   15654 # avoids that problem.
   15655 { set +x
   15656 $as_echo "$at_srcdir/output.at:173: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o foo.y foo.y"
   15657 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o foo.y foo.y" "output.at:173"
   15658 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o foo.y foo.y
   15659 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15660 at_status=$? at_failed=false
   15661 $at_check_filter
   15662 echo >>"$at_stderr"; $as_echo "foo.y: error: refusing to overwrite the input file 'foo.y'
   15663 " | \
   15664   $at_diff - "$at_stderr" || at_failed=:
   15665 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15666 at_fn_check_status 1 $at_status "$at_srcdir/output.at:173"
   15667 $at_failed && at_fn_log_failure
   15668 $at_traceon; }
   15669 
   15670 
   15671 { set +x
   15672 $as_echo "$at_srcdir/output.at:173: cat foo.y"
   15673 at_fn_check_prepare_trace "output.at:173"
   15674 ( $at_check_trace; cat foo.y
   15675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15676 at_status=$? at_failed=false
   15677 $at_check_filter
   15678 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15679 $at_diff expout "$at_stdout" || at_failed=:
   15680 at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
   15681 $at_failed && at_fn_log_failure
   15682 $at_traceon; }
   15683 
   15684   set +x
   15685   $at_times_p && times >"$at_times_file"
   15686 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   15687 read at_status <"$at_status_file"
   15688 #AT_STOP_76
   15689 #AT_START_77
   15690 at_fn_group_banner 77 'output.at:219' \
   15691   "Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'" "" 3
   15692 at_xfail=no
   15693 (
   15694   $as_echo "77. $at_setup_line: testing $at_desc ..."
   15695   $at_traceon
   15696 
   15697 
   15698 
   15699 # Skip if platform doesn't support file name.  For example, Cygwin
   15700 # doesn't support file names containing ":" or "\".
   15701 { set +x
   15702 $as_echo "$at_srcdir/output.at:219: touch \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.tmp\" || exit 77"
   15703 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15704 ( $at_check_trace; touch "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.tmp" || exit 77
   15705 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15706 at_status=$? at_failed=false
   15707 $at_check_filter
   15708 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15709 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15710 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15711 $at_failed && at_fn_log_failure
   15712 $at_traceon; }
   15713 
   15714 
   15715 cat >glr.y <<'_ATEOF'
   15716 %code top {
   15717 #include <config.h>
   15718 /* We don't need perfect functions for these tests. */
   15719 #undef malloc
   15720 #undef memcmp
   15721 #undef realloc
   15722 }
   15723 
   15724 %glr-parser
   15725 %code {
   15726 void yyerror ( const char *msg);
   15727 int yylex (void);
   15728 }
   15729 %%
   15730 start: {};
   15731 _ATEOF
   15732 
   15733 
   15734 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   15735   at_save_special_files
   15736   mkdir xml-tests
   15737     # Don't combine these Bison invocations since we want to be sure that
   15738   # --report=all isn't required to get the full XML file.
   15739   { set +x
   15740 $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   15741                   --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
   15742 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15743 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   15744                   --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
   15745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15746 at_status=$? at_failed=false
   15747 $at_check_filter
   15748 echo stderr:; cat "$at_stderr"
   15749 echo stdout:; cat "$at_stdout"
   15750 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15751 $at_failed && at_fn_log_failure
   15752 $at_traceon; }
   15753 
   15754   { set +x
   15755 $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
   15756 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15757 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
   15758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15759 at_status=$? at_failed=false
   15760 $at_check_filter
   15761 echo stderr:; cat "$at_stderr"
   15762 echo stdout:; cat "$at_stdout"
   15763 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15764 $at_failed && at_fn_log_failure
   15765 $at_traceon; }
   15766 
   15767     cp xml-tests/test.output expout
   15768   { set +x
   15769 $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
   15770              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   15771              xml-tests/test.xml"
   15772 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15773 ( $at_check_trace; $XSLTPROC \
   15774              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   15775              xml-tests/test.xml
   15776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15777 at_status=$? at_failed=false
   15778 $at_check_filter
   15779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15780 $at_diff expout "$at_stdout" || at_failed=:
   15781 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15782 $at_failed && at_fn_log_failure
   15783 $at_traceon; }
   15784 
   15785   sort xml-tests/test.dot > expout
   15786   { set +x
   15787 $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
   15788              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   15789              xml-tests/test.xml | sort"
   15790 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15791 ( $at_check_trace; $XSLTPROC \
   15792              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   15793              xml-tests/test.xml | sort
   15794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15795 at_status=$? at_failed=false
   15796 $at_check_filter
   15797 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15798 $at_diff expout "$at_stdout" || at_failed=:
   15799 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15800 $at_failed && at_fn_log_failure
   15801 $at_traceon; }
   15802 
   15803   rm -rf xml-tests expout
   15804   at_restore_special_files
   15805 fi
   15806 { set +x
   15807 $as_echo "$at_srcdir/output.at:219: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
   15808 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15809 ( $at_check_trace; bison -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
   15810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15811 at_status=$? at_failed=false
   15812 $at_check_filter
   15813 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15814 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15815 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15816 $at_failed && at_fn_log_failure
   15817 $at_traceon; }
   15818 
   15819 
   15820 { set +x
   15821 $as_echo "$at_srcdir/output.at:219: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\""
   15822 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15823 ( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
   15824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15825 at_status=$? at_failed=false
   15826 $at_check_filter
   15827 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15828 echo stdout:; cat "$at_stdout"
   15829 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15830 $at_failed && at_fn_log_failure
   15831 $at_traceon; }
   15832 
   15833 { set +x
   15834 $as_echo "$at_srcdir/output.at:219: \$BISON_C_WORKS"
   15835 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:219"
   15836 ( $at_check_trace; $BISON_C_WORKS
   15837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15838 at_status=$? at_failed=false
   15839 $at_check_filter
   15840 echo stderr:; cat "$at_stderr"
   15841 echo stdout:; cat "$at_stdout"
   15842 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15843 $at_failed && at_fn_log_failure
   15844 $at_traceon; }
   15845 
   15846 { set +x
   15847 $as_echo "$at_srcdir/output.at:219: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" "
   15848 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15849 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c"
   15850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15851 at_status=$? at_failed=false
   15852 $at_check_filter
   15853 echo stderr:; cat "$at_stderr"
   15854 echo stdout:; cat "$at_stdout"
   15855 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15856 $at_failed && at_fn_log_failure
   15857 $at_traceon; }
   15858 
   15859 
   15860 
   15861 cat >cxx.y <<'_ATEOF'
   15862 %code top {
   15863 #include <config.h>
   15864 /* We don't need perfect functions for these tests. */
   15865 #undef malloc
   15866 #undef memcmp
   15867 #undef realloc
   15868 }
   15869 
   15870 %skeleton "lalr1.cc"
   15871 %code { int yylex (yy::parser::semantic_type*); }
   15872 %%
   15873 start: {};
   15874 _ATEOF
   15875 
   15876 
   15877 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   15878   at_save_special_files
   15879   mkdir xml-tests
   15880     # Don't combine these Bison invocations since we want to be sure that
   15881   # --report=all isn't required to get the full XML file.
   15882   { set +x
   15883 $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   15884                   --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
   15885 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15886 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   15887                   --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y
   15888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15889 at_status=$? at_failed=false
   15890 $at_check_filter
   15891 echo stderr:; cat "$at_stderr"
   15892 echo stdout:; cat "$at_stdout"
   15893 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15894 $at_failed && at_fn_log_failure
   15895 $at_traceon; }
   15896 
   15897   { set +x
   15898 $as_echo "$at_srcdir/output.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
   15899 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15900 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y
   15901 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15902 at_status=$? at_failed=false
   15903 $at_check_filter
   15904 echo stderr:; cat "$at_stderr"
   15905 echo stdout:; cat "$at_stdout"
   15906 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15907 $at_failed && at_fn_log_failure
   15908 $at_traceon; }
   15909 
   15910     cp xml-tests/test.output expout
   15911   { set +x
   15912 $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
   15913              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   15914              xml-tests/test.xml"
   15915 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15916 ( $at_check_trace; $XSLTPROC \
   15917              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   15918              xml-tests/test.xml
   15919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15920 at_status=$? at_failed=false
   15921 $at_check_filter
   15922 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15923 $at_diff expout "$at_stdout" || at_failed=:
   15924 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15925 $at_failed && at_fn_log_failure
   15926 $at_traceon; }
   15927 
   15928   sort xml-tests/test.dot > expout
   15929   { set +x
   15930 $as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
   15931              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   15932              xml-tests/test.xml | sort"
   15933 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15934 ( $at_check_trace; $XSLTPROC \
   15935              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   15936              xml-tests/test.xml | sort
   15937 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15938 at_status=$? at_failed=false
   15939 $at_check_filter
   15940 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15941 $at_diff expout "$at_stdout" || at_failed=:
   15942 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15943 $at_failed && at_fn_log_failure
   15944 $at_traceon; }
   15945 
   15946   rm -rf xml-tests expout
   15947   at_restore_special_files
   15948 fi
   15949 { set +x
   15950 $as_echo "$at_srcdir/output.at:219: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
   15951 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15952 ( $at_check_trace; bison -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y
   15953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15954 at_status=$? at_failed=false
   15955 $at_check_filter
   15956 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15957 at_fn_diff_devnull "$at_stdout" || at_failed=:
   15958 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15959 $at_failed && at_fn_log_failure
   15960 $at_traceon; }
   15961 
   15962 
   15963 { set +x
   15964 $as_echo "$at_srcdir/output.at:219: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\""
   15965 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15966 ( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
   15967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15968 at_status=$? at_failed=false
   15969 $at_check_filter
   15970 at_fn_diff_devnull "$at_stderr" || at_failed=:
   15971 echo stdout:; cat "$at_stdout"
   15972 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15973 $at_failed && at_fn_log_failure
   15974 $at_traceon; }
   15975 
   15976 
   15977 { set +x
   15978 $as_echo "$at_srcdir/output.at:219: \$BISON_CXX_WORKS"
   15979 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:219"
   15980 ( $at_check_trace; $BISON_CXX_WORKS
   15981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15982 at_status=$? at_failed=false
   15983 $at_check_filter
   15984 echo stderr:; cat "$at_stderr"
   15985 echo stdout:; cat "$at_stdout"
   15986 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   15987 $at_failed && at_fn_log_failure
   15988 $at_traceon; }
   15989 
   15990 { set +x
   15991 $as_echo "$at_srcdir/output.at:219: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" "
   15992 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
   15993 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c"
   15994 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   15995 at_status=$? at_failed=false
   15996 $at_check_filter
   15997 echo stderr:; cat "$at_stderr"
   15998 echo stdout:; cat "$at_stdout"
   15999 at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
   16000 $at_failed && at_fn_log_failure
   16001 $at_traceon; }
   16002 
   16003 
   16004 
   16005 
   16006   set +x
   16007   $at_times_p && times >"$at_times_file"
   16008 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   16009 read at_status <"$at_status_file"
   16010 #AT_STOP_77
   16011 #AT_START_78
   16012 at_fn_group_banner 78 'output.at:226' \
   16013   "Output file name: (" "                            " 3
   16014 at_xfail=no
   16015 (
   16016   $as_echo "78. $at_setup_line: testing $at_desc ..."
   16017   $at_traceon
   16018 
   16019 
   16020 
   16021 # Skip if platform doesn't support file name.  For example, Cygwin
   16022 # doesn't support file names containing ":" or "\".
   16023 { set +x
   16024 $as_echo "$at_srcdir/output.at:226: touch \"(.tmp\" || exit 77"
   16025 at_fn_check_prepare_trace "output.at:226"
   16026 ( $at_check_trace; touch "(.tmp" || exit 77
   16027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16028 at_status=$? at_failed=false
   16029 $at_check_filter
   16030 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16031 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16032 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16033 $at_failed && at_fn_log_failure
   16034 $at_traceon; }
   16035 
   16036 
   16037 cat >glr.y <<'_ATEOF'
   16038 %code top {
   16039 #include <config.h>
   16040 /* We don't need perfect functions for these tests. */
   16041 #undef malloc
   16042 #undef memcmp
   16043 #undef realloc
   16044 }
   16045 
   16046 %glr-parser
   16047 %code {
   16048 void yyerror ( const char *msg);
   16049 int yylex (void);
   16050 }
   16051 %%
   16052 start: {};
   16053 _ATEOF
   16054 
   16055 
   16056 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   16057   at_save_special_files
   16058   mkdir xml-tests
   16059     # Don't combine these Bison invocations since we want to be sure that
   16060   # --report=all isn't required to get the full XML file.
   16061   { set +x
   16062 $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   16063                   --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" glr.y"
   16064 at_fn_check_prepare_notrace 'an embedded newline' "output.at:226"
   16065 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   16066                   --graph=xml-tests/test.dot -o "(.c" --defines="(.h" glr.y
   16067 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16068 at_status=$? at_failed=false
   16069 $at_check_filter
   16070 echo stderr:; cat "$at_stderr"
   16071 echo stdout:; cat "$at_stdout"
   16072 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16073 $at_failed && at_fn_log_failure
   16074 $at_traceon; }
   16075 
   16076   { set +x
   16077 $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y"
   16078 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y" "output.at:226"
   16079 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "(.c" --defines="(.h" glr.y
   16080 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16081 at_status=$? at_failed=false
   16082 $at_check_filter
   16083 echo stderr:; cat "$at_stderr"
   16084 echo stdout:; cat "$at_stdout"
   16085 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16086 $at_failed && at_fn_log_failure
   16087 $at_traceon; }
   16088 
   16089     cp xml-tests/test.output expout
   16090   { set +x
   16091 $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\
   16092              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   16093              xml-tests/test.xml"
   16094 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226"
   16095 ( $at_check_trace; $XSLTPROC \
   16096              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   16097              xml-tests/test.xml
   16098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16099 at_status=$? at_failed=false
   16100 $at_check_filter
   16101 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16102 $at_diff expout "$at_stdout" || at_failed=:
   16103 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16104 $at_failed && at_fn_log_failure
   16105 $at_traceon; }
   16106 
   16107   sort xml-tests/test.dot > expout
   16108   { set +x
   16109 $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\
   16110              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   16111              xml-tests/test.xml | sort"
   16112 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226"
   16113 ( $at_check_trace; $XSLTPROC \
   16114              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   16115              xml-tests/test.xml | sort
   16116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16117 at_status=$? at_failed=false
   16118 $at_check_filter
   16119 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16120 $at_diff expout "$at_stdout" || at_failed=:
   16121 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16122 $at_failed && at_fn_log_failure
   16123 $at_traceon; }
   16124 
   16125   rm -rf xml-tests expout
   16126   at_restore_special_files
   16127 fi
   16128 { set +x
   16129 $as_echo "$at_srcdir/output.at:226: bison -o \"(.c\" --defines=\"(.h\" glr.y"
   16130 at_fn_check_prepare_trace "output.at:226"
   16131 ( $at_check_trace; bison -o "(.c" --defines="(.h" glr.y
   16132 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16133 at_status=$? at_failed=false
   16134 $at_check_filter
   16135 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16136 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16137 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16138 $at_failed && at_fn_log_failure
   16139 $at_traceon; }
   16140 
   16141 
   16142 { set +x
   16143 $as_echo "$at_srcdir/output.at:226: ls \"(.c\" \"(.h\""
   16144 at_fn_check_prepare_trace "output.at:226"
   16145 ( $at_check_trace; ls "(.c" "(.h"
   16146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16147 at_status=$? at_failed=false
   16148 $at_check_filter
   16149 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16150 echo stdout:; cat "$at_stdout"
   16151 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16152 $at_failed && at_fn_log_failure
   16153 $at_traceon; }
   16154 
   16155 { set +x
   16156 $as_echo "$at_srcdir/output.at:226: \$BISON_C_WORKS"
   16157 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:226"
   16158 ( $at_check_trace; $BISON_C_WORKS
   16159 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16160 at_status=$? at_failed=false
   16161 $at_check_filter
   16162 echo stderr:; cat "$at_stderr"
   16163 echo stdout:; cat "$at_stdout"
   16164 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16165 $at_failed && at_fn_log_failure
   16166 $at_traceon; }
   16167 
   16168 { set +x
   16169 $as_echo "$at_srcdir/output.at:226: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"(.c\" "
   16170 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"(.c\" " "output.at:226"
   16171 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "(.c"
   16172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16173 at_status=$? at_failed=false
   16174 $at_check_filter
   16175 echo stderr:; cat "$at_stderr"
   16176 echo stdout:; cat "$at_stdout"
   16177 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16178 $at_failed && at_fn_log_failure
   16179 $at_traceon; }
   16180 
   16181 
   16182 
   16183 cat >cxx.y <<'_ATEOF'
   16184 %code top {
   16185 #include <config.h>
   16186 /* We don't need perfect functions for these tests. */
   16187 #undef malloc
   16188 #undef memcmp
   16189 #undef realloc
   16190 }
   16191 
   16192 %skeleton "lalr1.cc"
   16193 %code { int yylex (yy::parser::semantic_type*); }
   16194 %%
   16195 start: {};
   16196 _ATEOF
   16197 
   16198 
   16199 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   16200   at_save_special_files
   16201   mkdir xml-tests
   16202     # Don't combine these Bison invocations since we want to be sure that
   16203   # --report=all isn't required to get the full XML file.
   16204   { set +x
   16205 $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   16206                   --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" cxx.y"
   16207 at_fn_check_prepare_notrace 'an embedded newline' "output.at:226"
   16208 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   16209                   --graph=xml-tests/test.dot -o "(.c" --defines="(.h" cxx.y
   16210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16211 at_status=$? at_failed=false
   16212 $at_check_filter
   16213 echo stderr:; cat "$at_stderr"
   16214 echo stdout:; cat "$at_stdout"
   16215 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16216 $at_failed && at_fn_log_failure
   16217 $at_traceon; }
   16218 
   16219   { set +x
   16220 $as_echo "$at_srcdir/output.at:226: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" cxx.y"
   16221 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" cxx.y" "output.at:226"
   16222 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "(.c" --defines="(.h" cxx.y
   16223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16224 at_status=$? at_failed=false
   16225 $at_check_filter
   16226 echo stderr:; cat "$at_stderr"
   16227 echo stdout:; cat "$at_stdout"
   16228 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16229 $at_failed && at_fn_log_failure
   16230 $at_traceon; }
   16231 
   16232     cp xml-tests/test.output expout
   16233   { set +x
   16234 $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\
   16235              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   16236              xml-tests/test.xml"
   16237 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226"
   16238 ( $at_check_trace; $XSLTPROC \
   16239              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   16240              xml-tests/test.xml
   16241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16242 at_status=$? at_failed=false
   16243 $at_check_filter
   16244 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16245 $at_diff expout "$at_stdout" || at_failed=:
   16246 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16247 $at_failed && at_fn_log_failure
   16248 $at_traceon; }
   16249 
   16250   sort xml-tests/test.dot > expout
   16251   { set +x
   16252 $as_echo "$at_srcdir/output.at:226: \$XSLTPROC \\
   16253              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   16254              xml-tests/test.xml | sort"
   16255 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226"
   16256 ( $at_check_trace; $XSLTPROC \
   16257              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   16258              xml-tests/test.xml | sort
   16259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16260 at_status=$? at_failed=false
   16261 $at_check_filter
   16262 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16263 $at_diff expout "$at_stdout" || at_failed=:
   16264 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16265 $at_failed && at_fn_log_failure
   16266 $at_traceon; }
   16267 
   16268   rm -rf xml-tests expout
   16269   at_restore_special_files
   16270 fi
   16271 { set +x
   16272 $as_echo "$at_srcdir/output.at:226: bison -o \"(.c\" --defines=\"(.h\" cxx.y"
   16273 at_fn_check_prepare_trace "output.at:226"
   16274 ( $at_check_trace; bison -o "(.c" --defines="(.h" cxx.y
   16275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16276 at_status=$? at_failed=false
   16277 $at_check_filter
   16278 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16279 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16280 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16281 $at_failed && at_fn_log_failure
   16282 $at_traceon; }
   16283 
   16284 
   16285 { set +x
   16286 $as_echo "$at_srcdir/output.at:226: ls \"(.c\" \"(.h\""
   16287 at_fn_check_prepare_trace "output.at:226"
   16288 ( $at_check_trace; ls "(.c" "(.h"
   16289 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16290 at_status=$? at_failed=false
   16291 $at_check_filter
   16292 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16293 echo stdout:; cat "$at_stdout"
   16294 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16295 $at_failed && at_fn_log_failure
   16296 $at_traceon; }
   16297 
   16298 
   16299 { set +x
   16300 $as_echo "$at_srcdir/output.at:226: \$BISON_CXX_WORKS"
   16301 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:226"
   16302 ( $at_check_trace; $BISON_CXX_WORKS
   16303 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16304 at_status=$? at_failed=false
   16305 $at_check_filter
   16306 echo stderr:; cat "$at_stderr"
   16307 echo stdout:; cat "$at_stdout"
   16308 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16309 $at_failed && at_fn_log_failure
   16310 $at_traceon; }
   16311 
   16312 { set +x
   16313 $as_echo "$at_srcdir/output.at:226: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"(.c\" "
   16314 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"(.c\" " "output.at:226"
   16315 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "(.c"
   16316 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16317 at_status=$? at_failed=false
   16318 $at_check_filter
   16319 echo stderr:; cat "$at_stderr"
   16320 echo stdout:; cat "$at_stdout"
   16321 at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
   16322 $at_failed && at_fn_log_failure
   16323 $at_traceon; }
   16324 
   16325 
   16326 
   16327 
   16328   set +x
   16329   $at_times_p && times >"$at_times_file"
   16330 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   16331 read at_status <"$at_status_file"
   16332 #AT_STOP_78
   16333 #AT_START_79
   16334 at_fn_group_banner 79 'output.at:227' \
   16335   "Output file name: )" "                            " 3
   16336 at_xfail=no
   16337 (
   16338   $as_echo "79. $at_setup_line: testing $at_desc ..."
   16339   $at_traceon
   16340 
   16341 
   16342 
   16343 # Skip if platform doesn't support file name.  For example, Cygwin
   16344 # doesn't support file names containing ":" or "\".
   16345 { set +x
   16346 $as_echo "$at_srcdir/output.at:227: touch \").tmp\" || exit 77"
   16347 at_fn_check_prepare_trace "output.at:227"
   16348 ( $at_check_trace; touch ").tmp" || exit 77
   16349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16350 at_status=$? at_failed=false
   16351 $at_check_filter
   16352 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16353 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16354 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16355 $at_failed && at_fn_log_failure
   16356 $at_traceon; }
   16357 
   16358 
   16359 cat >glr.y <<'_ATEOF'
   16360 %code top {
   16361 #include <config.h>
   16362 /* We don't need perfect functions for these tests. */
   16363 #undef malloc
   16364 #undef memcmp
   16365 #undef realloc
   16366 }
   16367 
   16368 %glr-parser
   16369 %code {
   16370 void yyerror ( const char *msg);
   16371 int yylex (void);
   16372 }
   16373 %%
   16374 start: {};
   16375 _ATEOF
   16376 
   16377 
   16378 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   16379   at_save_special_files
   16380   mkdir xml-tests
   16381     # Don't combine these Bison invocations since we want to be sure that
   16382   # --report=all isn't required to get the full XML file.
   16383   { set +x
   16384 $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   16385                   --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" glr.y"
   16386 at_fn_check_prepare_notrace 'an embedded newline' "output.at:227"
   16387 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   16388                   --graph=xml-tests/test.dot -o ").c" --defines=").h" glr.y
   16389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16390 at_status=$? at_failed=false
   16391 $at_check_filter
   16392 echo stderr:; cat "$at_stderr"
   16393 echo stdout:; cat "$at_stdout"
   16394 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16395 $at_failed && at_fn_log_failure
   16396 $at_traceon; }
   16397 
   16398   { set +x
   16399 $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y"
   16400 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y" "output.at:227"
   16401 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o ").c" --defines=").h" glr.y
   16402 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16403 at_status=$? at_failed=false
   16404 $at_check_filter
   16405 echo stderr:; cat "$at_stderr"
   16406 echo stdout:; cat "$at_stdout"
   16407 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16408 $at_failed && at_fn_log_failure
   16409 $at_traceon; }
   16410 
   16411     cp xml-tests/test.output expout
   16412   { set +x
   16413 $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\
   16414              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   16415              xml-tests/test.xml"
   16416 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227"
   16417 ( $at_check_trace; $XSLTPROC \
   16418              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   16419              xml-tests/test.xml
   16420 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16421 at_status=$? at_failed=false
   16422 $at_check_filter
   16423 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16424 $at_diff expout "$at_stdout" || at_failed=:
   16425 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16426 $at_failed && at_fn_log_failure
   16427 $at_traceon; }
   16428 
   16429   sort xml-tests/test.dot > expout
   16430   { set +x
   16431 $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\
   16432              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   16433              xml-tests/test.xml | sort"
   16434 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227"
   16435 ( $at_check_trace; $XSLTPROC \
   16436              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   16437              xml-tests/test.xml | sort
   16438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16439 at_status=$? at_failed=false
   16440 $at_check_filter
   16441 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16442 $at_diff expout "$at_stdout" || at_failed=:
   16443 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16444 $at_failed && at_fn_log_failure
   16445 $at_traceon; }
   16446 
   16447   rm -rf xml-tests expout
   16448   at_restore_special_files
   16449 fi
   16450 { set +x
   16451 $as_echo "$at_srcdir/output.at:227: bison -o \").c\" --defines=\").h\" glr.y"
   16452 at_fn_check_prepare_trace "output.at:227"
   16453 ( $at_check_trace; bison -o ").c" --defines=").h" glr.y
   16454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16455 at_status=$? at_failed=false
   16456 $at_check_filter
   16457 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16458 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16459 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16460 $at_failed && at_fn_log_failure
   16461 $at_traceon; }
   16462 
   16463 
   16464 { set +x
   16465 $as_echo "$at_srcdir/output.at:227: ls \").c\" \").h\""
   16466 at_fn_check_prepare_trace "output.at:227"
   16467 ( $at_check_trace; ls ").c" ").h"
   16468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16469 at_status=$? at_failed=false
   16470 $at_check_filter
   16471 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16472 echo stdout:; cat "$at_stdout"
   16473 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16474 $at_failed && at_fn_log_failure
   16475 $at_traceon; }
   16476 
   16477 { set +x
   16478 $as_echo "$at_srcdir/output.at:227: \$BISON_C_WORKS"
   16479 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:227"
   16480 ( $at_check_trace; $BISON_C_WORKS
   16481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16482 at_status=$? at_failed=false
   16483 $at_check_filter
   16484 echo stderr:; cat "$at_stderr"
   16485 echo stdout:; cat "$at_stdout"
   16486 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16487 $at_failed && at_fn_log_failure
   16488 $at_traceon; }
   16489 
   16490 { set +x
   16491 $as_echo "$at_srcdir/output.at:227: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \").c\" "
   16492 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \").c\" " "output.at:227"
   16493 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c ").c"
   16494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16495 at_status=$? at_failed=false
   16496 $at_check_filter
   16497 echo stderr:; cat "$at_stderr"
   16498 echo stdout:; cat "$at_stdout"
   16499 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16500 $at_failed && at_fn_log_failure
   16501 $at_traceon; }
   16502 
   16503 
   16504 
   16505 cat >cxx.y <<'_ATEOF'
   16506 %code top {
   16507 #include <config.h>
   16508 /* We don't need perfect functions for these tests. */
   16509 #undef malloc
   16510 #undef memcmp
   16511 #undef realloc
   16512 }
   16513 
   16514 %skeleton "lalr1.cc"
   16515 %code { int yylex (yy::parser::semantic_type*); }
   16516 %%
   16517 start: {};
   16518 _ATEOF
   16519 
   16520 
   16521 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   16522   at_save_special_files
   16523   mkdir xml-tests
   16524     # Don't combine these Bison invocations since we want to be sure that
   16525   # --report=all isn't required to get the full XML file.
   16526   { set +x
   16527 $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   16528                   --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" cxx.y"
   16529 at_fn_check_prepare_notrace 'an embedded newline' "output.at:227"
   16530 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   16531                   --graph=xml-tests/test.dot -o ").c" --defines=").h" cxx.y
   16532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16533 at_status=$? at_failed=false
   16534 $at_check_filter
   16535 echo stderr:; cat "$at_stderr"
   16536 echo stdout:; cat "$at_stdout"
   16537 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16538 $at_failed && at_fn_log_failure
   16539 $at_traceon; }
   16540 
   16541   { set +x
   16542 $as_echo "$at_srcdir/output.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" cxx.y"
   16543 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" cxx.y" "output.at:227"
   16544 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o ").c" --defines=").h" cxx.y
   16545 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16546 at_status=$? at_failed=false
   16547 $at_check_filter
   16548 echo stderr:; cat "$at_stderr"
   16549 echo stdout:; cat "$at_stdout"
   16550 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16551 $at_failed && at_fn_log_failure
   16552 $at_traceon; }
   16553 
   16554     cp xml-tests/test.output expout
   16555   { set +x
   16556 $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\
   16557              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   16558              xml-tests/test.xml"
   16559 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227"
   16560 ( $at_check_trace; $XSLTPROC \
   16561              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   16562              xml-tests/test.xml
   16563 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16564 at_status=$? at_failed=false
   16565 $at_check_filter
   16566 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16567 $at_diff expout "$at_stdout" || at_failed=:
   16568 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16569 $at_failed && at_fn_log_failure
   16570 $at_traceon; }
   16571 
   16572   sort xml-tests/test.dot > expout
   16573   { set +x
   16574 $as_echo "$at_srcdir/output.at:227: \$XSLTPROC \\
   16575              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   16576              xml-tests/test.xml | sort"
   16577 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:227"
   16578 ( $at_check_trace; $XSLTPROC \
   16579              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   16580              xml-tests/test.xml | sort
   16581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16582 at_status=$? at_failed=false
   16583 $at_check_filter
   16584 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16585 $at_diff expout "$at_stdout" || at_failed=:
   16586 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16587 $at_failed && at_fn_log_failure
   16588 $at_traceon; }
   16589 
   16590   rm -rf xml-tests expout
   16591   at_restore_special_files
   16592 fi
   16593 { set +x
   16594 $as_echo "$at_srcdir/output.at:227: bison -o \").c\" --defines=\").h\" cxx.y"
   16595 at_fn_check_prepare_trace "output.at:227"
   16596 ( $at_check_trace; bison -o ").c" --defines=").h" cxx.y
   16597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16598 at_status=$? at_failed=false
   16599 $at_check_filter
   16600 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16601 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16602 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16603 $at_failed && at_fn_log_failure
   16604 $at_traceon; }
   16605 
   16606 
   16607 { set +x
   16608 $as_echo "$at_srcdir/output.at:227: ls \").c\" \").h\""
   16609 at_fn_check_prepare_trace "output.at:227"
   16610 ( $at_check_trace; ls ").c" ").h"
   16611 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16612 at_status=$? at_failed=false
   16613 $at_check_filter
   16614 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16615 echo stdout:; cat "$at_stdout"
   16616 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16617 $at_failed && at_fn_log_failure
   16618 $at_traceon; }
   16619 
   16620 
   16621 { set +x
   16622 $as_echo "$at_srcdir/output.at:227: \$BISON_CXX_WORKS"
   16623 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:227"
   16624 ( $at_check_trace; $BISON_CXX_WORKS
   16625 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16626 at_status=$? at_failed=false
   16627 $at_check_filter
   16628 echo stderr:; cat "$at_stderr"
   16629 echo stdout:; cat "$at_stdout"
   16630 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16631 $at_failed && at_fn_log_failure
   16632 $at_traceon; }
   16633 
   16634 { set +x
   16635 $as_echo "$at_srcdir/output.at:227: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \").c\" "
   16636 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \").c\" " "output.at:227"
   16637 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c ").c"
   16638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16639 at_status=$? at_failed=false
   16640 $at_check_filter
   16641 echo stderr:; cat "$at_stderr"
   16642 echo stdout:; cat "$at_stdout"
   16643 at_fn_check_status 0 $at_status "$at_srcdir/output.at:227"
   16644 $at_failed && at_fn_log_failure
   16645 $at_traceon; }
   16646 
   16647 
   16648 
   16649 
   16650   set +x
   16651   $at_times_p && times >"$at_times_file"
   16652 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   16653 read at_status <"$at_status_file"
   16654 #AT_STOP_79
   16655 #AT_START_80
   16656 at_fn_group_banner 80 'output.at:228' \
   16657   "Output file name: #" "                            " 3
   16658 at_xfail=no
   16659 (
   16660   $as_echo "80. $at_setup_line: testing $at_desc ..."
   16661   $at_traceon
   16662 
   16663 
   16664 
   16665 # Skip if platform doesn't support file name.  For example, Cygwin
   16666 # doesn't support file names containing ":" or "\".
   16667 { set +x
   16668 $as_echo "$at_srcdir/output.at:228: touch \"#.tmp\" || exit 77"
   16669 at_fn_check_prepare_trace "output.at:228"
   16670 ( $at_check_trace; touch "#.tmp" || exit 77
   16671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16672 at_status=$? at_failed=false
   16673 $at_check_filter
   16674 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16675 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16676 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16677 $at_failed && at_fn_log_failure
   16678 $at_traceon; }
   16679 
   16680 
   16681 cat >glr.y <<'_ATEOF'
   16682 %code top {
   16683 #include <config.h>
   16684 /* We don't need perfect functions for these tests. */
   16685 #undef malloc
   16686 #undef memcmp
   16687 #undef realloc
   16688 }
   16689 
   16690 %glr-parser
   16691 %code {
   16692 void yyerror ( const char *msg);
   16693 int yylex (void);
   16694 }
   16695 %%
   16696 start: {};
   16697 _ATEOF
   16698 
   16699 
   16700 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   16701   at_save_special_files
   16702   mkdir xml-tests
   16703     # Don't combine these Bison invocations since we want to be sure that
   16704   # --report=all isn't required to get the full XML file.
   16705   { set +x
   16706 $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   16707                   --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" glr.y"
   16708 at_fn_check_prepare_notrace 'an embedded newline' "output.at:228"
   16709 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   16710                   --graph=xml-tests/test.dot -o "#.c" --defines="#.h" glr.y
   16711 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16712 at_status=$? at_failed=false
   16713 $at_check_filter
   16714 echo stderr:; cat "$at_stderr"
   16715 echo stdout:; cat "$at_stdout"
   16716 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16717 $at_failed && at_fn_log_failure
   16718 $at_traceon; }
   16719 
   16720   { set +x
   16721 $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y"
   16722 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y" "output.at:228"
   16723 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "#.c" --defines="#.h" glr.y
   16724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16725 at_status=$? at_failed=false
   16726 $at_check_filter
   16727 echo stderr:; cat "$at_stderr"
   16728 echo stdout:; cat "$at_stdout"
   16729 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16730 $at_failed && at_fn_log_failure
   16731 $at_traceon; }
   16732 
   16733     cp xml-tests/test.output expout
   16734   { set +x
   16735 $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\
   16736              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   16737              xml-tests/test.xml"
   16738 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228"
   16739 ( $at_check_trace; $XSLTPROC \
   16740              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   16741              xml-tests/test.xml
   16742 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16743 at_status=$? at_failed=false
   16744 $at_check_filter
   16745 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16746 $at_diff expout "$at_stdout" || at_failed=:
   16747 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16748 $at_failed && at_fn_log_failure
   16749 $at_traceon; }
   16750 
   16751   sort xml-tests/test.dot > expout
   16752   { set +x
   16753 $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\
   16754              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   16755              xml-tests/test.xml | sort"
   16756 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228"
   16757 ( $at_check_trace; $XSLTPROC \
   16758              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   16759              xml-tests/test.xml | sort
   16760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16761 at_status=$? at_failed=false
   16762 $at_check_filter
   16763 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16764 $at_diff expout "$at_stdout" || at_failed=:
   16765 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16766 $at_failed && at_fn_log_failure
   16767 $at_traceon; }
   16768 
   16769   rm -rf xml-tests expout
   16770   at_restore_special_files
   16771 fi
   16772 { set +x
   16773 $as_echo "$at_srcdir/output.at:228: bison -o \"#.c\" --defines=\"#.h\" glr.y"
   16774 at_fn_check_prepare_trace "output.at:228"
   16775 ( $at_check_trace; bison -o "#.c" --defines="#.h" glr.y
   16776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16777 at_status=$? at_failed=false
   16778 $at_check_filter
   16779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16780 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16781 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16782 $at_failed && at_fn_log_failure
   16783 $at_traceon; }
   16784 
   16785 
   16786 { set +x
   16787 $as_echo "$at_srcdir/output.at:228: ls \"#.c\" \"#.h\""
   16788 at_fn_check_prepare_trace "output.at:228"
   16789 ( $at_check_trace; ls "#.c" "#.h"
   16790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16791 at_status=$? at_failed=false
   16792 $at_check_filter
   16793 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16794 echo stdout:; cat "$at_stdout"
   16795 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16796 $at_failed && at_fn_log_failure
   16797 $at_traceon; }
   16798 
   16799 { set +x
   16800 $as_echo "$at_srcdir/output.at:228: \$BISON_C_WORKS"
   16801 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:228"
   16802 ( $at_check_trace; $BISON_C_WORKS
   16803 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16804 at_status=$? at_failed=false
   16805 $at_check_filter
   16806 echo stderr:; cat "$at_stderr"
   16807 echo stdout:; cat "$at_stdout"
   16808 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16809 $at_failed && at_fn_log_failure
   16810 $at_traceon; }
   16811 
   16812 { set +x
   16813 $as_echo "$at_srcdir/output.at:228: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"#.c\" "
   16814 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"#.c\" " "output.at:228"
   16815 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "#.c"
   16816 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16817 at_status=$? at_failed=false
   16818 $at_check_filter
   16819 echo stderr:; cat "$at_stderr"
   16820 echo stdout:; cat "$at_stdout"
   16821 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16822 $at_failed && at_fn_log_failure
   16823 $at_traceon; }
   16824 
   16825 
   16826 
   16827 cat >cxx.y <<'_ATEOF'
   16828 %code top {
   16829 #include <config.h>
   16830 /* We don't need perfect functions for these tests. */
   16831 #undef malloc
   16832 #undef memcmp
   16833 #undef realloc
   16834 }
   16835 
   16836 %skeleton "lalr1.cc"
   16837 %code { int yylex (yy::parser::semantic_type*); }
   16838 %%
   16839 start: {};
   16840 _ATEOF
   16841 
   16842 
   16843 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   16844   at_save_special_files
   16845   mkdir xml-tests
   16846     # Don't combine these Bison invocations since we want to be sure that
   16847   # --report=all isn't required to get the full XML file.
   16848   { set +x
   16849 $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   16850                   --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" cxx.y"
   16851 at_fn_check_prepare_notrace 'an embedded newline' "output.at:228"
   16852 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   16853                   --graph=xml-tests/test.dot -o "#.c" --defines="#.h" cxx.y
   16854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16855 at_status=$? at_failed=false
   16856 $at_check_filter
   16857 echo stderr:; cat "$at_stderr"
   16858 echo stdout:; cat "$at_stdout"
   16859 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16860 $at_failed && at_fn_log_failure
   16861 $at_traceon; }
   16862 
   16863   { set +x
   16864 $as_echo "$at_srcdir/output.at:228: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" cxx.y"
   16865 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" cxx.y" "output.at:228"
   16866 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "#.c" --defines="#.h" cxx.y
   16867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16868 at_status=$? at_failed=false
   16869 $at_check_filter
   16870 echo stderr:; cat "$at_stderr"
   16871 echo stdout:; cat "$at_stdout"
   16872 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16873 $at_failed && at_fn_log_failure
   16874 $at_traceon; }
   16875 
   16876     cp xml-tests/test.output expout
   16877   { set +x
   16878 $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\
   16879              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   16880              xml-tests/test.xml"
   16881 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228"
   16882 ( $at_check_trace; $XSLTPROC \
   16883              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   16884              xml-tests/test.xml
   16885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16886 at_status=$? at_failed=false
   16887 $at_check_filter
   16888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16889 $at_diff expout "$at_stdout" || at_failed=:
   16890 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16891 $at_failed && at_fn_log_failure
   16892 $at_traceon; }
   16893 
   16894   sort xml-tests/test.dot > expout
   16895   { set +x
   16896 $as_echo "$at_srcdir/output.at:228: \$XSLTPROC \\
   16897              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   16898              xml-tests/test.xml | sort"
   16899 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:228"
   16900 ( $at_check_trace; $XSLTPROC \
   16901              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   16902              xml-tests/test.xml | sort
   16903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16904 at_status=$? at_failed=false
   16905 $at_check_filter
   16906 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16907 $at_diff expout "$at_stdout" || at_failed=:
   16908 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16909 $at_failed && at_fn_log_failure
   16910 $at_traceon; }
   16911 
   16912   rm -rf xml-tests expout
   16913   at_restore_special_files
   16914 fi
   16915 { set +x
   16916 $as_echo "$at_srcdir/output.at:228: bison -o \"#.c\" --defines=\"#.h\" cxx.y"
   16917 at_fn_check_prepare_trace "output.at:228"
   16918 ( $at_check_trace; bison -o "#.c" --defines="#.h" cxx.y
   16919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16920 at_status=$? at_failed=false
   16921 $at_check_filter
   16922 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16923 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16924 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16925 $at_failed && at_fn_log_failure
   16926 $at_traceon; }
   16927 
   16928 
   16929 { set +x
   16930 $as_echo "$at_srcdir/output.at:228: ls \"#.c\" \"#.h\""
   16931 at_fn_check_prepare_trace "output.at:228"
   16932 ( $at_check_trace; ls "#.c" "#.h"
   16933 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16934 at_status=$? at_failed=false
   16935 $at_check_filter
   16936 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16937 echo stdout:; cat "$at_stdout"
   16938 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16939 $at_failed && at_fn_log_failure
   16940 $at_traceon; }
   16941 
   16942 
   16943 { set +x
   16944 $as_echo "$at_srcdir/output.at:228: \$BISON_CXX_WORKS"
   16945 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:228"
   16946 ( $at_check_trace; $BISON_CXX_WORKS
   16947 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16948 at_status=$? at_failed=false
   16949 $at_check_filter
   16950 echo stderr:; cat "$at_stderr"
   16951 echo stdout:; cat "$at_stdout"
   16952 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16953 $at_failed && at_fn_log_failure
   16954 $at_traceon; }
   16955 
   16956 { set +x
   16957 $as_echo "$at_srcdir/output.at:228: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"#.c\" "
   16958 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"#.c\" " "output.at:228"
   16959 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "#.c"
   16960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16961 at_status=$? at_failed=false
   16962 $at_check_filter
   16963 echo stderr:; cat "$at_stderr"
   16964 echo stdout:; cat "$at_stdout"
   16965 at_fn_check_status 0 $at_status "$at_srcdir/output.at:228"
   16966 $at_failed && at_fn_log_failure
   16967 $at_traceon; }
   16968 
   16969 
   16970 
   16971 
   16972   set +x
   16973   $at_times_p && times >"$at_times_file"
   16974 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   16975 read at_status <"$at_status_file"
   16976 #AT_STOP_80
   16977 #AT_START_81
   16978 at_fn_group_banner 81 'output.at:229' \
   16979   "Output file name: @@" "                           " 3
   16980 at_xfail=no
   16981 (
   16982   $as_echo "81. $at_setup_line: testing $at_desc ..."
   16983   $at_traceon
   16984 
   16985 
   16986 
   16987 # Skip if platform doesn't support file name.  For example, Cygwin
   16988 # doesn't support file names containing ":" or "\".
   16989 { set +x
   16990 $as_echo "$at_srcdir/output.at:229: touch \"@@.tmp\" || exit 77"
   16991 at_fn_check_prepare_trace "output.at:229"
   16992 ( $at_check_trace; touch "@@.tmp" || exit 77
   16993 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   16994 at_status=$? at_failed=false
   16995 $at_check_filter
   16996 at_fn_diff_devnull "$at_stderr" || at_failed=:
   16997 at_fn_diff_devnull "$at_stdout" || at_failed=:
   16998 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   16999 $at_failed && at_fn_log_failure
   17000 $at_traceon; }
   17001 
   17002 
   17003 cat >glr.y <<'_ATEOF'
   17004 %code top {
   17005 #include <config.h>
   17006 /* We don't need perfect functions for these tests. */
   17007 #undef malloc
   17008 #undef memcmp
   17009 #undef realloc
   17010 }
   17011 
   17012 %glr-parser
   17013 %code {
   17014 void yyerror ( const char *msg);
   17015 int yylex (void);
   17016 }
   17017 %%
   17018 start: {};
   17019 _ATEOF
   17020 
   17021 
   17022 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17023   at_save_special_files
   17024   mkdir xml-tests
   17025     # Don't combine these Bison invocations since we want to be sure that
   17026   # --report=all isn't required to get the full XML file.
   17027   { set +x
   17028 $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17029                   --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" glr.y"
   17030 at_fn_check_prepare_notrace 'an embedded newline' "output.at:229"
   17031 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17032                   --graph=xml-tests/test.dot -o "@@.c" --defines="@@.h" glr.y
   17033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17034 at_status=$? at_failed=false
   17035 $at_check_filter
   17036 echo stderr:; cat "$at_stderr"
   17037 echo stdout:; cat "$at_stdout"
   17038 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17039 $at_failed && at_fn_log_failure
   17040 $at_traceon; }
   17041 
   17042   { set +x
   17043 $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y"
   17044 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y" "output.at:229"
   17045 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" glr.y
   17046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17047 at_status=$? at_failed=false
   17048 $at_check_filter
   17049 echo stderr:; cat "$at_stderr"
   17050 echo stdout:; cat "$at_stdout"
   17051 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17052 $at_failed && at_fn_log_failure
   17053 $at_traceon; }
   17054 
   17055     cp xml-tests/test.output expout
   17056   { set +x
   17057 $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\
   17058              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   17059              xml-tests/test.xml"
   17060 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229"
   17061 ( $at_check_trace; $XSLTPROC \
   17062              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   17063              xml-tests/test.xml
   17064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17065 at_status=$? at_failed=false
   17066 $at_check_filter
   17067 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17068 $at_diff expout "$at_stdout" || at_failed=:
   17069 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17070 $at_failed && at_fn_log_failure
   17071 $at_traceon; }
   17072 
   17073   sort xml-tests/test.dot > expout
   17074   { set +x
   17075 $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\
   17076              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   17077              xml-tests/test.xml | sort"
   17078 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229"
   17079 ( $at_check_trace; $XSLTPROC \
   17080              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   17081              xml-tests/test.xml | sort
   17082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17083 at_status=$? at_failed=false
   17084 $at_check_filter
   17085 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17086 $at_diff expout "$at_stdout" || at_failed=:
   17087 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17088 $at_failed && at_fn_log_failure
   17089 $at_traceon; }
   17090 
   17091   rm -rf xml-tests expout
   17092   at_restore_special_files
   17093 fi
   17094 { set +x
   17095 $as_echo "$at_srcdir/output.at:229: bison -o \"@@.c\" --defines=\"@@.h\" glr.y"
   17096 at_fn_check_prepare_trace "output.at:229"
   17097 ( $at_check_trace; bison -o "@@.c" --defines="@@.h" glr.y
   17098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17099 at_status=$? at_failed=false
   17100 $at_check_filter
   17101 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17102 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17103 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17104 $at_failed && at_fn_log_failure
   17105 $at_traceon; }
   17106 
   17107 
   17108 { set +x
   17109 $as_echo "$at_srcdir/output.at:229: ls \"@@.c\" \"@@.h\""
   17110 at_fn_check_prepare_trace "output.at:229"
   17111 ( $at_check_trace; ls "@@.c" "@@.h"
   17112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17113 at_status=$? at_failed=false
   17114 $at_check_filter
   17115 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17116 echo stdout:; cat "$at_stdout"
   17117 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17118 $at_failed && at_fn_log_failure
   17119 $at_traceon; }
   17120 
   17121 { set +x
   17122 $as_echo "$at_srcdir/output.at:229: \$BISON_C_WORKS"
   17123 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:229"
   17124 ( $at_check_trace; $BISON_C_WORKS
   17125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17126 at_status=$? at_failed=false
   17127 $at_check_filter
   17128 echo stderr:; cat "$at_stderr"
   17129 echo stdout:; cat "$at_stdout"
   17130 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17131 $at_failed && at_fn_log_failure
   17132 $at_traceon; }
   17133 
   17134 { set +x
   17135 $as_echo "$at_srcdir/output.at:229: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@@.c\" "
   17136 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@@.c\" " "output.at:229"
   17137 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@@.c"
   17138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17139 at_status=$? at_failed=false
   17140 $at_check_filter
   17141 echo stderr:; cat "$at_stderr"
   17142 echo stdout:; cat "$at_stdout"
   17143 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17144 $at_failed && at_fn_log_failure
   17145 $at_traceon; }
   17146 
   17147 
   17148 
   17149 cat >cxx.y <<'_ATEOF'
   17150 %code top {
   17151 #include <config.h>
   17152 /* We don't need perfect functions for these tests. */
   17153 #undef malloc
   17154 #undef memcmp
   17155 #undef realloc
   17156 }
   17157 
   17158 %skeleton "lalr1.cc"
   17159 %code { int yylex (yy::parser::semantic_type*); }
   17160 %%
   17161 start: {};
   17162 _ATEOF
   17163 
   17164 
   17165 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17166   at_save_special_files
   17167   mkdir xml-tests
   17168     # Don't combine these Bison invocations since we want to be sure that
   17169   # --report=all isn't required to get the full XML file.
   17170   { set +x
   17171 $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17172                   --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" cxx.y"
   17173 at_fn_check_prepare_notrace 'an embedded newline' "output.at:229"
   17174 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17175                   --graph=xml-tests/test.dot -o "@@.c" --defines="@@.h" cxx.y
   17176 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17177 at_status=$? at_failed=false
   17178 $at_check_filter
   17179 echo stderr:; cat "$at_stderr"
   17180 echo stdout:; cat "$at_stdout"
   17181 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17182 $at_failed && at_fn_log_failure
   17183 $at_traceon; }
   17184 
   17185   { set +x
   17186 $as_echo "$at_srcdir/output.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" cxx.y"
   17187 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" cxx.y" "output.at:229"
   17188 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" cxx.y
   17189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17190 at_status=$? at_failed=false
   17191 $at_check_filter
   17192 echo stderr:; cat "$at_stderr"
   17193 echo stdout:; cat "$at_stdout"
   17194 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17195 $at_failed && at_fn_log_failure
   17196 $at_traceon; }
   17197 
   17198     cp xml-tests/test.output expout
   17199   { set +x
   17200 $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\
   17201              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   17202              xml-tests/test.xml"
   17203 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229"
   17204 ( $at_check_trace; $XSLTPROC \
   17205              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   17206              xml-tests/test.xml
   17207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17208 at_status=$? at_failed=false
   17209 $at_check_filter
   17210 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17211 $at_diff expout "$at_stdout" || at_failed=:
   17212 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17213 $at_failed && at_fn_log_failure
   17214 $at_traceon; }
   17215 
   17216   sort xml-tests/test.dot > expout
   17217   { set +x
   17218 $as_echo "$at_srcdir/output.at:229: \$XSLTPROC \\
   17219              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   17220              xml-tests/test.xml | sort"
   17221 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:229"
   17222 ( $at_check_trace; $XSLTPROC \
   17223              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   17224              xml-tests/test.xml | sort
   17225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17226 at_status=$? at_failed=false
   17227 $at_check_filter
   17228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17229 $at_diff expout "$at_stdout" || at_failed=:
   17230 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17231 $at_failed && at_fn_log_failure
   17232 $at_traceon; }
   17233 
   17234   rm -rf xml-tests expout
   17235   at_restore_special_files
   17236 fi
   17237 { set +x
   17238 $as_echo "$at_srcdir/output.at:229: bison -o \"@@.c\" --defines=\"@@.h\" cxx.y"
   17239 at_fn_check_prepare_trace "output.at:229"
   17240 ( $at_check_trace; bison -o "@@.c" --defines="@@.h" cxx.y
   17241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17242 at_status=$? at_failed=false
   17243 $at_check_filter
   17244 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17245 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17246 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17247 $at_failed && at_fn_log_failure
   17248 $at_traceon; }
   17249 
   17250 
   17251 { set +x
   17252 $as_echo "$at_srcdir/output.at:229: ls \"@@.c\" \"@@.h\""
   17253 at_fn_check_prepare_trace "output.at:229"
   17254 ( $at_check_trace; ls "@@.c" "@@.h"
   17255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17256 at_status=$? at_failed=false
   17257 $at_check_filter
   17258 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17259 echo stdout:; cat "$at_stdout"
   17260 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17261 $at_failed && at_fn_log_failure
   17262 $at_traceon; }
   17263 
   17264 
   17265 { set +x
   17266 $as_echo "$at_srcdir/output.at:229: \$BISON_CXX_WORKS"
   17267 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:229"
   17268 ( $at_check_trace; $BISON_CXX_WORKS
   17269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17270 at_status=$? at_failed=false
   17271 $at_check_filter
   17272 echo stderr:; cat "$at_stderr"
   17273 echo stdout:; cat "$at_stdout"
   17274 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17275 $at_failed && at_fn_log_failure
   17276 $at_traceon; }
   17277 
   17278 { set +x
   17279 $as_echo "$at_srcdir/output.at:229: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@@.c\" "
   17280 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@@.c\" " "output.at:229"
   17281 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@@.c"
   17282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17283 at_status=$? at_failed=false
   17284 $at_check_filter
   17285 echo stderr:; cat "$at_stderr"
   17286 echo stdout:; cat "$at_stdout"
   17287 at_fn_check_status 0 $at_status "$at_srcdir/output.at:229"
   17288 $at_failed && at_fn_log_failure
   17289 $at_traceon; }
   17290 
   17291 
   17292 
   17293 
   17294   set +x
   17295   $at_times_p && times >"$at_times_file"
   17296 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   17297 read at_status <"$at_status_file"
   17298 #AT_STOP_81
   17299 #AT_START_82
   17300 at_fn_group_banner 82 'output.at:230' \
   17301   "Output file name: @{" "                           " 3
   17302 at_xfail=no
   17303 (
   17304   $as_echo "82. $at_setup_line: testing $at_desc ..."
   17305   $at_traceon
   17306 
   17307 
   17308 
   17309 # Skip if platform doesn't support file name.  For example, Cygwin
   17310 # doesn't support file names containing ":" or "\".
   17311 { set +x
   17312 $as_echo "$at_srcdir/output.at:230: touch \"@{.tmp\" || exit 77"
   17313 at_fn_check_prepare_trace "output.at:230"
   17314 ( $at_check_trace; touch "@{.tmp" || exit 77
   17315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17316 at_status=$? at_failed=false
   17317 $at_check_filter
   17318 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17319 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17320 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17321 $at_failed && at_fn_log_failure
   17322 $at_traceon; }
   17323 
   17324 
   17325 cat >glr.y <<'_ATEOF'
   17326 %code top {
   17327 #include <config.h>
   17328 /* We don't need perfect functions for these tests. */
   17329 #undef malloc
   17330 #undef memcmp
   17331 #undef realloc
   17332 }
   17333 
   17334 %glr-parser
   17335 %code {
   17336 void yyerror ( const char *msg);
   17337 int yylex (void);
   17338 }
   17339 %%
   17340 start: {};
   17341 _ATEOF
   17342 
   17343 
   17344 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17345   at_save_special_files
   17346   mkdir xml-tests
   17347     # Don't combine these Bison invocations since we want to be sure that
   17348   # --report=all isn't required to get the full XML file.
   17349   { set +x
   17350 $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17351                   --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" glr.y"
   17352 at_fn_check_prepare_notrace 'an embedded newline' "output.at:230"
   17353 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17354                   --graph=xml-tests/test.dot -o "@{.c" --defines="@{.h" glr.y
   17355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17356 at_status=$? at_failed=false
   17357 $at_check_filter
   17358 echo stderr:; cat "$at_stderr"
   17359 echo stdout:; cat "$at_stdout"
   17360 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17361 $at_failed && at_fn_log_failure
   17362 $at_traceon; }
   17363 
   17364   { set +x
   17365 $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y"
   17366 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y" "output.at:230"
   17367 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" glr.y
   17368 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17369 at_status=$? at_failed=false
   17370 $at_check_filter
   17371 echo stderr:; cat "$at_stderr"
   17372 echo stdout:; cat "$at_stdout"
   17373 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17374 $at_failed && at_fn_log_failure
   17375 $at_traceon; }
   17376 
   17377     cp xml-tests/test.output expout
   17378   { set +x
   17379 $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\
   17380              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   17381              xml-tests/test.xml"
   17382 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230"
   17383 ( $at_check_trace; $XSLTPROC \
   17384              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   17385              xml-tests/test.xml
   17386 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17387 at_status=$? at_failed=false
   17388 $at_check_filter
   17389 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17390 $at_diff expout "$at_stdout" || at_failed=:
   17391 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17392 $at_failed && at_fn_log_failure
   17393 $at_traceon; }
   17394 
   17395   sort xml-tests/test.dot > expout
   17396   { set +x
   17397 $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\
   17398              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   17399              xml-tests/test.xml | sort"
   17400 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230"
   17401 ( $at_check_trace; $XSLTPROC \
   17402              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   17403              xml-tests/test.xml | sort
   17404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17405 at_status=$? at_failed=false
   17406 $at_check_filter
   17407 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17408 $at_diff expout "$at_stdout" || at_failed=:
   17409 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17410 $at_failed && at_fn_log_failure
   17411 $at_traceon; }
   17412 
   17413   rm -rf xml-tests expout
   17414   at_restore_special_files
   17415 fi
   17416 { set +x
   17417 $as_echo "$at_srcdir/output.at:230: bison -o \"@{.c\" --defines=\"@{.h\" glr.y"
   17418 at_fn_check_prepare_trace "output.at:230"
   17419 ( $at_check_trace; bison -o "@{.c" --defines="@{.h" glr.y
   17420 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17421 at_status=$? at_failed=false
   17422 $at_check_filter
   17423 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17424 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17425 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17426 $at_failed && at_fn_log_failure
   17427 $at_traceon; }
   17428 
   17429 
   17430 { set +x
   17431 $as_echo "$at_srcdir/output.at:230: ls \"@{.c\" \"@{.h\""
   17432 at_fn_check_prepare_trace "output.at:230"
   17433 ( $at_check_trace; ls "@{.c" "@{.h"
   17434 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17435 at_status=$? at_failed=false
   17436 $at_check_filter
   17437 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17438 echo stdout:; cat "$at_stdout"
   17439 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17440 $at_failed && at_fn_log_failure
   17441 $at_traceon; }
   17442 
   17443 { set +x
   17444 $as_echo "$at_srcdir/output.at:230: \$BISON_C_WORKS"
   17445 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:230"
   17446 ( $at_check_trace; $BISON_C_WORKS
   17447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17448 at_status=$? at_failed=false
   17449 $at_check_filter
   17450 echo stderr:; cat "$at_stderr"
   17451 echo stdout:; cat "$at_stdout"
   17452 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17453 $at_failed && at_fn_log_failure
   17454 $at_traceon; }
   17455 
   17456 { set +x
   17457 $as_echo "$at_srcdir/output.at:230: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@{.c\" "
   17458 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@{.c\" " "output.at:230"
   17459 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@{.c"
   17460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17461 at_status=$? at_failed=false
   17462 $at_check_filter
   17463 echo stderr:; cat "$at_stderr"
   17464 echo stdout:; cat "$at_stdout"
   17465 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17466 $at_failed && at_fn_log_failure
   17467 $at_traceon; }
   17468 
   17469 
   17470 
   17471 cat >cxx.y <<'_ATEOF'
   17472 %code top {
   17473 #include <config.h>
   17474 /* We don't need perfect functions for these tests. */
   17475 #undef malloc
   17476 #undef memcmp
   17477 #undef realloc
   17478 }
   17479 
   17480 %skeleton "lalr1.cc"
   17481 %code { int yylex (yy::parser::semantic_type*); }
   17482 %%
   17483 start: {};
   17484 _ATEOF
   17485 
   17486 
   17487 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17488   at_save_special_files
   17489   mkdir xml-tests
   17490     # Don't combine these Bison invocations since we want to be sure that
   17491   # --report=all isn't required to get the full XML file.
   17492   { set +x
   17493 $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17494                   --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" cxx.y"
   17495 at_fn_check_prepare_notrace 'an embedded newline' "output.at:230"
   17496 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17497                   --graph=xml-tests/test.dot -o "@{.c" --defines="@{.h" cxx.y
   17498 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17499 at_status=$? at_failed=false
   17500 $at_check_filter
   17501 echo stderr:; cat "$at_stderr"
   17502 echo stdout:; cat "$at_stdout"
   17503 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17504 $at_failed && at_fn_log_failure
   17505 $at_traceon; }
   17506 
   17507   { set +x
   17508 $as_echo "$at_srcdir/output.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" cxx.y"
   17509 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" cxx.y" "output.at:230"
   17510 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" cxx.y
   17511 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17512 at_status=$? at_failed=false
   17513 $at_check_filter
   17514 echo stderr:; cat "$at_stderr"
   17515 echo stdout:; cat "$at_stdout"
   17516 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17517 $at_failed && at_fn_log_failure
   17518 $at_traceon; }
   17519 
   17520     cp xml-tests/test.output expout
   17521   { set +x
   17522 $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\
   17523              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   17524              xml-tests/test.xml"
   17525 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230"
   17526 ( $at_check_trace; $XSLTPROC \
   17527              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   17528              xml-tests/test.xml
   17529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17530 at_status=$? at_failed=false
   17531 $at_check_filter
   17532 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17533 $at_diff expout "$at_stdout" || at_failed=:
   17534 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17535 $at_failed && at_fn_log_failure
   17536 $at_traceon; }
   17537 
   17538   sort xml-tests/test.dot > expout
   17539   { set +x
   17540 $as_echo "$at_srcdir/output.at:230: \$XSLTPROC \\
   17541              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   17542              xml-tests/test.xml | sort"
   17543 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:230"
   17544 ( $at_check_trace; $XSLTPROC \
   17545              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   17546              xml-tests/test.xml | sort
   17547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17548 at_status=$? at_failed=false
   17549 $at_check_filter
   17550 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17551 $at_diff expout "$at_stdout" || at_failed=:
   17552 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17553 $at_failed && at_fn_log_failure
   17554 $at_traceon; }
   17555 
   17556   rm -rf xml-tests expout
   17557   at_restore_special_files
   17558 fi
   17559 { set +x
   17560 $as_echo "$at_srcdir/output.at:230: bison -o \"@{.c\" --defines=\"@{.h\" cxx.y"
   17561 at_fn_check_prepare_trace "output.at:230"
   17562 ( $at_check_trace; bison -o "@{.c" --defines="@{.h" cxx.y
   17563 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17564 at_status=$? at_failed=false
   17565 $at_check_filter
   17566 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17567 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17568 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17569 $at_failed && at_fn_log_failure
   17570 $at_traceon; }
   17571 
   17572 
   17573 { set +x
   17574 $as_echo "$at_srcdir/output.at:230: ls \"@{.c\" \"@{.h\""
   17575 at_fn_check_prepare_trace "output.at:230"
   17576 ( $at_check_trace; ls "@{.c" "@{.h"
   17577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17578 at_status=$? at_failed=false
   17579 $at_check_filter
   17580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17581 echo stdout:; cat "$at_stdout"
   17582 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17583 $at_failed && at_fn_log_failure
   17584 $at_traceon; }
   17585 
   17586 
   17587 { set +x
   17588 $as_echo "$at_srcdir/output.at:230: \$BISON_CXX_WORKS"
   17589 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:230"
   17590 ( $at_check_trace; $BISON_CXX_WORKS
   17591 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17592 at_status=$? at_failed=false
   17593 $at_check_filter
   17594 echo stderr:; cat "$at_stderr"
   17595 echo stdout:; cat "$at_stdout"
   17596 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17597 $at_failed && at_fn_log_failure
   17598 $at_traceon; }
   17599 
   17600 { set +x
   17601 $as_echo "$at_srcdir/output.at:230: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@{.c\" "
   17602 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@{.c\" " "output.at:230"
   17603 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@{.c"
   17604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17605 at_status=$? at_failed=false
   17606 $at_check_filter
   17607 echo stderr:; cat "$at_stderr"
   17608 echo stdout:; cat "$at_stdout"
   17609 at_fn_check_status 0 $at_status "$at_srcdir/output.at:230"
   17610 $at_failed && at_fn_log_failure
   17611 $at_traceon; }
   17612 
   17613 
   17614 
   17615 
   17616   set +x
   17617   $at_times_p && times >"$at_times_file"
   17618 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   17619 read at_status <"$at_status_file"
   17620 #AT_STOP_82
   17621 #AT_START_83
   17622 at_fn_group_banner 83 'output.at:231' \
   17623   "Output file name: @}" "                           " 3
   17624 at_xfail=no
   17625 (
   17626   $as_echo "83. $at_setup_line: testing $at_desc ..."
   17627   $at_traceon
   17628 
   17629 
   17630 
   17631 # Skip if platform doesn't support file name.  For example, Cygwin
   17632 # doesn't support file names containing ":" or "\".
   17633 { set +x
   17634 $as_echo "$at_srcdir/output.at:231: touch \"@}.tmp\" || exit 77"
   17635 at_fn_check_prepare_trace "output.at:231"
   17636 ( $at_check_trace; touch "@}.tmp" || exit 77
   17637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17638 at_status=$? at_failed=false
   17639 $at_check_filter
   17640 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17641 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17642 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17643 $at_failed && at_fn_log_failure
   17644 $at_traceon; }
   17645 
   17646 
   17647 cat >glr.y <<'_ATEOF'
   17648 %code top {
   17649 #include <config.h>
   17650 /* We don't need perfect functions for these tests. */
   17651 #undef malloc
   17652 #undef memcmp
   17653 #undef realloc
   17654 }
   17655 
   17656 %glr-parser
   17657 %code {
   17658 void yyerror ( const char *msg);
   17659 int yylex (void);
   17660 }
   17661 %%
   17662 start: {};
   17663 _ATEOF
   17664 
   17665 
   17666 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17667   at_save_special_files
   17668   mkdir xml-tests
   17669     # Don't combine these Bison invocations since we want to be sure that
   17670   # --report=all isn't required to get the full XML file.
   17671   { set +x
   17672 $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17673                   --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" glr.y"
   17674 at_fn_check_prepare_notrace 'an embedded newline' "output.at:231"
   17675 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17676                   --graph=xml-tests/test.dot -o "@}.c" --defines="@}.h" glr.y
   17677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17678 at_status=$? at_failed=false
   17679 $at_check_filter
   17680 echo stderr:; cat "$at_stderr"
   17681 echo stdout:; cat "$at_stdout"
   17682 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17683 $at_failed && at_fn_log_failure
   17684 $at_traceon; }
   17685 
   17686   { set +x
   17687 $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y"
   17688 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y" "output.at:231"
   17689 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" glr.y
   17690 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17691 at_status=$? at_failed=false
   17692 $at_check_filter
   17693 echo stderr:; cat "$at_stderr"
   17694 echo stdout:; cat "$at_stdout"
   17695 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17696 $at_failed && at_fn_log_failure
   17697 $at_traceon; }
   17698 
   17699     cp xml-tests/test.output expout
   17700   { set +x
   17701 $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\
   17702              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   17703              xml-tests/test.xml"
   17704 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231"
   17705 ( $at_check_trace; $XSLTPROC \
   17706              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   17707              xml-tests/test.xml
   17708 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17709 at_status=$? at_failed=false
   17710 $at_check_filter
   17711 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17712 $at_diff expout "$at_stdout" || at_failed=:
   17713 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17714 $at_failed && at_fn_log_failure
   17715 $at_traceon; }
   17716 
   17717   sort xml-tests/test.dot > expout
   17718   { set +x
   17719 $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\
   17720              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   17721              xml-tests/test.xml | sort"
   17722 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231"
   17723 ( $at_check_trace; $XSLTPROC \
   17724              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   17725              xml-tests/test.xml | sort
   17726 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17727 at_status=$? at_failed=false
   17728 $at_check_filter
   17729 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17730 $at_diff expout "$at_stdout" || at_failed=:
   17731 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17732 $at_failed && at_fn_log_failure
   17733 $at_traceon; }
   17734 
   17735   rm -rf xml-tests expout
   17736   at_restore_special_files
   17737 fi
   17738 { set +x
   17739 $as_echo "$at_srcdir/output.at:231: bison -o \"@}.c\" --defines=\"@}.h\" glr.y"
   17740 at_fn_check_prepare_trace "output.at:231"
   17741 ( $at_check_trace; bison -o "@}.c" --defines="@}.h" glr.y
   17742 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17743 at_status=$? at_failed=false
   17744 $at_check_filter
   17745 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17746 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17747 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17748 $at_failed && at_fn_log_failure
   17749 $at_traceon; }
   17750 
   17751 
   17752 { set +x
   17753 $as_echo "$at_srcdir/output.at:231: ls \"@}.c\" \"@}.h\""
   17754 at_fn_check_prepare_trace "output.at:231"
   17755 ( $at_check_trace; ls "@}.c" "@}.h"
   17756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17757 at_status=$? at_failed=false
   17758 $at_check_filter
   17759 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17760 echo stdout:; cat "$at_stdout"
   17761 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17762 $at_failed && at_fn_log_failure
   17763 $at_traceon; }
   17764 
   17765 { set +x
   17766 $as_echo "$at_srcdir/output.at:231: \$BISON_C_WORKS"
   17767 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:231"
   17768 ( $at_check_trace; $BISON_C_WORKS
   17769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17770 at_status=$? at_failed=false
   17771 $at_check_filter
   17772 echo stderr:; cat "$at_stderr"
   17773 echo stdout:; cat "$at_stdout"
   17774 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17775 $at_failed && at_fn_log_failure
   17776 $at_traceon; }
   17777 
   17778 { set +x
   17779 $as_echo "$at_srcdir/output.at:231: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@}.c\" "
   17780 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@}.c\" " "output.at:231"
   17781 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@}.c"
   17782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17783 at_status=$? at_failed=false
   17784 $at_check_filter
   17785 echo stderr:; cat "$at_stderr"
   17786 echo stdout:; cat "$at_stdout"
   17787 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17788 $at_failed && at_fn_log_failure
   17789 $at_traceon; }
   17790 
   17791 
   17792 
   17793 cat >cxx.y <<'_ATEOF'
   17794 %code top {
   17795 #include <config.h>
   17796 /* We don't need perfect functions for these tests. */
   17797 #undef malloc
   17798 #undef memcmp
   17799 #undef realloc
   17800 }
   17801 
   17802 %skeleton "lalr1.cc"
   17803 %code { int yylex (yy::parser::semantic_type*); }
   17804 %%
   17805 start: {};
   17806 _ATEOF
   17807 
   17808 
   17809 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17810   at_save_special_files
   17811   mkdir xml-tests
   17812     # Don't combine these Bison invocations since we want to be sure that
   17813   # --report=all isn't required to get the full XML file.
   17814   { set +x
   17815 $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17816                   --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" cxx.y"
   17817 at_fn_check_prepare_notrace 'an embedded newline' "output.at:231"
   17818 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17819                   --graph=xml-tests/test.dot -o "@}.c" --defines="@}.h" cxx.y
   17820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17821 at_status=$? at_failed=false
   17822 $at_check_filter
   17823 echo stderr:; cat "$at_stderr"
   17824 echo stdout:; cat "$at_stdout"
   17825 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17826 $at_failed && at_fn_log_failure
   17827 $at_traceon; }
   17828 
   17829   { set +x
   17830 $as_echo "$at_srcdir/output.at:231: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" cxx.y"
   17831 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" cxx.y" "output.at:231"
   17832 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" cxx.y
   17833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17834 at_status=$? at_failed=false
   17835 $at_check_filter
   17836 echo stderr:; cat "$at_stderr"
   17837 echo stdout:; cat "$at_stdout"
   17838 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17839 $at_failed && at_fn_log_failure
   17840 $at_traceon; }
   17841 
   17842     cp xml-tests/test.output expout
   17843   { set +x
   17844 $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\
   17845              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   17846              xml-tests/test.xml"
   17847 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231"
   17848 ( $at_check_trace; $XSLTPROC \
   17849              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   17850              xml-tests/test.xml
   17851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17852 at_status=$? at_failed=false
   17853 $at_check_filter
   17854 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17855 $at_diff expout "$at_stdout" || at_failed=:
   17856 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17857 $at_failed && at_fn_log_failure
   17858 $at_traceon; }
   17859 
   17860   sort xml-tests/test.dot > expout
   17861   { set +x
   17862 $as_echo "$at_srcdir/output.at:231: \$XSLTPROC \\
   17863              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   17864              xml-tests/test.xml | sort"
   17865 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231"
   17866 ( $at_check_trace; $XSLTPROC \
   17867              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   17868              xml-tests/test.xml | sort
   17869 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17870 at_status=$? at_failed=false
   17871 $at_check_filter
   17872 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17873 $at_diff expout "$at_stdout" || at_failed=:
   17874 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17875 $at_failed && at_fn_log_failure
   17876 $at_traceon; }
   17877 
   17878   rm -rf xml-tests expout
   17879   at_restore_special_files
   17880 fi
   17881 { set +x
   17882 $as_echo "$at_srcdir/output.at:231: bison -o \"@}.c\" --defines=\"@}.h\" cxx.y"
   17883 at_fn_check_prepare_trace "output.at:231"
   17884 ( $at_check_trace; bison -o "@}.c" --defines="@}.h" cxx.y
   17885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17886 at_status=$? at_failed=false
   17887 $at_check_filter
   17888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17889 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17890 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17891 $at_failed && at_fn_log_failure
   17892 $at_traceon; }
   17893 
   17894 
   17895 { set +x
   17896 $as_echo "$at_srcdir/output.at:231: ls \"@}.c\" \"@}.h\""
   17897 at_fn_check_prepare_trace "output.at:231"
   17898 ( $at_check_trace; ls "@}.c" "@}.h"
   17899 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17900 at_status=$? at_failed=false
   17901 $at_check_filter
   17902 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17903 echo stdout:; cat "$at_stdout"
   17904 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17905 $at_failed && at_fn_log_failure
   17906 $at_traceon; }
   17907 
   17908 
   17909 { set +x
   17910 $as_echo "$at_srcdir/output.at:231: \$BISON_CXX_WORKS"
   17911 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:231"
   17912 ( $at_check_trace; $BISON_CXX_WORKS
   17913 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17914 at_status=$? at_failed=false
   17915 $at_check_filter
   17916 echo stderr:; cat "$at_stderr"
   17917 echo stdout:; cat "$at_stdout"
   17918 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17919 $at_failed && at_fn_log_failure
   17920 $at_traceon; }
   17921 
   17922 { set +x
   17923 $as_echo "$at_srcdir/output.at:231: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@}.c\" "
   17924 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@}.c\" " "output.at:231"
   17925 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@}.c"
   17926 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17927 at_status=$? at_failed=false
   17928 $at_check_filter
   17929 echo stderr:; cat "$at_stderr"
   17930 echo stdout:; cat "$at_stdout"
   17931 at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
   17932 $at_failed && at_fn_log_failure
   17933 $at_traceon; }
   17934 
   17935 
   17936 
   17937 
   17938   set +x
   17939   $at_times_p && times >"$at_times_file"
   17940 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   17941 read at_status <"$at_status_file"
   17942 #AT_STOP_83
   17943 #AT_START_84
   17944 at_fn_group_banner 84 'output.at:232' \
   17945   "Output file name: [" "                            " 3
   17946 at_xfail=no
   17947 (
   17948   $as_echo "84. $at_setup_line: testing $at_desc ..."
   17949   $at_traceon
   17950 
   17951 
   17952 
   17953 # Skip if platform doesn't support file name.  For example, Cygwin
   17954 # doesn't support file names containing ":" or "\".
   17955 { set +x
   17956 $as_echo "$at_srcdir/output.at:232: touch \"[.tmp\" || exit 77"
   17957 at_fn_check_prepare_trace "output.at:232"
   17958 ( $at_check_trace; touch "[.tmp" || exit 77
   17959 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   17960 at_status=$? at_failed=false
   17961 $at_check_filter
   17962 at_fn_diff_devnull "$at_stderr" || at_failed=:
   17963 at_fn_diff_devnull "$at_stdout" || at_failed=:
   17964 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   17965 $at_failed && at_fn_log_failure
   17966 $at_traceon; }
   17967 
   17968 
   17969 cat >glr.y <<'_ATEOF'
   17970 %code top {
   17971 #include <config.h>
   17972 /* We don't need perfect functions for these tests. */
   17973 #undef malloc
   17974 #undef memcmp
   17975 #undef realloc
   17976 }
   17977 
   17978 %glr-parser
   17979 %code {
   17980 void yyerror ( const char *msg);
   17981 int yylex (void);
   17982 }
   17983 %%
   17984 start: {};
   17985 _ATEOF
   17986 
   17987 
   17988 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   17989   at_save_special_files
   17990   mkdir xml-tests
   17991     # Don't combine these Bison invocations since we want to be sure that
   17992   # --report=all isn't required to get the full XML file.
   17993   { set +x
   17994 $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   17995                   --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" glr.y"
   17996 at_fn_check_prepare_notrace 'an embedded newline' "output.at:232"
   17997 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   17998                   --graph=xml-tests/test.dot -o "[.c" --defines="[.h" glr.y
   17999 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18000 at_status=$? at_failed=false
   18001 $at_check_filter
   18002 echo stderr:; cat "$at_stderr"
   18003 echo stdout:; cat "$at_stdout"
   18004 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18005 $at_failed && at_fn_log_failure
   18006 $at_traceon; }
   18007 
   18008   { set +x
   18009 $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y"
   18010 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y" "output.at:232"
   18011 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "[.c" --defines="[.h" glr.y
   18012 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18013 at_status=$? at_failed=false
   18014 $at_check_filter
   18015 echo stderr:; cat "$at_stderr"
   18016 echo stdout:; cat "$at_stdout"
   18017 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18018 $at_failed && at_fn_log_failure
   18019 $at_traceon; }
   18020 
   18021     cp xml-tests/test.output expout
   18022   { set +x
   18023 $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\
   18024              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18025              xml-tests/test.xml"
   18026 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232"
   18027 ( $at_check_trace; $XSLTPROC \
   18028              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18029              xml-tests/test.xml
   18030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18031 at_status=$? at_failed=false
   18032 $at_check_filter
   18033 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18034 $at_diff expout "$at_stdout" || at_failed=:
   18035 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18036 $at_failed && at_fn_log_failure
   18037 $at_traceon; }
   18038 
   18039   sort xml-tests/test.dot > expout
   18040   { set +x
   18041 $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\
   18042              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18043              xml-tests/test.xml | sort"
   18044 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232"
   18045 ( $at_check_trace; $XSLTPROC \
   18046              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   18047              xml-tests/test.xml | sort
   18048 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18049 at_status=$? at_failed=false
   18050 $at_check_filter
   18051 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18052 $at_diff expout "$at_stdout" || at_failed=:
   18053 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18054 $at_failed && at_fn_log_failure
   18055 $at_traceon; }
   18056 
   18057   rm -rf xml-tests expout
   18058   at_restore_special_files
   18059 fi
   18060 { set +x
   18061 $as_echo "$at_srcdir/output.at:232: bison -o \"[.c\" --defines=\"[.h\" glr.y"
   18062 at_fn_check_prepare_trace "output.at:232"
   18063 ( $at_check_trace; bison -o "[.c" --defines="[.h" glr.y
   18064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18065 at_status=$? at_failed=false
   18066 $at_check_filter
   18067 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18068 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18069 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18070 $at_failed && at_fn_log_failure
   18071 $at_traceon; }
   18072 
   18073 
   18074 { set +x
   18075 $as_echo "$at_srcdir/output.at:232: ls \"[.c\" \"[.h\""
   18076 at_fn_check_prepare_trace "output.at:232"
   18077 ( $at_check_trace; ls "[.c" "[.h"
   18078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18079 at_status=$? at_failed=false
   18080 $at_check_filter
   18081 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18082 echo stdout:; cat "$at_stdout"
   18083 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18084 $at_failed && at_fn_log_failure
   18085 $at_traceon; }
   18086 
   18087 { set +x
   18088 $as_echo "$at_srcdir/output.at:232: \$BISON_C_WORKS"
   18089 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:232"
   18090 ( $at_check_trace; $BISON_C_WORKS
   18091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18092 at_status=$? at_failed=false
   18093 $at_check_filter
   18094 echo stderr:; cat "$at_stderr"
   18095 echo stdout:; cat "$at_stdout"
   18096 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18097 $at_failed && at_fn_log_failure
   18098 $at_traceon; }
   18099 
   18100 { set +x
   18101 $as_echo "$at_srcdir/output.at:232: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"[.c\" "
   18102 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"[.c\" " "output.at:232"
   18103 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "[.c"
   18104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18105 at_status=$? at_failed=false
   18106 $at_check_filter
   18107 echo stderr:; cat "$at_stderr"
   18108 echo stdout:; cat "$at_stdout"
   18109 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18110 $at_failed && at_fn_log_failure
   18111 $at_traceon; }
   18112 
   18113 
   18114 
   18115 cat >cxx.y <<'_ATEOF'
   18116 %code top {
   18117 #include <config.h>
   18118 /* We don't need perfect functions for these tests. */
   18119 #undef malloc
   18120 #undef memcmp
   18121 #undef realloc
   18122 }
   18123 
   18124 %skeleton "lalr1.cc"
   18125 %code { int yylex (yy::parser::semantic_type*); }
   18126 %%
   18127 start: {};
   18128 _ATEOF
   18129 
   18130 
   18131 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   18132   at_save_special_files
   18133   mkdir xml-tests
   18134     # Don't combine these Bison invocations since we want to be sure that
   18135   # --report=all isn't required to get the full XML file.
   18136   { set +x
   18137 $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   18138                   --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" cxx.y"
   18139 at_fn_check_prepare_notrace 'an embedded newline' "output.at:232"
   18140 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   18141                   --graph=xml-tests/test.dot -o "[.c" --defines="[.h" cxx.y
   18142 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18143 at_status=$? at_failed=false
   18144 $at_check_filter
   18145 echo stderr:; cat "$at_stderr"
   18146 echo stdout:; cat "$at_stdout"
   18147 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18148 $at_failed && at_fn_log_failure
   18149 $at_traceon; }
   18150 
   18151   { set +x
   18152 $as_echo "$at_srcdir/output.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" cxx.y"
   18153 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" cxx.y" "output.at:232"
   18154 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "[.c" --defines="[.h" cxx.y
   18155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18156 at_status=$? at_failed=false
   18157 $at_check_filter
   18158 echo stderr:; cat "$at_stderr"
   18159 echo stdout:; cat "$at_stdout"
   18160 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18161 $at_failed && at_fn_log_failure
   18162 $at_traceon; }
   18163 
   18164     cp xml-tests/test.output expout
   18165   { set +x
   18166 $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\
   18167              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18168              xml-tests/test.xml"
   18169 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232"
   18170 ( $at_check_trace; $XSLTPROC \
   18171              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18172              xml-tests/test.xml
   18173 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18174 at_status=$? at_failed=false
   18175 $at_check_filter
   18176 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18177 $at_diff expout "$at_stdout" || at_failed=:
   18178 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18179 $at_failed && at_fn_log_failure
   18180 $at_traceon; }
   18181 
   18182   sort xml-tests/test.dot > expout
   18183   { set +x
   18184 $as_echo "$at_srcdir/output.at:232: \$XSLTPROC \\
   18185              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18186              xml-tests/test.xml | sort"
   18187 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:232"
   18188 ( $at_check_trace; $XSLTPROC \
   18189              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   18190              xml-tests/test.xml | sort
   18191 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18192 at_status=$? at_failed=false
   18193 $at_check_filter
   18194 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18195 $at_diff expout "$at_stdout" || at_failed=:
   18196 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18197 $at_failed && at_fn_log_failure
   18198 $at_traceon; }
   18199 
   18200   rm -rf xml-tests expout
   18201   at_restore_special_files
   18202 fi
   18203 { set +x
   18204 $as_echo "$at_srcdir/output.at:232: bison -o \"[.c\" --defines=\"[.h\" cxx.y"
   18205 at_fn_check_prepare_trace "output.at:232"
   18206 ( $at_check_trace; bison -o "[.c" --defines="[.h" cxx.y
   18207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18208 at_status=$? at_failed=false
   18209 $at_check_filter
   18210 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18211 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18212 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18213 $at_failed && at_fn_log_failure
   18214 $at_traceon; }
   18215 
   18216 
   18217 { set +x
   18218 $as_echo "$at_srcdir/output.at:232: ls \"[.c\" \"[.h\""
   18219 at_fn_check_prepare_trace "output.at:232"
   18220 ( $at_check_trace; ls "[.c" "[.h"
   18221 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18222 at_status=$? at_failed=false
   18223 $at_check_filter
   18224 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18225 echo stdout:; cat "$at_stdout"
   18226 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18227 $at_failed && at_fn_log_failure
   18228 $at_traceon; }
   18229 
   18230 
   18231 { set +x
   18232 $as_echo "$at_srcdir/output.at:232: \$BISON_CXX_WORKS"
   18233 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:232"
   18234 ( $at_check_trace; $BISON_CXX_WORKS
   18235 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18236 at_status=$? at_failed=false
   18237 $at_check_filter
   18238 echo stderr:; cat "$at_stderr"
   18239 echo stdout:; cat "$at_stdout"
   18240 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18241 $at_failed && at_fn_log_failure
   18242 $at_traceon; }
   18243 
   18244 { set +x
   18245 $as_echo "$at_srcdir/output.at:232: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"[.c\" "
   18246 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"[.c\" " "output.at:232"
   18247 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "[.c"
   18248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18249 at_status=$? at_failed=false
   18250 $at_check_filter
   18251 echo stderr:; cat "$at_stderr"
   18252 echo stdout:; cat "$at_stdout"
   18253 at_fn_check_status 0 $at_status "$at_srcdir/output.at:232"
   18254 $at_failed && at_fn_log_failure
   18255 $at_traceon; }
   18256 
   18257 
   18258 
   18259 
   18260   set +x
   18261   $at_times_p && times >"$at_times_file"
   18262 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   18263 read at_status <"$at_status_file"
   18264 #AT_STOP_84
   18265 #AT_START_85
   18266 at_fn_group_banner 85 'output.at:233' \
   18267   "Output file name: ]" "                            " 3
   18268 at_xfail=no
   18269 (
   18270   $as_echo "85. $at_setup_line: testing $at_desc ..."
   18271   $at_traceon
   18272 
   18273 
   18274 
   18275 # Skip if platform doesn't support file name.  For example, Cygwin
   18276 # doesn't support file names containing ":" or "\".
   18277 { set +x
   18278 $as_echo "$at_srcdir/output.at:233: touch \"].tmp\" || exit 77"
   18279 at_fn_check_prepare_trace "output.at:233"
   18280 ( $at_check_trace; touch "].tmp" || exit 77
   18281 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18282 at_status=$? at_failed=false
   18283 $at_check_filter
   18284 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18285 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18286 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18287 $at_failed && at_fn_log_failure
   18288 $at_traceon; }
   18289 
   18290 
   18291 cat >glr.y <<'_ATEOF'
   18292 %code top {
   18293 #include <config.h>
   18294 /* We don't need perfect functions for these tests. */
   18295 #undef malloc
   18296 #undef memcmp
   18297 #undef realloc
   18298 }
   18299 
   18300 %glr-parser
   18301 %code {
   18302 void yyerror ( const char *msg);
   18303 int yylex (void);
   18304 }
   18305 %%
   18306 start: {};
   18307 _ATEOF
   18308 
   18309 
   18310 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   18311   at_save_special_files
   18312   mkdir xml-tests
   18313     # Don't combine these Bison invocations since we want to be sure that
   18314   # --report=all isn't required to get the full XML file.
   18315   { set +x
   18316 $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   18317                   --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" glr.y"
   18318 at_fn_check_prepare_notrace 'an embedded newline' "output.at:233"
   18319 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   18320                   --graph=xml-tests/test.dot -o "].c" --defines="].h" glr.y
   18321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18322 at_status=$? at_failed=false
   18323 $at_check_filter
   18324 echo stderr:; cat "$at_stderr"
   18325 echo stdout:; cat "$at_stdout"
   18326 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18327 $at_failed && at_fn_log_failure
   18328 $at_traceon; }
   18329 
   18330   { set +x
   18331 $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y"
   18332 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y" "output.at:233"
   18333 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "].c" --defines="].h" glr.y
   18334 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18335 at_status=$? at_failed=false
   18336 $at_check_filter
   18337 echo stderr:; cat "$at_stderr"
   18338 echo stdout:; cat "$at_stdout"
   18339 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18340 $at_failed && at_fn_log_failure
   18341 $at_traceon; }
   18342 
   18343     cp xml-tests/test.output expout
   18344   { set +x
   18345 $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\
   18346              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18347              xml-tests/test.xml"
   18348 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233"
   18349 ( $at_check_trace; $XSLTPROC \
   18350              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18351              xml-tests/test.xml
   18352 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18353 at_status=$? at_failed=false
   18354 $at_check_filter
   18355 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18356 $at_diff expout "$at_stdout" || at_failed=:
   18357 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18358 $at_failed && at_fn_log_failure
   18359 $at_traceon; }
   18360 
   18361   sort xml-tests/test.dot > expout
   18362   { set +x
   18363 $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\
   18364              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18365              xml-tests/test.xml | sort"
   18366 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233"
   18367 ( $at_check_trace; $XSLTPROC \
   18368              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   18369              xml-tests/test.xml | sort
   18370 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18371 at_status=$? at_failed=false
   18372 $at_check_filter
   18373 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18374 $at_diff expout "$at_stdout" || at_failed=:
   18375 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18376 $at_failed && at_fn_log_failure
   18377 $at_traceon; }
   18378 
   18379   rm -rf xml-tests expout
   18380   at_restore_special_files
   18381 fi
   18382 { set +x
   18383 $as_echo "$at_srcdir/output.at:233: bison -o \"].c\" --defines=\"].h\" glr.y"
   18384 at_fn_check_prepare_trace "output.at:233"
   18385 ( $at_check_trace; bison -o "].c" --defines="].h" glr.y
   18386 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18387 at_status=$? at_failed=false
   18388 $at_check_filter
   18389 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18390 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18391 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18392 $at_failed && at_fn_log_failure
   18393 $at_traceon; }
   18394 
   18395 
   18396 { set +x
   18397 $as_echo "$at_srcdir/output.at:233: ls \"].c\" \"].h\""
   18398 at_fn_check_prepare_trace "output.at:233"
   18399 ( $at_check_trace; ls "].c" "].h"
   18400 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18401 at_status=$? at_failed=false
   18402 $at_check_filter
   18403 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18404 echo stdout:; cat "$at_stdout"
   18405 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18406 $at_failed && at_fn_log_failure
   18407 $at_traceon; }
   18408 
   18409 { set +x
   18410 $as_echo "$at_srcdir/output.at:233: \$BISON_C_WORKS"
   18411 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:233"
   18412 ( $at_check_trace; $BISON_C_WORKS
   18413 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18414 at_status=$? at_failed=false
   18415 $at_check_filter
   18416 echo stderr:; cat "$at_stderr"
   18417 echo stdout:; cat "$at_stdout"
   18418 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18419 $at_failed && at_fn_log_failure
   18420 $at_traceon; }
   18421 
   18422 { set +x
   18423 $as_echo "$at_srcdir/output.at:233: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"].c\" "
   18424 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"].c\" " "output.at:233"
   18425 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "].c"
   18426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18427 at_status=$? at_failed=false
   18428 $at_check_filter
   18429 echo stderr:; cat "$at_stderr"
   18430 echo stdout:; cat "$at_stdout"
   18431 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18432 $at_failed && at_fn_log_failure
   18433 $at_traceon; }
   18434 
   18435 
   18436 
   18437 cat >cxx.y <<'_ATEOF'
   18438 %code top {
   18439 #include <config.h>
   18440 /* We don't need perfect functions for these tests. */
   18441 #undef malloc
   18442 #undef memcmp
   18443 #undef realloc
   18444 }
   18445 
   18446 %skeleton "lalr1.cc"
   18447 %code { int yylex (yy::parser::semantic_type*); }
   18448 %%
   18449 start: {};
   18450 _ATEOF
   18451 
   18452 
   18453 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   18454   at_save_special_files
   18455   mkdir xml-tests
   18456     # Don't combine these Bison invocations since we want to be sure that
   18457   # --report=all isn't required to get the full XML file.
   18458   { set +x
   18459 $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   18460                   --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" cxx.y"
   18461 at_fn_check_prepare_notrace 'an embedded newline' "output.at:233"
   18462 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   18463                   --graph=xml-tests/test.dot -o "].c" --defines="].h" cxx.y
   18464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18465 at_status=$? at_failed=false
   18466 $at_check_filter
   18467 echo stderr:; cat "$at_stderr"
   18468 echo stdout:; cat "$at_stdout"
   18469 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18470 $at_failed && at_fn_log_failure
   18471 $at_traceon; }
   18472 
   18473   { set +x
   18474 $as_echo "$at_srcdir/output.at:233: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" cxx.y"
   18475 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" cxx.y" "output.at:233"
   18476 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o "].c" --defines="].h" cxx.y
   18477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18478 at_status=$? at_failed=false
   18479 $at_check_filter
   18480 echo stderr:; cat "$at_stderr"
   18481 echo stdout:; cat "$at_stdout"
   18482 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18483 $at_failed && at_fn_log_failure
   18484 $at_traceon; }
   18485 
   18486     cp xml-tests/test.output expout
   18487   { set +x
   18488 $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\
   18489              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18490              xml-tests/test.xml"
   18491 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233"
   18492 ( $at_check_trace; $XSLTPROC \
   18493              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18494              xml-tests/test.xml
   18495 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18496 at_status=$? at_failed=false
   18497 $at_check_filter
   18498 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18499 $at_diff expout "$at_stdout" || at_failed=:
   18500 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18501 $at_failed && at_fn_log_failure
   18502 $at_traceon; }
   18503 
   18504   sort xml-tests/test.dot > expout
   18505   { set +x
   18506 $as_echo "$at_srcdir/output.at:233: \$XSLTPROC \\
   18507              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18508              xml-tests/test.xml | sort"
   18509 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:233"
   18510 ( $at_check_trace; $XSLTPROC \
   18511              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   18512              xml-tests/test.xml | sort
   18513 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18514 at_status=$? at_failed=false
   18515 $at_check_filter
   18516 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18517 $at_diff expout "$at_stdout" || at_failed=:
   18518 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18519 $at_failed && at_fn_log_failure
   18520 $at_traceon; }
   18521 
   18522   rm -rf xml-tests expout
   18523   at_restore_special_files
   18524 fi
   18525 { set +x
   18526 $as_echo "$at_srcdir/output.at:233: bison -o \"].c\" --defines=\"].h\" cxx.y"
   18527 at_fn_check_prepare_trace "output.at:233"
   18528 ( $at_check_trace; bison -o "].c" --defines="].h" cxx.y
   18529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18530 at_status=$? at_failed=false
   18531 $at_check_filter
   18532 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18533 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18534 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18535 $at_failed && at_fn_log_failure
   18536 $at_traceon; }
   18537 
   18538 
   18539 { set +x
   18540 $as_echo "$at_srcdir/output.at:233: ls \"].c\" \"].h\""
   18541 at_fn_check_prepare_trace "output.at:233"
   18542 ( $at_check_trace; ls "].c" "].h"
   18543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18544 at_status=$? at_failed=false
   18545 $at_check_filter
   18546 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18547 echo stdout:; cat "$at_stdout"
   18548 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18549 $at_failed && at_fn_log_failure
   18550 $at_traceon; }
   18551 
   18552 
   18553 { set +x
   18554 $as_echo "$at_srcdir/output.at:233: \$BISON_CXX_WORKS"
   18555 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:233"
   18556 ( $at_check_trace; $BISON_CXX_WORKS
   18557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18558 at_status=$? at_failed=false
   18559 $at_check_filter
   18560 echo stderr:; cat "$at_stderr"
   18561 echo stdout:; cat "$at_stdout"
   18562 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18563 $at_failed && at_fn_log_failure
   18564 $at_traceon; }
   18565 
   18566 { set +x
   18567 $as_echo "$at_srcdir/output.at:233: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"].c\" "
   18568 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"].c\" " "output.at:233"
   18569 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "].c"
   18570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18571 at_status=$? at_failed=false
   18572 $at_check_filter
   18573 echo stderr:; cat "$at_stderr"
   18574 echo stdout:; cat "$at_stdout"
   18575 at_fn_check_status 0 $at_status "$at_srcdir/output.at:233"
   18576 $at_failed && at_fn_log_failure
   18577 $at_traceon; }
   18578 
   18579 
   18580 
   18581 
   18582   set +x
   18583   $at_times_p && times >"$at_times_file"
   18584 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   18585 read at_status <"$at_status_file"
   18586 #AT_STOP_85
   18587 #AT_START_86
   18588 at_fn_group_banner 86 'output.at:260' \
   18589   "Graph with no conflicts" "                        " 3
   18590 at_xfail=no
   18591 (
   18592   $as_echo "86. $at_setup_line: testing $at_desc ..."
   18593   $at_traceon
   18594 
   18595 
   18596 cat >input.y <<'_ATEOF'
   18597 %%
   18598 exp: a '?' b;
   18599 a: ;
   18600 b: 'b';
   18601 _ATEOF
   18602 
   18603 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   18604   at_save_special_files
   18605   mkdir xml-tests
   18606     # Don't combine these Bison invocations since we want to be sure that
   18607   # --report=all isn't required to get the full XML file.
   18608   { set +x
   18609 $as_echo "$at_srcdir/output.at:260: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   18610                   --graph=xml-tests/test.dot -rall --graph input.y"
   18611 at_fn_check_prepare_notrace 'an embedded newline' "output.at:260"
   18612 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   18613                   --graph=xml-tests/test.dot -rall --graph input.y
   18614 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18615 at_status=$? at_failed=false
   18616 $at_check_filter
   18617 echo stderr:; cat "$at_stderr"
   18618 echo stdout:; cat "$at_stdout"
   18619 at_fn_check_status 0 $at_status "$at_srcdir/output.at:260"
   18620 $at_failed && at_fn_log_failure
   18621 $at_traceon; }
   18622 
   18623   { set +x
   18624 $as_echo "$at_srcdir/output.at:260: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y"
   18625 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:260"
   18626 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y
   18627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18628 at_status=$? at_failed=false
   18629 $at_check_filter
   18630 echo stderr:; cat "$at_stderr"
   18631 echo stdout:; cat "$at_stdout"
   18632 at_fn_check_status 0 $at_status "$at_srcdir/output.at:260"
   18633 $at_failed && at_fn_log_failure
   18634 $at_traceon; }
   18635 
   18636     cp xml-tests/test.output expout
   18637   { set +x
   18638 $as_echo "$at_srcdir/output.at:260: \$XSLTPROC \\
   18639              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18640              xml-tests/test.xml"
   18641 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:260"
   18642 ( $at_check_trace; $XSLTPROC \
   18643              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18644              xml-tests/test.xml
   18645 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18646 at_status=$? at_failed=false
   18647 $at_check_filter
   18648 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18649 $at_diff expout "$at_stdout" || at_failed=:
   18650 at_fn_check_status 0 $at_status "$at_srcdir/output.at:260"
   18651 $at_failed && at_fn_log_failure
   18652 $at_traceon; }
   18653 
   18654   sort xml-tests/test.dot > expout
   18655   { set +x
   18656 $as_echo "$at_srcdir/output.at:260: \$XSLTPROC \\
   18657              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18658              xml-tests/test.xml | sort"
   18659 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:260"
   18660 ( $at_check_trace; $XSLTPROC \
   18661              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   18662              xml-tests/test.xml | sort
   18663 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18664 at_status=$? at_failed=false
   18665 $at_check_filter
   18666 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18667 $at_diff expout "$at_stdout" || at_failed=:
   18668 at_fn_check_status 0 $at_status "$at_srcdir/output.at:260"
   18669 $at_failed && at_fn_log_failure
   18670 $at_traceon; }
   18671 
   18672   rm -rf xml-tests expout
   18673   at_restore_special_files
   18674 fi
   18675 { set +x
   18676 $as_echo "$at_srcdir/output.at:260: bison -rall --graph input.y"
   18677 at_fn_check_prepare_trace "output.at:260"
   18678 ( $at_check_trace; bison -rall --graph input.y
   18679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18680 at_status=$? at_failed=false
   18681 $at_check_filter
   18682 echo stderr:; cat "$at_stderr"
   18683 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18684 at_fn_check_status 0 $at_status "$at_srcdir/output.at:260"
   18685 $at_failed && at_fn_log_failure
   18686 $at_traceon; }
   18687 
   18688 
   18689 { set +x
   18690 $as_echo "$at_srcdir/output.at:260: grep -v // input.dot"
   18691 at_fn_check_prepare_trace "output.at:260"
   18692 ( $at_check_trace; grep -v // input.dot
   18693 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18694 at_status=$? at_failed=false
   18695 $at_check_filter
   18696 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18697 echo >>"$at_stdout"; $as_echo "
   18698 digraph \"input.y\"
   18699 {
   18700   node [fontname = courier, shape = box, colorscheme = paired6]
   18701   edge [fontname = courier]
   18702 
   18703   0 [label=\"State 0\\n\\l  0 \$accept: . exp \$end\\l  1 exp: . a '?' b\\l  2 a: .\\l\"]
   18704   0 -> 1 [style=dashed label=\"exp\"]
   18705   0 -> 2 [style=dashed label=\"a\"]
   18706   0 -> \"0R2\" [style=solid]
   18707  \"0R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
   18708   1 [label=\"State 1\\n\\l  0 \$accept: exp . \$end\\l\"]
   18709   1 -> 3 [style=solid label=\"\$end\"]
   18710   2 [label=\"State 2\\n\\l  1 exp: a . '?' b\\l\"]
   18711   2 -> 4 [style=solid label=\"'?'\"]
   18712   3 [label=\"State 3\\n\\l  0 \$accept: exp \$end .\\l\"]
   18713   3 -> \"3R0\" [style=solid]
   18714  \"3R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
   18715   4 [label=\"State 4\\n\\l  1 exp: a '?' . b\\l  3 b: . 'b'\\l\"]
   18716   4 -> 5 [style=solid label=\"'b'\"]
   18717   4 -> 6 [style=dashed label=\"b\"]
   18718   5 [label=\"State 5\\n\\l  3 b: 'b' .\\l\"]
   18719   5 -> \"5R3\" [style=solid]
   18720  \"5R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
   18721   6 [label=\"State 6\\n\\l  1 exp: a '?' b .\\l\"]
   18722   6 -> \"6R1\" [style=solid]
   18723  \"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
   18724 }
   18725 " | \
   18726   $at_diff - "$at_stdout" || at_failed=:
   18727 at_fn_check_status 0 $at_status "$at_srcdir/output.at:260"
   18728 $at_failed && at_fn_log_failure
   18729 $at_traceon; }
   18730 
   18731   set +x
   18732   $at_times_p && times >"$at_times_file"
   18733 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   18734 read at_status <"$at_status_file"
   18735 #AT_STOP_86
   18736 #AT_START_87
   18737 at_fn_group_banner 87 'output.at:294' \
   18738   "Graph with unsolved S/R" "                        " 3
   18739 at_xfail=no
   18740 (
   18741   $as_echo "87. $at_setup_line: testing $at_desc ..."
   18742   $at_traceon
   18743 
   18744 
   18745 cat >input.y <<'_ATEOF'
   18746 %%
   18747 start:
   18748     'a'
   18749   | empty_a 'a'
   18750   | 'b'
   18751   | empty_b 'b'
   18752   | 'c'
   18753   | empty_c 'c'
   18754   ;
   18755 empty_a: %prec 'a';
   18756 empty_b: %prec 'b';
   18757 empty_c: %prec 'c';
   18758 _ATEOF
   18759 
   18760 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   18761   at_save_special_files
   18762   mkdir xml-tests
   18763     # Don't combine these Bison invocations since we want to be sure that
   18764   # --report=all isn't required to get the full XML file.
   18765   { set +x
   18766 $as_echo "$at_srcdir/output.at:294: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   18767                   --graph=xml-tests/test.dot -rall --graph input.y"
   18768 at_fn_check_prepare_notrace 'an embedded newline' "output.at:294"
   18769 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   18770                   --graph=xml-tests/test.dot -rall --graph input.y
   18771 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18772 at_status=$? at_failed=false
   18773 $at_check_filter
   18774 echo stderr:; cat "$at_stderr"
   18775 echo stdout:; cat "$at_stdout"
   18776 at_fn_check_status 0 $at_status "$at_srcdir/output.at:294"
   18777 $at_failed && at_fn_log_failure
   18778 $at_traceon; }
   18779 
   18780   { set +x
   18781 $as_echo "$at_srcdir/output.at:294: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y"
   18782 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:294"
   18783 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y
   18784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18785 at_status=$? at_failed=false
   18786 $at_check_filter
   18787 echo stderr:; cat "$at_stderr"
   18788 echo stdout:; cat "$at_stdout"
   18789 at_fn_check_status 0 $at_status "$at_srcdir/output.at:294"
   18790 $at_failed && at_fn_log_failure
   18791 $at_traceon; }
   18792 
   18793     cp xml-tests/test.output expout
   18794   { set +x
   18795 $as_echo "$at_srcdir/output.at:294: \$XSLTPROC \\
   18796              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18797              xml-tests/test.xml"
   18798 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:294"
   18799 ( $at_check_trace; $XSLTPROC \
   18800              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18801              xml-tests/test.xml
   18802 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18803 at_status=$? at_failed=false
   18804 $at_check_filter
   18805 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18806 $at_diff expout "$at_stdout" || at_failed=:
   18807 at_fn_check_status 0 $at_status "$at_srcdir/output.at:294"
   18808 $at_failed && at_fn_log_failure
   18809 $at_traceon; }
   18810 
   18811   sort xml-tests/test.dot > expout
   18812   { set +x
   18813 $as_echo "$at_srcdir/output.at:294: \$XSLTPROC \\
   18814              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18815              xml-tests/test.xml | sort"
   18816 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:294"
   18817 ( $at_check_trace; $XSLTPROC \
   18818              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   18819              xml-tests/test.xml | sort
   18820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18821 at_status=$? at_failed=false
   18822 $at_check_filter
   18823 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18824 $at_diff expout "$at_stdout" || at_failed=:
   18825 at_fn_check_status 0 $at_status "$at_srcdir/output.at:294"
   18826 $at_failed && at_fn_log_failure
   18827 $at_traceon; }
   18828 
   18829   rm -rf xml-tests expout
   18830   at_restore_special_files
   18831 fi
   18832 { set +x
   18833 $as_echo "$at_srcdir/output.at:294: bison -rall --graph input.y"
   18834 at_fn_check_prepare_trace "output.at:294"
   18835 ( $at_check_trace; bison -rall --graph input.y
   18836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18837 at_status=$? at_failed=false
   18838 $at_check_filter
   18839 echo stderr:; cat "$at_stderr"
   18840 at_fn_diff_devnull "$at_stdout" || at_failed=:
   18841 at_fn_check_status 0 $at_status "$at_srcdir/output.at:294"
   18842 $at_failed && at_fn_log_failure
   18843 $at_traceon; }
   18844 
   18845 
   18846 { set +x
   18847 $as_echo "$at_srcdir/output.at:294: grep -v // input.dot"
   18848 at_fn_check_prepare_trace "output.at:294"
   18849 ( $at_check_trace; grep -v // input.dot
   18850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18851 at_status=$? at_failed=false
   18852 $at_check_filter
   18853 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18854 echo >>"$at_stdout"; $as_echo "
   18855 digraph \"input.y\"
   18856 {
   18857   node [fontname = courier, shape = box, colorscheme = paired6]
   18858   edge [fontname = courier]
   18859 
   18860   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: .  ['a']\\l  8 empty_b: .  ['b']\\l  9 empty_c: .  ['c']\\l\"]
   18861   0 -> 1 [style=solid label=\"'a'\"]
   18862   0 -> 2 [style=solid label=\"'b'\"]
   18863   0 -> 3 [style=solid label=\"'c'\"]
   18864   0 -> 4 [style=dashed label=\"start\"]
   18865   0 -> 5 [style=dashed label=\"empty_a\"]
   18866   0 -> 6 [style=dashed label=\"empty_b\"]
   18867   0 -> 7 [style=dashed label=\"empty_c\"]
   18868   0 -> \"0R7d\" [label=\"['a']\", style=solid]
   18869  \"0R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled]
   18870   0 -> \"0R8d\" [label=\"['b']\", style=solid]
   18871  \"0R8d\" [label=\"R8\", fillcolor=5, shape=diamond, style=filled]
   18872   0 -> \"0R9d\" [label=\"['c']\", style=solid]
   18873  \"0R9d\" [label=\"R9\", fillcolor=5, shape=diamond, style=filled]
   18874   1 [label=\"State 1\\n\\l  1 start: 'a' .\\l\"]
   18875   1 -> \"1R1\" [style=solid]
   18876  \"1R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
   18877   2 [label=\"State 2\\n\\l  3 start: 'b' .\\l\"]
   18878   2 -> \"2R3\" [style=solid]
   18879  \"2R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
   18880   3 [label=\"State 3\\n\\l  5 start: 'c' .\\l\"]
   18881   3 -> \"3R5\" [style=solid]
   18882  \"3R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
   18883   4 [label=\"State 4\\n\\l  0 \$accept: start . \$end\\l\"]
   18884   4 -> 8 [style=solid label=\"\$end\"]
   18885   5 [label=\"State 5\\n\\l  2 start: empty_a . 'a'\\l\"]
   18886   5 -> 9 [style=solid label=\"'a'\"]
   18887   6 [label=\"State 6\\n\\l  4 start: empty_b . 'b'\\l\"]
   18888   6 -> 10 [style=solid label=\"'b'\"]
   18889   7 [label=\"State 7\\n\\l  6 start: empty_c . 'c'\\l\"]
   18890   7 -> 11 [style=solid label=\"'c'\"]
   18891   8 [label=\"State 8\\n\\l  0 \$accept: start \$end .\\l\"]
   18892   8 -> \"8R0\" [style=solid]
   18893  \"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
   18894   9 [label=\"State 9\\n\\l  2 start: empty_a 'a' .\\l\"]
   18895   9 -> \"9R2\" [style=solid]
   18896  \"9R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
   18897   10 [label=\"State 10\\n\\l  4 start: empty_b 'b' .\\l\"]
   18898   10 -> \"10R4\" [style=solid]
   18899  \"10R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
   18900   11 [label=\"State 11\\n\\l  6 start: empty_c 'c' .\\l\"]
   18901   11 -> \"11R6\" [style=solid]
   18902  \"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
   18903 }
   18904 " | \
   18905   $at_diff - "$at_stdout" || at_failed=:
   18906 at_fn_check_status 0 $at_status "$at_srcdir/output.at:294"
   18907 $at_failed && at_fn_log_failure
   18908 $at_traceon; }
   18909 
   18910   set +x
   18911   $at_times_p && times >"$at_times_file"
   18912 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   18913 read at_status <"$at_status_file"
   18914 #AT_STOP_87
   18915 #AT_START_88
   18916 at_fn_group_banner 88 'output.at:358' \
   18917   "Graph with solved S/R" "                          " 3
   18918 at_xfail=no
   18919 (
   18920   $as_echo "88. $at_setup_line: testing $at_desc ..."
   18921   $at_traceon
   18922 
   18923 
   18924 cat >input.y <<'_ATEOF'
   18925 %left 'a'
   18926 %right 'b'
   18927 %right 'c'
   18928 %%
   18929 start:
   18930     'a'
   18931   | empty_a 'a'
   18932   | 'b'
   18933   | empty_b 'b'
   18934   | 'c'
   18935   | empty_c 'c'
   18936   ;
   18937 empty_a: %prec 'a';
   18938 empty_b: %prec 'b';
   18939 empty_c: %prec 'c';
   18940 _ATEOF
   18941 
   18942 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   18943   at_save_special_files
   18944   mkdir xml-tests
   18945     # Don't combine these Bison invocations since we want to be sure that
   18946   # --report=all isn't required to get the full XML file.
   18947   { set +x
   18948 $as_echo "$at_srcdir/output.at:358: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   18949                   --graph=xml-tests/test.dot -rall --graph input.y"
   18950 at_fn_check_prepare_notrace 'an embedded newline' "output.at:358"
   18951 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   18952                   --graph=xml-tests/test.dot -rall --graph input.y
   18953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18954 at_status=$? at_failed=false
   18955 $at_check_filter
   18956 echo stderr:; cat "$at_stderr"
   18957 echo stdout:; cat "$at_stdout"
   18958 at_fn_check_status 0 $at_status "$at_srcdir/output.at:358"
   18959 $at_failed && at_fn_log_failure
   18960 $at_traceon; }
   18961 
   18962   { set +x
   18963 $as_echo "$at_srcdir/output.at:358: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y"
   18964 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:358"
   18965 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y
   18966 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18967 at_status=$? at_failed=false
   18968 $at_check_filter
   18969 echo stderr:; cat "$at_stderr"
   18970 echo stdout:; cat "$at_stdout"
   18971 at_fn_check_status 0 $at_status "$at_srcdir/output.at:358"
   18972 $at_failed && at_fn_log_failure
   18973 $at_traceon; }
   18974 
   18975     cp xml-tests/test.output expout
   18976   { set +x
   18977 $as_echo "$at_srcdir/output.at:358: \$XSLTPROC \\
   18978              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   18979              xml-tests/test.xml"
   18980 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:358"
   18981 ( $at_check_trace; $XSLTPROC \
   18982              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   18983              xml-tests/test.xml
   18984 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   18985 at_status=$? at_failed=false
   18986 $at_check_filter
   18987 at_fn_diff_devnull "$at_stderr" || at_failed=:
   18988 $at_diff expout "$at_stdout" || at_failed=:
   18989 at_fn_check_status 0 $at_status "$at_srcdir/output.at:358"
   18990 $at_failed && at_fn_log_failure
   18991 $at_traceon; }
   18992 
   18993   sort xml-tests/test.dot > expout
   18994   { set +x
   18995 $as_echo "$at_srcdir/output.at:358: \$XSLTPROC \\
   18996              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   18997              xml-tests/test.xml | sort"
   18998 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:358"
   18999 ( $at_check_trace; $XSLTPROC \
   19000              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19001              xml-tests/test.xml | sort
   19002 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19003 at_status=$? at_failed=false
   19004 $at_check_filter
   19005 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19006 $at_diff expout "$at_stdout" || at_failed=:
   19007 at_fn_check_status 0 $at_status "$at_srcdir/output.at:358"
   19008 $at_failed && at_fn_log_failure
   19009 $at_traceon; }
   19010 
   19011   rm -rf xml-tests expout
   19012   at_restore_special_files
   19013 fi
   19014 { set +x
   19015 $as_echo "$at_srcdir/output.at:358: bison -rall --graph input.y"
   19016 at_fn_check_prepare_trace "output.at:358"
   19017 ( $at_check_trace; bison -rall --graph input.y
   19018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19019 at_status=$? at_failed=false
   19020 $at_check_filter
   19021 echo stderr:; cat "$at_stderr"
   19022 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19023 at_fn_check_status 0 $at_status "$at_srcdir/output.at:358"
   19024 $at_failed && at_fn_log_failure
   19025 $at_traceon; }
   19026 
   19027 
   19028 { set +x
   19029 $as_echo "$at_srcdir/output.at:358: grep -v // input.dot"
   19030 at_fn_check_prepare_trace "output.at:358"
   19031 ( $at_check_trace; grep -v // input.dot
   19032 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19033 at_status=$? at_failed=false
   19034 $at_check_filter
   19035 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19036 echo >>"$at_stdout"; $as_echo "
   19037 digraph \"input.y\"
   19038 {
   19039   node [fontname = courier, shape = box, colorscheme = paired6]
   19040   edge [fontname = courier]
   19041 
   19042   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: .  ['a']\\l  8 empty_b: .  []\\l  9 empty_c: .  []\\l\"]
   19043   0 -> 1 [style=solid label=\"'b'\"]
   19044   0 -> 2 [style=solid label=\"'c'\"]
   19045   0 -> 3 [style=dashed label=\"start\"]
   19046   0 -> 4 [style=dashed label=\"empty_a\"]
   19047   0 -> 5 [style=dashed label=\"empty_b\"]
   19048   0 -> 6 [style=dashed label=\"empty_c\"]
   19049   0 -> \"0R7\" [style=solid]
   19050  \"0R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
   19051   1 [label=\"State 1\\n\\l  3 start: 'b' .\\l\"]
   19052   1 -> \"1R3\" [style=solid]
   19053  \"1R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
   19054   2 [label=\"State 2\\n\\l  5 start: 'c' .\\l\"]
   19055   2 -> \"2R5\" [style=solid]
   19056  \"2R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
   19057   3 [label=\"State 3\\n\\l  0 \$accept: start . \$end\\l\"]
   19058   3 -> 7 [style=solid label=\"\$end\"]
   19059   4 [label=\"State 4\\n\\l  2 start: empty_a . 'a'\\l\"]
   19060   4 -> 8 [style=solid label=\"'a'\"]
   19061   5 [label=\"State 5\\n\\l  4 start: empty_b . 'b'\\l\"]
   19062   5 -> 9 [style=solid label=\"'b'\"]
   19063   6 [label=\"State 6\\n\\l  6 start: empty_c . 'c'\\l\"]
   19064   6 -> 10 [style=solid label=\"'c'\"]
   19065   7 [label=\"State 7\\n\\l  0 \$accept: start \$end .\\l\"]
   19066   7 -> \"7R0\" [style=solid]
   19067  \"7R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
   19068   8 [label=\"State 8\\n\\l  2 start: empty_a 'a' .\\l\"]
   19069   8 -> \"8R2\" [style=solid]
   19070  \"8R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
   19071   9 [label=\"State 9\\n\\l  4 start: empty_b 'b' .\\l\"]
   19072   9 -> \"9R4\" [style=solid]
   19073  \"9R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
   19074   10 [label=\"State 10\\n\\l  6 start: empty_c 'c' .\\l\"]
   19075   10 -> \"10R6\" [style=solid]
   19076  \"10R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
   19077 }
   19078 " | \
   19079   $at_diff - "$at_stdout" || at_failed=:
   19080 at_fn_check_status 0 $at_status "$at_srcdir/output.at:358"
   19081 $at_failed && at_fn_log_failure
   19082 $at_traceon; }
   19083 
   19084   set +x
   19085   $at_times_p && times >"$at_times_file"
   19086 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   19087 read at_status <"$at_status_file"
   19088 #AT_STOP_88
   19089 #AT_START_89
   19090 at_fn_group_banner 89 'output.at:417' \
   19091   "Graph with R/R" "                                 " 3
   19092 at_xfail=no
   19093 (
   19094   $as_echo "89. $at_setup_line: testing $at_desc ..."
   19095   $at_traceon
   19096 
   19097 
   19098 cat >input.y <<'_ATEOF'
   19099 %%
   19100 exp: a | b;
   19101 a: ;
   19102 b: ;
   19103 _ATEOF
   19104 
   19105 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   19106   at_save_special_files
   19107   mkdir xml-tests
   19108     # Don't combine these Bison invocations since we want to be sure that
   19109   # --report=all isn't required to get the full XML file.
   19110   { set +x
   19111 $as_echo "$at_srcdir/output.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   19112                   --graph=xml-tests/test.dot -rall --graph input.y"
   19113 at_fn_check_prepare_notrace 'an embedded newline' "output.at:417"
   19114 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   19115                   --graph=xml-tests/test.dot -rall --graph input.y
   19116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19117 at_status=$? at_failed=false
   19118 $at_check_filter
   19119 echo stderr:; cat "$at_stderr"
   19120 echo stdout:; cat "$at_stdout"
   19121 at_fn_check_status 0 $at_status "$at_srcdir/output.at:417"
   19122 $at_failed && at_fn_log_failure
   19123 $at_traceon; }
   19124 
   19125   { set +x
   19126 $as_echo "$at_srcdir/output.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y"
   19127 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:417"
   19128 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y
   19129 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19130 at_status=$? at_failed=false
   19131 $at_check_filter
   19132 echo stderr:; cat "$at_stderr"
   19133 echo stdout:; cat "$at_stdout"
   19134 at_fn_check_status 0 $at_status "$at_srcdir/output.at:417"
   19135 $at_failed && at_fn_log_failure
   19136 $at_traceon; }
   19137 
   19138     cp xml-tests/test.output expout
   19139   { set +x
   19140 $as_echo "$at_srcdir/output.at:417: \$XSLTPROC \\
   19141              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   19142              xml-tests/test.xml"
   19143 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:417"
   19144 ( $at_check_trace; $XSLTPROC \
   19145              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   19146              xml-tests/test.xml
   19147 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19148 at_status=$? at_failed=false
   19149 $at_check_filter
   19150 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19151 $at_diff expout "$at_stdout" || at_failed=:
   19152 at_fn_check_status 0 $at_status "$at_srcdir/output.at:417"
   19153 $at_failed && at_fn_log_failure
   19154 $at_traceon; }
   19155 
   19156   sort xml-tests/test.dot > expout
   19157   { set +x
   19158 $as_echo "$at_srcdir/output.at:417: \$XSLTPROC \\
   19159              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   19160              xml-tests/test.xml | sort"
   19161 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:417"
   19162 ( $at_check_trace; $XSLTPROC \
   19163              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19164              xml-tests/test.xml | sort
   19165 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19166 at_status=$? at_failed=false
   19167 $at_check_filter
   19168 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19169 $at_diff expout "$at_stdout" || at_failed=:
   19170 at_fn_check_status 0 $at_status "$at_srcdir/output.at:417"
   19171 $at_failed && at_fn_log_failure
   19172 $at_traceon; }
   19173 
   19174   rm -rf xml-tests expout
   19175   at_restore_special_files
   19176 fi
   19177 { set +x
   19178 $as_echo "$at_srcdir/output.at:417: bison -rall --graph input.y"
   19179 at_fn_check_prepare_trace "output.at:417"
   19180 ( $at_check_trace; bison -rall --graph input.y
   19181 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19182 at_status=$? at_failed=false
   19183 $at_check_filter
   19184 echo stderr:; cat "$at_stderr"
   19185 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19186 at_fn_check_status 0 $at_status "$at_srcdir/output.at:417"
   19187 $at_failed && at_fn_log_failure
   19188 $at_traceon; }
   19189 
   19190 
   19191 { set +x
   19192 $as_echo "$at_srcdir/output.at:417: grep -v // input.dot"
   19193 at_fn_check_prepare_trace "output.at:417"
   19194 ( $at_check_trace; grep -v // input.dot
   19195 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19196 at_status=$? at_failed=false
   19197 $at_check_filter
   19198 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19199 echo >>"$at_stdout"; $as_echo "
   19200 digraph \"input.y\"
   19201 {
   19202   node [fontname = courier, shape = box, colorscheme = paired6]
   19203   edge [fontname = courier]
   19204 
   19205   0 [label=\"State 0\\n\\l  0 \$accept: . exp \$end\\l  1 exp: . a\\l  2    | . b\\l  3 a: .  [\$end]\\l  4 b: .  [\$end]\\l\"]
   19206   0 -> 1 [style=dashed label=\"exp\"]
   19207   0 -> 2 [style=dashed label=\"a\"]
   19208   0 -> 3 [style=dashed label=\"b\"]
   19209   0 -> \"0R3\" [style=solid]
   19210  \"0R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
   19211   0 -> \"0R4d\" [label=\"[\$end]\", style=solid]
   19212  \"0R4d\" [label=\"R4\", fillcolor=5, shape=diamond, style=filled]
   19213   1 [label=\"State 1\\n\\l  0 \$accept: exp . \$end\\l\"]
   19214   1 -> 4 [style=solid label=\"\$end\"]
   19215   2 [label=\"State 2\\n\\l  1 exp: a .\\l\"]
   19216   2 -> \"2R1\" [style=solid]
   19217  \"2R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
   19218   3 [label=\"State 3\\n\\l  2 exp: b .\\l\"]
   19219   3 -> \"3R2\" [style=solid]
   19220  \"3R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
   19221   4 [label=\"State 4\\n\\l  0 \$accept: exp \$end .\\l\"]
   19222   4 -> \"4R0\" [style=solid]
   19223  \"4R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
   19224 }
   19225 " | \
   19226   $at_diff - "$at_stdout" || at_failed=:
   19227 at_fn_check_status 0 $at_status "$at_srcdir/output.at:417"
   19228 $at_failed && at_fn_log_failure
   19229 $at_traceon; }
   19230 
   19231   set +x
   19232   $at_times_p && times >"$at_times_file"
   19233 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   19234 read at_status <"$at_status_file"
   19235 #AT_STOP_89
   19236 #AT_START_90
   19237 at_fn_group_banner 90 'output.at:449' \
   19238   "Graph with reductions with multiple LAT" "        " 3
   19239 at_xfail=no
   19240 (
   19241   $as_echo "90. $at_setup_line: testing $at_desc ..."
   19242   $at_traceon
   19243 
   19244 
   19245 cat >input.y <<'_ATEOF'
   19246 %%
   19247 exp: a ';' | a ';' | a '.' | b '?' | b '!' | c '?' | c ';';
   19248 a: ;
   19249 b: ;
   19250 c: ;
   19251 _ATEOF
   19252 
   19253 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   19254   at_save_special_files
   19255   mkdir xml-tests
   19256     # Don't combine these Bison invocations since we want to be sure that
   19257   # --report=all isn't required to get the full XML file.
   19258   { set +x
   19259 $as_echo "$at_srcdir/output.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   19260                   --graph=xml-tests/test.dot -rall --graph input.y"
   19261 at_fn_check_prepare_notrace 'an embedded newline' "output.at:449"
   19262 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   19263                   --graph=xml-tests/test.dot -rall --graph input.y
   19264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19265 at_status=$? at_failed=false
   19266 $at_check_filter
   19267 echo stderr:; cat "$at_stderr"
   19268 echo stdout:; cat "$at_stdout"
   19269 at_fn_check_status 0 $at_status "$at_srcdir/output.at:449"
   19270 $at_failed && at_fn_log_failure
   19271 $at_traceon; }
   19272 
   19273   { set +x
   19274 $as_echo "$at_srcdir/output.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y"
   19275 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:449"
   19276 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y
   19277 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19278 at_status=$? at_failed=false
   19279 $at_check_filter
   19280 echo stderr:; cat "$at_stderr"
   19281 echo stdout:; cat "$at_stdout"
   19282 at_fn_check_status 0 $at_status "$at_srcdir/output.at:449"
   19283 $at_failed && at_fn_log_failure
   19284 $at_traceon; }
   19285 
   19286     cp xml-tests/test.output expout
   19287   { set +x
   19288 $as_echo "$at_srcdir/output.at:449: \$XSLTPROC \\
   19289              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   19290              xml-tests/test.xml"
   19291 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:449"
   19292 ( $at_check_trace; $XSLTPROC \
   19293              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   19294              xml-tests/test.xml
   19295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19296 at_status=$? at_failed=false
   19297 $at_check_filter
   19298 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19299 $at_diff expout "$at_stdout" || at_failed=:
   19300 at_fn_check_status 0 $at_status "$at_srcdir/output.at:449"
   19301 $at_failed && at_fn_log_failure
   19302 $at_traceon; }
   19303 
   19304   sort xml-tests/test.dot > expout
   19305   { set +x
   19306 $as_echo "$at_srcdir/output.at:449: \$XSLTPROC \\
   19307              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   19308              xml-tests/test.xml | sort"
   19309 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:449"
   19310 ( $at_check_trace; $XSLTPROC \
   19311              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19312              xml-tests/test.xml | sort
   19313 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19314 at_status=$? at_failed=false
   19315 $at_check_filter
   19316 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19317 $at_diff expout "$at_stdout" || at_failed=:
   19318 at_fn_check_status 0 $at_status "$at_srcdir/output.at:449"
   19319 $at_failed && at_fn_log_failure
   19320 $at_traceon; }
   19321 
   19322   rm -rf xml-tests expout
   19323   at_restore_special_files
   19324 fi
   19325 { set +x
   19326 $as_echo "$at_srcdir/output.at:449: bison -rall --graph input.y"
   19327 at_fn_check_prepare_trace "output.at:449"
   19328 ( $at_check_trace; bison -rall --graph input.y
   19329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19330 at_status=$? at_failed=false
   19331 $at_check_filter
   19332 echo stderr:; cat "$at_stderr"
   19333 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19334 at_fn_check_status 0 $at_status "$at_srcdir/output.at:449"
   19335 $at_failed && at_fn_log_failure
   19336 $at_traceon; }
   19337 
   19338 
   19339 { set +x
   19340 $as_echo "$at_srcdir/output.at:449: grep -v // input.dot"
   19341 at_fn_check_prepare_trace "output.at:449"
   19342 ( $at_check_trace; grep -v // input.dot
   19343 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19344 at_status=$? at_failed=false
   19345 $at_check_filter
   19346 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19347 echo >>"$at_stdout"; $as_echo "
   19348 digraph \"input.y\"
   19349 {
   19350   node [fontname = courier, shape = box, colorscheme = paired6]
   19351   edge [fontname = courier]
   19352 
   19353   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: .  [';', '.']\\l  9 b: .  ['?', '!']\\l 10 c: .  [';', '?']\\l\"]
   19354   0 -> 1 [style=dashed label=\"exp\"]
   19355   0 -> 2 [style=dashed label=\"a\"]
   19356   0 -> 3 [style=dashed label=\"b\"]
   19357   0 -> 4 [style=dashed label=\"c\"]
   19358   0 -> \"0R8\" [style=solid]
   19359  \"0R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled]
   19360   0 -> \"0R9\" [label=\"['?', '!']\", style=solid]
   19361  \"0R9\" [label=\"R9\", fillcolor=3, shape=diamond, style=filled]
   19362   0 -> \"0R10d\" [label=\"[';', '?']\", style=solid]
   19363  \"0R10d\" [label=\"R10\", fillcolor=5, shape=diamond, style=filled]
   19364   1 [label=\"State 1\\n\\l  0 \$accept: exp . \$end\\l\"]
   19365   1 -> 5 [style=solid label=\"\$end\"]
   19366   2 [label=\"State 2\\n\\l  1 exp: a . ';'\\l  2    | a . ';'\\l  3    | a . '.'\\l\"]
   19367   2 -> 6 [style=solid label=\"';'\"]
   19368   2 -> 7 [style=solid label=\"'.'\"]
   19369   3 [label=\"State 3\\n\\l  4 exp: b . '?'\\l  5    | b . '!'\\l\"]
   19370   3 -> 8 [style=solid label=\"'?'\"]
   19371   3 -> 9 [style=solid label=\"'!'\"]
   19372   4 [label=\"State 4\\n\\l  6 exp: c . '?'\\l  7    | c . ';'\\l\"]
   19373   4 -> 10 [style=solid label=\"';'\"]
   19374   4 -> 11 [style=solid label=\"'?'\"]
   19375   5 [label=\"State 5\\n\\l  0 \$accept: exp \$end .\\l\"]
   19376   5 -> \"5R0\" [style=solid]
   19377  \"5R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
   19378   6 [label=\"State 6\\n\\l  1 exp: a ';' .  [\$end]\\l  2    | a ';' .  [\$end]\\l\"]
   19379   6 -> \"6R1\" [style=solid]
   19380  \"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
   19381   6 -> \"6R2d\" [label=\"[\$end]\", style=solid]
   19382  \"6R2d\" [label=\"R2\", fillcolor=5, shape=diamond, style=filled]
   19383   7 [label=\"State 7\\n\\l  3 exp: a '.' .\\l\"]
   19384   7 -> \"7R3\" [style=solid]
   19385  \"7R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
   19386   8 [label=\"State 8\\n\\l  4 exp: b '?' .\\l\"]
   19387   8 -> \"8R4\" [style=solid]
   19388  \"8R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
   19389   9 [label=\"State 9\\n\\l  5 exp: b '!' .\\l\"]
   19390   9 -> \"9R5\" [style=solid]
   19391  \"9R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
   19392   10 [label=\"State 10\\n\\l  7 exp: c ';' .\\l\"]
   19393   10 -> \"10R7\" [style=solid]
   19394  \"10R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
   19395   11 [label=\"State 11\\n\\l  6 exp: c '?' .\\l\"]
   19396   11 -> \"11R6\" [style=solid]
   19397  \"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
   19398 }
   19399 " | \
   19400   $at_diff - "$at_stdout" || at_failed=:
   19401 at_fn_check_status 0 $at_status "$at_srcdir/output.at:449"
   19402 $at_failed && at_fn_log_failure
   19403 $at_traceon; }
   19404 
   19405   set +x
   19406   $at_times_p && times >"$at_times_file"
   19407 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   19408 read at_status <"$at_status_file"
   19409 #AT_STOP_90
   19410 #AT_START_91
   19411 at_fn_group_banner 91 'output.at:508' \
   19412   "Graph with a reduction rule both enabled and disabled" "" 3
   19413 at_xfail=no
   19414 (
   19415   $as_echo "91. $at_setup_line: testing $at_desc ..."
   19416   $at_traceon
   19417 
   19418 
   19419 cat >input.y <<'_ATEOF'
   19420 %%
   19421 exp: ifexp | opexp | imm;
   19422 ifexp: "if" exp "then" exp elseexp;
   19423 elseexp: "else" exp | ;
   19424 opexp: exp '+' exp;
   19425 imm: '0';
   19426 _ATEOF
   19427 
   19428 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   19429   at_save_special_files
   19430   mkdir xml-tests
   19431     # Don't combine these Bison invocations since we want to be sure that
   19432   # --report=all isn't required to get the full XML file.
   19433   { set +x
   19434 $as_echo "$at_srcdir/output.at:508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   19435                   --graph=xml-tests/test.dot -rall --graph input.y"
   19436 at_fn_check_prepare_notrace 'an embedded newline' "output.at:508"
   19437 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   19438                   --graph=xml-tests/test.dot -rall --graph input.y
   19439 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19440 at_status=$? at_failed=false
   19441 $at_check_filter
   19442 echo stderr:; cat "$at_stderr"
   19443 echo stdout:; cat "$at_stdout"
   19444 at_fn_check_status 0 $at_status "$at_srcdir/output.at:508"
   19445 $at_failed && at_fn_log_failure
   19446 $at_traceon; }
   19447 
   19448   { set +x
   19449 $as_echo "$at_srcdir/output.at:508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y"
   19450 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y" "output.at:508"
   19451 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -rall --graph input.y
   19452 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19453 at_status=$? at_failed=false
   19454 $at_check_filter
   19455 echo stderr:; cat "$at_stderr"
   19456 echo stdout:; cat "$at_stdout"
   19457 at_fn_check_status 0 $at_status "$at_srcdir/output.at:508"
   19458 $at_failed && at_fn_log_failure
   19459 $at_traceon; }
   19460 
   19461     cp xml-tests/test.output expout
   19462   { set +x
   19463 $as_echo "$at_srcdir/output.at:508: \$XSLTPROC \\
   19464              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   19465              xml-tests/test.xml"
   19466 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:508"
   19467 ( $at_check_trace; $XSLTPROC \
   19468              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   19469              xml-tests/test.xml
   19470 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19471 at_status=$? at_failed=false
   19472 $at_check_filter
   19473 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19474 $at_diff expout "$at_stdout" || at_failed=:
   19475 at_fn_check_status 0 $at_status "$at_srcdir/output.at:508"
   19476 $at_failed && at_fn_log_failure
   19477 $at_traceon; }
   19478 
   19479   sort xml-tests/test.dot > expout
   19480   { set +x
   19481 $as_echo "$at_srcdir/output.at:508: \$XSLTPROC \\
   19482              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   19483              xml-tests/test.xml | sort"
   19484 at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:508"
   19485 ( $at_check_trace; $XSLTPROC \
   19486              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19487              xml-tests/test.xml | sort
   19488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19489 at_status=$? at_failed=false
   19490 $at_check_filter
   19491 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19492 $at_diff expout "$at_stdout" || at_failed=:
   19493 at_fn_check_status 0 $at_status "$at_srcdir/output.at:508"
   19494 $at_failed && at_fn_log_failure
   19495 $at_traceon; }
   19496 
   19497   rm -rf xml-tests expout
   19498   at_restore_special_files
   19499 fi
   19500 { set +x
   19501 $as_echo "$at_srcdir/output.at:508: bison -rall --graph input.y"
   19502 at_fn_check_prepare_trace "output.at:508"
   19503 ( $at_check_trace; bison -rall --graph input.y
   19504 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19505 at_status=$? at_failed=false
   19506 $at_check_filter
   19507 echo stderr:; cat "$at_stderr"
   19508 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19509 at_fn_check_status 0 $at_status "$at_srcdir/output.at:508"
   19510 $at_failed && at_fn_log_failure
   19511 $at_traceon; }
   19512 
   19513 
   19514 { set +x
   19515 $as_echo "$at_srcdir/output.at:508: grep -v // input.dot"
   19516 at_fn_check_prepare_trace "output.at:508"
   19517 ( $at_check_trace; grep -v // input.dot
   19518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19519 at_status=$? at_failed=false
   19520 $at_check_filter
   19521 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19522 echo >>"$at_stdout"; $as_echo "
   19523 digraph \"input.y\"
   19524 {
   19525   node [fontname = courier, shape = box, colorscheme = paired6]
   19526   edge [fontname = courier]
   19527 
   19528   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\"]
   19529   0 -> 1 [style=solid label=\"\\\"if\\\"\"]
   19530   0 -> 2 [style=solid label=\"'0'\"]
   19531   0 -> 3 [style=dashed label=\"exp\"]
   19532   0 -> 4 [style=dashed label=\"ifexp\"]
   19533   0 -> 5 [style=dashed label=\"opexp\"]
   19534   0 -> 6 [style=dashed label=\"imm\"]
   19535   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\"]
   19536   1 -> 1 [style=solid label=\"\\\"if\\\"\"]
   19537   1 -> 2 [style=solid label=\"'0'\"]
   19538   1 -> 7 [style=dashed label=\"exp\"]
   19539   1 -> 4 [style=dashed label=\"ifexp\"]
   19540   1 -> 5 [style=dashed label=\"opexp\"]
   19541   1 -> 6 [style=dashed label=\"imm\"]
   19542   2 [label=\"State 2\\n\\l  8 imm: '0' .\\l\"]
   19543   2 -> \"2R8\" [style=solid]
   19544  \"2R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled]
   19545   3 [label=\"State 3\\n\\l  0 \$accept: exp . \$end\\l  7 opexp: exp . '+' exp\\l\"]
   19546   3 -> 8 [style=solid label=\"\$end\"]
   19547   3 -> 9 [style=solid label=\"'+'\"]
   19548   4 [label=\"State 4\\n\\l  1 exp: ifexp .\\l\"]
   19549   4 -> \"4R1\" [style=solid]
   19550  \"4R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
   19551   5 [label=\"State 5\\n\\l  2 exp: opexp .\\l\"]
   19552   5 -> \"5R2\" [style=solid]
   19553  \"5R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
   19554   6 [label=\"State 6\\n\\l  3 exp: imm .\\l\"]
   19555   6 -> \"6R3\" [style=solid]
   19556  \"6R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
   19557   7 [label=\"State 7\\n\\l  4 ifexp: \\\"if\\\" exp . \\\"then\\\" exp elseexp\\l  7 opexp: exp . '+' exp\\l\"]
   19558   7 -> 10 [style=solid label=\"\\\"then\\\"\"]
   19559   7 -> 9 [style=solid label=\"'+'\"]
   19560   8 [label=\"State 8\\n\\l  0 \$accept: exp \$end .\\l\"]
   19561   8 -> \"8R0\" [style=solid]
   19562  \"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
   19563   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\"]
   19564   9 -> 1 [style=solid label=\"\\\"if\\\"\"]
   19565   9 -> 2 [style=solid label=\"'0'\"]
   19566   9 -> 11 [style=dashed label=\"exp\"]
   19567   9 -> 4 [style=dashed label=\"ifexp\"]
   19568   9 -> 5 [style=dashed label=\"opexp\"]
   19569   9 -> 6 [style=dashed label=\"imm\"]
   19570   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\"]
   19571   10 -> 1 [style=solid label=\"\\\"if\\\"\"]
   19572   10 -> 2 [style=solid label=\"'0'\"]
   19573   10 -> 12 [style=dashed label=\"exp\"]
   19574   10 -> 4 [style=dashed label=\"ifexp\"]
   19575   10 -> 5 [style=dashed label=\"opexp\"]
   19576   10 -> 6 [style=dashed label=\"imm\"]
   19577   11 [label=\"State 11\\n\\l  7 opexp: exp . '+' exp\\l  7      | exp '+' exp .  [\$end, \\\"then\\\", \\\"else\\\", '+']\\l\"]
   19578   11 -> 9 [style=solid label=\"'+'\"]
   19579   11 -> \"11R7d\" [label=\"['+']\", style=solid]
   19580  \"11R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled]
   19581   11 -> \"11R7\" [style=solid]
   19582  \"11R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
   19583   12 [label=\"State 12\\n\\l  4 ifexp: \\\"if\\\" exp \\\"then\\\" exp . elseexp\\l  5 elseexp: . \\\"else\\\" exp\\l  6        | .  [\$end, \\\"then\\\", \\\"else\\\", '+']\\l  7 opexp: exp . '+' exp\\l\"]
   19584   12 -> 13 [style=solid label=\"\\\"else\\\"\"]
   19585   12 -> 9 [style=solid label=\"'+'\"]
   19586   12 -> 14 [style=dashed label=\"elseexp\"]
   19587   12 -> \"12R6d\" [label=\"[\\\"else\\\", '+']\", style=solid]
   19588  \"12R6d\" [label=\"R6\", fillcolor=5, shape=diamond, style=filled]
   19589   12 -> \"12R6\" [style=solid]
   19590  \"12R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
   19591   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\"]
   19592   13 -> 1 [style=solid label=\"\\\"if\\\"\"]
   19593   13 -> 2 [style=solid label=\"'0'\"]
   19594   13 -> 15 [style=dashed label=\"exp\"]
   19595   13 -> 4 [style=dashed label=\"ifexp\"]
   19596   13 -> 5 [style=dashed label=\"opexp\"]
   19597   13 -> 6 [style=dashed label=\"imm\"]
   19598   14 [label=\"State 14\\n\\l  4 ifexp: \\\"if\\\" exp \\\"then\\\" exp elseexp .\\l\"]
   19599   14 -> \"14R4\" [style=solid]
   19600  \"14R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
   19601   15 [label=\"State 15\\n\\l  5 elseexp: \\\"else\\\" exp .  [\$end, \\\"then\\\", \\\"else\\\", '+']\\l  7 opexp: exp . '+' exp\\l\"]
   19602   15 -> 9 [style=solid label=\"'+'\"]
   19603   15 -> \"15R5d\" [label=\"['+']\", style=solid]
   19604  \"15R5d\" [label=\"R5\", fillcolor=5, shape=diamond, style=filled]
   19605   15 -> \"15R5\" [style=solid]
   19606  \"15R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
   19607 }
   19608 " | \
   19609   $at_diff - "$at_stdout" || at_failed=:
   19610 at_fn_check_status 0 $at_status "$at_srcdir/output.at:508"
   19611 $at_failed && at_fn_log_failure
   19612 $at_traceon; }
   19613 
   19614   set +x
   19615   $at_times_p && times >"$at_times_file"
   19616 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   19617 read at_status <"$at_status_file"
   19618 #AT_STOP_91
   19619 #AT_START_92
   19620 at_fn_group_banner 92 'skeletons.at:24' \
   19621   "Relative skeleton file names" "                   " 4
   19622 at_xfail=no
   19623 (
   19624   $as_echo "92. $at_setup_line: testing $at_desc ..."
   19625   $at_traceon
   19626 
   19627 
   19628 { set +x
   19629 $as_echo "$at_srcdir/skeletons.at:26: mkdir tmp"
   19630 at_fn_check_prepare_trace "skeletons.at:26"
   19631 ( $at_check_trace; mkdir tmp
   19632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19633 at_status=$? at_failed=false
   19634 $at_check_filter
   19635 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19636 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19637 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:26"
   19638 $at_failed && at_fn_log_failure
   19639 $at_traceon; }
   19640 
   19641 
   19642 cat >tmp/skel.c <<'_ATEOF'
   19643 m4_divert_push(0)dnl
   19644 @output(b4_parser_file_name@)dnl
   19645 b4_percent_define_get([[test]])
   19646 m4_divert_pop(0)
   19647 _ATEOF
   19648 
   19649 
   19650 cat >skel.c <<'_ATEOF'
   19651 m4_divert_push(0)dnl
   19652 @output(b4_parser_file_name@)dnl
   19653 b4_percent_define_get([[test]]) -- Local
   19654 m4_divert_pop(0)
   19655 _ATEOF
   19656 
   19657 
   19658 cat >tmp/input-gram.y <<'_ATEOF'
   19659 %skeleton "./skel.c"
   19660 %define test "Hello World"
   19661 %%
   19662 start: ;
   19663 _ATEOF
   19664 
   19665 
   19666 cat >input-gram.y <<'_ATEOF'
   19667 %skeleton "./skel.c"
   19668 %define test "Hello World"
   19669 %%
   19670 start: ;
   19671 _ATEOF
   19672 
   19673 
   19674 cat >tmp/input-cmd-line.y <<'_ATEOF'
   19675 %define test "Hello World"
   19676 %%
   19677 start: ;
   19678 _ATEOF
   19679 
   19680 
   19681 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   19682   at_save_special_files
   19683   mkdir xml-tests
   19684     # Don't combine these Bison invocations since we want to be sure that
   19685   # --report=all isn't required to get the full XML file.
   19686   { set +x
   19687 $as_echo "$at_srcdir/skeletons.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   19688                   --graph=xml-tests/test.dot tmp/input-gram.y"
   19689 at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:62"
   19690 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   19691                   --graph=xml-tests/test.dot tmp/input-gram.y
   19692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19693 at_status=$? at_failed=false
   19694 $at_check_filter
   19695 echo stderr:; cat "$at_stderr"
   19696 echo stdout:; cat "$at_stdout"
   19697 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62"
   19698 $at_failed && at_fn_log_failure
   19699 $at_traceon; }
   19700 
   19701   { set +x
   19702 $as_echo "$at_srcdir/skeletons.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml tmp/input-gram.y"
   19703 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml tmp/input-gram.y" "skeletons.at:62"
   19704 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml tmp/input-gram.y
   19705 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19706 at_status=$? at_failed=false
   19707 $at_check_filter
   19708 echo stderr:; cat "$at_stderr"
   19709 echo stdout:; cat "$at_stdout"
   19710 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62"
   19711 $at_failed && at_fn_log_failure
   19712 $at_traceon; }
   19713 
   19714     cp xml-tests/test.output expout
   19715   { set +x
   19716 $as_echo "$at_srcdir/skeletons.at:62: \$XSLTPROC \\
   19717              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   19718              xml-tests/test.xml"
   19719 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:62"
   19720 ( $at_check_trace; $XSLTPROC \
   19721              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   19722              xml-tests/test.xml
   19723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19724 at_status=$? at_failed=false
   19725 $at_check_filter
   19726 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19727 $at_diff expout "$at_stdout" || at_failed=:
   19728 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62"
   19729 $at_failed && at_fn_log_failure
   19730 $at_traceon; }
   19731 
   19732   sort xml-tests/test.dot > expout
   19733   { set +x
   19734 $as_echo "$at_srcdir/skeletons.at:62: \$XSLTPROC \\
   19735              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   19736              xml-tests/test.xml | sort"
   19737 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:62"
   19738 ( $at_check_trace; $XSLTPROC \
   19739              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19740              xml-tests/test.xml | sort
   19741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19742 at_status=$? at_failed=false
   19743 $at_check_filter
   19744 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19745 $at_diff expout "$at_stdout" || at_failed=:
   19746 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62"
   19747 $at_failed && at_fn_log_failure
   19748 $at_traceon; }
   19749 
   19750   rm -rf xml-tests expout
   19751   at_restore_special_files
   19752 fi
   19753 { set +x
   19754 $as_echo "$at_srcdir/skeletons.at:62: bison tmp/input-gram.y"
   19755 at_fn_check_prepare_trace "skeletons.at:62"
   19756 ( $at_check_trace; bison tmp/input-gram.y
   19757 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19758 at_status=$? at_failed=false
   19759 $at_check_filter
   19760 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19761 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19762 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62"
   19763 $at_failed && at_fn_log_failure
   19764 $at_traceon; }
   19765 
   19766 
   19767 { set +x
   19768 $as_echo "$at_srcdir/skeletons.at:63: cat input-gram.tab.c"
   19769 at_fn_check_prepare_trace "skeletons.at:63"
   19770 ( $at_check_trace; cat input-gram.tab.c
   19771 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19772 at_status=$? at_failed=false
   19773 $at_check_filter
   19774 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19775 echo >>"$at_stdout"; $as_echo "Hello World
   19776 " | \
   19777   $at_diff - "$at_stdout" || at_failed=:
   19778 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
   19779 $at_failed && at_fn_log_failure
   19780 $at_traceon; }
   19781 
   19782 
   19783 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   19784   at_save_special_files
   19785   mkdir xml-tests
   19786     # Don't combine these Bison invocations since we want to be sure that
   19787   # --report=all isn't required to get the full XML file.
   19788   { set +x
   19789 $as_echo "$at_srcdir/skeletons.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   19790                   --graph=xml-tests/test.dot input-gram.y"
   19791 at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:67"
   19792 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   19793                   --graph=xml-tests/test.dot input-gram.y
   19794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19795 at_status=$? at_failed=false
   19796 $at_check_filter
   19797 echo stderr:; cat "$at_stderr"
   19798 echo stdout:; cat "$at_stdout"
   19799 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67"
   19800 $at_failed && at_fn_log_failure
   19801 $at_traceon; }
   19802 
   19803   { set +x
   19804 $as_echo "$at_srcdir/skeletons.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-gram.y"
   19805 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-gram.y" "skeletons.at:67"
   19806 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-gram.y
   19807 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19808 at_status=$? at_failed=false
   19809 $at_check_filter
   19810 echo stderr:; cat "$at_stderr"
   19811 echo stdout:; cat "$at_stdout"
   19812 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67"
   19813 $at_failed && at_fn_log_failure
   19814 $at_traceon; }
   19815 
   19816     cp xml-tests/test.output expout
   19817   { set +x
   19818 $as_echo "$at_srcdir/skeletons.at:67: \$XSLTPROC \\
   19819              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   19820              xml-tests/test.xml"
   19821 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:67"
   19822 ( $at_check_trace; $XSLTPROC \
   19823              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   19824              xml-tests/test.xml
   19825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19826 at_status=$? at_failed=false
   19827 $at_check_filter
   19828 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19829 $at_diff expout "$at_stdout" || at_failed=:
   19830 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67"
   19831 $at_failed && at_fn_log_failure
   19832 $at_traceon; }
   19833 
   19834   sort xml-tests/test.dot > expout
   19835   { set +x
   19836 $as_echo "$at_srcdir/skeletons.at:67: \$XSLTPROC \\
   19837              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   19838              xml-tests/test.xml | sort"
   19839 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:67"
   19840 ( $at_check_trace; $XSLTPROC \
   19841              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19842              xml-tests/test.xml | sort
   19843 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19844 at_status=$? at_failed=false
   19845 $at_check_filter
   19846 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19847 $at_diff expout "$at_stdout" || at_failed=:
   19848 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67"
   19849 $at_failed && at_fn_log_failure
   19850 $at_traceon; }
   19851 
   19852   rm -rf xml-tests expout
   19853   at_restore_special_files
   19854 fi
   19855 { set +x
   19856 $as_echo "$at_srcdir/skeletons.at:67: bison input-gram.y"
   19857 at_fn_check_prepare_trace "skeletons.at:67"
   19858 ( $at_check_trace; bison input-gram.y
   19859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19860 at_status=$? at_failed=false
   19861 $at_check_filter
   19862 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19863 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19864 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67"
   19865 $at_failed && at_fn_log_failure
   19866 $at_traceon; }
   19867 
   19868 
   19869 { set +x
   19870 $as_echo "$at_srcdir/skeletons.at:68: cat input-gram.tab.c"
   19871 at_fn_check_prepare_trace "skeletons.at:68"
   19872 ( $at_check_trace; cat input-gram.tab.c
   19873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19874 at_status=$? at_failed=false
   19875 $at_check_filter
   19876 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19877 echo >>"$at_stdout"; $as_echo "Hello World -- Local
   19878 " | \
   19879   $at_diff - "$at_stdout" || at_failed=:
   19880 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
   19881 $at_failed && at_fn_log_failure
   19882 $at_traceon; }
   19883 
   19884 
   19885 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   19886   at_save_special_files
   19887   mkdir xml-tests
   19888     # Don't combine these Bison invocations since we want to be sure that
   19889   # --report=all isn't required to get the full XML file.
   19890   { set +x
   19891 $as_echo "$at_srcdir/skeletons.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   19892                   --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y"
   19893 at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:72"
   19894 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   19895                   --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y
   19896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19897 at_status=$? at_failed=false
   19898 $at_check_filter
   19899 echo stderr:; cat "$at_stderr"
   19900 echo stdout:; cat "$at_stdout"
   19901 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72"
   19902 $at_failed && at_fn_log_failure
   19903 $at_traceon; }
   19904 
   19905   { set +x
   19906 $as_echo "$at_srcdir/skeletons.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y"
   19907 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" "skeletons.at:72"
   19908 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y
   19909 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19910 at_status=$? at_failed=false
   19911 $at_check_filter
   19912 echo stderr:; cat "$at_stderr"
   19913 echo stdout:; cat "$at_stdout"
   19914 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72"
   19915 $at_failed && at_fn_log_failure
   19916 $at_traceon; }
   19917 
   19918     cp xml-tests/test.output expout
   19919   { set +x
   19920 $as_echo "$at_srcdir/skeletons.at:72: \$XSLTPROC \\
   19921              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   19922              xml-tests/test.xml"
   19923 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:72"
   19924 ( $at_check_trace; $XSLTPROC \
   19925              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   19926              xml-tests/test.xml
   19927 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19928 at_status=$? at_failed=false
   19929 $at_check_filter
   19930 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19931 $at_diff expout "$at_stdout" || at_failed=:
   19932 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72"
   19933 $at_failed && at_fn_log_failure
   19934 $at_traceon; }
   19935 
   19936   sort xml-tests/test.dot > expout
   19937   { set +x
   19938 $as_echo "$at_srcdir/skeletons.at:72: \$XSLTPROC \\
   19939              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   19940              xml-tests/test.xml | sort"
   19941 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:72"
   19942 ( $at_check_trace; $XSLTPROC \
   19943              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   19944              xml-tests/test.xml | sort
   19945 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19946 at_status=$? at_failed=false
   19947 $at_check_filter
   19948 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19949 $at_diff expout "$at_stdout" || at_failed=:
   19950 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72"
   19951 $at_failed && at_fn_log_failure
   19952 $at_traceon; }
   19953 
   19954   rm -rf xml-tests expout
   19955   at_restore_special_files
   19956 fi
   19957 { set +x
   19958 $as_echo "$at_srcdir/skeletons.at:72: bison --skeleton=tmp/skel.c tmp/input-cmd-line.y"
   19959 at_fn_check_prepare_trace "skeletons.at:72"
   19960 ( $at_check_trace; bison --skeleton=tmp/skel.c tmp/input-cmd-line.y
   19961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19962 at_status=$? at_failed=false
   19963 $at_check_filter
   19964 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19965 at_fn_diff_devnull "$at_stdout" || at_failed=:
   19966 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72"
   19967 $at_failed && at_fn_log_failure
   19968 $at_traceon; }
   19969 
   19970 
   19971 { set +x
   19972 $as_echo "$at_srcdir/skeletons.at:73: cat input-cmd-line.tab.c"
   19973 at_fn_check_prepare_trace "skeletons.at:73"
   19974 ( $at_check_trace; cat input-cmd-line.tab.c
   19975 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   19976 at_status=$? at_failed=false
   19977 $at_check_filter
   19978 at_fn_diff_devnull "$at_stderr" || at_failed=:
   19979 echo >>"$at_stdout"; $as_echo "Hello World
   19980 " | \
   19981   $at_diff - "$at_stdout" || at_failed=:
   19982 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
   19983 $at_failed && at_fn_log_failure
   19984 $at_traceon; }
   19985 
   19986 
   19987   set +x
   19988   $at_times_p && times >"$at_times_file"
   19989 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   19990 read at_status <"$at_status_file"
   19991 #AT_STOP_92
   19992 #AT_START_93
   19993 at_fn_group_banner 93 'skeletons.at:84' \
   19994   "Installed skeleton file names" "                  " 4
   19995 at_xfail=no
   19996 (
   19997   $as_echo "93. $at_setup_line: testing $at_desc ..."
   19998   $at_traceon
   19999 
   20000 
   20001 
   20002 
   20003 
   20004 cat >input-cmd-line.y <<'_ATEOF'
   20005 %code top {
   20006 #include <config.h>
   20007 /* We don't need perfect functions for these tests. */
   20008 #undef malloc
   20009 #undef memcmp
   20010 #undef realloc
   20011 }
   20012 
   20013 %{
   20014   #include <stdio.h>
   20015   static void yyerror ( const char *msg);
   20016   int yylex (void);
   20017 %}
   20018 
   20019 %error-verbose
   20020 %token 'a'
   20021 
   20022 %%
   20023 
   20024 start: ;
   20025 
   20026 %%
   20027 
   20028 #include <stdio.h>
   20029 /* A C error reporting function.  */
   20030 static
   20031 void yyerror ( const char *msg)
   20032 {
   20033   fprintf (stderr, "%s\n", msg);
   20034 }
   20035 int
   20036 yylex (void)
   20037 {
   20038   return 'a';
   20039 }
   20040 
   20041 int
   20042 main (void)
   20043 {
   20044   return yyparse ();
   20045 }
   20046 _ATEOF
   20047 
   20048 
   20049 
   20050 cat >input-gram.y <<'_ATEOF'
   20051 %code top {
   20052 #include <config.h>
   20053 /* We don't need perfect functions for these tests. */
   20054 #undef malloc
   20055 #undef memcmp
   20056 #undef realloc
   20057 }
   20058 
   20059 %skeleton "yacc.c"
   20060 %{
   20061   #include <stdio.h>
   20062   static void yyerror ( const char *msg);
   20063   int yylex (void);
   20064 %}
   20065 
   20066 %error-verbose
   20067 %token 'a'
   20068 
   20069 %%
   20070 
   20071 start: ;
   20072 
   20073 %%
   20074 
   20075 #include <stdio.h>
   20076 /* A C error reporting function.  */
   20077 static
   20078 void yyerror ( const char *msg)
   20079 {
   20080   fprintf (stderr, "%s\n", msg);
   20081 }
   20082 int
   20083 yylex (void)
   20084 {
   20085   return 'a';
   20086 }
   20087 
   20088 int
   20089 main (void)
   20090 {
   20091   return yyparse ();
   20092 }
   20093 _ATEOF
   20094 
   20095 
   20096 
   20097 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   20098   at_save_special_files
   20099   mkdir xml-tests
   20100     # Don't combine these Bison invocations since we want to be sure that
   20101   # --report=all isn't required to get the full XML file.
   20102   { set +x
   20103 $as_echo "$at_srcdir/skeletons.at:124: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   20104                   --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
   20105 at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:124"
   20106 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   20107                   --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
   20108 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20109 at_status=$? at_failed=false
   20110 $at_check_filter
   20111 echo stderr:; cat "$at_stderr"
   20112 echo stdout:; cat "$at_stdout"
   20113 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124"
   20114 $at_failed && at_fn_log_failure
   20115 $at_traceon; }
   20116 
   20117   { set +x
   20118 $as_echo "$at_srcdir/skeletons.at:124: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
   20119 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" "skeletons.at:124"
   20120 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
   20121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20122 at_status=$? at_failed=false
   20123 $at_check_filter
   20124 echo stderr:; cat "$at_stderr"
   20125 echo stdout:; cat "$at_stdout"
   20126 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124"
   20127 $at_failed && at_fn_log_failure
   20128 $at_traceon; }
   20129 
   20130     cp xml-tests/test.output expout
   20131   { set +x
   20132 $as_echo "$at_srcdir/skeletons.at:124: \$XSLTPROC \\
   20133              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   20134              xml-tests/test.xml"
   20135 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:124"
   20136 ( $at_check_trace; $XSLTPROC \
   20137              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   20138              xml-tests/test.xml
   20139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20140 at_status=$? at_failed=false
   20141 $at_check_filter
   20142 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20143 $at_diff expout "$at_stdout" || at_failed=:
   20144 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124"
   20145 $at_failed && at_fn_log_failure
   20146 $at_traceon; }
   20147 
   20148   sort xml-tests/test.dot > expout
   20149   { set +x
   20150 $as_echo "$at_srcdir/skeletons.at:124: \$XSLTPROC \\
   20151              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   20152              xml-tests/test.xml | sort"
   20153 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:124"
   20154 ( $at_check_trace; $XSLTPROC \
   20155              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   20156              xml-tests/test.xml | sort
   20157 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20158 at_status=$? at_failed=false
   20159 $at_check_filter
   20160 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20161 $at_diff expout "$at_stdout" || at_failed=:
   20162 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124"
   20163 $at_failed && at_fn_log_failure
   20164 $at_traceon; }
   20165 
   20166   rm -rf xml-tests expout
   20167   at_restore_special_files
   20168 fi
   20169 { set +x
   20170 $as_echo "$at_srcdir/skeletons.at:124: bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
   20171 at_fn_check_prepare_trace "skeletons.at:124"
   20172 ( $at_check_trace; bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
   20173 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20174 at_status=$? at_failed=false
   20175 $at_check_filter
   20176 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20177 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20178 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:124"
   20179 $at_failed && at_fn_log_failure
   20180 $at_traceon; }
   20181 
   20182 
   20183 { set +x
   20184 $as_echo "$at_srcdir/skeletons.at:125: \$BISON_C_WORKS"
   20185 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:125"
   20186 ( $at_check_trace; $BISON_C_WORKS
   20187 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20188 at_status=$? at_failed=false
   20189 $at_check_filter
   20190 echo stderr:; cat "$at_stderr"
   20191 echo stdout:; cat "$at_stdout"
   20192 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:125"
   20193 $at_failed && at_fn_log_failure
   20194 $at_traceon; }
   20195 
   20196 { set +x
   20197 $as_echo "$at_srcdir/skeletons.at:125: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-cmd-line input-cmd-line.c \$LIBS"
   20198 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS" "skeletons.at:125"
   20199 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS
   20200 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20201 at_status=$? at_failed=false
   20202 $at_check_filter
   20203 echo stderr:; cat "$at_stderr"
   20204 echo stdout:; cat "$at_stdout"
   20205 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:125"
   20206 $at_failed && at_fn_log_failure
   20207 $at_traceon; }
   20208 
   20209 { set +x
   20210 $as_echo "$at_srcdir/skeletons.at:126:  \$PREPARSER ./input-cmd-line"
   20211 at_fn_check_prepare_dynamic " $PREPARSER ./input-cmd-line" "skeletons.at:126"
   20212 ( $at_check_trace;  $PREPARSER ./input-cmd-line
   20213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20214 at_status=$? at_failed=false
   20215 $at_check_filter
   20216 echo stderr:; tee stderr <"$at_stderr"
   20217 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20218 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:126"
   20219 $at_failed && at_fn_log_failure
   20220 $at_traceon; }
   20221 
   20222 { set +x
   20223 $as_echo "$at_srcdir/skeletons.at:126: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   20224 at_fn_check_prepare_trace "skeletons.at:126"
   20225 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   20226 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20227 at_status=$? at_failed=false
   20228 $at_check_filter
   20229 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end
   20230 " | \
   20231   $at_diff - "$at_stderr" || at_failed=:
   20232 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20233 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
   20234 $at_failed && at_fn_log_failure
   20235 $at_traceon; }
   20236 
   20237 
   20238 
   20239 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   20240   at_save_special_files
   20241   mkdir xml-tests
   20242     # Don't combine these Bison invocations since we want to be sure that
   20243   # --report=all isn't required to get the full XML file.
   20244   { set +x
   20245 $as_echo "$at_srcdir/skeletons.at:130: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   20246                   --graph=xml-tests/test.dot -o input-gram.c input-gram.y"
   20247 at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:130"
   20248 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   20249                   --graph=xml-tests/test.dot -o input-gram.c input-gram.y
   20250 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20251 at_status=$? at_failed=false
   20252 $at_check_filter
   20253 echo stderr:; cat "$at_stderr"
   20254 echo stdout:; cat "$at_stdout"
   20255 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130"
   20256 $at_failed && at_fn_log_failure
   20257 $at_traceon; }
   20258 
   20259   { set +x
   20260 $as_echo "$at_srcdir/skeletons.at:130: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y"
   20261 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y" "skeletons.at:130"
   20262 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y
   20263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20264 at_status=$? at_failed=false
   20265 $at_check_filter
   20266 echo stderr:; cat "$at_stderr"
   20267 echo stdout:; cat "$at_stdout"
   20268 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130"
   20269 $at_failed && at_fn_log_failure
   20270 $at_traceon; }
   20271 
   20272     cp xml-tests/test.output expout
   20273   { set +x
   20274 $as_echo "$at_srcdir/skeletons.at:130: \$XSLTPROC \\
   20275              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   20276              xml-tests/test.xml"
   20277 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:130"
   20278 ( $at_check_trace; $XSLTPROC \
   20279              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   20280              xml-tests/test.xml
   20281 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20282 at_status=$? at_failed=false
   20283 $at_check_filter
   20284 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20285 $at_diff expout "$at_stdout" || at_failed=:
   20286 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130"
   20287 $at_failed && at_fn_log_failure
   20288 $at_traceon; }
   20289 
   20290   sort xml-tests/test.dot > expout
   20291   { set +x
   20292 $as_echo "$at_srcdir/skeletons.at:130: \$XSLTPROC \\
   20293              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   20294              xml-tests/test.xml | sort"
   20295 at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:130"
   20296 ( $at_check_trace; $XSLTPROC \
   20297              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   20298              xml-tests/test.xml | sort
   20299 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20300 at_status=$? at_failed=false
   20301 $at_check_filter
   20302 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20303 $at_diff expout "$at_stdout" || at_failed=:
   20304 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130"
   20305 $at_failed && at_fn_log_failure
   20306 $at_traceon; }
   20307 
   20308   rm -rf xml-tests expout
   20309   at_restore_special_files
   20310 fi
   20311 { set +x
   20312 $as_echo "$at_srcdir/skeletons.at:130: bison -o input-gram.c input-gram.y"
   20313 at_fn_check_prepare_trace "skeletons.at:130"
   20314 ( $at_check_trace; bison -o input-gram.c input-gram.y
   20315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20316 at_status=$? at_failed=false
   20317 $at_check_filter
   20318 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20319 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20320 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:130"
   20321 $at_failed && at_fn_log_failure
   20322 $at_traceon; }
   20323 
   20324 
   20325 { set +x
   20326 $as_echo "$at_srcdir/skeletons.at:131: \$BISON_C_WORKS"
   20327 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:131"
   20328 ( $at_check_trace; $BISON_C_WORKS
   20329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20330 at_status=$? at_failed=false
   20331 $at_check_filter
   20332 echo stderr:; cat "$at_stderr"
   20333 echo stdout:; cat "$at_stdout"
   20334 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:131"
   20335 $at_failed && at_fn_log_failure
   20336 $at_traceon; }
   20337 
   20338 { set +x
   20339 $as_echo "$at_srcdir/skeletons.at:131: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-gram input-gram.c \$LIBS"
   20340 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS" "skeletons.at:131"
   20341 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS
   20342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20343 at_status=$? at_failed=false
   20344 $at_check_filter
   20345 echo stderr:; cat "$at_stderr"
   20346 echo stdout:; cat "$at_stdout"
   20347 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:131"
   20348 $at_failed && at_fn_log_failure
   20349 $at_traceon; }
   20350 
   20351 { set +x
   20352 $as_echo "$at_srcdir/skeletons.at:132:  \$PREPARSER ./input-gram"
   20353 at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:132"
   20354 ( $at_check_trace;  $PREPARSER ./input-gram
   20355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20356 at_status=$? at_failed=false
   20357 $at_check_filter
   20358 echo stderr:; tee stderr <"$at_stderr"
   20359 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20360 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:132"
   20361 $at_failed && at_fn_log_failure
   20362 $at_traceon; }
   20363 
   20364 { set +x
   20365 $as_echo "$at_srcdir/skeletons.at:132: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   20366 at_fn_check_prepare_trace "skeletons.at:132"
   20367 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   20368 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20369 at_status=$? at_failed=false
   20370 $at_check_filter
   20371 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end
   20372 " | \
   20373   $at_diff - "$at_stderr" || at_failed=:
   20374 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20375 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:132"
   20376 $at_failed && at_fn_log_failure
   20377 $at_traceon; }
   20378 
   20379 
   20380 
   20381 
   20382 
   20383 
   20384   set +x
   20385   $at_times_p && times >"$at_times_file"
   20386 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   20387 read at_status <"$at_status_file"
   20388 #AT_STOP_93
   20389 #AT_START_94
   20390 at_fn_group_banner 94 'skeletons.at:146' \
   20391   "%define Boolean variables: invalid skeleton defaults" "" 4
   20392 at_xfail=no
   20393 (
   20394   $as_echo "94. $at_setup_line: testing $at_desc ..."
   20395   $at_traceon
   20396 
   20397 
   20398 cat >skel.c <<'_ATEOF'
   20399 b4_percent_define_default([[foo]], [[bogus value]])
   20400 b4_percent_define_flag_if([[foo]])
   20401 _ATEOF
   20402 
   20403 
   20404 cat >input.y <<'_ATEOF'
   20405 %skeleton "./skel.c"
   20406 %%
   20407 start: ;
   20408 _ATEOF
   20409 
   20410 
   20411 
   20412 { set +x
   20413 $as_echo "$at_srcdir/skeletons.at:159: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   20414 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "skeletons.at:159"
   20415 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   20416 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20417 at_status=$? at_failed=false
   20418 $at_check_filter
   20419 echo >>"$at_stderr"; $as_echo "<skeleton default value>: error: invalid value for %define Boolean variable 'foo'
   20420 " | \
   20421   $at_diff - "$at_stderr" || at_failed=:
   20422 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20423 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:159"
   20424 $at_failed && at_fn_log_failure
   20425 $at_traceon; }
   20426 
   20427 
   20428 
   20429   set +x
   20430   $at_times_p && times >"$at_times_file"
   20431 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   20432 read at_status <"$at_status_file"
   20433 #AT_STOP_94
   20434 #AT_START_95
   20435 at_fn_group_banner 95 'skeletons.at:170' \
   20436   "Complaining during macro argument expansion" "    " 4
   20437 at_xfail=no
   20438 (
   20439   $as_echo "95. $at_setup_line: testing $at_desc ..."
   20440   $at_traceon
   20441 
   20442 
   20443 cat >skel1.c <<'_ATEOF'
   20444 m4_define([foow], [b4_warn([[foow fubar]])])
   20445 m4_define([foowat], [b4_warn_at([[foow.y:2.3]],
   20446                                     [[foow.y:5.4]], [[foowat fubar]])])
   20447 m4_define([fooc], [b4_complain([[fooc fubar]])])
   20448 m4_define([foocat], [b4_complain_at([[fooc.y:1.1]],
   20449                                         [[fooc.y:10.6]], [[foocat fubar]])])
   20450 m4_define([foof], [b4_fatal([[foof fubar]])])
   20451 m4_if(foow, [1], [yes])
   20452 m4_if(foowat, [1], [yes])
   20453 m4_if(fooc, [1], [yes])
   20454 m4_if(foocat, [1], [yes])
   20455 m4_if(foof, [1], [yes])
   20456 _ATEOF
   20457 
   20458 
   20459 cat >input1.y <<'_ATEOF'
   20460 %skeleton "./skel1.c"
   20461 %%
   20462 start: ;
   20463 _ATEOF
   20464 
   20465 
   20466 
   20467 { set +x
   20468 $as_echo "$at_srcdir/skeletons.at:193: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y"
   20469 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" "skeletons.at:193"
   20470 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input1.y
   20471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20472 at_status=$? at_failed=false
   20473 $at_check_filter
   20474 echo >>"$at_stderr"; $as_echo "input1.y: warning: foow fubar
   20475 foow.y:2.3-5.3: warning: foowat fubar
   20476 input1.y: error: fooc fubar
   20477 fooc.y:1.1-10.5: error: foocat fubar
   20478 input1.y: fatal error: foof fubar
   20479 " | \
   20480   $at_diff - "$at_stderr" || at_failed=:
   20481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20482 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:193"
   20483 $at_failed && at_fn_log_failure
   20484 $at_traceon; }
   20485 
   20486 
   20487 
   20488 cat >skel2.c <<'_ATEOF'
   20489 m4_define([foofat], [b4_fatal_at([[foof.y:12.11]],
   20490                                        [[foof.y:100.123]], [[foofat fubar]])])
   20491 m4_if(foofat, [1], [yes])
   20492 _ATEOF
   20493 
   20494 
   20495 cat >input2.y <<'_ATEOF'
   20496 %skeleton "./skel2.c"
   20497 %%
   20498 start: ;
   20499 _ATEOF
   20500 
   20501 
   20502 
   20503 { set +x
   20504 $as_echo "$at_srcdir/skeletons.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y"
   20505 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" "skeletons.at:213"
   20506 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input2.y
   20507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20508 at_status=$? at_failed=false
   20509 $at_check_filter
   20510 echo >>"$at_stderr"; $as_echo "foof.y:12.11-100.122: fatal error: foofat fubar
   20511 " | \
   20512   $at_diff - "$at_stderr" || at_failed=:
   20513 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20514 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:213"
   20515 $at_failed && at_fn_log_failure
   20516 $at_traceon; }
   20517 
   20518 
   20519 
   20520 cat >skel3.c <<'_ATEOF'
   20521 b4_complain_at(b4_percent_define_get_loc([[bogus]]), [[bad value]])
   20522 _ATEOF
   20523 
   20524 
   20525 cat >input3.y <<'_ATEOF'
   20526 %skeleton "./skel3.c"
   20527 %%
   20528 start: ;
   20529 _ATEOF
   20530 
   20531 
   20532 
   20533 { set +x
   20534 $as_echo "$at_srcdir/skeletons.at:227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input3.y"
   20535 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input3.y" "skeletons.at:227"
   20536 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input3.y
   20537 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20538 at_status=$? at_failed=false
   20539 $at_check_filter
   20540 echo >>"$at_stderr"; $as_echo "input3.y: fatal error: b4_percent_define_get_loc: undefined %define variable 'bogus'
   20541 " | \
   20542   $at_diff - "$at_stderr" || at_failed=:
   20543 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20544 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:227"
   20545 $at_failed && at_fn_log_failure
   20546 $at_traceon; }
   20547 
   20548 
   20549 
   20550 cat >skel4.c <<'_ATEOF'
   20551 b4_warn_at(b4_percent_define_get_syncline([[bogus]]), [[bad value]])
   20552 _ATEOF
   20553 
   20554 
   20555 cat >input4.y <<'_ATEOF'
   20556 %skeleton "./skel4.c"
   20557 %%
   20558 start: ;
   20559 _ATEOF
   20560 
   20561 
   20562 
   20563 { set +x
   20564 $as_echo "$at_srcdir/skeletons.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input4.y"
   20565 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input4.y" "skeletons.at:241"
   20566 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input4.y
   20567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20568 at_status=$? at_failed=false
   20569 $at_check_filter
   20570 echo >>"$at_stderr"; $as_echo "input4.y: fatal error: b4_percent_define_get_syncline: undefined %define variable 'bogus'
   20571 " | \
   20572   $at_diff - "$at_stderr" || at_failed=:
   20573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20574 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:241"
   20575 $at_failed && at_fn_log_failure
   20576 $at_traceon; }
   20577 
   20578 
   20579 
   20580   set +x
   20581   $at_times_p && times >"$at_times_file"
   20582 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   20583 read at_status <"$at_status_file"
   20584 #AT_STOP_95
   20585 #AT_START_96
   20586 at_fn_group_banner 96 'skeletons.at:252' \
   20587   "Fatal errors make M4 exit immediately" "          " 4
   20588 at_xfail=no
   20589 (
   20590   $as_echo "96. $at_setup_line: testing $at_desc ..."
   20591   $at_traceon
   20592 
   20593 
   20594 cat >skel1.c <<'_ATEOF'
   20595 b4_complain([[non-fatal error]])
   20596 b4_fatal([[M4 should exit immediately here]])
   20597 m4_fatal([this should never be evaluated])
   20598 _ATEOF
   20599 
   20600 
   20601 cat >input1.y <<'_ATEOF'
   20602 %skeleton "./skel1.c"
   20603 %%
   20604 start: ;
   20605 _ATEOF
   20606 
   20607 
   20608 
   20609 { set +x
   20610 $as_echo "$at_srcdir/skeletons.at:266: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y"
   20611 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" "skeletons.at:266"
   20612 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input1.y
   20613 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20614 at_status=$? at_failed=false
   20615 $at_check_filter
   20616 echo >>"$at_stderr"; $as_echo "input1.y: error: non-fatal error
   20617 input1.y: fatal error: M4 should exit immediately here
   20618 " | \
   20619   $at_diff - "$at_stderr" || at_failed=:
   20620 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20621 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:266"
   20622 $at_failed && at_fn_log_failure
   20623 $at_traceon; }
   20624 
   20625 
   20626 
   20627 cat >skel2.c <<'_ATEOF'
   20628 b4_warn([[morning]])
   20629 b4_fatal_at([[foo.y:1.5]], [[foo.y:1.7]], [[M4 should exit immediately here]])
   20630 m4_fatal([this should never be evaluated])
   20631 _ATEOF
   20632 
   20633 
   20634 cat >input2.y <<'_ATEOF'
   20635 %skeleton "./skel2.c"
   20636 %%
   20637 start: ;
   20638 _ATEOF
   20639 
   20640 
   20641 
   20642 { set +x
   20643 $as_echo "$at_srcdir/skeletons.at:283: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y"
   20644 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" "skeletons.at:283"
   20645 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input2.y
   20646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20647 at_status=$? at_failed=false
   20648 $at_check_filter
   20649 echo >>"$at_stderr"; $as_echo "input2.y: warning: morning
   20650 foo.y:1.5-6: fatal error: M4 should exit immediately here
   20651 " | \
   20652   $at_diff - "$at_stderr" || at_failed=:
   20653 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20654 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:283"
   20655 $at_failed && at_fn_log_failure
   20656 $at_traceon; }
   20657 
   20658 
   20659 
   20660   set +x
   20661   $at_times_p && times >"$at_times_file"
   20662 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   20663 read at_status <"$at_status_file"
   20664 #AT_STOP_96
   20665 #AT_START_97
   20666 at_fn_group_banner 97 'skeletons.at:306' \
   20667   "Fatal errors but M4 continues producing output" " " 4
   20668 at_xfail=no
   20669 (
   20670   $as_echo "97. $at_setup_line: testing $at_desc ..."
   20671   $at_traceon
   20672 
   20673 
   20674 cat >gen-skel.pl <<'_ATEOF'
   20675 use warnings;
   20676 use strict;
   20677 my $M4 = "m4";
   20678 my $DNL = "d"."nl";
   20679 print "${M4}_divert_push(0)$DNL\n";
   20680 print '@output(@,@)', "\n";
   20681 (print "garbage"x10, "\n") for (1..1000);
   20682 print "${M4}_divert_pop(0)\n";
   20683 _ATEOF
   20684 
   20685 { set +x
   20686 $as_echo "$at_srcdir/skeletons.at:318: \$PERL gen-skel.pl > skel.c || exit 77"
   20687 at_fn_check_prepare_dynamic "$PERL gen-skel.pl > skel.c || exit 77" "skeletons.at:318"
   20688 ( $at_check_trace; $PERL gen-skel.pl > skel.c || exit 77
   20689 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20690 at_status=$? at_failed=false
   20691 $at_check_filter
   20692 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20693 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20694 at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:318"
   20695 $at_failed && at_fn_log_failure
   20696 $at_traceon; }
   20697 
   20698 
   20699 cat >input.y <<'_ATEOF'
   20700 %skeleton "./skel.c"
   20701 %%
   20702 start: ;
   20703 _ATEOF
   20704 
   20705 
   20706 
   20707 { set +x
   20708 $as_echo "$at_srcdir/skeletons.at:326: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   20709 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "skeletons.at:326"
   20710 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   20711 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20712 at_status=$? at_failed=false
   20713 $at_check_filter
   20714 echo >>"$at_stderr"; $as_echo "input.y: fatal error: too many arguments for @output directive in skeleton
   20715 " | \
   20716   $at_diff - "$at_stderr" || at_failed=:
   20717 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20718 at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:326"
   20719 $at_failed && at_fn_log_failure
   20720 $at_traceon; }
   20721 
   20722 
   20723 
   20724   set +x
   20725   $at_times_p && times >"$at_times_file"
   20726 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   20727 read at_status <"$at_status_file"
   20728 #AT_STOP_97
   20729 #AT_START_98
   20730 at_fn_group_banner 98 'sets.at:66' \
   20731   "Nullable" "                                       " 5
   20732 at_xfail=no
   20733 (
   20734   $as_echo "98. $at_setup_line: testing $at_desc ..."
   20735   $at_traceon
   20736 
   20737 
   20738 # At some point, nullable had been smoking grass, and managed to say:
   20739 #
   20740 # Entering set_nullable
   20741 # NULLABLE
   20742 #         'e': yes
   20743 #         (null): no
   20744 # ...
   20745 
   20746 cat >input.y <<'_ATEOF'
   20747 %%
   20748 e: 'e' | /* Nothing */;
   20749 _ATEOF
   20750 
   20751 
   20752 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   20753   at_save_special_files
   20754   mkdir xml-tests
   20755     # Don't combine these Bison invocations since we want to be sure that
   20756   # --report=all isn't required to get the full XML file.
   20757   { set +x
   20758 $as_echo "$at_srcdir/sets.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   20759                   --graph=xml-tests/test.dot --trace=sets input.y"
   20760 at_fn_check_prepare_notrace 'an embedded newline' "sets.at:81"
   20761 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   20762                   --graph=xml-tests/test.dot --trace=sets input.y
   20763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20764 at_status=$? at_failed=false
   20765 $at_check_filter
   20766 echo stderr:; cat "$at_stderr"
   20767 echo stdout:; cat "$at_stdout"
   20768 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
   20769 $at_failed && at_fn_log_failure
   20770 $at_traceon; }
   20771 
   20772   { set +x
   20773 $as_echo "$at_srcdir/sets.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y"
   20774 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:81"
   20775 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y
   20776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20777 at_status=$? at_failed=false
   20778 $at_check_filter
   20779 echo stderr:; cat "$at_stderr"
   20780 echo stdout:; cat "$at_stdout"
   20781 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
   20782 $at_failed && at_fn_log_failure
   20783 $at_traceon; }
   20784 
   20785     cp xml-tests/test.output expout
   20786   { set +x
   20787 $as_echo "$at_srcdir/sets.at:81: \$XSLTPROC \\
   20788              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   20789              xml-tests/test.xml"
   20790 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:81"
   20791 ( $at_check_trace; $XSLTPROC \
   20792              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   20793              xml-tests/test.xml
   20794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20795 at_status=$? at_failed=false
   20796 $at_check_filter
   20797 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20798 $at_diff expout "$at_stdout" || at_failed=:
   20799 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
   20800 $at_failed && at_fn_log_failure
   20801 $at_traceon; }
   20802 
   20803   sort xml-tests/test.dot > expout
   20804   { set +x
   20805 $as_echo "$at_srcdir/sets.at:81: \$XSLTPROC \\
   20806              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   20807              xml-tests/test.xml | sort"
   20808 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:81"
   20809 ( $at_check_trace; $XSLTPROC \
   20810              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   20811              xml-tests/test.xml | sort
   20812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20813 at_status=$? at_failed=false
   20814 $at_check_filter
   20815 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20816 $at_diff expout "$at_stdout" || at_failed=:
   20817 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
   20818 $at_failed && at_fn_log_failure
   20819 $at_traceon; }
   20820 
   20821   rm -rf xml-tests expout
   20822   at_restore_special_files
   20823 fi
   20824 { set +x
   20825 $as_echo "$at_srcdir/sets.at:81: bison --trace=sets input.y"
   20826 at_fn_check_prepare_trace "sets.at:81"
   20827 ( $at_check_trace; bison --trace=sets input.y
   20828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20829 at_status=$? at_failed=false
   20830 $at_check_filter
   20831 echo stderr:; tee stderr <"$at_stderr"
   20832 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20833 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
   20834 $at_failed && at_fn_log_failure
   20835 $at_traceon; }
   20836 
   20837 
   20838 cat >extract.sed <<'_ATEOF'
   20839 #n
   20840 /^NULLABLE$/ {
   20841    :null
   20842    p
   20843    n
   20844    /^[	 ]*$/ !b null
   20845 }
   20846 /^FIRSTS$/ {
   20847    :firsts
   20848    p
   20849    n
   20850    /^[	 ]*$/ !b firsts
   20851 }
   20852 /^FDERIVES$/ {
   20853    :fderiv
   20854    p
   20855    n
   20856    /^[	 ]*$/ !b fderiv
   20857 }
   20858 /^DERIVES$/ {
   20859    :deriv
   20860    p
   20861    n
   20862    /^[	 ]*$/ !b deriv
   20863 }
   20864 _ATEOF
   20865 
   20866 { set +x
   20867 $as_echo "$at_srcdir/sets.at:82: sed -f extract.sed stderr"
   20868 at_fn_check_prepare_trace "sets.at:82"
   20869 ( $at_check_trace; sed -f extract.sed stderr
   20870 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20871 at_status=$? at_failed=false
   20872 $at_check_filter
   20873 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20874 echo stdout:; tee stdout <"$at_stdout"
   20875 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:82"
   20876 $at_failed && at_fn_log_failure
   20877 $at_traceon; }
   20878 
   20879 { set +x
   20880 $as_echo "$at_srcdir/sets.at:82: mv stdout sets"
   20881 at_fn_check_prepare_trace "sets.at:82"
   20882 ( $at_check_trace; mv stdout sets
   20883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20884 at_status=$? at_failed=false
   20885 $at_check_filter
   20886 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20887 at_fn_diff_devnull "$at_stdout" || at_failed=:
   20888 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:82"
   20889 $at_failed && at_fn_log_failure
   20890 $at_traceon; }
   20891 
   20892 
   20893 { set +x
   20894 $as_echo "$at_srcdir/sets.at:83: cat sets"
   20895 at_fn_check_prepare_trace "sets.at:83"
   20896 ( $at_check_trace; cat sets
   20897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20898 at_status=$? at_failed=false
   20899 $at_check_filter
   20900 at_fn_diff_devnull "$at_stderr" || at_failed=:
   20901 echo >>"$at_stdout"; $as_echo "DERIVES
   20902 	\$accept derives
   20903 		  0  e \$end
   20904 	e derives
   20905 		  1  'e'
   20906 		  2  /* empty */
   20907 NULLABLE
   20908 	\$accept: no
   20909 	e: yes
   20910 FIRSTS
   20911 	\$accept firsts
   20912 		\$accept
   20913 		e
   20914 	e firsts
   20915 		e
   20916 FDERIVES
   20917 	\$accept derives
   20918 		  0  e \$end
   20919 		  1  'e'
   20920 		  2  /* empty */
   20921 	e derives
   20922 		  1  'e'
   20923 		  2  /* empty */
   20924 " | \
   20925   $at_diff - "$at_stdout" || at_failed=:
   20926 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:83"
   20927 $at_failed && at_fn_log_failure
   20928 $at_traceon; }
   20929 
   20930 
   20931   set +x
   20932   $at_times_p && times >"$at_times_file"
   20933 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   20934 read at_status <"$at_status_file"
   20935 #AT_STOP_98
   20936 #AT_START_99
   20937 at_fn_group_banner 99 'sets.at:151' \
   20938   "Broken Closure" "                                 " 5
   20939 at_xfail=no
   20940 (
   20941   $as_echo "99. $at_setup_line: testing $at_desc ..."
   20942   $at_traceon
   20943 
   20944 
   20945 cat >input.y <<'_ATEOF'
   20946 %%
   20947 a: b;
   20948 b: c;
   20949 c: d;
   20950 d: e;
   20951 e: f;
   20952 f: g;
   20953 g: h;
   20954 h: 'h';
   20955 _ATEOF
   20956 
   20957 
   20958 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   20959   at_save_special_files
   20960   mkdir xml-tests
   20961     # Don't combine these Bison invocations since we want to be sure that
   20962   # --report=all isn't required to get the full XML file.
   20963   { set +x
   20964 $as_echo "$at_srcdir/sets.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   20965                   --graph=xml-tests/test.dot --trace=sets input.y"
   20966 at_fn_check_prepare_notrace 'an embedded newline' "sets.at:165"
   20967 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   20968                   --graph=xml-tests/test.dot --trace=sets input.y
   20969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20970 at_status=$? at_failed=false
   20971 $at_check_filter
   20972 echo stderr:; cat "$at_stderr"
   20973 echo stdout:; cat "$at_stdout"
   20974 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165"
   20975 $at_failed && at_fn_log_failure
   20976 $at_traceon; }
   20977 
   20978   { set +x
   20979 $as_echo "$at_srcdir/sets.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y"
   20980 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:165"
   20981 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y
   20982 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   20983 at_status=$? at_failed=false
   20984 $at_check_filter
   20985 echo stderr:; cat "$at_stderr"
   20986 echo stdout:; cat "$at_stdout"
   20987 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165"
   20988 $at_failed && at_fn_log_failure
   20989 $at_traceon; }
   20990 
   20991     cp xml-tests/test.output expout
   20992   { set +x
   20993 $as_echo "$at_srcdir/sets.at:165: \$XSLTPROC \\
   20994              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   20995              xml-tests/test.xml"
   20996 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:165"
   20997 ( $at_check_trace; $XSLTPROC \
   20998              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   20999              xml-tests/test.xml
   21000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21001 at_status=$? at_failed=false
   21002 $at_check_filter
   21003 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21004 $at_diff expout "$at_stdout" || at_failed=:
   21005 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165"
   21006 $at_failed && at_fn_log_failure
   21007 $at_traceon; }
   21008 
   21009   sort xml-tests/test.dot > expout
   21010   { set +x
   21011 $as_echo "$at_srcdir/sets.at:165: \$XSLTPROC \\
   21012              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   21013              xml-tests/test.xml | sort"
   21014 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:165"
   21015 ( $at_check_trace; $XSLTPROC \
   21016              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   21017              xml-tests/test.xml | sort
   21018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21019 at_status=$? at_failed=false
   21020 $at_check_filter
   21021 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21022 $at_diff expout "$at_stdout" || at_failed=:
   21023 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165"
   21024 $at_failed && at_fn_log_failure
   21025 $at_traceon; }
   21026 
   21027   rm -rf xml-tests expout
   21028   at_restore_special_files
   21029 fi
   21030 { set +x
   21031 $as_echo "$at_srcdir/sets.at:165: bison --trace=sets input.y"
   21032 at_fn_check_prepare_trace "sets.at:165"
   21033 ( $at_check_trace; bison --trace=sets input.y
   21034 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21035 at_status=$? at_failed=false
   21036 $at_check_filter
   21037 echo stderr:; tee stderr <"$at_stderr"
   21038 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21039 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:165"
   21040 $at_failed && at_fn_log_failure
   21041 $at_traceon; }
   21042 
   21043 
   21044 
   21045 { set +x
   21046 $as_echo "$at_srcdir/sets.at:167: sed -n 's/[	 ]*\$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr"
   21047 at_fn_check_prepare_dynamic "sed -n 's/[	 ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr" "sets.at:167"
   21048 ( $at_check_trace; sed -n 's/[	 ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr
   21049 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21050 at_status=$? at_failed=false
   21051 $at_check_filter
   21052 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21053 echo >>"$at_stdout"; $as_echo "RTC: Firsts Output BEGIN
   21054 
   21055    012345678
   21056   .---------.
   21057  0|111111111|
   21058  1| 11111111|
   21059  2|  1111111|
   21060  3|   111111|
   21061  4|    11111|
   21062  5|     1111|
   21063  6|      111|
   21064  7|       11|
   21065  8|        1|
   21066   \`---------'
   21067 RTC: Firsts Output END
   21068 " | \
   21069   $at_diff - "$at_stdout" || at_failed=:
   21070 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:167"
   21071 $at_failed && at_fn_log_failure
   21072 $at_traceon; }
   21073 
   21074 
   21075   set +x
   21076   $at_times_p && times >"$at_times_file"
   21077 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   21078 read at_status <"$at_status_file"
   21079 #AT_STOP_99
   21080 #AT_START_100
   21081 at_fn_group_banner 100 'sets.at:193' \
   21082   "Firsts" "                                         " 5
   21083 at_xfail=no
   21084 (
   21085   $as_echo "100. $at_setup_line: testing $at_desc ..."
   21086   $at_traceon
   21087 
   21088 
   21089 cat >input.y <<'_ATEOF'
   21090 %nonassoc '<' '>'
   21091 %left '+' '-'
   21092 %right '^' '='
   21093 %%
   21094 exp:
   21095    exp '<' exp
   21096  | exp '>' exp
   21097  | exp '+' exp
   21098  | exp '-' exp
   21099  | exp '^' exp
   21100  | exp '=' exp
   21101  | "exp"
   21102  ;
   21103 _ATEOF
   21104 
   21105 
   21106 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   21107   at_save_special_files
   21108   mkdir xml-tests
   21109     # Don't combine these Bison invocations since we want to be sure that
   21110   # --report=all isn't required to get the full XML file.
   21111   { set +x
   21112 $as_echo "$at_srcdir/sets.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   21113                   --graph=xml-tests/test.dot --trace=sets input.y"
   21114 at_fn_check_prepare_notrace 'an embedded newline' "sets.at:211"
   21115 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   21116                   --graph=xml-tests/test.dot --trace=sets input.y
   21117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21118 at_status=$? at_failed=false
   21119 $at_check_filter
   21120 echo stderr:; cat "$at_stderr"
   21121 echo stdout:; cat "$at_stdout"
   21122 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
   21123 $at_failed && at_fn_log_failure
   21124 $at_traceon; }
   21125 
   21126   { set +x
   21127 $as_echo "$at_srcdir/sets.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y"
   21128 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:211"
   21129 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --trace=sets input.y
   21130 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21131 at_status=$? at_failed=false
   21132 $at_check_filter
   21133 echo stderr:; cat "$at_stderr"
   21134 echo stdout:; cat "$at_stdout"
   21135 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
   21136 $at_failed && at_fn_log_failure
   21137 $at_traceon; }
   21138 
   21139     cp xml-tests/test.output expout
   21140   { set +x
   21141 $as_echo "$at_srcdir/sets.at:211: \$XSLTPROC \\
   21142              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   21143              xml-tests/test.xml"
   21144 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:211"
   21145 ( $at_check_trace; $XSLTPROC \
   21146              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   21147              xml-tests/test.xml
   21148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21149 at_status=$? at_failed=false
   21150 $at_check_filter
   21151 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21152 $at_diff expout "$at_stdout" || at_failed=:
   21153 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
   21154 $at_failed && at_fn_log_failure
   21155 $at_traceon; }
   21156 
   21157   sort xml-tests/test.dot > expout
   21158   { set +x
   21159 $as_echo "$at_srcdir/sets.at:211: \$XSLTPROC \\
   21160              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   21161              xml-tests/test.xml | sort"
   21162 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:211"
   21163 ( $at_check_trace; $XSLTPROC \
   21164              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   21165              xml-tests/test.xml | sort
   21166 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21167 at_status=$? at_failed=false
   21168 $at_check_filter
   21169 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21170 $at_diff expout "$at_stdout" || at_failed=:
   21171 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
   21172 $at_failed && at_fn_log_failure
   21173 $at_traceon; }
   21174 
   21175   rm -rf xml-tests expout
   21176   at_restore_special_files
   21177 fi
   21178 { set +x
   21179 $as_echo "$at_srcdir/sets.at:211: bison --trace=sets input.y"
   21180 at_fn_check_prepare_trace "sets.at:211"
   21181 ( $at_check_trace; bison --trace=sets input.y
   21182 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21183 at_status=$? at_failed=false
   21184 $at_check_filter
   21185 echo stderr:; tee stderr <"$at_stderr"
   21186 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21187 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
   21188 $at_failed && at_fn_log_failure
   21189 $at_traceon; }
   21190 
   21191 
   21192 cat >extract.sed <<'_ATEOF'
   21193 #n
   21194 /^NULLABLE$/ {
   21195    :null
   21196    p
   21197    n
   21198    /^[	 ]*$/ !b null
   21199 }
   21200 /^FIRSTS$/ {
   21201    :firsts
   21202    p
   21203    n
   21204    /^[	 ]*$/ !b firsts
   21205 }
   21206 /^FDERIVES$/ {
   21207    :fderiv
   21208    p
   21209    n
   21210    /^[	 ]*$/ !b fderiv
   21211 }
   21212 /^DERIVES$/ {
   21213    :deriv
   21214    p
   21215    n
   21216    /^[	 ]*$/ !b deriv
   21217 }
   21218 _ATEOF
   21219 
   21220 { set +x
   21221 $as_echo "$at_srcdir/sets.at:212: sed -f extract.sed stderr"
   21222 at_fn_check_prepare_trace "sets.at:212"
   21223 ( $at_check_trace; sed -f extract.sed stderr
   21224 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21225 at_status=$? at_failed=false
   21226 $at_check_filter
   21227 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21228 echo stdout:; tee stdout <"$at_stdout"
   21229 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:212"
   21230 $at_failed && at_fn_log_failure
   21231 $at_traceon; }
   21232 
   21233 { set +x
   21234 $as_echo "$at_srcdir/sets.at:212: mv stdout sets"
   21235 at_fn_check_prepare_trace "sets.at:212"
   21236 ( $at_check_trace; mv stdout sets
   21237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21238 at_status=$? at_failed=false
   21239 $at_check_filter
   21240 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21241 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21242 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:212"
   21243 $at_failed && at_fn_log_failure
   21244 $at_traceon; }
   21245 
   21246 
   21247 { set +x
   21248 $as_echo "$at_srcdir/sets.at:213: cat sets"
   21249 at_fn_check_prepare_trace "sets.at:213"
   21250 ( $at_check_trace; cat sets
   21251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21252 at_status=$? at_failed=false
   21253 $at_check_filter
   21254 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21255 echo >>"$at_stdout"; $as_echo "DERIVES
   21256 	\$accept derives
   21257 		  0  exp \$end
   21258 	exp derives
   21259 		  1  exp '<' exp
   21260 		  2  exp '>' exp
   21261 		  3  exp '+' exp
   21262 		  4  exp '-' exp
   21263 		  5  exp '^' exp
   21264 		  6  exp '=' exp
   21265 		  7  \"exp\"
   21266 NULLABLE
   21267 	\$accept: no
   21268 	exp: no
   21269 FIRSTS
   21270 	\$accept firsts
   21271 		\$accept
   21272 		exp
   21273 	exp firsts
   21274 		exp
   21275 FDERIVES
   21276 	\$accept derives
   21277 		  0  exp \$end
   21278 		  1  exp '<' exp
   21279 		  2  exp '>' exp
   21280 		  3  exp '+' exp
   21281 		  4  exp '-' exp
   21282 		  5  exp '^' exp
   21283 		  6  exp '=' exp
   21284 		  7  \"exp\"
   21285 	exp derives
   21286 		  1  exp '<' exp
   21287 		  2  exp '>' exp
   21288 		  3  exp '+' exp
   21289 		  4  exp '-' exp
   21290 		  5  exp '^' exp
   21291 		  6  exp '=' exp
   21292 		  7  \"exp\"
   21293 " | \
   21294   $at_diff - "$at_stdout" || at_failed=:
   21295 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:213"
   21296 $at_failed && at_fn_log_failure
   21297 $at_traceon; }
   21298 
   21299 
   21300   set +x
   21301   $at_times_p && times >"$at_times_file"
   21302 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   21303 read at_status <"$at_status_file"
   21304 #AT_STOP_100
   21305 #AT_START_101
   21306 at_fn_group_banner 101 'sets.at:269' \
   21307   "Accept" "                                         " 5
   21308 at_xfail=no
   21309 (
   21310   $as_echo "101. $at_setup_line: testing $at_desc ..."
   21311   $at_traceon
   21312 
   21313 
   21314 cat >input.y <<'_ATEOF'
   21315 %token END 0
   21316 %%
   21317 input:
   21318   'a'
   21319 | '(' input ')'
   21320 | '(' error END
   21321 ;
   21322 _ATEOF
   21323 
   21324 
   21325 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   21326   at_save_special_files
   21327   mkdir xml-tests
   21328     # Don't combine these Bison invocations since we want to be sure that
   21329   # --report=all isn't required to get the full XML file.
   21330   { set +x
   21331 $as_echo "$at_srcdir/sets.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   21332                   --graph=xml-tests/test.dot -v -o input.c input.y"
   21333 at_fn_check_prepare_notrace 'an embedded newline' "sets.at:281"
   21334 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   21335                   --graph=xml-tests/test.dot -v -o input.c input.y
   21336 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21337 at_status=$? at_failed=false
   21338 $at_check_filter
   21339 echo stderr:; cat "$at_stderr"
   21340 echo stdout:; cat "$at_stdout"
   21341 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281"
   21342 $at_failed && at_fn_log_failure
   21343 $at_traceon; }
   21344 
   21345   { set +x
   21346 $as_echo "$at_srcdir/sets.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y"
   21347 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "sets.at:281"
   21348 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y
   21349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21350 at_status=$? at_failed=false
   21351 $at_check_filter
   21352 echo stderr:; cat "$at_stderr"
   21353 echo stdout:; cat "$at_stdout"
   21354 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281"
   21355 $at_failed && at_fn_log_failure
   21356 $at_traceon; }
   21357 
   21358     cp xml-tests/test.output expout
   21359   { set +x
   21360 $as_echo "$at_srcdir/sets.at:281: \$XSLTPROC \\
   21361              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   21362              xml-tests/test.xml"
   21363 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:281"
   21364 ( $at_check_trace; $XSLTPROC \
   21365              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   21366              xml-tests/test.xml
   21367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21368 at_status=$? at_failed=false
   21369 $at_check_filter
   21370 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21371 $at_diff expout "$at_stdout" || at_failed=:
   21372 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281"
   21373 $at_failed && at_fn_log_failure
   21374 $at_traceon; }
   21375 
   21376   sort xml-tests/test.dot > expout
   21377   { set +x
   21378 $as_echo "$at_srcdir/sets.at:281: \$XSLTPROC \\
   21379              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   21380              xml-tests/test.xml | sort"
   21381 at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:281"
   21382 ( $at_check_trace; $XSLTPROC \
   21383              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   21384              xml-tests/test.xml | sort
   21385 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21386 at_status=$? at_failed=false
   21387 $at_check_filter
   21388 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21389 $at_diff expout "$at_stdout" || at_failed=:
   21390 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281"
   21391 $at_failed && at_fn_log_failure
   21392 $at_traceon; }
   21393 
   21394   rm -rf xml-tests expout
   21395   at_restore_special_files
   21396 fi
   21397 { set +x
   21398 $as_echo "$at_srcdir/sets.at:281: bison -v -o input.c input.y"
   21399 at_fn_check_prepare_trace "sets.at:281"
   21400 ( $at_check_trace; bison -v -o input.c input.y
   21401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21402 at_status=$? at_failed=false
   21403 $at_check_filter
   21404 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21405 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21406 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:281"
   21407 $at_failed && at_fn_log_failure
   21408 $at_traceon; }
   21409 
   21410 
   21411 
   21412 # Get the final state in the parser.
   21413 { set +x
   21414 $as_echo "$at_srcdir/sets.at:284: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c"
   21415 at_fn_check_prepare_trace "sets.at:284"
   21416 ( $at_check_trace; sed -n 's/.*define YYFINAL *\([0-9][0-9]*\)/final state \1/p' input.c
   21417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21418 at_status=$? at_failed=false
   21419 $at_check_filter
   21420 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21421 echo stdout:; tee stdout <"$at_stdout"
   21422 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:284"
   21423 $at_failed && at_fn_log_failure
   21424 $at_traceon; }
   21425 
   21426 mv stdout expout
   21427 
   21428 # Get the final state in the report, from the "accept" action..
   21429 { set +x
   21430 $as_echo "$at_srcdir/sets.at:289: sed -n '
   21431            /^State \\(.*\\)/{
   21432 	     s//final state \\1/
   21433 	     x
   21434 	   }
   21435 	   / accept/{
   21436 	     x
   21437 	     p
   21438 	     q
   21439 	   }
   21440 	' input.output"
   21441 at_fn_check_prepare_notrace 'an embedded newline' "sets.at:289"
   21442 ( $at_check_trace; sed -n '
   21443            /^State \(.*\)/{
   21444 	     s//final state \1/
   21445 	     x
   21446 	   }
   21447 	   / accept/{
   21448 	     x
   21449 	     p
   21450 	     q
   21451 	   }
   21452 	' input.output
   21453 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21454 at_status=$? at_failed=false
   21455 $at_check_filter
   21456 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21457 $at_diff expout "$at_stdout" || at_failed=:
   21458 at_fn_check_status 0 $at_status "$at_srcdir/sets.at:289"
   21459 $at_failed && at_fn_log_failure
   21460 $at_traceon; }
   21461 
   21462 
   21463   set +x
   21464   $at_times_p && times >"$at_times_file"
   21465 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   21466 read at_status <"$at_status_file"
   21467 #AT_STOP_101
   21468 #AT_START_102
   21469 at_fn_group_banner 102 'reduce.at:25' \
   21470   "Useless Terminals" "                              " 6
   21471 at_xfail=no
   21472 (
   21473   $as_echo "102. $at_setup_line: testing $at_desc ..."
   21474   $at_traceon
   21475 
   21476 
   21477 cat >input.y <<'_ATEOF'
   21478 %verbose
   21479 %output "input.c"
   21480 
   21481 %token useless1
   21482 %token useless2
   21483 %token useless3
   21484 %token useless4
   21485 %token useless5
   21486 %token useless6
   21487 %token useless7
   21488 %token useless8
   21489 %token useless9
   21490 
   21491 %token useful
   21492 %%
   21493 exp: useful;
   21494 _ATEOF
   21495 
   21496 
   21497 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   21498   at_save_special_files
   21499   mkdir xml-tests
   21500     # Don't combine these Bison invocations since we want to be sure that
   21501   # --report=all isn't required to get the full XML file.
   21502   { set +x
   21503 $as_echo "$at_srcdir/reduce.at:46: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   21504                   --graph=xml-tests/test.dot input.y"
   21505 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:46"
   21506 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   21507                   --graph=xml-tests/test.dot input.y
   21508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21509 at_status=$? at_failed=false
   21510 $at_check_filter
   21511 echo stderr:; cat "$at_stderr"
   21512 echo stdout:; cat "$at_stdout"
   21513 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46"
   21514 $at_failed && at_fn_log_failure
   21515 $at_traceon; }
   21516 
   21517   { set +x
   21518 $as_echo "$at_srcdir/reduce.at:46: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   21519 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:46"
   21520 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   21521 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21522 at_status=$? at_failed=false
   21523 $at_check_filter
   21524 echo stderr:; cat "$at_stderr"
   21525 echo stdout:; cat "$at_stdout"
   21526 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46"
   21527 $at_failed && at_fn_log_failure
   21528 $at_traceon; }
   21529 
   21530     cp xml-tests/test.output expout
   21531   { set +x
   21532 $as_echo "$at_srcdir/reduce.at:46: \$XSLTPROC \\
   21533              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   21534              xml-tests/test.xml"
   21535 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:46"
   21536 ( $at_check_trace; $XSLTPROC \
   21537              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   21538              xml-tests/test.xml
   21539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21540 at_status=$? at_failed=false
   21541 $at_check_filter
   21542 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21543 $at_diff expout "$at_stdout" || at_failed=:
   21544 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46"
   21545 $at_failed && at_fn_log_failure
   21546 $at_traceon; }
   21547 
   21548   sort xml-tests/test.dot > expout
   21549   { set +x
   21550 $as_echo "$at_srcdir/reduce.at:46: \$XSLTPROC \\
   21551              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   21552              xml-tests/test.xml | sort"
   21553 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:46"
   21554 ( $at_check_trace; $XSLTPROC \
   21555              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   21556              xml-tests/test.xml | sort
   21557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21558 at_status=$? at_failed=false
   21559 $at_check_filter
   21560 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21561 $at_diff expout "$at_stdout" || at_failed=:
   21562 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46"
   21563 $at_failed && at_fn_log_failure
   21564 $at_traceon; }
   21565 
   21566   rm -rf xml-tests expout
   21567   at_restore_special_files
   21568 fi
   21569 { set +x
   21570 $as_echo "$at_srcdir/reduce.at:46: bison input.y"
   21571 at_fn_check_prepare_trace "reduce.at:46"
   21572 ( $at_check_trace; bison input.y
   21573 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21574 at_status=$? at_failed=false
   21575 $at_check_filter
   21576 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21577 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21578 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:46"
   21579 $at_failed && at_fn_log_failure
   21580 $at_traceon; }
   21581 
   21582 
   21583 
   21584 { set +x
   21585 $as_echo "$at_srcdir/reduce.at:48: sed -n '/^Grammar/q;/^\$/!p' input.output"
   21586 at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:48"
   21587 ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
   21588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21589 at_status=$? at_failed=false
   21590 $at_check_filter
   21591 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21592 echo >>"$at_stdout"; $as_echo "Terminals unused in grammar
   21593    useless1
   21594    useless2
   21595    useless3
   21596    useless4
   21597    useless5
   21598    useless6
   21599    useless7
   21600    useless8
   21601    useless9
   21602 " | \
   21603   $at_diff - "$at_stdout" || at_failed=:
   21604 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:48"
   21605 $at_failed && at_fn_log_failure
   21606 $at_traceon; }
   21607 
   21608 
   21609   set +x
   21610   $at_times_p && times >"$at_times_file"
   21611 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   21612 read at_status <"$at_status_file"
   21613 #AT_STOP_102
   21614 #AT_START_103
   21615 at_fn_group_banner 103 'reduce.at:69' \
   21616   "Useless Nonterminals" "                           " 6
   21617 at_xfail=no
   21618 (
   21619   $as_echo "103. $at_setup_line: testing $at_desc ..."
   21620   $at_traceon
   21621 
   21622 
   21623 cat >input.y <<'_ATEOF'
   21624 %verbose
   21625 %output "input.c"
   21626 
   21627 %nterm useless1
   21628 %nterm useless2
   21629 %nterm useless3
   21630 %nterm useless4
   21631 %nterm useless5
   21632 %nterm useless6
   21633 %nterm useless7
   21634 %nterm useless8
   21635 %nterm useless9
   21636 
   21637 %token useful
   21638 %%
   21639 exp: useful;
   21640 _ATEOF
   21641 
   21642 
   21643 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   21644   at_save_special_files
   21645   mkdir xml-tests
   21646     # Don't combine these Bison invocations since we want to be sure that
   21647   # --report=all isn't required to get the full XML file.
   21648   { set +x
   21649 $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   21650                   --graph=xml-tests/test.dot input.y"
   21651 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:90"
   21652 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   21653                   --graph=xml-tests/test.dot input.y
   21654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21655 at_status=$? at_failed=false
   21656 $at_check_filter
   21657 echo stderr:; cat "$at_stderr"
   21658 echo stdout:; cat "$at_stdout"
   21659 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21660 $at_failed && at_fn_log_failure
   21661 $at_traceon; }
   21662 
   21663   { set +x
   21664 $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   21665 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:90"
   21666 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   21667 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21668 at_status=$? at_failed=false
   21669 $at_check_filter
   21670 echo stderr:; cat "$at_stderr"
   21671 echo stdout:; cat "$at_stdout"
   21672 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21673 $at_failed && at_fn_log_failure
   21674 $at_traceon; }
   21675 
   21676     cp xml-tests/test.output expout
   21677   { set +x
   21678 $as_echo "$at_srcdir/reduce.at:90: \$XSLTPROC \\
   21679              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   21680              xml-tests/test.xml"
   21681 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:90"
   21682 ( $at_check_trace; $XSLTPROC \
   21683              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   21684              xml-tests/test.xml
   21685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21686 at_status=$? at_failed=false
   21687 $at_check_filter
   21688 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21689 $at_diff expout "$at_stdout" || at_failed=:
   21690 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21691 $at_failed && at_fn_log_failure
   21692 $at_traceon; }
   21693 
   21694   sort xml-tests/test.dot > expout
   21695   { set +x
   21696 $as_echo "$at_srcdir/reduce.at:90: \$XSLTPROC \\
   21697              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   21698              xml-tests/test.xml | sort"
   21699 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:90"
   21700 ( $at_check_trace; $XSLTPROC \
   21701              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   21702              xml-tests/test.xml | sort
   21703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21704 at_status=$? at_failed=false
   21705 $at_check_filter
   21706 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21707 $at_diff expout "$at_stdout" || at_failed=:
   21708 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21709 $at_failed && at_fn_log_failure
   21710 $at_traceon; }
   21711 
   21712   rm -rf xml-tests expout
   21713   at_restore_special_files
   21714 fi
   21715 { set +x
   21716 $as_echo "$at_srcdir/reduce.at:90: bison input.y"
   21717 at_fn_check_prepare_trace "reduce.at:90"
   21718 ( $at_check_trace; bison input.y
   21719 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21720 at_status=$? at_failed=false
   21721 $at_check_filter
   21722 echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
   21723 input.y:4.8-15: warning: nonterminal useless in grammar: useless1
   21724 input.y:5.8-15: warning: nonterminal useless in grammar: useless2
   21725 input.y:6.8-15: warning: nonterminal useless in grammar: useless3
   21726 input.y:7.8-15: warning: nonterminal useless in grammar: useless4
   21727 input.y:8.8-15: warning: nonterminal useless in grammar: useless5
   21728 input.y:9.8-15: warning: nonterminal useless in grammar: useless6
   21729 input.y:10.8-15: warning: nonterminal useless in grammar: useless7
   21730 input.y:11.8-15: warning: nonterminal useless in grammar: useless8
   21731 input.y:12.8-15: warning: nonterminal useless in grammar: useless9
   21732 " | \
   21733   $at_diff - "$at_stderr" || at_failed=:
   21734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21735 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21736 $at_failed && at_fn_log_failure
   21737 $at_traceon; }
   21738 
   21739 # Defining POSIXLY_CORRECT causes bison to complain if options are
   21740 # added after the grammar file name, so skip these checks in that
   21741 # case.
   21742 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   21743   at_save_special_files
   21744 
   21745   # To avoid expanding it repeatedly, store specified stdout.
   21746   : >expout
   21747 
   21748   # Run with -Werror.
   21749   { set +x
   21750 $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   21751 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "reduce.at:90"
   21752 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   21753 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21754 at_status=$? at_failed=false
   21755 $at_check_filter
   21756 echo stderr:; tee stderr <"$at_stderr"
   21757 $at_diff expout "$at_stdout" || at_failed=:
   21758 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:90"
   21759 $at_failed && at_fn_log_failure
   21760 $at_traceon; }
   21761 
   21762 
   21763   # Build expected stderr up to and including the "warnings being
   21764   # treated as errors" message.
   21765   cat >at-bison-check-warnings <<'_ATEOF'
   21766 input.y: warning: 9 nonterminals useless in grammar
   21767 input.y:4.8-15: warning: nonterminal useless in grammar: useless1
   21768 input.y:5.8-15: warning: nonterminal useless in grammar: useless2
   21769 input.y:6.8-15: warning: nonterminal useless in grammar: useless3
   21770 input.y:7.8-15: warning: nonterminal useless in grammar: useless4
   21771 input.y:8.8-15: warning: nonterminal useless in grammar: useless5
   21772 input.y:9.8-15: warning: nonterminal useless in grammar: useless6
   21773 input.y:10.8-15: warning: nonterminal useless in grammar: useless7
   21774 input.y:11.8-15: warning: nonterminal useless in grammar: useless8
   21775 input.y:12.8-15: warning: nonterminal useless in grammar: useless9
   21776 _ATEOF
   21777 
   21778   at_bison_check_first=`sed -n \
   21779     '/: warning: /{=;q;}' at-bison-check-warnings`
   21780   : ${at_bison_check_first:=1}
   21781   at_bison_check_first_tmp=`sed -n \
   21782     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   21783   : ${at_bison_check_first_tmp:=1}
   21784   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   21785     at_bison_check_first=$at_bison_check_first_tmp
   21786   fi
   21787   if test $at_bison_check_first -gt 1; then
   21788     sed -n "1,`expr $at_bison_check_first - 1`"p \
   21789       at-bison-check-warnings > experr
   21790   fi
   21791   echo 'bison: warnings being treated as errors' >> experr
   21792 
   21793   # Finish building expected stderr and check.  Unlike warnings,
   21794   # complaints cause bison to exit early.  Thus, with -Werror, bison
   21795   # does not necessarily report all warnings that it does without
   21796   # -Werror, but it at least reports one.
   21797   at_bison_check_last=`sed -n '$=' stderr`
   21798   : ${at_bison_check_last:=1}
   21799   at_bison_check_last=`expr $at_bison_check_last - 1`
   21800   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   21801     at-bison-check-warnings >> experr
   21802   { set +x
   21803 $as_echo "$at_srcdir/reduce.at:90: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   21804               stderr 1>&2"
   21805 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:90"
   21806 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   21807               stderr 1>&2
   21808 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21809 at_status=$? at_failed=false
   21810 $at_check_filter
   21811 $at_diff experr "$at_stderr" || at_failed=:
   21812 at_fn_diff_devnull "$at_stdout" || at_failed=:
   21813 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21814 $at_failed && at_fn_log_failure
   21815 $at_traceon; }
   21816 
   21817 
   21818   # Now check --warnings=error.
   21819   cp stderr experr
   21820   { set +x
   21821 $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   21822 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "reduce.at:90"
   21823 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   21824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21825 at_status=$? at_failed=false
   21826 $at_check_filter
   21827 $at_diff experr "$at_stderr" || at_failed=:
   21828 $at_diff expout "$at_stdout" || at_failed=:
   21829 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:90"
   21830 $at_failed && at_fn_log_failure
   21831 $at_traceon; }
   21832 
   21833 
   21834   # Now check -Wnone and --warnings=none by making sure that
   21835   # -Werror doesn't change the exit status when -Wnone or
   21836   # --warnings=none is specified.
   21837   { set +x
   21838 $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   21839 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "reduce.at:90"
   21840 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   21841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21842 at_status=$? at_failed=false
   21843 $at_check_filter
   21844 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21845 $at_diff expout "$at_stdout" || at_failed=:
   21846 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21847 $at_failed && at_fn_log_failure
   21848 $at_traceon; }
   21849 
   21850   { set +x
   21851 $as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   21852 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "reduce.at:90"
   21853 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   21854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21855 at_status=$? at_failed=false
   21856 $at_check_filter
   21857 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21858 $at_diff expout "$at_stdout" || at_failed=:
   21859 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:90"
   21860 $at_failed && at_fn_log_failure
   21861 $at_traceon; }
   21862 
   21863 
   21864   at_restore_special_files
   21865 fi
   21866 
   21867 { set +x
   21868 $as_echo "$at_srcdir/reduce.at:103: sed -n '/^Grammar/q;/^\$/!p' input.output"
   21869 at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:103"
   21870 ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
   21871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21872 at_status=$? at_failed=false
   21873 $at_check_filter
   21874 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21875 echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   21876    useless1
   21877    useless2
   21878    useless3
   21879    useless4
   21880    useless5
   21881    useless6
   21882    useless7
   21883    useless8
   21884    useless9
   21885 " | \
   21886   $at_diff - "$at_stdout" || at_failed=:
   21887 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:103"
   21888 $at_failed && at_fn_log_failure
   21889 $at_traceon; }
   21890 
   21891 
   21892   set +x
   21893   $at_times_p && times >"$at_times_file"
   21894 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   21895 read at_status <"$at_status_file"
   21896 #AT_STOP_103
   21897 #AT_START_104
   21898 at_fn_group_banner 104 'reduce.at:124' \
   21899   "Useless Rules" "                                  " 6
   21900 at_xfail=no
   21901 (
   21902   $as_echo "104. $at_setup_line: testing $at_desc ..."
   21903   $at_traceon
   21904 
   21905 
   21906 
   21907 
   21908 cat >input.y <<'_ATEOF'
   21909 %verbose
   21910 %output "input.c"
   21911 %token useful
   21912 %%
   21913 exp: useful;
   21914 useless1: '1';
   21915 useless2: '2';
   21916 useless3: '3';
   21917 useless4: '4';
   21918 useless5: '5';
   21919 useless6: '6';
   21920 useless7: '7';
   21921 useless8: '8';
   21922 useless9: '9';
   21923 _ATEOF
   21924 
   21925 
   21926 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   21927   at_save_special_files
   21928   mkdir xml-tests
   21929     # Don't combine these Bison invocations since we want to be sure that
   21930   # --report=all isn't required to get the full XML file.
   21931   { set +x
   21932 $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   21933                   --graph=xml-tests/test.dot -fcaret input.y"
   21934 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:145"
   21935 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   21936                   --graph=xml-tests/test.dot -fcaret input.y
   21937 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21938 at_status=$? at_failed=false
   21939 $at_check_filter
   21940 echo stderr:; cat "$at_stderr"
   21941 echo stdout:; cat "$at_stdout"
   21942 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   21943 $at_failed && at_fn_log_failure
   21944 $at_traceon; }
   21945 
   21946   { set +x
   21947 $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y"
   21948 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:145"
   21949 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret input.y
   21950 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21951 at_status=$? at_failed=false
   21952 $at_check_filter
   21953 echo stderr:; cat "$at_stderr"
   21954 echo stdout:; cat "$at_stdout"
   21955 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   21956 $at_failed && at_fn_log_failure
   21957 $at_traceon; }
   21958 
   21959     cp xml-tests/test.output expout
   21960   { set +x
   21961 $as_echo "$at_srcdir/reduce.at:145: \$XSLTPROC \\
   21962              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   21963              xml-tests/test.xml"
   21964 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:145"
   21965 ( $at_check_trace; $XSLTPROC \
   21966              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   21967              xml-tests/test.xml
   21968 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21969 at_status=$? at_failed=false
   21970 $at_check_filter
   21971 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21972 $at_diff expout "$at_stdout" || at_failed=:
   21973 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   21974 $at_failed && at_fn_log_failure
   21975 $at_traceon; }
   21976 
   21977   sort xml-tests/test.dot > expout
   21978   { set +x
   21979 $as_echo "$at_srcdir/reduce.at:145: \$XSLTPROC \\
   21980              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   21981              xml-tests/test.xml | sort"
   21982 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:145"
   21983 ( $at_check_trace; $XSLTPROC \
   21984              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   21985              xml-tests/test.xml | sort
   21986 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   21987 at_status=$? at_failed=false
   21988 $at_check_filter
   21989 at_fn_diff_devnull "$at_stderr" || at_failed=:
   21990 $at_diff expout "$at_stdout" || at_failed=:
   21991 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   21992 $at_failed && at_fn_log_failure
   21993 $at_traceon; }
   21994 
   21995   rm -rf xml-tests expout
   21996   at_restore_special_files
   21997 fi
   21998 { set +x
   21999 $as_echo "$at_srcdir/reduce.at:145: bison -fcaret input.y"
   22000 at_fn_check_prepare_trace "reduce.at:145"
   22001 ( $at_check_trace; bison -fcaret input.y
   22002 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22003 at_status=$? at_failed=false
   22004 $at_check_filter
   22005 echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
   22006 input.y: warning: 9 rules useless in grammar
   22007 input.y:6.1-8: warning: nonterminal useless in grammar: useless1
   22008  useless1: '1';
   22009  ^^^^^^^^
   22010 input.y:7.1-8: warning: nonterminal useless in grammar: useless2
   22011  useless2: '2';
   22012  ^^^^^^^^
   22013 input.y:8.1-8: warning: nonterminal useless in grammar: useless3
   22014  useless3: '3';
   22015  ^^^^^^^^
   22016 input.y:9.1-8: warning: nonterminal useless in grammar: useless4
   22017  useless4: '4';
   22018  ^^^^^^^^
   22019 input.y:10.1-8: warning: nonterminal useless in grammar: useless5
   22020  useless5: '5';
   22021  ^^^^^^^^
   22022 input.y:11.1-8: warning: nonterminal useless in grammar: useless6
   22023  useless6: '6';
   22024  ^^^^^^^^
   22025 input.y:12.1-8: warning: nonterminal useless in grammar: useless7
   22026  useless7: '7';
   22027  ^^^^^^^^
   22028 input.y:13.1-8: warning: nonterminal useless in grammar: useless8
   22029  useless8: '8';
   22030  ^^^^^^^^
   22031 input.y:14.1-8: warning: nonterminal useless in grammar: useless9
   22032  useless9: '9';
   22033  ^^^^^^^^
   22034 input.y:6.11-13: warning: rule useless in grammar
   22035  useless1: '1';
   22036            ^^^
   22037 input.y:7.11-13: warning: rule useless in grammar
   22038  useless2: '2';
   22039            ^^^
   22040 input.y:8.11-13: warning: rule useless in grammar
   22041  useless3: '3';
   22042            ^^^
   22043 input.y:9.11-13: warning: rule useless in grammar
   22044  useless4: '4';
   22045            ^^^
   22046 input.y:10.11-13: warning: rule useless in grammar
   22047  useless5: '5';
   22048            ^^^
   22049 input.y:11.11-13: warning: rule useless in grammar
   22050  useless6: '6';
   22051            ^^^
   22052 input.y:12.11-13: warning: rule useless in grammar
   22053  useless7: '7';
   22054            ^^^
   22055 input.y:13.11-13: warning: rule useless in grammar
   22056  useless8: '8';
   22057            ^^^
   22058 input.y:14.11-13: warning: rule useless in grammar
   22059  useless9: '9';
   22060            ^^^
   22061 " | \
   22062   $at_diff - "$at_stderr" || at_failed=:
   22063 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22064 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   22065 $at_failed && at_fn_log_failure
   22066 $at_traceon; }
   22067 
   22068 # Defining POSIXLY_CORRECT causes bison to complain if options are
   22069 # added after the grammar file name, so skip these checks in that
   22070 # case.
   22071 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   22072   at_save_special_files
   22073 
   22074   # To avoid expanding it repeatedly, store specified stdout.
   22075   : >expout
   22076 
   22077   # Run with -Werror.
   22078   { set +x
   22079 $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror"
   22080 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Werror" "reduce.at:145"
   22081 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Werror
   22082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22083 at_status=$? at_failed=false
   22084 $at_check_filter
   22085 echo stderr:; tee stderr <"$at_stderr"
   22086 $at_diff expout "$at_stdout" || at_failed=:
   22087 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:145"
   22088 $at_failed && at_fn_log_failure
   22089 $at_traceon; }
   22090 
   22091 
   22092   # Build expected stderr up to and including the "warnings being
   22093   # treated as errors" message.
   22094   cat >at-bison-check-warnings <<'_ATEOF'
   22095 input.y: warning: 9 nonterminals useless in grammar
   22096 input.y: warning: 9 rules useless in grammar
   22097 input.y:6.1-8: warning: nonterminal useless in grammar: useless1
   22098  useless1: '1';
   22099  ^^^^^^^^
   22100 input.y:7.1-8: warning: nonterminal useless in grammar: useless2
   22101  useless2: '2';
   22102  ^^^^^^^^
   22103 input.y:8.1-8: warning: nonterminal useless in grammar: useless3
   22104  useless3: '3';
   22105  ^^^^^^^^
   22106 input.y:9.1-8: warning: nonterminal useless in grammar: useless4
   22107  useless4: '4';
   22108  ^^^^^^^^
   22109 input.y:10.1-8: warning: nonterminal useless in grammar: useless5
   22110  useless5: '5';
   22111  ^^^^^^^^
   22112 input.y:11.1-8: warning: nonterminal useless in grammar: useless6
   22113  useless6: '6';
   22114  ^^^^^^^^
   22115 input.y:12.1-8: warning: nonterminal useless in grammar: useless7
   22116  useless7: '7';
   22117  ^^^^^^^^
   22118 input.y:13.1-8: warning: nonterminal useless in grammar: useless8
   22119  useless8: '8';
   22120  ^^^^^^^^
   22121 input.y:14.1-8: warning: nonterminal useless in grammar: useless9
   22122  useless9: '9';
   22123  ^^^^^^^^
   22124 input.y:6.11-13: warning: rule useless in grammar
   22125  useless1: '1';
   22126            ^^^
   22127 input.y:7.11-13: warning: rule useless in grammar
   22128  useless2: '2';
   22129            ^^^
   22130 input.y:8.11-13: warning: rule useless in grammar
   22131  useless3: '3';
   22132            ^^^
   22133 input.y:9.11-13: warning: rule useless in grammar
   22134  useless4: '4';
   22135            ^^^
   22136 input.y:10.11-13: warning: rule useless in grammar
   22137  useless5: '5';
   22138            ^^^
   22139 input.y:11.11-13: warning: rule useless in grammar
   22140  useless6: '6';
   22141            ^^^
   22142 input.y:12.11-13: warning: rule useless in grammar
   22143  useless7: '7';
   22144            ^^^
   22145 input.y:13.11-13: warning: rule useless in grammar
   22146  useless8: '8';
   22147            ^^^
   22148 input.y:14.11-13: warning: rule useless in grammar
   22149  useless9: '9';
   22150            ^^^
   22151 _ATEOF
   22152 
   22153   at_bison_check_first=`sed -n \
   22154     '/: warning: /{=;q;}' at-bison-check-warnings`
   22155   : ${at_bison_check_first:=1}
   22156   at_bison_check_first_tmp=`sed -n \
   22157     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   22158   : ${at_bison_check_first_tmp:=1}
   22159   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   22160     at_bison_check_first=$at_bison_check_first_tmp
   22161   fi
   22162   if test $at_bison_check_first -gt 1; then
   22163     sed -n "1,`expr $at_bison_check_first - 1`"p \
   22164       at-bison-check-warnings > experr
   22165   fi
   22166   echo 'bison: warnings being treated as errors' >> experr
   22167 
   22168   # Finish building expected stderr and check.  Unlike warnings,
   22169   # complaints cause bison to exit early.  Thus, with -Werror, bison
   22170   # does not necessarily report all warnings that it does without
   22171   # -Werror, but it at least reports one.
   22172   at_bison_check_last=`sed -n '$=' stderr`
   22173   : ${at_bison_check_last:=1}
   22174   at_bison_check_last=`expr $at_bison_check_last - 1`
   22175   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   22176     at-bison-check-warnings >> experr
   22177   { set +x
   22178 $as_echo "$at_srcdir/reduce.at:145: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   22179               stderr 1>&2"
   22180 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:145"
   22181 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   22182               stderr 1>&2
   22183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22184 at_status=$? at_failed=false
   22185 $at_check_filter
   22186 $at_diff experr "$at_stderr" || at_failed=:
   22187 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22188 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   22189 $at_failed && at_fn_log_failure
   22190 $at_traceon; }
   22191 
   22192 
   22193   # Now check --warnings=error.
   22194   cp stderr experr
   22195   { set +x
   22196 $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error"
   22197 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error" "reduce.at:145"
   22198 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=error
   22199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22200 at_status=$? at_failed=false
   22201 $at_check_filter
   22202 $at_diff experr "$at_stderr" || at_failed=:
   22203 $at_diff expout "$at_stdout" || at_failed=:
   22204 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:145"
   22205 $at_failed && at_fn_log_failure
   22206 $at_traceon; }
   22207 
   22208 
   22209   # Now check -Wnone and --warnings=none by making sure that
   22210   # -Werror doesn't change the exit status when -Wnone or
   22211   # --warnings=none is specified.
   22212   { set +x
   22213 $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror"
   22214 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror" "reduce.at:145"
   22215 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y -Wnone -Werror
   22216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22217 at_status=$? at_failed=false
   22218 $at_check_filter
   22219 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22220 $at_diff expout "$at_stdout" || at_failed=:
   22221 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   22222 $at_failed && at_fn_log_failure
   22223 $at_traceon; }
   22224 
   22225   { set +x
   22226 $as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror"
   22227 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror" "reduce.at:145"
   22228 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret input.y --warnings=none -Werror
   22229 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22230 at_status=$? at_failed=false
   22231 $at_check_filter
   22232 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22233 $at_diff expout "$at_stdout" || at_failed=:
   22234 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:145"
   22235 $at_failed && at_fn_log_failure
   22236 $at_traceon; }
   22237 
   22238 
   22239   at_restore_special_files
   22240 fi
   22241 
   22242 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   22243   at_save_special_files
   22244   mkdir xml-tests
   22245     # Don't combine these Bison invocations since we want to be sure that
   22246   # --report=all isn't required to get the full XML file.
   22247   { set +x
   22248 $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   22249                   --graph=xml-tests/test.dot input.y"
   22250 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:204"
   22251 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   22252                   --graph=xml-tests/test.dot input.y
   22253 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22254 at_status=$? at_failed=false
   22255 $at_check_filter
   22256 echo stderr:; cat "$at_stderr"
   22257 echo stdout:; cat "$at_stdout"
   22258 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22259 $at_failed && at_fn_log_failure
   22260 $at_traceon; }
   22261 
   22262   { set +x
   22263 $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   22264 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:204"
   22265 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   22266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22267 at_status=$? at_failed=false
   22268 $at_check_filter
   22269 echo stderr:; cat "$at_stderr"
   22270 echo stdout:; cat "$at_stdout"
   22271 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22272 $at_failed && at_fn_log_failure
   22273 $at_traceon; }
   22274 
   22275     cp xml-tests/test.output expout
   22276   { set +x
   22277 $as_echo "$at_srcdir/reduce.at:204: \$XSLTPROC \\
   22278              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   22279              xml-tests/test.xml"
   22280 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:204"
   22281 ( $at_check_trace; $XSLTPROC \
   22282              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   22283              xml-tests/test.xml
   22284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22285 at_status=$? at_failed=false
   22286 $at_check_filter
   22287 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22288 $at_diff expout "$at_stdout" || at_failed=:
   22289 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22290 $at_failed && at_fn_log_failure
   22291 $at_traceon; }
   22292 
   22293   sort xml-tests/test.dot > expout
   22294   { set +x
   22295 $as_echo "$at_srcdir/reduce.at:204: \$XSLTPROC \\
   22296              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   22297              xml-tests/test.xml | sort"
   22298 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:204"
   22299 ( $at_check_trace; $XSLTPROC \
   22300              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   22301              xml-tests/test.xml | sort
   22302 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22303 at_status=$? at_failed=false
   22304 $at_check_filter
   22305 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22306 $at_diff expout "$at_stdout" || at_failed=:
   22307 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22308 $at_failed && at_fn_log_failure
   22309 $at_traceon; }
   22310 
   22311   rm -rf xml-tests expout
   22312   at_restore_special_files
   22313 fi
   22314 { set +x
   22315 $as_echo "$at_srcdir/reduce.at:204: bison input.y"
   22316 at_fn_check_prepare_trace "reduce.at:204"
   22317 ( $at_check_trace; bison input.y
   22318 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22319 at_status=$? at_failed=false
   22320 $at_check_filter
   22321 echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
   22322 input.y: warning: 9 rules useless in grammar
   22323 input.y:6.1-8: warning: nonterminal useless in grammar: useless1
   22324 input.y:7.1-8: warning: nonterminal useless in grammar: useless2
   22325 input.y:8.1-8: warning: nonterminal useless in grammar: useless3
   22326 input.y:9.1-8: warning: nonterminal useless in grammar: useless4
   22327 input.y:10.1-8: warning: nonterminal useless in grammar: useless5
   22328 input.y:11.1-8: warning: nonterminal useless in grammar: useless6
   22329 input.y:12.1-8: warning: nonterminal useless in grammar: useless7
   22330 input.y:13.1-8: warning: nonterminal useless in grammar: useless8
   22331 input.y:14.1-8: warning: nonterminal useless in grammar: useless9
   22332 input.y:6.11-13: warning: rule useless in grammar: useless1: '1'
   22333 input.y:7.11-13: warning: rule useless in grammar: useless2: '2'
   22334 input.y:8.11-13: warning: rule useless in grammar: useless3: '3'
   22335 input.y:9.11-13: warning: rule useless in grammar: useless4: '4'
   22336 input.y:10.11-13: warning: rule useless in grammar: useless5: '5'
   22337 input.y:11.11-13: warning: rule useless in grammar: useless6: '6'
   22338 input.y:12.11-13: warning: rule useless in grammar: useless7: '7'
   22339 input.y:13.11-13: warning: rule useless in grammar: useless8: '8'
   22340 input.y:14.11-13: warning: rule useless in grammar: useless9: '9'
   22341 " | \
   22342   $at_diff - "$at_stderr" || at_failed=:
   22343 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22344 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22345 $at_failed && at_fn_log_failure
   22346 $at_traceon; }
   22347 
   22348 # Defining POSIXLY_CORRECT causes bison to complain if options are
   22349 # added after the grammar file name, so skip these checks in that
   22350 # case.
   22351 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   22352   at_save_special_files
   22353 
   22354   # To avoid expanding it repeatedly, store specified stdout.
   22355   : >expout
   22356 
   22357   # Run with -Werror.
   22358   { set +x
   22359 $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   22360 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "reduce.at:204"
   22361 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   22362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22363 at_status=$? at_failed=false
   22364 $at_check_filter
   22365 echo stderr:; tee stderr <"$at_stderr"
   22366 $at_diff expout "$at_stdout" || at_failed=:
   22367 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:204"
   22368 $at_failed && at_fn_log_failure
   22369 $at_traceon; }
   22370 
   22371 
   22372   # Build expected stderr up to and including the "warnings being
   22373   # treated as errors" message.
   22374   cat >at-bison-check-warnings <<'_ATEOF'
   22375 input.y: warning: 9 nonterminals useless in grammar
   22376 input.y: warning: 9 rules useless in grammar
   22377 input.y:6.1-8: warning: nonterminal useless in grammar: useless1
   22378 input.y:7.1-8: warning: nonterminal useless in grammar: useless2
   22379 input.y:8.1-8: warning: nonterminal useless in grammar: useless3
   22380 input.y:9.1-8: warning: nonterminal useless in grammar: useless4
   22381 input.y:10.1-8: warning: nonterminal useless in grammar: useless5
   22382 input.y:11.1-8: warning: nonterminal useless in grammar: useless6
   22383 input.y:12.1-8: warning: nonterminal useless in grammar: useless7
   22384 input.y:13.1-8: warning: nonterminal useless in grammar: useless8
   22385 input.y:14.1-8: warning: nonterminal useless in grammar: useless9
   22386 input.y:6.11-13: warning: rule useless in grammar: useless1: '1'
   22387 input.y:7.11-13: warning: rule useless in grammar: useless2: '2'
   22388 input.y:8.11-13: warning: rule useless in grammar: useless3: '3'
   22389 input.y:9.11-13: warning: rule useless in grammar: useless4: '4'
   22390 input.y:10.11-13: warning: rule useless in grammar: useless5: '5'
   22391 input.y:11.11-13: warning: rule useless in grammar: useless6: '6'
   22392 input.y:12.11-13: warning: rule useless in grammar: useless7: '7'
   22393 input.y:13.11-13: warning: rule useless in grammar: useless8: '8'
   22394 input.y:14.11-13: warning: rule useless in grammar: useless9: '9'
   22395 _ATEOF
   22396 
   22397   at_bison_check_first=`sed -n \
   22398     '/: warning: /{=;q;}' at-bison-check-warnings`
   22399   : ${at_bison_check_first:=1}
   22400   at_bison_check_first_tmp=`sed -n \
   22401     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   22402   : ${at_bison_check_first_tmp:=1}
   22403   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   22404     at_bison_check_first=$at_bison_check_first_tmp
   22405   fi
   22406   if test $at_bison_check_first -gt 1; then
   22407     sed -n "1,`expr $at_bison_check_first - 1`"p \
   22408       at-bison-check-warnings > experr
   22409   fi
   22410   echo 'bison: warnings being treated as errors' >> experr
   22411 
   22412   # Finish building expected stderr and check.  Unlike warnings,
   22413   # complaints cause bison to exit early.  Thus, with -Werror, bison
   22414   # does not necessarily report all warnings that it does without
   22415   # -Werror, but it at least reports one.
   22416   at_bison_check_last=`sed -n '$=' stderr`
   22417   : ${at_bison_check_last:=1}
   22418   at_bison_check_last=`expr $at_bison_check_last - 1`
   22419   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   22420     at-bison-check-warnings >> experr
   22421   { set +x
   22422 $as_echo "$at_srcdir/reduce.at:204: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   22423               stderr 1>&2"
   22424 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:204"
   22425 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   22426               stderr 1>&2
   22427 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22428 at_status=$? at_failed=false
   22429 $at_check_filter
   22430 $at_diff experr "$at_stderr" || at_failed=:
   22431 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22432 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22433 $at_failed && at_fn_log_failure
   22434 $at_traceon; }
   22435 
   22436 
   22437   # Now check --warnings=error.
   22438   cp stderr experr
   22439   { set +x
   22440 $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   22441 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "reduce.at:204"
   22442 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   22443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22444 at_status=$? at_failed=false
   22445 $at_check_filter
   22446 $at_diff experr "$at_stderr" || at_failed=:
   22447 $at_diff expout "$at_stdout" || at_failed=:
   22448 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:204"
   22449 $at_failed && at_fn_log_failure
   22450 $at_traceon; }
   22451 
   22452 
   22453   # Now check -Wnone and --warnings=none by making sure that
   22454   # -Werror doesn't change the exit status when -Wnone or
   22455   # --warnings=none is specified.
   22456   { set +x
   22457 $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   22458 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "reduce.at:204"
   22459 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   22460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22461 at_status=$? at_failed=false
   22462 $at_check_filter
   22463 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22464 $at_diff expout "$at_stdout" || at_failed=:
   22465 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22466 $at_failed && at_fn_log_failure
   22467 $at_traceon; }
   22468 
   22469   { set +x
   22470 $as_echo "$at_srcdir/reduce.at:204: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   22471 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "reduce.at:204"
   22472 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   22473 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22474 at_status=$? at_failed=false
   22475 $at_check_filter
   22476 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22477 $at_diff expout "$at_stdout" || at_failed=:
   22478 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:204"
   22479 $at_failed && at_fn_log_failure
   22480 $at_traceon; }
   22481 
   22482 
   22483   at_restore_special_files
   22484 fi
   22485 
   22486 { set +x
   22487 $as_echo "$at_srcdir/reduce.at:227: sed -n '/^Grammar/q;/^\$/!p' input.output"
   22488 at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:227"
   22489 ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
   22490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22491 at_status=$? at_failed=false
   22492 $at_check_filter
   22493 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22494 echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   22495    useless1
   22496    useless2
   22497    useless3
   22498    useless4
   22499    useless5
   22500    useless6
   22501    useless7
   22502    useless8
   22503    useless9
   22504 Terminals unused in grammar
   22505    '1'
   22506    '2'
   22507    '3'
   22508    '4'
   22509    '5'
   22510    '6'
   22511    '7'
   22512    '8'
   22513    '9'
   22514 Rules useless in grammar
   22515     2 useless1: '1'
   22516     3 useless2: '2'
   22517     4 useless3: '3'
   22518     5 useless4: '4'
   22519     6 useless5: '5'
   22520     7 useless6: '6'
   22521     8 useless7: '7'
   22522     9 useless8: '8'
   22523    10 useless9: '9'
   22524 " | \
   22525   $at_diff - "$at_stdout" || at_failed=:
   22526 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:227"
   22527 $at_failed && at_fn_log_failure
   22528 $at_traceon; }
   22529 
   22530 
   22531   set +x
   22532   $at_times_p && times >"$at_times_file"
   22533 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   22534 read at_status <"$at_status_file"
   22535 #AT_STOP_104
   22536 #AT_START_105
   22537 at_fn_group_banner 105 'reduce.at:271' \
   22538   "Reduced Automaton" "                              " 6
   22539 at_xfail=no
   22540 (
   22541   $as_echo "105. $at_setup_line: testing $at_desc ..."
   22542   $at_traceon
   22543 
   22544 
   22545 
   22546 
   22547 # The non reduced grammar.
   22548 # ------------------------
   22549 cat >not-reduced.y <<'_ATEOF'
   22550 /* A useless token. */
   22551 %token useless_token
   22552 /* A useful one. */
   22553 %token useful
   22554 %verbose
   22555 %output "not-reduced.c"
   22556 
   22557 %%
   22558 
   22559 exp: useful            { /* A useful action. */ }
   22560    | non_productive    { /* A non productive action. */ }
   22561    ;
   22562 
   22563 not_reachable: useful  { /* A not reachable action. */ }
   22564              ;
   22565 
   22566 non_productive: non_productive useless_token
   22567                        { /* Another non productive action. */ }
   22568               ;
   22569 %%
   22570 _ATEOF
   22571 
   22572 
   22573 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   22574   at_save_special_files
   22575   mkdir xml-tests
   22576     # Don't combine these Bison invocations since we want to be sure that
   22577   # --report=all isn't required to get the full XML file.
   22578   { set +x
   22579 $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   22580                   --graph=xml-tests/test.dot -fcaret not-reduced.y"
   22581 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:300"
   22582 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   22583                   --graph=xml-tests/test.dot -fcaret not-reduced.y
   22584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22585 at_status=$? at_failed=false
   22586 $at_check_filter
   22587 echo stderr:; cat "$at_stderr"
   22588 echo stdout:; cat "$at_stdout"
   22589 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22590 $at_failed && at_fn_log_failure
   22591 $at_traceon; }
   22592 
   22593   { set +x
   22594 $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret not-reduced.y"
   22595 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret not-reduced.y" "reduce.at:300"
   22596 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret not-reduced.y
   22597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22598 at_status=$? at_failed=false
   22599 $at_check_filter
   22600 echo stderr:; cat "$at_stderr"
   22601 echo stdout:; cat "$at_stdout"
   22602 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22603 $at_failed && at_fn_log_failure
   22604 $at_traceon; }
   22605 
   22606     cp xml-tests/test.output expout
   22607   { set +x
   22608 $as_echo "$at_srcdir/reduce.at:300: \$XSLTPROC \\
   22609              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   22610              xml-tests/test.xml"
   22611 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:300"
   22612 ( $at_check_trace; $XSLTPROC \
   22613              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   22614              xml-tests/test.xml
   22615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22616 at_status=$? at_failed=false
   22617 $at_check_filter
   22618 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22619 $at_diff expout "$at_stdout" || at_failed=:
   22620 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22621 $at_failed && at_fn_log_failure
   22622 $at_traceon; }
   22623 
   22624   sort xml-tests/test.dot > expout
   22625   { set +x
   22626 $as_echo "$at_srcdir/reduce.at:300: \$XSLTPROC \\
   22627              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   22628              xml-tests/test.xml | sort"
   22629 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:300"
   22630 ( $at_check_trace; $XSLTPROC \
   22631              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   22632              xml-tests/test.xml | sort
   22633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22634 at_status=$? at_failed=false
   22635 $at_check_filter
   22636 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22637 $at_diff expout "$at_stdout" || at_failed=:
   22638 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22639 $at_failed && at_fn_log_failure
   22640 $at_traceon; }
   22641 
   22642   rm -rf xml-tests expout
   22643   at_restore_special_files
   22644 fi
   22645 { set +x
   22646 $as_echo "$at_srcdir/reduce.at:300: bison -fcaret not-reduced.y"
   22647 at_fn_check_prepare_trace "reduce.at:300"
   22648 ( $at_check_trace; bison -fcaret not-reduced.y
   22649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22650 at_status=$? at_failed=false
   22651 $at_check_filter
   22652 echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar
   22653 not-reduced.y: warning: 3 rules useless in grammar
   22654 not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
   22655  not_reachable: useful  { /* A not reachable action. */ }
   22656  ^^^^^^^^^^^^^
   22657 not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
   22658     | non_productive    { /* A non productive action. */ }
   22659       ^^^^^^^^^^^^^^
   22660 not-reduced.y:11.6-57: warning: rule useless in grammar
   22661     | non_productive    { /* A non productive action. */ }
   22662       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   22663 not-reduced.y:14.16-56: warning: rule useless in grammar
   22664  not_reachable: useful  { /* A not reachable action. */ }
   22665                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   22666 not-reduced.y:17.17-18.63: warning: rule useless in grammar
   22667  non_productive: non_productive useless_token
   22668                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   22669 " | \
   22670   $at_diff - "$at_stderr" || at_failed=:
   22671 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22672 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22673 $at_failed && at_fn_log_failure
   22674 $at_traceon; }
   22675 
   22676 # Defining POSIXLY_CORRECT causes bison to complain if options are
   22677 # added after the grammar file name, so skip these checks in that
   22678 # case.
   22679 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   22680   at_save_special_files
   22681 
   22682   # To avoid expanding it repeatedly, store specified stdout.
   22683   : >expout
   22684 
   22685   # Run with -Werror.
   22686   { set +x
   22687 $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Werror"
   22688 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Werror" "reduce.at:300"
   22689 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Werror
   22690 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22691 at_status=$? at_failed=false
   22692 $at_check_filter
   22693 echo stderr:; tee stderr <"$at_stderr"
   22694 $at_diff expout "$at_stdout" || at_failed=:
   22695 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:300"
   22696 $at_failed && at_fn_log_failure
   22697 $at_traceon; }
   22698 
   22699 
   22700   # Build expected stderr up to and including the "warnings being
   22701   # treated as errors" message.
   22702   cat >at-bison-check-warnings <<'_ATEOF'
   22703 not-reduced.y: warning: 2 nonterminals useless in grammar
   22704 not-reduced.y: warning: 3 rules useless in grammar
   22705 not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
   22706  not_reachable: useful  { /* A not reachable action. */ }
   22707  ^^^^^^^^^^^^^
   22708 not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
   22709     | non_productive    { /* A non productive action. */ }
   22710       ^^^^^^^^^^^^^^
   22711 not-reduced.y:11.6-57: warning: rule useless in grammar
   22712     | non_productive    { /* A non productive action. */ }
   22713       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   22714 not-reduced.y:14.16-56: warning: rule useless in grammar
   22715  not_reachable: useful  { /* A not reachable action. */ }
   22716                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   22717 not-reduced.y:17.17-18.63: warning: rule useless in grammar
   22718  non_productive: non_productive useless_token
   22719                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   22720 _ATEOF
   22721 
   22722   at_bison_check_first=`sed -n \
   22723     '/: warning: /{=;q;}' at-bison-check-warnings`
   22724   : ${at_bison_check_first:=1}
   22725   at_bison_check_first_tmp=`sed -n \
   22726     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   22727   : ${at_bison_check_first_tmp:=1}
   22728   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   22729     at_bison_check_first=$at_bison_check_first_tmp
   22730   fi
   22731   if test $at_bison_check_first -gt 1; then
   22732     sed -n "1,`expr $at_bison_check_first - 1`"p \
   22733       at-bison-check-warnings > experr
   22734   fi
   22735   echo 'bison: warnings being treated as errors' >> experr
   22736 
   22737   # Finish building expected stderr and check.  Unlike warnings,
   22738   # complaints cause bison to exit early.  Thus, with -Werror, bison
   22739   # does not necessarily report all warnings that it does without
   22740   # -Werror, but it at least reports one.
   22741   at_bison_check_last=`sed -n '$=' stderr`
   22742   : ${at_bison_check_last:=1}
   22743   at_bison_check_last=`expr $at_bison_check_last - 1`
   22744   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   22745     at-bison-check-warnings >> experr
   22746   { set +x
   22747 $as_echo "$at_srcdir/reduce.at:300: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   22748               stderr 1>&2"
   22749 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:300"
   22750 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   22751               stderr 1>&2
   22752 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22753 at_status=$? at_failed=false
   22754 $at_check_filter
   22755 $at_diff experr "$at_stderr" || at_failed=:
   22756 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22757 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22758 $at_failed && at_fn_log_failure
   22759 $at_traceon; }
   22760 
   22761 
   22762   # Now check --warnings=error.
   22763   cp stderr experr
   22764   { set +x
   22765 $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=error"
   22766 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=error" "reduce.at:300"
   22767 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=error
   22768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22769 at_status=$? at_failed=false
   22770 $at_check_filter
   22771 $at_diff experr "$at_stderr" || at_failed=:
   22772 $at_diff expout "$at_stdout" || at_failed=:
   22773 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:300"
   22774 $at_failed && at_fn_log_failure
   22775 $at_traceon; }
   22776 
   22777 
   22778   # Now check -Wnone and --warnings=none by making sure that
   22779   # -Werror doesn't change the exit status when -Wnone or
   22780   # --warnings=none is specified.
   22781   { set +x
   22782 $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Wnone -Werror"
   22783 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Wnone -Werror" "reduce.at:300"
   22784 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y -Wnone -Werror
   22785 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22786 at_status=$? at_failed=false
   22787 $at_check_filter
   22788 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22789 $at_diff expout "$at_stdout" || at_failed=:
   22790 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22791 $at_failed && at_fn_log_failure
   22792 $at_traceon; }
   22793 
   22794   { set +x
   22795 $as_echo "$at_srcdir/reduce.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=none -Werror"
   22796 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=none -Werror" "reduce.at:300"
   22797 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret not-reduced.y --warnings=none -Werror
   22798 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22799 at_status=$? at_failed=false
   22800 $at_check_filter
   22801 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22802 $at_diff expout "$at_stdout" || at_failed=:
   22803 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:300"
   22804 $at_failed && at_fn_log_failure
   22805 $at_traceon; }
   22806 
   22807 
   22808   at_restore_special_files
   22809 fi
   22810 
   22811 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   22812   at_save_special_files
   22813   mkdir xml-tests
   22814     # Don't combine these Bison invocations since we want to be sure that
   22815   # --report=all isn't required to get the full XML file.
   22816   { set +x
   22817 $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   22818                   --graph=xml-tests/test.dot not-reduced.y"
   22819 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:320"
   22820 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   22821                   --graph=xml-tests/test.dot not-reduced.y
   22822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22823 at_status=$? at_failed=false
   22824 $at_check_filter
   22825 echo stderr:; cat "$at_stderr"
   22826 echo stdout:; cat "$at_stdout"
   22827 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   22828 $at_failed && at_fn_log_failure
   22829 $at_traceon; }
   22830 
   22831   { set +x
   22832 $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml not-reduced.y"
   22833 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml not-reduced.y" "reduce.at:320"
   22834 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml not-reduced.y
   22835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22836 at_status=$? at_failed=false
   22837 $at_check_filter
   22838 echo stderr:; cat "$at_stderr"
   22839 echo stdout:; cat "$at_stdout"
   22840 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   22841 $at_failed && at_fn_log_failure
   22842 $at_traceon; }
   22843 
   22844     cp xml-tests/test.output expout
   22845   { set +x
   22846 $as_echo "$at_srcdir/reduce.at:320: \$XSLTPROC \\
   22847              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   22848              xml-tests/test.xml"
   22849 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:320"
   22850 ( $at_check_trace; $XSLTPROC \
   22851              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   22852              xml-tests/test.xml
   22853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22854 at_status=$? at_failed=false
   22855 $at_check_filter
   22856 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22857 $at_diff expout "$at_stdout" || at_failed=:
   22858 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   22859 $at_failed && at_fn_log_failure
   22860 $at_traceon; }
   22861 
   22862   sort xml-tests/test.dot > expout
   22863   { set +x
   22864 $as_echo "$at_srcdir/reduce.at:320: \$XSLTPROC \\
   22865              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   22866              xml-tests/test.xml | sort"
   22867 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:320"
   22868 ( $at_check_trace; $XSLTPROC \
   22869              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   22870              xml-tests/test.xml | sort
   22871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22872 at_status=$? at_failed=false
   22873 $at_check_filter
   22874 at_fn_diff_devnull "$at_stderr" || at_failed=:
   22875 $at_diff expout "$at_stdout" || at_failed=:
   22876 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   22877 $at_failed && at_fn_log_failure
   22878 $at_traceon; }
   22879 
   22880   rm -rf xml-tests expout
   22881   at_restore_special_files
   22882 fi
   22883 { set +x
   22884 $as_echo "$at_srcdir/reduce.at:320: bison not-reduced.y"
   22885 at_fn_check_prepare_trace "reduce.at:320"
   22886 ( $at_check_trace; bison not-reduced.y
   22887 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22888 at_status=$? at_failed=false
   22889 $at_check_filter
   22890 echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar
   22891 not-reduced.y: warning: 3 rules useless in grammar
   22892 not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
   22893 not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
   22894 not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
   22895 not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful
   22896 not-reduced.y:17.17-18.63: warning: rule useless in grammar: non_productive: non_productive useless_token
   22897 " | \
   22898   $at_diff - "$at_stderr" || at_failed=:
   22899 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22900 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   22901 $at_failed && at_fn_log_failure
   22902 $at_traceon; }
   22903 
   22904 # Defining POSIXLY_CORRECT causes bison to complain if options are
   22905 # added after the grammar file name, so skip these checks in that
   22906 # case.
   22907 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   22908   at_save_special_files
   22909 
   22910   # To avoid expanding it repeatedly, store specified stdout.
   22911   : >expout
   22912 
   22913   # Run with -Werror.
   22914   { set +x
   22915 $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Werror"
   22916 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Werror" "reduce.at:320"
   22917 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y -Werror
   22918 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22919 at_status=$? at_failed=false
   22920 $at_check_filter
   22921 echo stderr:; tee stderr <"$at_stderr"
   22922 $at_diff expout "$at_stdout" || at_failed=:
   22923 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:320"
   22924 $at_failed && at_fn_log_failure
   22925 $at_traceon; }
   22926 
   22927 
   22928   # Build expected stderr up to and including the "warnings being
   22929   # treated as errors" message.
   22930   cat >at-bison-check-warnings <<'_ATEOF'
   22931 not-reduced.y: warning: 2 nonterminals useless in grammar
   22932 not-reduced.y: warning: 3 rules useless in grammar
   22933 not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
   22934 not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
   22935 not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
   22936 not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful
   22937 not-reduced.y:17.17-18.63: warning: rule useless in grammar: non_productive: non_productive useless_token
   22938 _ATEOF
   22939 
   22940   at_bison_check_first=`sed -n \
   22941     '/: warning: /{=;q;}' at-bison-check-warnings`
   22942   : ${at_bison_check_first:=1}
   22943   at_bison_check_first_tmp=`sed -n \
   22944     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   22945   : ${at_bison_check_first_tmp:=1}
   22946   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   22947     at_bison_check_first=$at_bison_check_first_tmp
   22948   fi
   22949   if test $at_bison_check_first -gt 1; then
   22950     sed -n "1,`expr $at_bison_check_first - 1`"p \
   22951       at-bison-check-warnings > experr
   22952   fi
   22953   echo 'bison: warnings being treated as errors' >> experr
   22954 
   22955   # Finish building expected stderr and check.  Unlike warnings,
   22956   # complaints cause bison to exit early.  Thus, with -Werror, bison
   22957   # does not necessarily report all warnings that it does without
   22958   # -Werror, but it at least reports one.
   22959   at_bison_check_last=`sed -n '$=' stderr`
   22960   : ${at_bison_check_last:=1}
   22961   at_bison_check_last=`expr $at_bison_check_last - 1`
   22962   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   22963     at-bison-check-warnings >> experr
   22964   { set +x
   22965 $as_echo "$at_srcdir/reduce.at:320: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   22966               stderr 1>&2"
   22967 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:320"
   22968 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   22969               stderr 1>&2
   22970 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22971 at_status=$? at_failed=false
   22972 $at_check_filter
   22973 $at_diff experr "$at_stderr" || at_failed=:
   22974 at_fn_diff_devnull "$at_stdout" || at_failed=:
   22975 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   22976 $at_failed && at_fn_log_failure
   22977 $at_traceon; }
   22978 
   22979 
   22980   # Now check --warnings=error.
   22981   cp stderr experr
   22982   { set +x
   22983 $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=error"
   22984 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=error" "reduce.at:320"
   22985 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y --warnings=error
   22986 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   22987 at_status=$? at_failed=false
   22988 $at_check_filter
   22989 $at_diff experr "$at_stderr" || at_failed=:
   22990 $at_diff expout "$at_stdout" || at_failed=:
   22991 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:320"
   22992 $at_failed && at_fn_log_failure
   22993 $at_traceon; }
   22994 
   22995 
   22996   # Now check -Wnone and --warnings=none by making sure that
   22997   # -Werror doesn't change the exit status when -Wnone or
   22998   # --warnings=none is specified.
   22999   { set +x
   23000 $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Wnone -Werror"
   23001 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y -Wnone -Werror" "reduce.at:320"
   23002 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y -Wnone -Werror
   23003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23004 at_status=$? at_failed=false
   23005 $at_check_filter
   23006 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23007 $at_diff expout "$at_stdout" || at_failed=:
   23008 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   23009 $at_failed && at_fn_log_failure
   23010 $at_traceon; }
   23011 
   23012   { set +x
   23013 $as_echo "$at_srcdir/reduce.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=none -Werror"
   23014 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison not-reduced.y --warnings=none -Werror" "reduce.at:320"
   23015 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison not-reduced.y --warnings=none -Werror
   23016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23017 at_status=$? at_failed=false
   23018 $at_check_filter
   23019 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23020 $at_diff expout "$at_stdout" || at_failed=:
   23021 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:320"
   23022 $at_failed && at_fn_log_failure
   23023 $at_traceon; }
   23024 
   23025 
   23026   at_restore_special_files
   23027 fi
   23028 
   23029 { set +x
   23030 $as_echo "$at_srcdir/reduce.at:330: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output"
   23031 at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' not-reduced.output" "reduce.at:330"
   23032 ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' not-reduced.output
   23033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23034 at_status=$? at_failed=false
   23035 $at_check_filter
   23036 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23037 echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   23038    not_reachable
   23039    non_productive
   23040 Terminals unused in grammar
   23041    useless_token
   23042 Rules useless in grammar
   23043     2 exp: non_productive
   23044     3 not_reachable: useful
   23045     4 non_productive: non_productive useless_token
   23046 " | \
   23047   $at_diff - "$at_stdout" || at_failed=:
   23048 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:330"
   23049 $at_failed && at_fn_log_failure
   23050 $at_traceon; }
   23051 
   23052 
   23053 # The reduced grammar.
   23054 # --------------------
   23055 cat >reduced.y <<'_ATEOF'
   23056 /* A useless token. */
   23057 %token useless_token
   23058 /* A useful one. */
   23059 %token useful
   23060 %verbose
   23061 %output "reduced.c"
   23062 
   23063 %%
   23064 
   23065 exp: useful            { /* A useful action. */ }
   23066 //   | non_productive    { /* A non productive action. */ } */
   23067    ;
   23068 
   23069 //not_reachable: useful  { /* A not reachable action. */ }
   23070 //             ;
   23071 
   23072 //non_productive: non_productive useless_token
   23073 //                       { /* Another non productive action. */ }
   23074 //              ;
   23075 %%
   23076 _ATEOF
   23077 
   23078 
   23079 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   23080   at_save_special_files
   23081   mkdir xml-tests
   23082     # Don't combine these Bison invocations since we want to be sure that
   23083   # --report=all isn't required to get the full XML file.
   23084   { set +x
   23085 $as_echo "$at_srcdir/reduce.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   23086                   --graph=xml-tests/test.dot reduced.y"
   23087 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:367"
   23088 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   23089                   --graph=xml-tests/test.dot reduced.y
   23090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23091 at_status=$? at_failed=false
   23092 $at_check_filter
   23093 echo stderr:; cat "$at_stderr"
   23094 echo stdout:; cat "$at_stdout"
   23095 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367"
   23096 $at_failed && at_fn_log_failure
   23097 $at_traceon; }
   23098 
   23099   { set +x
   23100 $as_echo "$at_srcdir/reduce.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml reduced.y"
   23101 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml reduced.y" "reduce.at:367"
   23102 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml reduced.y
   23103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23104 at_status=$? at_failed=false
   23105 $at_check_filter
   23106 echo stderr:; cat "$at_stderr"
   23107 echo stdout:; cat "$at_stdout"
   23108 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367"
   23109 $at_failed && at_fn_log_failure
   23110 $at_traceon; }
   23111 
   23112     cp xml-tests/test.output expout
   23113   { set +x
   23114 $as_echo "$at_srcdir/reduce.at:367: \$XSLTPROC \\
   23115              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   23116              xml-tests/test.xml"
   23117 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:367"
   23118 ( $at_check_trace; $XSLTPROC \
   23119              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   23120              xml-tests/test.xml
   23121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23122 at_status=$? at_failed=false
   23123 $at_check_filter
   23124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23125 $at_diff expout "$at_stdout" || at_failed=:
   23126 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367"
   23127 $at_failed && at_fn_log_failure
   23128 $at_traceon; }
   23129 
   23130   sort xml-tests/test.dot > expout
   23131   { set +x
   23132 $as_echo "$at_srcdir/reduce.at:367: \$XSLTPROC \\
   23133              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   23134              xml-tests/test.xml | sort"
   23135 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:367"
   23136 ( $at_check_trace; $XSLTPROC \
   23137              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   23138              xml-tests/test.xml | sort
   23139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23140 at_status=$? at_failed=false
   23141 $at_check_filter
   23142 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23143 $at_diff expout "$at_stdout" || at_failed=:
   23144 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367"
   23145 $at_failed && at_fn_log_failure
   23146 $at_traceon; }
   23147 
   23148   rm -rf xml-tests expout
   23149   at_restore_special_files
   23150 fi
   23151 { set +x
   23152 $as_echo "$at_srcdir/reduce.at:367: bison reduced.y"
   23153 at_fn_check_prepare_trace "reduce.at:367"
   23154 ( $at_check_trace; bison reduced.y
   23155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23156 at_status=$? at_failed=false
   23157 $at_check_filter
   23158 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23159 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23160 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:367"
   23161 $at_failed && at_fn_log_failure
   23162 $at_traceon; }
   23163 
   23164 
   23165 
   23166 # Comparing the parsers.
   23167 cp reduced.c expout
   23168 { set +x
   23169 $as_echo "$at_srcdir/reduce.at:371: sed 's/not-reduced/reduced/g' not-reduced.c"
   23170 at_fn_check_prepare_trace "reduce.at:371"
   23171 ( $at_check_trace; sed 's/not-reduced/reduced/g' not-reduced.c
   23172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23173 at_status=$? at_failed=false
   23174 $at_check_filter
   23175 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23176 $at_diff expout "$at_stdout" || at_failed=:
   23177 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:371"
   23178 $at_failed && at_fn_log_failure
   23179 $at_traceon; }
   23180 
   23181 
   23182   set +x
   23183   $at_times_p && times >"$at_times_file"
   23184 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   23185 read at_status <"$at_status_file"
   23186 #AT_STOP_105
   23187 #AT_START_106
   23188 at_fn_group_banner 106 'reduce.at:381' \
   23189   "Underivable Rules" "                              " 6
   23190 at_xfail=no
   23191 (
   23192   $as_echo "106. $at_setup_line: testing $at_desc ..."
   23193   $at_traceon
   23194 
   23195 
   23196 
   23197 
   23198 cat >input.y <<'_ATEOF'
   23199 %verbose
   23200 %output "input.c"
   23201 %token useful
   23202 %%
   23203 exp: useful | underivable;
   23204 underivable: indirection;
   23205 indirection: underivable;
   23206 _ATEOF
   23207 
   23208 
   23209 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   23210   at_save_special_files
   23211   mkdir xml-tests
   23212     # Don't combine these Bison invocations since we want to be sure that
   23213   # --report=all isn't required to get the full XML file.
   23214   { set +x
   23215 $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   23216                   --graph=xml-tests/test.dot input.y"
   23217 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:395"
   23218 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   23219                   --graph=xml-tests/test.dot input.y
   23220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23221 at_status=$? at_failed=false
   23222 $at_check_filter
   23223 echo stderr:; cat "$at_stderr"
   23224 echo stdout:; cat "$at_stdout"
   23225 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23226 $at_failed && at_fn_log_failure
   23227 $at_traceon; }
   23228 
   23229   { set +x
   23230 $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y"
   23231 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y" "reduce.at:395"
   23232 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input.y
   23233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23234 at_status=$? at_failed=false
   23235 $at_check_filter
   23236 echo stderr:; cat "$at_stderr"
   23237 echo stdout:; cat "$at_stdout"
   23238 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23239 $at_failed && at_fn_log_failure
   23240 $at_traceon; }
   23241 
   23242     cp xml-tests/test.output expout
   23243   { set +x
   23244 $as_echo "$at_srcdir/reduce.at:395: \$XSLTPROC \\
   23245              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   23246              xml-tests/test.xml"
   23247 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:395"
   23248 ( $at_check_trace; $XSLTPROC \
   23249              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   23250              xml-tests/test.xml
   23251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23252 at_status=$? at_failed=false
   23253 $at_check_filter
   23254 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23255 $at_diff expout "$at_stdout" || at_failed=:
   23256 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23257 $at_failed && at_fn_log_failure
   23258 $at_traceon; }
   23259 
   23260   sort xml-tests/test.dot > expout
   23261   { set +x
   23262 $as_echo "$at_srcdir/reduce.at:395: \$XSLTPROC \\
   23263              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   23264              xml-tests/test.xml | sort"
   23265 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:395"
   23266 ( $at_check_trace; $XSLTPROC \
   23267              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   23268              xml-tests/test.xml | sort
   23269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23270 at_status=$? at_failed=false
   23271 $at_check_filter
   23272 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23273 $at_diff expout "$at_stdout" || at_failed=:
   23274 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23275 $at_failed && at_fn_log_failure
   23276 $at_traceon; }
   23277 
   23278   rm -rf xml-tests expout
   23279   at_restore_special_files
   23280 fi
   23281 { set +x
   23282 $as_echo "$at_srcdir/reduce.at:395: bison input.y"
   23283 at_fn_check_prepare_trace "reduce.at:395"
   23284 ( $at_check_trace; bison input.y
   23285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23286 at_status=$? at_failed=false
   23287 $at_check_filter
   23288 echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar
   23289 input.y: warning: 3 rules useless in grammar
   23290 input.y:5.15-25: warning: nonterminal useless in grammar: underivable
   23291 input.y:6.14-24: warning: nonterminal useless in grammar: indirection
   23292 input.y:5.15-25: warning: rule useless in grammar: exp: underivable
   23293 input.y:6.14-24: warning: rule useless in grammar: underivable: indirection
   23294 input.y:7.14-24: warning: rule useless in grammar: indirection: underivable
   23295 " | \
   23296   $at_diff - "$at_stderr" || at_failed=:
   23297 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23298 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23299 $at_failed && at_fn_log_failure
   23300 $at_traceon; }
   23301 
   23302 # Defining POSIXLY_CORRECT causes bison to complain if options are
   23303 # added after the grammar file name, so skip these checks in that
   23304 # case.
   23305 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   23306   at_save_special_files
   23307 
   23308   # To avoid expanding it repeatedly, store specified stdout.
   23309   : >expout
   23310 
   23311   # Run with -Werror.
   23312   { set +x
   23313 $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror"
   23314 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Werror" "reduce.at:395"
   23315 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Werror
   23316 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23317 at_status=$? at_failed=false
   23318 $at_check_filter
   23319 echo stderr:; tee stderr <"$at_stderr"
   23320 $at_diff expout "$at_stdout" || at_failed=:
   23321 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:395"
   23322 $at_failed && at_fn_log_failure
   23323 $at_traceon; }
   23324 
   23325 
   23326   # Build expected stderr up to and including the "warnings being
   23327   # treated as errors" message.
   23328   cat >at-bison-check-warnings <<'_ATEOF'
   23329 input.y: warning: 2 nonterminals useless in grammar
   23330 input.y: warning: 3 rules useless in grammar
   23331 input.y:5.15-25: warning: nonterminal useless in grammar: underivable
   23332 input.y:6.14-24: warning: nonterminal useless in grammar: indirection
   23333 input.y:5.15-25: warning: rule useless in grammar: exp: underivable
   23334 input.y:6.14-24: warning: rule useless in grammar: underivable: indirection
   23335 input.y:7.14-24: warning: rule useless in grammar: indirection: underivable
   23336 _ATEOF
   23337 
   23338   at_bison_check_first=`sed -n \
   23339     '/: warning: /{=;q;}' at-bison-check-warnings`
   23340   : ${at_bison_check_first:=1}
   23341   at_bison_check_first_tmp=`sed -n \
   23342     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   23343   : ${at_bison_check_first_tmp:=1}
   23344   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   23345     at_bison_check_first=$at_bison_check_first_tmp
   23346   fi
   23347   if test $at_bison_check_first -gt 1; then
   23348     sed -n "1,`expr $at_bison_check_first - 1`"p \
   23349       at-bison-check-warnings > experr
   23350   fi
   23351   echo 'bison: warnings being treated as errors' >> experr
   23352 
   23353   # Finish building expected stderr and check.  Unlike warnings,
   23354   # complaints cause bison to exit early.  Thus, with -Werror, bison
   23355   # does not necessarily report all warnings that it does without
   23356   # -Werror, but it at least reports one.
   23357   at_bison_check_last=`sed -n '$=' stderr`
   23358   : ${at_bison_check_last:=1}
   23359   at_bison_check_last=`expr $at_bison_check_last - 1`
   23360   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   23361     at-bison-check-warnings >> experr
   23362   { set +x
   23363 $as_echo "$at_srcdir/reduce.at:395: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   23364               stderr 1>&2"
   23365 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:395"
   23366 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   23367               stderr 1>&2
   23368 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23369 at_status=$? at_failed=false
   23370 $at_check_filter
   23371 $at_diff experr "$at_stderr" || at_failed=:
   23372 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23373 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23374 $at_failed && at_fn_log_failure
   23375 $at_traceon; }
   23376 
   23377 
   23378   # Now check --warnings=error.
   23379   cp stderr experr
   23380   { set +x
   23381 $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error"
   23382 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=error" "reduce.at:395"
   23383 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=error
   23384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23385 at_status=$? at_failed=false
   23386 $at_check_filter
   23387 $at_diff experr "$at_stderr" || at_failed=:
   23388 $at_diff expout "$at_stdout" || at_failed=:
   23389 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:395"
   23390 $at_failed && at_fn_log_failure
   23391 $at_traceon; }
   23392 
   23393 
   23394   # Now check -Wnone and --warnings=none by making sure that
   23395   # -Werror doesn't change the exit status when -Wnone or
   23396   # --warnings=none is specified.
   23397   { set +x
   23398 $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror"
   23399 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y -Wnone -Werror" "reduce.at:395"
   23400 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -Wnone -Werror
   23401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23402 at_status=$? at_failed=false
   23403 $at_check_filter
   23404 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23405 $at_diff expout "$at_stdout" || at_failed=:
   23406 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23407 $at_failed && at_fn_log_failure
   23408 $at_traceon; }
   23409 
   23410   { set +x
   23411 $as_echo "$at_srcdir/reduce.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror"
   23412 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror" "reduce.at:395"
   23413 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y --warnings=none -Werror
   23414 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23415 at_status=$? at_failed=false
   23416 $at_check_filter
   23417 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23418 $at_diff expout "$at_stdout" || at_failed=:
   23419 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:395"
   23420 $at_failed && at_fn_log_failure
   23421 $at_traceon; }
   23422 
   23423 
   23424   at_restore_special_files
   23425 fi
   23426 
   23427 { set +x
   23428 $as_echo "$at_srcdir/reduce.at:405: sed -n '/^Grammar/q;/^\$/!p' input.output"
   23429 at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:405"
   23430 ( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
   23431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23432 at_status=$? at_failed=false
   23433 $at_check_filter
   23434 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23435 echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   23436    underivable
   23437    indirection
   23438 Rules useless in grammar
   23439     2 exp: underivable
   23440     3 underivable: indirection
   23441     4 indirection: underivable
   23442 " | \
   23443   $at_diff - "$at_stdout" || at_failed=:
   23444 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:405"
   23445 $at_failed && at_fn_log_failure
   23446 $at_traceon; }
   23447 
   23448 
   23449   set +x
   23450   $at_times_p && times >"$at_times_file"
   23451 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   23452 read at_status <"$at_status_file"
   23453 #AT_STOP_106
   23454 #AT_START_107
   23455 at_fn_group_banner 107 'reduce.at:423' \
   23456   "Empty Language" "                                 " 6
   23457 at_xfail=no
   23458 (
   23459   $as_echo "107. $at_setup_line: testing $at_desc ..."
   23460   $at_traceon
   23461 
   23462 
   23463 cat >input.y <<'_ATEOF'
   23464 %output "input.c"
   23465 %%
   23466 exp: exp;
   23467 _ATEOF
   23468 
   23469 
   23470 
   23471 { set +x
   23472 $as_echo "$at_srcdir/reduce.at:431: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   23473 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "reduce.at:431"
   23474 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   23475 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23476 at_status=$? at_failed=false
   23477 $at_check_filter
   23478 echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar
   23479 input.y: warning: 2 rules useless in grammar
   23480 input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
   23481 " | \
   23482   $at_diff - "$at_stderr" || at_failed=:
   23483 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23484 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:431"
   23485 $at_failed && at_fn_log_failure
   23486 $at_traceon; }
   23487 
   23488 
   23489 
   23490   set +x
   23491   $at_times_p && times >"$at_times_file"
   23492 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   23493 read at_status <"$at_status_file"
   23494 #AT_STOP_107
   23495 #AT_START_108
   23496 at_fn_group_banner 108 'reduce.at:474' \
   23497   "no %define lr.type: Single State Split" "         " 6
   23498 at_xfail=no
   23499 (
   23500   $as_echo "108. $at_setup_line: testing $at_desc ..."
   23501   $at_traceon
   23502 
   23503 
   23504 cat >input.y <<'_ATEOF'
   23505 %code top {
   23506 #include <config.h>
   23507 /* We don't need perfect functions for these tests. */
   23508 #undef malloc
   23509 #undef memcmp
   23510 #undef realloc
   23511 }
   23512 
   23513 %code {
   23514   #include <stdio.h>
   23515   static void yyerror ( const char *msg);
   23516   static int yylex (void);
   23517 }
   23518 
   23519 %left 'a'
   23520 // Conflict resolution renders state 12 unreachable for canonical LR(1).  We
   23521 // keep it so that the paser table diff is easier to code.
   23522 %define lr.keep-unreachable-states
   23523 
   23524 %%
   23525 
   23526 
   23527 S: 'a' A 'a' /* rule 1 */
   23528  | 'b' A 'b' /* rule 2 */
   23529  | 'c' c     /* rule 3 */
   23530  ;
   23531 
   23532 /* A conflict should appear after the first 'a' in rules 4 and 5 but only after
   23533    having shifted the first 'a' in rule 1.  However, when LALR(1) merging is
   23534    chosen, the state containing that conflict is reused after having seen the
   23535    first 'b' in rule 2 and then the first 'a' in rules 4 and 5.  In both cases,
   23536    because of the merged state, if the next token is an 'a', the %left forces a
   23537    reduction action with rule 5.  In the latter case, only a shift is actually
   23538    grammatically correct.  Thus, the parser would report a syntax error for the
   23539    grammatically correct sentence "baab" because it would encounter a syntax
   23540    error after that incorrect reduction.
   23541 
   23542    Despite not being LALR(1), Menhir version 20070322 suffers from this problem
   23543    as well.  It uses David Pager's weak compatibility test for merging states.
   23544    Bison and Menhir accept non-LR(1) grammars with conflict resolution.  Pager
   23545    designed his algorithm only for LR(1) grammars.  */
   23546 A: 'a' 'a' /* rule 4 */
   23547  | 'a'     /* rule 5 */
   23548  ;
   23549 
   23550 /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
   23551    useless after conflict resolution.  This proves that, even though LALR(1)
   23552    generates incorrect parser tables sometimes, Bison will not necessarily
   23553    produce any warning to help the user realize it.  */
   23554 c: 'a' 'b' /* rule 6 */
   23555  | A       /* rule 7 */
   23556  ;
   23557 
   23558 
   23559 %%
   23560 #include <stdio.h>
   23561 /* A C error reporting function.  */
   23562 static
   23563 void yyerror ( const char *msg)
   23564 {
   23565   fprintf (stderr, "%s\n", msg);
   23566 }
   23567 static int
   23568 yylex (void)
   23569 {
   23570   static int const input[] = {
   23571     'b', 'a', 'a', 'b', 0
   23572   };
   23573   static int const *inputp = input;
   23574   return *inputp++;
   23575 }
   23576 
   23577 int
   23578 main (void)
   23579 {
   23580   return yyparse ();
   23581 }
   23582 _ATEOF
   23583 
   23584 
   23585 
   23586 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   23587 # expanding macros, so it corrupts some special characters in the
   23588 # macros.  To avoid this, expand now and pass it the result with proper
   23589 # string quotation.  Assume args 7 through 12 expand to properly quoted
   23590 # strings.
   23591 
   23592 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   23593   at_save_special_files
   23594   mkdir xml-tests
   23595     # Don't combine these Bison invocations since we want to be sure that
   23596   # --report=all isn't required to get the full XML file.
   23597   { set +x
   23598 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   23599                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   23600 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474"
   23601 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   23602                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   23603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23604 at_status=$? at_failed=false
   23605 $at_check_filter
   23606 echo stderr:; cat "$at_stderr"
   23607 echo stdout:; cat "$at_stdout"
   23608 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23609 $at_failed && at_fn_log_failure
   23610 $at_traceon; }
   23611 
   23612   { set +x
   23613 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   23614 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474"
   23615 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   23616 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23617 at_status=$? at_failed=false
   23618 $at_check_filter
   23619 echo stderr:; cat "$at_stderr"
   23620 echo stdout:; cat "$at_stdout"
   23621 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23622 $at_failed && at_fn_log_failure
   23623 $at_traceon; }
   23624 
   23625     cp xml-tests/test.output expout
   23626   { set +x
   23627 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   23628              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   23629              xml-tests/test.xml"
   23630 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   23631 ( $at_check_trace; $XSLTPROC \
   23632              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   23633              xml-tests/test.xml
   23634 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23635 at_status=$? at_failed=false
   23636 $at_check_filter
   23637 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23638 $at_diff expout "$at_stdout" || at_failed=:
   23639 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23640 $at_failed && at_fn_log_failure
   23641 $at_traceon; }
   23642 
   23643   sort xml-tests/test.dot > expout
   23644   { set +x
   23645 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   23646              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   23647              xml-tests/test.xml | sort"
   23648 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   23649 ( $at_check_trace; $XSLTPROC \
   23650              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   23651              xml-tests/test.xml | sort
   23652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23653 at_status=$? at_failed=false
   23654 $at_check_filter
   23655 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23656 $at_diff expout "$at_stdout" || at_failed=:
   23657 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23658 $at_failed && at_fn_log_failure
   23659 $at_traceon; }
   23660 
   23661   rm -rf xml-tests expout
   23662   at_restore_special_files
   23663 fi
   23664 { set +x
   23665 $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
   23666 at_fn_check_prepare_trace "reduce.at:474"
   23667 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   23668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23669 at_status=$? at_failed=false
   23670 $at_check_filter
   23671 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23672 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23673 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23674 $at_failed && at_fn_log_failure
   23675 $at_traceon; }
   23676 
   23677 
   23678 
   23679 { set +x
   23680 $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output"
   23681 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474"
   23682 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   23683 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23684 at_status=$? at_failed=false
   23685 $at_check_filter
   23686 at_fn_diff_devnull "$at_stderr" || at_failed=:
   23687 echo >>"$at_stdout"; $as_echo "State 0
   23688 
   23689     0 \$accept: . S \$end
   23690     1 S: . 'a' A 'a'
   23691     2  | . 'b' A 'b'
   23692     3  | . 'c' c
   23693 
   23694     'a'  shift, and go to state 1
   23695     'b'  shift, and go to state 2
   23696     'c'  shift, and go to state 3
   23697 
   23698     S  go to state 4
   23699 
   23700 
   23701 State 1
   23702 
   23703     1 S: 'a' . A 'a'
   23704     4 A: . 'a' 'a'
   23705     5  | . 'a'
   23706 
   23707     'a'  shift, and go to state 5
   23708 
   23709     A  go to state 6
   23710 
   23711 
   23712 State 2
   23713 
   23714     2 S: 'b' . A 'b'
   23715     4 A: . 'a' 'a'
   23716     5  | . 'a'
   23717 
   23718     'a'  shift, and go to state 5
   23719 
   23720     A  go to state 7
   23721 
   23722 
   23723 State 3
   23724 
   23725     3 S: 'c' . c
   23726     4 A: . 'a' 'a'
   23727     5  | . 'a'
   23728     6 c: . 'a' 'b'
   23729     7  | . A
   23730 
   23731     'a'  shift, and go to state 8
   23732 
   23733     A  go to state 9
   23734     c  go to state 10
   23735 
   23736 
   23737 State 4
   23738 
   23739     0 \$accept: S . \$end
   23740 
   23741     \$end  shift, and go to state 11
   23742 
   23743 
   23744 State 5
   23745 
   23746     4 A: 'a' . 'a'
   23747     5  | 'a' .  ['a', 'b']
   23748 
   23749     \$default  reduce using rule 5 (A)
   23750 
   23751     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   23752 
   23753 
   23754 State 6
   23755 
   23756     1 S: 'a' A . 'a'
   23757 
   23758     'a'  shift, and go to state 13
   23759 
   23760 
   23761 State 7
   23762 
   23763     2 S: 'b' A . 'b'
   23764 
   23765     'b'  shift, and go to state 14
   23766 
   23767 
   23768 State 8
   23769 
   23770     4 A: 'a' . 'a'
   23771     5  | 'a' .  [\$end]
   23772     6 c: 'a' . 'b'
   23773 
   23774     'a'  shift, and go to state 12
   23775     'b'  shift, and go to state 15
   23776 
   23777     \$default  reduce using rule 5 (A)
   23778 
   23779 
   23780 State 9
   23781 
   23782     7 c: A .
   23783 
   23784     \$default  reduce using rule 7 (c)
   23785 
   23786 
   23787 State 10
   23788 
   23789     3 S: 'c' c .
   23790 
   23791     \$default  reduce using rule 3 (S)
   23792 
   23793 
   23794 State 11
   23795 
   23796     0 \$accept: S \$end .
   23797 
   23798     \$default  accept
   23799 
   23800 
   23801 State 12
   23802 
   23803     4 A: 'a' 'a' .
   23804 
   23805     \$default  reduce using rule 4 (A)
   23806 
   23807 
   23808 State 13
   23809 
   23810     1 S: 'a' A 'a' .
   23811 
   23812     \$default  reduce using rule 1 (S)
   23813 
   23814 
   23815 State 14
   23816 
   23817     2 S: 'b' A 'b' .
   23818 
   23819     \$default  reduce using rule 2 (S)
   23820 
   23821 
   23822 State 15
   23823 
   23824     6 c: 'a' 'b' .
   23825 
   23826     \$default  reduce using rule 6 (c)
   23827 " | \
   23828   $at_diff - "$at_stdout" || at_failed=:
   23829 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23830 $at_failed && at_fn_log_failure
   23831 $at_traceon; }
   23832 
   23833 
   23834 
   23835 
   23836 # Canonical LR generates very large tables, resulting in very long
   23837 # files with #line directives that may overflow what the standards
   23838 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   23839 # will issue an error.
   23840 #
   23841 # There is no "" around `wc` since some indent the result.
   23842 
   23843 { set +x
   23844 $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS"
   23845 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
   23846 ( $at_check_trace; $BISON_C_WORKS
   23847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23848 at_status=$? at_failed=false
   23849 $at_check_filter
   23850 echo stderr:; cat "$at_stderr"
   23851 echo stdout:; cat "$at_stdout"
   23852 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23853 $at_failed && at_fn_log_failure
   23854 $at_traceon; }
   23855 
   23856 { set +x
   23857 $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   23858 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474"
   23859 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   23860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23861 at_status=$? at_failed=false
   23862 $at_check_filter
   23863 echo stderr:; cat "$at_stderr"
   23864 echo stdout:; cat "$at_stdout"
   23865 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23866 $at_failed && at_fn_log_failure
   23867 $at_traceon; }
   23868 
   23869 
   23870 { set +x
   23871 $as_echo "$at_srcdir/reduce.at:474:  \$PREPARSER ./input"
   23872 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
   23873 ( $at_check_trace;  $PREPARSER ./input
   23874 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23875 at_status=$? at_failed=false
   23876 $at_check_filter
   23877 echo stderr:; tee stderr <"$at_stderr"
   23878 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23879 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:474"
   23880 $at_failed && at_fn_log_failure
   23881 $at_traceon; }
   23882 
   23883 { set +x
   23884 $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   23885 at_fn_check_prepare_trace "reduce.at:474"
   23886 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   23887 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   23888 at_status=$? at_failed=false
   23889 $at_check_filter
   23890 echo >>"$at_stderr"; $as_echo "syntax error
   23891 " | \
   23892   $at_diff - "$at_stderr" || at_failed=:
   23893 at_fn_diff_devnull "$at_stdout" || at_failed=:
   23894 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   23895 $at_failed && at_fn_log_failure
   23896 $at_traceon; }
   23897 
   23898 
   23899 
   23900 
   23901   set +x
   23902   $at_times_p && times >"$at_times_file"
   23903 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   23904 read at_status <"$at_status_file"
   23905 #AT_STOP_108
   23906 #AT_START_109
   23907 at_fn_group_banner 109 'reduce.at:474' \
   23908   "%define lr.type lalr: Single State Split" "       " 6
   23909 at_xfail=no
   23910 (
   23911   $as_echo "109. $at_setup_line: testing $at_desc ..."
   23912   $at_traceon
   23913 
   23914 
   23915 cat >input.y <<'_ATEOF'
   23916 %code top {
   23917 #include <config.h>
   23918 /* We don't need perfect functions for these tests. */
   23919 #undef malloc
   23920 #undef memcmp
   23921 #undef realloc
   23922 }
   23923 
   23924 %code {
   23925   #include <stdio.h>
   23926   static void yyerror ( const char *msg);
   23927   static int yylex (void);
   23928 }
   23929 
   23930 %define lr.type lalr
   23931 %left 'a'
   23932 // Conflict resolution renders state 12 unreachable for canonical LR(1).  We
   23933 // keep it so that the paser table diff is easier to code.
   23934 %define lr.keep-unreachable-states
   23935 
   23936 %%
   23937 
   23938 
   23939 S: 'a' A 'a' /* rule 1 */
   23940  | 'b' A 'b' /* rule 2 */
   23941  | 'c' c     /* rule 3 */
   23942  ;
   23943 
   23944 /* A conflict should appear after the first 'a' in rules 4 and 5 but only after
   23945    having shifted the first 'a' in rule 1.  However, when LALR(1) merging is
   23946    chosen, the state containing that conflict is reused after having seen the
   23947    first 'b' in rule 2 and then the first 'a' in rules 4 and 5.  In both cases,
   23948    because of the merged state, if the next token is an 'a', the %left forces a
   23949    reduction action with rule 5.  In the latter case, only a shift is actually
   23950    grammatically correct.  Thus, the parser would report a syntax error for the
   23951    grammatically correct sentence "baab" because it would encounter a syntax
   23952    error after that incorrect reduction.
   23953 
   23954    Despite not being LALR(1), Menhir version 20070322 suffers from this problem
   23955    as well.  It uses David Pager's weak compatibility test for merging states.
   23956    Bison and Menhir accept non-LR(1) grammars with conflict resolution.  Pager
   23957    designed his algorithm only for LR(1) grammars.  */
   23958 A: 'a' 'a' /* rule 4 */
   23959  | 'a'     /* rule 5 */
   23960  ;
   23961 
   23962 /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
   23963    useless after conflict resolution.  This proves that, even though LALR(1)
   23964    generates incorrect parser tables sometimes, Bison will not necessarily
   23965    produce any warning to help the user realize it.  */
   23966 c: 'a' 'b' /* rule 6 */
   23967  | A       /* rule 7 */
   23968  ;
   23969 
   23970 
   23971 %%
   23972 #include <stdio.h>
   23973 /* A C error reporting function.  */
   23974 static
   23975 void yyerror ( const char *msg)
   23976 {
   23977   fprintf (stderr, "%s\n", msg);
   23978 }
   23979 static int
   23980 yylex (void)
   23981 {
   23982   static int const input[] = {
   23983     'b', 'a', 'a', 'b', 0
   23984   };
   23985   static int const *inputp = input;
   23986   return *inputp++;
   23987 }
   23988 
   23989 int
   23990 main (void)
   23991 {
   23992   return yyparse ();
   23993 }
   23994 _ATEOF
   23995 
   23996 
   23997 
   23998 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   23999 # expanding macros, so it corrupts some special characters in the
   24000 # macros.  To avoid this, expand now and pass it the result with proper
   24001 # string quotation.  Assume args 7 through 12 expand to properly quoted
   24002 # strings.
   24003 
   24004 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   24005   at_save_special_files
   24006   mkdir xml-tests
   24007     # Don't combine these Bison invocations since we want to be sure that
   24008   # --report=all isn't required to get the full XML file.
   24009   { set +x
   24010 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   24011                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   24012 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474"
   24013 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   24014                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   24015 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24016 at_status=$? at_failed=false
   24017 $at_check_filter
   24018 echo stderr:; cat "$at_stderr"
   24019 echo stdout:; cat "$at_stdout"
   24020 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24021 $at_failed && at_fn_log_failure
   24022 $at_traceon; }
   24023 
   24024   { set +x
   24025 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   24026 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474"
   24027 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   24028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24029 at_status=$? at_failed=false
   24030 $at_check_filter
   24031 echo stderr:; cat "$at_stderr"
   24032 echo stdout:; cat "$at_stdout"
   24033 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24034 $at_failed && at_fn_log_failure
   24035 $at_traceon; }
   24036 
   24037     cp xml-tests/test.output expout
   24038   { set +x
   24039 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   24040              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   24041              xml-tests/test.xml"
   24042 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   24043 ( $at_check_trace; $XSLTPROC \
   24044              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   24045              xml-tests/test.xml
   24046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24047 at_status=$? at_failed=false
   24048 $at_check_filter
   24049 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24050 $at_diff expout "$at_stdout" || at_failed=:
   24051 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24052 $at_failed && at_fn_log_failure
   24053 $at_traceon; }
   24054 
   24055   sort xml-tests/test.dot > expout
   24056   { set +x
   24057 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   24058              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   24059              xml-tests/test.xml | sort"
   24060 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   24061 ( $at_check_trace; $XSLTPROC \
   24062              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   24063              xml-tests/test.xml | sort
   24064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24065 at_status=$? at_failed=false
   24066 $at_check_filter
   24067 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24068 $at_diff expout "$at_stdout" || at_failed=:
   24069 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24070 $at_failed && at_fn_log_failure
   24071 $at_traceon; }
   24072 
   24073   rm -rf xml-tests expout
   24074   at_restore_special_files
   24075 fi
   24076 { set +x
   24077 $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
   24078 at_fn_check_prepare_trace "reduce.at:474"
   24079 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   24080 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24081 at_status=$? at_failed=false
   24082 $at_check_filter
   24083 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24084 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24085 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24086 $at_failed && at_fn_log_failure
   24087 $at_traceon; }
   24088 
   24089 
   24090 
   24091 { set +x
   24092 $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output"
   24093 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474"
   24094 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   24095 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24096 at_status=$? at_failed=false
   24097 $at_check_filter
   24098 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24099 echo >>"$at_stdout"; $as_echo "State 0
   24100 
   24101     0 \$accept: . S \$end
   24102     1 S: . 'a' A 'a'
   24103     2  | . 'b' A 'b'
   24104     3  | . 'c' c
   24105 
   24106     'a'  shift, and go to state 1
   24107     'b'  shift, and go to state 2
   24108     'c'  shift, and go to state 3
   24109 
   24110     S  go to state 4
   24111 
   24112 
   24113 State 1
   24114 
   24115     1 S: 'a' . A 'a'
   24116     4 A: . 'a' 'a'
   24117     5  | . 'a'
   24118 
   24119     'a'  shift, and go to state 5
   24120 
   24121     A  go to state 6
   24122 
   24123 
   24124 State 2
   24125 
   24126     2 S: 'b' . A 'b'
   24127     4 A: . 'a' 'a'
   24128     5  | . 'a'
   24129 
   24130     'a'  shift, and go to state 5
   24131 
   24132     A  go to state 7
   24133 
   24134 
   24135 State 3
   24136 
   24137     3 S: 'c' . c
   24138     4 A: . 'a' 'a'
   24139     5  | . 'a'
   24140     6 c: . 'a' 'b'
   24141     7  | . A
   24142 
   24143     'a'  shift, and go to state 8
   24144 
   24145     A  go to state 9
   24146     c  go to state 10
   24147 
   24148 
   24149 State 4
   24150 
   24151     0 \$accept: S . \$end
   24152 
   24153     \$end  shift, and go to state 11
   24154 
   24155 
   24156 State 5
   24157 
   24158     4 A: 'a' . 'a'
   24159     5  | 'a' .  ['a', 'b']
   24160 
   24161     \$default  reduce using rule 5 (A)
   24162 
   24163     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   24164 
   24165 
   24166 State 6
   24167 
   24168     1 S: 'a' A . 'a'
   24169 
   24170     'a'  shift, and go to state 13
   24171 
   24172 
   24173 State 7
   24174 
   24175     2 S: 'b' A . 'b'
   24176 
   24177     'b'  shift, and go to state 14
   24178 
   24179 
   24180 State 8
   24181 
   24182     4 A: 'a' . 'a'
   24183     5  | 'a' .  [\$end]
   24184     6 c: 'a' . 'b'
   24185 
   24186     'a'  shift, and go to state 12
   24187     'b'  shift, and go to state 15
   24188 
   24189     \$default  reduce using rule 5 (A)
   24190 
   24191 
   24192 State 9
   24193 
   24194     7 c: A .
   24195 
   24196     \$default  reduce using rule 7 (c)
   24197 
   24198 
   24199 State 10
   24200 
   24201     3 S: 'c' c .
   24202 
   24203     \$default  reduce using rule 3 (S)
   24204 
   24205 
   24206 State 11
   24207 
   24208     0 \$accept: S \$end .
   24209 
   24210     \$default  accept
   24211 
   24212 
   24213 State 12
   24214 
   24215     4 A: 'a' 'a' .
   24216 
   24217     \$default  reduce using rule 4 (A)
   24218 
   24219 
   24220 State 13
   24221 
   24222     1 S: 'a' A 'a' .
   24223 
   24224     \$default  reduce using rule 1 (S)
   24225 
   24226 
   24227 State 14
   24228 
   24229     2 S: 'b' A 'b' .
   24230 
   24231     \$default  reduce using rule 2 (S)
   24232 
   24233 
   24234 State 15
   24235 
   24236     6 c: 'a' 'b' .
   24237 
   24238     \$default  reduce using rule 6 (c)
   24239 " | \
   24240   $at_diff - "$at_stdout" || at_failed=:
   24241 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24242 $at_failed && at_fn_log_failure
   24243 $at_traceon; }
   24244 
   24245 
   24246 
   24247 
   24248 # Canonical LR generates very large tables, resulting in very long
   24249 # files with #line directives that may overflow what the standards
   24250 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   24251 # will issue an error.
   24252 #
   24253 # There is no "" around `wc` since some indent the result.
   24254 
   24255 { set +x
   24256 $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS"
   24257 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
   24258 ( $at_check_trace; $BISON_C_WORKS
   24259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24260 at_status=$? at_failed=false
   24261 $at_check_filter
   24262 echo stderr:; cat "$at_stderr"
   24263 echo stdout:; cat "$at_stdout"
   24264 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24265 $at_failed && at_fn_log_failure
   24266 $at_traceon; }
   24267 
   24268 { set +x
   24269 $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   24270 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474"
   24271 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   24272 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24273 at_status=$? at_failed=false
   24274 $at_check_filter
   24275 echo stderr:; cat "$at_stderr"
   24276 echo stdout:; cat "$at_stdout"
   24277 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24278 $at_failed && at_fn_log_failure
   24279 $at_traceon; }
   24280 
   24281 
   24282 { set +x
   24283 $as_echo "$at_srcdir/reduce.at:474:  \$PREPARSER ./input"
   24284 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
   24285 ( $at_check_trace;  $PREPARSER ./input
   24286 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24287 at_status=$? at_failed=false
   24288 $at_check_filter
   24289 echo stderr:; tee stderr <"$at_stderr"
   24290 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24291 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:474"
   24292 $at_failed && at_fn_log_failure
   24293 $at_traceon; }
   24294 
   24295 { set +x
   24296 $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   24297 at_fn_check_prepare_trace "reduce.at:474"
   24298 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   24299 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24300 at_status=$? at_failed=false
   24301 $at_check_filter
   24302 echo >>"$at_stderr"; $as_echo "syntax error
   24303 " | \
   24304   $at_diff - "$at_stderr" || at_failed=:
   24305 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24306 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24307 $at_failed && at_fn_log_failure
   24308 $at_traceon; }
   24309 
   24310 
   24311 
   24312 
   24313   set +x
   24314   $at_times_p && times >"$at_times_file"
   24315 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   24316 read at_status <"$at_status_file"
   24317 #AT_STOP_109
   24318 #AT_START_110
   24319 at_fn_group_banner 110 'reduce.at:474' \
   24320   "%define lr.type ielr: Single State Split" "       " 6
   24321 at_xfail=no
   24322 (
   24323   $as_echo "110. $at_setup_line: testing $at_desc ..."
   24324   $at_traceon
   24325 
   24326 
   24327 cat >input.y <<'_ATEOF'
   24328 %code top {
   24329 #include <config.h>
   24330 /* We don't need perfect functions for these tests. */
   24331 #undef malloc
   24332 #undef memcmp
   24333 #undef realloc
   24334 }
   24335 
   24336 %code {
   24337   #include <stdio.h>
   24338   static void yyerror ( const char *msg);
   24339   static int yylex (void);
   24340 }
   24341 
   24342 %define lr.type ielr
   24343 %left 'a'
   24344 // Conflict resolution renders state 12 unreachable for canonical LR(1).  We
   24345 // keep it so that the paser table diff is easier to code.
   24346 %define lr.keep-unreachable-states
   24347 
   24348 %%
   24349 
   24350 
   24351 S: 'a' A 'a' /* rule 1 */
   24352  | 'b' A 'b' /* rule 2 */
   24353  | 'c' c     /* rule 3 */
   24354  ;
   24355 
   24356 /* A conflict should appear after the first 'a' in rules 4 and 5 but only after
   24357    having shifted the first 'a' in rule 1.  However, when LALR(1) merging is
   24358    chosen, the state containing that conflict is reused after having seen the
   24359    first 'b' in rule 2 and then the first 'a' in rules 4 and 5.  In both cases,
   24360    because of the merged state, if the next token is an 'a', the %left forces a
   24361    reduction action with rule 5.  In the latter case, only a shift is actually
   24362    grammatically correct.  Thus, the parser would report a syntax error for the
   24363    grammatically correct sentence "baab" because it would encounter a syntax
   24364    error after that incorrect reduction.
   24365 
   24366    Despite not being LALR(1), Menhir version 20070322 suffers from this problem
   24367    as well.  It uses David Pager's weak compatibility test for merging states.
   24368    Bison and Menhir accept non-LR(1) grammars with conflict resolution.  Pager
   24369    designed his algorithm only for LR(1) grammars.  */
   24370 A: 'a' 'a' /* rule 4 */
   24371  | 'a'     /* rule 5 */
   24372  ;
   24373 
   24374 /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
   24375    useless after conflict resolution.  This proves that, even though LALR(1)
   24376    generates incorrect parser tables sometimes, Bison will not necessarily
   24377    produce any warning to help the user realize it.  */
   24378 c: 'a' 'b' /* rule 6 */
   24379  | A       /* rule 7 */
   24380  ;
   24381 
   24382 
   24383 %%
   24384 #include <stdio.h>
   24385 /* A C error reporting function.  */
   24386 static
   24387 void yyerror ( const char *msg)
   24388 {
   24389   fprintf (stderr, "%s\n", msg);
   24390 }
   24391 static int
   24392 yylex (void)
   24393 {
   24394   static int const input[] = {
   24395     'b', 'a', 'a', 'b', 0
   24396   };
   24397   static int const *inputp = input;
   24398   return *inputp++;
   24399 }
   24400 
   24401 int
   24402 main (void)
   24403 {
   24404   return yyparse ();
   24405 }
   24406 _ATEOF
   24407 
   24408 
   24409 
   24410 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   24411 # expanding macros, so it corrupts some special characters in the
   24412 # macros.  To avoid this, expand now and pass it the result with proper
   24413 # string quotation.  Assume args 7 through 12 expand to properly quoted
   24414 # strings.
   24415 
   24416 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   24417   at_save_special_files
   24418   mkdir xml-tests
   24419     # Don't combine these Bison invocations since we want to be sure that
   24420   # --report=all isn't required to get the full XML file.
   24421   { set +x
   24422 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   24423                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   24424 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474"
   24425 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   24426                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   24427 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24428 at_status=$? at_failed=false
   24429 $at_check_filter
   24430 echo stderr:; cat "$at_stderr"
   24431 echo stdout:; cat "$at_stdout"
   24432 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24433 $at_failed && at_fn_log_failure
   24434 $at_traceon; }
   24435 
   24436   { set +x
   24437 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   24438 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474"
   24439 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   24440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24441 at_status=$? at_failed=false
   24442 $at_check_filter
   24443 echo stderr:; cat "$at_stderr"
   24444 echo stdout:; cat "$at_stdout"
   24445 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24446 $at_failed && at_fn_log_failure
   24447 $at_traceon; }
   24448 
   24449     cp xml-tests/test.output expout
   24450   { set +x
   24451 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   24452              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   24453              xml-tests/test.xml"
   24454 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   24455 ( $at_check_trace; $XSLTPROC \
   24456              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   24457              xml-tests/test.xml
   24458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24459 at_status=$? at_failed=false
   24460 $at_check_filter
   24461 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24462 $at_diff expout "$at_stdout" || at_failed=:
   24463 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24464 $at_failed && at_fn_log_failure
   24465 $at_traceon; }
   24466 
   24467   sort xml-tests/test.dot > expout
   24468   { set +x
   24469 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   24470              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   24471              xml-tests/test.xml | sort"
   24472 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   24473 ( $at_check_trace; $XSLTPROC \
   24474              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   24475              xml-tests/test.xml | sort
   24476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24477 at_status=$? at_failed=false
   24478 $at_check_filter
   24479 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24480 $at_diff expout "$at_stdout" || at_failed=:
   24481 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24482 $at_failed && at_fn_log_failure
   24483 $at_traceon; }
   24484 
   24485   rm -rf xml-tests expout
   24486   at_restore_special_files
   24487 fi
   24488 { set +x
   24489 $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
   24490 at_fn_check_prepare_trace "reduce.at:474"
   24491 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   24492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24493 at_status=$? at_failed=false
   24494 $at_check_filter
   24495 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24496 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24497 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24498 $at_failed && at_fn_log_failure
   24499 $at_traceon; }
   24500 
   24501 
   24502 
   24503 { set +x
   24504 $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output"
   24505 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474"
   24506 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   24507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24508 at_status=$? at_failed=false
   24509 $at_check_filter
   24510 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24511 echo >>"$at_stdout"; $as_echo "State 0
   24512 
   24513     0 \$accept: . S \$end
   24514     1 S: . 'a' A 'a'
   24515     2  | . 'b' A 'b'
   24516     3  | . 'c' c
   24517 
   24518     'a'  shift, and go to state 1
   24519     'b'  shift, and go to state 2
   24520     'c'  shift, and go to state 3
   24521 
   24522     S  go to state 4
   24523 
   24524 
   24525 State 1
   24526 
   24527     1 S: 'a' . A 'a'
   24528     4 A: . 'a' 'a'
   24529     5  | . 'a'
   24530 
   24531     'a'  shift, and go to state 5
   24532 
   24533     A  go to state 6
   24534 
   24535 
   24536 State 2
   24537 
   24538     2 S: 'b' . A 'b'
   24539     4 A: . 'a' 'a'
   24540     5  | . 'a'
   24541 
   24542     'a'  shift, and go to state 16
   24543 
   24544     A  go to state 7
   24545 
   24546 
   24547 State 3
   24548 
   24549     3 S: 'c' . c
   24550     4 A: . 'a' 'a'
   24551     5  | . 'a'
   24552     6 c: . 'a' 'b'
   24553     7  | . A
   24554 
   24555     'a'  shift, and go to state 8
   24556 
   24557     A  go to state 9
   24558     c  go to state 10
   24559 
   24560 
   24561 State 4
   24562 
   24563     0 \$accept: S . \$end
   24564 
   24565     \$end  shift, and go to state 11
   24566 
   24567 
   24568 State 5
   24569 
   24570     4 A: 'a' . 'a'
   24571     5  | 'a' .  ['a']
   24572 
   24573     \$default  reduce using rule 5 (A)
   24574 
   24575     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   24576 
   24577 
   24578 State 6
   24579 
   24580     1 S: 'a' A . 'a'
   24581 
   24582     'a'  shift, and go to state 13
   24583 
   24584 
   24585 State 7
   24586 
   24587     2 S: 'b' A . 'b'
   24588 
   24589     'b'  shift, and go to state 14
   24590 
   24591 
   24592 State 8
   24593 
   24594     4 A: 'a' . 'a'
   24595     5  | 'a' .  [\$end]
   24596     6 c: 'a' . 'b'
   24597 
   24598     'a'  shift, and go to state 12
   24599     'b'  shift, and go to state 15
   24600 
   24601     \$default  reduce using rule 5 (A)
   24602 
   24603 
   24604 State 9
   24605 
   24606     7 c: A .
   24607 
   24608     \$default  reduce using rule 7 (c)
   24609 
   24610 
   24611 State 10
   24612 
   24613     3 S: 'c' c .
   24614 
   24615     \$default  reduce using rule 3 (S)
   24616 
   24617 
   24618 State 11
   24619 
   24620     0 \$accept: S \$end .
   24621 
   24622     \$default  accept
   24623 
   24624 
   24625 State 12
   24626 
   24627     4 A: 'a' 'a' .
   24628 
   24629     \$default  reduce using rule 4 (A)
   24630 
   24631 
   24632 State 13
   24633 
   24634     1 S: 'a' A 'a' .
   24635 
   24636     \$default  reduce using rule 1 (S)
   24637 
   24638 
   24639 State 14
   24640 
   24641     2 S: 'b' A 'b' .
   24642 
   24643     \$default  reduce using rule 2 (S)
   24644 
   24645 
   24646 State 15
   24647 
   24648     6 c: 'a' 'b' .
   24649 
   24650     \$default  reduce using rule 6 (c)
   24651 
   24652 
   24653 State 16
   24654 
   24655     4 A: 'a' . 'a'
   24656     5  | 'a' .  ['b']
   24657 
   24658     'a'  shift, and go to state 12
   24659 
   24660     \$default  reduce using rule 5 (A)
   24661 " | \
   24662   $at_diff - "$at_stdout" || at_failed=:
   24663 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24664 $at_failed && at_fn_log_failure
   24665 $at_traceon; }
   24666 
   24667 
   24668 
   24669 
   24670 # Canonical LR generates very large tables, resulting in very long
   24671 # files with #line directives that may overflow what the standards
   24672 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   24673 # will issue an error.
   24674 #
   24675 # There is no "" around `wc` since some indent the result.
   24676 
   24677 { set +x
   24678 $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS"
   24679 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
   24680 ( $at_check_trace; $BISON_C_WORKS
   24681 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24682 at_status=$? at_failed=false
   24683 $at_check_filter
   24684 echo stderr:; cat "$at_stderr"
   24685 echo stdout:; cat "$at_stdout"
   24686 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24687 $at_failed && at_fn_log_failure
   24688 $at_traceon; }
   24689 
   24690 { set +x
   24691 $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   24692 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474"
   24693 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   24694 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24695 at_status=$? at_failed=false
   24696 $at_check_filter
   24697 echo stderr:; cat "$at_stderr"
   24698 echo stdout:; cat "$at_stdout"
   24699 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24700 $at_failed && at_fn_log_failure
   24701 $at_traceon; }
   24702 
   24703 
   24704 { set +x
   24705 $as_echo "$at_srcdir/reduce.at:474:  \$PREPARSER ./input"
   24706 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
   24707 ( $at_check_trace;  $PREPARSER ./input
   24708 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24709 at_status=$? at_failed=false
   24710 $at_check_filter
   24711 echo stderr:; tee stderr <"$at_stderr"
   24712 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24713 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24714 $at_failed && at_fn_log_failure
   24715 $at_traceon; }
   24716 
   24717 { set +x
   24718 $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   24719 at_fn_check_prepare_trace "reduce.at:474"
   24720 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   24721 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24722 at_status=$? at_failed=false
   24723 $at_check_filter
   24724 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24725 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24726 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24727 $at_failed && at_fn_log_failure
   24728 $at_traceon; }
   24729 
   24730 
   24731 
   24732 
   24733   set +x
   24734   $at_times_p && times >"$at_times_file"
   24735 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   24736 read at_status <"$at_status_file"
   24737 #AT_STOP_110
   24738 #AT_START_111
   24739 at_fn_group_banner 111 'reduce.at:474' \
   24740   "%define lr.type canonical-lr: Single State Split" "" 6
   24741 at_xfail=no
   24742 (
   24743   $as_echo "111. $at_setup_line: testing $at_desc ..."
   24744   $at_traceon
   24745 
   24746 
   24747 cat >input.y <<'_ATEOF'
   24748 %code top {
   24749 #include <config.h>
   24750 /* We don't need perfect functions for these tests. */
   24751 #undef malloc
   24752 #undef memcmp
   24753 #undef realloc
   24754 }
   24755 
   24756 %code {
   24757   #include <stdio.h>
   24758   static void yyerror ( const char *msg);
   24759   static int yylex (void);
   24760 }
   24761 
   24762 %define lr.type canonical-lr
   24763 %left 'a'
   24764 // Conflict resolution renders state 12 unreachable for canonical LR(1).  We
   24765 // keep it so that the paser table diff is easier to code.
   24766 %define lr.keep-unreachable-states
   24767 
   24768 %%
   24769 
   24770 
   24771 S: 'a' A 'a' /* rule 1 */
   24772  | 'b' A 'b' /* rule 2 */
   24773  | 'c' c     /* rule 3 */
   24774  ;
   24775 
   24776 /* A conflict should appear after the first 'a' in rules 4 and 5 but only after
   24777    having shifted the first 'a' in rule 1.  However, when LALR(1) merging is
   24778    chosen, the state containing that conflict is reused after having seen the
   24779    first 'b' in rule 2 and then the first 'a' in rules 4 and 5.  In both cases,
   24780    because of the merged state, if the next token is an 'a', the %left forces a
   24781    reduction action with rule 5.  In the latter case, only a shift is actually
   24782    grammatically correct.  Thus, the parser would report a syntax error for the
   24783    grammatically correct sentence "baab" because it would encounter a syntax
   24784    error after that incorrect reduction.
   24785 
   24786    Despite not being LALR(1), Menhir version 20070322 suffers from this problem
   24787    as well.  It uses David Pager's weak compatibility test for merging states.
   24788    Bison and Menhir accept non-LR(1) grammars with conflict resolution.  Pager
   24789    designed his algorithm only for LR(1) grammars.  */
   24790 A: 'a' 'a' /* rule 4 */
   24791  | 'a'     /* rule 5 */
   24792  ;
   24793 
   24794 /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
   24795    useless after conflict resolution.  This proves that, even though LALR(1)
   24796    generates incorrect parser tables sometimes, Bison will not necessarily
   24797    produce any warning to help the user realize it.  */
   24798 c: 'a' 'b' /* rule 6 */
   24799  | A       /* rule 7 */
   24800  ;
   24801 
   24802 
   24803 %%
   24804 #include <stdio.h>
   24805 /* A C error reporting function.  */
   24806 static
   24807 void yyerror ( const char *msg)
   24808 {
   24809   fprintf (stderr, "%s\n", msg);
   24810 }
   24811 static int
   24812 yylex (void)
   24813 {
   24814   static int const input[] = {
   24815     'b', 'a', 'a', 'b', 0
   24816   };
   24817   static int const *inputp = input;
   24818   return *inputp++;
   24819 }
   24820 
   24821 int
   24822 main (void)
   24823 {
   24824   return yyparse ();
   24825 }
   24826 _ATEOF
   24827 
   24828 
   24829 
   24830 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   24831 # expanding macros, so it corrupts some special characters in the
   24832 # macros.  To avoid this, expand now and pass it the result with proper
   24833 # string quotation.  Assume args 7 through 12 expand to properly quoted
   24834 # strings.
   24835 
   24836 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   24837   at_save_special_files
   24838   mkdir xml-tests
   24839     # Don't combine these Bison invocations since we want to be sure that
   24840   # --report=all isn't required to get the full XML file.
   24841   { set +x
   24842 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   24843                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   24844 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:474"
   24845 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   24846                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   24847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24848 at_status=$? at_failed=false
   24849 $at_check_filter
   24850 echo stderr:; cat "$at_stderr"
   24851 echo stdout:; cat "$at_stdout"
   24852 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24853 $at_failed && at_fn_log_failure
   24854 $at_traceon; }
   24855 
   24856   { set +x
   24857 $as_echo "$at_srcdir/reduce.at:474: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   24858 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:474"
   24859 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   24860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24861 at_status=$? at_failed=false
   24862 $at_check_filter
   24863 echo stderr:; cat "$at_stderr"
   24864 echo stdout:; cat "$at_stdout"
   24865 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24866 $at_failed && at_fn_log_failure
   24867 $at_traceon; }
   24868 
   24869     cp xml-tests/test.output expout
   24870   { set +x
   24871 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   24872              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   24873              xml-tests/test.xml"
   24874 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   24875 ( $at_check_trace; $XSLTPROC \
   24876              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   24877              xml-tests/test.xml
   24878 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24879 at_status=$? at_failed=false
   24880 $at_check_filter
   24881 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24882 $at_diff expout "$at_stdout" || at_failed=:
   24883 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24884 $at_failed && at_fn_log_failure
   24885 $at_traceon; }
   24886 
   24887   sort xml-tests/test.dot > expout
   24888   { set +x
   24889 $as_echo "$at_srcdir/reduce.at:474: \$XSLTPROC \\
   24890              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   24891              xml-tests/test.xml | sort"
   24892 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:474"
   24893 ( $at_check_trace; $XSLTPROC \
   24894              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   24895              xml-tests/test.xml | sort
   24896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24897 at_status=$? at_failed=false
   24898 $at_check_filter
   24899 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24900 $at_diff expout "$at_stdout" || at_failed=:
   24901 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24902 $at_failed && at_fn_log_failure
   24903 $at_traceon; }
   24904 
   24905   rm -rf xml-tests expout
   24906   at_restore_special_files
   24907 fi
   24908 { set +x
   24909 $as_echo "$at_srcdir/reduce.at:474: bison --report=all --defines -o input.c input.y"
   24910 at_fn_check_prepare_trace "reduce.at:474"
   24911 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   24912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24913 at_status=$? at_failed=false
   24914 $at_check_filter
   24915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24916 at_fn_diff_devnull "$at_stdout" || at_failed=:
   24917 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   24918 $at_failed && at_fn_log_failure
   24919 $at_traceon; }
   24920 
   24921 
   24922 
   24923 { set +x
   24924 $as_echo "$at_srcdir/reduce.at:474: sed -n '/^State 0\$/,\$p' input.output"
   24925 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:474"
   24926 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   24927 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   24928 at_status=$? at_failed=false
   24929 $at_check_filter
   24930 at_fn_diff_devnull "$at_stderr" || at_failed=:
   24931 echo >>"$at_stdout"; $as_echo "State 0
   24932 
   24933     0 \$accept: . S \$end
   24934     1 S: . 'a' A 'a'
   24935     2  | . 'b' A 'b'
   24936     3  | . 'c' c
   24937 
   24938     'a'  shift, and go to state 1
   24939     'b'  shift, and go to state 2
   24940     'c'  shift, and go to state 3
   24941 
   24942     S  go to state 4
   24943 
   24944 
   24945 State 1
   24946 
   24947     1 S: 'a' . A 'a'
   24948     4 A: . 'a' 'a'
   24949     5  | . 'a'
   24950 
   24951     'a'  shift, and go to state 5
   24952 
   24953     A  go to state 6
   24954 
   24955 
   24956 State 2
   24957 
   24958     2 S: 'b' . A 'b'
   24959     4 A: . 'a' 'a'
   24960     5  | . 'a'
   24961 
   24962     'a'  shift, and go to state 16
   24963 
   24964     A  go to state 7
   24965 
   24966 
   24967 State 3
   24968 
   24969     3 S: 'c' . c
   24970     4 A: . 'a' 'a'
   24971     5  | . 'a'
   24972     6 c: . 'a' 'b'
   24973     7  | . A
   24974 
   24975     'a'  shift, and go to state 8
   24976 
   24977     A  go to state 9
   24978     c  go to state 10
   24979 
   24980 
   24981 State 4
   24982 
   24983     0 \$accept: S . \$end
   24984 
   24985     \$end  shift, and go to state 11
   24986 
   24987 
   24988 State 5
   24989 
   24990     4 A: 'a' . 'a'
   24991     5  | 'a' .  ['a']
   24992 
   24993     'a'  reduce using rule 5 (A)
   24994 
   24995     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   24996 
   24997 
   24998 State 6
   24999 
   25000     1 S: 'a' A . 'a'
   25001 
   25002     'a'  shift, and go to state 13
   25003 
   25004 
   25005 State 7
   25006 
   25007     2 S: 'b' A . 'b'
   25008 
   25009     'b'  shift, and go to state 14
   25010 
   25011 
   25012 State 8
   25013 
   25014     4 A: 'a' . 'a'
   25015     5  | 'a' .  [\$end]
   25016     6 c: 'a' . 'b'
   25017 
   25018     'a'  shift, and go to state 17
   25019     'b'  shift, and go to state 15
   25020 
   25021     \$end  reduce using rule 5 (A)
   25022 
   25023 
   25024 State 9
   25025 
   25026     7 c: A .  [\$end]
   25027 
   25028     \$end  reduce using rule 7 (c)
   25029 
   25030 
   25031 State 10
   25032 
   25033     3 S: 'c' c .  [\$end]
   25034 
   25035     \$end  reduce using rule 3 (S)
   25036 
   25037 
   25038 State 11
   25039 
   25040     0 \$accept: S \$end .
   25041 
   25042     \$default  accept
   25043 
   25044 
   25045 State 12
   25046 
   25047     4 A: 'a' 'a' .  ['a']
   25048 
   25049     'a'  reduce using rule 4 (A)
   25050 
   25051 
   25052 State 13
   25053 
   25054     1 S: 'a' A 'a' .  [\$end]
   25055 
   25056     \$end  reduce using rule 1 (S)
   25057 
   25058 
   25059 State 14
   25060 
   25061     2 S: 'b' A 'b' .  [\$end]
   25062 
   25063     \$end  reduce using rule 2 (S)
   25064 
   25065 
   25066 State 15
   25067 
   25068     6 c: 'a' 'b' .  [\$end]
   25069 
   25070     \$end  reduce using rule 6 (c)
   25071 
   25072 
   25073 State 16
   25074 
   25075     4 A: 'a' . 'a'
   25076     5  | 'a' .  ['b']
   25077 
   25078     'a'  shift, and go to state 18
   25079 
   25080     'b'  reduce using rule 5 (A)
   25081 
   25082 
   25083 State 17
   25084 
   25085     4 A: 'a' 'a' .  [\$end]
   25086 
   25087     \$end  reduce using rule 4 (A)
   25088 
   25089 
   25090 State 18
   25091 
   25092     4 A: 'a' 'a' .  ['b']
   25093 
   25094     'b'  reduce using rule 4 (A)
   25095 " | \
   25096   $at_diff - "$at_stdout" || at_failed=:
   25097 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   25098 $at_failed && at_fn_log_failure
   25099 $at_traceon; }
   25100 
   25101 
   25102 
   25103 
   25104 # Canonical LR generates very large tables, resulting in very long
   25105 # files with #line directives that may overflow what the standards
   25106 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   25107 # will issue an error.
   25108 #
   25109 # There is no "" around `wc` since some indent the result.
   25110 if test 32767 -lt `wc -l < input.c`; then
   25111   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   25112   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   25113 fi
   25114 { set +x
   25115 $as_echo "$at_srcdir/reduce.at:474: \$BISON_C_WORKS"
   25116 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:474"
   25117 ( $at_check_trace; $BISON_C_WORKS
   25118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25119 at_status=$? at_failed=false
   25120 $at_check_filter
   25121 echo stderr:; cat "$at_stderr"
   25122 echo stdout:; cat "$at_stdout"
   25123 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   25124 $at_failed && at_fn_log_failure
   25125 $at_traceon; }
   25126 
   25127 { set +x
   25128 $as_echo "$at_srcdir/reduce.at:474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   25129 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:474"
   25130 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   25131 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25132 at_status=$? at_failed=false
   25133 $at_check_filter
   25134 echo stderr:; cat "$at_stderr"
   25135 echo stdout:; cat "$at_stdout"
   25136 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   25137 $at_failed && at_fn_log_failure
   25138 $at_traceon; }
   25139 
   25140 
   25141 { set +x
   25142 $as_echo "$at_srcdir/reduce.at:474:  \$PREPARSER ./input"
   25143 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:474"
   25144 ( $at_check_trace;  $PREPARSER ./input
   25145 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25146 at_status=$? at_failed=false
   25147 $at_check_filter
   25148 echo stderr:; tee stderr <"$at_stderr"
   25149 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25150 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   25151 $at_failed && at_fn_log_failure
   25152 $at_traceon; }
   25153 
   25154 { set +x
   25155 $as_echo "$at_srcdir/reduce.at:474: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   25156 at_fn_check_prepare_trace "reduce.at:474"
   25157 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   25158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25159 at_status=$? at_failed=false
   25160 $at_check_filter
   25161 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25162 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25163 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:474"
   25164 $at_failed && at_fn_log_failure
   25165 $at_traceon; }
   25166 
   25167 
   25168 
   25169 
   25170   set +x
   25171   $at_times_p && times >"$at_times_file"
   25172 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   25173 read at_status <"$at_status_file"
   25174 #AT_STOP_111
   25175 #AT_START_112
   25176 at_fn_group_banner 112 'reduce.at:707' \
   25177   "no %define lr.type: Lane Split" "                 " 6
   25178 at_xfail=no
   25179 (
   25180   $as_echo "112. $at_setup_line: testing $at_desc ..."
   25181   $at_traceon
   25182 
   25183 
   25184 cat >input.y <<'_ATEOF'
   25185 %code top {
   25186 #include <config.h>
   25187 /* We don't need perfect functions for these tests. */
   25188 #undef malloc
   25189 #undef memcmp
   25190 #undef realloc
   25191 }
   25192 
   25193 %code {
   25194   #include <stdio.h>
   25195   static void yyerror ( const char *msg);
   25196   static int yylex (void);
   25197 }
   25198 
   25199 %left 'a'
   25200 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   25201 // keep it so that the paser table diff is easier to code.
   25202 %define lr.keep-unreachable-states
   25203 
   25204 %%
   25205 
   25206 
   25207 /* Similar to the last test case set but two states must be split.  */
   25208 S: 'a' A 'a' /* rule 1 */
   25209  | 'b' A 'b' /* rule 2 */
   25210  | 'c' c     /* rule 3 */
   25211  ;
   25212 
   25213 A: 'a' 'a' 'a' /* rule 4 */
   25214  | 'a' 'a'     /* rule 5 */
   25215  ;
   25216 
   25217 c: 'a' 'a' 'b' /* rule 6 */
   25218  | A           /* rule 7 */
   25219  ;
   25220 
   25221 
   25222 %%
   25223 #include <stdio.h>
   25224 /* A C error reporting function.  */
   25225 static
   25226 void yyerror ( const char *msg)
   25227 {
   25228   fprintf (stderr, "%s\n", msg);
   25229 }
   25230 static int
   25231 yylex (void)
   25232 {
   25233   static int const input[] = {
   25234     'b', 'a', 'a', 'a', 'b', 0
   25235   };
   25236   static int const *inputp = input;
   25237   return *inputp++;
   25238 }
   25239 
   25240 int
   25241 main (void)
   25242 {
   25243   return yyparse ();
   25244 }
   25245 _ATEOF
   25246 
   25247 
   25248 
   25249 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   25250 # expanding macros, so it corrupts some special characters in the
   25251 # macros.  To avoid this, expand now and pass it the result with proper
   25252 # string quotation.  Assume args 7 through 12 expand to properly quoted
   25253 # strings.
   25254 
   25255 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   25256   at_save_special_files
   25257   mkdir xml-tests
   25258     # Don't combine these Bison invocations since we want to be sure that
   25259   # --report=all isn't required to get the full XML file.
   25260   { set +x
   25261 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   25262                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   25263 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707"
   25264 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   25265                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   25266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25267 at_status=$? at_failed=false
   25268 $at_check_filter
   25269 echo stderr:; cat "$at_stderr"
   25270 echo stdout:; cat "$at_stdout"
   25271 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25272 $at_failed && at_fn_log_failure
   25273 $at_traceon; }
   25274 
   25275   { set +x
   25276 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   25277 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707"
   25278 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   25279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25280 at_status=$? at_failed=false
   25281 $at_check_filter
   25282 echo stderr:; cat "$at_stderr"
   25283 echo stdout:; cat "$at_stdout"
   25284 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25285 $at_failed && at_fn_log_failure
   25286 $at_traceon; }
   25287 
   25288     cp xml-tests/test.output expout
   25289   { set +x
   25290 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   25291              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   25292              xml-tests/test.xml"
   25293 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   25294 ( $at_check_trace; $XSLTPROC \
   25295              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   25296              xml-tests/test.xml
   25297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25298 at_status=$? at_failed=false
   25299 $at_check_filter
   25300 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25301 $at_diff expout "$at_stdout" || at_failed=:
   25302 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25303 $at_failed && at_fn_log_failure
   25304 $at_traceon; }
   25305 
   25306   sort xml-tests/test.dot > expout
   25307   { set +x
   25308 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   25309              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   25310              xml-tests/test.xml | sort"
   25311 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   25312 ( $at_check_trace; $XSLTPROC \
   25313              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   25314              xml-tests/test.xml | sort
   25315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25316 at_status=$? at_failed=false
   25317 $at_check_filter
   25318 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25319 $at_diff expout "$at_stdout" || at_failed=:
   25320 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25321 $at_failed && at_fn_log_failure
   25322 $at_traceon; }
   25323 
   25324   rm -rf xml-tests expout
   25325   at_restore_special_files
   25326 fi
   25327 { set +x
   25328 $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
   25329 at_fn_check_prepare_trace "reduce.at:707"
   25330 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   25331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25332 at_status=$? at_failed=false
   25333 $at_check_filter
   25334 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25335 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25336 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25337 $at_failed && at_fn_log_failure
   25338 $at_traceon; }
   25339 
   25340 
   25341 
   25342 { set +x
   25343 $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output"
   25344 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707"
   25345 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   25346 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25347 at_status=$? at_failed=false
   25348 $at_check_filter
   25349 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25350 echo >>"$at_stdout"; $as_echo "State 0
   25351 
   25352     0 \$accept: . S \$end
   25353     1 S: . 'a' A 'a'
   25354     2  | . 'b' A 'b'
   25355     3  | . 'c' c
   25356 
   25357     'a'  shift, and go to state 1
   25358     'b'  shift, and go to state 2
   25359     'c'  shift, and go to state 3
   25360 
   25361     S  go to state 4
   25362 
   25363 
   25364 State 1
   25365 
   25366     1 S: 'a' . A 'a'
   25367     4 A: . 'a' 'a' 'a'
   25368     5  | . 'a' 'a'
   25369 
   25370     'a'  shift, and go to state 5
   25371 
   25372     A  go to state 6
   25373 
   25374 
   25375 State 2
   25376 
   25377     2 S: 'b' . A 'b'
   25378     4 A: . 'a' 'a' 'a'
   25379     5  | . 'a' 'a'
   25380 
   25381     'a'  shift, and go to state 5
   25382 
   25383     A  go to state 7
   25384 
   25385 
   25386 State 3
   25387 
   25388     3 S: 'c' . c
   25389     4 A: . 'a' 'a' 'a'
   25390     5  | . 'a' 'a'
   25391     6 c: . 'a' 'a' 'b'
   25392     7  | . A
   25393 
   25394     'a'  shift, and go to state 8
   25395 
   25396     A  go to state 9
   25397     c  go to state 10
   25398 
   25399 
   25400 State 4
   25401 
   25402     0 \$accept: S . \$end
   25403 
   25404     \$end  shift, and go to state 11
   25405 
   25406 
   25407 State 5
   25408 
   25409     4 A: 'a' . 'a' 'a'
   25410     5  | 'a' . 'a'
   25411 
   25412     'a'  shift, and go to state 12
   25413 
   25414 
   25415 State 6
   25416 
   25417     1 S: 'a' A . 'a'
   25418 
   25419     'a'  shift, and go to state 13
   25420 
   25421 
   25422 State 7
   25423 
   25424     2 S: 'b' A . 'b'
   25425 
   25426     'b'  shift, and go to state 14
   25427 
   25428 
   25429 State 8
   25430 
   25431     4 A: 'a' . 'a' 'a'
   25432     5  | 'a' . 'a'
   25433     6 c: 'a' . 'a' 'b'
   25434 
   25435     'a'  shift, and go to state 15
   25436 
   25437 
   25438 State 9
   25439 
   25440     7 c: A .
   25441 
   25442     \$default  reduce using rule 7 (c)
   25443 
   25444 
   25445 State 10
   25446 
   25447     3 S: 'c' c .
   25448 
   25449     \$default  reduce using rule 3 (S)
   25450 
   25451 
   25452 State 11
   25453 
   25454     0 \$accept: S \$end .
   25455 
   25456     \$default  accept
   25457 
   25458 
   25459 State 12
   25460 
   25461     4 A: 'a' 'a' . 'a'
   25462     5  | 'a' 'a' .  ['a', 'b']
   25463 
   25464     \$default  reduce using rule 5 (A)
   25465 
   25466     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   25467 
   25468 
   25469 State 13
   25470 
   25471     1 S: 'a' A 'a' .
   25472 
   25473     \$default  reduce using rule 1 (S)
   25474 
   25475 
   25476 State 14
   25477 
   25478     2 S: 'b' A 'b' .
   25479 
   25480     \$default  reduce using rule 2 (S)
   25481 
   25482 
   25483 State 15
   25484 
   25485     4 A: 'a' 'a' . 'a'
   25486     5  | 'a' 'a' .  [\$end]
   25487     6 c: 'a' 'a' . 'b'
   25488 
   25489     'a'  shift, and go to state 16
   25490     'b'  shift, and go to state 17
   25491 
   25492     \$default  reduce using rule 5 (A)
   25493 
   25494 
   25495 State 16
   25496 
   25497     4 A: 'a' 'a' 'a' .
   25498 
   25499     \$default  reduce using rule 4 (A)
   25500 
   25501 
   25502 State 17
   25503 
   25504     6 c: 'a' 'a' 'b' .
   25505 
   25506     \$default  reduce using rule 6 (c)
   25507 " | \
   25508   $at_diff - "$at_stdout" || at_failed=:
   25509 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25510 $at_failed && at_fn_log_failure
   25511 $at_traceon; }
   25512 
   25513 
   25514 
   25515 
   25516 # Canonical LR generates very large tables, resulting in very long
   25517 # files with #line directives that may overflow what the standards
   25518 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   25519 # will issue an error.
   25520 #
   25521 # There is no "" around `wc` since some indent the result.
   25522 
   25523 { set +x
   25524 $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS"
   25525 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
   25526 ( $at_check_trace; $BISON_C_WORKS
   25527 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25528 at_status=$? at_failed=false
   25529 $at_check_filter
   25530 echo stderr:; cat "$at_stderr"
   25531 echo stdout:; cat "$at_stdout"
   25532 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25533 $at_failed && at_fn_log_failure
   25534 $at_traceon; }
   25535 
   25536 { set +x
   25537 $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   25538 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707"
   25539 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   25540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25541 at_status=$? at_failed=false
   25542 $at_check_filter
   25543 echo stderr:; cat "$at_stderr"
   25544 echo stdout:; cat "$at_stdout"
   25545 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25546 $at_failed && at_fn_log_failure
   25547 $at_traceon; }
   25548 
   25549 
   25550 { set +x
   25551 $as_echo "$at_srcdir/reduce.at:707:  \$PREPARSER ./input"
   25552 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
   25553 ( $at_check_trace;  $PREPARSER ./input
   25554 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25555 at_status=$? at_failed=false
   25556 $at_check_filter
   25557 echo stderr:; tee stderr <"$at_stderr"
   25558 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25559 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:707"
   25560 $at_failed && at_fn_log_failure
   25561 $at_traceon; }
   25562 
   25563 { set +x
   25564 $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   25565 at_fn_check_prepare_trace "reduce.at:707"
   25566 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   25567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25568 at_status=$? at_failed=false
   25569 $at_check_filter
   25570 echo >>"$at_stderr"; $as_echo "syntax error
   25571 " | \
   25572   $at_diff - "$at_stderr" || at_failed=:
   25573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25574 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25575 $at_failed && at_fn_log_failure
   25576 $at_traceon; }
   25577 
   25578 
   25579 
   25580 
   25581   set +x
   25582   $at_times_p && times >"$at_times_file"
   25583 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   25584 read at_status <"$at_status_file"
   25585 #AT_STOP_112
   25586 #AT_START_113
   25587 at_fn_group_banner 113 'reduce.at:707' \
   25588   "%define lr.type lalr: Lane Split" "               " 6
   25589 at_xfail=no
   25590 (
   25591   $as_echo "113. $at_setup_line: testing $at_desc ..."
   25592   $at_traceon
   25593 
   25594 
   25595 cat >input.y <<'_ATEOF'
   25596 %code top {
   25597 #include <config.h>
   25598 /* We don't need perfect functions for these tests. */
   25599 #undef malloc
   25600 #undef memcmp
   25601 #undef realloc
   25602 }
   25603 
   25604 %code {
   25605   #include <stdio.h>
   25606   static void yyerror ( const char *msg);
   25607   static int yylex (void);
   25608 }
   25609 
   25610 %define lr.type lalr
   25611 %left 'a'
   25612 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   25613 // keep it so that the paser table diff is easier to code.
   25614 %define lr.keep-unreachable-states
   25615 
   25616 %%
   25617 
   25618 
   25619 /* Similar to the last test case set but two states must be split.  */
   25620 S: 'a' A 'a' /* rule 1 */
   25621  | 'b' A 'b' /* rule 2 */
   25622  | 'c' c     /* rule 3 */
   25623  ;
   25624 
   25625 A: 'a' 'a' 'a' /* rule 4 */
   25626  | 'a' 'a'     /* rule 5 */
   25627  ;
   25628 
   25629 c: 'a' 'a' 'b' /* rule 6 */
   25630  | A           /* rule 7 */
   25631  ;
   25632 
   25633 
   25634 %%
   25635 #include <stdio.h>
   25636 /* A C error reporting function.  */
   25637 static
   25638 void yyerror ( const char *msg)
   25639 {
   25640   fprintf (stderr, "%s\n", msg);
   25641 }
   25642 static int
   25643 yylex (void)
   25644 {
   25645   static int const input[] = {
   25646     'b', 'a', 'a', 'a', 'b', 0
   25647   };
   25648   static int const *inputp = input;
   25649   return *inputp++;
   25650 }
   25651 
   25652 int
   25653 main (void)
   25654 {
   25655   return yyparse ();
   25656 }
   25657 _ATEOF
   25658 
   25659 
   25660 
   25661 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   25662 # expanding macros, so it corrupts some special characters in the
   25663 # macros.  To avoid this, expand now and pass it the result with proper
   25664 # string quotation.  Assume args 7 through 12 expand to properly quoted
   25665 # strings.
   25666 
   25667 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   25668   at_save_special_files
   25669   mkdir xml-tests
   25670     # Don't combine these Bison invocations since we want to be sure that
   25671   # --report=all isn't required to get the full XML file.
   25672   { set +x
   25673 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   25674                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   25675 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707"
   25676 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   25677                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   25678 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25679 at_status=$? at_failed=false
   25680 $at_check_filter
   25681 echo stderr:; cat "$at_stderr"
   25682 echo stdout:; cat "$at_stdout"
   25683 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25684 $at_failed && at_fn_log_failure
   25685 $at_traceon; }
   25686 
   25687   { set +x
   25688 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   25689 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707"
   25690 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   25691 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25692 at_status=$? at_failed=false
   25693 $at_check_filter
   25694 echo stderr:; cat "$at_stderr"
   25695 echo stdout:; cat "$at_stdout"
   25696 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25697 $at_failed && at_fn_log_failure
   25698 $at_traceon; }
   25699 
   25700     cp xml-tests/test.output expout
   25701   { set +x
   25702 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   25703              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   25704              xml-tests/test.xml"
   25705 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   25706 ( $at_check_trace; $XSLTPROC \
   25707              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   25708              xml-tests/test.xml
   25709 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25710 at_status=$? at_failed=false
   25711 $at_check_filter
   25712 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25713 $at_diff expout "$at_stdout" || at_failed=:
   25714 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25715 $at_failed && at_fn_log_failure
   25716 $at_traceon; }
   25717 
   25718   sort xml-tests/test.dot > expout
   25719   { set +x
   25720 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   25721              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   25722              xml-tests/test.xml | sort"
   25723 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   25724 ( $at_check_trace; $XSLTPROC \
   25725              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   25726              xml-tests/test.xml | sort
   25727 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25728 at_status=$? at_failed=false
   25729 $at_check_filter
   25730 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25731 $at_diff expout "$at_stdout" || at_failed=:
   25732 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25733 $at_failed && at_fn_log_failure
   25734 $at_traceon; }
   25735 
   25736   rm -rf xml-tests expout
   25737   at_restore_special_files
   25738 fi
   25739 { set +x
   25740 $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
   25741 at_fn_check_prepare_trace "reduce.at:707"
   25742 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   25743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25744 at_status=$? at_failed=false
   25745 $at_check_filter
   25746 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25747 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25748 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25749 $at_failed && at_fn_log_failure
   25750 $at_traceon; }
   25751 
   25752 
   25753 
   25754 { set +x
   25755 $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output"
   25756 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707"
   25757 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   25758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25759 at_status=$? at_failed=false
   25760 $at_check_filter
   25761 at_fn_diff_devnull "$at_stderr" || at_failed=:
   25762 echo >>"$at_stdout"; $as_echo "State 0
   25763 
   25764     0 \$accept: . S \$end
   25765     1 S: . 'a' A 'a'
   25766     2  | . 'b' A 'b'
   25767     3  | . 'c' c
   25768 
   25769     'a'  shift, and go to state 1
   25770     'b'  shift, and go to state 2
   25771     'c'  shift, and go to state 3
   25772 
   25773     S  go to state 4
   25774 
   25775 
   25776 State 1
   25777 
   25778     1 S: 'a' . A 'a'
   25779     4 A: . 'a' 'a' 'a'
   25780     5  | . 'a' 'a'
   25781 
   25782     'a'  shift, and go to state 5
   25783 
   25784     A  go to state 6
   25785 
   25786 
   25787 State 2
   25788 
   25789     2 S: 'b' . A 'b'
   25790     4 A: . 'a' 'a' 'a'
   25791     5  | . 'a' 'a'
   25792 
   25793     'a'  shift, and go to state 5
   25794 
   25795     A  go to state 7
   25796 
   25797 
   25798 State 3
   25799 
   25800     3 S: 'c' . c
   25801     4 A: . 'a' 'a' 'a'
   25802     5  | . 'a' 'a'
   25803     6 c: . 'a' 'a' 'b'
   25804     7  | . A
   25805 
   25806     'a'  shift, and go to state 8
   25807 
   25808     A  go to state 9
   25809     c  go to state 10
   25810 
   25811 
   25812 State 4
   25813 
   25814     0 \$accept: S . \$end
   25815 
   25816     \$end  shift, and go to state 11
   25817 
   25818 
   25819 State 5
   25820 
   25821     4 A: 'a' . 'a' 'a'
   25822     5  | 'a' . 'a'
   25823 
   25824     'a'  shift, and go to state 12
   25825 
   25826 
   25827 State 6
   25828 
   25829     1 S: 'a' A . 'a'
   25830 
   25831     'a'  shift, and go to state 13
   25832 
   25833 
   25834 State 7
   25835 
   25836     2 S: 'b' A . 'b'
   25837 
   25838     'b'  shift, and go to state 14
   25839 
   25840 
   25841 State 8
   25842 
   25843     4 A: 'a' . 'a' 'a'
   25844     5  | 'a' . 'a'
   25845     6 c: 'a' . 'a' 'b'
   25846 
   25847     'a'  shift, and go to state 15
   25848 
   25849 
   25850 State 9
   25851 
   25852     7 c: A .
   25853 
   25854     \$default  reduce using rule 7 (c)
   25855 
   25856 
   25857 State 10
   25858 
   25859     3 S: 'c' c .
   25860 
   25861     \$default  reduce using rule 3 (S)
   25862 
   25863 
   25864 State 11
   25865 
   25866     0 \$accept: S \$end .
   25867 
   25868     \$default  accept
   25869 
   25870 
   25871 State 12
   25872 
   25873     4 A: 'a' 'a' . 'a'
   25874     5  | 'a' 'a' .  ['a', 'b']
   25875 
   25876     \$default  reduce using rule 5 (A)
   25877 
   25878     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   25879 
   25880 
   25881 State 13
   25882 
   25883     1 S: 'a' A 'a' .
   25884 
   25885     \$default  reduce using rule 1 (S)
   25886 
   25887 
   25888 State 14
   25889 
   25890     2 S: 'b' A 'b' .
   25891 
   25892     \$default  reduce using rule 2 (S)
   25893 
   25894 
   25895 State 15
   25896 
   25897     4 A: 'a' 'a' . 'a'
   25898     5  | 'a' 'a' .  [\$end]
   25899     6 c: 'a' 'a' . 'b'
   25900 
   25901     'a'  shift, and go to state 16
   25902     'b'  shift, and go to state 17
   25903 
   25904     \$default  reduce using rule 5 (A)
   25905 
   25906 
   25907 State 16
   25908 
   25909     4 A: 'a' 'a' 'a' .
   25910 
   25911     \$default  reduce using rule 4 (A)
   25912 
   25913 
   25914 State 17
   25915 
   25916     6 c: 'a' 'a' 'b' .
   25917 
   25918     \$default  reduce using rule 6 (c)
   25919 " | \
   25920   $at_diff - "$at_stdout" || at_failed=:
   25921 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25922 $at_failed && at_fn_log_failure
   25923 $at_traceon; }
   25924 
   25925 
   25926 
   25927 
   25928 # Canonical LR generates very large tables, resulting in very long
   25929 # files with #line directives that may overflow what the standards
   25930 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   25931 # will issue an error.
   25932 #
   25933 # There is no "" around `wc` since some indent the result.
   25934 
   25935 { set +x
   25936 $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS"
   25937 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
   25938 ( $at_check_trace; $BISON_C_WORKS
   25939 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25940 at_status=$? at_failed=false
   25941 $at_check_filter
   25942 echo stderr:; cat "$at_stderr"
   25943 echo stdout:; cat "$at_stdout"
   25944 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25945 $at_failed && at_fn_log_failure
   25946 $at_traceon; }
   25947 
   25948 { set +x
   25949 $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   25950 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707"
   25951 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   25952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25953 at_status=$? at_failed=false
   25954 $at_check_filter
   25955 echo stderr:; cat "$at_stderr"
   25956 echo stdout:; cat "$at_stdout"
   25957 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25958 $at_failed && at_fn_log_failure
   25959 $at_traceon; }
   25960 
   25961 
   25962 { set +x
   25963 $as_echo "$at_srcdir/reduce.at:707:  \$PREPARSER ./input"
   25964 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
   25965 ( $at_check_trace;  $PREPARSER ./input
   25966 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25967 at_status=$? at_failed=false
   25968 $at_check_filter
   25969 echo stderr:; tee stderr <"$at_stderr"
   25970 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25971 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:707"
   25972 $at_failed && at_fn_log_failure
   25973 $at_traceon; }
   25974 
   25975 { set +x
   25976 $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   25977 at_fn_check_prepare_trace "reduce.at:707"
   25978 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   25979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   25980 at_status=$? at_failed=false
   25981 $at_check_filter
   25982 echo >>"$at_stderr"; $as_echo "syntax error
   25983 " | \
   25984   $at_diff - "$at_stderr" || at_failed=:
   25985 at_fn_diff_devnull "$at_stdout" || at_failed=:
   25986 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   25987 $at_failed && at_fn_log_failure
   25988 $at_traceon; }
   25989 
   25990 
   25991 
   25992 
   25993   set +x
   25994   $at_times_p && times >"$at_times_file"
   25995 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   25996 read at_status <"$at_status_file"
   25997 #AT_STOP_113
   25998 #AT_START_114
   25999 at_fn_group_banner 114 'reduce.at:707' \
   26000   "%define lr.type ielr: Lane Split" "               " 6
   26001 at_xfail=no
   26002 (
   26003   $as_echo "114. $at_setup_line: testing $at_desc ..."
   26004   $at_traceon
   26005 
   26006 
   26007 cat >input.y <<'_ATEOF'
   26008 %code top {
   26009 #include <config.h>
   26010 /* We don't need perfect functions for these tests. */
   26011 #undef malloc
   26012 #undef memcmp
   26013 #undef realloc
   26014 }
   26015 
   26016 %code {
   26017   #include <stdio.h>
   26018   static void yyerror ( const char *msg);
   26019   static int yylex (void);
   26020 }
   26021 
   26022 %define lr.type ielr
   26023 %left 'a'
   26024 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   26025 // keep it so that the paser table diff is easier to code.
   26026 %define lr.keep-unreachable-states
   26027 
   26028 %%
   26029 
   26030 
   26031 /* Similar to the last test case set but two states must be split.  */
   26032 S: 'a' A 'a' /* rule 1 */
   26033  | 'b' A 'b' /* rule 2 */
   26034  | 'c' c     /* rule 3 */
   26035  ;
   26036 
   26037 A: 'a' 'a' 'a' /* rule 4 */
   26038  | 'a' 'a'     /* rule 5 */
   26039  ;
   26040 
   26041 c: 'a' 'a' 'b' /* rule 6 */
   26042  | A           /* rule 7 */
   26043  ;
   26044 
   26045 
   26046 %%
   26047 #include <stdio.h>
   26048 /* A C error reporting function.  */
   26049 static
   26050 void yyerror ( const char *msg)
   26051 {
   26052   fprintf (stderr, "%s\n", msg);
   26053 }
   26054 static int
   26055 yylex (void)
   26056 {
   26057   static int const input[] = {
   26058     'b', 'a', 'a', 'a', 'b', 0
   26059   };
   26060   static int const *inputp = input;
   26061   return *inputp++;
   26062 }
   26063 
   26064 int
   26065 main (void)
   26066 {
   26067   return yyparse ();
   26068 }
   26069 _ATEOF
   26070 
   26071 
   26072 
   26073 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   26074 # expanding macros, so it corrupts some special characters in the
   26075 # macros.  To avoid this, expand now and pass it the result with proper
   26076 # string quotation.  Assume args 7 through 12 expand to properly quoted
   26077 # strings.
   26078 
   26079 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   26080   at_save_special_files
   26081   mkdir xml-tests
   26082     # Don't combine these Bison invocations since we want to be sure that
   26083   # --report=all isn't required to get the full XML file.
   26084   { set +x
   26085 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   26086                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   26087 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707"
   26088 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   26089                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   26090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26091 at_status=$? at_failed=false
   26092 $at_check_filter
   26093 echo stderr:; cat "$at_stderr"
   26094 echo stdout:; cat "$at_stdout"
   26095 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26096 $at_failed && at_fn_log_failure
   26097 $at_traceon; }
   26098 
   26099   { set +x
   26100 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   26101 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707"
   26102 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   26103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26104 at_status=$? at_failed=false
   26105 $at_check_filter
   26106 echo stderr:; cat "$at_stderr"
   26107 echo stdout:; cat "$at_stdout"
   26108 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26109 $at_failed && at_fn_log_failure
   26110 $at_traceon; }
   26111 
   26112     cp xml-tests/test.output expout
   26113   { set +x
   26114 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   26115              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   26116              xml-tests/test.xml"
   26117 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   26118 ( $at_check_trace; $XSLTPROC \
   26119              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   26120              xml-tests/test.xml
   26121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26122 at_status=$? at_failed=false
   26123 $at_check_filter
   26124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26125 $at_diff expout "$at_stdout" || at_failed=:
   26126 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26127 $at_failed && at_fn_log_failure
   26128 $at_traceon; }
   26129 
   26130   sort xml-tests/test.dot > expout
   26131   { set +x
   26132 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   26133              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   26134              xml-tests/test.xml | sort"
   26135 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   26136 ( $at_check_trace; $XSLTPROC \
   26137              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   26138              xml-tests/test.xml | sort
   26139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26140 at_status=$? at_failed=false
   26141 $at_check_filter
   26142 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26143 $at_diff expout "$at_stdout" || at_failed=:
   26144 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26145 $at_failed && at_fn_log_failure
   26146 $at_traceon; }
   26147 
   26148   rm -rf xml-tests expout
   26149   at_restore_special_files
   26150 fi
   26151 { set +x
   26152 $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
   26153 at_fn_check_prepare_trace "reduce.at:707"
   26154 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   26155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26156 at_status=$? at_failed=false
   26157 $at_check_filter
   26158 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26159 at_fn_diff_devnull "$at_stdout" || at_failed=:
   26160 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26161 $at_failed && at_fn_log_failure
   26162 $at_traceon; }
   26163 
   26164 
   26165 
   26166 { set +x
   26167 $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output"
   26168 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707"
   26169 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   26170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26171 at_status=$? at_failed=false
   26172 $at_check_filter
   26173 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26174 echo >>"$at_stdout"; $as_echo "State 0
   26175 
   26176     0 \$accept: . S \$end
   26177     1 S: . 'a' A 'a'
   26178     2  | . 'b' A 'b'
   26179     3  | . 'c' c
   26180 
   26181     'a'  shift, and go to state 1
   26182     'b'  shift, and go to state 2
   26183     'c'  shift, and go to state 3
   26184 
   26185     S  go to state 4
   26186 
   26187 
   26188 State 1
   26189 
   26190     1 S: 'a' . A 'a'
   26191     4 A: . 'a' 'a' 'a'
   26192     5  | . 'a' 'a'
   26193 
   26194     'a'  shift, and go to state 5
   26195 
   26196     A  go to state 6
   26197 
   26198 
   26199 State 2
   26200 
   26201     2 S: 'b' . A 'b'
   26202     4 A: . 'a' 'a' 'a'
   26203     5  | . 'a' 'a'
   26204 
   26205     'a'  shift, and go to state 18
   26206 
   26207     A  go to state 7
   26208 
   26209 
   26210 State 3
   26211 
   26212     3 S: 'c' . c
   26213     4 A: . 'a' 'a' 'a'
   26214     5  | . 'a' 'a'
   26215     6 c: . 'a' 'a' 'b'
   26216     7  | . A
   26217 
   26218     'a'  shift, and go to state 8
   26219 
   26220     A  go to state 9
   26221     c  go to state 10
   26222 
   26223 
   26224 State 4
   26225 
   26226     0 \$accept: S . \$end
   26227 
   26228     \$end  shift, and go to state 11
   26229 
   26230 
   26231 State 5
   26232 
   26233     4 A: 'a' . 'a' 'a'
   26234     5  | 'a' . 'a'
   26235 
   26236     'a'  shift, and go to state 12
   26237 
   26238 
   26239 State 6
   26240 
   26241     1 S: 'a' A . 'a'
   26242 
   26243     'a'  shift, and go to state 13
   26244 
   26245 
   26246 State 7
   26247 
   26248     2 S: 'b' A . 'b'
   26249 
   26250     'b'  shift, and go to state 14
   26251 
   26252 
   26253 State 8
   26254 
   26255     4 A: 'a' . 'a' 'a'
   26256     5  | 'a' . 'a'
   26257     6 c: 'a' . 'a' 'b'
   26258 
   26259     'a'  shift, and go to state 15
   26260 
   26261 
   26262 State 9
   26263 
   26264     7 c: A .
   26265 
   26266     \$default  reduce using rule 7 (c)
   26267 
   26268 
   26269 State 10
   26270 
   26271     3 S: 'c' c .
   26272 
   26273     \$default  reduce using rule 3 (S)
   26274 
   26275 
   26276 State 11
   26277 
   26278     0 \$accept: S \$end .
   26279 
   26280     \$default  accept
   26281 
   26282 
   26283 State 12
   26284 
   26285     4 A: 'a' 'a' . 'a'
   26286     5  | 'a' 'a' .  ['a']
   26287 
   26288     \$default  reduce using rule 5 (A)
   26289 
   26290     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   26291 
   26292 
   26293 State 13
   26294 
   26295     1 S: 'a' A 'a' .
   26296 
   26297     \$default  reduce using rule 1 (S)
   26298 
   26299 
   26300 State 14
   26301 
   26302     2 S: 'b' A 'b' .
   26303 
   26304     \$default  reduce using rule 2 (S)
   26305 
   26306 
   26307 State 15
   26308 
   26309     4 A: 'a' 'a' . 'a'
   26310     5  | 'a' 'a' .  [\$end]
   26311     6 c: 'a' 'a' . 'b'
   26312 
   26313     'a'  shift, and go to state 16
   26314     'b'  shift, and go to state 17
   26315 
   26316     \$default  reduce using rule 5 (A)
   26317 
   26318 
   26319 State 16
   26320 
   26321     4 A: 'a' 'a' 'a' .
   26322 
   26323     \$default  reduce using rule 4 (A)
   26324 
   26325 
   26326 State 17
   26327 
   26328     6 c: 'a' 'a' 'b' .
   26329 
   26330     \$default  reduce using rule 6 (c)
   26331 
   26332 
   26333 State 18
   26334 
   26335     4 A: 'a' . 'a' 'a'
   26336     5  | 'a' . 'a'
   26337 
   26338     'a'  shift, and go to state 19
   26339 
   26340 
   26341 State 19
   26342 
   26343     4 A: 'a' 'a' . 'a'
   26344     5  | 'a' 'a' .  ['b']
   26345 
   26346     'a'  shift, and go to state 16
   26347 
   26348     \$default  reduce using rule 5 (A)
   26349 " | \
   26350   $at_diff - "$at_stdout" || at_failed=:
   26351 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26352 $at_failed && at_fn_log_failure
   26353 $at_traceon; }
   26354 
   26355 
   26356 
   26357 
   26358 # Canonical LR generates very large tables, resulting in very long
   26359 # files with #line directives that may overflow what the standards
   26360 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   26361 # will issue an error.
   26362 #
   26363 # There is no "" around `wc` since some indent the result.
   26364 
   26365 { set +x
   26366 $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS"
   26367 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
   26368 ( $at_check_trace; $BISON_C_WORKS
   26369 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26370 at_status=$? at_failed=false
   26371 $at_check_filter
   26372 echo stderr:; cat "$at_stderr"
   26373 echo stdout:; cat "$at_stdout"
   26374 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26375 $at_failed && at_fn_log_failure
   26376 $at_traceon; }
   26377 
   26378 { set +x
   26379 $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   26380 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707"
   26381 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   26382 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26383 at_status=$? at_failed=false
   26384 $at_check_filter
   26385 echo stderr:; cat "$at_stderr"
   26386 echo stdout:; cat "$at_stdout"
   26387 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26388 $at_failed && at_fn_log_failure
   26389 $at_traceon; }
   26390 
   26391 
   26392 { set +x
   26393 $as_echo "$at_srcdir/reduce.at:707:  \$PREPARSER ./input"
   26394 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
   26395 ( $at_check_trace;  $PREPARSER ./input
   26396 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26397 at_status=$? at_failed=false
   26398 $at_check_filter
   26399 echo stderr:; tee stderr <"$at_stderr"
   26400 at_fn_diff_devnull "$at_stdout" || at_failed=:
   26401 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26402 $at_failed && at_fn_log_failure
   26403 $at_traceon; }
   26404 
   26405 { set +x
   26406 $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   26407 at_fn_check_prepare_trace "reduce.at:707"
   26408 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   26409 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26410 at_status=$? at_failed=false
   26411 $at_check_filter
   26412 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26413 at_fn_diff_devnull "$at_stdout" || at_failed=:
   26414 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26415 $at_failed && at_fn_log_failure
   26416 $at_traceon; }
   26417 
   26418 
   26419 
   26420 
   26421   set +x
   26422   $at_times_p && times >"$at_times_file"
   26423 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   26424 read at_status <"$at_status_file"
   26425 #AT_STOP_114
   26426 #AT_START_115
   26427 at_fn_group_banner 115 'reduce.at:707' \
   26428   "%define lr.type canonical-lr: Lane Split" "       " 6
   26429 at_xfail=no
   26430 (
   26431   $as_echo "115. $at_setup_line: testing $at_desc ..."
   26432   $at_traceon
   26433 
   26434 
   26435 cat >input.y <<'_ATEOF'
   26436 %code top {
   26437 #include <config.h>
   26438 /* We don't need perfect functions for these tests. */
   26439 #undef malloc
   26440 #undef memcmp
   26441 #undef realloc
   26442 }
   26443 
   26444 %code {
   26445   #include <stdio.h>
   26446   static void yyerror ( const char *msg);
   26447   static int yylex (void);
   26448 }
   26449 
   26450 %define lr.type canonical-lr
   26451 %left 'a'
   26452 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   26453 // keep it so that the paser table diff is easier to code.
   26454 %define lr.keep-unreachable-states
   26455 
   26456 %%
   26457 
   26458 
   26459 /* Similar to the last test case set but two states must be split.  */
   26460 S: 'a' A 'a' /* rule 1 */
   26461  | 'b' A 'b' /* rule 2 */
   26462  | 'c' c     /* rule 3 */
   26463  ;
   26464 
   26465 A: 'a' 'a' 'a' /* rule 4 */
   26466  | 'a' 'a'     /* rule 5 */
   26467  ;
   26468 
   26469 c: 'a' 'a' 'b' /* rule 6 */
   26470  | A           /* rule 7 */
   26471  ;
   26472 
   26473 
   26474 %%
   26475 #include <stdio.h>
   26476 /* A C error reporting function.  */
   26477 static
   26478 void yyerror ( const char *msg)
   26479 {
   26480   fprintf (stderr, "%s\n", msg);
   26481 }
   26482 static int
   26483 yylex (void)
   26484 {
   26485   static int const input[] = {
   26486     'b', 'a', 'a', 'a', 'b', 0
   26487   };
   26488   static int const *inputp = input;
   26489   return *inputp++;
   26490 }
   26491 
   26492 int
   26493 main (void)
   26494 {
   26495   return yyparse ();
   26496 }
   26497 _ATEOF
   26498 
   26499 
   26500 
   26501 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   26502 # expanding macros, so it corrupts some special characters in the
   26503 # macros.  To avoid this, expand now and pass it the result with proper
   26504 # string quotation.  Assume args 7 through 12 expand to properly quoted
   26505 # strings.
   26506 
   26507 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   26508   at_save_special_files
   26509   mkdir xml-tests
   26510     # Don't combine these Bison invocations since we want to be sure that
   26511   # --report=all isn't required to get the full XML file.
   26512   { set +x
   26513 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   26514                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   26515 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:707"
   26516 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   26517                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   26518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26519 at_status=$? at_failed=false
   26520 $at_check_filter
   26521 echo stderr:; cat "$at_stderr"
   26522 echo stdout:; cat "$at_stdout"
   26523 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26524 $at_failed && at_fn_log_failure
   26525 $at_traceon; }
   26526 
   26527   { set +x
   26528 $as_echo "$at_srcdir/reduce.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   26529 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:707"
   26530 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   26531 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26532 at_status=$? at_failed=false
   26533 $at_check_filter
   26534 echo stderr:; cat "$at_stderr"
   26535 echo stdout:; cat "$at_stdout"
   26536 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26537 $at_failed && at_fn_log_failure
   26538 $at_traceon; }
   26539 
   26540     cp xml-tests/test.output expout
   26541   { set +x
   26542 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   26543              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   26544              xml-tests/test.xml"
   26545 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   26546 ( $at_check_trace; $XSLTPROC \
   26547              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   26548              xml-tests/test.xml
   26549 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26550 at_status=$? at_failed=false
   26551 $at_check_filter
   26552 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26553 $at_diff expout "$at_stdout" || at_failed=:
   26554 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26555 $at_failed && at_fn_log_failure
   26556 $at_traceon; }
   26557 
   26558   sort xml-tests/test.dot > expout
   26559   { set +x
   26560 $as_echo "$at_srcdir/reduce.at:707: \$XSLTPROC \\
   26561              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   26562              xml-tests/test.xml | sort"
   26563 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:707"
   26564 ( $at_check_trace; $XSLTPROC \
   26565              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   26566              xml-tests/test.xml | sort
   26567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26568 at_status=$? at_failed=false
   26569 $at_check_filter
   26570 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26571 $at_diff expout "$at_stdout" || at_failed=:
   26572 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26573 $at_failed && at_fn_log_failure
   26574 $at_traceon; }
   26575 
   26576   rm -rf xml-tests expout
   26577   at_restore_special_files
   26578 fi
   26579 { set +x
   26580 $as_echo "$at_srcdir/reduce.at:707: bison --report=all --defines -o input.c input.y"
   26581 at_fn_check_prepare_trace "reduce.at:707"
   26582 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   26583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26584 at_status=$? at_failed=false
   26585 $at_check_filter
   26586 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26587 at_fn_diff_devnull "$at_stdout" || at_failed=:
   26588 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26589 $at_failed && at_fn_log_failure
   26590 $at_traceon; }
   26591 
   26592 
   26593 
   26594 { set +x
   26595 $as_echo "$at_srcdir/reduce.at:707: sed -n '/^State 0\$/,\$p' input.output"
   26596 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:707"
   26597 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   26598 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26599 at_status=$? at_failed=false
   26600 $at_check_filter
   26601 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26602 echo >>"$at_stdout"; $as_echo "State 0
   26603 
   26604     0 \$accept: . S \$end
   26605     1 S: . 'a' A 'a'
   26606     2  | . 'b' A 'b'
   26607     3  | . 'c' c
   26608 
   26609     'a'  shift, and go to state 1
   26610     'b'  shift, and go to state 2
   26611     'c'  shift, and go to state 3
   26612 
   26613     S  go to state 4
   26614 
   26615 
   26616 State 1
   26617 
   26618     1 S: 'a' . A 'a'
   26619     4 A: . 'a' 'a' 'a'
   26620     5  | . 'a' 'a'
   26621 
   26622     'a'  shift, and go to state 5
   26623 
   26624     A  go to state 6
   26625 
   26626 
   26627 State 2
   26628 
   26629     2 S: 'b' . A 'b'
   26630     4 A: . 'a' 'a' 'a'
   26631     5  | . 'a' 'a'
   26632 
   26633     'a'  shift, and go to state 18
   26634 
   26635     A  go to state 7
   26636 
   26637 
   26638 State 3
   26639 
   26640     3 S: 'c' . c
   26641     4 A: . 'a' 'a' 'a'
   26642     5  | . 'a' 'a'
   26643     6 c: . 'a' 'a' 'b'
   26644     7  | . A
   26645 
   26646     'a'  shift, and go to state 8
   26647 
   26648     A  go to state 9
   26649     c  go to state 10
   26650 
   26651 
   26652 State 4
   26653 
   26654     0 \$accept: S . \$end
   26655 
   26656     \$end  shift, and go to state 11
   26657 
   26658 
   26659 State 5
   26660 
   26661     4 A: 'a' . 'a' 'a'
   26662     5  | 'a' . 'a'
   26663 
   26664     'a'  shift, and go to state 12
   26665 
   26666 
   26667 State 6
   26668 
   26669     1 S: 'a' A . 'a'
   26670 
   26671     'a'  shift, and go to state 13
   26672 
   26673 
   26674 State 7
   26675 
   26676     2 S: 'b' A . 'b'
   26677 
   26678     'b'  shift, and go to state 14
   26679 
   26680 
   26681 State 8
   26682 
   26683     4 A: 'a' . 'a' 'a'
   26684     5  | 'a' . 'a'
   26685     6 c: 'a' . 'a' 'b'
   26686 
   26687     'a'  shift, and go to state 15
   26688 
   26689 
   26690 State 9
   26691 
   26692     7 c: A .  [\$end]
   26693 
   26694     \$end  reduce using rule 7 (c)
   26695 
   26696 
   26697 State 10
   26698 
   26699     3 S: 'c' c .  [\$end]
   26700 
   26701     \$end  reduce using rule 3 (S)
   26702 
   26703 
   26704 State 11
   26705 
   26706     0 \$accept: S \$end .
   26707 
   26708     \$default  accept
   26709 
   26710 
   26711 State 12
   26712 
   26713     4 A: 'a' 'a' . 'a'
   26714     5  | 'a' 'a' .  ['a']
   26715 
   26716     'a'  reduce using rule 5 (A)
   26717 
   26718     Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
   26719 
   26720 
   26721 State 13
   26722 
   26723     1 S: 'a' A 'a' .  [\$end]
   26724 
   26725     \$end  reduce using rule 1 (S)
   26726 
   26727 
   26728 State 14
   26729 
   26730     2 S: 'b' A 'b' .  [\$end]
   26731 
   26732     \$end  reduce using rule 2 (S)
   26733 
   26734 
   26735 State 15
   26736 
   26737     4 A: 'a' 'a' . 'a'
   26738     5  | 'a' 'a' .  [\$end]
   26739     6 c: 'a' 'a' . 'b'
   26740 
   26741     'a'  shift, and go to state 19
   26742     'b'  shift, and go to state 17
   26743 
   26744     \$end  reduce using rule 5 (A)
   26745 
   26746 
   26747 State 16
   26748 
   26749     4 A: 'a' 'a' 'a' .  ['a']
   26750 
   26751     'a'  reduce using rule 4 (A)
   26752 
   26753 
   26754 State 17
   26755 
   26756     6 c: 'a' 'a' 'b' .  [\$end]
   26757 
   26758     \$end  reduce using rule 6 (c)
   26759 
   26760 
   26761 State 18
   26762 
   26763     4 A: 'a' . 'a' 'a'
   26764     5  | 'a' . 'a'
   26765 
   26766     'a'  shift, and go to state 20
   26767 
   26768 
   26769 State 19
   26770 
   26771     4 A: 'a' 'a' 'a' .  [\$end]
   26772 
   26773     \$end  reduce using rule 4 (A)
   26774 
   26775 
   26776 State 20
   26777 
   26778     4 A: 'a' 'a' . 'a'
   26779     5  | 'a' 'a' .  ['b']
   26780 
   26781     'a'  shift, and go to state 21
   26782 
   26783     'b'  reduce using rule 5 (A)
   26784 
   26785 
   26786 State 21
   26787 
   26788     4 A: 'a' 'a' 'a' .  ['b']
   26789 
   26790     'b'  reduce using rule 4 (A)
   26791 " | \
   26792   $at_diff - "$at_stdout" || at_failed=:
   26793 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26794 $at_failed && at_fn_log_failure
   26795 $at_traceon; }
   26796 
   26797 
   26798 
   26799 
   26800 # Canonical LR generates very large tables, resulting in very long
   26801 # files with #line directives that may overflow what the standards
   26802 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   26803 # will issue an error.
   26804 #
   26805 # There is no "" around `wc` since some indent the result.
   26806 if test 32767 -lt `wc -l < input.c`; then
   26807   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   26808   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   26809 fi
   26810 { set +x
   26811 $as_echo "$at_srcdir/reduce.at:707: \$BISON_C_WORKS"
   26812 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:707"
   26813 ( $at_check_trace; $BISON_C_WORKS
   26814 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26815 at_status=$? at_failed=false
   26816 $at_check_filter
   26817 echo stderr:; cat "$at_stderr"
   26818 echo stdout:; cat "$at_stdout"
   26819 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26820 $at_failed && at_fn_log_failure
   26821 $at_traceon; }
   26822 
   26823 { set +x
   26824 $as_echo "$at_srcdir/reduce.at:707: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   26825 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:707"
   26826 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   26827 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26828 at_status=$? at_failed=false
   26829 $at_check_filter
   26830 echo stderr:; cat "$at_stderr"
   26831 echo stdout:; cat "$at_stdout"
   26832 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26833 $at_failed && at_fn_log_failure
   26834 $at_traceon; }
   26835 
   26836 
   26837 { set +x
   26838 $as_echo "$at_srcdir/reduce.at:707:  \$PREPARSER ./input"
   26839 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:707"
   26840 ( $at_check_trace;  $PREPARSER ./input
   26841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26842 at_status=$? at_failed=false
   26843 $at_check_filter
   26844 echo stderr:; tee stderr <"$at_stderr"
   26845 at_fn_diff_devnull "$at_stdout" || at_failed=:
   26846 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26847 $at_failed && at_fn_log_failure
   26848 $at_traceon; }
   26849 
   26850 { set +x
   26851 $as_echo "$at_srcdir/reduce.at:707: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   26852 at_fn_check_prepare_trace "reduce.at:707"
   26853 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   26854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26855 at_status=$? at_failed=false
   26856 $at_check_filter
   26857 at_fn_diff_devnull "$at_stderr" || at_failed=:
   26858 at_fn_diff_devnull "$at_stdout" || at_failed=:
   26859 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:707"
   26860 $at_failed && at_fn_log_failure
   26861 $at_traceon; }
   26862 
   26863 
   26864 
   26865 
   26866   set +x
   26867   $at_times_p && times >"$at_times_file"
   26868 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   26869 read at_status <"$at_status_file"
   26870 #AT_STOP_115
   26871 #AT_START_116
   26872 at_fn_group_banner 116 'reduce.at:951' \
   26873   "no %define lr.type: Complex Lane Split" "         " 6
   26874 at_xfail=no
   26875 (
   26876   $as_echo "116. $at_setup_line: testing $at_desc ..."
   26877   $at_traceon
   26878 
   26879 
   26880 cat >input.y <<'_ATEOF'
   26881 %code top {
   26882 #include <config.h>
   26883 /* We don't need perfect functions for these tests. */
   26884 #undef malloc
   26885 #undef memcmp
   26886 #undef realloc
   26887 }
   26888 
   26889 %code {
   26890   #include <stdio.h>
   26891   static void yyerror ( const char *msg);
   26892   static int yylex (void);
   26893 }
   26894 
   26895 %left 'a'
   26896 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   26897 // keep it so that the paser table diff is easier to code.
   26898 %define lr.keep-unreachable-states
   26899 
   26900 %%
   26901 
   26902 
   26903 /* Similar to the last test case set but forseeing the S/R conflict from the
   26904    first state that must be split is becoming difficult.  Imagine if B were
   26905    even more complex.  Imagine if A had other RHS's ending in other
   26906    nonterminals.  */
   26907 S: 'a' A 'a'
   26908  | 'b' A 'b'
   26909  | 'c' c
   26910  ;
   26911 A: 'a' 'a' B
   26912  ;
   26913 B: 'a'
   26914  | %prec 'a'
   26915  ;
   26916 c: 'a' 'a' 'b'
   26917  | A
   26918  ;
   26919 
   26920 
   26921 %%
   26922 #include <stdio.h>
   26923 /* A C error reporting function.  */
   26924 static
   26925 void yyerror ( const char *msg)
   26926 {
   26927   fprintf (stderr, "%s\n", msg);
   26928 }
   26929 static int
   26930 yylex (void)
   26931 {
   26932   static int const input[] = {
   26933     'b', 'a', 'a', 'a', 'b', 0
   26934   };
   26935   static int const *inputp = input;
   26936   return *inputp++;
   26937 }
   26938 
   26939 int
   26940 main (void)
   26941 {
   26942   return yyparse ();
   26943 }
   26944 _ATEOF
   26945 
   26946 
   26947 
   26948 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   26949 # expanding macros, so it corrupts some special characters in the
   26950 # macros.  To avoid this, expand now and pass it the result with proper
   26951 # string quotation.  Assume args 7 through 12 expand to properly quoted
   26952 # strings.
   26953 
   26954 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   26955   at_save_special_files
   26956   mkdir xml-tests
   26957     # Don't combine these Bison invocations since we want to be sure that
   26958   # --report=all isn't required to get the full XML file.
   26959   { set +x
   26960 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   26961                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   26962 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951"
   26963 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   26964                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   26965 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26966 at_status=$? at_failed=false
   26967 $at_check_filter
   26968 echo stderr:; cat "$at_stderr"
   26969 echo stdout:; cat "$at_stdout"
   26970 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   26971 $at_failed && at_fn_log_failure
   26972 $at_traceon; }
   26973 
   26974   { set +x
   26975 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   26976 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951"
   26977 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   26978 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26979 at_status=$? at_failed=false
   26980 $at_check_filter
   26981 echo stderr:; cat "$at_stderr"
   26982 echo stdout:; cat "$at_stdout"
   26983 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   26984 $at_failed && at_fn_log_failure
   26985 $at_traceon; }
   26986 
   26987     cp xml-tests/test.output expout
   26988   { set +x
   26989 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   26990              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   26991              xml-tests/test.xml"
   26992 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   26993 ( $at_check_trace; $XSLTPROC \
   26994              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   26995              xml-tests/test.xml
   26996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   26997 at_status=$? at_failed=false
   26998 $at_check_filter
   26999 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27000 $at_diff expout "$at_stdout" || at_failed=:
   27001 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27002 $at_failed && at_fn_log_failure
   27003 $at_traceon; }
   27004 
   27005   sort xml-tests/test.dot > expout
   27006   { set +x
   27007 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   27008              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   27009              xml-tests/test.xml | sort"
   27010 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   27011 ( $at_check_trace; $XSLTPROC \
   27012              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   27013              xml-tests/test.xml | sort
   27014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27015 at_status=$? at_failed=false
   27016 $at_check_filter
   27017 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27018 $at_diff expout "$at_stdout" || at_failed=:
   27019 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27020 $at_failed && at_fn_log_failure
   27021 $at_traceon; }
   27022 
   27023   rm -rf xml-tests expout
   27024   at_restore_special_files
   27025 fi
   27026 { set +x
   27027 $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
   27028 at_fn_check_prepare_trace "reduce.at:951"
   27029 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   27030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27031 at_status=$? at_failed=false
   27032 $at_check_filter
   27033 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27034 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27035 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27036 $at_failed && at_fn_log_failure
   27037 $at_traceon; }
   27038 
   27039 
   27040 
   27041 { set +x
   27042 $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output"
   27043 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951"
   27044 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   27045 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27046 at_status=$? at_failed=false
   27047 $at_check_filter
   27048 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27049 echo >>"$at_stdout"; $as_echo "State 0
   27050 
   27051     0 \$accept: . S \$end
   27052     1 S: . 'a' A 'a'
   27053     2  | . 'b' A 'b'
   27054     3  | . 'c' c
   27055 
   27056     'a'  shift, and go to state 1
   27057     'b'  shift, and go to state 2
   27058     'c'  shift, and go to state 3
   27059 
   27060     S  go to state 4
   27061 
   27062 
   27063 State 1
   27064 
   27065     1 S: 'a' . A 'a'
   27066     4 A: . 'a' 'a' B
   27067 
   27068     'a'  shift, and go to state 5
   27069 
   27070     A  go to state 6
   27071 
   27072 
   27073 State 2
   27074 
   27075     2 S: 'b' . A 'b'
   27076     4 A: . 'a' 'a' B
   27077 
   27078     'a'  shift, and go to state 5
   27079 
   27080     A  go to state 7
   27081 
   27082 
   27083 State 3
   27084 
   27085     3 S: 'c' . c
   27086     4 A: . 'a' 'a' B
   27087     7 c: . 'a' 'a' 'b'
   27088     8  | . A
   27089 
   27090     'a'  shift, and go to state 8
   27091 
   27092     A  go to state 9
   27093     c  go to state 10
   27094 
   27095 
   27096 State 4
   27097 
   27098     0 \$accept: S . \$end
   27099 
   27100     \$end  shift, and go to state 11
   27101 
   27102 
   27103 State 5
   27104 
   27105     4 A: 'a' . 'a' B
   27106 
   27107     'a'  shift, and go to state 12
   27108 
   27109 
   27110 State 6
   27111 
   27112     1 S: 'a' A . 'a'
   27113 
   27114     'a'  shift, and go to state 13
   27115 
   27116 
   27117 State 7
   27118 
   27119     2 S: 'b' A . 'b'
   27120 
   27121     'b'  shift, and go to state 14
   27122 
   27123 
   27124 State 8
   27125 
   27126     4 A: 'a' . 'a' B
   27127     7 c: 'a' . 'a' 'b'
   27128 
   27129     'a'  shift, and go to state 15
   27130 
   27131 
   27132 State 9
   27133 
   27134     8 c: A .
   27135 
   27136     \$default  reduce using rule 8 (c)
   27137 
   27138 
   27139 State 10
   27140 
   27141     3 S: 'c' c .
   27142 
   27143     \$default  reduce using rule 3 (S)
   27144 
   27145 
   27146 State 11
   27147 
   27148     0 \$accept: S \$end .
   27149 
   27150     \$default  accept
   27151 
   27152 
   27153 State 12
   27154 
   27155     4 A: 'a' 'a' . B
   27156     5 B: . 'a'
   27157     6  | .  ['a', 'b']
   27158 
   27159     \$default  reduce using rule 6 (B)
   27160 
   27161     B  go to state 17
   27162 
   27163     Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
   27164 
   27165 
   27166 State 13
   27167 
   27168     1 S: 'a' A 'a' .
   27169 
   27170     \$default  reduce using rule 1 (S)
   27171 
   27172 
   27173 State 14
   27174 
   27175     2 S: 'b' A 'b' .
   27176 
   27177     \$default  reduce using rule 2 (S)
   27178 
   27179 
   27180 State 15
   27181 
   27182     4 A: 'a' 'a' . B
   27183     5 B: . 'a'
   27184     6  | .  [\$end]
   27185     7 c: 'a' 'a' . 'b'
   27186 
   27187     'a'  shift, and go to state 16
   27188     'b'  shift, and go to state 18
   27189 
   27190     \$default  reduce using rule 6 (B)
   27191 
   27192     B  go to state 17
   27193 
   27194 
   27195 State 16
   27196 
   27197     5 B: 'a' .
   27198 
   27199     \$default  reduce using rule 5 (B)
   27200 
   27201 
   27202 State 17
   27203 
   27204     4 A: 'a' 'a' B .
   27205 
   27206     \$default  reduce using rule 4 (A)
   27207 
   27208 
   27209 State 18
   27210 
   27211     7 c: 'a' 'a' 'b' .
   27212 
   27213     \$default  reduce using rule 7 (c)
   27214 " | \
   27215   $at_diff - "$at_stdout" || at_failed=:
   27216 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27217 $at_failed && at_fn_log_failure
   27218 $at_traceon; }
   27219 
   27220 
   27221 
   27222 
   27223 # Canonical LR generates very large tables, resulting in very long
   27224 # files with #line directives that may overflow what the standards
   27225 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   27226 # will issue an error.
   27227 #
   27228 # There is no "" around `wc` since some indent the result.
   27229 
   27230 { set +x
   27231 $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS"
   27232 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
   27233 ( $at_check_trace; $BISON_C_WORKS
   27234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27235 at_status=$? at_failed=false
   27236 $at_check_filter
   27237 echo stderr:; cat "$at_stderr"
   27238 echo stdout:; cat "$at_stdout"
   27239 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27240 $at_failed && at_fn_log_failure
   27241 $at_traceon; }
   27242 
   27243 { set +x
   27244 $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   27245 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951"
   27246 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   27247 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27248 at_status=$? at_failed=false
   27249 $at_check_filter
   27250 echo stderr:; cat "$at_stderr"
   27251 echo stdout:; cat "$at_stdout"
   27252 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27253 $at_failed && at_fn_log_failure
   27254 $at_traceon; }
   27255 
   27256 
   27257 { set +x
   27258 $as_echo "$at_srcdir/reduce.at:951:  \$PREPARSER ./input"
   27259 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
   27260 ( $at_check_trace;  $PREPARSER ./input
   27261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27262 at_status=$? at_failed=false
   27263 $at_check_filter
   27264 echo stderr:; tee stderr <"$at_stderr"
   27265 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27266 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:951"
   27267 $at_failed && at_fn_log_failure
   27268 $at_traceon; }
   27269 
   27270 { set +x
   27271 $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   27272 at_fn_check_prepare_trace "reduce.at:951"
   27273 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   27274 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27275 at_status=$? at_failed=false
   27276 $at_check_filter
   27277 echo >>"$at_stderr"; $as_echo "syntax error
   27278 " | \
   27279   $at_diff - "$at_stderr" || at_failed=:
   27280 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27281 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27282 $at_failed && at_fn_log_failure
   27283 $at_traceon; }
   27284 
   27285 
   27286 
   27287 
   27288   set +x
   27289   $at_times_p && times >"$at_times_file"
   27290 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   27291 read at_status <"$at_status_file"
   27292 #AT_STOP_116
   27293 #AT_START_117
   27294 at_fn_group_banner 117 'reduce.at:951' \
   27295   "%define lr.type lalr: Complex Lane Split" "       " 6
   27296 at_xfail=no
   27297 (
   27298   $as_echo "117. $at_setup_line: testing $at_desc ..."
   27299   $at_traceon
   27300 
   27301 
   27302 cat >input.y <<'_ATEOF'
   27303 %code top {
   27304 #include <config.h>
   27305 /* We don't need perfect functions for these tests. */
   27306 #undef malloc
   27307 #undef memcmp
   27308 #undef realloc
   27309 }
   27310 
   27311 %code {
   27312   #include <stdio.h>
   27313   static void yyerror ( const char *msg);
   27314   static int yylex (void);
   27315 }
   27316 
   27317 %define lr.type lalr
   27318 %left 'a'
   27319 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   27320 // keep it so that the paser table diff is easier to code.
   27321 %define lr.keep-unreachable-states
   27322 
   27323 %%
   27324 
   27325 
   27326 /* Similar to the last test case set but forseeing the S/R conflict from the
   27327    first state that must be split is becoming difficult.  Imagine if B were
   27328    even more complex.  Imagine if A had other RHS's ending in other
   27329    nonterminals.  */
   27330 S: 'a' A 'a'
   27331  | 'b' A 'b'
   27332  | 'c' c
   27333  ;
   27334 A: 'a' 'a' B
   27335  ;
   27336 B: 'a'
   27337  | %prec 'a'
   27338  ;
   27339 c: 'a' 'a' 'b'
   27340  | A
   27341  ;
   27342 
   27343 
   27344 %%
   27345 #include <stdio.h>
   27346 /* A C error reporting function.  */
   27347 static
   27348 void yyerror ( const char *msg)
   27349 {
   27350   fprintf (stderr, "%s\n", msg);
   27351 }
   27352 static int
   27353 yylex (void)
   27354 {
   27355   static int const input[] = {
   27356     'b', 'a', 'a', 'a', 'b', 0
   27357   };
   27358   static int const *inputp = input;
   27359   return *inputp++;
   27360 }
   27361 
   27362 int
   27363 main (void)
   27364 {
   27365   return yyparse ();
   27366 }
   27367 _ATEOF
   27368 
   27369 
   27370 
   27371 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   27372 # expanding macros, so it corrupts some special characters in the
   27373 # macros.  To avoid this, expand now and pass it the result with proper
   27374 # string quotation.  Assume args 7 through 12 expand to properly quoted
   27375 # strings.
   27376 
   27377 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   27378   at_save_special_files
   27379   mkdir xml-tests
   27380     # Don't combine these Bison invocations since we want to be sure that
   27381   # --report=all isn't required to get the full XML file.
   27382   { set +x
   27383 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   27384                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   27385 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951"
   27386 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   27387                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   27388 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27389 at_status=$? at_failed=false
   27390 $at_check_filter
   27391 echo stderr:; cat "$at_stderr"
   27392 echo stdout:; cat "$at_stdout"
   27393 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27394 $at_failed && at_fn_log_failure
   27395 $at_traceon; }
   27396 
   27397   { set +x
   27398 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   27399 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951"
   27400 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   27401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27402 at_status=$? at_failed=false
   27403 $at_check_filter
   27404 echo stderr:; cat "$at_stderr"
   27405 echo stdout:; cat "$at_stdout"
   27406 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27407 $at_failed && at_fn_log_failure
   27408 $at_traceon; }
   27409 
   27410     cp xml-tests/test.output expout
   27411   { set +x
   27412 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   27413              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   27414              xml-tests/test.xml"
   27415 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   27416 ( $at_check_trace; $XSLTPROC \
   27417              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   27418              xml-tests/test.xml
   27419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27420 at_status=$? at_failed=false
   27421 $at_check_filter
   27422 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27423 $at_diff expout "$at_stdout" || at_failed=:
   27424 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27425 $at_failed && at_fn_log_failure
   27426 $at_traceon; }
   27427 
   27428   sort xml-tests/test.dot > expout
   27429   { set +x
   27430 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   27431              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   27432              xml-tests/test.xml | sort"
   27433 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   27434 ( $at_check_trace; $XSLTPROC \
   27435              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   27436              xml-tests/test.xml | sort
   27437 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27438 at_status=$? at_failed=false
   27439 $at_check_filter
   27440 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27441 $at_diff expout "$at_stdout" || at_failed=:
   27442 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27443 $at_failed && at_fn_log_failure
   27444 $at_traceon; }
   27445 
   27446   rm -rf xml-tests expout
   27447   at_restore_special_files
   27448 fi
   27449 { set +x
   27450 $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
   27451 at_fn_check_prepare_trace "reduce.at:951"
   27452 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   27453 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27454 at_status=$? at_failed=false
   27455 $at_check_filter
   27456 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27457 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27458 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27459 $at_failed && at_fn_log_failure
   27460 $at_traceon; }
   27461 
   27462 
   27463 
   27464 { set +x
   27465 $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output"
   27466 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951"
   27467 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   27468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27469 at_status=$? at_failed=false
   27470 $at_check_filter
   27471 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27472 echo >>"$at_stdout"; $as_echo "State 0
   27473 
   27474     0 \$accept: . S \$end
   27475     1 S: . 'a' A 'a'
   27476     2  | . 'b' A 'b'
   27477     3  | . 'c' c
   27478 
   27479     'a'  shift, and go to state 1
   27480     'b'  shift, and go to state 2
   27481     'c'  shift, and go to state 3
   27482 
   27483     S  go to state 4
   27484 
   27485 
   27486 State 1
   27487 
   27488     1 S: 'a' . A 'a'
   27489     4 A: . 'a' 'a' B
   27490 
   27491     'a'  shift, and go to state 5
   27492 
   27493     A  go to state 6
   27494 
   27495 
   27496 State 2
   27497 
   27498     2 S: 'b' . A 'b'
   27499     4 A: . 'a' 'a' B
   27500 
   27501     'a'  shift, and go to state 5
   27502 
   27503     A  go to state 7
   27504 
   27505 
   27506 State 3
   27507 
   27508     3 S: 'c' . c
   27509     4 A: . 'a' 'a' B
   27510     7 c: . 'a' 'a' 'b'
   27511     8  | . A
   27512 
   27513     'a'  shift, and go to state 8
   27514 
   27515     A  go to state 9
   27516     c  go to state 10
   27517 
   27518 
   27519 State 4
   27520 
   27521     0 \$accept: S . \$end
   27522 
   27523     \$end  shift, and go to state 11
   27524 
   27525 
   27526 State 5
   27527 
   27528     4 A: 'a' . 'a' B
   27529 
   27530     'a'  shift, and go to state 12
   27531 
   27532 
   27533 State 6
   27534 
   27535     1 S: 'a' A . 'a'
   27536 
   27537     'a'  shift, and go to state 13
   27538 
   27539 
   27540 State 7
   27541 
   27542     2 S: 'b' A . 'b'
   27543 
   27544     'b'  shift, and go to state 14
   27545 
   27546 
   27547 State 8
   27548 
   27549     4 A: 'a' . 'a' B
   27550     7 c: 'a' . 'a' 'b'
   27551 
   27552     'a'  shift, and go to state 15
   27553 
   27554 
   27555 State 9
   27556 
   27557     8 c: A .
   27558 
   27559     \$default  reduce using rule 8 (c)
   27560 
   27561 
   27562 State 10
   27563 
   27564     3 S: 'c' c .
   27565 
   27566     \$default  reduce using rule 3 (S)
   27567 
   27568 
   27569 State 11
   27570 
   27571     0 \$accept: S \$end .
   27572 
   27573     \$default  accept
   27574 
   27575 
   27576 State 12
   27577 
   27578     4 A: 'a' 'a' . B
   27579     5 B: . 'a'
   27580     6  | .  ['a', 'b']
   27581 
   27582     \$default  reduce using rule 6 (B)
   27583 
   27584     B  go to state 17
   27585 
   27586     Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
   27587 
   27588 
   27589 State 13
   27590 
   27591     1 S: 'a' A 'a' .
   27592 
   27593     \$default  reduce using rule 1 (S)
   27594 
   27595 
   27596 State 14
   27597 
   27598     2 S: 'b' A 'b' .
   27599 
   27600     \$default  reduce using rule 2 (S)
   27601 
   27602 
   27603 State 15
   27604 
   27605     4 A: 'a' 'a' . B
   27606     5 B: . 'a'
   27607     6  | .  [\$end]
   27608     7 c: 'a' 'a' . 'b'
   27609 
   27610     'a'  shift, and go to state 16
   27611     'b'  shift, and go to state 18
   27612 
   27613     \$default  reduce using rule 6 (B)
   27614 
   27615     B  go to state 17
   27616 
   27617 
   27618 State 16
   27619 
   27620     5 B: 'a' .
   27621 
   27622     \$default  reduce using rule 5 (B)
   27623 
   27624 
   27625 State 17
   27626 
   27627     4 A: 'a' 'a' B .
   27628 
   27629     \$default  reduce using rule 4 (A)
   27630 
   27631 
   27632 State 18
   27633 
   27634     7 c: 'a' 'a' 'b' .
   27635 
   27636     \$default  reduce using rule 7 (c)
   27637 " | \
   27638   $at_diff - "$at_stdout" || at_failed=:
   27639 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27640 $at_failed && at_fn_log_failure
   27641 $at_traceon; }
   27642 
   27643 
   27644 
   27645 
   27646 # Canonical LR generates very large tables, resulting in very long
   27647 # files with #line directives that may overflow what the standards
   27648 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   27649 # will issue an error.
   27650 #
   27651 # There is no "" around `wc` since some indent the result.
   27652 
   27653 { set +x
   27654 $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS"
   27655 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
   27656 ( $at_check_trace; $BISON_C_WORKS
   27657 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27658 at_status=$? at_failed=false
   27659 $at_check_filter
   27660 echo stderr:; cat "$at_stderr"
   27661 echo stdout:; cat "$at_stdout"
   27662 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27663 $at_failed && at_fn_log_failure
   27664 $at_traceon; }
   27665 
   27666 { set +x
   27667 $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   27668 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951"
   27669 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   27670 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27671 at_status=$? at_failed=false
   27672 $at_check_filter
   27673 echo stderr:; cat "$at_stderr"
   27674 echo stdout:; cat "$at_stdout"
   27675 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27676 $at_failed && at_fn_log_failure
   27677 $at_traceon; }
   27678 
   27679 
   27680 { set +x
   27681 $as_echo "$at_srcdir/reduce.at:951:  \$PREPARSER ./input"
   27682 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
   27683 ( $at_check_trace;  $PREPARSER ./input
   27684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27685 at_status=$? at_failed=false
   27686 $at_check_filter
   27687 echo stderr:; tee stderr <"$at_stderr"
   27688 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27689 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:951"
   27690 $at_failed && at_fn_log_failure
   27691 $at_traceon; }
   27692 
   27693 { set +x
   27694 $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   27695 at_fn_check_prepare_trace "reduce.at:951"
   27696 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   27697 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27698 at_status=$? at_failed=false
   27699 $at_check_filter
   27700 echo >>"$at_stderr"; $as_echo "syntax error
   27701 " | \
   27702   $at_diff - "$at_stderr" || at_failed=:
   27703 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27704 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27705 $at_failed && at_fn_log_failure
   27706 $at_traceon; }
   27707 
   27708 
   27709 
   27710 
   27711   set +x
   27712   $at_times_p && times >"$at_times_file"
   27713 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   27714 read at_status <"$at_status_file"
   27715 #AT_STOP_117
   27716 #AT_START_118
   27717 at_fn_group_banner 118 'reduce.at:951' \
   27718   "%define lr.type ielr: Complex Lane Split" "       " 6
   27719 at_xfail=no
   27720 (
   27721   $as_echo "118. $at_setup_line: testing $at_desc ..."
   27722   $at_traceon
   27723 
   27724 
   27725 cat >input.y <<'_ATEOF'
   27726 %code top {
   27727 #include <config.h>
   27728 /* We don't need perfect functions for these tests. */
   27729 #undef malloc
   27730 #undef memcmp
   27731 #undef realloc
   27732 }
   27733 
   27734 %code {
   27735   #include <stdio.h>
   27736   static void yyerror ( const char *msg);
   27737   static int yylex (void);
   27738 }
   27739 
   27740 %define lr.type ielr
   27741 %left 'a'
   27742 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   27743 // keep it so that the paser table diff is easier to code.
   27744 %define lr.keep-unreachable-states
   27745 
   27746 %%
   27747 
   27748 
   27749 /* Similar to the last test case set but forseeing the S/R conflict from the
   27750    first state that must be split is becoming difficult.  Imagine if B were
   27751    even more complex.  Imagine if A had other RHS's ending in other
   27752    nonterminals.  */
   27753 S: 'a' A 'a'
   27754  | 'b' A 'b'
   27755  | 'c' c
   27756  ;
   27757 A: 'a' 'a' B
   27758  ;
   27759 B: 'a'
   27760  | %prec 'a'
   27761  ;
   27762 c: 'a' 'a' 'b'
   27763  | A
   27764  ;
   27765 
   27766 
   27767 %%
   27768 #include <stdio.h>
   27769 /* A C error reporting function.  */
   27770 static
   27771 void yyerror ( const char *msg)
   27772 {
   27773   fprintf (stderr, "%s\n", msg);
   27774 }
   27775 static int
   27776 yylex (void)
   27777 {
   27778   static int const input[] = {
   27779     'b', 'a', 'a', 'a', 'b', 0
   27780   };
   27781   static int const *inputp = input;
   27782   return *inputp++;
   27783 }
   27784 
   27785 int
   27786 main (void)
   27787 {
   27788   return yyparse ();
   27789 }
   27790 _ATEOF
   27791 
   27792 
   27793 
   27794 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   27795 # expanding macros, so it corrupts some special characters in the
   27796 # macros.  To avoid this, expand now and pass it the result with proper
   27797 # string quotation.  Assume args 7 through 12 expand to properly quoted
   27798 # strings.
   27799 
   27800 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   27801   at_save_special_files
   27802   mkdir xml-tests
   27803     # Don't combine these Bison invocations since we want to be sure that
   27804   # --report=all isn't required to get the full XML file.
   27805   { set +x
   27806 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   27807                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   27808 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951"
   27809 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   27810                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   27811 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27812 at_status=$? at_failed=false
   27813 $at_check_filter
   27814 echo stderr:; cat "$at_stderr"
   27815 echo stdout:; cat "$at_stdout"
   27816 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27817 $at_failed && at_fn_log_failure
   27818 $at_traceon; }
   27819 
   27820   { set +x
   27821 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   27822 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951"
   27823 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   27824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27825 at_status=$? at_failed=false
   27826 $at_check_filter
   27827 echo stderr:; cat "$at_stderr"
   27828 echo stdout:; cat "$at_stdout"
   27829 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27830 $at_failed && at_fn_log_failure
   27831 $at_traceon; }
   27832 
   27833     cp xml-tests/test.output expout
   27834   { set +x
   27835 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   27836              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   27837              xml-tests/test.xml"
   27838 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   27839 ( $at_check_trace; $XSLTPROC \
   27840              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   27841              xml-tests/test.xml
   27842 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27843 at_status=$? at_failed=false
   27844 $at_check_filter
   27845 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27846 $at_diff expout "$at_stdout" || at_failed=:
   27847 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27848 $at_failed && at_fn_log_failure
   27849 $at_traceon; }
   27850 
   27851   sort xml-tests/test.dot > expout
   27852   { set +x
   27853 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   27854              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   27855              xml-tests/test.xml | sort"
   27856 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   27857 ( $at_check_trace; $XSLTPROC \
   27858              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   27859              xml-tests/test.xml | sort
   27860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27861 at_status=$? at_failed=false
   27862 $at_check_filter
   27863 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27864 $at_diff expout "$at_stdout" || at_failed=:
   27865 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27866 $at_failed && at_fn_log_failure
   27867 $at_traceon; }
   27868 
   27869   rm -rf xml-tests expout
   27870   at_restore_special_files
   27871 fi
   27872 { set +x
   27873 $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
   27874 at_fn_check_prepare_trace "reduce.at:951"
   27875 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   27876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27877 at_status=$? at_failed=false
   27878 $at_check_filter
   27879 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27880 at_fn_diff_devnull "$at_stdout" || at_failed=:
   27881 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   27882 $at_failed && at_fn_log_failure
   27883 $at_traceon; }
   27884 
   27885 
   27886 
   27887 { set +x
   27888 $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output"
   27889 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951"
   27890 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   27891 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   27892 at_status=$? at_failed=false
   27893 $at_check_filter
   27894 at_fn_diff_devnull "$at_stderr" || at_failed=:
   27895 echo >>"$at_stdout"; $as_echo "State 0
   27896 
   27897     0 \$accept: . S \$end
   27898     1 S: . 'a' A 'a'
   27899     2  | . 'b' A 'b'
   27900     3  | . 'c' c
   27901 
   27902     'a'  shift, and go to state 1
   27903     'b'  shift, and go to state 2
   27904     'c'  shift, and go to state 3
   27905 
   27906     S  go to state 4
   27907 
   27908 
   27909 State 1
   27910 
   27911     1 S: 'a' . A 'a'
   27912     4 A: . 'a' 'a' B
   27913 
   27914     'a'  shift, and go to state 5
   27915 
   27916     A  go to state 6
   27917 
   27918 
   27919 State 2
   27920 
   27921     2 S: 'b' . A 'b'
   27922     4 A: . 'a' 'a' B
   27923 
   27924     'a'  shift, and go to state 19
   27925 
   27926     A  go to state 7
   27927 
   27928 
   27929 State 3
   27930 
   27931     3 S: 'c' . c
   27932     4 A: . 'a' 'a' B
   27933     7 c: . 'a' 'a' 'b'
   27934     8  | . A
   27935 
   27936     'a'  shift, and go to state 8
   27937 
   27938     A  go to state 9
   27939     c  go to state 10
   27940 
   27941 
   27942 State 4
   27943 
   27944     0 \$accept: S . \$end
   27945 
   27946     \$end  shift, and go to state 11
   27947 
   27948 
   27949 State 5
   27950 
   27951     4 A: 'a' . 'a' B
   27952 
   27953     'a'  shift, and go to state 12
   27954 
   27955 
   27956 State 6
   27957 
   27958     1 S: 'a' A . 'a'
   27959 
   27960     'a'  shift, and go to state 13
   27961 
   27962 
   27963 State 7
   27964 
   27965     2 S: 'b' A . 'b'
   27966 
   27967     'b'  shift, and go to state 14
   27968 
   27969 
   27970 State 8
   27971 
   27972     4 A: 'a' . 'a' B
   27973     7 c: 'a' . 'a' 'b'
   27974 
   27975     'a'  shift, and go to state 15
   27976 
   27977 
   27978 State 9
   27979 
   27980     8 c: A .
   27981 
   27982     \$default  reduce using rule 8 (c)
   27983 
   27984 
   27985 State 10
   27986 
   27987     3 S: 'c' c .
   27988 
   27989     \$default  reduce using rule 3 (S)
   27990 
   27991 
   27992 State 11
   27993 
   27994     0 \$accept: S \$end .
   27995 
   27996     \$default  accept
   27997 
   27998 
   27999 State 12
   28000 
   28001     4 A: 'a' 'a' . B
   28002     5 B: . 'a'
   28003     6  | .  ['a']
   28004 
   28005     \$default  reduce using rule 6 (B)
   28006 
   28007     B  go to state 17
   28008 
   28009     Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
   28010 
   28011 
   28012 State 13
   28013 
   28014     1 S: 'a' A 'a' .
   28015 
   28016     \$default  reduce using rule 1 (S)
   28017 
   28018 
   28019 State 14
   28020 
   28021     2 S: 'b' A 'b' .
   28022 
   28023     \$default  reduce using rule 2 (S)
   28024 
   28025 
   28026 State 15
   28027 
   28028     4 A: 'a' 'a' . B
   28029     5 B: . 'a'
   28030     6  | .  [\$end]
   28031     7 c: 'a' 'a' . 'b'
   28032 
   28033     'a'  shift, and go to state 16
   28034     'b'  shift, and go to state 18
   28035 
   28036     \$default  reduce using rule 6 (B)
   28037 
   28038     B  go to state 17
   28039 
   28040 
   28041 State 16
   28042 
   28043     5 B: 'a' .
   28044 
   28045     \$default  reduce using rule 5 (B)
   28046 
   28047 
   28048 State 17
   28049 
   28050     4 A: 'a' 'a' B .
   28051 
   28052     \$default  reduce using rule 4 (A)
   28053 
   28054 
   28055 State 18
   28056 
   28057     7 c: 'a' 'a' 'b' .
   28058 
   28059     \$default  reduce using rule 7 (c)
   28060 
   28061 
   28062 State 19
   28063 
   28064     4 A: 'a' . 'a' B
   28065 
   28066     'a'  shift, and go to state 20
   28067 
   28068 
   28069 State 20
   28070 
   28071     4 A: 'a' 'a' . B
   28072     5 B: . 'a'
   28073     6  | .  ['b']
   28074 
   28075     'a'  shift, and go to state 16
   28076 
   28077     \$default  reduce using rule 6 (B)
   28078 
   28079     B  go to state 17
   28080 " | \
   28081   $at_diff - "$at_stdout" || at_failed=:
   28082 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28083 $at_failed && at_fn_log_failure
   28084 $at_traceon; }
   28085 
   28086 
   28087 
   28088 
   28089 # Canonical LR generates very large tables, resulting in very long
   28090 # files with #line directives that may overflow what the standards
   28091 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   28092 # will issue an error.
   28093 #
   28094 # There is no "" around `wc` since some indent the result.
   28095 
   28096 { set +x
   28097 $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS"
   28098 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
   28099 ( $at_check_trace; $BISON_C_WORKS
   28100 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28101 at_status=$? at_failed=false
   28102 $at_check_filter
   28103 echo stderr:; cat "$at_stderr"
   28104 echo stdout:; cat "$at_stdout"
   28105 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28106 $at_failed && at_fn_log_failure
   28107 $at_traceon; }
   28108 
   28109 { set +x
   28110 $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   28111 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951"
   28112 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   28113 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28114 at_status=$? at_failed=false
   28115 $at_check_filter
   28116 echo stderr:; cat "$at_stderr"
   28117 echo stdout:; cat "$at_stdout"
   28118 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28119 $at_failed && at_fn_log_failure
   28120 $at_traceon; }
   28121 
   28122 
   28123 { set +x
   28124 $as_echo "$at_srcdir/reduce.at:951:  \$PREPARSER ./input"
   28125 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
   28126 ( $at_check_trace;  $PREPARSER ./input
   28127 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28128 at_status=$? at_failed=false
   28129 $at_check_filter
   28130 echo stderr:; tee stderr <"$at_stderr"
   28131 at_fn_diff_devnull "$at_stdout" || at_failed=:
   28132 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28133 $at_failed && at_fn_log_failure
   28134 $at_traceon; }
   28135 
   28136 { set +x
   28137 $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   28138 at_fn_check_prepare_trace "reduce.at:951"
   28139 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   28140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28141 at_status=$? at_failed=false
   28142 $at_check_filter
   28143 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28144 at_fn_diff_devnull "$at_stdout" || at_failed=:
   28145 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28146 $at_failed && at_fn_log_failure
   28147 $at_traceon; }
   28148 
   28149 
   28150 
   28151 
   28152   set +x
   28153   $at_times_p && times >"$at_times_file"
   28154 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   28155 read at_status <"$at_status_file"
   28156 #AT_STOP_118
   28157 #AT_START_119
   28158 at_fn_group_banner 119 'reduce.at:951' \
   28159   "%define lr.type canonical-lr: Complex Lane Split" "" 6
   28160 at_xfail=no
   28161 (
   28162   $as_echo "119. $at_setup_line: testing $at_desc ..."
   28163   $at_traceon
   28164 
   28165 
   28166 cat >input.y <<'_ATEOF'
   28167 %code top {
   28168 #include <config.h>
   28169 /* We don't need perfect functions for these tests. */
   28170 #undef malloc
   28171 #undef memcmp
   28172 #undef realloc
   28173 }
   28174 
   28175 %code {
   28176   #include <stdio.h>
   28177   static void yyerror ( const char *msg);
   28178   static int yylex (void);
   28179 }
   28180 
   28181 %define lr.type canonical-lr
   28182 %left 'a'
   28183 // Conflict resolution renders state 16 unreachable for canonical LR(1).  We
   28184 // keep it so that the paser table diff is easier to code.
   28185 %define lr.keep-unreachable-states
   28186 
   28187 %%
   28188 
   28189 
   28190 /* Similar to the last test case set but forseeing the S/R conflict from the
   28191    first state that must be split is becoming difficult.  Imagine if B were
   28192    even more complex.  Imagine if A had other RHS's ending in other
   28193    nonterminals.  */
   28194 S: 'a' A 'a'
   28195  | 'b' A 'b'
   28196  | 'c' c
   28197  ;
   28198 A: 'a' 'a' B
   28199  ;
   28200 B: 'a'
   28201  | %prec 'a'
   28202  ;
   28203 c: 'a' 'a' 'b'
   28204  | A
   28205  ;
   28206 
   28207 
   28208 %%
   28209 #include <stdio.h>
   28210 /* A C error reporting function.  */
   28211 static
   28212 void yyerror ( const char *msg)
   28213 {
   28214   fprintf (stderr, "%s\n", msg);
   28215 }
   28216 static int
   28217 yylex (void)
   28218 {
   28219   static int const input[] = {
   28220     'b', 'a', 'a', 'a', 'b', 0
   28221   };
   28222   static int const *inputp = input;
   28223   return *inputp++;
   28224 }
   28225 
   28226 int
   28227 main (void)
   28228 {
   28229   return yyparse ();
   28230 }
   28231 _ATEOF
   28232 
   28233 
   28234 
   28235 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   28236 # expanding macros, so it corrupts some special characters in the
   28237 # macros.  To avoid this, expand now and pass it the result with proper
   28238 # string quotation.  Assume args 7 through 12 expand to properly quoted
   28239 # strings.
   28240 
   28241 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   28242   at_save_special_files
   28243   mkdir xml-tests
   28244     # Don't combine these Bison invocations since we want to be sure that
   28245   # --report=all isn't required to get the full XML file.
   28246   { set +x
   28247 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   28248                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   28249 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:951"
   28250 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   28251                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   28252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28253 at_status=$? at_failed=false
   28254 $at_check_filter
   28255 echo stderr:; cat "$at_stderr"
   28256 echo stdout:; cat "$at_stdout"
   28257 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28258 $at_failed && at_fn_log_failure
   28259 $at_traceon; }
   28260 
   28261   { set +x
   28262 $as_echo "$at_srcdir/reduce.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   28263 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:951"
   28264 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   28265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28266 at_status=$? at_failed=false
   28267 $at_check_filter
   28268 echo stderr:; cat "$at_stderr"
   28269 echo stdout:; cat "$at_stdout"
   28270 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28271 $at_failed && at_fn_log_failure
   28272 $at_traceon; }
   28273 
   28274     cp xml-tests/test.output expout
   28275   { set +x
   28276 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   28277              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   28278              xml-tests/test.xml"
   28279 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   28280 ( $at_check_trace; $XSLTPROC \
   28281              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   28282              xml-tests/test.xml
   28283 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28284 at_status=$? at_failed=false
   28285 $at_check_filter
   28286 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28287 $at_diff expout "$at_stdout" || at_failed=:
   28288 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28289 $at_failed && at_fn_log_failure
   28290 $at_traceon; }
   28291 
   28292   sort xml-tests/test.dot > expout
   28293   { set +x
   28294 $as_echo "$at_srcdir/reduce.at:951: \$XSLTPROC \\
   28295              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   28296              xml-tests/test.xml | sort"
   28297 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:951"
   28298 ( $at_check_trace; $XSLTPROC \
   28299              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   28300              xml-tests/test.xml | sort
   28301 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28302 at_status=$? at_failed=false
   28303 $at_check_filter
   28304 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28305 $at_diff expout "$at_stdout" || at_failed=:
   28306 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28307 $at_failed && at_fn_log_failure
   28308 $at_traceon; }
   28309 
   28310   rm -rf xml-tests expout
   28311   at_restore_special_files
   28312 fi
   28313 { set +x
   28314 $as_echo "$at_srcdir/reduce.at:951: bison --report=all --defines -o input.c input.y"
   28315 at_fn_check_prepare_trace "reduce.at:951"
   28316 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   28317 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28318 at_status=$? at_failed=false
   28319 $at_check_filter
   28320 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28321 at_fn_diff_devnull "$at_stdout" || at_failed=:
   28322 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28323 $at_failed && at_fn_log_failure
   28324 $at_traceon; }
   28325 
   28326 
   28327 
   28328 { set +x
   28329 $as_echo "$at_srcdir/reduce.at:951: sed -n '/^State 0\$/,\$p' input.output"
   28330 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:951"
   28331 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   28332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28333 at_status=$? at_failed=false
   28334 $at_check_filter
   28335 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28336 echo >>"$at_stdout"; $as_echo "State 0
   28337 
   28338     0 \$accept: . S \$end
   28339     1 S: . 'a' A 'a'
   28340     2  | . 'b' A 'b'
   28341     3  | . 'c' c
   28342 
   28343     'a'  shift, and go to state 1
   28344     'b'  shift, and go to state 2
   28345     'c'  shift, and go to state 3
   28346 
   28347     S  go to state 4
   28348 
   28349 
   28350 State 1
   28351 
   28352     1 S: 'a' . A 'a'
   28353     4 A: . 'a' 'a' B
   28354 
   28355     'a'  shift, and go to state 5
   28356 
   28357     A  go to state 6
   28358 
   28359 
   28360 State 2
   28361 
   28362     2 S: 'b' . A 'b'
   28363     4 A: . 'a' 'a' B
   28364 
   28365     'a'  shift, and go to state 19
   28366 
   28367     A  go to state 7
   28368 
   28369 
   28370 State 3
   28371 
   28372     3 S: 'c' . c
   28373     4 A: . 'a' 'a' B
   28374     7 c: . 'a' 'a' 'b'
   28375     8  | . A
   28376 
   28377     'a'  shift, and go to state 8
   28378 
   28379     A  go to state 9
   28380     c  go to state 10
   28381 
   28382 
   28383 State 4
   28384 
   28385     0 \$accept: S . \$end
   28386 
   28387     \$end  shift, and go to state 11
   28388 
   28389 
   28390 State 5
   28391 
   28392     4 A: 'a' . 'a' B
   28393 
   28394     'a'  shift, and go to state 12
   28395 
   28396 
   28397 State 6
   28398 
   28399     1 S: 'a' A . 'a'
   28400 
   28401     'a'  shift, and go to state 13
   28402 
   28403 
   28404 State 7
   28405 
   28406     2 S: 'b' A . 'b'
   28407 
   28408     'b'  shift, and go to state 14
   28409 
   28410 
   28411 State 8
   28412 
   28413     4 A: 'a' . 'a' B
   28414     7 c: 'a' . 'a' 'b'
   28415 
   28416     'a'  shift, and go to state 15
   28417 
   28418 
   28419 State 9
   28420 
   28421     8 c: A .  [\$end]
   28422 
   28423     \$end  reduce using rule 8 (c)
   28424 
   28425 
   28426 State 10
   28427 
   28428     3 S: 'c' c .  [\$end]
   28429 
   28430     \$end  reduce using rule 3 (S)
   28431 
   28432 
   28433 State 11
   28434 
   28435     0 \$accept: S \$end .
   28436 
   28437     \$default  accept
   28438 
   28439 
   28440 State 12
   28441 
   28442     4 A: 'a' 'a' . B
   28443     5 B: . 'a'
   28444     6  | .  ['a']
   28445 
   28446     'a'  reduce using rule 6 (B)
   28447 
   28448     B  go to state 17
   28449 
   28450     Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
   28451 
   28452 
   28453 State 13
   28454 
   28455     1 S: 'a' A 'a' .  [\$end]
   28456 
   28457     \$end  reduce using rule 1 (S)
   28458 
   28459 
   28460 State 14
   28461 
   28462     2 S: 'b' A 'b' .  [\$end]
   28463 
   28464     \$end  reduce using rule 2 (S)
   28465 
   28466 
   28467 State 15
   28468 
   28469     4 A: 'a' 'a' . B
   28470     5 B: . 'a'
   28471     6  | .  [\$end]
   28472     7 c: 'a' 'a' . 'b'
   28473 
   28474     'a'  shift, and go to state 20
   28475     'b'  shift, and go to state 18
   28476 
   28477     \$end  reduce using rule 6 (B)
   28478 
   28479     B  go to state 21
   28480 
   28481 
   28482 State 16
   28483 
   28484     5 B: 'a' .  ['a']
   28485 
   28486     'a'  reduce using rule 5 (B)
   28487 
   28488 
   28489 State 17
   28490 
   28491     4 A: 'a' 'a' B .  ['a']
   28492 
   28493     'a'  reduce using rule 4 (A)
   28494 
   28495 
   28496 State 18
   28497 
   28498     7 c: 'a' 'a' 'b' .  [\$end]
   28499 
   28500     \$end  reduce using rule 7 (c)
   28501 
   28502 
   28503 State 19
   28504 
   28505     4 A: 'a' . 'a' B
   28506 
   28507     'a'  shift, and go to state 22
   28508 
   28509 
   28510 State 20
   28511 
   28512     5 B: 'a' .  [\$end]
   28513 
   28514     \$end  reduce using rule 5 (B)
   28515 
   28516 
   28517 State 21
   28518 
   28519     4 A: 'a' 'a' B .  [\$end]
   28520 
   28521     \$end  reduce using rule 4 (A)
   28522 
   28523 
   28524 State 22
   28525 
   28526     4 A: 'a' 'a' . B
   28527     5 B: . 'a'
   28528     6  | .  ['b']
   28529 
   28530     'a'  shift, and go to state 23
   28531 
   28532     'b'  reduce using rule 6 (B)
   28533 
   28534     B  go to state 24
   28535 
   28536 
   28537 State 23
   28538 
   28539     5 B: 'a' .  ['b']
   28540 
   28541     'b'  reduce using rule 5 (B)
   28542 
   28543 
   28544 State 24
   28545 
   28546     4 A: 'a' 'a' B .  ['b']
   28547 
   28548     'b'  reduce using rule 4 (A)
   28549 " | \
   28550   $at_diff - "$at_stdout" || at_failed=:
   28551 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28552 $at_failed && at_fn_log_failure
   28553 $at_traceon; }
   28554 
   28555 
   28556 
   28557 
   28558 # Canonical LR generates very large tables, resulting in very long
   28559 # files with #line directives that may overflow what the standards
   28560 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   28561 # will issue an error.
   28562 #
   28563 # There is no "" around `wc` since some indent the result.
   28564 if test 32767 -lt `wc -l < input.c`; then
   28565   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   28566   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   28567 fi
   28568 { set +x
   28569 $as_echo "$at_srcdir/reduce.at:951: \$BISON_C_WORKS"
   28570 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:951"
   28571 ( $at_check_trace; $BISON_C_WORKS
   28572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28573 at_status=$? at_failed=false
   28574 $at_check_filter
   28575 echo stderr:; cat "$at_stderr"
   28576 echo stdout:; cat "$at_stdout"
   28577 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28578 $at_failed && at_fn_log_failure
   28579 $at_traceon; }
   28580 
   28581 { set +x
   28582 $as_echo "$at_srcdir/reduce.at:951: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   28583 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:951"
   28584 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   28585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28586 at_status=$? at_failed=false
   28587 $at_check_filter
   28588 echo stderr:; cat "$at_stderr"
   28589 echo stdout:; cat "$at_stdout"
   28590 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28591 $at_failed && at_fn_log_failure
   28592 $at_traceon; }
   28593 
   28594 
   28595 { set +x
   28596 $as_echo "$at_srcdir/reduce.at:951:  \$PREPARSER ./input"
   28597 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:951"
   28598 ( $at_check_trace;  $PREPARSER ./input
   28599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28600 at_status=$? at_failed=false
   28601 $at_check_filter
   28602 echo stderr:; tee stderr <"$at_stderr"
   28603 at_fn_diff_devnull "$at_stdout" || at_failed=:
   28604 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28605 $at_failed && at_fn_log_failure
   28606 $at_traceon; }
   28607 
   28608 { set +x
   28609 $as_echo "$at_srcdir/reduce.at:951: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   28610 at_fn_check_prepare_trace "reduce.at:951"
   28611 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   28612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28613 at_status=$? at_failed=false
   28614 $at_check_filter
   28615 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28616 at_fn_diff_devnull "$at_stdout" || at_failed=:
   28617 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:951"
   28618 $at_failed && at_fn_log_failure
   28619 $at_traceon; }
   28620 
   28621 
   28622 
   28623 
   28624   set +x
   28625   $at_times_p && times >"$at_times_file"
   28626 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   28627 read at_status <"$at_status_file"
   28628 #AT_STOP_119
   28629 #AT_START_120
   28630 at_fn_group_banner 120 'reduce.at:1220' \
   28631   "no %define lr.type: Split During Added Lookahead Propagation" "" 6
   28632 at_xfail=no
   28633 (
   28634   $as_echo "120. $at_setup_line: testing $at_desc ..."
   28635   $at_traceon
   28636 
   28637 
   28638 cat >input.y <<'_ATEOF'
   28639 %code top {
   28640 #include <config.h>
   28641 /* We don't need perfect functions for these tests. */
   28642 #undef malloc
   28643 #undef memcmp
   28644 #undef realloc
   28645 }
   28646 
   28647 %code {
   28648   #include <stdio.h>
   28649   static void yyerror ( const char *msg);
   28650   static int yylex (void);
   28651 }
   28652 
   28653 %define lr.keep-unreachable-states
   28654 
   28655 %%
   28656 
   28657 
   28658 /* The partial state chart diagram below is for LALR(1).  State 0 is the start
   28659    state.  States are iterated for successor construction in numerical order.
   28660    Transitions are downwards.
   28661 
   28662    State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
   28663    algorithm using annotations alone.  That is, when state 11's successor on
   28664    'd' is merged with state 5 (which is originally just state 1's successor on
   28665    'd'), state 5's successor on 'e' must then be changed because the resulting
   28666    lookaheads that propagate to it now make it incompatible with state 8's
   28667    successor on 'e'.  In other words, state 13 must be split to avoid the
   28668    conflict.
   28669 
   28670           0
   28671         / | \
   28672      a / c|  \ b
   28673       1   3   2
   28674       |   |   |
   28675      d|   |c  | d
   28676       |  11   |
   28677       |   |   |
   28678        \ /d   |
   28679         5     8
   28680          \    |
   28681         e \  / e
   28682            13
   28683            R/R
   28684 
   28685    This grammar is designed carefully to make sure that, despite Bison's LR(1)
   28686    algorithm's bread-first iteration of transitions to reconstruct states,
   28687    state 11's successors are constructed after state 5's and state 8's.
   28688    Otherwise (for example, if you remove the first 'c' in each of rules 6 and
   28689    7), state 5's successor on 'e' would never be merged with state 8's, so the
   28690    split of the resulting state 13 would never need to be performed.  */
   28691 S: 'a' A 'f'
   28692  | 'a' B
   28693  | 'b' A 'f'
   28694  | 'b' B 'g'
   28695  | 'b' 'd'
   28696  | 'c' 'c' A 'g'
   28697  | 'c' 'c' B
   28698  ;
   28699 A: 'd' 'e' ;
   28700 B: 'd' 'e' ;
   28701 
   28702 
   28703 %%
   28704 #include <stdio.h>
   28705 /* A C error reporting function.  */
   28706 static
   28707 void yyerror ( const char *msg)
   28708 {
   28709   fprintf (stderr, "%s\n", msg);
   28710 }
   28711 static int
   28712 yylex (void)
   28713 {
   28714   static int const input[] = {
   28715     'b', 'd', 'e', 'g', 0
   28716   };
   28717   static int const *inputp = input;
   28718   return *inputp++;
   28719 }
   28720 
   28721 int
   28722 main (void)
   28723 {
   28724   return yyparse ();
   28725 }
   28726 _ATEOF
   28727 
   28728 
   28729 
   28730 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   28731 # expanding macros, so it corrupts some special characters in the
   28732 # macros.  To avoid this, expand now and pass it the result with proper
   28733 # string quotation.  Assume args 7 through 12 expand to properly quoted
   28734 # strings.
   28735 
   28736 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   28737   at_save_special_files
   28738   mkdir xml-tests
   28739     # Don't combine these Bison invocations since we want to be sure that
   28740   # --report=all isn't required to get the full XML file.
   28741   { set +x
   28742 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   28743                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   28744 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220"
   28745 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   28746                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   28747 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28748 at_status=$? at_failed=false
   28749 $at_check_filter
   28750 echo stderr:; cat "$at_stderr"
   28751 echo stdout:; cat "$at_stdout"
   28752 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   28753 $at_failed && at_fn_log_failure
   28754 $at_traceon; }
   28755 
   28756   { set +x
   28757 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   28758 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220"
   28759 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   28760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28761 at_status=$? at_failed=false
   28762 $at_check_filter
   28763 echo stderr:; cat "$at_stderr"
   28764 echo stdout:; cat "$at_stdout"
   28765 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   28766 $at_failed && at_fn_log_failure
   28767 $at_traceon; }
   28768 
   28769     cp xml-tests/test.output expout
   28770   { set +x
   28771 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   28772              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   28773              xml-tests/test.xml"
   28774 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   28775 ( $at_check_trace; $XSLTPROC \
   28776              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   28777              xml-tests/test.xml
   28778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28779 at_status=$? at_failed=false
   28780 $at_check_filter
   28781 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28782 $at_diff expout "$at_stdout" || at_failed=:
   28783 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   28784 $at_failed && at_fn_log_failure
   28785 $at_traceon; }
   28786 
   28787   sort xml-tests/test.dot > expout
   28788   { set +x
   28789 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   28790              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   28791              xml-tests/test.xml | sort"
   28792 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   28793 ( $at_check_trace; $XSLTPROC \
   28794              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   28795              xml-tests/test.xml | sort
   28796 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28797 at_status=$? at_failed=false
   28798 $at_check_filter
   28799 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28800 $at_diff expout "$at_stdout" || at_failed=:
   28801 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   28802 $at_failed && at_fn_log_failure
   28803 $at_traceon; }
   28804 
   28805   rm -rf xml-tests expout
   28806   at_restore_special_files
   28807 fi
   28808 { set +x
   28809 $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
   28810 at_fn_check_prepare_trace "reduce.at:1220"
   28811 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   28812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28813 at_status=$? at_failed=false
   28814 $at_check_filter
   28815 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
   28816 " | \
   28817   $at_diff - "$at_stderr" || at_failed=:
   28818 at_fn_diff_devnull "$at_stdout" || at_failed=:
   28819 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   28820 $at_failed && at_fn_log_failure
   28821 $at_traceon; }
   28822 
   28823 
   28824 
   28825 { set +x
   28826 $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output"
   28827 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220"
   28828 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   28829 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   28830 at_status=$? at_failed=false
   28831 $at_check_filter
   28832 at_fn_diff_devnull "$at_stderr" || at_failed=:
   28833 echo >>"$at_stdout"; $as_echo "State 0
   28834 
   28835     0 \$accept: . S \$end
   28836     1 S: . 'a' A 'f'
   28837     2  | . 'a' B
   28838     3  | . 'b' A 'f'
   28839     4  | . 'b' B 'g'
   28840     5  | . 'b' 'd'
   28841     6  | . 'c' 'c' A 'g'
   28842     7  | . 'c' 'c' B
   28843 
   28844     'a'  shift, and go to state 1
   28845     'b'  shift, and go to state 2
   28846     'c'  shift, and go to state 3
   28847 
   28848     S  go to state 4
   28849 
   28850 
   28851 State 1
   28852 
   28853     1 S: 'a' . A 'f'
   28854     2  | 'a' . B
   28855     8 A: . 'd' 'e'
   28856     9 B: . 'd' 'e'
   28857 
   28858     'd'  shift, and go to state 5
   28859 
   28860     A  go to state 6
   28861     B  go to state 7
   28862 
   28863 
   28864 State 2
   28865 
   28866     3 S: 'b' . A 'f'
   28867     4  | 'b' . B 'g'
   28868     5  | 'b' . 'd'
   28869     8 A: . 'd' 'e'
   28870     9 B: . 'd' 'e'
   28871 
   28872     'd'  shift, and go to state 8
   28873 
   28874     A  go to state 9
   28875     B  go to state 10
   28876 
   28877 
   28878 State 3
   28879 
   28880     6 S: 'c' . 'c' A 'g'
   28881     7  | 'c' . 'c' B
   28882 
   28883     'c'  shift, and go to state 11
   28884 
   28885 
   28886 State 4
   28887 
   28888     0 \$accept: S . \$end
   28889 
   28890     \$end  shift, and go to state 12
   28891 
   28892 
   28893 State 5
   28894 
   28895     8 A: 'd' . 'e'
   28896     9 B: 'd' . 'e'
   28897 
   28898     'e'  shift, and go to state 13
   28899 
   28900 
   28901 State 6
   28902 
   28903     1 S: 'a' A . 'f'
   28904 
   28905     'f'  shift, and go to state 14
   28906 
   28907 
   28908 State 7
   28909 
   28910     2 S: 'a' B .
   28911 
   28912     \$default  reduce using rule 2 (S)
   28913 
   28914 
   28915 State 8
   28916 
   28917     5 S: 'b' 'd' .  [\$end]
   28918     8 A: 'd' . 'e'
   28919     9 B: 'd' . 'e'
   28920 
   28921     'e'  shift, and go to state 13
   28922 
   28923     \$default  reduce using rule 5 (S)
   28924 
   28925 
   28926 State 9
   28927 
   28928     3 S: 'b' A . 'f'
   28929 
   28930     'f'  shift, and go to state 15
   28931 
   28932 
   28933 State 10
   28934 
   28935     4 S: 'b' B . 'g'
   28936 
   28937     'g'  shift, and go to state 16
   28938 
   28939 
   28940 State 11
   28941 
   28942     6 S: 'c' 'c' . A 'g'
   28943     7  | 'c' 'c' . B
   28944     8 A: . 'd' 'e'
   28945     9 B: . 'd' 'e'
   28946 
   28947     'd'  shift, and go to state 5
   28948 
   28949     A  go to state 17
   28950     B  go to state 18
   28951 
   28952 
   28953 State 12
   28954 
   28955     0 \$accept: S \$end .
   28956 
   28957     \$default  accept
   28958 
   28959 
   28960 State 13
   28961 
   28962     8 A: 'd' 'e' .  ['f', 'g']
   28963     9 B: 'd' 'e' .  [\$end, 'g']
   28964 
   28965     \$end      reduce using rule 9 (B)
   28966     'g'       reduce using rule 8 (A)
   28967     'g'       [reduce using rule 9 (B)]
   28968     \$default  reduce using rule 8 (A)
   28969 
   28970 
   28971 State 14
   28972 
   28973     1 S: 'a' A 'f' .
   28974 
   28975     \$default  reduce using rule 1 (S)
   28976 
   28977 
   28978 State 15
   28979 
   28980     3 S: 'b' A 'f' .
   28981 
   28982     \$default  reduce using rule 3 (S)
   28983 
   28984 
   28985 State 16
   28986 
   28987     4 S: 'b' B 'g' .
   28988 
   28989     \$default  reduce using rule 4 (S)
   28990 
   28991 
   28992 State 17
   28993 
   28994     6 S: 'c' 'c' A . 'g'
   28995 
   28996     'g'  shift, and go to state 19
   28997 
   28998 
   28999 State 18
   29000 
   29001     7 S: 'c' 'c' B .
   29002 
   29003     \$default  reduce using rule 7 (S)
   29004 
   29005 
   29006 State 19
   29007 
   29008     6 S: 'c' 'c' A 'g' .
   29009 
   29010     \$default  reduce using rule 6 (S)
   29011 " | \
   29012   $at_diff - "$at_stdout" || at_failed=:
   29013 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29014 $at_failed && at_fn_log_failure
   29015 $at_traceon; }
   29016 
   29017 
   29018 
   29019 
   29020 # Canonical LR generates very large tables, resulting in very long
   29021 # files with #line directives that may overflow what the standards
   29022 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   29023 # will issue an error.
   29024 #
   29025 # There is no "" around `wc` since some indent the result.
   29026 
   29027 { set +x
   29028 $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS"
   29029 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
   29030 ( $at_check_trace; $BISON_C_WORKS
   29031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29032 at_status=$? at_failed=false
   29033 $at_check_filter
   29034 echo stderr:; cat "$at_stderr"
   29035 echo stdout:; cat "$at_stdout"
   29036 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29037 $at_failed && at_fn_log_failure
   29038 $at_traceon; }
   29039 
   29040 { set +x
   29041 $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   29042 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220"
   29043 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   29044 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29045 at_status=$? at_failed=false
   29046 $at_check_filter
   29047 echo stderr:; cat "$at_stderr"
   29048 echo stdout:; cat "$at_stdout"
   29049 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29050 $at_failed && at_fn_log_failure
   29051 $at_traceon; }
   29052 
   29053 
   29054 { set +x
   29055 $as_echo "$at_srcdir/reduce.at:1220:  \$PREPARSER ./input"
   29056 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
   29057 ( $at_check_trace;  $PREPARSER ./input
   29058 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29059 at_status=$? at_failed=false
   29060 $at_check_filter
   29061 echo stderr:; tee stderr <"$at_stderr"
   29062 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29063 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1220"
   29064 $at_failed && at_fn_log_failure
   29065 $at_traceon; }
   29066 
   29067 { set +x
   29068 $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   29069 at_fn_check_prepare_trace "reduce.at:1220"
   29070 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   29071 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29072 at_status=$? at_failed=false
   29073 $at_check_filter
   29074 echo >>"$at_stderr"; $as_echo "syntax error
   29075 " | \
   29076   $at_diff - "$at_stderr" || at_failed=:
   29077 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29078 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29079 $at_failed && at_fn_log_failure
   29080 $at_traceon; }
   29081 
   29082 
   29083 
   29084 
   29085   set +x
   29086   $at_times_p && times >"$at_times_file"
   29087 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   29088 read at_status <"$at_status_file"
   29089 #AT_STOP_120
   29090 #AT_START_121
   29091 at_fn_group_banner 121 'reduce.at:1220' \
   29092   "%define lr.type lalr: Split During Added Lookahead Propagation" "" 6
   29093 at_xfail=no
   29094 (
   29095   $as_echo "121. $at_setup_line: testing $at_desc ..."
   29096   $at_traceon
   29097 
   29098 
   29099 cat >input.y <<'_ATEOF'
   29100 %code top {
   29101 #include <config.h>
   29102 /* We don't need perfect functions for these tests. */
   29103 #undef malloc
   29104 #undef memcmp
   29105 #undef realloc
   29106 }
   29107 
   29108 %code {
   29109   #include <stdio.h>
   29110   static void yyerror ( const char *msg);
   29111   static int yylex (void);
   29112 }
   29113 
   29114 %define lr.type lalr
   29115 %define lr.keep-unreachable-states
   29116 
   29117 %%
   29118 
   29119 
   29120 /* The partial state chart diagram below is for LALR(1).  State 0 is the start
   29121    state.  States are iterated for successor construction in numerical order.
   29122    Transitions are downwards.
   29123 
   29124    State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
   29125    algorithm using annotations alone.  That is, when state 11's successor on
   29126    'd' is merged with state 5 (which is originally just state 1's successor on
   29127    'd'), state 5's successor on 'e' must then be changed because the resulting
   29128    lookaheads that propagate to it now make it incompatible with state 8's
   29129    successor on 'e'.  In other words, state 13 must be split to avoid the
   29130    conflict.
   29131 
   29132           0
   29133         / | \
   29134      a / c|  \ b
   29135       1   3   2
   29136       |   |   |
   29137      d|   |c  | d
   29138       |  11   |
   29139       |   |   |
   29140        \ /d   |
   29141         5     8
   29142          \    |
   29143         e \  / e
   29144            13
   29145            R/R
   29146 
   29147    This grammar is designed carefully to make sure that, despite Bison's LR(1)
   29148    algorithm's bread-first iteration of transitions to reconstruct states,
   29149    state 11's successors are constructed after state 5's and state 8's.
   29150    Otherwise (for example, if you remove the first 'c' in each of rules 6 and
   29151    7), state 5's successor on 'e' would never be merged with state 8's, so the
   29152    split of the resulting state 13 would never need to be performed.  */
   29153 S: 'a' A 'f'
   29154  | 'a' B
   29155  | 'b' A 'f'
   29156  | 'b' B 'g'
   29157  | 'b' 'd'
   29158  | 'c' 'c' A 'g'
   29159  | 'c' 'c' B
   29160  ;
   29161 A: 'd' 'e' ;
   29162 B: 'd' 'e' ;
   29163 
   29164 
   29165 %%
   29166 #include <stdio.h>
   29167 /* A C error reporting function.  */
   29168 static
   29169 void yyerror ( const char *msg)
   29170 {
   29171   fprintf (stderr, "%s\n", msg);
   29172 }
   29173 static int
   29174 yylex (void)
   29175 {
   29176   static int const input[] = {
   29177     'b', 'd', 'e', 'g', 0
   29178   };
   29179   static int const *inputp = input;
   29180   return *inputp++;
   29181 }
   29182 
   29183 int
   29184 main (void)
   29185 {
   29186   return yyparse ();
   29187 }
   29188 _ATEOF
   29189 
   29190 
   29191 
   29192 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   29193 # expanding macros, so it corrupts some special characters in the
   29194 # macros.  To avoid this, expand now and pass it the result with proper
   29195 # string quotation.  Assume args 7 through 12 expand to properly quoted
   29196 # strings.
   29197 
   29198 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   29199   at_save_special_files
   29200   mkdir xml-tests
   29201     # Don't combine these Bison invocations since we want to be sure that
   29202   # --report=all isn't required to get the full XML file.
   29203   { set +x
   29204 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   29205                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   29206 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220"
   29207 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   29208                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   29209 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29210 at_status=$? at_failed=false
   29211 $at_check_filter
   29212 echo stderr:; cat "$at_stderr"
   29213 echo stdout:; cat "$at_stdout"
   29214 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29215 $at_failed && at_fn_log_failure
   29216 $at_traceon; }
   29217 
   29218   { set +x
   29219 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   29220 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220"
   29221 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   29222 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29223 at_status=$? at_failed=false
   29224 $at_check_filter
   29225 echo stderr:; cat "$at_stderr"
   29226 echo stdout:; cat "$at_stdout"
   29227 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29228 $at_failed && at_fn_log_failure
   29229 $at_traceon; }
   29230 
   29231     cp xml-tests/test.output expout
   29232   { set +x
   29233 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   29234              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   29235              xml-tests/test.xml"
   29236 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   29237 ( $at_check_trace; $XSLTPROC \
   29238              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   29239              xml-tests/test.xml
   29240 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29241 at_status=$? at_failed=false
   29242 $at_check_filter
   29243 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29244 $at_diff expout "$at_stdout" || at_failed=:
   29245 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29246 $at_failed && at_fn_log_failure
   29247 $at_traceon; }
   29248 
   29249   sort xml-tests/test.dot > expout
   29250   { set +x
   29251 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   29252              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   29253              xml-tests/test.xml | sort"
   29254 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   29255 ( $at_check_trace; $XSLTPROC \
   29256              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   29257              xml-tests/test.xml | sort
   29258 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29259 at_status=$? at_failed=false
   29260 $at_check_filter
   29261 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29262 $at_diff expout "$at_stdout" || at_failed=:
   29263 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29264 $at_failed && at_fn_log_failure
   29265 $at_traceon; }
   29266 
   29267   rm -rf xml-tests expout
   29268   at_restore_special_files
   29269 fi
   29270 { set +x
   29271 $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
   29272 at_fn_check_prepare_trace "reduce.at:1220"
   29273 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   29274 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29275 at_status=$? at_failed=false
   29276 $at_check_filter
   29277 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
   29278 " | \
   29279   $at_diff - "$at_stderr" || at_failed=:
   29280 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29281 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29282 $at_failed && at_fn_log_failure
   29283 $at_traceon; }
   29284 
   29285 
   29286 
   29287 { set +x
   29288 $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output"
   29289 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220"
   29290 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   29291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29292 at_status=$? at_failed=false
   29293 $at_check_filter
   29294 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29295 echo >>"$at_stdout"; $as_echo "State 0
   29296 
   29297     0 \$accept: . S \$end
   29298     1 S: . 'a' A 'f'
   29299     2  | . 'a' B
   29300     3  | . 'b' A 'f'
   29301     4  | . 'b' B 'g'
   29302     5  | . 'b' 'd'
   29303     6  | . 'c' 'c' A 'g'
   29304     7  | . 'c' 'c' B
   29305 
   29306     'a'  shift, and go to state 1
   29307     'b'  shift, and go to state 2
   29308     'c'  shift, and go to state 3
   29309 
   29310     S  go to state 4
   29311 
   29312 
   29313 State 1
   29314 
   29315     1 S: 'a' . A 'f'
   29316     2  | 'a' . B
   29317     8 A: . 'd' 'e'
   29318     9 B: . 'd' 'e'
   29319 
   29320     'd'  shift, and go to state 5
   29321 
   29322     A  go to state 6
   29323     B  go to state 7
   29324 
   29325 
   29326 State 2
   29327 
   29328     3 S: 'b' . A 'f'
   29329     4  | 'b' . B 'g'
   29330     5  | 'b' . 'd'
   29331     8 A: . 'd' 'e'
   29332     9 B: . 'd' 'e'
   29333 
   29334     'd'  shift, and go to state 8
   29335 
   29336     A  go to state 9
   29337     B  go to state 10
   29338 
   29339 
   29340 State 3
   29341 
   29342     6 S: 'c' . 'c' A 'g'
   29343     7  | 'c' . 'c' B
   29344 
   29345     'c'  shift, and go to state 11
   29346 
   29347 
   29348 State 4
   29349 
   29350     0 \$accept: S . \$end
   29351 
   29352     \$end  shift, and go to state 12
   29353 
   29354 
   29355 State 5
   29356 
   29357     8 A: 'd' . 'e'
   29358     9 B: 'd' . 'e'
   29359 
   29360     'e'  shift, and go to state 13
   29361 
   29362 
   29363 State 6
   29364 
   29365     1 S: 'a' A . 'f'
   29366 
   29367     'f'  shift, and go to state 14
   29368 
   29369 
   29370 State 7
   29371 
   29372     2 S: 'a' B .
   29373 
   29374     \$default  reduce using rule 2 (S)
   29375 
   29376 
   29377 State 8
   29378 
   29379     5 S: 'b' 'd' .  [\$end]
   29380     8 A: 'd' . 'e'
   29381     9 B: 'd' . 'e'
   29382 
   29383     'e'  shift, and go to state 13
   29384 
   29385     \$default  reduce using rule 5 (S)
   29386 
   29387 
   29388 State 9
   29389 
   29390     3 S: 'b' A . 'f'
   29391 
   29392     'f'  shift, and go to state 15
   29393 
   29394 
   29395 State 10
   29396 
   29397     4 S: 'b' B . 'g'
   29398 
   29399     'g'  shift, and go to state 16
   29400 
   29401 
   29402 State 11
   29403 
   29404     6 S: 'c' 'c' . A 'g'
   29405     7  | 'c' 'c' . B
   29406     8 A: . 'd' 'e'
   29407     9 B: . 'd' 'e'
   29408 
   29409     'd'  shift, and go to state 5
   29410 
   29411     A  go to state 17
   29412     B  go to state 18
   29413 
   29414 
   29415 State 12
   29416 
   29417     0 \$accept: S \$end .
   29418 
   29419     \$default  accept
   29420 
   29421 
   29422 State 13
   29423 
   29424     8 A: 'd' 'e' .  ['f', 'g']
   29425     9 B: 'd' 'e' .  [\$end, 'g']
   29426 
   29427     \$end      reduce using rule 9 (B)
   29428     'g'       reduce using rule 8 (A)
   29429     'g'       [reduce using rule 9 (B)]
   29430     \$default  reduce using rule 8 (A)
   29431 
   29432 
   29433 State 14
   29434 
   29435     1 S: 'a' A 'f' .
   29436 
   29437     \$default  reduce using rule 1 (S)
   29438 
   29439 
   29440 State 15
   29441 
   29442     3 S: 'b' A 'f' .
   29443 
   29444     \$default  reduce using rule 3 (S)
   29445 
   29446 
   29447 State 16
   29448 
   29449     4 S: 'b' B 'g' .
   29450 
   29451     \$default  reduce using rule 4 (S)
   29452 
   29453 
   29454 State 17
   29455 
   29456     6 S: 'c' 'c' A . 'g'
   29457 
   29458     'g'  shift, and go to state 19
   29459 
   29460 
   29461 State 18
   29462 
   29463     7 S: 'c' 'c' B .
   29464 
   29465     \$default  reduce using rule 7 (S)
   29466 
   29467 
   29468 State 19
   29469 
   29470     6 S: 'c' 'c' A 'g' .
   29471 
   29472     \$default  reduce using rule 6 (S)
   29473 " | \
   29474   $at_diff - "$at_stdout" || at_failed=:
   29475 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29476 $at_failed && at_fn_log_failure
   29477 $at_traceon; }
   29478 
   29479 
   29480 
   29481 
   29482 # Canonical LR generates very large tables, resulting in very long
   29483 # files with #line directives that may overflow what the standards
   29484 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   29485 # will issue an error.
   29486 #
   29487 # There is no "" around `wc` since some indent the result.
   29488 
   29489 { set +x
   29490 $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS"
   29491 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
   29492 ( $at_check_trace; $BISON_C_WORKS
   29493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29494 at_status=$? at_failed=false
   29495 $at_check_filter
   29496 echo stderr:; cat "$at_stderr"
   29497 echo stdout:; cat "$at_stdout"
   29498 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29499 $at_failed && at_fn_log_failure
   29500 $at_traceon; }
   29501 
   29502 { set +x
   29503 $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   29504 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220"
   29505 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   29506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29507 at_status=$? at_failed=false
   29508 $at_check_filter
   29509 echo stderr:; cat "$at_stderr"
   29510 echo stdout:; cat "$at_stdout"
   29511 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29512 $at_failed && at_fn_log_failure
   29513 $at_traceon; }
   29514 
   29515 
   29516 { set +x
   29517 $as_echo "$at_srcdir/reduce.at:1220:  \$PREPARSER ./input"
   29518 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
   29519 ( $at_check_trace;  $PREPARSER ./input
   29520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29521 at_status=$? at_failed=false
   29522 $at_check_filter
   29523 echo stderr:; tee stderr <"$at_stderr"
   29524 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29525 at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1220"
   29526 $at_failed && at_fn_log_failure
   29527 $at_traceon; }
   29528 
   29529 { set +x
   29530 $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   29531 at_fn_check_prepare_trace "reduce.at:1220"
   29532 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   29533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29534 at_status=$? at_failed=false
   29535 $at_check_filter
   29536 echo >>"$at_stderr"; $as_echo "syntax error
   29537 " | \
   29538   $at_diff - "$at_stderr" || at_failed=:
   29539 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29540 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29541 $at_failed && at_fn_log_failure
   29542 $at_traceon; }
   29543 
   29544 
   29545 
   29546 
   29547   set +x
   29548   $at_times_p && times >"$at_times_file"
   29549 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   29550 read at_status <"$at_status_file"
   29551 #AT_STOP_121
   29552 #AT_START_122
   29553 at_fn_group_banner 122 'reduce.at:1220' \
   29554   "%define lr.type ielr: Split During Added Lookahead Propagation" "" 6
   29555 at_xfail=no
   29556 (
   29557   $as_echo "122. $at_setup_line: testing $at_desc ..."
   29558   $at_traceon
   29559 
   29560 
   29561 cat >input.y <<'_ATEOF'
   29562 %code top {
   29563 #include <config.h>
   29564 /* We don't need perfect functions for these tests. */
   29565 #undef malloc
   29566 #undef memcmp
   29567 #undef realloc
   29568 }
   29569 
   29570 %code {
   29571   #include <stdio.h>
   29572   static void yyerror ( const char *msg);
   29573   static int yylex (void);
   29574 }
   29575 
   29576 %define lr.type ielr
   29577 %define lr.keep-unreachable-states
   29578 
   29579 %%
   29580 
   29581 
   29582 /* The partial state chart diagram below is for LALR(1).  State 0 is the start
   29583    state.  States are iterated for successor construction in numerical order.
   29584    Transitions are downwards.
   29585 
   29586    State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
   29587    algorithm using annotations alone.  That is, when state 11's successor on
   29588    'd' is merged with state 5 (which is originally just state 1's successor on
   29589    'd'), state 5's successor on 'e' must then be changed because the resulting
   29590    lookaheads that propagate to it now make it incompatible with state 8's
   29591    successor on 'e'.  In other words, state 13 must be split to avoid the
   29592    conflict.
   29593 
   29594           0
   29595         / | \
   29596      a / c|  \ b
   29597       1   3   2
   29598       |   |   |
   29599      d|   |c  | d
   29600       |  11   |
   29601       |   |   |
   29602        \ /d   |
   29603         5     8
   29604          \    |
   29605         e \  / e
   29606            13
   29607            R/R
   29608 
   29609    This grammar is designed carefully to make sure that, despite Bison's LR(1)
   29610    algorithm's bread-first iteration of transitions to reconstruct states,
   29611    state 11's successors are constructed after state 5's and state 8's.
   29612    Otherwise (for example, if you remove the first 'c' in each of rules 6 and
   29613    7), state 5's successor on 'e' would never be merged with state 8's, so the
   29614    split of the resulting state 13 would never need to be performed.  */
   29615 S: 'a' A 'f'
   29616  | 'a' B
   29617  | 'b' A 'f'
   29618  | 'b' B 'g'
   29619  | 'b' 'd'
   29620  | 'c' 'c' A 'g'
   29621  | 'c' 'c' B
   29622  ;
   29623 A: 'd' 'e' ;
   29624 B: 'd' 'e' ;
   29625 
   29626 
   29627 %%
   29628 #include <stdio.h>
   29629 /* A C error reporting function.  */
   29630 static
   29631 void yyerror ( const char *msg)
   29632 {
   29633   fprintf (stderr, "%s\n", msg);
   29634 }
   29635 static int
   29636 yylex (void)
   29637 {
   29638   static int const input[] = {
   29639     'b', 'd', 'e', 'g', 0
   29640   };
   29641   static int const *inputp = input;
   29642   return *inputp++;
   29643 }
   29644 
   29645 int
   29646 main (void)
   29647 {
   29648   return yyparse ();
   29649 }
   29650 _ATEOF
   29651 
   29652 
   29653 
   29654 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   29655 # expanding macros, so it corrupts some special characters in the
   29656 # macros.  To avoid this, expand now and pass it the result with proper
   29657 # string quotation.  Assume args 7 through 12 expand to properly quoted
   29658 # strings.
   29659 
   29660 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   29661   at_save_special_files
   29662   mkdir xml-tests
   29663     # Don't combine these Bison invocations since we want to be sure that
   29664   # --report=all isn't required to get the full XML file.
   29665   { set +x
   29666 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   29667                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   29668 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220"
   29669 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   29670                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   29671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29672 at_status=$? at_failed=false
   29673 $at_check_filter
   29674 echo stderr:; cat "$at_stderr"
   29675 echo stdout:; cat "$at_stdout"
   29676 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29677 $at_failed && at_fn_log_failure
   29678 $at_traceon; }
   29679 
   29680   { set +x
   29681 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   29682 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220"
   29683 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   29684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29685 at_status=$? at_failed=false
   29686 $at_check_filter
   29687 echo stderr:; cat "$at_stderr"
   29688 echo stdout:; cat "$at_stdout"
   29689 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29690 $at_failed && at_fn_log_failure
   29691 $at_traceon; }
   29692 
   29693     cp xml-tests/test.output expout
   29694   { set +x
   29695 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   29696              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   29697              xml-tests/test.xml"
   29698 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   29699 ( $at_check_trace; $XSLTPROC \
   29700              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   29701              xml-tests/test.xml
   29702 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29703 at_status=$? at_failed=false
   29704 $at_check_filter
   29705 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29706 $at_diff expout "$at_stdout" || at_failed=:
   29707 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29708 $at_failed && at_fn_log_failure
   29709 $at_traceon; }
   29710 
   29711   sort xml-tests/test.dot > expout
   29712   { set +x
   29713 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   29714              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   29715              xml-tests/test.xml | sort"
   29716 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   29717 ( $at_check_trace; $XSLTPROC \
   29718              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   29719              xml-tests/test.xml | sort
   29720 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29721 at_status=$? at_failed=false
   29722 $at_check_filter
   29723 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29724 $at_diff expout "$at_stdout" || at_failed=:
   29725 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29726 $at_failed && at_fn_log_failure
   29727 $at_traceon; }
   29728 
   29729   rm -rf xml-tests expout
   29730   at_restore_special_files
   29731 fi
   29732 { set +x
   29733 $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
   29734 at_fn_check_prepare_trace "reduce.at:1220"
   29735 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   29736 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29737 at_status=$? at_failed=false
   29738 $at_check_filter
   29739 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29740 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29741 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29742 $at_failed && at_fn_log_failure
   29743 $at_traceon; }
   29744 
   29745 
   29746 
   29747 { set +x
   29748 $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output"
   29749 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220"
   29750 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   29751 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29752 at_status=$? at_failed=false
   29753 $at_check_filter
   29754 at_fn_diff_devnull "$at_stderr" || at_failed=:
   29755 echo >>"$at_stdout"; $as_echo "State 0
   29756 
   29757     0 \$accept: . S \$end
   29758     1 S: . 'a' A 'f'
   29759     2  | . 'a' B
   29760     3  | . 'b' A 'f'
   29761     4  | . 'b' B 'g'
   29762     5  | . 'b' 'd'
   29763     6  | . 'c' 'c' A 'g'
   29764     7  | . 'c' 'c' B
   29765 
   29766     'a'  shift, and go to state 1
   29767     'b'  shift, and go to state 2
   29768     'c'  shift, and go to state 3
   29769 
   29770     S  go to state 4
   29771 
   29772 
   29773 State 1
   29774 
   29775     1 S: 'a' . A 'f'
   29776     2  | 'a' . B
   29777     8 A: . 'd' 'e'
   29778     9 B: . 'd' 'e'
   29779 
   29780     'd'  shift, and go to state 5
   29781 
   29782     A  go to state 6
   29783     B  go to state 7
   29784 
   29785 
   29786 State 2
   29787 
   29788     3 S: 'b' . A 'f'
   29789     4  | 'b' . B 'g'
   29790     5  | 'b' . 'd'
   29791     8 A: . 'd' 'e'
   29792     9 B: . 'd' 'e'
   29793 
   29794     'd'  shift, and go to state 8
   29795 
   29796     A  go to state 9
   29797     B  go to state 10
   29798 
   29799 
   29800 State 3
   29801 
   29802     6 S: 'c' . 'c' A 'g'
   29803     7  | 'c' . 'c' B
   29804 
   29805     'c'  shift, and go to state 11
   29806 
   29807 
   29808 State 4
   29809 
   29810     0 \$accept: S . \$end
   29811 
   29812     \$end  shift, and go to state 12
   29813 
   29814 
   29815 State 5
   29816 
   29817     8 A: 'd' . 'e'
   29818     9 B: 'd' . 'e'
   29819 
   29820     'e'  shift, and go to state 20
   29821 
   29822 
   29823 State 6
   29824 
   29825     1 S: 'a' A . 'f'
   29826 
   29827     'f'  shift, and go to state 14
   29828 
   29829 
   29830 State 7
   29831 
   29832     2 S: 'a' B .
   29833 
   29834     \$default  reduce using rule 2 (S)
   29835 
   29836 
   29837 State 8
   29838 
   29839     5 S: 'b' 'd' .  [\$end]
   29840     8 A: 'd' . 'e'
   29841     9 B: 'd' . 'e'
   29842 
   29843     'e'  shift, and go to state 13
   29844 
   29845     \$default  reduce using rule 5 (S)
   29846 
   29847 
   29848 State 9
   29849 
   29850     3 S: 'b' A . 'f'
   29851 
   29852     'f'  shift, and go to state 15
   29853 
   29854 
   29855 State 10
   29856 
   29857     4 S: 'b' B . 'g'
   29858 
   29859     'g'  shift, and go to state 16
   29860 
   29861 
   29862 State 11
   29863 
   29864     6 S: 'c' 'c' . A 'g'
   29865     7  | 'c' 'c' . B
   29866     8 A: . 'd' 'e'
   29867     9 B: . 'd' 'e'
   29868 
   29869     'd'  shift, and go to state 5
   29870 
   29871     A  go to state 17
   29872     B  go to state 18
   29873 
   29874 
   29875 State 12
   29876 
   29877     0 \$accept: S \$end .
   29878 
   29879     \$default  accept
   29880 
   29881 
   29882 State 13
   29883 
   29884     8 A: 'd' 'e' .  ['f']
   29885     9 B: 'd' 'e' .  ['g']
   29886 
   29887     'g'       reduce using rule 9 (B)
   29888     \$default  reduce using rule 8 (A)
   29889 
   29890 
   29891 State 14
   29892 
   29893     1 S: 'a' A 'f' .
   29894 
   29895     \$default  reduce using rule 1 (S)
   29896 
   29897 
   29898 State 15
   29899 
   29900     3 S: 'b' A 'f' .
   29901 
   29902     \$default  reduce using rule 3 (S)
   29903 
   29904 
   29905 State 16
   29906 
   29907     4 S: 'b' B 'g' .
   29908 
   29909     \$default  reduce using rule 4 (S)
   29910 
   29911 
   29912 State 17
   29913 
   29914     6 S: 'c' 'c' A . 'g'
   29915 
   29916     'g'  shift, and go to state 19
   29917 
   29918 
   29919 State 18
   29920 
   29921     7 S: 'c' 'c' B .
   29922 
   29923     \$default  reduce using rule 7 (S)
   29924 
   29925 
   29926 State 19
   29927 
   29928     6 S: 'c' 'c' A 'g' .
   29929 
   29930     \$default  reduce using rule 6 (S)
   29931 
   29932 
   29933 State 20
   29934 
   29935     8 A: 'd' 'e' .  ['f', 'g']
   29936     9 B: 'd' 'e' .  [\$end]
   29937 
   29938     \$end      reduce using rule 9 (B)
   29939     \$default  reduce using rule 8 (A)
   29940 " | \
   29941   $at_diff - "$at_stdout" || at_failed=:
   29942 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29943 $at_failed && at_fn_log_failure
   29944 $at_traceon; }
   29945 
   29946 
   29947 
   29948 
   29949 # Canonical LR generates very large tables, resulting in very long
   29950 # files with #line directives that may overflow what the standards
   29951 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   29952 # will issue an error.
   29953 #
   29954 # There is no "" around `wc` since some indent the result.
   29955 
   29956 { set +x
   29957 $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS"
   29958 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
   29959 ( $at_check_trace; $BISON_C_WORKS
   29960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29961 at_status=$? at_failed=false
   29962 $at_check_filter
   29963 echo stderr:; cat "$at_stderr"
   29964 echo stdout:; cat "$at_stdout"
   29965 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29966 $at_failed && at_fn_log_failure
   29967 $at_traceon; }
   29968 
   29969 { set +x
   29970 $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   29971 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220"
   29972 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   29973 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29974 at_status=$? at_failed=false
   29975 $at_check_filter
   29976 echo stderr:; cat "$at_stderr"
   29977 echo stdout:; cat "$at_stdout"
   29978 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29979 $at_failed && at_fn_log_failure
   29980 $at_traceon; }
   29981 
   29982 
   29983 { set +x
   29984 $as_echo "$at_srcdir/reduce.at:1220:  \$PREPARSER ./input"
   29985 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
   29986 ( $at_check_trace;  $PREPARSER ./input
   29987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   29988 at_status=$? at_failed=false
   29989 $at_check_filter
   29990 echo stderr:; tee stderr <"$at_stderr"
   29991 at_fn_diff_devnull "$at_stdout" || at_failed=:
   29992 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   29993 $at_failed && at_fn_log_failure
   29994 $at_traceon; }
   29995 
   29996 { set +x
   29997 $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   29998 at_fn_check_prepare_trace "reduce.at:1220"
   29999 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   30000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30001 at_status=$? at_failed=false
   30002 $at_check_filter
   30003 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30004 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30005 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30006 $at_failed && at_fn_log_failure
   30007 $at_traceon; }
   30008 
   30009 
   30010 
   30011 
   30012   set +x
   30013   $at_times_p && times >"$at_times_file"
   30014 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   30015 read at_status <"$at_status_file"
   30016 #AT_STOP_122
   30017 #AT_START_123
   30018 at_fn_group_banner 123 'reduce.at:1220' \
   30019   "%define lr.type canonical-lr: Split During Added Lookahead Propagation" "" 6
   30020 at_xfail=no
   30021 (
   30022   $as_echo "123. $at_setup_line: testing $at_desc ..."
   30023   $at_traceon
   30024 
   30025 
   30026 cat >input.y <<'_ATEOF'
   30027 %code top {
   30028 #include <config.h>
   30029 /* We don't need perfect functions for these tests. */
   30030 #undef malloc
   30031 #undef memcmp
   30032 #undef realloc
   30033 }
   30034 
   30035 %code {
   30036   #include <stdio.h>
   30037   static void yyerror ( const char *msg);
   30038   static int yylex (void);
   30039 }
   30040 
   30041 %define lr.type canonical-lr
   30042 %define lr.keep-unreachable-states
   30043 
   30044 %%
   30045 
   30046 
   30047 /* The partial state chart diagram below is for LALR(1).  State 0 is the start
   30048    state.  States are iterated for successor construction in numerical order.
   30049    Transitions are downwards.
   30050 
   30051    State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
   30052    algorithm using annotations alone.  That is, when state 11's successor on
   30053    'd' is merged with state 5 (which is originally just state 1's successor on
   30054    'd'), state 5's successor on 'e' must then be changed because the resulting
   30055    lookaheads that propagate to it now make it incompatible with state 8's
   30056    successor on 'e'.  In other words, state 13 must be split to avoid the
   30057    conflict.
   30058 
   30059           0
   30060         / | \
   30061      a / c|  \ b
   30062       1   3   2
   30063       |   |   |
   30064      d|   |c  | d
   30065       |  11   |
   30066       |   |   |
   30067        \ /d   |
   30068         5     8
   30069          \    |
   30070         e \  / e
   30071            13
   30072            R/R
   30073 
   30074    This grammar is designed carefully to make sure that, despite Bison's LR(1)
   30075    algorithm's bread-first iteration of transitions to reconstruct states,
   30076    state 11's successors are constructed after state 5's and state 8's.
   30077    Otherwise (for example, if you remove the first 'c' in each of rules 6 and
   30078    7), state 5's successor on 'e' would never be merged with state 8's, so the
   30079    split of the resulting state 13 would never need to be performed.  */
   30080 S: 'a' A 'f'
   30081  | 'a' B
   30082  | 'b' A 'f'
   30083  | 'b' B 'g'
   30084  | 'b' 'd'
   30085  | 'c' 'c' A 'g'
   30086  | 'c' 'c' B
   30087  ;
   30088 A: 'd' 'e' ;
   30089 B: 'd' 'e' ;
   30090 
   30091 
   30092 %%
   30093 #include <stdio.h>
   30094 /* A C error reporting function.  */
   30095 static
   30096 void yyerror ( const char *msg)
   30097 {
   30098   fprintf (stderr, "%s\n", msg);
   30099 }
   30100 static int
   30101 yylex (void)
   30102 {
   30103   static int const input[] = {
   30104     'b', 'd', 'e', 'g', 0
   30105   };
   30106   static int const *inputp = input;
   30107   return *inputp++;
   30108 }
   30109 
   30110 int
   30111 main (void)
   30112 {
   30113   return yyparse ();
   30114 }
   30115 _ATEOF
   30116 
   30117 
   30118 
   30119 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   30120 # expanding macros, so it corrupts some special characters in the
   30121 # macros.  To avoid this, expand now and pass it the result with proper
   30122 # string quotation.  Assume args 7 through 12 expand to properly quoted
   30123 # strings.
   30124 
   30125 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   30126   at_save_special_files
   30127   mkdir xml-tests
   30128     # Don't combine these Bison invocations since we want to be sure that
   30129   # --report=all isn't required to get the full XML file.
   30130   { set +x
   30131 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   30132                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   30133 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1220"
   30134 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   30135                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   30136 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30137 at_status=$? at_failed=false
   30138 $at_check_filter
   30139 echo stderr:; cat "$at_stderr"
   30140 echo stdout:; cat "$at_stdout"
   30141 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30142 $at_failed && at_fn_log_failure
   30143 $at_traceon; }
   30144 
   30145   { set +x
   30146 $as_echo "$at_srcdir/reduce.at:1220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   30147 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1220"
   30148 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   30149 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30150 at_status=$? at_failed=false
   30151 $at_check_filter
   30152 echo stderr:; cat "$at_stderr"
   30153 echo stdout:; cat "$at_stdout"
   30154 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30155 $at_failed && at_fn_log_failure
   30156 $at_traceon; }
   30157 
   30158     cp xml-tests/test.output expout
   30159   { set +x
   30160 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   30161              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   30162              xml-tests/test.xml"
   30163 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   30164 ( $at_check_trace; $XSLTPROC \
   30165              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   30166              xml-tests/test.xml
   30167 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30168 at_status=$? at_failed=false
   30169 $at_check_filter
   30170 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30171 $at_diff expout "$at_stdout" || at_failed=:
   30172 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30173 $at_failed && at_fn_log_failure
   30174 $at_traceon; }
   30175 
   30176   sort xml-tests/test.dot > expout
   30177   { set +x
   30178 $as_echo "$at_srcdir/reduce.at:1220: \$XSLTPROC \\
   30179              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   30180              xml-tests/test.xml | sort"
   30181 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1220"
   30182 ( $at_check_trace; $XSLTPROC \
   30183              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   30184              xml-tests/test.xml | sort
   30185 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30186 at_status=$? at_failed=false
   30187 $at_check_filter
   30188 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30189 $at_diff expout "$at_stdout" || at_failed=:
   30190 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30191 $at_failed && at_fn_log_failure
   30192 $at_traceon; }
   30193 
   30194   rm -rf xml-tests expout
   30195   at_restore_special_files
   30196 fi
   30197 { set +x
   30198 $as_echo "$at_srcdir/reduce.at:1220: bison --report=all --defines -o input.c input.y"
   30199 at_fn_check_prepare_trace "reduce.at:1220"
   30200 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   30201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30202 at_status=$? at_failed=false
   30203 $at_check_filter
   30204 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30206 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30207 $at_failed && at_fn_log_failure
   30208 $at_traceon; }
   30209 
   30210 
   30211 
   30212 { set +x
   30213 $as_echo "$at_srcdir/reduce.at:1220: sed -n '/^State 0\$/,\$p' input.output"
   30214 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1220"
   30215 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   30216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30217 at_status=$? at_failed=false
   30218 $at_check_filter
   30219 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30220 echo >>"$at_stdout"; $as_echo "State 0
   30221 
   30222     0 \$accept: . S \$end
   30223     1 S: . 'a' A 'f'
   30224     2  | . 'a' B
   30225     3  | . 'b' A 'f'
   30226     4  | . 'b' B 'g'
   30227     5  | . 'b' 'd'
   30228     6  | . 'c' 'c' A 'g'
   30229     7  | . 'c' 'c' B
   30230 
   30231     'a'  shift, and go to state 1
   30232     'b'  shift, and go to state 2
   30233     'c'  shift, and go to state 3
   30234 
   30235     S  go to state 4
   30236 
   30237 
   30238 State 1
   30239 
   30240     1 S: 'a' . A 'f'
   30241     2  | 'a' . B
   30242     8 A: . 'd' 'e'
   30243     9 B: . 'd' 'e'
   30244 
   30245     'd'  shift, and go to state 5
   30246 
   30247     A  go to state 6
   30248     B  go to state 7
   30249 
   30250 
   30251 State 2
   30252 
   30253     3 S: 'b' . A 'f'
   30254     4  | 'b' . B 'g'
   30255     5  | 'b' . 'd'
   30256     8 A: . 'd' 'e'
   30257     9 B: . 'd' 'e'
   30258 
   30259     'd'  shift, and go to state 8
   30260 
   30261     A  go to state 9
   30262     B  go to state 10
   30263 
   30264 
   30265 State 3
   30266 
   30267     6 S: 'c' . 'c' A 'g'
   30268     7  | 'c' . 'c' B
   30269 
   30270     'c'  shift, and go to state 11
   30271 
   30272 
   30273 State 4
   30274 
   30275     0 \$accept: S . \$end
   30276 
   30277     \$end  shift, and go to state 12
   30278 
   30279 
   30280 State 5
   30281 
   30282     8 A: 'd' . 'e'
   30283     9 B: 'd' . 'e'
   30284 
   30285     'e'  shift, and go to state 13
   30286 
   30287 
   30288 State 6
   30289 
   30290     1 S: 'a' A . 'f'
   30291 
   30292     'f'  shift, and go to state 14
   30293 
   30294 
   30295 State 7
   30296 
   30297     2 S: 'a' B .  [\$end]
   30298 
   30299     \$end  reduce using rule 2 (S)
   30300 
   30301 
   30302 State 8
   30303 
   30304     5 S: 'b' 'd' .  [\$end]
   30305     8 A: 'd' . 'e'
   30306     9 B: 'd' . 'e'
   30307 
   30308     'e'  shift, and go to state 20
   30309 
   30310     \$end  reduce using rule 5 (S)
   30311 
   30312 
   30313 State 9
   30314 
   30315     3 S: 'b' A . 'f'
   30316 
   30317     'f'  shift, and go to state 15
   30318 
   30319 
   30320 State 10
   30321 
   30322     4 S: 'b' B . 'g'
   30323 
   30324     'g'  shift, and go to state 16
   30325 
   30326 
   30327 State 11
   30328 
   30329     6 S: 'c' 'c' . A 'g'
   30330     7  | 'c' 'c' . B
   30331     8 A: . 'd' 'e'
   30332     9 B: . 'd' 'e'
   30333 
   30334     'd'  shift, and go to state 21
   30335 
   30336     A  go to state 17
   30337     B  go to state 18
   30338 
   30339 
   30340 State 12
   30341 
   30342     0 \$accept: S \$end .
   30343 
   30344     \$default  accept
   30345 
   30346 
   30347 State 13
   30348 
   30349     8 A: 'd' 'e' .  ['f']
   30350     9 B: 'd' 'e' .  [\$end]
   30351 
   30352     \$end  reduce using rule 9 (B)
   30353     'f'   reduce using rule 8 (A)
   30354 
   30355 
   30356 State 14
   30357 
   30358     1 S: 'a' A 'f' .  [\$end]
   30359 
   30360     \$end  reduce using rule 1 (S)
   30361 
   30362 
   30363 State 15
   30364 
   30365     3 S: 'b' A 'f' .  [\$end]
   30366 
   30367     \$end  reduce using rule 3 (S)
   30368 
   30369 
   30370 State 16
   30371 
   30372     4 S: 'b' B 'g' .  [\$end]
   30373 
   30374     \$end  reduce using rule 4 (S)
   30375 
   30376 
   30377 State 17
   30378 
   30379     6 S: 'c' 'c' A . 'g'
   30380 
   30381     'g'  shift, and go to state 19
   30382 
   30383 
   30384 State 18
   30385 
   30386     7 S: 'c' 'c' B .  [\$end]
   30387 
   30388     \$end  reduce using rule 7 (S)
   30389 
   30390 
   30391 State 19
   30392 
   30393     6 S: 'c' 'c' A 'g' .  [\$end]
   30394 
   30395     \$end  reduce using rule 6 (S)
   30396 
   30397 
   30398 State 20
   30399 
   30400     8 A: 'd' 'e' .  ['f']
   30401     9 B: 'd' 'e' .  ['g']
   30402 
   30403     'f'  reduce using rule 8 (A)
   30404     'g'  reduce using rule 9 (B)
   30405 
   30406 
   30407 State 21
   30408 
   30409     8 A: 'd' . 'e'
   30410     9 B: 'd' . 'e'
   30411 
   30412     'e'  shift, and go to state 22
   30413 
   30414 
   30415 State 22
   30416 
   30417     8 A: 'd' 'e' .  ['g']
   30418     9 B: 'd' 'e' .  [\$end]
   30419 
   30420     \$end  reduce using rule 9 (B)
   30421     'g'   reduce using rule 8 (A)
   30422 " | \
   30423   $at_diff - "$at_stdout" || at_failed=:
   30424 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30425 $at_failed && at_fn_log_failure
   30426 $at_traceon; }
   30427 
   30428 
   30429 
   30430 
   30431 # Canonical LR generates very large tables, resulting in very long
   30432 # files with #line directives that may overflow what the standards
   30433 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   30434 # will issue an error.
   30435 #
   30436 # There is no "" around `wc` since some indent the result.
   30437 if test 32767 -lt `wc -l < input.c`; then
   30438   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   30439   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   30440 fi
   30441 { set +x
   30442 $as_echo "$at_srcdir/reduce.at:1220: \$BISON_C_WORKS"
   30443 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1220"
   30444 ( $at_check_trace; $BISON_C_WORKS
   30445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30446 at_status=$? at_failed=false
   30447 $at_check_filter
   30448 echo stderr:; cat "$at_stderr"
   30449 echo stdout:; cat "$at_stdout"
   30450 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30451 $at_failed && at_fn_log_failure
   30452 $at_traceon; }
   30453 
   30454 { set +x
   30455 $as_echo "$at_srcdir/reduce.at:1220: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   30456 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1220"
   30457 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   30458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30459 at_status=$? at_failed=false
   30460 $at_check_filter
   30461 echo stderr:; cat "$at_stderr"
   30462 echo stdout:; cat "$at_stdout"
   30463 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30464 $at_failed && at_fn_log_failure
   30465 $at_traceon; }
   30466 
   30467 
   30468 { set +x
   30469 $as_echo "$at_srcdir/reduce.at:1220:  \$PREPARSER ./input"
   30470 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1220"
   30471 ( $at_check_trace;  $PREPARSER ./input
   30472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30473 at_status=$? at_failed=false
   30474 $at_check_filter
   30475 echo stderr:; tee stderr <"$at_stderr"
   30476 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30477 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30478 $at_failed && at_fn_log_failure
   30479 $at_traceon; }
   30480 
   30481 { set +x
   30482 $as_echo "$at_srcdir/reduce.at:1220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   30483 at_fn_check_prepare_trace "reduce.at:1220"
   30484 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   30485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30486 at_status=$? at_failed=false
   30487 $at_check_filter
   30488 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30489 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30490 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1220"
   30491 $at_failed && at_fn_log_failure
   30492 $at_traceon; }
   30493 
   30494 
   30495 
   30496 
   30497   set +x
   30498   $at_times_p && times >"$at_times_file"
   30499 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   30500 read at_status <"$at_status_file"
   30501 #AT_STOP_123
   30502 #AT_START_124
   30503 at_fn_group_banner 124 'reduce.at:1550' \
   30504   "no %define lr.default-reductions" "               " 6
   30505 at_xfail=no
   30506 (
   30507   $as_echo "124. $at_setup_line: testing $at_desc ..."
   30508   $at_traceon
   30509 
   30510 
   30511 cat >input.y <<'_ATEOF'
   30512 %code top {
   30513 #include <config.h>
   30514 /* We don't need perfect functions for these tests. */
   30515 #undef malloc
   30516 #undef memcmp
   30517 #undef realloc
   30518 }
   30519 
   30520 %code {
   30521   #include <stdio.h>
   30522   static void yyerror ( const char *msg);
   30523   static int yylex (void);
   30524 }
   30525 
   30526 
   30527 
   30528 %%
   30529 
   30530 
   30531 /* The start state is consistent and has a shift on 'a' and no reductions.
   30532    After pushing the b below, enter an inconsistent state that has a shift and
   30533    one reduction with one lookahead.  */
   30534 start:
   30535     a b
   30536   | a b 'a'
   30537   | a c 'b'
   30538   ;
   30539 
   30540 /* After shifting this 'a', enter a consistent state that has no shift and 1
   30541    reduction with multiple lookaheads.  */
   30542 a: 'a' ;
   30543 
   30544 /* After the previous reduction, enter an inconsistent state that has no shift
   30545    and multiple reductions.  The first reduction has more lookaheads than the
   30546    second, so the first should always be preferred as the default reduction if
   30547    enabled.  The second reduction has one lookahead.  */
   30548 b: ;
   30549 c: ;
   30550 
   30551 
   30552 %%
   30553 #include <stdio.h>
   30554 /* A C error reporting function.  */
   30555 static
   30556 void yyerror ( const char *msg)
   30557 {
   30558   fprintf (stderr, "%s\n", msg);
   30559 }
   30560 static int
   30561 yylex (void)
   30562 {
   30563   static int const input[] = {
   30564     'a', 'a', 0
   30565   };
   30566   static int const *inputp = input;
   30567   return *inputp++;
   30568 }
   30569 
   30570 int
   30571 main (void)
   30572 {
   30573   return yyparse ();
   30574 }
   30575 _ATEOF
   30576 
   30577 
   30578 
   30579 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   30580 # expanding macros, so it corrupts some special characters in the
   30581 # macros.  To avoid this, expand now and pass it the result with proper
   30582 # string quotation.  Assume args 7 through 12 expand to properly quoted
   30583 # strings.
   30584 
   30585 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   30586   at_save_special_files
   30587   mkdir xml-tests
   30588     # Don't combine these Bison invocations since we want to be sure that
   30589   # --report=all isn't required to get the full XML file.
   30590   { set +x
   30591 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   30592                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   30593 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550"
   30594 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   30595                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   30596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30597 at_status=$? at_failed=false
   30598 $at_check_filter
   30599 echo stderr:; cat "$at_stderr"
   30600 echo stdout:; cat "$at_stdout"
   30601 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30602 $at_failed && at_fn_log_failure
   30603 $at_traceon; }
   30604 
   30605   { set +x
   30606 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   30607 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550"
   30608 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   30609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30610 at_status=$? at_failed=false
   30611 $at_check_filter
   30612 echo stderr:; cat "$at_stderr"
   30613 echo stdout:; cat "$at_stdout"
   30614 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30615 $at_failed && at_fn_log_failure
   30616 $at_traceon; }
   30617 
   30618     cp xml-tests/test.output expout
   30619   { set +x
   30620 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   30621              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   30622              xml-tests/test.xml"
   30623 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   30624 ( $at_check_trace; $XSLTPROC \
   30625              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   30626              xml-tests/test.xml
   30627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30628 at_status=$? at_failed=false
   30629 $at_check_filter
   30630 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30631 $at_diff expout "$at_stdout" || at_failed=:
   30632 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30633 $at_failed && at_fn_log_failure
   30634 $at_traceon; }
   30635 
   30636   sort xml-tests/test.dot > expout
   30637   { set +x
   30638 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   30639              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   30640              xml-tests/test.xml | sort"
   30641 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   30642 ( $at_check_trace; $XSLTPROC \
   30643              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   30644              xml-tests/test.xml | sort
   30645 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30646 at_status=$? at_failed=false
   30647 $at_check_filter
   30648 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30649 $at_diff expout "$at_stdout" || at_failed=:
   30650 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30651 $at_failed && at_fn_log_failure
   30652 $at_traceon; }
   30653 
   30654   rm -rf xml-tests expout
   30655   at_restore_special_files
   30656 fi
   30657 { set +x
   30658 $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
   30659 at_fn_check_prepare_trace "reduce.at:1550"
   30660 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   30661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30662 at_status=$? at_failed=false
   30663 $at_check_filter
   30664 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30665 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30666 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30667 $at_failed && at_fn_log_failure
   30668 $at_traceon; }
   30669 
   30670 
   30671 
   30672 { set +x
   30673 $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output"
   30674 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550"
   30675 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   30676 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30677 at_status=$? at_failed=false
   30678 $at_check_filter
   30679 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30680 echo >>"$at_stdout"; $as_echo "State 0
   30681 
   30682     0 \$accept: . start \$end
   30683     1 start: . a b
   30684     2      | . a b 'a'
   30685     3      | . a c 'b'
   30686     4 a: . 'a'
   30687 
   30688     'a'  shift, and go to state 1
   30689 
   30690     start  go to state 2
   30691     a      go to state 3
   30692 
   30693 
   30694 State 1
   30695 
   30696     4 a: 'a' .
   30697 
   30698     \$default  reduce using rule 4 (a)
   30699 
   30700 
   30701 State 2
   30702 
   30703     0 \$accept: start . \$end
   30704 
   30705     \$end  shift, and go to state 4
   30706 
   30707 
   30708 State 3
   30709 
   30710     1 start: a . b
   30711     2      | a . b 'a'
   30712     3      | a . c 'b'
   30713     5 b: .  [\$end, 'a']
   30714     6 c: .  ['b']
   30715 
   30716     'b'       reduce using rule 6 (c)
   30717     \$default  reduce using rule 5 (b)
   30718 
   30719     b  go to state 5
   30720     c  go to state 6
   30721 
   30722 
   30723 State 4
   30724 
   30725     0 \$accept: start \$end .
   30726 
   30727     \$default  accept
   30728 
   30729 
   30730 State 5
   30731 
   30732     1 start: a b .  [\$end]
   30733     2      | a b . 'a'
   30734 
   30735     'a'  shift, and go to state 7
   30736 
   30737     \$default  reduce using rule 1 (start)
   30738 
   30739 
   30740 State 6
   30741 
   30742     3 start: a c . 'b'
   30743 
   30744     'b'  shift, and go to state 8
   30745 
   30746 
   30747 State 7
   30748 
   30749     2 start: a b 'a' .
   30750 
   30751     \$default  reduce using rule 2 (start)
   30752 
   30753 
   30754 State 8
   30755 
   30756     3 start: a c 'b' .
   30757 
   30758     \$default  reduce using rule 3 (start)
   30759 " | \
   30760   $at_diff - "$at_stdout" || at_failed=:
   30761 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30762 $at_failed && at_fn_log_failure
   30763 $at_traceon; }
   30764 
   30765 
   30766 
   30767 
   30768 # Canonical LR generates very large tables, resulting in very long
   30769 # files with #line directives that may overflow what the standards
   30770 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   30771 # will issue an error.
   30772 #
   30773 # There is no "" around `wc` since some indent the result.
   30774 
   30775 { set +x
   30776 $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS"
   30777 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
   30778 ( $at_check_trace; $BISON_C_WORKS
   30779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30780 at_status=$? at_failed=false
   30781 $at_check_filter
   30782 echo stderr:; cat "$at_stderr"
   30783 echo stdout:; cat "$at_stdout"
   30784 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30785 $at_failed && at_fn_log_failure
   30786 $at_traceon; }
   30787 
   30788 { set +x
   30789 $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   30790 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550"
   30791 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   30792 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30793 at_status=$? at_failed=false
   30794 $at_check_filter
   30795 echo stderr:; cat "$at_stderr"
   30796 echo stdout:; cat "$at_stdout"
   30797 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30798 $at_failed && at_fn_log_failure
   30799 $at_traceon; }
   30800 
   30801 
   30802 { set +x
   30803 $as_echo "$at_srcdir/reduce.at:1550:  \$PREPARSER ./input"
   30804 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
   30805 ( $at_check_trace;  $PREPARSER ./input
   30806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30807 at_status=$? at_failed=false
   30808 $at_check_filter
   30809 echo stderr:; tee stderr <"$at_stderr"
   30810 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30811 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30812 $at_failed && at_fn_log_failure
   30813 $at_traceon; }
   30814 
   30815 { set +x
   30816 $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   30817 at_fn_check_prepare_trace "reduce.at:1550"
   30818 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   30819 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30820 at_status=$? at_failed=false
   30821 $at_check_filter
   30822 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30823 at_fn_diff_devnull "$at_stdout" || at_failed=:
   30824 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30825 $at_failed && at_fn_log_failure
   30826 $at_traceon; }
   30827 
   30828 
   30829 
   30830 
   30831   set +x
   30832   $at_times_p && times >"$at_times_file"
   30833 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   30834 read at_status <"$at_status_file"
   30835 #AT_STOP_124
   30836 #AT_START_125
   30837 at_fn_group_banner 125 'reduce.at:1550' \
   30838   "%define lr.default-reductions most" "             " 6
   30839 at_xfail=no
   30840 (
   30841   $as_echo "125. $at_setup_line: testing $at_desc ..."
   30842   $at_traceon
   30843 
   30844 
   30845 cat >input.y <<'_ATEOF'
   30846 %code top {
   30847 #include <config.h>
   30848 /* We don't need perfect functions for these tests. */
   30849 #undef malloc
   30850 #undef memcmp
   30851 #undef realloc
   30852 }
   30853 
   30854 %code {
   30855   #include <stdio.h>
   30856   static void yyerror ( const char *msg);
   30857   static int yylex (void);
   30858 }
   30859 
   30860 %define lr.default-reductions most
   30861 
   30862 %%
   30863 
   30864 
   30865 /* The start state is consistent and has a shift on 'a' and no reductions.
   30866    After pushing the b below, enter an inconsistent state that has a shift and
   30867    one reduction with one lookahead.  */
   30868 start:
   30869     a b
   30870   | a b 'a'
   30871   | a c 'b'
   30872   ;
   30873 
   30874 /* After shifting this 'a', enter a consistent state that has no shift and 1
   30875    reduction with multiple lookaheads.  */
   30876 a: 'a' ;
   30877 
   30878 /* After the previous reduction, enter an inconsistent state that has no shift
   30879    and multiple reductions.  The first reduction has more lookaheads than the
   30880    second, so the first should always be preferred as the default reduction if
   30881    enabled.  The second reduction has one lookahead.  */
   30882 b: ;
   30883 c: ;
   30884 
   30885 
   30886 %%
   30887 #include <stdio.h>
   30888 /* A C error reporting function.  */
   30889 static
   30890 void yyerror ( const char *msg)
   30891 {
   30892   fprintf (stderr, "%s\n", msg);
   30893 }
   30894 static int
   30895 yylex (void)
   30896 {
   30897   static int const input[] = {
   30898     'a', 'a', 0
   30899   };
   30900   static int const *inputp = input;
   30901   return *inputp++;
   30902 }
   30903 
   30904 int
   30905 main (void)
   30906 {
   30907   return yyparse ();
   30908 }
   30909 _ATEOF
   30910 
   30911 
   30912 
   30913 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   30914 # expanding macros, so it corrupts some special characters in the
   30915 # macros.  To avoid this, expand now and pass it the result with proper
   30916 # string quotation.  Assume args 7 through 12 expand to properly quoted
   30917 # strings.
   30918 
   30919 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   30920   at_save_special_files
   30921   mkdir xml-tests
   30922     # Don't combine these Bison invocations since we want to be sure that
   30923   # --report=all isn't required to get the full XML file.
   30924   { set +x
   30925 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   30926                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   30927 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550"
   30928 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   30929                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   30930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30931 at_status=$? at_failed=false
   30932 $at_check_filter
   30933 echo stderr:; cat "$at_stderr"
   30934 echo stdout:; cat "$at_stdout"
   30935 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30936 $at_failed && at_fn_log_failure
   30937 $at_traceon; }
   30938 
   30939   { set +x
   30940 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   30941 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550"
   30942 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   30943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30944 at_status=$? at_failed=false
   30945 $at_check_filter
   30946 echo stderr:; cat "$at_stderr"
   30947 echo stdout:; cat "$at_stdout"
   30948 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30949 $at_failed && at_fn_log_failure
   30950 $at_traceon; }
   30951 
   30952     cp xml-tests/test.output expout
   30953   { set +x
   30954 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   30955              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   30956              xml-tests/test.xml"
   30957 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   30958 ( $at_check_trace; $XSLTPROC \
   30959              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   30960              xml-tests/test.xml
   30961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30962 at_status=$? at_failed=false
   30963 $at_check_filter
   30964 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30965 $at_diff expout "$at_stdout" || at_failed=:
   30966 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30967 $at_failed && at_fn_log_failure
   30968 $at_traceon; }
   30969 
   30970   sort xml-tests/test.dot > expout
   30971   { set +x
   30972 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   30973              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   30974              xml-tests/test.xml | sort"
   30975 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   30976 ( $at_check_trace; $XSLTPROC \
   30977              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   30978              xml-tests/test.xml | sort
   30979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30980 at_status=$? at_failed=false
   30981 $at_check_filter
   30982 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30983 $at_diff expout "$at_stdout" || at_failed=:
   30984 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   30985 $at_failed && at_fn_log_failure
   30986 $at_traceon; }
   30987 
   30988   rm -rf xml-tests expout
   30989   at_restore_special_files
   30990 fi
   30991 { set +x
   30992 $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
   30993 at_fn_check_prepare_trace "reduce.at:1550"
   30994 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   30995 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   30996 at_status=$? at_failed=false
   30997 $at_check_filter
   30998 at_fn_diff_devnull "$at_stderr" || at_failed=:
   30999 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31000 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31001 $at_failed && at_fn_log_failure
   31002 $at_traceon; }
   31003 
   31004 
   31005 
   31006 { set +x
   31007 $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output"
   31008 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550"
   31009 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   31010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31011 at_status=$? at_failed=false
   31012 $at_check_filter
   31013 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31014 echo >>"$at_stdout"; $as_echo "State 0
   31015 
   31016     0 \$accept: . start \$end
   31017     1 start: . a b
   31018     2      | . a b 'a'
   31019     3      | . a c 'b'
   31020     4 a: . 'a'
   31021 
   31022     'a'  shift, and go to state 1
   31023 
   31024     start  go to state 2
   31025     a      go to state 3
   31026 
   31027 
   31028 State 1
   31029 
   31030     4 a: 'a' .
   31031 
   31032     \$default  reduce using rule 4 (a)
   31033 
   31034 
   31035 State 2
   31036 
   31037     0 \$accept: start . \$end
   31038 
   31039     \$end  shift, and go to state 4
   31040 
   31041 
   31042 State 3
   31043 
   31044     1 start: a . b
   31045     2      | a . b 'a'
   31046     3      | a . c 'b'
   31047     5 b: .  [\$end, 'a']
   31048     6 c: .  ['b']
   31049 
   31050     'b'       reduce using rule 6 (c)
   31051     \$default  reduce using rule 5 (b)
   31052 
   31053     b  go to state 5
   31054     c  go to state 6
   31055 
   31056 
   31057 State 4
   31058 
   31059     0 \$accept: start \$end .
   31060 
   31061     \$default  accept
   31062 
   31063 
   31064 State 5
   31065 
   31066     1 start: a b .  [\$end]
   31067     2      | a b . 'a'
   31068 
   31069     'a'  shift, and go to state 7
   31070 
   31071     \$default  reduce using rule 1 (start)
   31072 
   31073 
   31074 State 6
   31075 
   31076     3 start: a c . 'b'
   31077 
   31078     'b'  shift, and go to state 8
   31079 
   31080 
   31081 State 7
   31082 
   31083     2 start: a b 'a' .
   31084 
   31085     \$default  reduce using rule 2 (start)
   31086 
   31087 
   31088 State 8
   31089 
   31090     3 start: a c 'b' .
   31091 
   31092     \$default  reduce using rule 3 (start)
   31093 " | \
   31094   $at_diff - "$at_stdout" || at_failed=:
   31095 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31096 $at_failed && at_fn_log_failure
   31097 $at_traceon; }
   31098 
   31099 
   31100 
   31101 
   31102 # Canonical LR generates very large tables, resulting in very long
   31103 # files with #line directives that may overflow what the standards
   31104 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   31105 # will issue an error.
   31106 #
   31107 # There is no "" around `wc` since some indent the result.
   31108 
   31109 { set +x
   31110 $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS"
   31111 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
   31112 ( $at_check_trace; $BISON_C_WORKS
   31113 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31114 at_status=$? at_failed=false
   31115 $at_check_filter
   31116 echo stderr:; cat "$at_stderr"
   31117 echo stdout:; cat "$at_stdout"
   31118 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31119 $at_failed && at_fn_log_failure
   31120 $at_traceon; }
   31121 
   31122 { set +x
   31123 $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   31124 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550"
   31125 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   31126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31127 at_status=$? at_failed=false
   31128 $at_check_filter
   31129 echo stderr:; cat "$at_stderr"
   31130 echo stdout:; cat "$at_stdout"
   31131 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31132 $at_failed && at_fn_log_failure
   31133 $at_traceon; }
   31134 
   31135 
   31136 { set +x
   31137 $as_echo "$at_srcdir/reduce.at:1550:  \$PREPARSER ./input"
   31138 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
   31139 ( $at_check_trace;  $PREPARSER ./input
   31140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31141 at_status=$? at_failed=false
   31142 $at_check_filter
   31143 echo stderr:; tee stderr <"$at_stderr"
   31144 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31145 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31146 $at_failed && at_fn_log_failure
   31147 $at_traceon; }
   31148 
   31149 { set +x
   31150 $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   31151 at_fn_check_prepare_trace "reduce.at:1550"
   31152 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   31153 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31154 at_status=$? at_failed=false
   31155 $at_check_filter
   31156 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31157 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31158 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31159 $at_failed && at_fn_log_failure
   31160 $at_traceon; }
   31161 
   31162 
   31163 
   31164 
   31165   set +x
   31166   $at_times_p && times >"$at_times_file"
   31167 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   31168 read at_status <"$at_status_file"
   31169 #AT_STOP_125
   31170 #AT_START_126
   31171 at_fn_group_banner 126 'reduce.at:1550' \
   31172   "%define lr.default-reductions consistent" "       " 6
   31173 at_xfail=no
   31174 (
   31175   $as_echo "126. $at_setup_line: testing $at_desc ..."
   31176   $at_traceon
   31177 
   31178 
   31179 cat >input.y <<'_ATEOF'
   31180 %code top {
   31181 #include <config.h>
   31182 /* We don't need perfect functions for these tests. */
   31183 #undef malloc
   31184 #undef memcmp
   31185 #undef realloc
   31186 }
   31187 
   31188 %code {
   31189   #include <stdio.h>
   31190   static void yyerror ( const char *msg);
   31191   static int yylex (void);
   31192 }
   31193 
   31194 %define lr.default-reductions consistent
   31195 
   31196 %%
   31197 
   31198 
   31199 /* The start state is consistent and has a shift on 'a' and no reductions.
   31200    After pushing the b below, enter an inconsistent state that has a shift and
   31201    one reduction with one lookahead.  */
   31202 start:
   31203     a b
   31204   | a b 'a'
   31205   | a c 'b'
   31206   ;
   31207 
   31208 /* After shifting this 'a', enter a consistent state that has no shift and 1
   31209    reduction with multiple lookaheads.  */
   31210 a: 'a' ;
   31211 
   31212 /* After the previous reduction, enter an inconsistent state that has no shift
   31213    and multiple reductions.  The first reduction has more lookaheads than the
   31214    second, so the first should always be preferred as the default reduction if
   31215    enabled.  The second reduction has one lookahead.  */
   31216 b: ;
   31217 c: ;
   31218 
   31219 
   31220 %%
   31221 #include <stdio.h>
   31222 /* A C error reporting function.  */
   31223 static
   31224 void yyerror ( const char *msg)
   31225 {
   31226   fprintf (stderr, "%s\n", msg);
   31227 }
   31228 static int
   31229 yylex (void)
   31230 {
   31231   static int const input[] = {
   31232     'a', 'a', 0
   31233   };
   31234   static int const *inputp = input;
   31235   return *inputp++;
   31236 }
   31237 
   31238 int
   31239 main (void)
   31240 {
   31241   return yyparse ();
   31242 }
   31243 _ATEOF
   31244 
   31245 
   31246 
   31247 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   31248 # expanding macros, so it corrupts some special characters in the
   31249 # macros.  To avoid this, expand now and pass it the result with proper
   31250 # string quotation.  Assume args 7 through 12 expand to properly quoted
   31251 # strings.
   31252 
   31253 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   31254   at_save_special_files
   31255   mkdir xml-tests
   31256     # Don't combine these Bison invocations since we want to be sure that
   31257   # --report=all isn't required to get the full XML file.
   31258   { set +x
   31259 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   31260                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   31261 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550"
   31262 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   31263                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   31264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31265 at_status=$? at_failed=false
   31266 $at_check_filter
   31267 echo stderr:; cat "$at_stderr"
   31268 echo stdout:; cat "$at_stdout"
   31269 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31270 $at_failed && at_fn_log_failure
   31271 $at_traceon; }
   31272 
   31273   { set +x
   31274 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   31275 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550"
   31276 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   31277 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31278 at_status=$? at_failed=false
   31279 $at_check_filter
   31280 echo stderr:; cat "$at_stderr"
   31281 echo stdout:; cat "$at_stdout"
   31282 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31283 $at_failed && at_fn_log_failure
   31284 $at_traceon; }
   31285 
   31286     cp xml-tests/test.output expout
   31287   { set +x
   31288 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   31289              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   31290              xml-tests/test.xml"
   31291 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   31292 ( $at_check_trace; $XSLTPROC \
   31293              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   31294              xml-tests/test.xml
   31295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31296 at_status=$? at_failed=false
   31297 $at_check_filter
   31298 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31299 $at_diff expout "$at_stdout" || at_failed=:
   31300 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31301 $at_failed && at_fn_log_failure
   31302 $at_traceon; }
   31303 
   31304   sort xml-tests/test.dot > expout
   31305   { set +x
   31306 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   31307              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   31308              xml-tests/test.xml | sort"
   31309 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   31310 ( $at_check_trace; $XSLTPROC \
   31311              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   31312              xml-tests/test.xml | sort
   31313 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31314 at_status=$? at_failed=false
   31315 $at_check_filter
   31316 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31317 $at_diff expout "$at_stdout" || at_failed=:
   31318 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31319 $at_failed && at_fn_log_failure
   31320 $at_traceon; }
   31321 
   31322   rm -rf xml-tests expout
   31323   at_restore_special_files
   31324 fi
   31325 { set +x
   31326 $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
   31327 at_fn_check_prepare_trace "reduce.at:1550"
   31328 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   31329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31330 at_status=$? at_failed=false
   31331 $at_check_filter
   31332 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31333 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31334 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31335 $at_failed && at_fn_log_failure
   31336 $at_traceon; }
   31337 
   31338 
   31339 
   31340 { set +x
   31341 $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output"
   31342 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550"
   31343 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   31344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31345 at_status=$? at_failed=false
   31346 $at_check_filter
   31347 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31348 echo >>"$at_stdout"; $as_echo "State 0
   31349 
   31350     0 \$accept: . start \$end
   31351     1 start: . a b
   31352     2      | . a b 'a'
   31353     3      | . a c 'b'
   31354     4 a: . 'a'
   31355 
   31356     'a'  shift, and go to state 1
   31357 
   31358     start  go to state 2
   31359     a      go to state 3
   31360 
   31361 
   31362 State 1
   31363 
   31364     4 a: 'a' .
   31365 
   31366     \$default  reduce using rule 4 (a)
   31367 
   31368 
   31369 State 2
   31370 
   31371     0 \$accept: start . \$end
   31372 
   31373     \$end  shift, and go to state 4
   31374 
   31375 
   31376 State 3
   31377 
   31378     1 start: a . b
   31379     2      | a . b 'a'
   31380     3      | a . c 'b'
   31381     5 b: .  [\$end, 'a']
   31382     6 c: .  ['b']
   31383 
   31384     \$end  reduce using rule 5 (b)
   31385     'a'   reduce using rule 5 (b)
   31386     'b'   reduce using rule 6 (c)
   31387 
   31388     b  go to state 5
   31389     c  go to state 6
   31390 
   31391 
   31392 State 4
   31393 
   31394     0 \$accept: start \$end .
   31395 
   31396     \$default  accept
   31397 
   31398 
   31399 State 5
   31400 
   31401     1 start: a b .  [\$end]
   31402     2      | a b . 'a'
   31403 
   31404     'a'  shift, and go to state 7
   31405 
   31406     \$end  reduce using rule 1 (start)
   31407 
   31408 
   31409 State 6
   31410 
   31411     3 start: a c . 'b'
   31412 
   31413     'b'  shift, and go to state 8
   31414 
   31415 
   31416 State 7
   31417 
   31418     2 start: a b 'a' .
   31419 
   31420     \$default  reduce using rule 2 (start)
   31421 
   31422 
   31423 State 8
   31424 
   31425     3 start: a c 'b' .
   31426 
   31427     \$default  reduce using rule 3 (start)
   31428 " | \
   31429   $at_diff - "$at_stdout" || at_failed=:
   31430 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31431 $at_failed && at_fn_log_failure
   31432 $at_traceon; }
   31433 
   31434 
   31435 
   31436 
   31437 # Canonical LR generates very large tables, resulting in very long
   31438 # files with #line directives that may overflow what the standards
   31439 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   31440 # will issue an error.
   31441 #
   31442 # There is no "" around `wc` since some indent the result.
   31443 
   31444 { set +x
   31445 $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS"
   31446 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
   31447 ( $at_check_trace; $BISON_C_WORKS
   31448 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31449 at_status=$? at_failed=false
   31450 $at_check_filter
   31451 echo stderr:; cat "$at_stderr"
   31452 echo stdout:; cat "$at_stdout"
   31453 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31454 $at_failed && at_fn_log_failure
   31455 $at_traceon; }
   31456 
   31457 { set +x
   31458 $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   31459 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550"
   31460 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   31461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31462 at_status=$? at_failed=false
   31463 $at_check_filter
   31464 echo stderr:; cat "$at_stderr"
   31465 echo stdout:; cat "$at_stdout"
   31466 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31467 $at_failed && at_fn_log_failure
   31468 $at_traceon; }
   31469 
   31470 
   31471 { set +x
   31472 $as_echo "$at_srcdir/reduce.at:1550:  \$PREPARSER ./input"
   31473 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
   31474 ( $at_check_trace;  $PREPARSER ./input
   31475 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31476 at_status=$? at_failed=false
   31477 $at_check_filter
   31478 echo stderr:; tee stderr <"$at_stderr"
   31479 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31480 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31481 $at_failed && at_fn_log_failure
   31482 $at_traceon; }
   31483 
   31484 { set +x
   31485 $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   31486 at_fn_check_prepare_trace "reduce.at:1550"
   31487 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   31488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31489 at_status=$? at_failed=false
   31490 $at_check_filter
   31491 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31492 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31493 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31494 $at_failed && at_fn_log_failure
   31495 $at_traceon; }
   31496 
   31497 
   31498 
   31499 
   31500   set +x
   31501   $at_times_p && times >"$at_times_file"
   31502 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   31503 read at_status <"$at_status_file"
   31504 #AT_STOP_126
   31505 #AT_START_127
   31506 at_fn_group_banner 127 'reduce.at:1550' \
   31507   "%define lr.default-reductions accepting" "        " 6
   31508 at_xfail=no
   31509 (
   31510   $as_echo "127. $at_setup_line: testing $at_desc ..."
   31511   $at_traceon
   31512 
   31513 
   31514 cat >input.y <<'_ATEOF'
   31515 %code top {
   31516 #include <config.h>
   31517 /* We don't need perfect functions for these tests. */
   31518 #undef malloc
   31519 #undef memcmp
   31520 #undef realloc
   31521 }
   31522 
   31523 %code {
   31524   #include <stdio.h>
   31525   static void yyerror ( const char *msg);
   31526   static int yylex (void);
   31527 }
   31528 
   31529 %define lr.default-reductions accepting
   31530 
   31531 %%
   31532 
   31533 
   31534 /* The start state is consistent and has a shift on 'a' and no reductions.
   31535    After pushing the b below, enter an inconsistent state that has a shift and
   31536    one reduction with one lookahead.  */
   31537 start:
   31538     a b
   31539   | a b 'a'
   31540   | a c 'b'
   31541   ;
   31542 
   31543 /* After shifting this 'a', enter a consistent state that has no shift and 1
   31544    reduction with multiple lookaheads.  */
   31545 a: 'a' ;
   31546 
   31547 /* After the previous reduction, enter an inconsistent state that has no shift
   31548    and multiple reductions.  The first reduction has more lookaheads than the
   31549    second, so the first should always be preferred as the default reduction if
   31550    enabled.  The second reduction has one lookahead.  */
   31551 b: ;
   31552 c: ;
   31553 
   31554 
   31555 %%
   31556 #include <stdio.h>
   31557 /* A C error reporting function.  */
   31558 static
   31559 void yyerror ( const char *msg)
   31560 {
   31561   fprintf (stderr, "%s\n", msg);
   31562 }
   31563 static int
   31564 yylex (void)
   31565 {
   31566   static int const input[] = {
   31567     'a', 'a', 0
   31568   };
   31569   static int const *inputp = input;
   31570   return *inputp++;
   31571 }
   31572 
   31573 int
   31574 main (void)
   31575 {
   31576   return yyparse ();
   31577 }
   31578 _ATEOF
   31579 
   31580 
   31581 
   31582 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   31583 # expanding macros, so it corrupts some special characters in the
   31584 # macros.  To avoid this, expand now and pass it the result with proper
   31585 # string quotation.  Assume args 7 through 12 expand to properly quoted
   31586 # strings.
   31587 
   31588 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   31589   at_save_special_files
   31590   mkdir xml-tests
   31591     # Don't combine these Bison invocations since we want to be sure that
   31592   # --report=all isn't required to get the full XML file.
   31593   { set +x
   31594 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   31595                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   31596 at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1550"
   31597 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   31598                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   31599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31600 at_status=$? at_failed=false
   31601 $at_check_filter
   31602 echo stderr:; cat "$at_stderr"
   31603 echo stdout:; cat "$at_stdout"
   31604 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31605 $at_failed && at_fn_log_failure
   31606 $at_traceon; }
   31607 
   31608   { set +x
   31609 $as_echo "$at_srcdir/reduce.at:1550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   31610 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "reduce.at:1550"
   31611 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   31612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31613 at_status=$? at_failed=false
   31614 $at_check_filter
   31615 echo stderr:; cat "$at_stderr"
   31616 echo stdout:; cat "$at_stdout"
   31617 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31618 $at_failed && at_fn_log_failure
   31619 $at_traceon; }
   31620 
   31621     cp xml-tests/test.output expout
   31622   { set +x
   31623 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   31624              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   31625              xml-tests/test.xml"
   31626 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   31627 ( $at_check_trace; $XSLTPROC \
   31628              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   31629              xml-tests/test.xml
   31630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31631 at_status=$? at_failed=false
   31632 $at_check_filter
   31633 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31634 $at_diff expout "$at_stdout" || at_failed=:
   31635 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31636 $at_failed && at_fn_log_failure
   31637 $at_traceon; }
   31638 
   31639   sort xml-tests/test.dot > expout
   31640   { set +x
   31641 $as_echo "$at_srcdir/reduce.at:1550: \$XSLTPROC \\
   31642              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   31643              xml-tests/test.xml | sort"
   31644 at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1550"
   31645 ( $at_check_trace; $XSLTPROC \
   31646              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   31647              xml-tests/test.xml | sort
   31648 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31649 at_status=$? at_failed=false
   31650 $at_check_filter
   31651 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31652 $at_diff expout "$at_stdout" || at_failed=:
   31653 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31654 $at_failed && at_fn_log_failure
   31655 $at_traceon; }
   31656 
   31657   rm -rf xml-tests expout
   31658   at_restore_special_files
   31659 fi
   31660 { set +x
   31661 $as_echo "$at_srcdir/reduce.at:1550: bison --report=all --defines -o input.c input.y"
   31662 at_fn_check_prepare_trace "reduce.at:1550"
   31663 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   31664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31665 at_status=$? at_failed=false
   31666 $at_check_filter
   31667 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31668 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31669 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31670 $at_failed && at_fn_log_failure
   31671 $at_traceon; }
   31672 
   31673 
   31674 
   31675 { set +x
   31676 $as_echo "$at_srcdir/reduce.at:1550: sed -n '/^State 0\$/,\$p' input.output"
   31677 at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1550"
   31678 ( $at_check_trace; sed -n '/^State 0$/,$p' input.output
   31679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31680 at_status=$? at_failed=false
   31681 $at_check_filter
   31682 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31683 echo >>"$at_stdout"; $as_echo "State 0
   31684 
   31685     0 \$accept: . start \$end
   31686     1 start: . a b
   31687     2      | . a b 'a'
   31688     3      | . a c 'b'
   31689     4 a: . 'a'
   31690 
   31691     'a'  shift, and go to state 1
   31692 
   31693     start  go to state 2
   31694     a      go to state 3
   31695 
   31696 
   31697 State 1
   31698 
   31699     4 a: 'a' .  [\$end, 'a', 'b']
   31700 
   31701     \$end  reduce using rule 4 (a)
   31702     'a'   reduce using rule 4 (a)
   31703     'b'   reduce using rule 4 (a)
   31704 
   31705 
   31706 State 2
   31707 
   31708     0 \$accept: start . \$end
   31709 
   31710     \$end  shift, and go to state 4
   31711 
   31712 
   31713 State 3
   31714 
   31715     1 start: a . b
   31716     2      | a . b 'a'
   31717     3      | a . c 'b'
   31718     5 b: .  [\$end, 'a']
   31719     6 c: .  ['b']
   31720 
   31721     \$end  reduce using rule 5 (b)
   31722     'a'   reduce using rule 5 (b)
   31723     'b'   reduce using rule 6 (c)
   31724 
   31725     b  go to state 5
   31726     c  go to state 6
   31727 
   31728 
   31729 State 4
   31730 
   31731     0 \$accept: start \$end .
   31732 
   31733     \$default  accept
   31734 
   31735 
   31736 State 5
   31737 
   31738     1 start: a b .  [\$end]
   31739     2      | a b . 'a'
   31740 
   31741     'a'  shift, and go to state 7
   31742 
   31743     \$end  reduce using rule 1 (start)
   31744 
   31745 
   31746 State 6
   31747 
   31748     3 start: a c . 'b'
   31749 
   31750     'b'  shift, and go to state 8
   31751 
   31752 
   31753 State 7
   31754 
   31755     2 start: a b 'a' .  [\$end]
   31756 
   31757     \$end  reduce using rule 2 (start)
   31758 
   31759 
   31760 State 8
   31761 
   31762     3 start: a c 'b' .  [\$end]
   31763 
   31764     \$end  reduce using rule 3 (start)
   31765 " | \
   31766   $at_diff - "$at_stdout" || at_failed=:
   31767 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31768 $at_failed && at_fn_log_failure
   31769 $at_traceon; }
   31770 
   31771 
   31772 
   31773 
   31774 # Canonical LR generates very large tables, resulting in very long
   31775 # files with #line directives that may overflow what the standards
   31776 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   31777 # will issue an error.
   31778 #
   31779 # There is no "" around `wc` since some indent the result.
   31780 
   31781 { set +x
   31782 $as_echo "$at_srcdir/reduce.at:1550: \$BISON_C_WORKS"
   31783 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1550"
   31784 ( $at_check_trace; $BISON_C_WORKS
   31785 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31786 at_status=$? at_failed=false
   31787 $at_check_filter
   31788 echo stderr:; cat "$at_stderr"
   31789 echo stdout:; cat "$at_stdout"
   31790 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31791 $at_failed && at_fn_log_failure
   31792 $at_traceon; }
   31793 
   31794 { set +x
   31795 $as_echo "$at_srcdir/reduce.at:1550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   31796 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1550"
   31797 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   31798 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31799 at_status=$? at_failed=false
   31800 $at_check_filter
   31801 echo stderr:; cat "$at_stderr"
   31802 echo stdout:; cat "$at_stdout"
   31803 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31804 $at_failed && at_fn_log_failure
   31805 $at_traceon; }
   31806 
   31807 
   31808 { set +x
   31809 $as_echo "$at_srcdir/reduce.at:1550:  \$PREPARSER ./input"
   31810 at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1550"
   31811 ( $at_check_trace;  $PREPARSER ./input
   31812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31813 at_status=$? at_failed=false
   31814 $at_check_filter
   31815 echo stderr:; tee stderr <"$at_stderr"
   31816 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31817 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31818 $at_failed && at_fn_log_failure
   31819 $at_traceon; }
   31820 
   31821 { set +x
   31822 $as_echo "$at_srcdir/reduce.at:1550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   31823 at_fn_check_prepare_trace "reduce.at:1550"
   31824 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   31825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31826 at_status=$? at_failed=false
   31827 $at_check_filter
   31828 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31829 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31830 at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1550"
   31831 $at_failed && at_fn_log_failure
   31832 $at_traceon; }
   31833 
   31834 
   31835 
   31836 
   31837   set +x
   31838   $at_times_p && times >"$at_times_file"
   31839 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   31840 read at_status <"$at_status_file"
   31841 #AT_STOP_127
   31842 #AT_START_128
   31843 at_fn_group_banner 128 'synclines.at:150' \
   31844   "Prologue syncline" "                              " 7
   31845 at_xfail=no
   31846 (
   31847   $as_echo "128. $at_setup_line: testing $at_desc ..."
   31848   $at_traceon
   31849 
   31850 
   31851 # It seems impossible to find a generic scheme to check the location
   31852 # of an error.  Even requiring GCC is not sufficient, since for instance
   31853 # the version modified by Apple:
   31854 #
   31855 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   31856 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   31857 # | 19991024 (release) configure:2124: $? = 0
   31858 #
   31859 # instead of:
   31860 #
   31861 # | input.y:2: #error "2"
   31862 #
   31863 # it reports:
   31864 #
   31865 # | input.y:2: "2"
   31866 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   31867 
   31868 cat >syncline.c <<'_ATEOF'
   31869 #error "1"
   31870 int i; /* avoids -pedantic warning about an empty translation unit. */
   31871 _ATEOF
   31872 
   31873 
   31874 { set +x
   31875 $as_echo "$at_srcdir/synclines.at:150: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   31876 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:150"
   31877 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
   31878 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31879 at_status=$? at_failed=false
   31880 $at_check_filter
   31881 echo stderr:; tee stderr <"$at_stderr"
   31882 at_fn_diff_devnull "$at_stdout" || at_failed=:
   31883 at_fn_check_skip $at_status "$at_srcdir/synclines.at:150"
   31884 $at_failed && at_fn_log_failure
   31885 $at_traceon; }
   31886 
   31887 
   31888 # Transform stderr into something like this:
   31889 #
   31890 #   input.y:4: #error "4"
   31891 #
   31892 # In case GCC displays column information, strip it down.
   31893 #
   31894 #   input.y:4:2: #error "4"    or
   31895 #   input.y:4.2: #error "4"    or
   31896 #   input.y:4:2: error: #error "4"
   31897 # =>
   31898 #   input.y:4: #error "4"
   31899 #
   31900 # It may also issue more context information:
   31901 #
   31902 #   input.y: In function 'yyparse':
   31903 #   input.y:8: #error "8"
   31904 # =>
   31905 #   input.y:4: #error "8"
   31906 #
   31907 # The message may include a caret-error (indented by GCC 4.8,
   31908 # not by clang 3.2):
   31909 #
   31910 #   input.y:1:2: error: #error "1"
   31911 #    #error "1"
   31912 #     ^
   31913 #
   31914 # Possibly distcc adds its bits.
   31915 #
   31916 #   distcc[33187] ERROR: compile (null) on localhost failed
   31917 #   syncline.c:1:2: error: #error "1"
   31918 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   31919 #
   31920 # or even
   31921 #
   31922 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   31923 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   31924 #
   31925 # The compiler might end by the number of messages issued (Clang 3.2):
   31926 #
   31927 #    syncline.c:1:2: error: "1"
   31928 #    #error "1"
   31929 #     ^
   31930 #    1 error generated.
   31931 #
   31932 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   31933 #
   31934 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   31935 
   31936 { set +x
   31937 $as_echo "$at_srcdir/synclines.at:150: \$PERL -p -0777 - stderr <<\\EOF
   31938   # 1. Remove useless lines.
   31939 
   31940   # distcc clutter.
   31941   s/^distcc\\[\\d+\\] .*\\n//gm;
   31942   # c vs. c++.
   31943   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   31944   # Function context.
   31945   s/^[^:]*: In function '[^']+':\\n//gm;
   31946   # Caret error.
   31947   s/^ *#error.*\\n *\\^\\n//gm;
   31948   # Number of errors.
   31949   s/^1 error generated\\.\\n//gm;
   31950 
   31951   # 2. Normalize the lines we kept.
   31952 
   31953   # Remove column.
   31954   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   31955   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   31956   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   31957 EOF
   31958 "
   31959 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:150"
   31960 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   31961   # 1. Remove useless lines.
   31962 
   31963   # distcc clutter.
   31964   s/^distcc\[\d+\] .*\n//gm;
   31965   # c vs. c++.
   31966   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   31967   # Function context.
   31968   s/^[^:]*: In function '[^']+':\n//gm;
   31969   # Caret error.
   31970   s/^ *#error.*\n *\^\n//gm;
   31971   # Number of errors.
   31972   s/^1 error generated\.\n//gm;
   31973 
   31974   # 2. Normalize the lines we kept.
   31975 
   31976   # Remove column.
   31977   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   31978   # Map all combinations of "error: " and "#error: " to "#error ".
   31979   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   31980 EOF
   31981 
   31982 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31983 at_status=$? at_failed=false
   31984 $at_check_filter
   31985 at_fn_diff_devnull "$at_stderr" || at_failed=:
   31986 echo stdout:; tee stdout <"$at_stdout"
   31987 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   31988 $at_failed && at_fn_log_failure
   31989 $at_traceon; }
   31990 
   31991 
   31992 { set +x
   31993 $as_echo "$at_srcdir/synclines.at:150: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   31994 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:150"
   31995 ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
   31996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   31997 at_status=$? at_failed=false
   31998 $at_check_filter
   31999 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32000 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32001 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32002 $at_failed && at_fn_log_failure
   32003 $at_traceon; }
   32004 
   32005 
   32006 cat >input.y <<'_ATEOF'
   32007 %{
   32008 #error "2"
   32009 void yyerror ( const char *msg);
   32010 int yylex (void);
   32011 %}
   32012 %%
   32013 exp: '0';
   32014 %%
   32015 _ATEOF
   32016 
   32017 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   32018   at_save_special_files
   32019   mkdir xml-tests
   32020     # Don't combine these Bison invocations since we want to be sure that
   32021   # --report=all isn't required to get the full XML file.
   32022   { set +x
   32023 $as_echo "$at_srcdir/synclines.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   32024                   --graph=xml-tests/test.dot -o input.c input.y"
   32025 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:150"
   32026 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   32027                   --graph=xml-tests/test.dot -o input.c input.y
   32028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32029 at_status=$? at_failed=false
   32030 $at_check_filter
   32031 echo stderr:; cat "$at_stderr"
   32032 echo stdout:; cat "$at_stdout"
   32033 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32034 $at_failed && at_fn_log_failure
   32035 $at_traceon; }
   32036 
   32037   { set +x
   32038 $as_echo "$at_srcdir/synclines.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   32039 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:150"
   32040 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   32041 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32042 at_status=$? at_failed=false
   32043 $at_check_filter
   32044 echo stderr:; cat "$at_stderr"
   32045 echo stdout:; cat "$at_stdout"
   32046 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32047 $at_failed && at_fn_log_failure
   32048 $at_traceon; }
   32049 
   32050     cp xml-tests/test.output expout
   32051   { set +x
   32052 $as_echo "$at_srcdir/synclines.at:150: \$XSLTPROC \\
   32053              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   32054              xml-tests/test.xml"
   32055 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:150"
   32056 ( $at_check_trace; $XSLTPROC \
   32057              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   32058              xml-tests/test.xml
   32059 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32060 at_status=$? at_failed=false
   32061 $at_check_filter
   32062 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32063 $at_diff expout "$at_stdout" || at_failed=:
   32064 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32065 $at_failed && at_fn_log_failure
   32066 $at_traceon; }
   32067 
   32068   sort xml-tests/test.dot > expout
   32069   { set +x
   32070 $as_echo "$at_srcdir/synclines.at:150: \$XSLTPROC \\
   32071              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   32072              xml-tests/test.xml | sort"
   32073 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:150"
   32074 ( $at_check_trace; $XSLTPROC \
   32075              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   32076              xml-tests/test.xml | sort
   32077 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32078 at_status=$? at_failed=false
   32079 $at_check_filter
   32080 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32081 $at_diff expout "$at_stdout" || at_failed=:
   32082 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32083 $at_failed && at_fn_log_failure
   32084 $at_traceon; }
   32085 
   32086   rm -rf xml-tests expout
   32087   at_restore_special_files
   32088 fi
   32089 { set +x
   32090 $as_echo "$at_srcdir/synclines.at:150: bison -o input.c input.y"
   32091 at_fn_check_prepare_trace "synclines.at:150"
   32092 ( $at_check_trace; bison -o input.c input.y
   32093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32094 at_status=$? at_failed=false
   32095 $at_check_filter
   32096 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32097 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32098 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32099 $at_failed && at_fn_log_failure
   32100 $at_traceon; }
   32101 
   32102 
   32103 { set +x
   32104 $as_echo "$at_srcdir/synclines.at:150: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   32105 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:150"
   32106 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
   32107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32108 at_status=$? at_failed=false
   32109 $at_check_filter
   32110 echo stderr:; tee stderr <"$at_stderr"
   32111 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32112 at_fn_check_skip $at_status "$at_srcdir/synclines.at:150"
   32113 $at_failed && at_fn_log_failure
   32114 $at_traceon; }
   32115 
   32116 
   32117 # Transform stderr into something like this:
   32118 #
   32119 #   input.y:4: #error "4"
   32120 #
   32121 # In case GCC displays column information, strip it down.
   32122 #
   32123 #   input.y:4:2: #error "4"    or
   32124 #   input.y:4.2: #error "4"    or
   32125 #   input.y:4:2: error: #error "4"
   32126 # =>
   32127 #   input.y:4: #error "4"
   32128 #
   32129 # It may also issue more context information:
   32130 #
   32131 #   input.y: In function 'yyparse':
   32132 #   input.y:8: #error "8"
   32133 # =>
   32134 #   input.y:4: #error "8"
   32135 #
   32136 # The message may include a caret-error (indented by GCC 4.8,
   32137 # not by clang 3.2):
   32138 #
   32139 #   input.y:1:2: error: #error "1"
   32140 #    #error "1"
   32141 #     ^
   32142 #
   32143 # Possibly distcc adds its bits.
   32144 #
   32145 #   distcc[33187] ERROR: compile (null) on localhost failed
   32146 #   syncline.c:1:2: error: #error "1"
   32147 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   32148 #
   32149 # or even
   32150 #
   32151 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   32152 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   32153 #
   32154 # The compiler might end by the number of messages issued (Clang 3.2):
   32155 #
   32156 #    syncline.c:1:2: error: "1"
   32157 #    #error "1"
   32158 #     ^
   32159 #    1 error generated.
   32160 #
   32161 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   32162 #
   32163 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   32164 
   32165 { set +x
   32166 $as_echo "$at_srcdir/synclines.at:150: \$PERL -p -0777 - stderr <<\\EOF
   32167   # 1. Remove useless lines.
   32168 
   32169   # distcc clutter.
   32170   s/^distcc\\[\\d+\\] .*\\n//gm;
   32171   # c vs. c++.
   32172   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   32173   # Function context.
   32174   s/^[^:]*: In function '[^']+':\\n//gm;
   32175   # Caret error.
   32176   s/^ *#error.*\\n *\\^\\n//gm;
   32177   # Number of errors.
   32178   s/^1 error generated\\.\\n//gm;
   32179 
   32180   # 2. Normalize the lines we kept.
   32181 
   32182   # Remove column.
   32183   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   32184   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   32185   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   32186 EOF
   32187 "
   32188 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:150"
   32189 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   32190   # 1. Remove useless lines.
   32191 
   32192   # distcc clutter.
   32193   s/^distcc\[\d+\] .*\n//gm;
   32194   # c vs. c++.
   32195   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   32196   # Function context.
   32197   s/^[^:]*: In function '[^']+':\n//gm;
   32198   # Caret error.
   32199   s/^ *#error.*\n *\^\n//gm;
   32200   # Number of errors.
   32201   s/^1 error generated\.\n//gm;
   32202 
   32203   # 2. Normalize the lines we kept.
   32204 
   32205   # Remove column.
   32206   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   32207   # Map all combinations of "error: " and "#error: " to "#error ".
   32208   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   32209 EOF
   32210 
   32211 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32212 at_status=$? at_failed=false
   32213 $at_check_filter
   32214 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32215 echo stdout:; tee stdout <"$at_stdout"
   32216 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32217 $at_failed && at_fn_log_failure
   32218 $at_traceon; }
   32219 
   32220 
   32221 { set +x
   32222 $as_echo "$at_srcdir/synclines.at:150: cat stdout"
   32223 at_fn_check_prepare_trace "synclines.at:150"
   32224 ( $at_check_trace; cat stdout
   32225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32226 at_status=$? at_failed=false
   32227 $at_check_filter
   32228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32229 echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
   32230 " | \
   32231   $at_diff - "$at_stdout" || at_failed=:
   32232 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:150"
   32233 $at_failed && at_fn_log_failure
   32234 $at_traceon; }
   32235 
   32236 
   32237   set +x
   32238   $at_times_p && times >"$at_times_file"
   32239 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   32240 read at_status <"$at_status_file"
   32241 #AT_STOP_128
   32242 #AT_START_129
   32243 at_fn_group_banner 129 'synclines.at:168' \
   32244   "%union syncline" "                                " 7
   32245 at_xfail=no
   32246 (
   32247   $as_echo "129. $at_setup_line: testing $at_desc ..."
   32248   $at_traceon
   32249 
   32250 
   32251 # It seems impossible to find a generic scheme to check the location
   32252 # of an error.  Even requiring GCC is not sufficient, since for instance
   32253 # the version modified by Apple:
   32254 #
   32255 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   32256 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   32257 # | 19991024 (release) configure:2124: $? = 0
   32258 #
   32259 # instead of:
   32260 #
   32261 # | input.y:2: #error "2"
   32262 #
   32263 # it reports:
   32264 #
   32265 # | input.y:2: "2"
   32266 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   32267 
   32268 cat >syncline.c <<'_ATEOF'
   32269 #error "1"
   32270 int i; /* avoids -pedantic warning about an empty translation unit. */
   32271 _ATEOF
   32272 
   32273 
   32274 { set +x
   32275 $as_echo "$at_srcdir/synclines.at:168: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   32276 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:168"
   32277 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
   32278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32279 at_status=$? at_failed=false
   32280 $at_check_filter
   32281 echo stderr:; tee stderr <"$at_stderr"
   32282 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32283 at_fn_check_skip $at_status "$at_srcdir/synclines.at:168"
   32284 $at_failed && at_fn_log_failure
   32285 $at_traceon; }
   32286 
   32287 
   32288 # Transform stderr into something like this:
   32289 #
   32290 #   input.y:4: #error "4"
   32291 #
   32292 # In case GCC displays column information, strip it down.
   32293 #
   32294 #   input.y:4:2: #error "4"    or
   32295 #   input.y:4.2: #error "4"    or
   32296 #   input.y:4:2: error: #error "4"
   32297 # =>
   32298 #   input.y:4: #error "4"
   32299 #
   32300 # It may also issue more context information:
   32301 #
   32302 #   input.y: In function 'yyparse':
   32303 #   input.y:8: #error "8"
   32304 # =>
   32305 #   input.y:4: #error "8"
   32306 #
   32307 # The message may include a caret-error (indented by GCC 4.8,
   32308 # not by clang 3.2):
   32309 #
   32310 #   input.y:1:2: error: #error "1"
   32311 #    #error "1"
   32312 #     ^
   32313 #
   32314 # Possibly distcc adds its bits.
   32315 #
   32316 #   distcc[33187] ERROR: compile (null) on localhost failed
   32317 #   syncline.c:1:2: error: #error "1"
   32318 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   32319 #
   32320 # or even
   32321 #
   32322 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   32323 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   32324 #
   32325 # The compiler might end by the number of messages issued (Clang 3.2):
   32326 #
   32327 #    syncline.c:1:2: error: "1"
   32328 #    #error "1"
   32329 #     ^
   32330 #    1 error generated.
   32331 #
   32332 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   32333 #
   32334 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   32335 
   32336 { set +x
   32337 $as_echo "$at_srcdir/synclines.at:168: \$PERL -p -0777 - stderr <<\\EOF
   32338   # 1. Remove useless lines.
   32339 
   32340   # distcc clutter.
   32341   s/^distcc\\[\\d+\\] .*\\n//gm;
   32342   # c vs. c++.
   32343   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   32344   # Function context.
   32345   s/^[^:]*: In function '[^']+':\\n//gm;
   32346   # Caret error.
   32347   s/^ *#error.*\\n *\\^\\n//gm;
   32348   # Number of errors.
   32349   s/^1 error generated\\.\\n//gm;
   32350 
   32351   # 2. Normalize the lines we kept.
   32352 
   32353   # Remove column.
   32354   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   32355   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   32356   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   32357 EOF
   32358 "
   32359 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:168"
   32360 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   32361   # 1. Remove useless lines.
   32362 
   32363   # distcc clutter.
   32364   s/^distcc\[\d+\] .*\n//gm;
   32365   # c vs. c++.
   32366   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   32367   # Function context.
   32368   s/^[^:]*: In function '[^']+':\n//gm;
   32369   # Caret error.
   32370   s/^ *#error.*\n *\^\n//gm;
   32371   # Number of errors.
   32372   s/^1 error generated\.\n//gm;
   32373 
   32374   # 2. Normalize the lines we kept.
   32375 
   32376   # Remove column.
   32377   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   32378   # Map all combinations of "error: " and "#error: " to "#error ".
   32379   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   32380 EOF
   32381 
   32382 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32383 at_status=$? at_failed=false
   32384 $at_check_filter
   32385 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32386 echo stdout:; tee stdout <"$at_stdout"
   32387 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32388 $at_failed && at_fn_log_failure
   32389 $at_traceon; }
   32390 
   32391 
   32392 { set +x
   32393 $as_echo "$at_srcdir/synclines.at:168: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   32394 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:168"
   32395 ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
   32396 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32397 at_status=$? at_failed=false
   32398 $at_check_filter
   32399 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32400 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32401 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32402 $at_failed && at_fn_log_failure
   32403 $at_traceon; }
   32404 
   32405 
   32406 cat >input.y <<'_ATEOF'
   32407 %union {
   32408 #error "2"
   32409   char dummy;
   32410 }
   32411 %{
   32412 void yyerror ( const char *msg);
   32413 int yylex (void);
   32414 %}
   32415 %%
   32416 exp: '0';
   32417 %%
   32418 _ATEOF
   32419 
   32420 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   32421   at_save_special_files
   32422   mkdir xml-tests
   32423     # Don't combine these Bison invocations since we want to be sure that
   32424   # --report=all isn't required to get the full XML file.
   32425   { set +x
   32426 $as_echo "$at_srcdir/synclines.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   32427                   --graph=xml-tests/test.dot -o input.c input.y"
   32428 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:168"
   32429 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   32430                   --graph=xml-tests/test.dot -o input.c input.y
   32431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32432 at_status=$? at_failed=false
   32433 $at_check_filter
   32434 echo stderr:; cat "$at_stderr"
   32435 echo stdout:; cat "$at_stdout"
   32436 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32437 $at_failed && at_fn_log_failure
   32438 $at_traceon; }
   32439 
   32440   { set +x
   32441 $as_echo "$at_srcdir/synclines.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   32442 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:168"
   32443 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   32444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32445 at_status=$? at_failed=false
   32446 $at_check_filter
   32447 echo stderr:; cat "$at_stderr"
   32448 echo stdout:; cat "$at_stdout"
   32449 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32450 $at_failed && at_fn_log_failure
   32451 $at_traceon; }
   32452 
   32453     cp xml-tests/test.output expout
   32454   { set +x
   32455 $as_echo "$at_srcdir/synclines.at:168: \$XSLTPROC \\
   32456              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   32457              xml-tests/test.xml"
   32458 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:168"
   32459 ( $at_check_trace; $XSLTPROC \
   32460              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   32461              xml-tests/test.xml
   32462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32463 at_status=$? at_failed=false
   32464 $at_check_filter
   32465 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32466 $at_diff expout "$at_stdout" || at_failed=:
   32467 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32468 $at_failed && at_fn_log_failure
   32469 $at_traceon; }
   32470 
   32471   sort xml-tests/test.dot > expout
   32472   { set +x
   32473 $as_echo "$at_srcdir/synclines.at:168: \$XSLTPROC \\
   32474              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   32475              xml-tests/test.xml | sort"
   32476 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:168"
   32477 ( $at_check_trace; $XSLTPROC \
   32478              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   32479              xml-tests/test.xml | sort
   32480 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32481 at_status=$? at_failed=false
   32482 $at_check_filter
   32483 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32484 $at_diff expout "$at_stdout" || at_failed=:
   32485 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32486 $at_failed && at_fn_log_failure
   32487 $at_traceon; }
   32488 
   32489   rm -rf xml-tests expout
   32490   at_restore_special_files
   32491 fi
   32492 { set +x
   32493 $as_echo "$at_srcdir/synclines.at:168: bison -o input.c input.y"
   32494 at_fn_check_prepare_trace "synclines.at:168"
   32495 ( $at_check_trace; bison -o input.c input.y
   32496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32497 at_status=$? at_failed=false
   32498 $at_check_filter
   32499 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32500 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32501 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32502 $at_failed && at_fn_log_failure
   32503 $at_traceon; }
   32504 
   32505 
   32506 { set +x
   32507 $as_echo "$at_srcdir/synclines.at:168: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   32508 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:168"
   32509 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
   32510 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32511 at_status=$? at_failed=false
   32512 $at_check_filter
   32513 echo stderr:; tee stderr <"$at_stderr"
   32514 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32515 at_fn_check_skip $at_status "$at_srcdir/synclines.at:168"
   32516 $at_failed && at_fn_log_failure
   32517 $at_traceon; }
   32518 
   32519 
   32520 # Transform stderr into something like this:
   32521 #
   32522 #   input.y:4: #error "4"
   32523 #
   32524 # In case GCC displays column information, strip it down.
   32525 #
   32526 #   input.y:4:2: #error "4"    or
   32527 #   input.y:4.2: #error "4"    or
   32528 #   input.y:4:2: error: #error "4"
   32529 # =>
   32530 #   input.y:4: #error "4"
   32531 #
   32532 # It may also issue more context information:
   32533 #
   32534 #   input.y: In function 'yyparse':
   32535 #   input.y:8: #error "8"
   32536 # =>
   32537 #   input.y:4: #error "8"
   32538 #
   32539 # The message may include a caret-error (indented by GCC 4.8,
   32540 # not by clang 3.2):
   32541 #
   32542 #   input.y:1:2: error: #error "1"
   32543 #    #error "1"
   32544 #     ^
   32545 #
   32546 # Possibly distcc adds its bits.
   32547 #
   32548 #   distcc[33187] ERROR: compile (null) on localhost failed
   32549 #   syncline.c:1:2: error: #error "1"
   32550 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   32551 #
   32552 # or even
   32553 #
   32554 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   32555 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   32556 #
   32557 # The compiler might end by the number of messages issued (Clang 3.2):
   32558 #
   32559 #    syncline.c:1:2: error: "1"
   32560 #    #error "1"
   32561 #     ^
   32562 #    1 error generated.
   32563 #
   32564 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   32565 #
   32566 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   32567 
   32568 { set +x
   32569 $as_echo "$at_srcdir/synclines.at:168: \$PERL -p -0777 - stderr <<\\EOF
   32570   # 1. Remove useless lines.
   32571 
   32572   # distcc clutter.
   32573   s/^distcc\\[\\d+\\] .*\\n//gm;
   32574   # c vs. c++.
   32575   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   32576   # Function context.
   32577   s/^[^:]*: In function '[^']+':\\n//gm;
   32578   # Caret error.
   32579   s/^ *#error.*\\n *\\^\\n//gm;
   32580   # Number of errors.
   32581   s/^1 error generated\\.\\n//gm;
   32582 
   32583   # 2. Normalize the lines we kept.
   32584 
   32585   # Remove column.
   32586   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   32587   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   32588   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   32589 EOF
   32590 "
   32591 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:168"
   32592 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   32593   # 1. Remove useless lines.
   32594 
   32595   # distcc clutter.
   32596   s/^distcc\[\d+\] .*\n//gm;
   32597   # c vs. c++.
   32598   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   32599   # Function context.
   32600   s/^[^:]*: In function '[^']+':\n//gm;
   32601   # Caret error.
   32602   s/^ *#error.*\n *\^\n//gm;
   32603   # Number of errors.
   32604   s/^1 error generated\.\n//gm;
   32605 
   32606   # 2. Normalize the lines we kept.
   32607 
   32608   # Remove column.
   32609   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   32610   # Map all combinations of "error: " and "#error: " to "#error ".
   32611   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   32612 EOF
   32613 
   32614 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32615 at_status=$? at_failed=false
   32616 $at_check_filter
   32617 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32618 echo stdout:; tee stdout <"$at_stdout"
   32619 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32620 $at_failed && at_fn_log_failure
   32621 $at_traceon; }
   32622 
   32623 
   32624 { set +x
   32625 $as_echo "$at_srcdir/synclines.at:168: cat stdout"
   32626 at_fn_check_prepare_trace "synclines.at:168"
   32627 ( $at_check_trace; cat stdout
   32628 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32629 at_status=$? at_failed=false
   32630 $at_check_filter
   32631 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32632 echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
   32633 " | \
   32634   $at_diff - "$at_stdout" || at_failed=:
   32635 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:168"
   32636 $at_failed && at_fn_log_failure
   32637 $at_traceon; }
   32638 
   32639 
   32640   set +x
   32641   $at_times_p && times >"$at_times_file"
   32642 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   32643 read at_status <"$at_status_file"
   32644 #AT_STOP_129
   32645 #AT_START_130
   32646 at_fn_group_banner 130 'synclines.at:189' \
   32647   "Postprologue syncline" "                          " 7
   32648 at_xfail=no
   32649 (
   32650   $as_echo "130. $at_setup_line: testing $at_desc ..."
   32651   $at_traceon
   32652 
   32653 
   32654 # It seems impossible to find a generic scheme to check the location
   32655 # of an error.  Even requiring GCC is not sufficient, since for instance
   32656 # the version modified by Apple:
   32657 #
   32658 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   32659 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   32660 # | 19991024 (release) configure:2124: $? = 0
   32661 #
   32662 # instead of:
   32663 #
   32664 # | input.y:2: #error "2"
   32665 #
   32666 # it reports:
   32667 #
   32668 # | input.y:2: "2"
   32669 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   32670 
   32671 cat >syncline.c <<'_ATEOF'
   32672 #error "1"
   32673 int i; /* avoids -pedantic warning about an empty translation unit. */
   32674 _ATEOF
   32675 
   32676 
   32677 { set +x
   32678 $as_echo "$at_srcdir/synclines.at:189: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   32679 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:189"
   32680 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
   32681 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32682 at_status=$? at_failed=false
   32683 $at_check_filter
   32684 echo stderr:; tee stderr <"$at_stderr"
   32685 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32686 at_fn_check_skip $at_status "$at_srcdir/synclines.at:189"
   32687 $at_failed && at_fn_log_failure
   32688 $at_traceon; }
   32689 
   32690 
   32691 # Transform stderr into something like this:
   32692 #
   32693 #   input.y:4: #error "4"
   32694 #
   32695 # In case GCC displays column information, strip it down.
   32696 #
   32697 #   input.y:4:2: #error "4"    or
   32698 #   input.y:4.2: #error "4"    or
   32699 #   input.y:4:2: error: #error "4"
   32700 # =>
   32701 #   input.y:4: #error "4"
   32702 #
   32703 # It may also issue more context information:
   32704 #
   32705 #   input.y: In function 'yyparse':
   32706 #   input.y:8: #error "8"
   32707 # =>
   32708 #   input.y:4: #error "8"
   32709 #
   32710 # The message may include a caret-error (indented by GCC 4.8,
   32711 # not by clang 3.2):
   32712 #
   32713 #   input.y:1:2: error: #error "1"
   32714 #    #error "1"
   32715 #     ^
   32716 #
   32717 # Possibly distcc adds its bits.
   32718 #
   32719 #   distcc[33187] ERROR: compile (null) on localhost failed
   32720 #   syncline.c:1:2: error: #error "1"
   32721 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   32722 #
   32723 # or even
   32724 #
   32725 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   32726 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   32727 #
   32728 # The compiler might end by the number of messages issued (Clang 3.2):
   32729 #
   32730 #    syncline.c:1:2: error: "1"
   32731 #    #error "1"
   32732 #     ^
   32733 #    1 error generated.
   32734 #
   32735 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   32736 #
   32737 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   32738 
   32739 { set +x
   32740 $as_echo "$at_srcdir/synclines.at:189: \$PERL -p -0777 - stderr <<\\EOF
   32741   # 1. Remove useless lines.
   32742 
   32743   # distcc clutter.
   32744   s/^distcc\\[\\d+\\] .*\\n//gm;
   32745   # c vs. c++.
   32746   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   32747   # Function context.
   32748   s/^[^:]*: In function '[^']+':\\n//gm;
   32749   # Caret error.
   32750   s/^ *#error.*\\n *\\^\\n//gm;
   32751   # Number of errors.
   32752   s/^1 error generated\\.\\n//gm;
   32753 
   32754   # 2. Normalize the lines we kept.
   32755 
   32756   # Remove column.
   32757   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   32758   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   32759   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   32760 EOF
   32761 "
   32762 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:189"
   32763 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   32764   # 1. Remove useless lines.
   32765 
   32766   # distcc clutter.
   32767   s/^distcc\[\d+\] .*\n//gm;
   32768   # c vs. c++.
   32769   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   32770   # Function context.
   32771   s/^[^:]*: In function '[^']+':\n//gm;
   32772   # Caret error.
   32773   s/^ *#error.*\n *\^\n//gm;
   32774   # Number of errors.
   32775   s/^1 error generated\.\n//gm;
   32776 
   32777   # 2. Normalize the lines we kept.
   32778 
   32779   # Remove column.
   32780   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   32781   # Map all combinations of "error: " and "#error: " to "#error ".
   32782   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   32783 EOF
   32784 
   32785 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32786 at_status=$? at_failed=false
   32787 $at_check_filter
   32788 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32789 echo stdout:; tee stdout <"$at_stdout"
   32790 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32791 $at_failed && at_fn_log_failure
   32792 $at_traceon; }
   32793 
   32794 
   32795 { set +x
   32796 $as_echo "$at_srcdir/synclines.at:189: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   32797 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:189"
   32798 ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
   32799 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32800 at_status=$? at_failed=false
   32801 $at_check_filter
   32802 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32803 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32804 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32805 $at_failed && at_fn_log_failure
   32806 $at_traceon; }
   32807 
   32808 
   32809 cat >input.y <<'_ATEOF'
   32810 %{
   32811 void yyerror ( const char *msg);
   32812 int yylex (void);
   32813 %}
   32814 %union
   32815 {
   32816   int ival;
   32817 }
   32818 %{
   32819 #error "10"
   32820 %}
   32821 %%
   32822 exp: '0';
   32823 %%
   32824 _ATEOF
   32825 
   32826 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   32827   at_save_special_files
   32828   mkdir xml-tests
   32829     # Don't combine these Bison invocations since we want to be sure that
   32830   # --report=all isn't required to get the full XML file.
   32831   { set +x
   32832 $as_echo "$at_srcdir/synclines.at:189: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   32833                   --graph=xml-tests/test.dot -o input.c input.y"
   32834 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:189"
   32835 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   32836                   --graph=xml-tests/test.dot -o input.c input.y
   32837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32838 at_status=$? at_failed=false
   32839 $at_check_filter
   32840 echo stderr:; cat "$at_stderr"
   32841 echo stdout:; cat "$at_stdout"
   32842 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32843 $at_failed && at_fn_log_failure
   32844 $at_traceon; }
   32845 
   32846   { set +x
   32847 $as_echo "$at_srcdir/synclines.at:189: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   32848 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:189"
   32849 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   32850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32851 at_status=$? at_failed=false
   32852 $at_check_filter
   32853 echo stderr:; cat "$at_stderr"
   32854 echo stdout:; cat "$at_stdout"
   32855 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32856 $at_failed && at_fn_log_failure
   32857 $at_traceon; }
   32858 
   32859     cp xml-tests/test.output expout
   32860   { set +x
   32861 $as_echo "$at_srcdir/synclines.at:189: \$XSLTPROC \\
   32862              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   32863              xml-tests/test.xml"
   32864 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:189"
   32865 ( $at_check_trace; $XSLTPROC \
   32866              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   32867              xml-tests/test.xml
   32868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32869 at_status=$? at_failed=false
   32870 $at_check_filter
   32871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32872 $at_diff expout "$at_stdout" || at_failed=:
   32873 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32874 $at_failed && at_fn_log_failure
   32875 $at_traceon; }
   32876 
   32877   sort xml-tests/test.dot > expout
   32878   { set +x
   32879 $as_echo "$at_srcdir/synclines.at:189: \$XSLTPROC \\
   32880              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   32881              xml-tests/test.xml | sort"
   32882 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:189"
   32883 ( $at_check_trace; $XSLTPROC \
   32884              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   32885              xml-tests/test.xml | sort
   32886 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32887 at_status=$? at_failed=false
   32888 $at_check_filter
   32889 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32890 $at_diff expout "$at_stdout" || at_failed=:
   32891 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32892 $at_failed && at_fn_log_failure
   32893 $at_traceon; }
   32894 
   32895   rm -rf xml-tests expout
   32896   at_restore_special_files
   32897 fi
   32898 { set +x
   32899 $as_echo "$at_srcdir/synclines.at:189: bison -o input.c input.y"
   32900 at_fn_check_prepare_trace "synclines.at:189"
   32901 ( $at_check_trace; bison -o input.c input.y
   32902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32903 at_status=$? at_failed=false
   32904 $at_check_filter
   32905 at_fn_diff_devnull "$at_stderr" || at_failed=:
   32906 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32907 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   32908 $at_failed && at_fn_log_failure
   32909 $at_traceon; }
   32910 
   32911 
   32912 { set +x
   32913 $as_echo "$at_srcdir/synclines.at:189: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   32914 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:189"
   32915 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
   32916 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   32917 at_status=$? at_failed=false
   32918 $at_check_filter
   32919 echo stderr:; tee stderr <"$at_stderr"
   32920 at_fn_diff_devnull "$at_stdout" || at_failed=:
   32921 at_fn_check_skip $at_status "$at_srcdir/synclines.at:189"
   32922 $at_failed && at_fn_log_failure
   32923 $at_traceon; }
   32924 
   32925 
   32926 # Transform stderr into something like this:
   32927 #
   32928 #   input.y:4: #error "4"
   32929 #
   32930 # In case GCC displays column information, strip it down.
   32931 #
   32932 #   input.y:4:2: #error "4"    or
   32933 #   input.y:4.2: #error "4"    or
   32934 #   input.y:4:2: error: #error "4"
   32935 # =>
   32936 #   input.y:4: #error "4"
   32937 #
   32938 # It may also issue more context information:
   32939 #
   32940 #   input.y: In function 'yyparse':
   32941 #   input.y:8: #error "8"
   32942 # =>
   32943 #   input.y:4: #error "8"
   32944 #
   32945 # The message may include a caret-error (indented by GCC 4.8,
   32946 # not by clang 3.2):
   32947 #
   32948 #   input.y:1:2: error: #error "1"
   32949 #    #error "1"
   32950 #     ^
   32951 #
   32952 # Possibly distcc adds its bits.
   32953 #
   32954 #   distcc[33187] ERROR: compile (null) on localhost failed
   32955 #   syncline.c:1:2: error: #error "1"
   32956 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   32957 #
   32958 # or even
   32959 #
   32960 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   32961 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   32962 #
   32963 # The compiler might end by the number of messages issued (Clang 3.2):
   32964 #
   32965 #    syncline.c:1:2: error: "1"
   32966 #    #error "1"
   32967 #     ^
   32968 #    1 error generated.
   32969 #
   32970 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   32971 #
   32972 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   32973 
   32974 { set +x
   32975 $as_echo "$at_srcdir/synclines.at:189: \$PERL -p -0777 - stderr <<\\EOF
   32976   # 1. Remove useless lines.
   32977 
   32978   # distcc clutter.
   32979   s/^distcc\\[\\d+\\] .*\\n//gm;
   32980   # c vs. c++.
   32981   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   32982   # Function context.
   32983   s/^[^:]*: In function '[^']+':\\n//gm;
   32984   # Caret error.
   32985   s/^ *#error.*\\n *\\^\\n//gm;
   32986   # Number of errors.
   32987   s/^1 error generated\\.\\n//gm;
   32988 
   32989   # 2. Normalize the lines we kept.
   32990 
   32991   # Remove column.
   32992   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   32993   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   32994   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   32995 EOF
   32996 "
   32997 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:189"
   32998 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   32999   # 1. Remove useless lines.
   33000 
   33001   # distcc clutter.
   33002   s/^distcc\[\d+\] .*\n//gm;
   33003   # c vs. c++.
   33004   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   33005   # Function context.
   33006   s/^[^:]*: In function '[^']+':\n//gm;
   33007   # Caret error.
   33008   s/^ *#error.*\n *\^\n//gm;
   33009   # Number of errors.
   33010   s/^1 error generated\.\n//gm;
   33011 
   33012   # 2. Normalize the lines we kept.
   33013 
   33014   # Remove column.
   33015   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   33016   # Map all combinations of "error: " and "#error: " to "#error ".
   33017   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   33018 EOF
   33019 
   33020 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33021 at_status=$? at_failed=false
   33022 $at_check_filter
   33023 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33024 echo stdout:; tee stdout <"$at_stdout"
   33025 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   33026 $at_failed && at_fn_log_failure
   33027 $at_traceon; }
   33028 
   33029 
   33030 { set +x
   33031 $as_echo "$at_srcdir/synclines.at:189: cat stdout"
   33032 at_fn_check_prepare_trace "synclines.at:189"
   33033 ( $at_check_trace; cat stdout
   33034 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33035 at_status=$? at_failed=false
   33036 $at_check_filter
   33037 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33038 echo >>"$at_stdout"; $as_echo "input.y:10: #error \"10\"
   33039 " | \
   33040   $at_diff - "$at_stdout" || at_failed=:
   33041 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:189"
   33042 $at_failed && at_fn_log_failure
   33043 $at_traceon; }
   33044 
   33045 
   33046   set +x
   33047   $at_times_p && times >"$at_times_file"
   33048 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   33049 read at_status <"$at_status_file"
   33050 #AT_STOP_130
   33051 #AT_START_131
   33052 at_fn_group_banner 131 'synclines.at:213' \
   33053   "Action syncline" "                                " 7
   33054 at_xfail=no
   33055 (
   33056   $as_echo "131. $at_setup_line: testing $at_desc ..."
   33057   $at_traceon
   33058 
   33059 
   33060 # It seems impossible to find a generic scheme to check the location
   33061 # of an error.  Even requiring GCC is not sufficient, since for instance
   33062 # the version modified by Apple:
   33063 #
   33064 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   33065 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   33066 # | 19991024 (release) configure:2124: $? = 0
   33067 #
   33068 # instead of:
   33069 #
   33070 # | input.y:2: #error "2"
   33071 #
   33072 # it reports:
   33073 #
   33074 # | input.y:2: "2"
   33075 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   33076 
   33077 cat >syncline.c <<'_ATEOF'
   33078 #error "1"
   33079 int i; /* avoids -pedantic warning about an empty translation unit. */
   33080 _ATEOF
   33081 
   33082 
   33083 { set +x
   33084 $as_echo "$at_srcdir/synclines.at:213: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   33085 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:213"
   33086 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
   33087 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33088 at_status=$? at_failed=false
   33089 $at_check_filter
   33090 echo stderr:; tee stderr <"$at_stderr"
   33091 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33092 at_fn_check_skip $at_status "$at_srcdir/synclines.at:213"
   33093 $at_failed && at_fn_log_failure
   33094 $at_traceon; }
   33095 
   33096 
   33097 # Transform stderr into something like this:
   33098 #
   33099 #   input.y:4: #error "4"
   33100 #
   33101 # In case GCC displays column information, strip it down.
   33102 #
   33103 #   input.y:4:2: #error "4"    or
   33104 #   input.y:4.2: #error "4"    or
   33105 #   input.y:4:2: error: #error "4"
   33106 # =>
   33107 #   input.y:4: #error "4"
   33108 #
   33109 # It may also issue more context information:
   33110 #
   33111 #   input.y: In function 'yyparse':
   33112 #   input.y:8: #error "8"
   33113 # =>
   33114 #   input.y:4: #error "8"
   33115 #
   33116 # The message may include a caret-error (indented by GCC 4.8,
   33117 # not by clang 3.2):
   33118 #
   33119 #   input.y:1:2: error: #error "1"
   33120 #    #error "1"
   33121 #     ^
   33122 #
   33123 # Possibly distcc adds its bits.
   33124 #
   33125 #   distcc[33187] ERROR: compile (null) on localhost failed
   33126 #   syncline.c:1:2: error: #error "1"
   33127 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   33128 #
   33129 # or even
   33130 #
   33131 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   33132 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   33133 #
   33134 # The compiler might end by the number of messages issued (Clang 3.2):
   33135 #
   33136 #    syncline.c:1:2: error: "1"
   33137 #    #error "1"
   33138 #     ^
   33139 #    1 error generated.
   33140 #
   33141 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   33142 #
   33143 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   33144 
   33145 { set +x
   33146 $as_echo "$at_srcdir/synclines.at:213: \$PERL -p -0777 - stderr <<\\EOF
   33147   # 1. Remove useless lines.
   33148 
   33149   # distcc clutter.
   33150   s/^distcc\\[\\d+\\] .*\\n//gm;
   33151   # c vs. c++.
   33152   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   33153   # Function context.
   33154   s/^[^:]*: In function '[^']+':\\n//gm;
   33155   # Caret error.
   33156   s/^ *#error.*\\n *\\^\\n//gm;
   33157   # Number of errors.
   33158   s/^1 error generated\\.\\n//gm;
   33159 
   33160   # 2. Normalize the lines we kept.
   33161 
   33162   # Remove column.
   33163   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   33164   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   33165   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   33166 EOF
   33167 "
   33168 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:213"
   33169 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   33170   # 1. Remove useless lines.
   33171 
   33172   # distcc clutter.
   33173   s/^distcc\[\d+\] .*\n//gm;
   33174   # c vs. c++.
   33175   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   33176   # Function context.
   33177   s/^[^:]*: In function '[^']+':\n//gm;
   33178   # Caret error.
   33179   s/^ *#error.*\n *\^\n//gm;
   33180   # Number of errors.
   33181   s/^1 error generated\.\n//gm;
   33182 
   33183   # 2. Normalize the lines we kept.
   33184 
   33185   # Remove column.
   33186   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   33187   # Map all combinations of "error: " and "#error: " to "#error ".
   33188   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   33189 EOF
   33190 
   33191 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33192 at_status=$? at_failed=false
   33193 $at_check_filter
   33194 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33195 echo stdout:; tee stdout <"$at_stdout"
   33196 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33197 $at_failed && at_fn_log_failure
   33198 $at_traceon; }
   33199 
   33200 
   33201 { set +x
   33202 $as_echo "$at_srcdir/synclines.at:213: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   33203 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:213"
   33204 ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
   33205 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33206 at_status=$? at_failed=false
   33207 $at_check_filter
   33208 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33209 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33210 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33211 $at_failed && at_fn_log_failure
   33212 $at_traceon; }
   33213 
   33214 
   33215 cat >input.y <<'_ATEOF'
   33216 %{
   33217 void yyerror ( const char *msg);
   33218 int yylex (void);
   33219 %}
   33220 %%
   33221 exp:
   33222 {
   33223 #error "8"
   33224 };
   33225 _ATEOF
   33226 
   33227 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   33228   at_save_special_files
   33229   mkdir xml-tests
   33230     # Don't combine these Bison invocations since we want to be sure that
   33231   # --report=all isn't required to get the full XML file.
   33232   { set +x
   33233 $as_echo "$at_srcdir/synclines.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   33234                   --graph=xml-tests/test.dot -o input.c input.y"
   33235 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:213"
   33236 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   33237                   --graph=xml-tests/test.dot -o input.c input.y
   33238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33239 at_status=$? at_failed=false
   33240 $at_check_filter
   33241 echo stderr:; cat "$at_stderr"
   33242 echo stdout:; cat "$at_stdout"
   33243 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33244 $at_failed && at_fn_log_failure
   33245 $at_traceon; }
   33246 
   33247   { set +x
   33248 $as_echo "$at_srcdir/synclines.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   33249 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:213"
   33250 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   33251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33252 at_status=$? at_failed=false
   33253 $at_check_filter
   33254 echo stderr:; cat "$at_stderr"
   33255 echo stdout:; cat "$at_stdout"
   33256 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33257 $at_failed && at_fn_log_failure
   33258 $at_traceon; }
   33259 
   33260     cp xml-tests/test.output expout
   33261   { set +x
   33262 $as_echo "$at_srcdir/synclines.at:213: \$XSLTPROC \\
   33263              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   33264              xml-tests/test.xml"
   33265 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:213"
   33266 ( $at_check_trace; $XSLTPROC \
   33267              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   33268              xml-tests/test.xml
   33269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33270 at_status=$? at_failed=false
   33271 $at_check_filter
   33272 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33273 $at_diff expout "$at_stdout" || at_failed=:
   33274 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33275 $at_failed && at_fn_log_failure
   33276 $at_traceon; }
   33277 
   33278   sort xml-tests/test.dot > expout
   33279   { set +x
   33280 $as_echo "$at_srcdir/synclines.at:213: \$XSLTPROC \\
   33281              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   33282              xml-tests/test.xml | sort"
   33283 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:213"
   33284 ( $at_check_trace; $XSLTPROC \
   33285              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   33286              xml-tests/test.xml | sort
   33287 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33288 at_status=$? at_failed=false
   33289 $at_check_filter
   33290 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33291 $at_diff expout "$at_stdout" || at_failed=:
   33292 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33293 $at_failed && at_fn_log_failure
   33294 $at_traceon; }
   33295 
   33296   rm -rf xml-tests expout
   33297   at_restore_special_files
   33298 fi
   33299 { set +x
   33300 $as_echo "$at_srcdir/synclines.at:213: bison -o input.c input.y"
   33301 at_fn_check_prepare_trace "synclines.at:213"
   33302 ( $at_check_trace; bison -o input.c input.y
   33303 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33304 at_status=$? at_failed=false
   33305 $at_check_filter
   33306 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33307 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33308 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33309 $at_failed && at_fn_log_failure
   33310 $at_traceon; }
   33311 
   33312 
   33313 { set +x
   33314 $as_echo "$at_srcdir/synclines.at:213: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   33315 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:213"
   33316 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
   33317 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33318 at_status=$? at_failed=false
   33319 $at_check_filter
   33320 echo stderr:; tee stderr <"$at_stderr"
   33321 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33322 at_fn_check_skip $at_status "$at_srcdir/synclines.at:213"
   33323 $at_failed && at_fn_log_failure
   33324 $at_traceon; }
   33325 
   33326 
   33327 # Transform stderr into something like this:
   33328 #
   33329 #   input.y:4: #error "4"
   33330 #
   33331 # In case GCC displays column information, strip it down.
   33332 #
   33333 #   input.y:4:2: #error "4"    or
   33334 #   input.y:4.2: #error "4"    or
   33335 #   input.y:4:2: error: #error "4"
   33336 # =>
   33337 #   input.y:4: #error "4"
   33338 #
   33339 # It may also issue more context information:
   33340 #
   33341 #   input.y: In function 'yyparse':
   33342 #   input.y:8: #error "8"
   33343 # =>
   33344 #   input.y:4: #error "8"
   33345 #
   33346 # The message may include a caret-error (indented by GCC 4.8,
   33347 # not by clang 3.2):
   33348 #
   33349 #   input.y:1:2: error: #error "1"
   33350 #    #error "1"
   33351 #     ^
   33352 #
   33353 # Possibly distcc adds its bits.
   33354 #
   33355 #   distcc[33187] ERROR: compile (null) on localhost failed
   33356 #   syncline.c:1:2: error: #error "1"
   33357 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   33358 #
   33359 # or even
   33360 #
   33361 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   33362 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   33363 #
   33364 # The compiler might end by the number of messages issued (Clang 3.2):
   33365 #
   33366 #    syncline.c:1:2: error: "1"
   33367 #    #error "1"
   33368 #     ^
   33369 #    1 error generated.
   33370 #
   33371 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   33372 #
   33373 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   33374 
   33375 { set +x
   33376 $as_echo "$at_srcdir/synclines.at:213: \$PERL -p -0777 - stderr <<\\EOF
   33377   # 1. Remove useless lines.
   33378 
   33379   # distcc clutter.
   33380   s/^distcc\\[\\d+\\] .*\\n//gm;
   33381   # c vs. c++.
   33382   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   33383   # Function context.
   33384   s/^[^:]*: In function '[^']+':\\n//gm;
   33385   # Caret error.
   33386   s/^ *#error.*\\n *\\^\\n//gm;
   33387   # Number of errors.
   33388   s/^1 error generated\\.\\n//gm;
   33389 
   33390   # 2. Normalize the lines we kept.
   33391 
   33392   # Remove column.
   33393   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   33394   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   33395   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   33396 EOF
   33397 "
   33398 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:213"
   33399 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   33400   # 1. Remove useless lines.
   33401 
   33402   # distcc clutter.
   33403   s/^distcc\[\d+\] .*\n//gm;
   33404   # c vs. c++.
   33405   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   33406   # Function context.
   33407   s/^[^:]*: In function '[^']+':\n//gm;
   33408   # Caret error.
   33409   s/^ *#error.*\n *\^\n//gm;
   33410   # Number of errors.
   33411   s/^1 error generated\.\n//gm;
   33412 
   33413   # 2. Normalize the lines we kept.
   33414 
   33415   # Remove column.
   33416   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   33417   # Map all combinations of "error: " and "#error: " to "#error ".
   33418   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   33419 EOF
   33420 
   33421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33422 at_status=$? at_failed=false
   33423 $at_check_filter
   33424 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33425 echo stdout:; tee stdout <"$at_stdout"
   33426 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33427 $at_failed && at_fn_log_failure
   33428 $at_traceon; }
   33429 
   33430 
   33431 { set +x
   33432 $as_echo "$at_srcdir/synclines.at:213: cat stdout"
   33433 at_fn_check_prepare_trace "synclines.at:213"
   33434 ( $at_check_trace; cat stdout
   33435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33436 at_status=$? at_failed=false
   33437 $at_check_filter
   33438 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33439 echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\"
   33440 " | \
   33441   $at_diff - "$at_stdout" || at_failed=:
   33442 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:213"
   33443 $at_failed && at_fn_log_failure
   33444 $at_traceon; }
   33445 
   33446 
   33447   set +x
   33448   $at_times_p && times >"$at_times_file"
   33449 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   33450 read at_status <"$at_status_file"
   33451 #AT_STOP_131
   33452 #AT_START_132
   33453 at_fn_group_banner 132 'synclines.at:232' \
   33454   "Epilogue syncline" "                              " 7
   33455 at_xfail=no
   33456 (
   33457   $as_echo "132. $at_setup_line: testing $at_desc ..."
   33458   $at_traceon
   33459 
   33460 
   33461 # It seems impossible to find a generic scheme to check the location
   33462 # of an error.  Even requiring GCC is not sufficient, since for instance
   33463 # the version modified by Apple:
   33464 #
   33465 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   33466 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   33467 # | 19991024 (release) configure:2124: $? = 0
   33468 #
   33469 # instead of:
   33470 #
   33471 # | input.y:2: #error "2"
   33472 #
   33473 # it reports:
   33474 #
   33475 # | input.y:2: "2"
   33476 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   33477 
   33478 cat >syncline.c <<'_ATEOF'
   33479 #error "1"
   33480 int i; /* avoids -pedantic warning about an empty translation unit. */
   33481 _ATEOF
   33482 
   33483 
   33484 { set +x
   33485 $as_echo "$at_srcdir/synclines.at:232: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   33486 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:232"
   33487 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
   33488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33489 at_status=$? at_failed=false
   33490 $at_check_filter
   33491 echo stderr:; tee stderr <"$at_stderr"
   33492 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33493 at_fn_check_skip $at_status "$at_srcdir/synclines.at:232"
   33494 $at_failed && at_fn_log_failure
   33495 $at_traceon; }
   33496 
   33497 
   33498 # Transform stderr into something like this:
   33499 #
   33500 #   input.y:4: #error "4"
   33501 #
   33502 # In case GCC displays column information, strip it down.
   33503 #
   33504 #   input.y:4:2: #error "4"    or
   33505 #   input.y:4.2: #error "4"    or
   33506 #   input.y:4:2: error: #error "4"
   33507 # =>
   33508 #   input.y:4: #error "4"
   33509 #
   33510 # It may also issue more context information:
   33511 #
   33512 #   input.y: In function 'yyparse':
   33513 #   input.y:8: #error "8"
   33514 # =>
   33515 #   input.y:4: #error "8"
   33516 #
   33517 # The message may include a caret-error (indented by GCC 4.8,
   33518 # not by clang 3.2):
   33519 #
   33520 #   input.y:1:2: error: #error "1"
   33521 #    #error "1"
   33522 #     ^
   33523 #
   33524 # Possibly distcc adds its bits.
   33525 #
   33526 #   distcc[33187] ERROR: compile (null) on localhost failed
   33527 #   syncline.c:1:2: error: #error "1"
   33528 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   33529 #
   33530 # or even
   33531 #
   33532 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   33533 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   33534 #
   33535 # The compiler might end by the number of messages issued (Clang 3.2):
   33536 #
   33537 #    syncline.c:1:2: error: "1"
   33538 #    #error "1"
   33539 #     ^
   33540 #    1 error generated.
   33541 #
   33542 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   33543 #
   33544 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   33545 
   33546 { set +x
   33547 $as_echo "$at_srcdir/synclines.at:232: \$PERL -p -0777 - stderr <<\\EOF
   33548   # 1. Remove useless lines.
   33549 
   33550   # distcc clutter.
   33551   s/^distcc\\[\\d+\\] .*\\n//gm;
   33552   # c vs. c++.
   33553   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   33554   # Function context.
   33555   s/^[^:]*: In function '[^']+':\\n//gm;
   33556   # Caret error.
   33557   s/^ *#error.*\\n *\\^\\n//gm;
   33558   # Number of errors.
   33559   s/^1 error generated\\.\\n//gm;
   33560 
   33561   # 2. Normalize the lines we kept.
   33562 
   33563   # Remove column.
   33564   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   33565   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   33566   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   33567 EOF
   33568 "
   33569 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:232"
   33570 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   33571   # 1. Remove useless lines.
   33572 
   33573   # distcc clutter.
   33574   s/^distcc\[\d+\] .*\n//gm;
   33575   # c vs. c++.
   33576   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   33577   # Function context.
   33578   s/^[^:]*: In function '[^']+':\n//gm;
   33579   # Caret error.
   33580   s/^ *#error.*\n *\^\n//gm;
   33581   # Number of errors.
   33582   s/^1 error generated\.\n//gm;
   33583 
   33584   # 2. Normalize the lines we kept.
   33585 
   33586   # Remove column.
   33587   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   33588   # Map all combinations of "error: " and "#error: " to "#error ".
   33589   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   33590 EOF
   33591 
   33592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33593 at_status=$? at_failed=false
   33594 $at_check_filter
   33595 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33596 echo stdout:; tee stdout <"$at_stdout"
   33597 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33598 $at_failed && at_fn_log_failure
   33599 $at_traceon; }
   33600 
   33601 
   33602 { set +x
   33603 $as_echo "$at_srcdir/synclines.at:232: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   33604 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:232"
   33605 ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
   33606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33607 at_status=$? at_failed=false
   33608 $at_check_filter
   33609 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33610 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33611 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33612 $at_failed && at_fn_log_failure
   33613 $at_traceon; }
   33614 
   33615 
   33616 cat >input.y <<'_ATEOF'
   33617 %{
   33618 void yyerror ( const char *msg);
   33619 int yylex (void);
   33620 %}
   33621 %%
   33622 exp: '0';
   33623 %%
   33624 #error "8"
   33625 _ATEOF
   33626 
   33627 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   33628   at_save_special_files
   33629   mkdir xml-tests
   33630     # Don't combine these Bison invocations since we want to be sure that
   33631   # --report=all isn't required to get the full XML file.
   33632   { set +x
   33633 $as_echo "$at_srcdir/synclines.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   33634                   --graph=xml-tests/test.dot -o input.c input.y"
   33635 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:232"
   33636 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   33637                   --graph=xml-tests/test.dot -o input.c input.y
   33638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33639 at_status=$? at_failed=false
   33640 $at_check_filter
   33641 echo stderr:; cat "$at_stderr"
   33642 echo stdout:; cat "$at_stdout"
   33643 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33644 $at_failed && at_fn_log_failure
   33645 $at_traceon; }
   33646 
   33647   { set +x
   33648 $as_echo "$at_srcdir/synclines.at:232: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   33649 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:232"
   33650 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   33651 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33652 at_status=$? at_failed=false
   33653 $at_check_filter
   33654 echo stderr:; cat "$at_stderr"
   33655 echo stdout:; cat "$at_stdout"
   33656 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33657 $at_failed && at_fn_log_failure
   33658 $at_traceon; }
   33659 
   33660     cp xml-tests/test.output expout
   33661   { set +x
   33662 $as_echo "$at_srcdir/synclines.at:232: \$XSLTPROC \\
   33663              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   33664              xml-tests/test.xml"
   33665 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:232"
   33666 ( $at_check_trace; $XSLTPROC \
   33667              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   33668              xml-tests/test.xml
   33669 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33670 at_status=$? at_failed=false
   33671 $at_check_filter
   33672 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33673 $at_diff expout "$at_stdout" || at_failed=:
   33674 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33675 $at_failed && at_fn_log_failure
   33676 $at_traceon; }
   33677 
   33678   sort xml-tests/test.dot > expout
   33679   { set +x
   33680 $as_echo "$at_srcdir/synclines.at:232: \$XSLTPROC \\
   33681              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   33682              xml-tests/test.xml | sort"
   33683 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:232"
   33684 ( $at_check_trace; $XSLTPROC \
   33685              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   33686              xml-tests/test.xml | sort
   33687 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33688 at_status=$? at_failed=false
   33689 $at_check_filter
   33690 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33691 $at_diff expout "$at_stdout" || at_failed=:
   33692 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33693 $at_failed && at_fn_log_failure
   33694 $at_traceon; }
   33695 
   33696   rm -rf xml-tests expout
   33697   at_restore_special_files
   33698 fi
   33699 { set +x
   33700 $as_echo "$at_srcdir/synclines.at:232: bison -o input.c input.y"
   33701 at_fn_check_prepare_trace "synclines.at:232"
   33702 ( $at_check_trace; bison -o input.c input.y
   33703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33704 at_status=$? at_failed=false
   33705 $at_check_filter
   33706 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33707 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33708 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33709 $at_failed && at_fn_log_failure
   33710 $at_traceon; }
   33711 
   33712 
   33713 { set +x
   33714 $as_echo "$at_srcdir/synclines.at:232: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   33715 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:232"
   33716 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
   33717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33718 at_status=$? at_failed=false
   33719 $at_check_filter
   33720 echo stderr:; tee stderr <"$at_stderr"
   33721 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33722 at_fn_check_skip $at_status "$at_srcdir/synclines.at:232"
   33723 $at_failed && at_fn_log_failure
   33724 $at_traceon; }
   33725 
   33726 
   33727 # Transform stderr into something like this:
   33728 #
   33729 #   input.y:4: #error "4"
   33730 #
   33731 # In case GCC displays column information, strip it down.
   33732 #
   33733 #   input.y:4:2: #error "4"    or
   33734 #   input.y:4.2: #error "4"    or
   33735 #   input.y:4:2: error: #error "4"
   33736 # =>
   33737 #   input.y:4: #error "4"
   33738 #
   33739 # It may also issue more context information:
   33740 #
   33741 #   input.y: In function 'yyparse':
   33742 #   input.y:8: #error "8"
   33743 # =>
   33744 #   input.y:4: #error "8"
   33745 #
   33746 # The message may include a caret-error (indented by GCC 4.8,
   33747 # not by clang 3.2):
   33748 #
   33749 #   input.y:1:2: error: #error "1"
   33750 #    #error "1"
   33751 #     ^
   33752 #
   33753 # Possibly distcc adds its bits.
   33754 #
   33755 #   distcc[33187] ERROR: compile (null) on localhost failed
   33756 #   syncline.c:1:2: error: #error "1"
   33757 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   33758 #
   33759 # or even
   33760 #
   33761 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   33762 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   33763 #
   33764 # The compiler might end by the number of messages issued (Clang 3.2):
   33765 #
   33766 #    syncline.c:1:2: error: "1"
   33767 #    #error "1"
   33768 #     ^
   33769 #    1 error generated.
   33770 #
   33771 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   33772 #
   33773 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   33774 
   33775 { set +x
   33776 $as_echo "$at_srcdir/synclines.at:232: \$PERL -p -0777 - stderr <<\\EOF
   33777   # 1. Remove useless lines.
   33778 
   33779   # distcc clutter.
   33780   s/^distcc\\[\\d+\\] .*\\n//gm;
   33781   # c vs. c++.
   33782   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   33783   # Function context.
   33784   s/^[^:]*: In function '[^']+':\\n//gm;
   33785   # Caret error.
   33786   s/^ *#error.*\\n *\\^\\n//gm;
   33787   # Number of errors.
   33788   s/^1 error generated\\.\\n//gm;
   33789 
   33790   # 2. Normalize the lines we kept.
   33791 
   33792   # Remove column.
   33793   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   33794   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   33795   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   33796 EOF
   33797 "
   33798 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:232"
   33799 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   33800   # 1. Remove useless lines.
   33801 
   33802   # distcc clutter.
   33803   s/^distcc\[\d+\] .*\n//gm;
   33804   # c vs. c++.
   33805   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   33806   # Function context.
   33807   s/^[^:]*: In function '[^']+':\n//gm;
   33808   # Caret error.
   33809   s/^ *#error.*\n *\^\n//gm;
   33810   # Number of errors.
   33811   s/^1 error generated\.\n//gm;
   33812 
   33813   # 2. Normalize the lines we kept.
   33814 
   33815   # Remove column.
   33816   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   33817   # Map all combinations of "error: " and "#error: " to "#error ".
   33818   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   33819 EOF
   33820 
   33821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33822 at_status=$? at_failed=false
   33823 $at_check_filter
   33824 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33825 echo stdout:; tee stdout <"$at_stdout"
   33826 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33827 $at_failed && at_fn_log_failure
   33828 $at_traceon; }
   33829 
   33830 
   33831 { set +x
   33832 $as_echo "$at_srcdir/synclines.at:232: cat stdout"
   33833 at_fn_check_prepare_trace "synclines.at:232"
   33834 ( $at_check_trace; cat stdout
   33835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33836 at_status=$? at_failed=false
   33837 $at_check_filter
   33838 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33839 echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\"
   33840 " | \
   33841   $at_diff - "$at_stdout" || at_failed=:
   33842 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:232"
   33843 $at_failed && at_fn_log_failure
   33844 $at_traceon; }
   33845 
   33846 
   33847   set +x
   33848   $at_times_p && times >"$at_times_file"
   33849 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   33850 read at_status <"$at_status_file"
   33851 #AT_STOP_132
   33852 #AT_START_133
   33853 at_fn_group_banner 133 'synclines.at:249' \
   33854   "%code top syncline" "                             " 7
   33855 at_xfail=no
   33856 (
   33857   $as_echo "133. $at_setup_line: testing $at_desc ..."
   33858   $at_traceon
   33859 
   33860 
   33861 # It seems impossible to find a generic scheme to check the location
   33862 # of an error.  Even requiring GCC is not sufficient, since for instance
   33863 # the version modified by Apple:
   33864 #
   33865 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   33866 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   33867 # | 19991024 (release) configure:2124: $? = 0
   33868 #
   33869 # instead of:
   33870 #
   33871 # | input.y:2: #error "2"
   33872 #
   33873 # it reports:
   33874 #
   33875 # | input.y:2: "2"
   33876 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   33877 
   33878 cat >syncline.c <<'_ATEOF'
   33879 #error "1"
   33880 int i; /* avoids -pedantic warning about an empty translation unit. */
   33881 _ATEOF
   33882 
   33883 
   33884 { set +x
   33885 $as_echo "$at_srcdir/synclines.at:249: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   33886 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:249"
   33887 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
   33888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33889 at_status=$? at_failed=false
   33890 $at_check_filter
   33891 echo stderr:; tee stderr <"$at_stderr"
   33892 at_fn_diff_devnull "$at_stdout" || at_failed=:
   33893 at_fn_check_skip $at_status "$at_srcdir/synclines.at:249"
   33894 $at_failed && at_fn_log_failure
   33895 $at_traceon; }
   33896 
   33897 
   33898 # Transform stderr into something like this:
   33899 #
   33900 #   input.y:4: #error "4"
   33901 #
   33902 # In case GCC displays column information, strip it down.
   33903 #
   33904 #   input.y:4:2: #error "4"    or
   33905 #   input.y:4.2: #error "4"    or
   33906 #   input.y:4:2: error: #error "4"
   33907 # =>
   33908 #   input.y:4: #error "4"
   33909 #
   33910 # It may also issue more context information:
   33911 #
   33912 #   input.y: In function 'yyparse':
   33913 #   input.y:8: #error "8"
   33914 # =>
   33915 #   input.y:4: #error "8"
   33916 #
   33917 # The message may include a caret-error (indented by GCC 4.8,
   33918 # not by clang 3.2):
   33919 #
   33920 #   input.y:1:2: error: #error "1"
   33921 #    #error "1"
   33922 #     ^
   33923 #
   33924 # Possibly distcc adds its bits.
   33925 #
   33926 #   distcc[33187] ERROR: compile (null) on localhost failed
   33927 #   syncline.c:1:2: error: #error "1"
   33928 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   33929 #
   33930 # or even
   33931 #
   33932 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   33933 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   33934 #
   33935 # The compiler might end by the number of messages issued (Clang 3.2):
   33936 #
   33937 #    syncline.c:1:2: error: "1"
   33938 #    #error "1"
   33939 #     ^
   33940 #    1 error generated.
   33941 #
   33942 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   33943 #
   33944 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   33945 
   33946 { set +x
   33947 $as_echo "$at_srcdir/synclines.at:249: \$PERL -p -0777 - stderr <<\\EOF
   33948   # 1. Remove useless lines.
   33949 
   33950   # distcc clutter.
   33951   s/^distcc\\[\\d+\\] .*\\n//gm;
   33952   # c vs. c++.
   33953   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   33954   # Function context.
   33955   s/^[^:]*: In function '[^']+':\\n//gm;
   33956   # Caret error.
   33957   s/^ *#error.*\\n *\\^\\n//gm;
   33958   # Number of errors.
   33959   s/^1 error generated\\.\\n//gm;
   33960 
   33961   # 2. Normalize the lines we kept.
   33962 
   33963   # Remove column.
   33964   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   33965   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   33966   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   33967 EOF
   33968 "
   33969 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:249"
   33970 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   33971   # 1. Remove useless lines.
   33972 
   33973   # distcc clutter.
   33974   s/^distcc\[\d+\] .*\n//gm;
   33975   # c vs. c++.
   33976   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   33977   # Function context.
   33978   s/^[^:]*: In function '[^']+':\n//gm;
   33979   # Caret error.
   33980   s/^ *#error.*\n *\^\n//gm;
   33981   # Number of errors.
   33982   s/^1 error generated\.\n//gm;
   33983 
   33984   # 2. Normalize the lines we kept.
   33985 
   33986   # Remove column.
   33987   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   33988   # Map all combinations of "error: " and "#error: " to "#error ".
   33989   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   33990 EOF
   33991 
   33992 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   33993 at_status=$? at_failed=false
   33994 $at_check_filter
   33995 at_fn_diff_devnull "$at_stderr" || at_failed=:
   33996 echo stdout:; tee stdout <"$at_stdout"
   33997 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   33998 $at_failed && at_fn_log_failure
   33999 $at_traceon; }
   34000 
   34001 
   34002 { set +x
   34003 $as_echo "$at_srcdir/synclines.at:249: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   34004 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:249"
   34005 ( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
   34006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34007 at_status=$? at_failed=false
   34008 $at_check_filter
   34009 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34010 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34011 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34012 $at_failed && at_fn_log_failure
   34013 $at_traceon; }
   34014 
   34015 
   34016 cat >input.y <<'_ATEOF'
   34017 %code top {
   34018 #error "2"
   34019 }
   34020 %{
   34021 void yyerror ( const char *msg);
   34022 int yylex (void);
   34023 %}
   34024 %%
   34025 exp: '0';
   34026 %%
   34027 _ATEOF
   34028 
   34029 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   34030   at_save_special_files
   34031   mkdir xml-tests
   34032     # Don't combine these Bison invocations since we want to be sure that
   34033   # --report=all isn't required to get the full XML file.
   34034   { set +x
   34035 $as_echo "$at_srcdir/synclines.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   34036                   --graph=xml-tests/test.dot -o input.c input.y"
   34037 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:249"
   34038 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   34039                   --graph=xml-tests/test.dot -o input.c input.y
   34040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34041 at_status=$? at_failed=false
   34042 $at_check_filter
   34043 echo stderr:; cat "$at_stderr"
   34044 echo stdout:; cat "$at_stdout"
   34045 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34046 $at_failed && at_fn_log_failure
   34047 $at_traceon; }
   34048 
   34049   { set +x
   34050 $as_echo "$at_srcdir/synclines.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   34051 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:249"
   34052 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   34053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34054 at_status=$? at_failed=false
   34055 $at_check_filter
   34056 echo stderr:; cat "$at_stderr"
   34057 echo stdout:; cat "$at_stdout"
   34058 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34059 $at_failed && at_fn_log_failure
   34060 $at_traceon; }
   34061 
   34062     cp xml-tests/test.output expout
   34063   { set +x
   34064 $as_echo "$at_srcdir/synclines.at:249: \$XSLTPROC \\
   34065              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   34066              xml-tests/test.xml"
   34067 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:249"
   34068 ( $at_check_trace; $XSLTPROC \
   34069              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   34070              xml-tests/test.xml
   34071 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34072 at_status=$? at_failed=false
   34073 $at_check_filter
   34074 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34075 $at_diff expout "$at_stdout" || at_failed=:
   34076 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34077 $at_failed && at_fn_log_failure
   34078 $at_traceon; }
   34079 
   34080   sort xml-tests/test.dot > expout
   34081   { set +x
   34082 $as_echo "$at_srcdir/synclines.at:249: \$XSLTPROC \\
   34083              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   34084              xml-tests/test.xml | sort"
   34085 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:249"
   34086 ( $at_check_trace; $XSLTPROC \
   34087              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   34088              xml-tests/test.xml | sort
   34089 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34090 at_status=$? at_failed=false
   34091 $at_check_filter
   34092 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34093 $at_diff expout "$at_stdout" || at_failed=:
   34094 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34095 $at_failed && at_fn_log_failure
   34096 $at_traceon; }
   34097 
   34098   rm -rf xml-tests expout
   34099   at_restore_special_files
   34100 fi
   34101 { set +x
   34102 $as_echo "$at_srcdir/synclines.at:249: bison -o input.c input.y"
   34103 at_fn_check_prepare_trace "synclines.at:249"
   34104 ( $at_check_trace; bison -o input.c input.y
   34105 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34106 at_status=$? at_failed=false
   34107 $at_check_filter
   34108 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34109 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34110 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34111 $at_failed && at_fn_log_failure
   34112 $at_traceon; }
   34113 
   34114 
   34115 { set +x
   34116 $as_echo "$at_srcdir/synclines.at:249: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   34117 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:249"
   34118 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
   34119 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34120 at_status=$? at_failed=false
   34121 $at_check_filter
   34122 echo stderr:; tee stderr <"$at_stderr"
   34123 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34124 at_fn_check_skip $at_status "$at_srcdir/synclines.at:249"
   34125 $at_failed && at_fn_log_failure
   34126 $at_traceon; }
   34127 
   34128 
   34129 # Transform stderr into something like this:
   34130 #
   34131 #   input.y:4: #error "4"
   34132 #
   34133 # In case GCC displays column information, strip it down.
   34134 #
   34135 #   input.y:4:2: #error "4"    or
   34136 #   input.y:4.2: #error "4"    or
   34137 #   input.y:4:2: error: #error "4"
   34138 # =>
   34139 #   input.y:4: #error "4"
   34140 #
   34141 # It may also issue more context information:
   34142 #
   34143 #   input.y: In function 'yyparse':
   34144 #   input.y:8: #error "8"
   34145 # =>
   34146 #   input.y:4: #error "8"
   34147 #
   34148 # The message may include a caret-error (indented by GCC 4.8,
   34149 # not by clang 3.2):
   34150 #
   34151 #   input.y:1:2: error: #error "1"
   34152 #    #error "1"
   34153 #     ^
   34154 #
   34155 # Possibly distcc adds its bits.
   34156 #
   34157 #   distcc[33187] ERROR: compile (null) on localhost failed
   34158 #   syncline.c:1:2: error: #error "1"
   34159 #   distcc[33185] ERROR: compile syncline.c on localhost failed
   34160 #
   34161 # or even
   34162 #
   34163 #   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
   34164 #   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
   34165 #
   34166 # The compiler might end by the number of messages issued (Clang 3.2):
   34167 #
   34168 #    syncline.c:1:2: error: "1"
   34169 #    #error "1"
   34170 #     ^
   34171 #    1 error generated.
   34172 #
   34173 # When c++ is used to compiler C, we might have more messages (Clang 3.2):
   34174 #
   34175 #    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
   34176 
   34177 { set +x
   34178 $as_echo "$at_srcdir/synclines.at:249: \$PERL -p -0777 - stderr <<\\EOF
   34179   # 1. Remove useless lines.
   34180 
   34181   # distcc clutter.
   34182   s/^distcc\\[\\d+\\] .*\\n//gm;
   34183   # c vs. c++.
   34184   s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
   34185   # Function context.
   34186   s/^[^:]*: In function '[^']+':\\n//gm;
   34187   # Caret error.
   34188   s/^ *#error.*\\n *\\^\\n//gm;
   34189   # Number of errors.
   34190   s/^1 error generated\\.\\n//gm;
   34191 
   34192   # 2. Normalize the lines we kept.
   34193 
   34194   # Remove column.
   34195   s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
   34196   # Map all combinations of \"error: \" and \"#error: \" to \"#error \".
   34197   s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
   34198 EOF
   34199 "
   34200 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:249"
   34201 ( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
   34202   # 1. Remove useless lines.
   34203 
   34204   # distcc clutter.
   34205   s/^distcc\[\d+\] .*\n//gm;
   34206   # c vs. c++.
   34207   s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
   34208   # Function context.
   34209   s/^[^:]*: In function '[^']+':\n//gm;
   34210   # Caret error.
   34211   s/^ *#error.*\n *\^\n//gm;
   34212   # Number of errors.
   34213   s/^1 error generated\.\n//gm;
   34214 
   34215   # 2. Normalize the lines we kept.
   34216 
   34217   # Remove column.
   34218   s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
   34219   # Map all combinations of "error: " and "#error: " to "#error ".
   34220   s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
   34221 EOF
   34222 
   34223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34224 at_status=$? at_failed=false
   34225 $at_check_filter
   34226 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34227 echo stdout:; tee stdout <"$at_stdout"
   34228 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34229 $at_failed && at_fn_log_failure
   34230 $at_traceon; }
   34231 
   34232 
   34233 { set +x
   34234 $as_echo "$at_srcdir/synclines.at:249: cat stdout"
   34235 at_fn_check_prepare_trace "synclines.at:249"
   34236 ( $at_check_trace; cat stdout
   34237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34238 at_status=$? at_failed=false
   34239 $at_check_filter
   34240 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34241 echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
   34242 " | \
   34243   $at_diff - "$at_stdout" || at_failed=:
   34244 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:249"
   34245 $at_failed && at_fn_log_failure
   34246 $at_traceon; }
   34247 
   34248 
   34249   set +x
   34250   $at_times_p && times >"$at_times_file"
   34251 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   34252 read at_status <"$at_status_file"
   34253 #AT_STOP_133
   34254 #AT_START_134
   34255 at_fn_group_banner 134 'synclines.at:290' \
   34256   "%no-lines" "                                      " 7
   34257 at_xfail=no
   34258 (
   34259   $as_echo "134. $at_setup_line: testing $at_desc ..."
   34260   $at_traceon
   34261 
   34262 
   34263 
   34264 cat >input.y <<'_ATEOF'
   34265 %code top {
   34266 #include <config.h>
   34267 /* We don't need perfect functions for these tests. */
   34268 #undef malloc
   34269 #undef memcmp
   34270 #undef realloc
   34271 }
   34272 
   34273 %skeleton "yacc.c" %defines
   34274 %{
   34275 void yyerror ( const char *msg);
   34276 int yylex (void);
   34277 %}
   34278 %%
   34279 exp: '0'
   34280 _ATEOF
   34281 
   34282 
   34283 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   34284   at_save_special_files
   34285   mkdir xml-tests
   34286     # Don't combine these Bison invocations since we want to be sure that
   34287   # --report=all isn't required to get the full XML file.
   34288   { set +x
   34289 $as_echo "$at_srcdir/synclines.at:290: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   34290                   --graph=xml-tests/test.dot --no-lines -o input.c -d input.y"
   34291 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:290"
   34292 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   34293                   --graph=xml-tests/test.dot --no-lines -o input.c -d input.y
   34294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34295 at_status=$? at_failed=false
   34296 $at_check_filter
   34297 echo stderr:; cat "$at_stderr"
   34298 echo stdout:; cat "$at_stdout"
   34299 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290"
   34300 $at_failed && at_fn_log_failure
   34301 $at_traceon; }
   34302 
   34303   { set +x
   34304 $as_echo "$at_srcdir/synclines.at:290: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y"
   34305 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:290"
   34306 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y
   34307 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34308 at_status=$? at_failed=false
   34309 $at_check_filter
   34310 echo stderr:; cat "$at_stderr"
   34311 echo stdout:; cat "$at_stdout"
   34312 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290"
   34313 $at_failed && at_fn_log_failure
   34314 $at_traceon; }
   34315 
   34316     cp xml-tests/test.output expout
   34317   { set +x
   34318 $as_echo "$at_srcdir/synclines.at:290: \$XSLTPROC \\
   34319              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   34320              xml-tests/test.xml"
   34321 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:290"
   34322 ( $at_check_trace; $XSLTPROC \
   34323              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   34324              xml-tests/test.xml
   34325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34326 at_status=$? at_failed=false
   34327 $at_check_filter
   34328 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34329 $at_diff expout "$at_stdout" || at_failed=:
   34330 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290"
   34331 $at_failed && at_fn_log_failure
   34332 $at_traceon; }
   34333 
   34334   sort xml-tests/test.dot > expout
   34335   { set +x
   34336 $as_echo "$at_srcdir/synclines.at:290: \$XSLTPROC \\
   34337              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   34338              xml-tests/test.xml | sort"
   34339 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:290"
   34340 ( $at_check_trace; $XSLTPROC \
   34341              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   34342              xml-tests/test.xml | sort
   34343 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34344 at_status=$? at_failed=false
   34345 $at_check_filter
   34346 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34347 $at_diff expout "$at_stdout" || at_failed=:
   34348 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290"
   34349 $at_failed && at_fn_log_failure
   34350 $at_traceon; }
   34351 
   34352   rm -rf xml-tests expout
   34353   at_restore_special_files
   34354 fi
   34355 { set +x
   34356 $as_echo "$at_srcdir/synclines.at:290: bison --no-lines -o input.c -d input.y"
   34357 at_fn_check_prepare_trace "synclines.at:290"
   34358 ( $at_check_trace; bison --no-lines -o input.c -d input.y
   34359 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34360 at_status=$? at_failed=false
   34361 $at_check_filter
   34362 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34363 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34364 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:290"
   34365 $at_failed && at_fn_log_failure
   34366 $at_traceon; }
   34367 
   34368 
   34369 { set +x
   34370 $as_echo "$at_srcdir/synclines.at:290: grep '#line' *.c *.h"
   34371 at_fn_check_prepare_trace "synclines.at:290"
   34372 ( $at_check_trace; grep '#line' *.c *.h
   34373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34374 at_status=$? at_failed=false
   34375 $at_check_filter
   34376 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34377 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34378 at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:290"
   34379 $at_failed && at_fn_log_failure
   34380 $at_traceon; }
   34381 
   34382 
   34383 
   34384   set +x
   34385   $at_times_p && times >"$at_times_file"
   34386 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   34387 read at_status <"$at_status_file"
   34388 #AT_STOP_134
   34389 #AT_START_135
   34390 at_fn_group_banner 135 'synclines.at:291' \
   34391   "%no-lines" "                                      " 7
   34392 at_xfail=no
   34393 (
   34394   $as_echo "135. $at_setup_line: testing $at_desc ..."
   34395   $at_traceon
   34396 
   34397 
   34398 
   34399 cat >input.y <<'_ATEOF'
   34400 %code top {
   34401 #include <config.h>
   34402 /* We don't need perfect functions for these tests. */
   34403 #undef malloc
   34404 #undef memcmp
   34405 #undef realloc
   34406 }
   34407 
   34408 %skeleton "glr.c" %defines
   34409 %{
   34410 void yyerror ( const char *msg);
   34411 int yylex (void);
   34412 %}
   34413 %%
   34414 exp: '0'
   34415 _ATEOF
   34416 
   34417 
   34418 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   34419   at_save_special_files
   34420   mkdir xml-tests
   34421     # Don't combine these Bison invocations since we want to be sure that
   34422   # --report=all isn't required to get the full XML file.
   34423   { set +x
   34424 $as_echo "$at_srcdir/synclines.at:291: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   34425                   --graph=xml-tests/test.dot --no-lines -o input.c -d input.y"
   34426 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:291"
   34427 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   34428                   --graph=xml-tests/test.dot --no-lines -o input.c -d input.y
   34429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34430 at_status=$? at_failed=false
   34431 $at_check_filter
   34432 echo stderr:; cat "$at_stderr"
   34433 echo stdout:; cat "$at_stdout"
   34434 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
   34435 $at_failed && at_fn_log_failure
   34436 $at_traceon; }
   34437 
   34438   { set +x
   34439 $as_echo "$at_srcdir/synclines.at:291: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y"
   34440 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:291"
   34441 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.c -d input.y
   34442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34443 at_status=$? at_failed=false
   34444 $at_check_filter
   34445 echo stderr:; cat "$at_stderr"
   34446 echo stdout:; cat "$at_stdout"
   34447 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
   34448 $at_failed && at_fn_log_failure
   34449 $at_traceon; }
   34450 
   34451     cp xml-tests/test.output expout
   34452   { set +x
   34453 $as_echo "$at_srcdir/synclines.at:291: \$XSLTPROC \\
   34454              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   34455              xml-tests/test.xml"
   34456 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291"
   34457 ( $at_check_trace; $XSLTPROC \
   34458              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   34459              xml-tests/test.xml
   34460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34461 at_status=$? at_failed=false
   34462 $at_check_filter
   34463 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34464 $at_diff expout "$at_stdout" || at_failed=:
   34465 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
   34466 $at_failed && at_fn_log_failure
   34467 $at_traceon; }
   34468 
   34469   sort xml-tests/test.dot > expout
   34470   { set +x
   34471 $as_echo "$at_srcdir/synclines.at:291: \$XSLTPROC \\
   34472              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   34473              xml-tests/test.xml | sort"
   34474 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291"
   34475 ( $at_check_trace; $XSLTPROC \
   34476              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   34477              xml-tests/test.xml | sort
   34478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34479 at_status=$? at_failed=false
   34480 $at_check_filter
   34481 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34482 $at_diff expout "$at_stdout" || at_failed=:
   34483 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
   34484 $at_failed && at_fn_log_failure
   34485 $at_traceon; }
   34486 
   34487   rm -rf xml-tests expout
   34488   at_restore_special_files
   34489 fi
   34490 { set +x
   34491 $as_echo "$at_srcdir/synclines.at:291: bison --no-lines -o input.c -d input.y"
   34492 at_fn_check_prepare_trace "synclines.at:291"
   34493 ( $at_check_trace; bison --no-lines -o input.c -d input.y
   34494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34495 at_status=$? at_failed=false
   34496 $at_check_filter
   34497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34498 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34499 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
   34500 $at_failed && at_fn_log_failure
   34501 $at_traceon; }
   34502 
   34503 
   34504 { set +x
   34505 $as_echo "$at_srcdir/synclines.at:291: grep '#line' *.c *.h"
   34506 at_fn_check_prepare_trace "synclines.at:291"
   34507 ( $at_check_trace; grep '#line' *.c *.h
   34508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34509 at_status=$? at_failed=false
   34510 $at_check_filter
   34511 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34512 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34513 at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:291"
   34514 $at_failed && at_fn_log_failure
   34515 $at_traceon; }
   34516 
   34517 
   34518 
   34519   set +x
   34520   $at_times_p && times >"$at_times_file"
   34521 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   34522 read at_status <"$at_status_file"
   34523 #AT_STOP_135
   34524 #AT_START_136
   34525 at_fn_group_banner 136 'synclines.at:292' \
   34526   "%no-lines" "                                      " 7
   34527 at_xfail=no
   34528 (
   34529   $as_echo "136. $at_setup_line: testing $at_desc ..."
   34530   $at_traceon
   34531 
   34532 
   34533 
   34534 cat >input.y <<'_ATEOF'
   34535 %code top {
   34536 #include <config.h>
   34537 /* We don't need perfect functions for these tests. */
   34538 #undef malloc
   34539 #undef memcmp
   34540 #undef realloc
   34541 }
   34542 
   34543 %skeleton "lalr1.cc" %defines
   34544 %{
   34545 
   34546 int yylex (yy::parser::semantic_type *lvalp);
   34547 %}
   34548 %%
   34549 exp: '0'
   34550 _ATEOF
   34551 
   34552 
   34553 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   34554   at_save_special_files
   34555   mkdir xml-tests
   34556     # Don't combine these Bison invocations since we want to be sure that
   34557   # --report=all isn't required to get the full XML file.
   34558   { set +x
   34559 $as_echo "$at_srcdir/synclines.at:292: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   34560                   --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y"
   34561 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:292"
   34562 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   34563                   --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y
   34564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34565 at_status=$? at_failed=false
   34566 $at_check_filter
   34567 echo stderr:; cat "$at_stderr"
   34568 echo stdout:; cat "$at_stdout"
   34569 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292"
   34570 $at_failed && at_fn_log_failure
   34571 $at_traceon; }
   34572 
   34573   { set +x
   34574 $as_echo "$at_srcdir/synclines.at:292: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
   34575 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:292"
   34576 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y
   34577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34578 at_status=$? at_failed=false
   34579 $at_check_filter
   34580 echo stderr:; cat "$at_stderr"
   34581 echo stdout:; cat "$at_stdout"
   34582 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292"
   34583 $at_failed && at_fn_log_failure
   34584 $at_traceon; }
   34585 
   34586     cp xml-tests/test.output expout
   34587   { set +x
   34588 $as_echo "$at_srcdir/synclines.at:292: \$XSLTPROC \\
   34589              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   34590              xml-tests/test.xml"
   34591 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:292"
   34592 ( $at_check_trace; $XSLTPROC \
   34593              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   34594              xml-tests/test.xml
   34595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34596 at_status=$? at_failed=false
   34597 $at_check_filter
   34598 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34599 $at_diff expout "$at_stdout" || at_failed=:
   34600 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292"
   34601 $at_failed && at_fn_log_failure
   34602 $at_traceon; }
   34603 
   34604   sort xml-tests/test.dot > expout
   34605   { set +x
   34606 $as_echo "$at_srcdir/synclines.at:292: \$XSLTPROC \\
   34607              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   34608              xml-tests/test.xml | sort"
   34609 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:292"
   34610 ( $at_check_trace; $XSLTPROC \
   34611              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   34612              xml-tests/test.xml | sort
   34613 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34614 at_status=$? at_failed=false
   34615 $at_check_filter
   34616 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34617 $at_diff expout "$at_stdout" || at_failed=:
   34618 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292"
   34619 $at_failed && at_fn_log_failure
   34620 $at_traceon; }
   34621 
   34622   rm -rf xml-tests expout
   34623   at_restore_special_files
   34624 fi
   34625 { set +x
   34626 $as_echo "$at_srcdir/synclines.at:292: bison --no-lines -o input.cc -d input.y"
   34627 at_fn_check_prepare_trace "synclines.at:292"
   34628 ( $at_check_trace; bison --no-lines -o input.cc -d input.y
   34629 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34630 at_status=$? at_failed=false
   34631 $at_check_filter
   34632 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34633 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34634 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:292"
   34635 $at_failed && at_fn_log_failure
   34636 $at_traceon; }
   34637 
   34638 
   34639 { set +x
   34640 $as_echo "$at_srcdir/synclines.at:292: grep '#line' *.cc *.hh"
   34641 at_fn_check_prepare_trace "synclines.at:292"
   34642 ( $at_check_trace; grep '#line' *.cc *.hh
   34643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34644 at_status=$? at_failed=false
   34645 $at_check_filter
   34646 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34647 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34648 at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:292"
   34649 $at_failed && at_fn_log_failure
   34650 $at_traceon; }
   34651 
   34652 
   34653 
   34654   set +x
   34655   $at_times_p && times >"$at_times_file"
   34656 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   34657 read at_status <"$at_status_file"
   34658 #AT_STOP_136
   34659 #AT_START_137
   34660 at_fn_group_banner 137 'synclines.at:293' \
   34661   "%no-lines" "                                      " 7
   34662 at_xfail=no
   34663 (
   34664   $as_echo "137. $at_setup_line: testing $at_desc ..."
   34665   $at_traceon
   34666 
   34667 
   34668 
   34669 cat >input.y <<'_ATEOF'
   34670 %code top {
   34671 #include <config.h>
   34672 /* We don't need perfect functions for these tests. */
   34673 #undef malloc
   34674 #undef memcmp
   34675 #undef realloc
   34676 }
   34677 
   34678 %skeleton "glr.cc" %defines
   34679 %{
   34680 
   34681 int yylex (yy::parser::semantic_type *lvalp);
   34682 %}
   34683 %%
   34684 exp: '0'
   34685 _ATEOF
   34686 
   34687 
   34688 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   34689   at_save_special_files
   34690   mkdir xml-tests
   34691     # Don't combine these Bison invocations since we want to be sure that
   34692   # --report=all isn't required to get the full XML file.
   34693   { set +x
   34694 $as_echo "$at_srcdir/synclines.at:293: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   34695                   --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y"
   34696 at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:293"
   34697 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   34698                   --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y
   34699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34700 at_status=$? at_failed=false
   34701 $at_check_filter
   34702 echo stderr:; cat "$at_stderr"
   34703 echo stdout:; cat "$at_stdout"
   34704 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293"
   34705 $at_failed && at_fn_log_failure
   34706 $at_traceon; }
   34707 
   34708   { set +x
   34709 $as_echo "$at_srcdir/synclines.at:293: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
   34710 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:293"
   34711 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y
   34712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34713 at_status=$? at_failed=false
   34714 $at_check_filter
   34715 echo stderr:; cat "$at_stderr"
   34716 echo stdout:; cat "$at_stdout"
   34717 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293"
   34718 $at_failed && at_fn_log_failure
   34719 $at_traceon; }
   34720 
   34721     cp xml-tests/test.output expout
   34722   { set +x
   34723 $as_echo "$at_srcdir/synclines.at:293: \$XSLTPROC \\
   34724              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   34725              xml-tests/test.xml"
   34726 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:293"
   34727 ( $at_check_trace; $XSLTPROC \
   34728              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   34729              xml-tests/test.xml
   34730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34731 at_status=$? at_failed=false
   34732 $at_check_filter
   34733 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34734 $at_diff expout "$at_stdout" || at_failed=:
   34735 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293"
   34736 $at_failed && at_fn_log_failure
   34737 $at_traceon; }
   34738 
   34739   sort xml-tests/test.dot > expout
   34740   { set +x
   34741 $as_echo "$at_srcdir/synclines.at:293: \$XSLTPROC \\
   34742              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   34743              xml-tests/test.xml | sort"
   34744 at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:293"
   34745 ( $at_check_trace; $XSLTPROC \
   34746              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   34747              xml-tests/test.xml | sort
   34748 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34749 at_status=$? at_failed=false
   34750 $at_check_filter
   34751 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34752 $at_diff expout "$at_stdout" || at_failed=:
   34753 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293"
   34754 $at_failed && at_fn_log_failure
   34755 $at_traceon; }
   34756 
   34757   rm -rf xml-tests expout
   34758   at_restore_special_files
   34759 fi
   34760 { set +x
   34761 $as_echo "$at_srcdir/synclines.at:293: bison --no-lines -o input.cc -d input.y"
   34762 at_fn_check_prepare_trace "synclines.at:293"
   34763 ( $at_check_trace; bison --no-lines -o input.cc -d input.y
   34764 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34765 at_status=$? at_failed=false
   34766 $at_check_filter
   34767 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34768 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34769 at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:293"
   34770 $at_failed && at_fn_log_failure
   34771 $at_traceon; }
   34772 
   34773 
   34774 { set +x
   34775 $as_echo "$at_srcdir/synclines.at:293: grep '#line' *.cc *.hh"
   34776 at_fn_check_prepare_trace "synclines.at:293"
   34777 ( $at_check_trace; grep '#line' *.cc *.hh
   34778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34779 at_status=$? at_failed=false
   34780 $at_check_filter
   34781 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34782 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34783 at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:293"
   34784 $at_failed && at_fn_log_failure
   34785 $at_traceon; }
   34786 
   34787 
   34788 
   34789   set +x
   34790   $at_times_p && times >"$at_times_file"
   34791 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   34792 read at_status <"$at_status_file"
   34793 #AT_STOP_137
   34794 #AT_START_138
   34795 at_fn_group_banner 138 'headers.at:57' \
   34796   "Invalid CPP guards:  --defines=input/input.h" "   " 8
   34797 at_xfail=no
   34798 (
   34799   $as_echo "138. $at_setup_line: testing $at_desc ..."
   34800   $at_traceon
   34801 
   34802 
   34803 # Possibly create inner directories.
   34804 dirname=`$as_dirname -- input/input ||
   34805 $as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   34806 	 Xinput/input : 'X\(//\)[^/]' \| \
   34807 	 Xinput/input : 'X\(//\)$' \| \
   34808 	 Xinput/input : 'X\(/\)' \| . 2>/dev/null ||
   34809 $as_echo Xinput/input |
   34810     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
   34811 	    s//\1/
   34812 	    q
   34813 	  }
   34814 	  /^X\(\/\/\)[^/].*/{
   34815 	    s//\1/
   34816 	    q
   34817 	  }
   34818 	  /^X\(\/\/\)$/{
   34819 	    s//\1/
   34820 	    q
   34821 	  }
   34822 	  /^X\(\/\).*/{
   34823 	    s//\1/
   34824 	    q
   34825 	  }
   34826 	  s/.*/./; q'`
   34827 as_dir=$dirname; as_fn_mkdir_p
   34828 
   34829 cat >input/input.y <<'_ATEOF'
   34830 %code top {
   34831 #include <config.h>
   34832 /* We don't need perfect functions for these tests. */
   34833 #undef malloc
   34834 #undef memcmp
   34835 #undef realloc
   34836 }
   34837 
   34838 
   34839 %{
   34840 #include <input/input.h>
   34841 void yyerror ( const char *msg);
   34842 int yylex (void);
   34843 %}
   34844 %%
   34845 dummy:;
   34846 %%
   34847 #include <input/input.h>
   34848 _ATEOF
   34849 
   34850 
   34851 
   34852 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   34853   at_save_special_files
   34854   mkdir xml-tests
   34855     # Don't combine these Bison invocations since we want to be sure that
   34856   # --report=all isn't required to get the full XML file.
   34857   { set +x
   34858 $as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   34859                   --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y"
   34860 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:57"
   34861 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   34862                   --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y
   34863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34864 at_status=$? at_failed=false
   34865 $at_check_filter
   34866 echo stderr:; cat "$at_stderr"
   34867 echo stdout:; cat "$at_stdout"
   34868 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34869 $at_failed && at_fn_log_failure
   34870 $at_traceon; }
   34871 
   34872   { set +x
   34873 $as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y"
   34874 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:57"
   34875 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y
   34876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34877 at_status=$? at_failed=false
   34878 $at_check_filter
   34879 echo stderr:; cat "$at_stderr"
   34880 echo stdout:; cat "$at_stdout"
   34881 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34882 $at_failed && at_fn_log_failure
   34883 $at_traceon; }
   34884 
   34885     cp xml-tests/test.output expout
   34886   { set +x
   34887 $as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\
   34888              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   34889              xml-tests/test.xml"
   34890 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57"
   34891 ( $at_check_trace; $XSLTPROC \
   34892              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   34893              xml-tests/test.xml
   34894 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34895 at_status=$? at_failed=false
   34896 $at_check_filter
   34897 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34898 $at_diff expout "$at_stdout" || at_failed=:
   34899 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34900 $at_failed && at_fn_log_failure
   34901 $at_traceon; }
   34902 
   34903   sort xml-tests/test.dot > expout
   34904   { set +x
   34905 $as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\
   34906              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   34907              xml-tests/test.xml | sort"
   34908 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57"
   34909 ( $at_check_trace; $XSLTPROC \
   34910              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   34911              xml-tests/test.xml | sort
   34912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34913 at_status=$? at_failed=false
   34914 $at_check_filter
   34915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34916 $at_diff expout "$at_stdout" || at_failed=:
   34917 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34918 $at_failed && at_fn_log_failure
   34919 $at_traceon; }
   34920 
   34921   rm -rf xml-tests expout
   34922   at_restore_special_files
   34923 fi
   34924 { set +x
   34925 $as_echo "$at_srcdir/headers.at:57: bison --defines=input/input.h --output=input/input.c input/input.y"
   34926 at_fn_check_prepare_trace "headers.at:57"
   34927 ( $at_check_trace; bison --defines=input/input.h --output=input/input.c input/input.y
   34928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34929 at_status=$? at_failed=false
   34930 $at_check_filter
   34931 at_fn_diff_devnull "$at_stderr" || at_failed=:
   34932 at_fn_diff_devnull "$at_stdout" || at_failed=:
   34933 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34934 $at_failed && at_fn_log_failure
   34935 $at_traceon; }
   34936 
   34937 
   34938 
   34939 { set +x
   34940 $as_echo "$at_srcdir/headers.at:57: \$BISON_C_WORKS"
   34941 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:57"
   34942 ( $at_check_trace; $BISON_C_WORKS
   34943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34944 at_status=$? at_failed=false
   34945 $at_check_filter
   34946 echo stderr:; cat "$at_stderr"
   34947 echo stdout:; cat "$at_stdout"
   34948 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34949 $at_failed && at_fn_log_failure
   34950 $at_traceon; }
   34951 
   34952 { set +x
   34953 $as_echo "$at_srcdir/headers.at:57: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c "
   34954 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:57"
   34955 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c
   34956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   34957 at_status=$? at_failed=false
   34958 $at_check_filter
   34959 echo stderr:; cat "$at_stderr"
   34960 echo stdout:; cat "$at_stdout"
   34961 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
   34962 $at_failed && at_fn_log_failure
   34963 $at_traceon; }
   34964 
   34965 
   34966 
   34967   set +x
   34968   $at_times_p && times >"$at_times_file"
   34969 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   34970 read at_status <"$at_status_file"
   34971 #AT_STOP_138
   34972 #AT_START_139
   34973 at_fn_group_banner 139 'headers.at:58' \
   34974   "Invalid CPP guards:  --defines=9foo.h" "          " 8
   34975 at_xfail=no
   34976 (
   34977   $as_echo "139. $at_setup_line: testing $at_desc ..."
   34978   $at_traceon
   34979 
   34980 
   34981 # Possibly create inner directories.
   34982 dirname=`$as_dirname -- 9foo ||
   34983 $as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   34984 	 X9foo : 'X\(//\)[^/]' \| \
   34985 	 X9foo : 'X\(//\)$' \| \
   34986 	 X9foo : 'X\(/\)' \| . 2>/dev/null ||
   34987 $as_echo X9foo |
   34988     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
   34989 	    s//\1/
   34990 	    q
   34991 	  }
   34992 	  /^X\(\/\/\)[^/].*/{
   34993 	    s//\1/
   34994 	    q
   34995 	  }
   34996 	  /^X\(\/\/\)$/{
   34997 	    s//\1/
   34998 	    q
   34999 	  }
   35000 	  /^X\(\/\).*/{
   35001 	    s//\1/
   35002 	    q
   35003 	  }
   35004 	  s/.*/./; q'`
   35005 as_dir=$dirname; as_fn_mkdir_p
   35006 
   35007 cat >9foo.y <<'_ATEOF'
   35008 %code top {
   35009 #include <config.h>
   35010 /* We don't need perfect functions for these tests. */
   35011 #undef malloc
   35012 #undef memcmp
   35013 #undef realloc
   35014 }
   35015 
   35016 
   35017 %{
   35018 #include <9foo.h>
   35019 void yyerror ( const char *msg);
   35020 int yylex (void);
   35021 %}
   35022 %%
   35023 dummy:;
   35024 %%
   35025 #include <9foo.h>
   35026 _ATEOF
   35027 
   35028 
   35029 
   35030 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   35031   at_save_special_files
   35032   mkdir xml-tests
   35033     # Don't combine these Bison invocations since we want to be sure that
   35034   # --report=all isn't required to get the full XML file.
   35035   { set +x
   35036 $as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   35037                   --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y"
   35038 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:58"
   35039 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   35040                   --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y
   35041 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35042 at_status=$? at_failed=false
   35043 $at_check_filter
   35044 echo stderr:; cat "$at_stderr"
   35045 echo stdout:; cat "$at_stdout"
   35046 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35047 $at_failed && at_fn_log_failure
   35048 $at_traceon; }
   35049 
   35050   { set +x
   35051 $as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y"
   35052 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:58"
   35053 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y
   35054 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35055 at_status=$? at_failed=false
   35056 $at_check_filter
   35057 echo stderr:; cat "$at_stderr"
   35058 echo stdout:; cat "$at_stdout"
   35059 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35060 $at_failed && at_fn_log_failure
   35061 $at_traceon; }
   35062 
   35063     cp xml-tests/test.output expout
   35064   { set +x
   35065 $as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\
   35066              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   35067              xml-tests/test.xml"
   35068 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58"
   35069 ( $at_check_trace; $XSLTPROC \
   35070              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   35071              xml-tests/test.xml
   35072 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35073 at_status=$? at_failed=false
   35074 $at_check_filter
   35075 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35076 $at_diff expout "$at_stdout" || at_failed=:
   35077 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35078 $at_failed && at_fn_log_failure
   35079 $at_traceon; }
   35080 
   35081   sort xml-tests/test.dot > expout
   35082   { set +x
   35083 $as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\
   35084              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   35085              xml-tests/test.xml | sort"
   35086 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58"
   35087 ( $at_check_trace; $XSLTPROC \
   35088              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   35089              xml-tests/test.xml | sort
   35090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35091 at_status=$? at_failed=false
   35092 $at_check_filter
   35093 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35094 $at_diff expout "$at_stdout" || at_failed=:
   35095 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35096 $at_failed && at_fn_log_failure
   35097 $at_traceon; }
   35098 
   35099   rm -rf xml-tests expout
   35100   at_restore_special_files
   35101 fi
   35102 { set +x
   35103 $as_echo "$at_srcdir/headers.at:58: bison --defines=9foo.h --output=9foo.c 9foo.y"
   35104 at_fn_check_prepare_trace "headers.at:58"
   35105 ( $at_check_trace; bison --defines=9foo.h --output=9foo.c 9foo.y
   35106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35107 at_status=$? at_failed=false
   35108 $at_check_filter
   35109 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35110 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35111 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35112 $at_failed && at_fn_log_failure
   35113 $at_traceon; }
   35114 
   35115 
   35116 
   35117 { set +x
   35118 $as_echo "$at_srcdir/headers.at:58: \$BISON_C_WORKS"
   35119 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:58"
   35120 ( $at_check_trace; $BISON_C_WORKS
   35121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35122 at_status=$? at_failed=false
   35123 $at_check_filter
   35124 echo stderr:; cat "$at_stderr"
   35125 echo stdout:; cat "$at_stdout"
   35126 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35127 $at_failed && at_fn_log_failure
   35128 $at_traceon; }
   35129 
   35130 { set +x
   35131 $as_echo "$at_srcdir/headers.at:58: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c "
   35132 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:58"
   35133 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c
   35134 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35135 at_status=$? at_failed=false
   35136 $at_check_filter
   35137 echo stderr:; cat "$at_stderr"
   35138 echo stdout:; cat "$at_stdout"
   35139 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
   35140 $at_failed && at_fn_log_failure
   35141 $at_traceon; }
   35142 
   35143 
   35144 
   35145   set +x
   35146   $at_times_p && times >"$at_times_file"
   35147 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   35148 read at_status <"$at_status_file"
   35149 #AT_STOP_139
   35150 #AT_START_140
   35151 at_fn_group_banner 140 'headers.at:59' \
   35152   "Invalid CPP guards: %glr-parser --defines=input/input.h" "" 8
   35153 at_xfail=no
   35154 (
   35155   $as_echo "140. $at_setup_line: testing $at_desc ..."
   35156   $at_traceon
   35157 
   35158 
   35159 # Possibly create inner directories.
   35160 dirname=`$as_dirname -- input/input ||
   35161 $as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   35162 	 Xinput/input : 'X\(//\)[^/]' \| \
   35163 	 Xinput/input : 'X\(//\)$' \| \
   35164 	 Xinput/input : 'X\(/\)' \| . 2>/dev/null ||
   35165 $as_echo Xinput/input |
   35166     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
   35167 	    s//\1/
   35168 	    q
   35169 	  }
   35170 	  /^X\(\/\/\)[^/].*/{
   35171 	    s//\1/
   35172 	    q
   35173 	  }
   35174 	  /^X\(\/\/\)$/{
   35175 	    s//\1/
   35176 	    q
   35177 	  }
   35178 	  /^X\(\/\).*/{
   35179 	    s//\1/
   35180 	    q
   35181 	  }
   35182 	  s/.*/./; q'`
   35183 as_dir=$dirname; as_fn_mkdir_p
   35184 
   35185 cat >input/input.y <<'_ATEOF'
   35186 %code top {
   35187 #include <config.h>
   35188 /* We don't need perfect functions for these tests. */
   35189 #undef malloc
   35190 #undef memcmp
   35191 #undef realloc
   35192 }
   35193 
   35194 %glr-parser
   35195 %{
   35196 #include <input/input.h>
   35197 void yyerror ( const char *msg);
   35198 int yylex (void);
   35199 %}
   35200 %%
   35201 dummy:;
   35202 %%
   35203 #include <input/input.h>
   35204 _ATEOF
   35205 
   35206 
   35207 
   35208 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   35209   at_save_special_files
   35210   mkdir xml-tests
   35211     # Don't combine these Bison invocations since we want to be sure that
   35212   # --report=all isn't required to get the full XML file.
   35213   { set +x
   35214 $as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   35215                   --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y"
   35216 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:59"
   35217 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   35218                   --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y
   35219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35220 at_status=$? at_failed=false
   35221 $at_check_filter
   35222 echo stderr:; cat "$at_stderr"
   35223 echo stdout:; cat "$at_stdout"
   35224 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35225 $at_failed && at_fn_log_failure
   35226 $at_traceon; }
   35227 
   35228   { set +x
   35229 $as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y"
   35230 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:59"
   35231 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y
   35232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35233 at_status=$? at_failed=false
   35234 $at_check_filter
   35235 echo stderr:; cat "$at_stderr"
   35236 echo stdout:; cat "$at_stdout"
   35237 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35238 $at_failed && at_fn_log_failure
   35239 $at_traceon; }
   35240 
   35241     cp xml-tests/test.output expout
   35242   { set +x
   35243 $as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\
   35244              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   35245              xml-tests/test.xml"
   35246 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59"
   35247 ( $at_check_trace; $XSLTPROC \
   35248              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   35249              xml-tests/test.xml
   35250 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35251 at_status=$? at_failed=false
   35252 $at_check_filter
   35253 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35254 $at_diff expout "$at_stdout" || at_failed=:
   35255 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35256 $at_failed && at_fn_log_failure
   35257 $at_traceon; }
   35258 
   35259   sort xml-tests/test.dot > expout
   35260   { set +x
   35261 $as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\
   35262              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   35263              xml-tests/test.xml | sort"
   35264 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59"
   35265 ( $at_check_trace; $XSLTPROC \
   35266              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   35267              xml-tests/test.xml | sort
   35268 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35269 at_status=$? at_failed=false
   35270 $at_check_filter
   35271 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35272 $at_diff expout "$at_stdout" || at_failed=:
   35273 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35274 $at_failed && at_fn_log_failure
   35275 $at_traceon; }
   35276 
   35277   rm -rf xml-tests expout
   35278   at_restore_special_files
   35279 fi
   35280 { set +x
   35281 $as_echo "$at_srcdir/headers.at:59: bison --defines=input/input.h --output=input/input.c input/input.y"
   35282 at_fn_check_prepare_trace "headers.at:59"
   35283 ( $at_check_trace; bison --defines=input/input.h --output=input/input.c input/input.y
   35284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35285 at_status=$? at_failed=false
   35286 $at_check_filter
   35287 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35288 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35289 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35290 $at_failed && at_fn_log_failure
   35291 $at_traceon; }
   35292 
   35293 
   35294 
   35295 { set +x
   35296 $as_echo "$at_srcdir/headers.at:59: \$BISON_C_WORKS"
   35297 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:59"
   35298 ( $at_check_trace; $BISON_C_WORKS
   35299 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35300 at_status=$? at_failed=false
   35301 $at_check_filter
   35302 echo stderr:; cat "$at_stderr"
   35303 echo stdout:; cat "$at_stdout"
   35304 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35305 $at_failed && at_fn_log_failure
   35306 $at_traceon; }
   35307 
   35308 { set +x
   35309 $as_echo "$at_srcdir/headers.at:59: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c "
   35310 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:59"
   35311 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c
   35312 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35313 at_status=$? at_failed=false
   35314 $at_check_filter
   35315 echo stderr:; cat "$at_stderr"
   35316 echo stdout:; cat "$at_stdout"
   35317 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
   35318 $at_failed && at_fn_log_failure
   35319 $at_traceon; }
   35320 
   35321 
   35322 
   35323   set +x
   35324   $at_times_p && times >"$at_times_file"
   35325 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   35326 read at_status <"$at_status_file"
   35327 #AT_STOP_140
   35328 #AT_START_141
   35329 at_fn_group_banner 141 'headers.at:60' \
   35330   "Invalid CPP guards: %glr-parser --defines=9foo.h" "" 8
   35331 at_xfail=no
   35332 (
   35333   $as_echo "141. $at_setup_line: testing $at_desc ..."
   35334   $at_traceon
   35335 
   35336 
   35337 # Possibly create inner directories.
   35338 dirname=`$as_dirname -- 9foo ||
   35339 $as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   35340 	 X9foo : 'X\(//\)[^/]' \| \
   35341 	 X9foo : 'X\(//\)$' \| \
   35342 	 X9foo : 'X\(/\)' \| . 2>/dev/null ||
   35343 $as_echo X9foo |
   35344     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
   35345 	    s//\1/
   35346 	    q
   35347 	  }
   35348 	  /^X\(\/\/\)[^/].*/{
   35349 	    s//\1/
   35350 	    q
   35351 	  }
   35352 	  /^X\(\/\/\)$/{
   35353 	    s//\1/
   35354 	    q
   35355 	  }
   35356 	  /^X\(\/\).*/{
   35357 	    s//\1/
   35358 	    q
   35359 	  }
   35360 	  s/.*/./; q'`
   35361 as_dir=$dirname; as_fn_mkdir_p
   35362 
   35363 cat >9foo.y <<'_ATEOF'
   35364 %code top {
   35365 #include <config.h>
   35366 /* We don't need perfect functions for these tests. */
   35367 #undef malloc
   35368 #undef memcmp
   35369 #undef realloc
   35370 }
   35371 
   35372 %glr-parser
   35373 %{
   35374 #include <9foo.h>
   35375 void yyerror ( const char *msg);
   35376 int yylex (void);
   35377 %}
   35378 %%
   35379 dummy:;
   35380 %%
   35381 #include <9foo.h>
   35382 _ATEOF
   35383 
   35384 
   35385 
   35386 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   35387   at_save_special_files
   35388   mkdir xml-tests
   35389     # Don't combine these Bison invocations since we want to be sure that
   35390   # --report=all isn't required to get the full XML file.
   35391   { set +x
   35392 $as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   35393                   --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y"
   35394 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:60"
   35395 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   35396                   --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y
   35397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35398 at_status=$? at_failed=false
   35399 $at_check_filter
   35400 echo stderr:; cat "$at_stderr"
   35401 echo stdout:; cat "$at_stdout"
   35402 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35403 $at_failed && at_fn_log_failure
   35404 $at_traceon; }
   35405 
   35406   { set +x
   35407 $as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y"
   35408 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:60"
   35409 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y
   35410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35411 at_status=$? at_failed=false
   35412 $at_check_filter
   35413 echo stderr:; cat "$at_stderr"
   35414 echo stdout:; cat "$at_stdout"
   35415 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35416 $at_failed && at_fn_log_failure
   35417 $at_traceon; }
   35418 
   35419     cp xml-tests/test.output expout
   35420   { set +x
   35421 $as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\
   35422              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   35423              xml-tests/test.xml"
   35424 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:60"
   35425 ( $at_check_trace; $XSLTPROC \
   35426              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   35427              xml-tests/test.xml
   35428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35429 at_status=$? at_failed=false
   35430 $at_check_filter
   35431 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35432 $at_diff expout "$at_stdout" || at_failed=:
   35433 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35434 $at_failed && at_fn_log_failure
   35435 $at_traceon; }
   35436 
   35437   sort xml-tests/test.dot > expout
   35438   { set +x
   35439 $as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\
   35440              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   35441              xml-tests/test.xml | sort"
   35442 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:60"
   35443 ( $at_check_trace; $XSLTPROC \
   35444              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   35445              xml-tests/test.xml | sort
   35446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35447 at_status=$? at_failed=false
   35448 $at_check_filter
   35449 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35450 $at_diff expout "$at_stdout" || at_failed=:
   35451 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35452 $at_failed && at_fn_log_failure
   35453 $at_traceon; }
   35454 
   35455   rm -rf xml-tests expout
   35456   at_restore_special_files
   35457 fi
   35458 { set +x
   35459 $as_echo "$at_srcdir/headers.at:60: bison --defines=9foo.h --output=9foo.c 9foo.y"
   35460 at_fn_check_prepare_trace "headers.at:60"
   35461 ( $at_check_trace; bison --defines=9foo.h --output=9foo.c 9foo.y
   35462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35463 at_status=$? at_failed=false
   35464 $at_check_filter
   35465 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35466 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35467 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35468 $at_failed && at_fn_log_failure
   35469 $at_traceon; }
   35470 
   35471 
   35472 
   35473 { set +x
   35474 $as_echo "$at_srcdir/headers.at:60: \$BISON_C_WORKS"
   35475 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:60"
   35476 ( $at_check_trace; $BISON_C_WORKS
   35477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35478 at_status=$? at_failed=false
   35479 $at_check_filter
   35480 echo stderr:; cat "$at_stderr"
   35481 echo stdout:; cat "$at_stdout"
   35482 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35483 $at_failed && at_fn_log_failure
   35484 $at_traceon; }
   35485 
   35486 { set +x
   35487 $as_echo "$at_srcdir/headers.at:60: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c "
   35488 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:60"
   35489 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c
   35490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35491 at_status=$? at_failed=false
   35492 $at_check_filter
   35493 echo stderr:; cat "$at_stderr"
   35494 echo stdout:; cat "$at_stdout"
   35495 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60"
   35496 $at_failed && at_fn_log_failure
   35497 $at_traceon; }
   35498 
   35499 
   35500 
   35501   set +x
   35502   $at_times_p && times >"$at_times_file"
   35503 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   35504 read at_status <"$at_status_file"
   35505 #AT_STOP_141
   35506 #AT_START_142
   35507 at_fn_group_banner 142 'headers.at:69' \
   35508   "export YYLTYPE" "                                 " 8
   35509 at_xfail=no
   35510 (
   35511   $as_echo "142. $at_setup_line: testing $at_desc ..."
   35512   $at_traceon
   35513 
   35514 
   35515 cat >input.y <<'_ATEOF'
   35516 %code top {
   35517 #include <config.h>
   35518 /* We don't need perfect functions for these tests. */
   35519 #undef malloc
   35520 #undef memcmp
   35521 #undef realloc
   35522 }
   35523 
   35524 %locations
   35525 
   35526 %name-prefix "my_"
   35527 %{
   35528 #include <stdio.h>
   35529 #include <stdlib.h>
   35530 
   35531 static int
   35532 my_lex (void)
   35533 {
   35534   return EOF;
   35535 }
   35536 
   35537 static void
   35538 my_error (const char *msg)
   35539 {
   35540   fprintf (stderr, "%s\n", msg);
   35541 }
   35542 
   35543 %}
   35544 %%
   35545 exp:;
   35546 _ATEOF
   35547 
   35548 
   35549 
   35550 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   35551   at_save_special_files
   35552   mkdir xml-tests
   35553     # Don't combine these Bison invocations since we want to be sure that
   35554   # --report=all isn't required to get the full XML file.
   35555   { set +x
   35556 $as_echo "$at_srcdir/headers.at:96: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   35557                   --graph=xml-tests/test.dot --defines -o input.c input.y"
   35558 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:96"
   35559 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   35560                   --graph=xml-tests/test.dot --defines -o input.c input.y
   35561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35562 at_status=$? at_failed=false
   35563 $at_check_filter
   35564 echo stderr:; cat "$at_stderr"
   35565 echo stdout:; cat "$at_stdout"
   35566 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96"
   35567 $at_failed && at_fn_log_failure
   35568 $at_traceon; }
   35569 
   35570   { set +x
   35571 $as_echo "$at_srcdir/headers.at:96: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines -o input.c input.y"
   35572 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines -o input.c input.y" "headers.at:96"
   35573 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --defines -o input.c input.y
   35574 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35575 at_status=$? at_failed=false
   35576 $at_check_filter
   35577 echo stderr:; cat "$at_stderr"
   35578 echo stdout:; cat "$at_stdout"
   35579 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96"
   35580 $at_failed && at_fn_log_failure
   35581 $at_traceon; }
   35582 
   35583     cp xml-tests/test.output expout
   35584   { set +x
   35585 $as_echo "$at_srcdir/headers.at:96: \$XSLTPROC \\
   35586              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   35587              xml-tests/test.xml"
   35588 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:96"
   35589 ( $at_check_trace; $XSLTPROC \
   35590              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   35591              xml-tests/test.xml
   35592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35593 at_status=$? at_failed=false
   35594 $at_check_filter
   35595 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35596 $at_diff expout "$at_stdout" || at_failed=:
   35597 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96"
   35598 $at_failed && at_fn_log_failure
   35599 $at_traceon; }
   35600 
   35601   sort xml-tests/test.dot > expout
   35602   { set +x
   35603 $as_echo "$at_srcdir/headers.at:96: \$XSLTPROC \\
   35604              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   35605              xml-tests/test.xml | sort"
   35606 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:96"
   35607 ( $at_check_trace; $XSLTPROC \
   35608              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   35609              xml-tests/test.xml | sort
   35610 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35611 at_status=$? at_failed=false
   35612 $at_check_filter
   35613 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35614 $at_diff expout "$at_stdout" || at_failed=:
   35615 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96"
   35616 $at_failed && at_fn_log_failure
   35617 $at_traceon; }
   35618 
   35619   rm -rf xml-tests expout
   35620   at_restore_special_files
   35621 fi
   35622 { set +x
   35623 $as_echo "$at_srcdir/headers.at:96: bison --defines -o input.c input.y"
   35624 at_fn_check_prepare_trace "headers.at:96"
   35625 ( $at_check_trace; bison --defines -o input.c input.y
   35626 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35627 at_status=$? at_failed=false
   35628 $at_check_filter
   35629 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35630 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35631 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:96"
   35632 $at_failed && at_fn_log_failure
   35633 $at_traceon; }
   35634 
   35635 
   35636 
   35637 # YYLTYPE should be defined, and MY_LLOC declared.
   35638 cat >caller.c <<'_ATEOF'
   35639 #include "input.h"
   35640 YYLTYPE *my_llocp = &my_lloc;
   35641 
   35642 int my_parse (void);
   35643 
   35644 int
   35645 main (void)
   35646 {
   35647   return my_parse ();
   35648 }
   35649 _ATEOF
   35650 
   35651 
   35652 # Link and execute, just to make sure everything is fine (and in
   35653 # particular, that MY_LLOC is indeed defined somewhere).
   35654 { set +x
   35655 $as_echo "$at_srcdir/headers.at:114: \$BISON_C_WORKS"
   35656 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:114"
   35657 ( $at_check_trace; $BISON_C_WORKS
   35658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35659 at_status=$? at_failed=false
   35660 $at_check_filter
   35661 echo stderr:; cat "$at_stderr"
   35662 echo stdout:; cat "$at_stdout"
   35663 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:114"
   35664 $at_failed && at_fn_log_failure
   35665 $at_traceon; }
   35666 
   35667 { set +x
   35668 $as_echo "$at_srcdir/headers.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o caller.o caller.c "
   35669 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c " "headers.at:114"
   35670 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c
   35671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35672 at_status=$? at_failed=false
   35673 $at_check_filter
   35674 echo stderr:; cat "$at_stderr"
   35675 echo stdout:; cat "$at_stdout"
   35676 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:114"
   35677 $at_failed && at_fn_log_failure
   35678 $at_traceon; }
   35679 
   35680 { set +x
   35681 $as_echo "$at_srcdir/headers.at:115: \$BISON_C_WORKS"
   35682 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:115"
   35683 ( $at_check_trace; $BISON_C_WORKS
   35684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35685 at_status=$? at_failed=false
   35686 $at_check_filter
   35687 echo stderr:; cat "$at_stderr"
   35688 echo stdout:; cat "$at_stdout"
   35689 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:115"
   35690 $at_failed && at_fn_log_failure
   35691 $at_traceon; }
   35692 
   35693 { set +x
   35694 $as_echo "$at_srcdir/headers.at:115: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   35695 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:115"
   35696 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   35697 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35698 at_status=$? at_failed=false
   35699 $at_check_filter
   35700 echo stderr:; cat "$at_stderr"
   35701 echo stdout:; cat "$at_stdout"
   35702 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:115"
   35703 $at_failed && at_fn_log_failure
   35704 $at_traceon; }
   35705 
   35706 { set +x
   35707 $as_echo "$at_srcdir/headers.at:116: \$BISON_C_WORKS"
   35708 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:116"
   35709 ( $at_check_trace; $BISON_C_WORKS
   35710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35711 at_status=$? at_failed=false
   35712 $at_check_filter
   35713 echo stderr:; cat "$at_stderr"
   35714 echo stdout:; cat "$at_stdout"
   35715 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:116"
   35716 $at_failed && at_fn_log_failure
   35717 $at_traceon; }
   35718 
   35719 { set +x
   35720 $as_echo "$at_srcdir/headers.at:116: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o caller caller.o input.o \$LIBS"
   35721 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS" "headers.at:116"
   35722 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS
   35723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35724 at_status=$? at_failed=false
   35725 $at_check_filter
   35726 echo stderr:; cat "$at_stderr"
   35727 echo stdout:; cat "$at_stdout"
   35728 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:116"
   35729 $at_failed && at_fn_log_failure
   35730 $at_traceon; }
   35731 
   35732 { set +x
   35733 $as_echo "$at_srcdir/headers.at:117:  \$PREPARSER ./caller"
   35734 at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:117"
   35735 ( $at_check_trace;  $PREPARSER ./caller
   35736 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35737 at_status=$? at_failed=false
   35738 $at_check_filter
   35739 echo stderr:; tee stderr <"$at_stderr"
   35740 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35741 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:117"
   35742 $at_failed && at_fn_log_failure
   35743 $at_traceon; }
   35744 
   35745 { set +x
   35746 $as_echo "$at_srcdir/headers.at:117: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   35747 at_fn_check_prepare_trace "headers.at:117"
   35748 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   35749 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35750 at_status=$? at_failed=false
   35751 $at_check_filter
   35752 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35753 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35754 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:117"
   35755 $at_failed && at_fn_log_failure
   35756 $at_traceon; }
   35757 
   35758 
   35759 
   35760   set +x
   35761   $at_times_p && times >"$at_times_file"
   35762 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   35763 read at_status <"$at_status_file"
   35764 #AT_STOP_142
   35765 #AT_START_143
   35766 at_fn_group_banner 143 'headers.at:125' \
   35767   "Several parsers" "                                " 8
   35768 at_xfail=no
   35769 (
   35770   $as_echo "143. $at_setup_line: testing $at_desc ..."
   35771   $at_traceon
   35772 
   35773 
   35774 # AT_TEST([PREFIX], [DIRECTIVES])
   35775 # -------------------------------
   35776 # Generate and compile to *.o.  Make sure there is no (allowed) YY*
   35777 # nor yy* identifiers in the header.  Check that headers are
   35778 # self-contained, and can be compiled by a C++ compiler.
   35779 # AT_TEST
   35780 
   35781 cat >main.cc <<'_ATEOF'
   35782 #include <config.h>
   35783 /* We don't need perfect functions for these tests. */
   35784 #undef malloc
   35785 #undef memcmp
   35786 #undef realloc
   35787 
   35788 // If we are compiling with CC=$CXX, then do not load the C headers
   35789 // inside extern "C", since they were _not_ compiled this way.
   35790 #if ! CC_IS_CXX
   35791 extern "C"
   35792 {
   35793 #endif
   35794   #include "x1.h"
   35795   #include "x2.h"
   35796   #include "x3.h"
   35797   #include "x4.h"
   35798   #include "x6.h"
   35799   #include "x7.h"
   35800   #include "x8.h"
   35801 #if ! CC_IS_CXX
   35802 }
   35803 #endif
   35804 #include "x5.hh"
   35805 //#include "x6.hh"
   35806 
   35807 #define RUN(S)                                  \
   35808   do {                                          \
   35809     int res = S;                                \
   35810     if (res)                                    \
   35811       std::cerr << #S": " << res << std::endl;  \
   35812   } while (false)
   35813 
   35814 int
   35815 main (void)
   35816 {
   35817   RUN(x1_parse());
   35818   RUN(x2_parse());
   35819   RUN(x3_parse());
   35820   RUN(x4_parse());
   35821   x5_::parser p5;
   35822   RUN(p5.parse());
   35823   RUN(x6_parse());
   35824   RUN(x7_parse());
   35825   RUN(x8_parse());
   35826 //  x6_::parser p6;
   35827 //  RUN(p6.parse());
   35828   return 0;
   35829 }
   35830 _ATEOF
   35831 # main.cc
   35832 
   35833 
   35834 cat >x1.y <<'_ATEOF'
   35835 %code top {
   35836 #include <config.h>
   35837 /* We don't need perfect functions for these tests. */
   35838 #undef malloc
   35839 #undef memcmp
   35840 #undef realloc
   35841 }
   35842 
   35843 %define api.prefix "x1_"
   35844 
   35845 %error-verbose
   35846 %union
   35847 {
   35848   int integer;
   35849 }
   35850 %{
   35851 #include <stdio.h>
   35852   static void x1_error ( const char *msg);
   35853   static int x1_lex (void);
   35854 %}
   35855 %%
   35856 exp:
   35857   'x' '1' { printf ("x1\n"); }
   35858 | 'x' '2' { printf ("x2\n"); }
   35859 | 'x' '3' { printf ("x3\n"); }
   35860 | 'x' '4' { printf ("x4\n"); }
   35861 | 'x' '5' { printf ("x5\n"); }
   35862 | 'x' '6' { printf ("x6\n"); }
   35863 | 'x' '7' { printf ("x7\n"); }
   35864 | 'x' '8' { printf ("x8\n"); }
   35865 ;
   35866 
   35867 %%
   35868 #include <stdio.h>
   35869 /* A C error reporting function.  */
   35870 static
   35871 void x1_error ( const char *msg)
   35872 {
   35873   fprintf (stderr, "%s\n", msg);
   35874 }
   35875 #include <assert.h>
   35876 static
   35877 int x1_lex (void)
   35878 {
   35879   static char const input[] = "x1";
   35880   static size_t toknum = 0;
   35881   int res;
   35882   ;
   35883   assert (toknum < sizeof input / sizeof input[0]);
   35884   res = input[toknum++];
   35885   ;
   35886   return res;
   35887 }
   35888 _ATEOF
   35889 
   35890 
   35891 
   35892 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   35893   at_save_special_files
   35894   mkdir xml-tests
   35895     # Don't combine these Bison invocations since we want to be sure that
   35896   # --report=all isn't required to get the full XML file.
   35897   { set +x
   35898 $as_echo "$at_srcdir/headers.at:218: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   35899                   --graph=xml-tests/test.dot -d -o x1.c x1.y"
   35900 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:218"
   35901 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   35902                   --graph=xml-tests/test.dot -d -o x1.c x1.y
   35903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35904 at_status=$? at_failed=false
   35905 $at_check_filter
   35906 echo stderr:; cat "$at_stderr"
   35907 echo stdout:; cat "$at_stdout"
   35908 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   35909 $at_failed && at_fn_log_failure
   35910 $at_traceon; }
   35911 
   35912   { set +x
   35913 $as_echo "$at_srcdir/headers.at:218: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x1.c x1.y"
   35914 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x1.c x1.y" "headers.at:218"
   35915 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x1.c x1.y
   35916 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35917 at_status=$? at_failed=false
   35918 $at_check_filter
   35919 echo stderr:; cat "$at_stderr"
   35920 echo stdout:; cat "$at_stdout"
   35921 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   35922 $at_failed && at_fn_log_failure
   35923 $at_traceon; }
   35924 
   35925     cp xml-tests/test.output expout
   35926   { set +x
   35927 $as_echo "$at_srcdir/headers.at:218: \$XSLTPROC \\
   35928              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   35929              xml-tests/test.xml"
   35930 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:218"
   35931 ( $at_check_trace; $XSLTPROC \
   35932              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   35933              xml-tests/test.xml
   35934 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35935 at_status=$? at_failed=false
   35936 $at_check_filter
   35937 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35938 $at_diff expout "$at_stdout" || at_failed=:
   35939 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   35940 $at_failed && at_fn_log_failure
   35941 $at_traceon; }
   35942 
   35943   sort xml-tests/test.dot > expout
   35944   { set +x
   35945 $as_echo "$at_srcdir/headers.at:218: \$XSLTPROC \\
   35946              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   35947              xml-tests/test.xml | sort"
   35948 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:218"
   35949 ( $at_check_trace; $XSLTPROC \
   35950              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   35951              xml-tests/test.xml | sort
   35952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35953 at_status=$? at_failed=false
   35954 $at_check_filter
   35955 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35956 $at_diff expout "$at_stdout" || at_failed=:
   35957 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   35958 $at_failed && at_fn_log_failure
   35959 $at_traceon; }
   35960 
   35961   rm -rf xml-tests expout
   35962   at_restore_special_files
   35963 fi
   35964 { set +x
   35965 $as_echo "$at_srcdir/headers.at:218: bison -d -o x1.c x1.y"
   35966 at_fn_check_prepare_trace "headers.at:218"
   35967 ( $at_check_trace; bison -d -o x1.c x1.y
   35968 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35969 at_status=$? at_failed=false
   35970 $at_check_filter
   35971 at_fn_diff_devnull "$at_stderr" || at_failed=:
   35972 at_fn_diff_devnull "$at_stdout" || at_failed=:
   35973 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   35974 $at_failed && at_fn_log_failure
   35975 $at_traceon; }
   35976 
   35977 
   35978 
   35979 { set +x
   35980 $as_echo "$at_srcdir/headers.at:218: \$BISON_C_WORKS"
   35981 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:218"
   35982 ( $at_check_trace; $BISON_C_WORKS
   35983 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35984 at_status=$? at_failed=false
   35985 $at_check_filter
   35986 echo stderr:; cat "$at_stderr"
   35987 echo stdout:; cat "$at_stdout"
   35988 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   35989 $at_failed && at_fn_log_failure
   35990 $at_traceon; }
   35991 
   35992 { set +x
   35993 $as_echo "$at_srcdir/headers.at:218: \$CC \$CFLAGS \$CPPFLAGS -c -o x1.o x1.c "
   35994 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c " "headers.at:218"
   35995 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c
   35996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   35997 at_status=$? at_failed=false
   35998 $at_check_filter
   35999 echo stderr:; cat "$at_stderr"
   36000 echo stdout:; cat "$at_stdout"
   36001 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   36002 $at_failed && at_fn_log_failure
   36003 $at_traceon; }
   36004 
   36005 { set +x
   36006 $as_echo "$at_srcdir/headers.at:218: echo \"x1\" >>expout"
   36007 at_fn_check_prepare_trace "headers.at:218"
   36008 ( $at_check_trace; echo "x1" >>expout
   36009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36010 at_status=$? at_failed=false
   36011 $at_check_filter
   36012 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36013 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36014 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:218"
   36015 $at_failed && at_fn_log_failure
   36016 $at_traceon; }
   36017 
   36018 
   36019 
   36020 
   36021 
   36022 cat >x2.y <<'_ATEOF'
   36023 %code top {
   36024 #include <config.h>
   36025 /* We don't need perfect functions for these tests. */
   36026 #undef malloc
   36027 #undef memcmp
   36028 #undef realloc
   36029 }
   36030 
   36031 %define api.prefix "x2_"
   36032 %locations %debug
   36033 %error-verbose
   36034 %union
   36035 {
   36036   int integer;
   36037 }
   36038 %{
   36039 #include <stdio.h>
   36040   static void x2_error ( const char *msg);
   36041   static int x2_lex (void);
   36042 %}
   36043 %%
   36044 exp:
   36045   'x' '1' { printf ("x1\n"); }
   36046 | 'x' '2' { printf ("x2\n"); }
   36047 | 'x' '3' { printf ("x3\n"); }
   36048 | 'x' '4' { printf ("x4\n"); }
   36049 | 'x' '5' { printf ("x5\n"); }
   36050 | 'x' '6' { printf ("x6\n"); }
   36051 | 'x' '7' { printf ("x7\n"); }
   36052 | 'x' '8' { printf ("x8\n"); }
   36053 ;
   36054 
   36055 %%
   36056 #include <stdio.h>
   36057 /* A C error reporting function.  */
   36058 static
   36059 void x2_error ( const char *msg)
   36060 {
   36061   YY_LOCATION_PRINT (stderr, (x2_lloc));
   36062   fprintf (stderr, ": ");
   36063   fprintf (stderr, "%s\n", msg);
   36064 }
   36065 #include <assert.h>
   36066 static
   36067 int x2_lex (void)
   36068 {
   36069   static char const input[] = "x2";
   36070   static size_t toknum = 0;
   36071   int res;
   36072   ;
   36073   assert (toknum < sizeof input / sizeof input[0]);
   36074   res = input[toknum++];
   36075   ;
   36076   (x2_lloc).first_line = (x2_lloc).last_line = 1;
   36077   (x2_lloc).first_column = (x2_lloc).last_column = toknum;
   36078   return res;
   36079 }
   36080 _ATEOF
   36081 
   36082 
   36083 
   36084 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   36085   at_save_special_files
   36086   mkdir xml-tests
   36087     # Don't combine these Bison invocations since we want to be sure that
   36088   # --report=all isn't required to get the full XML file.
   36089   { set +x
   36090 $as_echo "$at_srcdir/headers.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   36091                   --graph=xml-tests/test.dot -d -o x2.c x2.y"
   36092 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:219"
   36093 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   36094                   --graph=xml-tests/test.dot -d -o x2.c x2.y
   36095 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36096 at_status=$? at_failed=false
   36097 $at_check_filter
   36098 echo stderr:; cat "$at_stderr"
   36099 echo stdout:; cat "$at_stdout"
   36100 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36101 $at_failed && at_fn_log_failure
   36102 $at_traceon; }
   36103 
   36104   { set +x
   36105 $as_echo "$at_srcdir/headers.at:219: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x2.c x2.y"
   36106 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x2.c x2.y" "headers.at:219"
   36107 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x2.c x2.y
   36108 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36109 at_status=$? at_failed=false
   36110 $at_check_filter
   36111 echo stderr:; cat "$at_stderr"
   36112 echo stdout:; cat "$at_stdout"
   36113 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36114 $at_failed && at_fn_log_failure
   36115 $at_traceon; }
   36116 
   36117     cp xml-tests/test.output expout
   36118   { set +x
   36119 $as_echo "$at_srcdir/headers.at:219: \$XSLTPROC \\
   36120              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   36121              xml-tests/test.xml"
   36122 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:219"
   36123 ( $at_check_trace; $XSLTPROC \
   36124              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   36125              xml-tests/test.xml
   36126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36127 at_status=$? at_failed=false
   36128 $at_check_filter
   36129 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36130 $at_diff expout "$at_stdout" || at_failed=:
   36131 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36132 $at_failed && at_fn_log_failure
   36133 $at_traceon; }
   36134 
   36135   sort xml-tests/test.dot > expout
   36136   { set +x
   36137 $as_echo "$at_srcdir/headers.at:219: \$XSLTPROC \\
   36138              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   36139              xml-tests/test.xml | sort"
   36140 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:219"
   36141 ( $at_check_trace; $XSLTPROC \
   36142              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   36143              xml-tests/test.xml | sort
   36144 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36145 at_status=$? at_failed=false
   36146 $at_check_filter
   36147 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36148 $at_diff expout "$at_stdout" || at_failed=:
   36149 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36150 $at_failed && at_fn_log_failure
   36151 $at_traceon; }
   36152 
   36153   rm -rf xml-tests expout
   36154   at_restore_special_files
   36155 fi
   36156 { set +x
   36157 $as_echo "$at_srcdir/headers.at:219: bison -d -o x2.c x2.y"
   36158 at_fn_check_prepare_trace "headers.at:219"
   36159 ( $at_check_trace; bison -d -o x2.c x2.y
   36160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36161 at_status=$? at_failed=false
   36162 $at_check_filter
   36163 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36164 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36165 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36166 $at_failed && at_fn_log_failure
   36167 $at_traceon; }
   36168 
   36169 
   36170 
   36171 { set +x
   36172 $as_echo "$at_srcdir/headers.at:219: \$BISON_C_WORKS"
   36173 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:219"
   36174 ( $at_check_trace; $BISON_C_WORKS
   36175 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36176 at_status=$? at_failed=false
   36177 $at_check_filter
   36178 echo stderr:; cat "$at_stderr"
   36179 echo stdout:; cat "$at_stdout"
   36180 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36181 $at_failed && at_fn_log_failure
   36182 $at_traceon; }
   36183 
   36184 { set +x
   36185 $as_echo "$at_srcdir/headers.at:219: \$CC \$CFLAGS \$CPPFLAGS -c -o x2.o x2.c "
   36186 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c " "headers.at:219"
   36187 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c
   36188 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36189 at_status=$? at_failed=false
   36190 $at_check_filter
   36191 echo stderr:; cat "$at_stderr"
   36192 echo stdout:; cat "$at_stdout"
   36193 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36194 $at_failed && at_fn_log_failure
   36195 $at_traceon; }
   36196 
   36197 { set +x
   36198 $as_echo "$at_srcdir/headers.at:219: echo \"x2\" >>expout"
   36199 at_fn_check_prepare_trace "headers.at:219"
   36200 ( $at_check_trace; echo "x2" >>expout
   36201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36202 at_status=$? at_failed=false
   36203 $at_check_filter
   36204 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36206 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:219"
   36207 $at_failed && at_fn_log_failure
   36208 $at_traceon; }
   36209 
   36210 
   36211 
   36212 
   36213 
   36214 cat >x3.y <<'_ATEOF'
   36215 %code top {
   36216 #include <config.h>
   36217 /* We don't need perfect functions for these tests. */
   36218 #undef malloc
   36219 #undef memcmp
   36220 #undef realloc
   36221 }
   36222 
   36223 %define api.prefix "x3_"
   36224 %glr-parser
   36225 %error-verbose
   36226 %union
   36227 {
   36228   int integer;
   36229 }
   36230 %{
   36231 #include <stdio.h>
   36232   static void x3_error ( const char *msg);
   36233   static int x3_lex (void);
   36234 %}
   36235 %%
   36236 exp:
   36237   'x' '1' { printf ("x1\n"); }
   36238 | 'x' '2' { printf ("x2\n"); }
   36239 | 'x' '3' { printf ("x3\n"); }
   36240 | 'x' '4' { printf ("x4\n"); }
   36241 | 'x' '5' { printf ("x5\n"); }
   36242 | 'x' '6' { printf ("x6\n"); }
   36243 | 'x' '7' { printf ("x7\n"); }
   36244 | 'x' '8' { printf ("x8\n"); }
   36245 ;
   36246 
   36247 %%
   36248 #include <stdio.h>
   36249 /* A C error reporting function.  */
   36250 static
   36251 void x3_error ( const char *msg)
   36252 {
   36253   fprintf (stderr, "%s\n", msg);
   36254 }
   36255 #include <assert.h>
   36256 static
   36257 int x3_lex (void)
   36258 {
   36259   static char const input[] = "x3";
   36260   static size_t toknum = 0;
   36261   int res;
   36262   ;
   36263   assert (toknum < sizeof input / sizeof input[0]);
   36264   res = input[toknum++];
   36265   ;
   36266   return res;
   36267 }
   36268 _ATEOF
   36269 
   36270 
   36271 
   36272 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   36273   at_save_special_files
   36274   mkdir xml-tests
   36275     # Don't combine these Bison invocations since we want to be sure that
   36276   # --report=all isn't required to get the full XML file.
   36277   { set +x
   36278 $as_echo "$at_srcdir/headers.at:220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   36279                   --graph=xml-tests/test.dot -d -o x3.c x3.y"
   36280 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:220"
   36281 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   36282                   --graph=xml-tests/test.dot -d -o x3.c x3.y
   36283 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36284 at_status=$? at_failed=false
   36285 $at_check_filter
   36286 echo stderr:; cat "$at_stderr"
   36287 echo stdout:; cat "$at_stdout"
   36288 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36289 $at_failed && at_fn_log_failure
   36290 $at_traceon; }
   36291 
   36292   { set +x
   36293 $as_echo "$at_srcdir/headers.at:220: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x3.c x3.y"
   36294 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x3.c x3.y" "headers.at:220"
   36295 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x3.c x3.y
   36296 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36297 at_status=$? at_failed=false
   36298 $at_check_filter
   36299 echo stderr:; cat "$at_stderr"
   36300 echo stdout:; cat "$at_stdout"
   36301 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36302 $at_failed && at_fn_log_failure
   36303 $at_traceon; }
   36304 
   36305     cp xml-tests/test.output expout
   36306   { set +x
   36307 $as_echo "$at_srcdir/headers.at:220: \$XSLTPROC \\
   36308              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   36309              xml-tests/test.xml"
   36310 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:220"
   36311 ( $at_check_trace; $XSLTPROC \
   36312              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   36313              xml-tests/test.xml
   36314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36315 at_status=$? at_failed=false
   36316 $at_check_filter
   36317 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36318 $at_diff expout "$at_stdout" || at_failed=:
   36319 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36320 $at_failed && at_fn_log_failure
   36321 $at_traceon; }
   36322 
   36323   sort xml-tests/test.dot > expout
   36324   { set +x
   36325 $as_echo "$at_srcdir/headers.at:220: \$XSLTPROC \\
   36326              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   36327              xml-tests/test.xml | sort"
   36328 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:220"
   36329 ( $at_check_trace; $XSLTPROC \
   36330              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   36331              xml-tests/test.xml | sort
   36332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36333 at_status=$? at_failed=false
   36334 $at_check_filter
   36335 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36336 $at_diff expout "$at_stdout" || at_failed=:
   36337 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36338 $at_failed && at_fn_log_failure
   36339 $at_traceon; }
   36340 
   36341   rm -rf xml-tests expout
   36342   at_restore_special_files
   36343 fi
   36344 { set +x
   36345 $as_echo "$at_srcdir/headers.at:220: bison -d -o x3.c x3.y"
   36346 at_fn_check_prepare_trace "headers.at:220"
   36347 ( $at_check_trace; bison -d -o x3.c x3.y
   36348 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36349 at_status=$? at_failed=false
   36350 $at_check_filter
   36351 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36352 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36353 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36354 $at_failed && at_fn_log_failure
   36355 $at_traceon; }
   36356 
   36357 
   36358 
   36359 { set +x
   36360 $as_echo "$at_srcdir/headers.at:220: \$BISON_C_WORKS"
   36361 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:220"
   36362 ( $at_check_trace; $BISON_C_WORKS
   36363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36364 at_status=$? at_failed=false
   36365 $at_check_filter
   36366 echo stderr:; cat "$at_stderr"
   36367 echo stdout:; cat "$at_stdout"
   36368 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36369 $at_failed && at_fn_log_failure
   36370 $at_traceon; }
   36371 
   36372 { set +x
   36373 $as_echo "$at_srcdir/headers.at:220: \$CC \$CFLAGS \$CPPFLAGS -c -o x3.o x3.c "
   36374 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c " "headers.at:220"
   36375 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c
   36376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36377 at_status=$? at_failed=false
   36378 $at_check_filter
   36379 echo stderr:; cat "$at_stderr"
   36380 echo stdout:; cat "$at_stdout"
   36381 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36382 $at_failed && at_fn_log_failure
   36383 $at_traceon; }
   36384 
   36385 { set +x
   36386 $as_echo "$at_srcdir/headers.at:220: echo \"x3\" >>expout"
   36387 at_fn_check_prepare_trace "headers.at:220"
   36388 ( $at_check_trace; echo "x3" >>expout
   36389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36390 at_status=$? at_failed=false
   36391 $at_check_filter
   36392 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36393 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36394 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:220"
   36395 $at_failed && at_fn_log_failure
   36396 $at_traceon; }
   36397 
   36398 
   36399 
   36400 
   36401 
   36402 cat >x4.y <<'_ATEOF'
   36403 %code top {
   36404 #include <config.h>
   36405 /* We don't need perfect functions for these tests. */
   36406 #undef malloc
   36407 #undef memcmp
   36408 #undef realloc
   36409 }
   36410 
   36411 %define api.prefix "x4_"
   36412 %locations %debug %glr-parser
   36413 %error-verbose
   36414 %union
   36415 {
   36416   int integer;
   36417 }
   36418 %{
   36419 #include <stdio.h>
   36420   static void x4_error ( const char *msg);
   36421   static int x4_lex (void);
   36422 %}
   36423 %%
   36424 exp:
   36425   'x' '1' { printf ("x1\n"); }
   36426 | 'x' '2' { printf ("x2\n"); }
   36427 | 'x' '3' { printf ("x3\n"); }
   36428 | 'x' '4' { printf ("x4\n"); }
   36429 | 'x' '5' { printf ("x5\n"); }
   36430 | 'x' '6' { printf ("x6\n"); }
   36431 | 'x' '7' { printf ("x7\n"); }
   36432 | 'x' '8' { printf ("x8\n"); }
   36433 ;
   36434 
   36435 %%
   36436 #include <stdio.h>
   36437 /* A C error reporting function.  */
   36438 static
   36439 void x4_error ( const char *msg)
   36440 {
   36441   YY_LOCATION_PRINT (stderr, (x4_lloc));
   36442   fprintf (stderr, ": ");
   36443   fprintf (stderr, "%s\n", msg);
   36444 }
   36445 #include <assert.h>
   36446 static
   36447 int x4_lex (void)
   36448 {
   36449   static char const input[] = "x4";
   36450   static size_t toknum = 0;
   36451   int res;
   36452   ;
   36453   assert (toknum < sizeof input / sizeof input[0]);
   36454   res = input[toknum++];
   36455   ;
   36456   (x4_lloc).first_line = (x4_lloc).last_line = 1;
   36457   (x4_lloc).first_column = (x4_lloc).last_column = toknum;
   36458   return res;
   36459 }
   36460 _ATEOF
   36461 
   36462 
   36463 
   36464 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   36465   at_save_special_files
   36466   mkdir xml-tests
   36467     # Don't combine these Bison invocations since we want to be sure that
   36468   # --report=all isn't required to get the full XML file.
   36469   { set +x
   36470 $as_echo "$at_srcdir/headers.at:221: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   36471                   --graph=xml-tests/test.dot -d -o x4.c x4.y"
   36472 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:221"
   36473 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   36474                   --graph=xml-tests/test.dot -d -o x4.c x4.y
   36475 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36476 at_status=$? at_failed=false
   36477 $at_check_filter
   36478 echo stderr:; cat "$at_stderr"
   36479 echo stdout:; cat "$at_stdout"
   36480 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36481 $at_failed && at_fn_log_failure
   36482 $at_traceon; }
   36483 
   36484   { set +x
   36485 $as_echo "$at_srcdir/headers.at:221: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x4.c x4.y"
   36486 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x4.c x4.y" "headers.at:221"
   36487 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x4.c x4.y
   36488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36489 at_status=$? at_failed=false
   36490 $at_check_filter
   36491 echo stderr:; cat "$at_stderr"
   36492 echo stdout:; cat "$at_stdout"
   36493 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36494 $at_failed && at_fn_log_failure
   36495 $at_traceon; }
   36496 
   36497     cp xml-tests/test.output expout
   36498   { set +x
   36499 $as_echo "$at_srcdir/headers.at:221: \$XSLTPROC \\
   36500              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   36501              xml-tests/test.xml"
   36502 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:221"
   36503 ( $at_check_trace; $XSLTPROC \
   36504              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   36505              xml-tests/test.xml
   36506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36507 at_status=$? at_failed=false
   36508 $at_check_filter
   36509 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36510 $at_diff expout "$at_stdout" || at_failed=:
   36511 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36512 $at_failed && at_fn_log_failure
   36513 $at_traceon; }
   36514 
   36515   sort xml-tests/test.dot > expout
   36516   { set +x
   36517 $as_echo "$at_srcdir/headers.at:221: \$XSLTPROC \\
   36518              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   36519              xml-tests/test.xml | sort"
   36520 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:221"
   36521 ( $at_check_trace; $XSLTPROC \
   36522              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   36523              xml-tests/test.xml | sort
   36524 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36525 at_status=$? at_failed=false
   36526 $at_check_filter
   36527 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36528 $at_diff expout "$at_stdout" || at_failed=:
   36529 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36530 $at_failed && at_fn_log_failure
   36531 $at_traceon; }
   36532 
   36533   rm -rf xml-tests expout
   36534   at_restore_special_files
   36535 fi
   36536 { set +x
   36537 $as_echo "$at_srcdir/headers.at:221: bison -d -o x4.c x4.y"
   36538 at_fn_check_prepare_trace "headers.at:221"
   36539 ( $at_check_trace; bison -d -o x4.c x4.y
   36540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36541 at_status=$? at_failed=false
   36542 $at_check_filter
   36543 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36544 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36545 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36546 $at_failed && at_fn_log_failure
   36547 $at_traceon; }
   36548 
   36549 
   36550 
   36551 { set +x
   36552 $as_echo "$at_srcdir/headers.at:221: \$BISON_C_WORKS"
   36553 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:221"
   36554 ( $at_check_trace; $BISON_C_WORKS
   36555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36556 at_status=$? at_failed=false
   36557 $at_check_filter
   36558 echo stderr:; cat "$at_stderr"
   36559 echo stdout:; cat "$at_stdout"
   36560 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36561 $at_failed && at_fn_log_failure
   36562 $at_traceon; }
   36563 
   36564 { set +x
   36565 $as_echo "$at_srcdir/headers.at:221: \$CC \$CFLAGS \$CPPFLAGS -c -o x4.o x4.c "
   36566 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c " "headers.at:221"
   36567 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c
   36568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36569 at_status=$? at_failed=false
   36570 $at_check_filter
   36571 echo stderr:; cat "$at_stderr"
   36572 echo stdout:; cat "$at_stdout"
   36573 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36574 $at_failed && at_fn_log_failure
   36575 $at_traceon; }
   36576 
   36577 { set +x
   36578 $as_echo "$at_srcdir/headers.at:221: echo \"x4\" >>expout"
   36579 at_fn_check_prepare_trace "headers.at:221"
   36580 ( $at_check_trace; echo "x4" >>expout
   36581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36582 at_status=$? at_failed=false
   36583 $at_check_filter
   36584 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36585 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36586 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:221"
   36587 $at_failed && at_fn_log_failure
   36588 $at_traceon; }
   36589 
   36590 
   36591 
   36592 
   36593 
   36594 cat >x5.y <<'_ATEOF'
   36595 %code top {
   36596 #include <config.h>
   36597 /* We don't need perfect functions for these tests. */
   36598 #undef malloc
   36599 #undef memcmp
   36600 #undef realloc
   36601 }
   36602 
   36603 %define api.prefix "x5_"
   36604 %locations %debug %language "c++"
   36605 %error-verbose
   36606 %union
   36607 {
   36608   int integer;
   36609 }
   36610 %{
   36611 #include <stdio.h>
   36612 
   36613   static int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp);
   36614 %}
   36615 %%
   36616 exp:
   36617   'x' '1' { printf ("x1\n"); }
   36618 | 'x' '2' { printf ("x2\n"); }
   36619 | 'x' '3' { printf ("x3\n"); }
   36620 | 'x' '4' { printf ("x4\n"); }
   36621 | 'x' '5' { printf ("x5\n"); }
   36622 | 'x' '6' { printf ("x6\n"); }
   36623 | 'x' '7' { printf ("x7\n"); }
   36624 | 'x' '8' { printf ("x8\n"); }
   36625 ;
   36626 
   36627 %%
   36628 /* A C++ error reporting function.  */
   36629 void
   36630 x5_::parser::error (const location_type& l, const std::string& m)
   36631 {
   36632   (void) l;
   36633   std::cerr << l << ": " << m << std::endl;
   36634 }
   36635 #include <assert.h>
   36636 static
   36637 int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp)
   36638 {
   36639   static char const input[] = "x5";
   36640   static size_t toknum = 0;
   36641   int res;
   36642   (void) lvalp;(void) llocp;
   36643   assert (toknum < sizeof input / sizeof input[0]);
   36644   res = input[toknum++];
   36645   ;
   36646   (*llocp).begin.line = (*llocp).end.line = 1;
   36647   (*llocp).begin.column = (*llocp).end.column = toknum;
   36648   return res;
   36649 }
   36650 _ATEOF
   36651 
   36652 
   36653 
   36654 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   36655   at_save_special_files
   36656   mkdir xml-tests
   36657     # Don't combine these Bison invocations since we want to be sure that
   36658   # --report=all isn't required to get the full XML file.
   36659   { set +x
   36660 $as_echo "$at_srcdir/headers.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   36661                   --graph=xml-tests/test.dot -d -o x5.cc x5.y"
   36662 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:222"
   36663 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   36664                   --graph=xml-tests/test.dot -d -o x5.cc x5.y
   36665 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36666 at_status=$? at_failed=false
   36667 $at_check_filter
   36668 echo stderr:; cat "$at_stderr"
   36669 echo stdout:; cat "$at_stdout"
   36670 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36671 $at_failed && at_fn_log_failure
   36672 $at_traceon; }
   36673 
   36674   { set +x
   36675 $as_echo "$at_srcdir/headers.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x5.cc x5.y"
   36676 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x5.cc x5.y" "headers.at:222"
   36677 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x5.cc x5.y
   36678 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36679 at_status=$? at_failed=false
   36680 $at_check_filter
   36681 echo stderr:; cat "$at_stderr"
   36682 echo stdout:; cat "$at_stdout"
   36683 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36684 $at_failed && at_fn_log_failure
   36685 $at_traceon; }
   36686 
   36687     cp xml-tests/test.output expout
   36688   { set +x
   36689 $as_echo "$at_srcdir/headers.at:222: \$XSLTPROC \\
   36690              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   36691              xml-tests/test.xml"
   36692 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:222"
   36693 ( $at_check_trace; $XSLTPROC \
   36694              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   36695              xml-tests/test.xml
   36696 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36697 at_status=$? at_failed=false
   36698 $at_check_filter
   36699 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36700 $at_diff expout "$at_stdout" || at_failed=:
   36701 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36702 $at_failed && at_fn_log_failure
   36703 $at_traceon; }
   36704 
   36705   sort xml-tests/test.dot > expout
   36706   { set +x
   36707 $as_echo "$at_srcdir/headers.at:222: \$XSLTPROC \\
   36708              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   36709              xml-tests/test.xml | sort"
   36710 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:222"
   36711 ( $at_check_trace; $XSLTPROC \
   36712              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   36713              xml-tests/test.xml | sort
   36714 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36715 at_status=$? at_failed=false
   36716 $at_check_filter
   36717 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36718 $at_diff expout "$at_stdout" || at_failed=:
   36719 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36720 $at_failed && at_fn_log_failure
   36721 $at_traceon; }
   36722 
   36723   rm -rf xml-tests expout
   36724   at_restore_special_files
   36725 fi
   36726 { set +x
   36727 $as_echo "$at_srcdir/headers.at:222: bison -d -o x5.cc x5.y"
   36728 at_fn_check_prepare_trace "headers.at:222"
   36729 ( $at_check_trace; bison -d -o x5.cc x5.y
   36730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36731 at_status=$? at_failed=false
   36732 $at_check_filter
   36733 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36735 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36736 $at_failed && at_fn_log_failure
   36737 $at_traceon; }
   36738 
   36739 
   36740 
   36741 
   36742 { set +x
   36743 $as_echo "$at_srcdir/headers.at:222: \$BISON_CXX_WORKS"
   36744 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:222"
   36745 ( $at_check_trace; $BISON_CXX_WORKS
   36746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36747 at_status=$? at_failed=false
   36748 $at_check_filter
   36749 echo stderr:; cat "$at_stderr"
   36750 echo stdout:; cat "$at_stdout"
   36751 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36752 $at_failed && at_fn_log_failure
   36753 $at_traceon; }
   36754 
   36755 { set +x
   36756 $as_echo "$at_srcdir/headers.at:222: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o x5.o x5.cc "
   36757 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc " "headers.at:222"
   36758 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc
   36759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36760 at_status=$? at_failed=false
   36761 $at_check_filter
   36762 echo stderr:; cat "$at_stderr"
   36763 echo stdout:; cat "$at_stdout"
   36764 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36765 $at_failed && at_fn_log_failure
   36766 $at_traceon; }
   36767 
   36768 { set +x
   36769 $as_echo "$at_srcdir/headers.at:222: echo \"x5\" >>expout"
   36770 at_fn_check_prepare_trace "headers.at:222"
   36771 ( $at_check_trace; echo "x5" >>expout
   36772 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36773 at_status=$? at_failed=false
   36774 $at_check_filter
   36775 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36776 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36777 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:222"
   36778 $at_failed && at_fn_log_failure
   36779 $at_traceon; }
   36780 
   36781 
   36782 
   36783 
   36784 
   36785 cat >x6.y <<'_ATEOF'
   36786 %code top {
   36787 #include <config.h>
   36788 /* We don't need perfect functions for these tests. */
   36789 #undef malloc
   36790 #undef memcmp
   36791 #undef realloc
   36792 }
   36793 
   36794 %define api.prefix "x6_"
   36795 %define api.pure
   36796 %error-verbose
   36797 %union
   36798 {
   36799   int integer;
   36800 }
   36801 %{
   36802 #include <stdio.h>
   36803   static void x6_error ( const char *msg);
   36804   static int x6_lex (X6_STYPE *lvalp);
   36805 %}
   36806 %%
   36807 exp:
   36808   'x' '1' { printf ("x1\n"); }
   36809 | 'x' '2' { printf ("x2\n"); }
   36810 | 'x' '3' { printf ("x3\n"); }
   36811 | 'x' '4' { printf ("x4\n"); }
   36812 | 'x' '5' { printf ("x5\n"); }
   36813 | 'x' '6' { printf ("x6\n"); }
   36814 | 'x' '7' { printf ("x7\n"); }
   36815 | 'x' '8' { printf ("x8\n"); }
   36816 ;
   36817 
   36818 %%
   36819 #include <stdio.h>
   36820 /* A C error reporting function.  */
   36821 static
   36822 void x6_error ( const char *msg)
   36823 {
   36824   fprintf (stderr, "%s\n", msg);
   36825 }
   36826 #include <assert.h>
   36827 static
   36828 int x6_lex (X6_STYPE *lvalp)
   36829 {
   36830   static char const input[] = "x6";
   36831   static size_t toknum = 0;
   36832   int res;
   36833   (void) lvalp;;
   36834   assert (toknum < sizeof input / sizeof input[0]);
   36835   res = input[toknum++];
   36836   ;
   36837   return res;
   36838 }
   36839 _ATEOF
   36840 
   36841 
   36842 
   36843 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   36844   at_save_special_files
   36845   mkdir xml-tests
   36846     # Don't combine these Bison invocations since we want to be sure that
   36847   # --report=all isn't required to get the full XML file.
   36848   { set +x
   36849 $as_echo "$at_srcdir/headers.at:223: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   36850                   --graph=xml-tests/test.dot -d -o x6.c x6.y"
   36851 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:223"
   36852 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   36853                   --graph=xml-tests/test.dot -d -o x6.c x6.y
   36854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36855 at_status=$? at_failed=false
   36856 $at_check_filter
   36857 echo stderr:; cat "$at_stderr"
   36858 echo stdout:; cat "$at_stdout"
   36859 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36860 $at_failed && at_fn_log_failure
   36861 $at_traceon; }
   36862 
   36863   { set +x
   36864 $as_echo "$at_srcdir/headers.at:223: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x6.c x6.y"
   36865 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x6.c x6.y" "headers.at:223"
   36866 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x6.c x6.y
   36867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36868 at_status=$? at_failed=false
   36869 $at_check_filter
   36870 echo stderr:; cat "$at_stderr"
   36871 echo stdout:; cat "$at_stdout"
   36872 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36873 $at_failed && at_fn_log_failure
   36874 $at_traceon; }
   36875 
   36876     cp xml-tests/test.output expout
   36877   { set +x
   36878 $as_echo "$at_srcdir/headers.at:223: \$XSLTPROC \\
   36879              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   36880              xml-tests/test.xml"
   36881 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:223"
   36882 ( $at_check_trace; $XSLTPROC \
   36883              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   36884              xml-tests/test.xml
   36885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36886 at_status=$? at_failed=false
   36887 $at_check_filter
   36888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36889 $at_diff expout "$at_stdout" || at_failed=:
   36890 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36891 $at_failed && at_fn_log_failure
   36892 $at_traceon; }
   36893 
   36894   sort xml-tests/test.dot > expout
   36895   { set +x
   36896 $as_echo "$at_srcdir/headers.at:223: \$XSLTPROC \\
   36897              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   36898              xml-tests/test.xml | sort"
   36899 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:223"
   36900 ( $at_check_trace; $XSLTPROC \
   36901              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   36902              xml-tests/test.xml | sort
   36903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36904 at_status=$? at_failed=false
   36905 $at_check_filter
   36906 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36907 $at_diff expout "$at_stdout" || at_failed=:
   36908 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36909 $at_failed && at_fn_log_failure
   36910 $at_traceon; }
   36911 
   36912   rm -rf xml-tests expout
   36913   at_restore_special_files
   36914 fi
   36915 { set +x
   36916 $as_echo "$at_srcdir/headers.at:223: bison -d -o x6.c x6.y"
   36917 at_fn_check_prepare_trace "headers.at:223"
   36918 ( $at_check_trace; bison -d -o x6.c x6.y
   36919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36920 at_status=$? at_failed=false
   36921 $at_check_filter
   36922 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36923 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36924 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36925 $at_failed && at_fn_log_failure
   36926 $at_traceon; }
   36927 
   36928 
   36929 
   36930 { set +x
   36931 $as_echo "$at_srcdir/headers.at:223: \$BISON_C_WORKS"
   36932 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:223"
   36933 ( $at_check_trace; $BISON_C_WORKS
   36934 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36935 at_status=$? at_failed=false
   36936 $at_check_filter
   36937 echo stderr:; cat "$at_stderr"
   36938 echo stdout:; cat "$at_stdout"
   36939 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36940 $at_failed && at_fn_log_failure
   36941 $at_traceon; }
   36942 
   36943 { set +x
   36944 $as_echo "$at_srcdir/headers.at:223: \$CC \$CFLAGS \$CPPFLAGS -c -o x6.o x6.c "
   36945 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c " "headers.at:223"
   36946 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c
   36947 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36948 at_status=$? at_failed=false
   36949 $at_check_filter
   36950 echo stderr:; cat "$at_stderr"
   36951 echo stdout:; cat "$at_stdout"
   36952 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36953 $at_failed && at_fn_log_failure
   36954 $at_traceon; }
   36955 
   36956 { set +x
   36957 $as_echo "$at_srcdir/headers.at:223: echo \"x6\" >>expout"
   36958 at_fn_check_prepare_trace "headers.at:223"
   36959 ( $at_check_trace; echo "x6" >>expout
   36960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   36961 at_status=$? at_failed=false
   36962 $at_check_filter
   36963 at_fn_diff_devnull "$at_stderr" || at_failed=:
   36964 at_fn_diff_devnull "$at_stdout" || at_failed=:
   36965 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:223"
   36966 $at_failed && at_fn_log_failure
   36967 $at_traceon; }
   36968 
   36969 
   36970 
   36971 
   36972 
   36973 cat >x7.y <<'_ATEOF'
   36974 %code top {
   36975 #include <config.h>
   36976 /* We don't need perfect functions for these tests. */
   36977 #undef malloc
   36978 #undef memcmp
   36979 #undef realloc
   36980 }
   36981 
   36982 %define api.prefix "x7_"
   36983 %define api.push-pull both
   36984 %error-verbose
   36985 %union
   36986 {
   36987   int integer;
   36988 }
   36989 %{
   36990 #include <stdio.h>
   36991   static void x7_error ( const char *msg);
   36992   static int x7_lex (void);
   36993 %}
   36994 %%
   36995 exp:
   36996   'x' '1' { printf ("x1\n"); }
   36997 | 'x' '2' { printf ("x2\n"); }
   36998 | 'x' '3' { printf ("x3\n"); }
   36999 | 'x' '4' { printf ("x4\n"); }
   37000 | 'x' '5' { printf ("x5\n"); }
   37001 | 'x' '6' { printf ("x6\n"); }
   37002 | 'x' '7' { printf ("x7\n"); }
   37003 | 'x' '8' { printf ("x8\n"); }
   37004 ;
   37005 
   37006 %%
   37007 #include <stdio.h>
   37008 /* A C error reporting function.  */
   37009 static
   37010 void x7_error ( const char *msg)
   37011 {
   37012   fprintf (stderr, "%s\n", msg);
   37013 }
   37014 #include <assert.h>
   37015 static
   37016 int x7_lex (void)
   37017 {
   37018   static char const input[] = "x7";
   37019   static size_t toknum = 0;
   37020   int res;
   37021   ;
   37022   assert (toknum < sizeof input / sizeof input[0]);
   37023   res = input[toknum++];
   37024   ;
   37025   return res;
   37026 }
   37027 _ATEOF
   37028 
   37029 
   37030 
   37031 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   37032   at_save_special_files
   37033   mkdir xml-tests
   37034     # Don't combine these Bison invocations since we want to be sure that
   37035   # --report=all isn't required to get the full XML file.
   37036   { set +x
   37037 $as_echo "$at_srcdir/headers.at:224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   37038                   --graph=xml-tests/test.dot -d -o x7.c x7.y"
   37039 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:224"
   37040 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   37041                   --graph=xml-tests/test.dot -d -o x7.c x7.y
   37042 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37043 at_status=$? at_failed=false
   37044 $at_check_filter
   37045 echo stderr:; cat "$at_stderr"
   37046 echo stdout:; cat "$at_stdout"
   37047 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37048 $at_failed && at_fn_log_failure
   37049 $at_traceon; }
   37050 
   37051   { set +x
   37052 $as_echo "$at_srcdir/headers.at:224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x7.c x7.y"
   37053 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x7.c x7.y" "headers.at:224"
   37054 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x7.c x7.y
   37055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37056 at_status=$? at_failed=false
   37057 $at_check_filter
   37058 echo stderr:; cat "$at_stderr"
   37059 echo stdout:; cat "$at_stdout"
   37060 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37061 $at_failed && at_fn_log_failure
   37062 $at_traceon; }
   37063 
   37064     cp xml-tests/test.output expout
   37065   { set +x
   37066 $as_echo "$at_srcdir/headers.at:224: \$XSLTPROC \\
   37067              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   37068              xml-tests/test.xml"
   37069 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:224"
   37070 ( $at_check_trace; $XSLTPROC \
   37071              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   37072              xml-tests/test.xml
   37073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37074 at_status=$? at_failed=false
   37075 $at_check_filter
   37076 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37077 $at_diff expout "$at_stdout" || at_failed=:
   37078 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37079 $at_failed && at_fn_log_failure
   37080 $at_traceon; }
   37081 
   37082   sort xml-tests/test.dot > expout
   37083   { set +x
   37084 $as_echo "$at_srcdir/headers.at:224: \$XSLTPROC \\
   37085              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   37086              xml-tests/test.xml | sort"
   37087 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:224"
   37088 ( $at_check_trace; $XSLTPROC \
   37089              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   37090              xml-tests/test.xml | sort
   37091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37092 at_status=$? at_failed=false
   37093 $at_check_filter
   37094 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37095 $at_diff expout "$at_stdout" || at_failed=:
   37096 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37097 $at_failed && at_fn_log_failure
   37098 $at_traceon; }
   37099 
   37100   rm -rf xml-tests expout
   37101   at_restore_special_files
   37102 fi
   37103 { set +x
   37104 $as_echo "$at_srcdir/headers.at:224: bison -d -o x7.c x7.y"
   37105 at_fn_check_prepare_trace "headers.at:224"
   37106 ( $at_check_trace; bison -d -o x7.c x7.y
   37107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37108 at_status=$? at_failed=false
   37109 $at_check_filter
   37110 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37111 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37112 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37113 $at_failed && at_fn_log_failure
   37114 $at_traceon; }
   37115 
   37116 
   37117 
   37118 { set +x
   37119 $as_echo "$at_srcdir/headers.at:224: \$BISON_C_WORKS"
   37120 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:224"
   37121 ( $at_check_trace; $BISON_C_WORKS
   37122 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37123 at_status=$? at_failed=false
   37124 $at_check_filter
   37125 echo stderr:; cat "$at_stderr"
   37126 echo stdout:; cat "$at_stdout"
   37127 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37128 $at_failed && at_fn_log_failure
   37129 $at_traceon; }
   37130 
   37131 { set +x
   37132 $as_echo "$at_srcdir/headers.at:224: \$CC \$CFLAGS \$CPPFLAGS -c -o x7.o x7.c "
   37133 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c " "headers.at:224"
   37134 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c
   37135 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37136 at_status=$? at_failed=false
   37137 $at_check_filter
   37138 echo stderr:; cat "$at_stderr"
   37139 echo stdout:; cat "$at_stdout"
   37140 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37141 $at_failed && at_fn_log_failure
   37142 $at_traceon; }
   37143 
   37144 { set +x
   37145 $as_echo "$at_srcdir/headers.at:224: echo \"x7\" >>expout"
   37146 at_fn_check_prepare_trace "headers.at:224"
   37147 ( $at_check_trace; echo "x7" >>expout
   37148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37149 at_status=$? at_failed=false
   37150 $at_check_filter
   37151 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37152 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37153 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:224"
   37154 $at_failed && at_fn_log_failure
   37155 $at_traceon; }
   37156 
   37157 
   37158 
   37159 
   37160 
   37161 cat >x8.y <<'_ATEOF'
   37162 %code top {
   37163 #include <config.h>
   37164 /* We don't need perfect functions for these tests. */
   37165 #undef malloc
   37166 #undef memcmp
   37167 #undef realloc
   37168 }
   37169 
   37170 %define api.prefix "x8_"
   37171 %define api.pure %define api.push-pull both
   37172 %error-verbose
   37173 %union
   37174 {
   37175   int integer;
   37176 }
   37177 %{
   37178 #include <stdio.h>
   37179   static void x8_error ( const char *msg);
   37180   static int x8_lex (X8_STYPE *lvalp);
   37181 %}
   37182 %%
   37183 exp:
   37184   'x' '1' { printf ("x1\n"); }
   37185 | 'x' '2' { printf ("x2\n"); }
   37186 | 'x' '3' { printf ("x3\n"); }
   37187 | 'x' '4' { printf ("x4\n"); }
   37188 | 'x' '5' { printf ("x5\n"); }
   37189 | 'x' '6' { printf ("x6\n"); }
   37190 | 'x' '7' { printf ("x7\n"); }
   37191 | 'x' '8' { printf ("x8\n"); }
   37192 ;
   37193 
   37194 %%
   37195 #include <stdio.h>
   37196 /* A C error reporting function.  */
   37197 static
   37198 void x8_error ( const char *msg)
   37199 {
   37200   fprintf (stderr, "%s\n", msg);
   37201 }
   37202 #include <assert.h>
   37203 static
   37204 int x8_lex (X8_STYPE *lvalp)
   37205 {
   37206   static char const input[] = "x8";
   37207   static size_t toknum = 0;
   37208   int res;
   37209   (void) lvalp;;
   37210   assert (toknum < sizeof input / sizeof input[0]);
   37211   res = input[toknum++];
   37212   ;
   37213   return res;
   37214 }
   37215 _ATEOF
   37216 
   37217 
   37218 
   37219 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   37220   at_save_special_files
   37221   mkdir xml-tests
   37222     # Don't combine these Bison invocations since we want to be sure that
   37223   # --report=all isn't required to get the full XML file.
   37224   { set +x
   37225 $as_echo "$at_srcdir/headers.at:225: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   37226                   --graph=xml-tests/test.dot -d -o x8.c x8.y"
   37227 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:225"
   37228 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   37229                   --graph=xml-tests/test.dot -d -o x8.c x8.y
   37230 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37231 at_status=$? at_failed=false
   37232 $at_check_filter
   37233 echo stderr:; cat "$at_stderr"
   37234 echo stdout:; cat "$at_stdout"
   37235 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37236 $at_failed && at_fn_log_failure
   37237 $at_traceon; }
   37238 
   37239   { set +x
   37240 $as_echo "$at_srcdir/headers.at:225: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x8.c x8.y"
   37241 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x8.c x8.y" "headers.at:225"
   37242 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -o x8.c x8.y
   37243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37244 at_status=$? at_failed=false
   37245 $at_check_filter
   37246 echo stderr:; cat "$at_stderr"
   37247 echo stdout:; cat "$at_stdout"
   37248 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37249 $at_failed && at_fn_log_failure
   37250 $at_traceon; }
   37251 
   37252     cp xml-tests/test.output expout
   37253   { set +x
   37254 $as_echo "$at_srcdir/headers.at:225: \$XSLTPROC \\
   37255              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   37256              xml-tests/test.xml"
   37257 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:225"
   37258 ( $at_check_trace; $XSLTPROC \
   37259              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   37260              xml-tests/test.xml
   37261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37262 at_status=$? at_failed=false
   37263 $at_check_filter
   37264 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37265 $at_diff expout "$at_stdout" || at_failed=:
   37266 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37267 $at_failed && at_fn_log_failure
   37268 $at_traceon; }
   37269 
   37270   sort xml-tests/test.dot > expout
   37271   { set +x
   37272 $as_echo "$at_srcdir/headers.at:225: \$XSLTPROC \\
   37273              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   37274              xml-tests/test.xml | sort"
   37275 at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:225"
   37276 ( $at_check_trace; $XSLTPROC \
   37277              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   37278              xml-tests/test.xml | sort
   37279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37280 at_status=$? at_failed=false
   37281 $at_check_filter
   37282 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37283 $at_diff expout "$at_stdout" || at_failed=:
   37284 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37285 $at_failed && at_fn_log_failure
   37286 $at_traceon; }
   37287 
   37288   rm -rf xml-tests expout
   37289   at_restore_special_files
   37290 fi
   37291 { set +x
   37292 $as_echo "$at_srcdir/headers.at:225: bison -d -o x8.c x8.y"
   37293 at_fn_check_prepare_trace "headers.at:225"
   37294 ( $at_check_trace; bison -d -o x8.c x8.y
   37295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37296 at_status=$? at_failed=false
   37297 $at_check_filter
   37298 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37299 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37300 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37301 $at_failed && at_fn_log_failure
   37302 $at_traceon; }
   37303 
   37304 
   37305 
   37306 { set +x
   37307 $as_echo "$at_srcdir/headers.at:225: \$BISON_C_WORKS"
   37308 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:225"
   37309 ( $at_check_trace; $BISON_C_WORKS
   37310 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37311 at_status=$? at_failed=false
   37312 $at_check_filter
   37313 echo stderr:; cat "$at_stderr"
   37314 echo stdout:; cat "$at_stdout"
   37315 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37316 $at_failed && at_fn_log_failure
   37317 $at_traceon; }
   37318 
   37319 { set +x
   37320 $as_echo "$at_srcdir/headers.at:225: \$CC \$CFLAGS \$CPPFLAGS -c -o x8.o x8.c "
   37321 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c " "headers.at:225"
   37322 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c
   37323 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37324 at_status=$? at_failed=false
   37325 $at_check_filter
   37326 echo stderr:; cat "$at_stderr"
   37327 echo stdout:; cat "$at_stdout"
   37328 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37329 $at_failed && at_fn_log_failure
   37330 $at_traceon; }
   37331 
   37332 { set +x
   37333 $as_echo "$at_srcdir/headers.at:225: echo \"x8\" >>expout"
   37334 at_fn_check_prepare_trace "headers.at:225"
   37335 ( $at_check_trace; echo "x8" >>expout
   37336 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37337 at_status=$? at_failed=false
   37338 $at_check_filter
   37339 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37340 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37341 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:225"
   37342 $at_failed && at_fn_log_failure
   37343 $at_traceon; }
   37344 
   37345 
   37346 
   37347 
   37348 #AT_TEST([x5], [%locations %language "c++" %glr-parser])
   37349 
   37350 # Check there is no 'yy' left.
   37351 # C++ output relies on namespaces and still uses yy a lot.
   37352 #
   37353 # Check there is no 'YY' left.
   37354 # Ignore comments, YYChar (template parameter), YYPARSE_PARAM
   37355 # (obsolete), YYPUSH_MORE(_DEFINED)?  (constant definition),
   37356 # YY_\w+_INCLUDED (header guards).
   37357 #
   37358 # YYDEBUG (not renamed) can be read, but not changed.
   37359 { set +x
   37360 $as_echo "$at_srcdir/headers.at:237: \$PERL -n -0777 -e '
   37361   s{/\\*.*?\\*/}{}gs;
   37362   s{//.*}{}g;
   37363   s{\\b(YYChar
   37364       |YYPARSE_PARAM
   37365       |YYPUSH_MORE(_DEFINED)?
   37366       |YY_\\w+_INCLUDED
   37367       |YY_NULL
   37368       |(defined|if)\\ YYDEBUG
   37369       )\\b}{}gx;
   37370   while (/^(.*YY.*)\$/gm)
   37371   {
   37372     print \"\$ARGV: invalid exported YY: \$1\\n\";
   37373   }
   37374   if (\$ARGV =~ /\\.h\$/)
   37375   {
   37376     while (/^(.*yy.*)\$/gm)
   37377     {
   37378       print \"\$ARGV: invalid exported yy: \$1\\n\";
   37379     }
   37380   }
   37381 ' -- *.hh *.h"
   37382 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:237"
   37383 ( $at_check_trace; $PERL -n -0777 -e '
   37384   s{/\*.*?\*/}{}gs;
   37385   s{//.*}{}g;
   37386   s{\b(YYChar
   37387       |YYPARSE_PARAM
   37388       |YYPUSH_MORE(_DEFINED)?
   37389       |YY_\w+_INCLUDED
   37390       |YY_NULL
   37391       |(defined|if)\ YYDEBUG
   37392       )\b}{}gx;
   37393   while (/^(.*YY.*)$/gm)
   37394   {
   37395     print "$ARGV: invalid exported YY: $1\n";
   37396   }
   37397   if ($ARGV =~ /\.h$/)
   37398   {
   37399     while (/^(.*yy.*)$/gm)
   37400     {
   37401       print "$ARGV: invalid exported yy: $1\n";
   37402     }
   37403   }
   37404 ' -- *.hh *.h
   37405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37406 at_status=$? at_failed=false
   37407 $at_check_filter
   37408 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37409 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37410 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:237"
   37411 $at_failed && at_fn_log_failure
   37412 $at_traceon; }
   37413 
   37414 
   37415 # Check that the headers are self-contained, and protected against
   37416 # multiple inclusions.  While at it, check they are sane for C++.
   37417 for h in *.h *.hh
   37418 do
   37419   # No shell expansion with AT_DATA.
   37420   cat >$h.cc <<EOF
   37421 #include <config.h>
   37422 /* We don't need perfect functions for these tests. */
   37423 #undef malloc
   37424 #undef memcmp
   37425 #undef realloc
   37426 
   37427 #include "$h"
   37428 #include "$h"
   37429 EOF
   37430 
   37431 { set +x
   37432 $as_echo "$at_srcdir/headers.at:270: \$BISON_CXX_WORKS"
   37433 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:270"
   37434 ( $at_check_trace; $BISON_CXX_WORKS
   37435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37436 at_status=$? at_failed=false
   37437 $at_check_filter
   37438 echo stderr:; cat "$at_stderr"
   37439 echo stdout:; cat "$at_stdout"
   37440 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:270"
   37441 $at_failed && at_fn_log_failure
   37442 $at_traceon; }
   37443 
   37444 { set +x
   37445 $as_echo "$at_srcdir/headers.at:270: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o \$h.o \$h.cc "
   37446 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc " "headers.at:270"
   37447 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc
   37448 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37449 at_status=$? at_failed=false
   37450 $at_check_filter
   37451 echo stderr:; cat "$at_stderr"
   37452 echo stdout:; cat "$at_stdout"
   37453 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:270"
   37454 $at_failed && at_fn_log_failure
   37455 $at_traceon; }
   37456 
   37457 done
   37458 
   37459 # Do this late, so that other checks have been performed.
   37460 cat >c-and-cxx.h <<'_ATEOF'
   37461 #ifdef __cplusplus
   37462 extern "C"
   37463 {
   37464 #endif
   37465   int fortytwo (void);
   37466 #ifdef __cplusplus
   37467 }
   37468 #endif
   37469 _ATEOF
   37470 
   37471 cat >c-only.c <<'_ATEOF'
   37472 #include "c-and-cxx.h"
   37473 int
   37474 main (void)
   37475 {
   37476   return fortytwo () == 42 ? 0 : 1;
   37477 }
   37478 _ATEOF
   37479 
   37480 cat >cxx-only.cc <<'_ATEOF'
   37481 #include "c-and-cxx.h"
   37482 int fortytwo ()
   37483 {
   37484   return 42;
   37485 }
   37486 _ATEOF
   37487 
   37488 { set +x
   37489 $as_echo "$at_srcdir/headers.at:274: \$BISON_C_WORKS"
   37490 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:274"
   37491 ( $at_check_trace; $BISON_C_WORKS
   37492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37493 at_status=$? at_failed=false
   37494 $at_check_filter
   37495 echo stderr:; cat "$at_stderr"
   37496 echo stdout:; cat "$at_stdout"
   37497 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274"
   37498 $at_failed && at_fn_log_failure
   37499 $at_traceon; }
   37500 
   37501 { set +x
   37502 $as_echo "$at_srcdir/headers.at:274: \$CC \$CFLAGS \$CPPFLAGS -c -o c-only.o c-only.c "
   37503 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c " "headers.at:274"
   37504 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c
   37505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37506 at_status=$? at_failed=false
   37507 $at_check_filter
   37508 echo stderr:; cat "$at_stderr"
   37509 echo stdout:; cat "$at_stdout"
   37510 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274"
   37511 $at_failed && at_fn_log_failure
   37512 $at_traceon; }
   37513 
   37514 
   37515 { set +x
   37516 $as_echo "$at_srcdir/headers.at:274: \$BISON_CXX_WORKS"
   37517 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:274"
   37518 ( $at_check_trace; $BISON_CXX_WORKS
   37519 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37520 at_status=$? at_failed=false
   37521 $at_check_filter
   37522 echo stderr:; cat "$at_stderr"
   37523 echo stdout:; cat "$at_stdout"
   37524 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274"
   37525 $at_failed && at_fn_log_failure
   37526 $at_traceon; }
   37527 
   37528 { set +x
   37529 $as_echo "$at_srcdir/headers.at:274: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx-only.o cxx-only.cc "
   37530 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc " "headers.at:274"
   37531 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc
   37532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37533 at_status=$? at_failed=false
   37534 $at_check_filter
   37535 echo stderr:; cat "$at_stderr"
   37536 echo stdout:; cat "$at_stdout"
   37537 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274"
   37538 $at_failed && at_fn_log_failure
   37539 $at_traceon; }
   37540 
   37541 { set +x
   37542 $as_echo "$at_srcdir/headers.at:274: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS c-only.o cxx-only.o -o c-and-cxx ||
   37543           exit 77"
   37544 at_fn_check_prepare_notrace 'an embedded newline' "headers.at:274"
   37545 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS c-only.o cxx-only.o -o c-and-cxx ||
   37546           exit 77
   37547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37548 at_status=$? at_failed=false
   37549 $at_check_filter
   37550 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37551 echo stdout:; cat "$at_stdout"
   37552 at_fn_check_skip $at_status "$at_srcdir/headers.at:274"
   37553 $at_failed && at_fn_log_failure
   37554 $at_traceon; }
   37555 
   37556 { set +x
   37557 $as_echo "$at_srcdir/headers.at:274:  \$PREPARSER ./c-and-cxx"
   37558 at_fn_check_prepare_dynamic " $PREPARSER ./c-and-cxx" "headers.at:274"
   37559 ( $at_check_trace;  $PREPARSER ./c-and-cxx
   37560 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37561 at_status=$? at_failed=false
   37562 $at_check_filter
   37563 echo stderr:; tee stderr <"$at_stderr"
   37564 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37565 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274"
   37566 $at_failed && at_fn_log_failure
   37567 $at_traceon; }
   37568 
   37569 { set +x
   37570 $as_echo "$at_srcdir/headers.at:274: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   37571 at_fn_check_prepare_trace "headers.at:274"
   37572 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   37573 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37574 at_status=$? at_failed=false
   37575 $at_check_filter
   37576 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37577 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37578 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:274"
   37579 $at_failed && at_fn_log_failure
   37580 $at_traceon; }
   37581 
   37582 
   37583 
   37584 
   37585 
   37586 { set +x
   37587 $as_echo "$at_srcdir/headers.at:276: \$BISON_CXX_WORKS"
   37588 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:276"
   37589 ( $at_check_trace; $BISON_CXX_WORKS
   37590 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37591 at_status=$? at_failed=false
   37592 $at_check_filter
   37593 echo stderr:; cat "$at_stderr"
   37594 echo stdout:; cat "$at_stdout"
   37595 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:276"
   37596 $at_failed && at_fn_log_failure
   37597 $at_traceon; }
   37598 
   37599 { set +x
   37600 $as_echo "$at_srcdir/headers.at:276: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=\$CC_IS_CXX main.cc \$LIBS"
   37601 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:276"
   37602 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS
   37603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37604 at_status=$? at_failed=false
   37605 $at_check_filter
   37606 echo stderr:; cat "$at_stderr"
   37607 echo stdout:; cat "$at_stdout"
   37608 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:276"
   37609 $at_failed && at_fn_log_failure
   37610 $at_traceon; }
   37611 
   37612 { set +x
   37613 $as_echo "$at_srcdir/headers.at:277:  \$PREPARSER ./parser"
   37614 at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:277"
   37615 ( $at_check_trace;  $PREPARSER ./parser
   37616 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37617 at_status=$? at_failed=false
   37618 $at_check_filter
   37619 echo stderr:; tee stderr <"$at_stderr"
   37620 $at_diff expout "$at_stdout" || at_failed=:
   37621 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:277"
   37622 $at_failed && at_fn_log_failure
   37623 $at_traceon; }
   37624 
   37625 { set +x
   37626 $as_echo "$at_srcdir/headers.at:277: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   37627 at_fn_check_prepare_trace "headers.at:277"
   37628 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   37629 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37630 at_status=$? at_failed=false
   37631 $at_check_filter
   37632 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37633 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37634 at_fn_check_status 0 $at_status "$at_srcdir/headers.at:277"
   37635 $at_failed && at_fn_log_failure
   37636 $at_traceon; }
   37637 
   37638 
   37639 
   37640 
   37641 
   37642   set +x
   37643   $at_times_p && times >"$at_times_file"
   37644 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   37645 read at_status <"$at_status_file"
   37646 #AT_STOP_143
   37647 #AT_START_144
   37648 at_fn_group_banner 144 'actions.at:24' \
   37649   "Mid-rule actions" "                               " 9
   37650 at_xfail=no
   37651 (
   37652   $as_echo "144. $at_setup_line: testing $at_desc ..."
   37653   $at_traceon
   37654 
   37655 
   37656 # Bison once forgot the mid-rule actions.  It was because the action
   37657 # was attached to the host rule (the one with the mid-rule action),
   37658 # instead of being attached to the empty rule dedicated to this
   37659 # action.
   37660 
   37661 
   37662 cat >input.y <<'_ATEOF'
   37663 %code top {
   37664 #include <config.h>
   37665 /* We don't need perfect functions for these tests. */
   37666 #undef malloc
   37667 #undef memcmp
   37668 #undef realloc
   37669 }
   37670 
   37671 %error-verbose
   37672 %debug
   37673 %{
   37674 static void yyerror ( const char *msg);
   37675 static int yylex (void);
   37676 %}
   37677 %%
   37678 exp:     { putchar ('0'); }
   37679      '1' { putchar ('1'); }
   37680      '2' { putchar ('2'); }
   37681      '3' { putchar ('3'); }
   37682      '4' { putchar ('4'); }
   37683      '5' { putchar ('5'); }
   37684      '6' { putchar ('6'); }
   37685      '7' { putchar ('7'); }
   37686      '8' { putchar ('8'); }
   37687      '9' { putchar ('9'); }
   37688          { putchar ('\n'); }
   37689    ;
   37690 %%
   37691 #include <stdio.h>
   37692 /* A C error reporting function.  */
   37693 static
   37694 void yyerror ( const char *msg)
   37695 {
   37696   fprintf (stderr, "%s\n", msg);
   37697 }
   37698 #include <assert.h>
   37699 static
   37700 int yylex (void)
   37701 {
   37702   static char const input[] = "123456789";
   37703   static size_t toknum = 0;
   37704   int res;
   37705   ;
   37706   assert (toknum < sizeof input / sizeof input[0]);
   37707   res = input[toknum++];
   37708   ;
   37709   return res;
   37710 }
   37711 int
   37712 main (void)
   37713 {
   37714   return yyparse ();
   37715 }
   37716 _ATEOF
   37717 
   37718 
   37719 
   37720 
   37721 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   37722   at_save_special_files
   37723   mkdir xml-tests
   37724     # Don't combine these Bison invocations since we want to be sure that
   37725   # --report=all isn't required to get the full XML file.
   37726   { set +x
   37727 $as_echo "$at_srcdir/actions.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   37728                   --graph=xml-tests/test.dot -d -v -o input.c input.y"
   37729 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:63"
   37730 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   37731                   --graph=xml-tests/test.dot -d -v -o input.c input.y
   37732 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37733 at_status=$? at_failed=false
   37734 $at_check_filter
   37735 echo stderr:; cat "$at_stderr"
   37736 echo stdout:; cat "$at_stdout"
   37737 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63"
   37738 $at_failed && at_fn_log_failure
   37739 $at_traceon; }
   37740 
   37741   { set +x
   37742 $as_echo "$at_srcdir/actions.at:63: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y"
   37743 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:63"
   37744 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y
   37745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37746 at_status=$? at_failed=false
   37747 $at_check_filter
   37748 echo stderr:; cat "$at_stderr"
   37749 echo stdout:; cat "$at_stdout"
   37750 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63"
   37751 $at_failed && at_fn_log_failure
   37752 $at_traceon; }
   37753 
   37754     cp xml-tests/test.output expout
   37755   { set +x
   37756 $as_echo "$at_srcdir/actions.at:63: \$XSLTPROC \\
   37757              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   37758              xml-tests/test.xml"
   37759 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:63"
   37760 ( $at_check_trace; $XSLTPROC \
   37761              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   37762              xml-tests/test.xml
   37763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37764 at_status=$? at_failed=false
   37765 $at_check_filter
   37766 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37767 $at_diff expout "$at_stdout" || at_failed=:
   37768 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63"
   37769 $at_failed && at_fn_log_failure
   37770 $at_traceon; }
   37771 
   37772   sort xml-tests/test.dot > expout
   37773   { set +x
   37774 $as_echo "$at_srcdir/actions.at:63: \$XSLTPROC \\
   37775              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   37776              xml-tests/test.xml | sort"
   37777 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:63"
   37778 ( $at_check_trace; $XSLTPROC \
   37779              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   37780              xml-tests/test.xml | sort
   37781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37782 at_status=$? at_failed=false
   37783 $at_check_filter
   37784 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37785 $at_diff expout "$at_stdout" || at_failed=:
   37786 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63"
   37787 $at_failed && at_fn_log_failure
   37788 $at_traceon; }
   37789 
   37790   rm -rf xml-tests expout
   37791   at_restore_special_files
   37792 fi
   37793 { set +x
   37794 $as_echo "$at_srcdir/actions.at:63: bison -d -v -o input.c input.y"
   37795 at_fn_check_prepare_trace "actions.at:63"
   37796 ( $at_check_trace; bison -d -v -o input.c input.y
   37797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37798 at_status=$? at_failed=false
   37799 $at_check_filter
   37800 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37801 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37802 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63"
   37803 $at_failed && at_fn_log_failure
   37804 $at_traceon; }
   37805 
   37806 
   37807 { set +x
   37808 $as_echo "$at_srcdir/actions.at:64: \$BISON_C_WORKS"
   37809 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:64"
   37810 ( $at_check_trace; $BISON_C_WORKS
   37811 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37812 at_status=$? at_failed=false
   37813 $at_check_filter
   37814 echo stderr:; cat "$at_stderr"
   37815 echo stdout:; cat "$at_stdout"
   37816 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:64"
   37817 $at_failed && at_fn_log_failure
   37818 $at_traceon; }
   37819 
   37820 { set +x
   37821 $as_echo "$at_srcdir/actions.at:64: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   37822 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:64"
   37823 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   37824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37825 at_status=$? at_failed=false
   37826 $at_check_filter
   37827 echo stderr:; cat "$at_stderr"
   37828 echo stdout:; cat "$at_stdout"
   37829 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:64"
   37830 $at_failed && at_fn_log_failure
   37831 $at_traceon; }
   37832 
   37833 { set +x
   37834 $as_echo "$at_srcdir/actions.at:65:  \$PREPARSER ./input"
   37835 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:65"
   37836 ( $at_check_trace;  $PREPARSER ./input
   37837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37838 at_status=$? at_failed=false
   37839 $at_check_filter
   37840 echo stderr:; tee stderr <"$at_stderr"
   37841 echo >>"$at_stdout"; $as_echo "0123456789
   37842 " | \
   37843   $at_diff - "$at_stdout" || at_failed=:
   37844 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:65"
   37845 $at_failed && at_fn_log_failure
   37846 $at_traceon; }
   37847 
   37848 { set +x
   37849 $as_echo "$at_srcdir/actions.at:65: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   37850 at_fn_check_prepare_trace "actions.at:65"
   37851 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   37852 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37853 at_status=$? at_failed=false
   37854 $at_check_filter
   37855 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37856 at_fn_diff_devnull "$at_stdout" || at_failed=:
   37857 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:65"
   37858 $at_failed && at_fn_log_failure
   37859 $at_traceon; }
   37860 
   37861 
   37862 
   37863   set +x
   37864   $at_times_p && times >"$at_times_file"
   37865 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   37866 read at_status <"$at_status_file"
   37867 #AT_STOP_144
   37868 #AT_START_145
   37869 at_fn_group_banner 145 'actions.at:133' \
   37870   "Initial location: yacc.c " "                      " 9
   37871 at_xfail=no
   37872 (
   37873   $as_echo "145. $at_setup_line: testing $at_desc ..."
   37874   $at_traceon
   37875 
   37876 
   37877 
   37878 cat >input.y <<'_ATEOF'
   37879 %code top {
   37880 #include <config.h>
   37881 /* We don't need perfect functions for these tests. */
   37882 #undef malloc
   37883 #undef memcmp
   37884 #undef realloc
   37885 }
   37886 
   37887 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   37888 %locations
   37889 %debug
   37890 %skeleton "yacc.c"
   37891 
   37892 
   37893 %code
   37894 {
   37895 # include <stdio.h>
   37896 # include <stdlib.h> /* getenv */
   37897 static void yyerror ( const char *msg);
   37898 static int yylex (void);
   37899 }
   37900 %%
   37901 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   37902 %%
   37903 #include <stdio.h>
   37904 /* A C error reporting function.  */
   37905 static
   37906 void yyerror ( const char *msg)
   37907 {
   37908   YY_LOCATION_PRINT (stderr, (yylloc));
   37909   fprintf (stderr, ": ");
   37910   fprintf (stderr, "%s\n", msg);
   37911 }
   37912 
   37913 int yylex (void)
   37914 {
   37915   return 'x';
   37916 }
   37917 
   37918 int
   37919 main (void)
   37920 {
   37921   yydebug = !!getenv("YYDEBUG");
   37922   return !!yyparse ();
   37923 }
   37924 _ATEOF
   37925 
   37926 
   37927 
   37928 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   37929   at_save_special_files
   37930   mkdir xml-tests
   37931     # Don't combine these Bison invocations since we want to be sure that
   37932   # --report=all isn't required to get the full XML file.
   37933   { set +x
   37934 $as_echo "$at_srcdir/actions.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   37935                   --graph=xml-tests/test.dot -o input.c input.y"
   37936 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:133"
   37937 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   37938                   --graph=xml-tests/test.dot -o input.c input.y
   37939 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37940 at_status=$? at_failed=false
   37941 $at_check_filter
   37942 echo stderr:; cat "$at_stderr"
   37943 echo stdout:; cat "$at_stdout"
   37944 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   37945 $at_failed && at_fn_log_failure
   37946 $at_traceon; }
   37947 
   37948   { set +x
   37949 $as_echo "$at_srcdir/actions.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   37950 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:133"
   37951 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   37952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37953 at_status=$? at_failed=false
   37954 $at_check_filter
   37955 echo stderr:; cat "$at_stderr"
   37956 echo stdout:; cat "$at_stdout"
   37957 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   37958 $at_failed && at_fn_log_failure
   37959 $at_traceon; }
   37960 
   37961     cp xml-tests/test.output expout
   37962   { set +x
   37963 $as_echo "$at_srcdir/actions.at:133: \$XSLTPROC \\
   37964              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   37965              xml-tests/test.xml"
   37966 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:133"
   37967 ( $at_check_trace; $XSLTPROC \
   37968              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   37969              xml-tests/test.xml
   37970 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37971 at_status=$? at_failed=false
   37972 $at_check_filter
   37973 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37974 $at_diff expout "$at_stdout" || at_failed=:
   37975 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   37976 $at_failed && at_fn_log_failure
   37977 $at_traceon; }
   37978 
   37979   sort xml-tests/test.dot > expout
   37980   { set +x
   37981 $as_echo "$at_srcdir/actions.at:133: \$XSLTPROC \\
   37982              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   37983              xml-tests/test.xml | sort"
   37984 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:133"
   37985 ( $at_check_trace; $XSLTPROC \
   37986              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   37987              xml-tests/test.xml | sort
   37988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   37989 at_status=$? at_failed=false
   37990 $at_check_filter
   37991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   37992 $at_diff expout "$at_stdout" || at_failed=:
   37993 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   37994 $at_failed && at_fn_log_failure
   37995 $at_traceon; }
   37996 
   37997   rm -rf xml-tests expout
   37998   at_restore_special_files
   37999 fi
   38000 { set +x
   38001 $as_echo "$at_srcdir/actions.at:133: bison -o input.c input.y"
   38002 at_fn_check_prepare_trace "actions.at:133"
   38003 ( $at_check_trace; bison -o input.c input.y
   38004 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38005 at_status=$? at_failed=false
   38006 $at_check_filter
   38007 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38008 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38009 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   38010 $at_failed && at_fn_log_failure
   38011 $at_traceon; }
   38012 
   38013 
   38014    { set +x
   38015 $as_echo "$at_srcdir/actions.at:133: \$BISON_C_WORKS"
   38016 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:133"
   38017 ( $at_check_trace; $BISON_C_WORKS
   38018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38019 at_status=$? at_failed=false
   38020 $at_check_filter
   38021 echo stderr:; cat "$at_stderr"
   38022 echo stdout:; cat "$at_stdout"
   38023 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   38024 $at_failed && at_fn_log_failure
   38025 $at_traceon; }
   38026 
   38027 { set +x
   38028 $as_echo "$at_srcdir/actions.at:133: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   38029 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:133"
   38030 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   38031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38032 at_status=$? at_failed=false
   38033 $at_check_filter
   38034 echo stderr:; cat "$at_stderr"
   38035 echo stdout:; cat "$at_stdout"
   38036 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   38037 $at_failed && at_fn_log_failure
   38038 $at_traceon; }
   38039 
   38040 
   38041 { set +x
   38042 $as_echo "$at_srcdir/actions.at:133:  \$PREPARSER ./input"
   38043 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:133"
   38044 ( $at_check_trace;  $PREPARSER ./input
   38045 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38046 at_status=$? at_failed=false
   38047 $at_check_filter
   38048 echo stderr:; tee stderr <"$at_stderr"
   38049 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38050 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:133"
   38051 $at_failed && at_fn_log_failure
   38052 $at_traceon; }
   38053 
   38054 { set +x
   38055 $as_echo "$at_srcdir/actions.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   38056 at_fn_check_prepare_trace "actions.at:133"
   38057 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   38058 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38059 at_status=$? at_failed=false
   38060 $at_check_filter
   38061 echo >>"$at_stderr"; $as_echo "1.1
   38062 1.1: syntax error
   38063 " | \
   38064   $at_diff - "$at_stderr" || at_failed=:
   38065 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38066 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
   38067 $at_failed && at_fn_log_failure
   38068 $at_traceon; }
   38069 
   38070 
   38071 
   38072   set +x
   38073   $at_times_p && times >"$at_times_file"
   38074 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   38075 read at_status <"$at_status_file"
   38076 #AT_STOP_145
   38077 #AT_START_146
   38078 at_fn_group_banner 146 'actions.at:134' \
   38079   "Initial location: yacc.c %define api.pure full" " " 9
   38080 at_xfail=no
   38081 (
   38082   $as_echo "146. $at_setup_line: testing $at_desc ..."
   38083   $at_traceon
   38084 
   38085 
   38086 
   38087 cat >input.y <<'_ATEOF'
   38088 %code top {
   38089 #include <config.h>
   38090 /* We don't need perfect functions for these tests. */
   38091 #undef malloc
   38092 #undef memcmp
   38093 #undef realloc
   38094 }
   38095 
   38096 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   38097 %locations
   38098 %debug
   38099 %skeleton "yacc.c"
   38100 %define api.pure full
   38101 
   38102 %code
   38103 {
   38104 # include <stdio.h>
   38105 # include <stdlib.h> /* getenv */
   38106 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   38107 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   38108 }
   38109 %%
   38110 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   38111 %%
   38112 #include <stdio.h>
   38113 /* A C error reporting function.  */
   38114 static
   38115 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   38116 {
   38117   YY_LOCATION_PRINT (stderr, (*llocp));
   38118   fprintf (stderr, ": ");
   38119   fprintf (stderr, "%s\n", msg);
   38120 }
   38121 
   38122 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   38123 {
   38124   YYUSE(lvalp);
   38125   YYUSE(llocp);
   38126   return 'x';
   38127 }
   38128 
   38129 int
   38130 main (void)
   38131 {
   38132   yydebug = !!getenv("YYDEBUG");
   38133   return !!yyparse ();
   38134 }
   38135 _ATEOF
   38136 
   38137 
   38138 
   38139 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   38140   at_save_special_files
   38141   mkdir xml-tests
   38142     # Don't combine these Bison invocations since we want to be sure that
   38143   # --report=all isn't required to get the full XML file.
   38144   { set +x
   38145 $as_echo "$at_srcdir/actions.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   38146                   --graph=xml-tests/test.dot -o input.c input.y"
   38147 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:134"
   38148 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   38149                   --graph=xml-tests/test.dot -o input.c input.y
   38150 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38151 at_status=$? at_failed=false
   38152 $at_check_filter
   38153 echo stderr:; cat "$at_stderr"
   38154 echo stdout:; cat "$at_stdout"
   38155 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38156 $at_failed && at_fn_log_failure
   38157 $at_traceon; }
   38158 
   38159   { set +x
   38160 $as_echo "$at_srcdir/actions.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   38161 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:134"
   38162 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   38163 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38164 at_status=$? at_failed=false
   38165 $at_check_filter
   38166 echo stderr:; cat "$at_stderr"
   38167 echo stdout:; cat "$at_stdout"
   38168 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38169 $at_failed && at_fn_log_failure
   38170 $at_traceon; }
   38171 
   38172     cp xml-tests/test.output expout
   38173   { set +x
   38174 $as_echo "$at_srcdir/actions.at:134: \$XSLTPROC \\
   38175              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   38176              xml-tests/test.xml"
   38177 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:134"
   38178 ( $at_check_trace; $XSLTPROC \
   38179              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   38180              xml-tests/test.xml
   38181 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38182 at_status=$? at_failed=false
   38183 $at_check_filter
   38184 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38185 $at_diff expout "$at_stdout" || at_failed=:
   38186 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38187 $at_failed && at_fn_log_failure
   38188 $at_traceon; }
   38189 
   38190   sort xml-tests/test.dot > expout
   38191   { set +x
   38192 $as_echo "$at_srcdir/actions.at:134: \$XSLTPROC \\
   38193              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   38194              xml-tests/test.xml | sort"
   38195 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:134"
   38196 ( $at_check_trace; $XSLTPROC \
   38197              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   38198              xml-tests/test.xml | sort
   38199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38200 at_status=$? at_failed=false
   38201 $at_check_filter
   38202 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38203 $at_diff expout "$at_stdout" || at_failed=:
   38204 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38205 $at_failed && at_fn_log_failure
   38206 $at_traceon; }
   38207 
   38208   rm -rf xml-tests expout
   38209   at_restore_special_files
   38210 fi
   38211 { set +x
   38212 $as_echo "$at_srcdir/actions.at:134: bison -o input.c input.y"
   38213 at_fn_check_prepare_trace "actions.at:134"
   38214 ( $at_check_trace; bison -o input.c input.y
   38215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38216 at_status=$? at_failed=false
   38217 $at_check_filter
   38218 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38219 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38220 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38221 $at_failed && at_fn_log_failure
   38222 $at_traceon; }
   38223 
   38224 
   38225    { set +x
   38226 $as_echo "$at_srcdir/actions.at:134: \$BISON_C_WORKS"
   38227 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:134"
   38228 ( $at_check_trace; $BISON_C_WORKS
   38229 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38230 at_status=$? at_failed=false
   38231 $at_check_filter
   38232 echo stderr:; cat "$at_stderr"
   38233 echo stdout:; cat "$at_stdout"
   38234 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38235 $at_failed && at_fn_log_failure
   38236 $at_traceon; }
   38237 
   38238 { set +x
   38239 $as_echo "$at_srcdir/actions.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   38240 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:134"
   38241 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   38242 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38243 at_status=$? at_failed=false
   38244 $at_check_filter
   38245 echo stderr:; cat "$at_stderr"
   38246 echo stdout:; cat "$at_stdout"
   38247 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38248 $at_failed && at_fn_log_failure
   38249 $at_traceon; }
   38250 
   38251 
   38252 { set +x
   38253 $as_echo "$at_srcdir/actions.at:134:  \$PREPARSER ./input"
   38254 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:134"
   38255 ( $at_check_trace;  $PREPARSER ./input
   38256 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38257 at_status=$? at_failed=false
   38258 $at_check_filter
   38259 echo stderr:; tee stderr <"$at_stderr"
   38260 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38261 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:134"
   38262 $at_failed && at_fn_log_failure
   38263 $at_traceon; }
   38264 
   38265 { set +x
   38266 $as_echo "$at_srcdir/actions.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   38267 at_fn_check_prepare_trace "actions.at:134"
   38268 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   38269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38270 at_status=$? at_failed=false
   38271 $at_check_filter
   38272 echo >>"$at_stderr"; $as_echo "1.1
   38273 1.1: syntax error
   38274 " | \
   38275   $at_diff - "$at_stderr" || at_failed=:
   38276 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38277 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:134"
   38278 $at_failed && at_fn_log_failure
   38279 $at_traceon; }
   38280 
   38281 
   38282 
   38283   set +x
   38284   $at_times_p && times >"$at_times_file"
   38285 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   38286 read at_status <"$at_status_file"
   38287 #AT_STOP_146
   38288 #AT_START_147
   38289 at_fn_group_banner 147 'actions.at:135' \
   38290   "Initial location: yacc.c %define api.pure %parse-param { int x }" "" 9
   38291 at_xfail=no
   38292 (
   38293   $as_echo "147. $at_setup_line: testing $at_desc ..."
   38294   $at_traceon
   38295 
   38296 
   38297 
   38298 cat >input.y <<'_ATEOF'
   38299 %code top {
   38300 #include <config.h>
   38301 /* We don't need perfect functions for these tests. */
   38302 #undef malloc
   38303 #undef memcmp
   38304 #undef realloc
   38305 }
   38306 
   38307 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   38308 %locations
   38309 %debug
   38310 %skeleton "yacc.c"
   38311 %define api.pure %parse-param { int x }
   38312 
   38313 %code
   38314 {
   38315 # include <stdio.h>
   38316 # include <stdlib.h> /* getenv */
   38317 static void yyerror (YYLTYPE const * const llocp, int x,  const char *msg);
   38318 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   38319 }
   38320 %%
   38321 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   38322 %%
   38323 #include <stdio.h>
   38324 /* A C error reporting function.  */
   38325 static
   38326 void yyerror (YYLTYPE const * const llocp, int x,  const char *msg)
   38327 {
   38328   YYUSE(x);
   38329   YY_LOCATION_PRINT (stderr, (*llocp));
   38330   fprintf (stderr, ": ");
   38331   fprintf (stderr, "%s\n", msg);
   38332 }
   38333 
   38334 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   38335 {
   38336   YYUSE(lvalp);
   38337   YYUSE(llocp);
   38338   return 'x';
   38339 }
   38340 
   38341 int
   38342 main (void)
   38343 {
   38344   yydebug = !!getenv("YYDEBUG");
   38345   return !!yyparse (0);
   38346 }
   38347 _ATEOF
   38348 
   38349 
   38350 
   38351 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   38352   at_save_special_files
   38353   mkdir xml-tests
   38354     # Don't combine these Bison invocations since we want to be sure that
   38355   # --report=all isn't required to get the full XML file.
   38356   { set +x
   38357 $as_echo "$at_srcdir/actions.at:135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   38358                   --graph=xml-tests/test.dot -o input.c input.y"
   38359 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:135"
   38360 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   38361                   --graph=xml-tests/test.dot -o input.c input.y
   38362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38363 at_status=$? at_failed=false
   38364 $at_check_filter
   38365 echo stderr:; cat "$at_stderr"
   38366 echo stdout:; cat "$at_stdout"
   38367 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38368 $at_failed && at_fn_log_failure
   38369 $at_traceon; }
   38370 
   38371   { set +x
   38372 $as_echo "$at_srcdir/actions.at:135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   38373 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:135"
   38374 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   38375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38376 at_status=$? at_failed=false
   38377 $at_check_filter
   38378 echo stderr:; cat "$at_stderr"
   38379 echo stdout:; cat "$at_stdout"
   38380 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38381 $at_failed && at_fn_log_failure
   38382 $at_traceon; }
   38383 
   38384     cp xml-tests/test.output expout
   38385   { set +x
   38386 $as_echo "$at_srcdir/actions.at:135: \$XSLTPROC \\
   38387              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   38388              xml-tests/test.xml"
   38389 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:135"
   38390 ( $at_check_trace; $XSLTPROC \
   38391              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   38392              xml-tests/test.xml
   38393 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38394 at_status=$? at_failed=false
   38395 $at_check_filter
   38396 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38397 $at_diff expout "$at_stdout" || at_failed=:
   38398 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38399 $at_failed && at_fn_log_failure
   38400 $at_traceon; }
   38401 
   38402   sort xml-tests/test.dot > expout
   38403   { set +x
   38404 $as_echo "$at_srcdir/actions.at:135: \$XSLTPROC \\
   38405              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   38406              xml-tests/test.xml | sort"
   38407 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:135"
   38408 ( $at_check_trace; $XSLTPROC \
   38409              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   38410              xml-tests/test.xml | sort
   38411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38412 at_status=$? at_failed=false
   38413 $at_check_filter
   38414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38415 $at_diff expout "$at_stdout" || at_failed=:
   38416 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38417 $at_failed && at_fn_log_failure
   38418 $at_traceon; }
   38419 
   38420   rm -rf xml-tests expout
   38421   at_restore_special_files
   38422 fi
   38423 { set +x
   38424 $as_echo "$at_srcdir/actions.at:135: bison -o input.c input.y"
   38425 at_fn_check_prepare_trace "actions.at:135"
   38426 ( $at_check_trace; bison -o input.c input.y
   38427 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38428 at_status=$? at_failed=false
   38429 $at_check_filter
   38430 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38431 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38432 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38433 $at_failed && at_fn_log_failure
   38434 $at_traceon; }
   38435 
   38436 
   38437    { set +x
   38438 $as_echo "$at_srcdir/actions.at:135: \$BISON_C_WORKS"
   38439 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:135"
   38440 ( $at_check_trace; $BISON_C_WORKS
   38441 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38442 at_status=$? at_failed=false
   38443 $at_check_filter
   38444 echo stderr:; cat "$at_stderr"
   38445 echo stdout:; cat "$at_stdout"
   38446 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38447 $at_failed && at_fn_log_failure
   38448 $at_traceon; }
   38449 
   38450 { set +x
   38451 $as_echo "$at_srcdir/actions.at:135: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   38452 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:135"
   38453 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   38454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38455 at_status=$? at_failed=false
   38456 $at_check_filter
   38457 echo stderr:; cat "$at_stderr"
   38458 echo stdout:; cat "$at_stdout"
   38459 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38460 $at_failed && at_fn_log_failure
   38461 $at_traceon; }
   38462 
   38463 
   38464 { set +x
   38465 $as_echo "$at_srcdir/actions.at:135:  \$PREPARSER ./input"
   38466 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:135"
   38467 ( $at_check_trace;  $PREPARSER ./input
   38468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38469 at_status=$? at_failed=false
   38470 $at_check_filter
   38471 echo stderr:; tee stderr <"$at_stderr"
   38472 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38473 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:135"
   38474 $at_failed && at_fn_log_failure
   38475 $at_traceon; }
   38476 
   38477 { set +x
   38478 $as_echo "$at_srcdir/actions.at:135: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   38479 at_fn_check_prepare_trace "actions.at:135"
   38480 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   38481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38482 at_status=$? at_failed=false
   38483 $at_check_filter
   38484 echo >>"$at_stderr"; $as_echo "1.1
   38485 1.1: syntax error
   38486 " | \
   38487   $at_diff - "$at_stderr" || at_failed=:
   38488 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38489 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:135"
   38490 $at_failed && at_fn_log_failure
   38491 $at_traceon; }
   38492 
   38493 
   38494 
   38495   set +x
   38496   $at_times_p && times >"$at_times_file"
   38497 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   38498 read at_status <"$at_status_file"
   38499 #AT_STOP_147
   38500 #AT_START_148
   38501 at_fn_group_banner 148 'actions.at:136' \
   38502   "Initial location: yacc.c %define api.push-pull both" "" 9
   38503 at_xfail=no
   38504 (
   38505   $as_echo "148. $at_setup_line: testing $at_desc ..."
   38506   $at_traceon
   38507 
   38508 
   38509 
   38510 cat >input.y <<'_ATEOF'
   38511 %code top {
   38512 #include <config.h>
   38513 /* We don't need perfect functions for these tests. */
   38514 #undef malloc
   38515 #undef memcmp
   38516 #undef realloc
   38517 }
   38518 
   38519 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   38520 %locations
   38521 %debug
   38522 %skeleton "yacc.c"
   38523 %define api.push-pull both
   38524 
   38525 %code
   38526 {
   38527 # include <stdio.h>
   38528 # include <stdlib.h> /* getenv */
   38529 static void yyerror ( const char *msg);
   38530 static int yylex (void);
   38531 }
   38532 %%
   38533 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   38534 %%
   38535 #include <stdio.h>
   38536 /* A C error reporting function.  */
   38537 static
   38538 void yyerror ( const char *msg)
   38539 {
   38540   YY_LOCATION_PRINT (stderr, (yylloc));
   38541   fprintf (stderr, ": ");
   38542   fprintf (stderr, "%s\n", msg);
   38543 }
   38544 
   38545 int yylex (void)
   38546 {
   38547   return 'x';
   38548 }
   38549 
   38550 int
   38551 main (void)
   38552 {
   38553   yydebug = !!getenv("YYDEBUG");
   38554   return !!yyparse ();
   38555 }
   38556 _ATEOF
   38557 
   38558 
   38559 
   38560 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   38561   at_save_special_files
   38562   mkdir xml-tests
   38563     # Don't combine these Bison invocations since we want to be sure that
   38564   # --report=all isn't required to get the full XML file.
   38565   { set +x
   38566 $as_echo "$at_srcdir/actions.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   38567                   --graph=xml-tests/test.dot -o input.c input.y"
   38568 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:136"
   38569 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   38570                   --graph=xml-tests/test.dot -o input.c input.y
   38571 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38572 at_status=$? at_failed=false
   38573 $at_check_filter
   38574 echo stderr:; cat "$at_stderr"
   38575 echo stdout:; cat "$at_stdout"
   38576 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38577 $at_failed && at_fn_log_failure
   38578 $at_traceon; }
   38579 
   38580   { set +x
   38581 $as_echo "$at_srcdir/actions.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   38582 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:136"
   38583 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   38584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38585 at_status=$? at_failed=false
   38586 $at_check_filter
   38587 echo stderr:; cat "$at_stderr"
   38588 echo stdout:; cat "$at_stdout"
   38589 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38590 $at_failed && at_fn_log_failure
   38591 $at_traceon; }
   38592 
   38593     cp xml-tests/test.output expout
   38594   { set +x
   38595 $as_echo "$at_srcdir/actions.at:136: \$XSLTPROC \\
   38596              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   38597              xml-tests/test.xml"
   38598 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:136"
   38599 ( $at_check_trace; $XSLTPROC \
   38600              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   38601              xml-tests/test.xml
   38602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38603 at_status=$? at_failed=false
   38604 $at_check_filter
   38605 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38606 $at_diff expout "$at_stdout" || at_failed=:
   38607 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38608 $at_failed && at_fn_log_failure
   38609 $at_traceon; }
   38610 
   38611   sort xml-tests/test.dot > expout
   38612   { set +x
   38613 $as_echo "$at_srcdir/actions.at:136: \$XSLTPROC \\
   38614              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   38615              xml-tests/test.xml | sort"
   38616 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:136"
   38617 ( $at_check_trace; $XSLTPROC \
   38618              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   38619              xml-tests/test.xml | sort
   38620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38621 at_status=$? at_failed=false
   38622 $at_check_filter
   38623 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38624 $at_diff expout "$at_stdout" || at_failed=:
   38625 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38626 $at_failed && at_fn_log_failure
   38627 $at_traceon; }
   38628 
   38629   rm -rf xml-tests expout
   38630   at_restore_special_files
   38631 fi
   38632 { set +x
   38633 $as_echo "$at_srcdir/actions.at:136: bison -o input.c input.y"
   38634 at_fn_check_prepare_trace "actions.at:136"
   38635 ( $at_check_trace; bison -o input.c input.y
   38636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38637 at_status=$? at_failed=false
   38638 $at_check_filter
   38639 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38640 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38641 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38642 $at_failed && at_fn_log_failure
   38643 $at_traceon; }
   38644 
   38645 
   38646    { set +x
   38647 $as_echo "$at_srcdir/actions.at:136: \$BISON_C_WORKS"
   38648 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:136"
   38649 ( $at_check_trace; $BISON_C_WORKS
   38650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38651 at_status=$? at_failed=false
   38652 $at_check_filter
   38653 echo stderr:; cat "$at_stderr"
   38654 echo stdout:; cat "$at_stdout"
   38655 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38656 $at_failed && at_fn_log_failure
   38657 $at_traceon; }
   38658 
   38659 { set +x
   38660 $as_echo "$at_srcdir/actions.at:136: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   38661 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:136"
   38662 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   38663 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38664 at_status=$? at_failed=false
   38665 $at_check_filter
   38666 echo stderr:; cat "$at_stderr"
   38667 echo stdout:; cat "$at_stdout"
   38668 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38669 $at_failed && at_fn_log_failure
   38670 $at_traceon; }
   38671 
   38672 
   38673 { set +x
   38674 $as_echo "$at_srcdir/actions.at:136:  \$PREPARSER ./input"
   38675 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:136"
   38676 ( $at_check_trace;  $PREPARSER ./input
   38677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38678 at_status=$? at_failed=false
   38679 $at_check_filter
   38680 echo stderr:; tee stderr <"$at_stderr"
   38681 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38682 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:136"
   38683 $at_failed && at_fn_log_failure
   38684 $at_traceon; }
   38685 
   38686 { set +x
   38687 $as_echo "$at_srcdir/actions.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   38688 at_fn_check_prepare_trace "actions.at:136"
   38689 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   38690 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38691 at_status=$? at_failed=false
   38692 $at_check_filter
   38693 echo >>"$at_stderr"; $as_echo "1.1
   38694 1.1: syntax error
   38695 " | \
   38696   $at_diff - "$at_stderr" || at_failed=:
   38697 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38698 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:136"
   38699 $at_failed && at_fn_log_failure
   38700 $at_traceon; }
   38701 
   38702 
   38703 
   38704   set +x
   38705   $at_times_p && times >"$at_times_file"
   38706 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   38707 read at_status <"$at_status_file"
   38708 #AT_STOP_148
   38709 #AT_START_149
   38710 at_fn_group_banner 149 'actions.at:137' \
   38711   "Initial location: yacc.c %define api.push-pull both %define api.pure full" "" 9
   38712 at_xfail=no
   38713 (
   38714   $as_echo "149. $at_setup_line: testing $at_desc ..."
   38715   $at_traceon
   38716 
   38717 
   38718 
   38719 cat >input.y <<'_ATEOF'
   38720 %code top {
   38721 #include <config.h>
   38722 /* We don't need perfect functions for these tests. */
   38723 #undef malloc
   38724 #undef memcmp
   38725 #undef realloc
   38726 }
   38727 
   38728 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   38729 %locations
   38730 %debug
   38731 %skeleton "yacc.c"
   38732 %define api.push-pull both %define api.pure full
   38733 
   38734 %code
   38735 {
   38736 # include <stdio.h>
   38737 # include <stdlib.h> /* getenv */
   38738 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   38739 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   38740 }
   38741 %%
   38742 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   38743 %%
   38744 #include <stdio.h>
   38745 /* A C error reporting function.  */
   38746 static
   38747 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   38748 {
   38749   YY_LOCATION_PRINT (stderr, (*llocp));
   38750   fprintf (stderr, ": ");
   38751   fprintf (stderr, "%s\n", msg);
   38752 }
   38753 
   38754 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   38755 {
   38756   YYUSE(lvalp);
   38757   YYUSE(llocp);
   38758   return 'x';
   38759 }
   38760 
   38761 int
   38762 main (void)
   38763 {
   38764   yydebug = !!getenv("YYDEBUG");
   38765   return !!yyparse ();
   38766 }
   38767 _ATEOF
   38768 
   38769 
   38770 
   38771 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   38772   at_save_special_files
   38773   mkdir xml-tests
   38774     # Don't combine these Bison invocations since we want to be sure that
   38775   # --report=all isn't required to get the full XML file.
   38776   { set +x
   38777 $as_echo "$at_srcdir/actions.at:137: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   38778                   --graph=xml-tests/test.dot -o input.c input.y"
   38779 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:137"
   38780 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   38781                   --graph=xml-tests/test.dot -o input.c input.y
   38782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38783 at_status=$? at_failed=false
   38784 $at_check_filter
   38785 echo stderr:; cat "$at_stderr"
   38786 echo stdout:; cat "$at_stdout"
   38787 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38788 $at_failed && at_fn_log_failure
   38789 $at_traceon; }
   38790 
   38791   { set +x
   38792 $as_echo "$at_srcdir/actions.at:137: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   38793 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:137"
   38794 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   38795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38796 at_status=$? at_failed=false
   38797 $at_check_filter
   38798 echo stderr:; cat "$at_stderr"
   38799 echo stdout:; cat "$at_stdout"
   38800 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38801 $at_failed && at_fn_log_failure
   38802 $at_traceon; }
   38803 
   38804     cp xml-tests/test.output expout
   38805   { set +x
   38806 $as_echo "$at_srcdir/actions.at:137: \$XSLTPROC \\
   38807              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   38808              xml-tests/test.xml"
   38809 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:137"
   38810 ( $at_check_trace; $XSLTPROC \
   38811              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   38812              xml-tests/test.xml
   38813 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38814 at_status=$? at_failed=false
   38815 $at_check_filter
   38816 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38817 $at_diff expout "$at_stdout" || at_failed=:
   38818 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38819 $at_failed && at_fn_log_failure
   38820 $at_traceon; }
   38821 
   38822   sort xml-tests/test.dot > expout
   38823   { set +x
   38824 $as_echo "$at_srcdir/actions.at:137: \$XSLTPROC \\
   38825              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   38826              xml-tests/test.xml | sort"
   38827 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:137"
   38828 ( $at_check_trace; $XSLTPROC \
   38829              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   38830              xml-tests/test.xml | sort
   38831 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38832 at_status=$? at_failed=false
   38833 $at_check_filter
   38834 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38835 $at_diff expout "$at_stdout" || at_failed=:
   38836 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38837 $at_failed && at_fn_log_failure
   38838 $at_traceon; }
   38839 
   38840   rm -rf xml-tests expout
   38841   at_restore_special_files
   38842 fi
   38843 { set +x
   38844 $as_echo "$at_srcdir/actions.at:137: bison -o input.c input.y"
   38845 at_fn_check_prepare_trace "actions.at:137"
   38846 ( $at_check_trace; bison -o input.c input.y
   38847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38848 at_status=$? at_failed=false
   38849 $at_check_filter
   38850 at_fn_diff_devnull "$at_stderr" || at_failed=:
   38851 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38852 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38853 $at_failed && at_fn_log_failure
   38854 $at_traceon; }
   38855 
   38856 
   38857    { set +x
   38858 $as_echo "$at_srcdir/actions.at:137: \$BISON_C_WORKS"
   38859 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:137"
   38860 ( $at_check_trace; $BISON_C_WORKS
   38861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38862 at_status=$? at_failed=false
   38863 $at_check_filter
   38864 echo stderr:; cat "$at_stderr"
   38865 echo stdout:; cat "$at_stdout"
   38866 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38867 $at_failed && at_fn_log_failure
   38868 $at_traceon; }
   38869 
   38870 { set +x
   38871 $as_echo "$at_srcdir/actions.at:137: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   38872 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:137"
   38873 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   38874 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38875 at_status=$? at_failed=false
   38876 $at_check_filter
   38877 echo stderr:; cat "$at_stderr"
   38878 echo stdout:; cat "$at_stdout"
   38879 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38880 $at_failed && at_fn_log_failure
   38881 $at_traceon; }
   38882 
   38883 
   38884 { set +x
   38885 $as_echo "$at_srcdir/actions.at:137:  \$PREPARSER ./input"
   38886 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:137"
   38887 ( $at_check_trace;  $PREPARSER ./input
   38888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38889 at_status=$? at_failed=false
   38890 $at_check_filter
   38891 echo stderr:; tee stderr <"$at_stderr"
   38892 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38893 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:137"
   38894 $at_failed && at_fn_log_failure
   38895 $at_traceon; }
   38896 
   38897 { set +x
   38898 $as_echo "$at_srcdir/actions.at:137: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   38899 at_fn_check_prepare_trace "actions.at:137"
   38900 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   38901 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38902 at_status=$? at_failed=false
   38903 $at_check_filter
   38904 echo >>"$at_stderr"; $as_echo "1.1
   38905 1.1: syntax error
   38906 " | \
   38907   $at_diff - "$at_stderr" || at_failed=:
   38908 at_fn_diff_devnull "$at_stdout" || at_failed=:
   38909 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:137"
   38910 $at_failed && at_fn_log_failure
   38911 $at_traceon; }
   38912 
   38913 
   38914 
   38915   set +x
   38916   $at_times_p && times >"$at_times_file"
   38917 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   38918 read at_status <"$at_status_file"
   38919 #AT_STOP_149
   38920 #AT_START_150
   38921 at_fn_group_banner 150 'actions.at:138' \
   38922   "Initial location: glr.c " "                       " 9
   38923 at_xfail=no
   38924 (
   38925   $as_echo "150. $at_setup_line: testing $at_desc ..."
   38926   $at_traceon
   38927 
   38928 
   38929 
   38930 cat >input.y <<'_ATEOF'
   38931 %code top {
   38932 #include <config.h>
   38933 /* We don't need perfect functions for these tests. */
   38934 #undef malloc
   38935 #undef memcmp
   38936 #undef realloc
   38937 }
   38938 
   38939 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   38940 %locations
   38941 %debug
   38942 %skeleton "glr.c"
   38943 
   38944 
   38945 %code
   38946 {
   38947 # include <stdio.h>
   38948 # include <stdlib.h> /* getenv */
   38949 static void yyerror ( const char *msg);
   38950 static int yylex (void);
   38951 }
   38952 %%
   38953 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   38954 %%
   38955 #include <stdio.h>
   38956 /* A C error reporting function.  */
   38957 static
   38958 void yyerror ( const char *msg)
   38959 {
   38960   YY_LOCATION_PRINT (stderr, (yylloc));
   38961   fprintf (stderr, ": ");
   38962   fprintf (stderr, "%s\n", msg);
   38963 }
   38964 
   38965 int yylex (void)
   38966 {
   38967   return 'x';
   38968 }
   38969 
   38970 int
   38971 main (void)
   38972 {
   38973   yydebug = !!getenv("YYDEBUG");
   38974   return !!yyparse ();
   38975 }
   38976 _ATEOF
   38977 
   38978 
   38979 
   38980 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   38981   at_save_special_files
   38982   mkdir xml-tests
   38983     # Don't combine these Bison invocations since we want to be sure that
   38984   # --report=all isn't required to get the full XML file.
   38985   { set +x
   38986 $as_echo "$at_srcdir/actions.at:138: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   38987                   --graph=xml-tests/test.dot -o input.c input.y"
   38988 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:138"
   38989 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   38990                   --graph=xml-tests/test.dot -o input.c input.y
   38991 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   38992 at_status=$? at_failed=false
   38993 $at_check_filter
   38994 echo stderr:; cat "$at_stderr"
   38995 echo stdout:; cat "$at_stdout"
   38996 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   38997 $at_failed && at_fn_log_failure
   38998 $at_traceon; }
   38999 
   39000   { set +x
   39001 $as_echo "$at_srcdir/actions.at:138: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   39002 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:138"
   39003 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   39004 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39005 at_status=$? at_failed=false
   39006 $at_check_filter
   39007 echo stderr:; cat "$at_stderr"
   39008 echo stdout:; cat "$at_stdout"
   39009 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39010 $at_failed && at_fn_log_failure
   39011 $at_traceon; }
   39012 
   39013     cp xml-tests/test.output expout
   39014   { set +x
   39015 $as_echo "$at_srcdir/actions.at:138: \$XSLTPROC \\
   39016              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   39017              xml-tests/test.xml"
   39018 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:138"
   39019 ( $at_check_trace; $XSLTPROC \
   39020              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   39021              xml-tests/test.xml
   39022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39023 at_status=$? at_failed=false
   39024 $at_check_filter
   39025 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39026 $at_diff expout "$at_stdout" || at_failed=:
   39027 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39028 $at_failed && at_fn_log_failure
   39029 $at_traceon; }
   39030 
   39031   sort xml-tests/test.dot > expout
   39032   { set +x
   39033 $as_echo "$at_srcdir/actions.at:138: \$XSLTPROC \\
   39034              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   39035              xml-tests/test.xml | sort"
   39036 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:138"
   39037 ( $at_check_trace; $XSLTPROC \
   39038              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   39039              xml-tests/test.xml | sort
   39040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39041 at_status=$? at_failed=false
   39042 $at_check_filter
   39043 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39044 $at_diff expout "$at_stdout" || at_failed=:
   39045 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39046 $at_failed && at_fn_log_failure
   39047 $at_traceon; }
   39048 
   39049   rm -rf xml-tests expout
   39050   at_restore_special_files
   39051 fi
   39052 { set +x
   39053 $as_echo "$at_srcdir/actions.at:138: bison -o input.c input.y"
   39054 at_fn_check_prepare_trace "actions.at:138"
   39055 ( $at_check_trace; bison -o input.c input.y
   39056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39057 at_status=$? at_failed=false
   39058 $at_check_filter
   39059 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39060 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39061 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39062 $at_failed && at_fn_log_failure
   39063 $at_traceon; }
   39064 
   39065 
   39066    { set +x
   39067 $as_echo "$at_srcdir/actions.at:138: \$BISON_C_WORKS"
   39068 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:138"
   39069 ( $at_check_trace; $BISON_C_WORKS
   39070 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39071 at_status=$? at_failed=false
   39072 $at_check_filter
   39073 echo stderr:; cat "$at_stderr"
   39074 echo stdout:; cat "$at_stdout"
   39075 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39076 $at_failed && at_fn_log_failure
   39077 $at_traceon; }
   39078 
   39079 { set +x
   39080 $as_echo "$at_srcdir/actions.at:138: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   39081 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:138"
   39082 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   39083 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39084 at_status=$? at_failed=false
   39085 $at_check_filter
   39086 echo stderr:; cat "$at_stderr"
   39087 echo stdout:; cat "$at_stdout"
   39088 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39089 $at_failed && at_fn_log_failure
   39090 $at_traceon; }
   39091 
   39092 
   39093 { set +x
   39094 $as_echo "$at_srcdir/actions.at:138:  \$PREPARSER ./input"
   39095 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:138"
   39096 ( $at_check_trace;  $PREPARSER ./input
   39097 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39098 at_status=$? at_failed=false
   39099 $at_check_filter
   39100 echo stderr:; tee stderr <"$at_stderr"
   39101 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39102 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:138"
   39103 $at_failed && at_fn_log_failure
   39104 $at_traceon; }
   39105 
   39106 { set +x
   39107 $as_echo "$at_srcdir/actions.at:138: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   39108 at_fn_check_prepare_trace "actions.at:138"
   39109 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   39110 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39111 at_status=$? at_failed=false
   39112 $at_check_filter
   39113 echo >>"$at_stderr"; $as_echo "1.1
   39114 1.1: syntax error
   39115 " | \
   39116   $at_diff - "$at_stderr" || at_failed=:
   39117 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39118 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:138"
   39119 $at_failed && at_fn_log_failure
   39120 $at_traceon; }
   39121 
   39122 
   39123 
   39124   set +x
   39125   $at_times_p && times >"$at_times_file"
   39126 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   39127 read at_status <"$at_status_file"
   39128 #AT_STOP_150
   39129 #AT_START_151
   39130 at_fn_group_banner 151 'actions.at:139' \
   39131   "Initial location: glr.c %define api.pure" "       " 9
   39132 at_xfail=no
   39133 (
   39134   $as_echo "151. $at_setup_line: testing $at_desc ..."
   39135   $at_traceon
   39136 
   39137 
   39138 
   39139 cat >input.y <<'_ATEOF'
   39140 %code top {
   39141 #include <config.h>
   39142 /* We don't need perfect functions for these tests. */
   39143 #undef malloc
   39144 #undef memcmp
   39145 #undef realloc
   39146 }
   39147 
   39148 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   39149 %locations
   39150 %debug
   39151 %skeleton "glr.c"
   39152 %define api.pure
   39153 
   39154 %code
   39155 {
   39156 # include <stdio.h>
   39157 # include <stdlib.h> /* getenv */
   39158 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   39159 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   39160 }
   39161 %%
   39162 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   39163 %%
   39164 #include <stdio.h>
   39165 /* A C error reporting function.  */
   39166 static
   39167 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   39168 {
   39169   YY_LOCATION_PRINT (stderr, (*llocp));
   39170   fprintf (stderr, ": ");
   39171   fprintf (stderr, "%s\n", msg);
   39172 }
   39173 
   39174 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   39175 {
   39176   YYUSE(lvalp);
   39177   YYUSE(llocp);
   39178   return 'x';
   39179 }
   39180 
   39181 int
   39182 main (void)
   39183 {
   39184   yydebug = !!getenv("YYDEBUG");
   39185   return !!yyparse ();
   39186 }
   39187 _ATEOF
   39188 
   39189 
   39190 
   39191 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   39192   at_save_special_files
   39193   mkdir xml-tests
   39194     # Don't combine these Bison invocations since we want to be sure that
   39195   # --report=all isn't required to get the full XML file.
   39196   { set +x
   39197 $as_echo "$at_srcdir/actions.at:139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   39198                   --graph=xml-tests/test.dot -o input.c input.y"
   39199 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:139"
   39200 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   39201                   --graph=xml-tests/test.dot -o input.c input.y
   39202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39203 at_status=$? at_failed=false
   39204 $at_check_filter
   39205 echo stderr:; cat "$at_stderr"
   39206 echo stdout:; cat "$at_stdout"
   39207 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39208 $at_failed && at_fn_log_failure
   39209 $at_traceon; }
   39210 
   39211   { set +x
   39212 $as_echo "$at_srcdir/actions.at:139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   39213 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:139"
   39214 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   39215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39216 at_status=$? at_failed=false
   39217 $at_check_filter
   39218 echo stderr:; cat "$at_stderr"
   39219 echo stdout:; cat "$at_stdout"
   39220 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39221 $at_failed && at_fn_log_failure
   39222 $at_traceon; }
   39223 
   39224     cp xml-tests/test.output expout
   39225   { set +x
   39226 $as_echo "$at_srcdir/actions.at:139: \$XSLTPROC \\
   39227              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   39228              xml-tests/test.xml"
   39229 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:139"
   39230 ( $at_check_trace; $XSLTPROC \
   39231              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   39232              xml-tests/test.xml
   39233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39234 at_status=$? at_failed=false
   39235 $at_check_filter
   39236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39237 $at_diff expout "$at_stdout" || at_failed=:
   39238 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39239 $at_failed && at_fn_log_failure
   39240 $at_traceon; }
   39241 
   39242   sort xml-tests/test.dot > expout
   39243   { set +x
   39244 $as_echo "$at_srcdir/actions.at:139: \$XSLTPROC \\
   39245              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   39246              xml-tests/test.xml | sort"
   39247 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:139"
   39248 ( $at_check_trace; $XSLTPROC \
   39249              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   39250              xml-tests/test.xml | sort
   39251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39252 at_status=$? at_failed=false
   39253 $at_check_filter
   39254 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39255 $at_diff expout "$at_stdout" || at_failed=:
   39256 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39257 $at_failed && at_fn_log_failure
   39258 $at_traceon; }
   39259 
   39260   rm -rf xml-tests expout
   39261   at_restore_special_files
   39262 fi
   39263 { set +x
   39264 $as_echo "$at_srcdir/actions.at:139: bison -o input.c input.y"
   39265 at_fn_check_prepare_trace "actions.at:139"
   39266 ( $at_check_trace; bison -o input.c input.y
   39267 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39268 at_status=$? at_failed=false
   39269 $at_check_filter
   39270 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39271 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39272 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39273 $at_failed && at_fn_log_failure
   39274 $at_traceon; }
   39275 
   39276 
   39277    { set +x
   39278 $as_echo "$at_srcdir/actions.at:139: \$BISON_C_WORKS"
   39279 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:139"
   39280 ( $at_check_trace; $BISON_C_WORKS
   39281 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39282 at_status=$? at_failed=false
   39283 $at_check_filter
   39284 echo stderr:; cat "$at_stderr"
   39285 echo stdout:; cat "$at_stdout"
   39286 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39287 $at_failed && at_fn_log_failure
   39288 $at_traceon; }
   39289 
   39290 { set +x
   39291 $as_echo "$at_srcdir/actions.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   39292 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:139"
   39293 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   39294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39295 at_status=$? at_failed=false
   39296 $at_check_filter
   39297 echo stderr:; cat "$at_stderr"
   39298 echo stdout:; cat "$at_stdout"
   39299 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39300 $at_failed && at_fn_log_failure
   39301 $at_traceon; }
   39302 
   39303 
   39304 { set +x
   39305 $as_echo "$at_srcdir/actions.at:139:  \$PREPARSER ./input"
   39306 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:139"
   39307 ( $at_check_trace;  $PREPARSER ./input
   39308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39309 at_status=$? at_failed=false
   39310 $at_check_filter
   39311 echo stderr:; tee stderr <"$at_stderr"
   39312 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39313 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:139"
   39314 $at_failed && at_fn_log_failure
   39315 $at_traceon; }
   39316 
   39317 { set +x
   39318 $as_echo "$at_srcdir/actions.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   39319 at_fn_check_prepare_trace "actions.at:139"
   39320 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   39321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39322 at_status=$? at_failed=false
   39323 $at_check_filter
   39324 echo >>"$at_stderr"; $as_echo "1.1
   39325 1.1: syntax error
   39326 " | \
   39327   $at_diff - "$at_stderr" || at_failed=:
   39328 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39329 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139"
   39330 $at_failed && at_fn_log_failure
   39331 $at_traceon; }
   39332 
   39333 
   39334 
   39335   set +x
   39336   $at_times_p && times >"$at_times_file"
   39337 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   39338 read at_status <"$at_status_file"
   39339 #AT_STOP_151
   39340 #AT_START_152
   39341 at_fn_group_banner 152 'actions.at:140' \
   39342   "Initial location: lalr1.cc " "                    " 9
   39343 at_xfail=no
   39344 (
   39345   $as_echo "152. $at_setup_line: testing $at_desc ..."
   39346   $at_traceon
   39347 
   39348 
   39349 
   39350 cat >input.y <<'_ATEOF'
   39351 %code top {
   39352 #include <config.h>
   39353 /* We don't need perfect functions for these tests. */
   39354 #undef malloc
   39355 #undef memcmp
   39356 #undef realloc
   39357 }
   39358 
   39359 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   39360 %locations
   39361 %debug
   39362 %skeleton "lalr1.cc"
   39363 
   39364 
   39365 %code
   39366 {
   39367 # include <stdio.h>
   39368 # include <stdlib.h> /* getenv */
   39369 
   39370 static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   39371 }
   39372 %%
   39373 exp: { std::cerr << @$ << std::endl; }
   39374 %%
   39375 /* A C++ error reporting function.  */
   39376 void
   39377 yy::parser::error (const location_type& l, const std::string& m)
   39378 {
   39379   (void) l;
   39380   std::cerr << l << ": " << m << std::endl;
   39381 }
   39382 
   39383 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   39384 {
   39385   YYUSE(lvalp);
   39386   YYUSE(llocp);
   39387   return 'x';
   39388 }
   39389 
   39390 int
   39391 main (void)
   39392 {
   39393   yy::parser p;
   39394   p.set_debug_level (!!getenv("YYDEBUG"));
   39395   return p.parse ();
   39396 }
   39397 _ATEOF
   39398 
   39399 
   39400 
   39401 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   39402   at_save_special_files
   39403   mkdir xml-tests
   39404     # Don't combine these Bison invocations since we want to be sure that
   39405   # --report=all isn't required to get the full XML file.
   39406   { set +x
   39407 $as_echo "$at_srcdir/actions.at:140: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   39408                   --graph=xml-tests/test.dot -o input.cc input.y"
   39409 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:140"
   39410 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   39411                   --graph=xml-tests/test.dot -o input.cc input.y
   39412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39413 at_status=$? at_failed=false
   39414 $at_check_filter
   39415 echo stderr:; cat "$at_stderr"
   39416 echo stdout:; cat "$at_stdout"
   39417 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39418 $at_failed && at_fn_log_failure
   39419 $at_traceon; }
   39420 
   39421   { set +x
   39422 $as_echo "$at_srcdir/actions.at:140: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   39423 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:140"
   39424 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   39425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39426 at_status=$? at_failed=false
   39427 $at_check_filter
   39428 echo stderr:; cat "$at_stderr"
   39429 echo stdout:; cat "$at_stdout"
   39430 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39431 $at_failed && at_fn_log_failure
   39432 $at_traceon; }
   39433 
   39434     cp xml-tests/test.output expout
   39435   { set +x
   39436 $as_echo "$at_srcdir/actions.at:140: \$XSLTPROC \\
   39437              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   39438              xml-tests/test.xml"
   39439 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:140"
   39440 ( $at_check_trace; $XSLTPROC \
   39441              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   39442              xml-tests/test.xml
   39443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39444 at_status=$? at_failed=false
   39445 $at_check_filter
   39446 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39447 $at_diff expout "$at_stdout" || at_failed=:
   39448 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39449 $at_failed && at_fn_log_failure
   39450 $at_traceon; }
   39451 
   39452   sort xml-tests/test.dot > expout
   39453   { set +x
   39454 $as_echo "$at_srcdir/actions.at:140: \$XSLTPROC \\
   39455              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   39456              xml-tests/test.xml | sort"
   39457 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:140"
   39458 ( $at_check_trace; $XSLTPROC \
   39459              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   39460              xml-tests/test.xml | sort
   39461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39462 at_status=$? at_failed=false
   39463 $at_check_filter
   39464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39465 $at_diff expout "$at_stdout" || at_failed=:
   39466 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39467 $at_failed && at_fn_log_failure
   39468 $at_traceon; }
   39469 
   39470   rm -rf xml-tests expout
   39471   at_restore_special_files
   39472 fi
   39473 { set +x
   39474 $as_echo "$at_srcdir/actions.at:140: bison -o input.cc input.y"
   39475 at_fn_check_prepare_trace "actions.at:140"
   39476 ( $at_check_trace; bison -o input.cc input.y
   39477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39478 at_status=$? at_failed=false
   39479 $at_check_filter
   39480 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39482 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39483 $at_failed && at_fn_log_failure
   39484 $at_traceon; }
   39485 
   39486 
   39487 
   39488 { set +x
   39489 $as_echo "$at_srcdir/actions.at:140: \$BISON_CXX_WORKS"
   39490 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:140"
   39491 ( $at_check_trace; $BISON_CXX_WORKS
   39492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39493 at_status=$? at_failed=false
   39494 $at_check_filter
   39495 echo stderr:; cat "$at_stderr"
   39496 echo stdout:; cat "$at_stdout"
   39497 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39498 $at_failed && at_fn_log_failure
   39499 $at_traceon; }
   39500 
   39501 { set +x
   39502 $as_echo "$at_srcdir/actions.at:140: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   39503 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:140"
   39504 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   39505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39506 at_status=$? at_failed=false
   39507 $at_check_filter
   39508 echo stderr:; cat "$at_stderr"
   39509 echo stdout:; cat "$at_stdout"
   39510 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39511 $at_failed && at_fn_log_failure
   39512 $at_traceon; }
   39513 
   39514 
   39515 { set +x
   39516 $as_echo "$at_srcdir/actions.at:140:  \$PREPARSER ./input"
   39517 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:140"
   39518 ( $at_check_trace;  $PREPARSER ./input
   39519 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39520 at_status=$? at_failed=false
   39521 $at_check_filter
   39522 echo stderr:; tee stderr <"$at_stderr"
   39523 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39524 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:140"
   39525 $at_failed && at_fn_log_failure
   39526 $at_traceon; }
   39527 
   39528 { set +x
   39529 $as_echo "$at_srcdir/actions.at:140: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   39530 at_fn_check_prepare_trace "actions.at:140"
   39531 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   39532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39533 at_status=$? at_failed=false
   39534 $at_check_filter
   39535 echo >>"$at_stderr"; $as_echo "1.1
   39536 1.1: syntax error
   39537 " | \
   39538   $at_diff - "$at_stderr" || at_failed=:
   39539 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39540 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:140"
   39541 $at_failed && at_fn_log_failure
   39542 $at_traceon; }
   39543 
   39544 
   39545 
   39546   set +x
   39547   $at_times_p && times >"$at_times_file"
   39548 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   39549 read at_status <"$at_status_file"
   39550 #AT_STOP_152
   39551 #AT_START_153
   39552 at_fn_group_banner 153 'actions.at:141' \
   39553   "Initial location: glr.cc " "                      " 9
   39554 at_xfail=no
   39555 (
   39556   $as_echo "153. $at_setup_line: testing $at_desc ..."
   39557   $at_traceon
   39558 
   39559 
   39560 
   39561 cat >input.y <<'_ATEOF'
   39562 %code top {
   39563 #include <config.h>
   39564 /* We don't need perfect functions for these tests. */
   39565 #undef malloc
   39566 #undef memcmp
   39567 #undef realloc
   39568 }
   39569 
   39570 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   39571 %locations
   39572 %debug
   39573 %skeleton "glr.cc"
   39574 
   39575 
   39576 %code
   39577 {
   39578 # include <stdio.h>
   39579 # include <stdlib.h> /* getenv */
   39580 
   39581 static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   39582 }
   39583 %%
   39584 exp: { std::cerr << @$ << std::endl; }
   39585 %%
   39586 /* A C++ error reporting function.  */
   39587 void
   39588 yy::parser::error (const location_type& l, const std::string& m)
   39589 {
   39590   (void) l;
   39591   std::cerr << l << ": " << m << std::endl;
   39592 }
   39593 
   39594 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   39595 {
   39596   YYUSE(lvalp);
   39597   YYUSE(llocp);
   39598   return 'x';
   39599 }
   39600 
   39601 int
   39602 main (void)
   39603 {
   39604   yy::parser p;
   39605   p.set_debug_level (!!getenv("YYDEBUG"));
   39606   return p.parse ();
   39607 }
   39608 _ATEOF
   39609 
   39610 
   39611 
   39612 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   39613   at_save_special_files
   39614   mkdir xml-tests
   39615     # Don't combine these Bison invocations since we want to be sure that
   39616   # --report=all isn't required to get the full XML file.
   39617   { set +x
   39618 $as_echo "$at_srcdir/actions.at:141: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   39619                   --graph=xml-tests/test.dot -o input.cc input.y"
   39620 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:141"
   39621 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   39622                   --graph=xml-tests/test.dot -o input.cc input.y
   39623 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39624 at_status=$? at_failed=false
   39625 $at_check_filter
   39626 echo stderr:; cat "$at_stderr"
   39627 echo stdout:; cat "$at_stdout"
   39628 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39629 $at_failed && at_fn_log_failure
   39630 $at_traceon; }
   39631 
   39632   { set +x
   39633 $as_echo "$at_srcdir/actions.at:141: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   39634 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:141"
   39635 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   39636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39637 at_status=$? at_failed=false
   39638 $at_check_filter
   39639 echo stderr:; cat "$at_stderr"
   39640 echo stdout:; cat "$at_stdout"
   39641 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39642 $at_failed && at_fn_log_failure
   39643 $at_traceon; }
   39644 
   39645     cp xml-tests/test.output expout
   39646   { set +x
   39647 $as_echo "$at_srcdir/actions.at:141: \$XSLTPROC \\
   39648              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   39649              xml-tests/test.xml"
   39650 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:141"
   39651 ( $at_check_trace; $XSLTPROC \
   39652              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   39653              xml-tests/test.xml
   39654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39655 at_status=$? at_failed=false
   39656 $at_check_filter
   39657 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39658 $at_diff expout "$at_stdout" || at_failed=:
   39659 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39660 $at_failed && at_fn_log_failure
   39661 $at_traceon; }
   39662 
   39663   sort xml-tests/test.dot > expout
   39664   { set +x
   39665 $as_echo "$at_srcdir/actions.at:141: \$XSLTPROC \\
   39666              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   39667              xml-tests/test.xml | sort"
   39668 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:141"
   39669 ( $at_check_trace; $XSLTPROC \
   39670              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   39671              xml-tests/test.xml | sort
   39672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39673 at_status=$? at_failed=false
   39674 $at_check_filter
   39675 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39676 $at_diff expout "$at_stdout" || at_failed=:
   39677 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39678 $at_failed && at_fn_log_failure
   39679 $at_traceon; }
   39680 
   39681   rm -rf xml-tests expout
   39682   at_restore_special_files
   39683 fi
   39684 { set +x
   39685 $as_echo "$at_srcdir/actions.at:141: bison -o input.cc input.y"
   39686 at_fn_check_prepare_trace "actions.at:141"
   39687 ( $at_check_trace; bison -o input.cc input.y
   39688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39689 at_status=$? at_failed=false
   39690 $at_check_filter
   39691 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39692 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39693 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39694 $at_failed && at_fn_log_failure
   39695 $at_traceon; }
   39696 
   39697 
   39698 
   39699 { set +x
   39700 $as_echo "$at_srcdir/actions.at:141: \$BISON_CXX_WORKS"
   39701 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:141"
   39702 ( $at_check_trace; $BISON_CXX_WORKS
   39703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39704 at_status=$? at_failed=false
   39705 $at_check_filter
   39706 echo stderr:; cat "$at_stderr"
   39707 echo stdout:; cat "$at_stdout"
   39708 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39709 $at_failed && at_fn_log_failure
   39710 $at_traceon; }
   39711 
   39712 { set +x
   39713 $as_echo "$at_srcdir/actions.at:141: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   39714 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:141"
   39715 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   39716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39717 at_status=$? at_failed=false
   39718 $at_check_filter
   39719 echo stderr:; cat "$at_stderr"
   39720 echo stdout:; cat "$at_stdout"
   39721 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39722 $at_failed && at_fn_log_failure
   39723 $at_traceon; }
   39724 
   39725 
   39726 { set +x
   39727 $as_echo "$at_srcdir/actions.at:141:  \$PREPARSER ./input"
   39728 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:141"
   39729 ( $at_check_trace;  $PREPARSER ./input
   39730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39731 at_status=$? at_failed=false
   39732 $at_check_filter
   39733 echo stderr:; tee stderr <"$at_stderr"
   39734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39735 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:141"
   39736 $at_failed && at_fn_log_failure
   39737 $at_traceon; }
   39738 
   39739 { set +x
   39740 $as_echo "$at_srcdir/actions.at:141: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   39741 at_fn_check_prepare_trace "actions.at:141"
   39742 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   39743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39744 at_status=$? at_failed=false
   39745 $at_check_filter
   39746 echo >>"$at_stderr"; $as_echo "1.1
   39747 1.1: syntax error
   39748 " | \
   39749   $at_diff - "$at_stderr" || at_failed=:
   39750 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39751 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:141"
   39752 $at_failed && at_fn_log_failure
   39753 $at_traceon; }
   39754 
   39755 
   39756 
   39757   set +x
   39758   $at_times_p && times >"$at_times_file"
   39759 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   39760 read at_status <"$at_status_file"
   39761 #AT_STOP_153
   39762 #AT_START_154
   39763 at_fn_group_banner 154 'actions.at:150' \
   39764   "Initial location: yacc.c %define api.pure full" " " 9
   39765 at_xfail=no
   39766 (
   39767   $as_echo "154. $at_setup_line: testing $at_desc ..."
   39768   $at_traceon
   39769 
   39770 
   39771 
   39772 cat >input.y <<'_ATEOF'
   39773 %code top {
   39774 #include <config.h>
   39775 /* We don't need perfect functions for these tests. */
   39776 #undef malloc
   39777 #undef memcmp
   39778 #undef realloc
   39779 }
   39780 
   39781 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   39782 %locations
   39783 %debug
   39784 %skeleton "yacc.c"
   39785 %define api.pure full
   39786 %{
   39787 # define YYLTYPE int
   39788 # define YY_LOCATION_PRINT(Stream, Loc)      \
   39789    (void) (Loc)
   39790 # define YYLLOC_DEFAULT(Current, Rhs, N)    \
   39791   (Current) = ((Rhs)[N ? 1 : 0])
   39792 %}
   39793 
   39794 %code
   39795 {
   39796 # include <stdio.h>
   39797 # include <stdlib.h> /* getenv */
   39798 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   39799 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   39800 }
   39801 %%
   39802 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   39803 %%
   39804 #include <stdio.h>
   39805 /* A C error reporting function.  */
   39806 static
   39807 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   39808 {
   39809   YY_LOCATION_PRINT (stderr, (*llocp));
   39810   fprintf (stderr, ": ");
   39811   fprintf (stderr, "%s\n", msg);
   39812 }
   39813 
   39814 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   39815 {
   39816   YYUSE(lvalp);
   39817   YYUSE(llocp);
   39818   return 'x';
   39819 }
   39820 
   39821 int
   39822 main (void)
   39823 {
   39824   yydebug = !!getenv("YYDEBUG");
   39825   return !!yyparse ();
   39826 }
   39827 _ATEOF
   39828 
   39829 
   39830 
   39831 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   39832   at_save_special_files
   39833   mkdir xml-tests
   39834     # Don't combine these Bison invocations since we want to be sure that
   39835   # --report=all isn't required to get the full XML file.
   39836   { set +x
   39837 $as_echo "$at_srcdir/actions.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   39838                   --graph=xml-tests/test.dot -o input.c input.y"
   39839 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:150"
   39840 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   39841                   --graph=xml-tests/test.dot -o input.c input.y
   39842 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39843 at_status=$? at_failed=false
   39844 $at_check_filter
   39845 echo stderr:; cat "$at_stderr"
   39846 echo stdout:; cat "$at_stdout"
   39847 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39848 $at_failed && at_fn_log_failure
   39849 $at_traceon; }
   39850 
   39851   { set +x
   39852 $as_echo "$at_srcdir/actions.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   39853 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:150"
   39854 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   39855 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39856 at_status=$? at_failed=false
   39857 $at_check_filter
   39858 echo stderr:; cat "$at_stderr"
   39859 echo stdout:; cat "$at_stdout"
   39860 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39861 $at_failed && at_fn_log_failure
   39862 $at_traceon; }
   39863 
   39864     cp xml-tests/test.output expout
   39865   { set +x
   39866 $as_echo "$at_srcdir/actions.at:150: \$XSLTPROC \\
   39867              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   39868              xml-tests/test.xml"
   39869 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:150"
   39870 ( $at_check_trace; $XSLTPROC \
   39871              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   39872              xml-tests/test.xml
   39873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39874 at_status=$? at_failed=false
   39875 $at_check_filter
   39876 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39877 $at_diff expout "$at_stdout" || at_failed=:
   39878 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39879 $at_failed && at_fn_log_failure
   39880 $at_traceon; }
   39881 
   39882   sort xml-tests/test.dot > expout
   39883   { set +x
   39884 $as_echo "$at_srcdir/actions.at:150: \$XSLTPROC \\
   39885              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   39886              xml-tests/test.xml | sort"
   39887 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:150"
   39888 ( $at_check_trace; $XSLTPROC \
   39889              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   39890              xml-tests/test.xml | sort
   39891 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39892 at_status=$? at_failed=false
   39893 $at_check_filter
   39894 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39895 $at_diff expout "$at_stdout" || at_failed=:
   39896 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39897 $at_failed && at_fn_log_failure
   39898 $at_traceon; }
   39899 
   39900   rm -rf xml-tests expout
   39901   at_restore_special_files
   39902 fi
   39903 { set +x
   39904 $as_echo "$at_srcdir/actions.at:150: bison -o input.c input.y"
   39905 at_fn_check_prepare_trace "actions.at:150"
   39906 ( $at_check_trace; bison -o input.c input.y
   39907 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39908 at_status=$? at_failed=false
   39909 $at_check_filter
   39910 at_fn_diff_devnull "$at_stderr" || at_failed=:
   39911 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39912 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39913 $at_failed && at_fn_log_failure
   39914 $at_traceon; }
   39915 
   39916 
   39917    { set +x
   39918 $as_echo "$at_srcdir/actions.at:150: \$BISON_C_WORKS"
   39919 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:150"
   39920 ( $at_check_trace; $BISON_C_WORKS
   39921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39922 at_status=$? at_failed=false
   39923 $at_check_filter
   39924 echo stderr:; cat "$at_stderr"
   39925 echo stdout:; cat "$at_stdout"
   39926 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39927 $at_failed && at_fn_log_failure
   39928 $at_traceon; }
   39929 
   39930 { set +x
   39931 $as_echo "$at_srcdir/actions.at:150: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   39932 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:150"
   39933 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   39934 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39935 at_status=$? at_failed=false
   39936 $at_check_filter
   39937 echo stderr:; cat "$at_stderr"
   39938 echo stdout:; cat "$at_stdout"
   39939 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39940 $at_failed && at_fn_log_failure
   39941 $at_traceon; }
   39942 
   39943 
   39944 { set +x
   39945 $as_echo "$at_srcdir/actions.at:150:  \$PREPARSER ./input"
   39946 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:150"
   39947 ( $at_check_trace;  $PREPARSER ./input
   39948 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39949 at_status=$? at_failed=false
   39950 $at_check_filter
   39951 echo stderr:; tee stderr <"$at_stderr"
   39952 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39953 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:150"
   39954 $at_failed && at_fn_log_failure
   39955 $at_traceon; }
   39956 
   39957 { set +x
   39958 $as_echo "$at_srcdir/actions.at:150: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   39959 at_fn_check_prepare_trace "actions.at:150"
   39960 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   39961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   39962 at_status=$? at_failed=false
   39963 $at_check_filter
   39964 echo >>"$at_stderr"; $as_echo "
   39965 : syntax error
   39966 " | \
   39967   $at_diff - "$at_stderr" || at_failed=:
   39968 at_fn_diff_devnull "$at_stdout" || at_failed=:
   39969 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:150"
   39970 $at_failed && at_fn_log_failure
   39971 $at_traceon; }
   39972 
   39973 
   39974 
   39975   set +x
   39976   $at_times_p && times >"$at_times_file"
   39977 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   39978 read at_status <"$at_status_file"
   39979 #AT_STOP_154
   39980 #AT_START_155
   39981 at_fn_group_banner 155 'actions.at:161' \
   39982   "Initial location: yacc.c %define api.pure full" " " 9
   39983 at_xfail=no
   39984 (
   39985   $as_echo "155. $at_setup_line: testing $at_desc ..."
   39986   $at_traceon
   39987 
   39988 
   39989 
   39990 cat >input.y <<'_ATEOF'
   39991 %code top {
   39992 #include <config.h>
   39993 /* We don't need perfect functions for these tests. */
   39994 #undef malloc
   39995 #undef memcmp
   39996 #undef realloc
   39997 }
   39998 
   39999 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   40000 %locations
   40001 %debug
   40002 %skeleton "yacc.c"
   40003 %define api.pure full
   40004 %{
   40005 # define YYLTYPE int
   40006 # define YY_LOCATION_PRINT(Stream, Loc)      \
   40007     fprintf ((Stream), "%d", (Loc))
   40008 # define YYLLOC_DEFAULT(Current, Rhs, N)    \
   40009   (Current) = ((Rhs)[N ? 1 : 0])
   40010 %}
   40011 
   40012 %code
   40013 {
   40014 # include <stdio.h>
   40015 # include <stdlib.h> /* getenv */
   40016 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   40017 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   40018 }
   40019 %%
   40020 exp: { YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
   40021 %%
   40022 #include <stdio.h>
   40023 /* A C error reporting function.  */
   40024 static
   40025 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   40026 {
   40027   YY_LOCATION_PRINT (stderr, (*llocp));
   40028   fprintf (stderr, ": ");
   40029   fprintf (stderr, "%s\n", msg);
   40030 }
   40031 
   40032 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   40033 {
   40034   YYUSE(lvalp);
   40035   YYUSE(llocp);
   40036   return 'x';
   40037 }
   40038 
   40039 int
   40040 main (void)
   40041 {
   40042   yydebug = !!getenv("YYDEBUG");
   40043   return !!yyparse ();
   40044 }
   40045 _ATEOF
   40046 
   40047 
   40048 
   40049 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   40050   at_save_special_files
   40051   mkdir xml-tests
   40052     # Don't combine these Bison invocations since we want to be sure that
   40053   # --report=all isn't required to get the full XML file.
   40054   { set +x
   40055 $as_echo "$at_srcdir/actions.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   40056                   --graph=xml-tests/test.dot -o input.c input.y"
   40057 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:161"
   40058 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   40059                   --graph=xml-tests/test.dot -o input.c input.y
   40060 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40061 at_status=$? at_failed=false
   40062 $at_check_filter
   40063 echo stderr:; cat "$at_stderr"
   40064 echo stdout:; cat "$at_stdout"
   40065 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40066 $at_failed && at_fn_log_failure
   40067 $at_traceon; }
   40068 
   40069   { set +x
   40070 $as_echo "$at_srcdir/actions.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   40071 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:161"
   40072 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   40073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40074 at_status=$? at_failed=false
   40075 $at_check_filter
   40076 echo stderr:; cat "$at_stderr"
   40077 echo stdout:; cat "$at_stdout"
   40078 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40079 $at_failed && at_fn_log_failure
   40080 $at_traceon; }
   40081 
   40082     cp xml-tests/test.output expout
   40083   { set +x
   40084 $as_echo "$at_srcdir/actions.at:161: \$XSLTPROC \\
   40085              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   40086              xml-tests/test.xml"
   40087 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:161"
   40088 ( $at_check_trace; $XSLTPROC \
   40089              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   40090              xml-tests/test.xml
   40091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40092 at_status=$? at_failed=false
   40093 $at_check_filter
   40094 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40095 $at_diff expout "$at_stdout" || at_failed=:
   40096 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40097 $at_failed && at_fn_log_failure
   40098 $at_traceon; }
   40099 
   40100   sort xml-tests/test.dot > expout
   40101   { set +x
   40102 $as_echo "$at_srcdir/actions.at:161: \$XSLTPROC \\
   40103              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   40104              xml-tests/test.xml | sort"
   40105 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:161"
   40106 ( $at_check_trace; $XSLTPROC \
   40107              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   40108              xml-tests/test.xml | sort
   40109 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40110 at_status=$? at_failed=false
   40111 $at_check_filter
   40112 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40113 $at_diff expout "$at_stdout" || at_failed=:
   40114 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40115 $at_failed && at_fn_log_failure
   40116 $at_traceon; }
   40117 
   40118   rm -rf xml-tests expout
   40119   at_restore_special_files
   40120 fi
   40121 { set +x
   40122 $as_echo "$at_srcdir/actions.at:161: bison -o input.c input.y"
   40123 at_fn_check_prepare_trace "actions.at:161"
   40124 ( $at_check_trace; bison -o input.c input.y
   40125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40126 at_status=$? at_failed=false
   40127 $at_check_filter
   40128 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40129 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40130 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40131 $at_failed && at_fn_log_failure
   40132 $at_traceon; }
   40133 
   40134 
   40135    { set +x
   40136 $as_echo "$at_srcdir/actions.at:161: \$BISON_C_WORKS"
   40137 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:161"
   40138 ( $at_check_trace; $BISON_C_WORKS
   40139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40140 at_status=$? at_failed=false
   40141 $at_check_filter
   40142 echo stderr:; cat "$at_stderr"
   40143 echo stdout:; cat "$at_stdout"
   40144 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40145 $at_failed && at_fn_log_failure
   40146 $at_traceon; }
   40147 
   40148 { set +x
   40149 $as_echo "$at_srcdir/actions.at:161: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   40150 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:161"
   40151 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   40152 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40153 at_status=$? at_failed=false
   40154 $at_check_filter
   40155 echo stderr:; cat "$at_stderr"
   40156 echo stdout:; cat "$at_stdout"
   40157 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40158 $at_failed && at_fn_log_failure
   40159 $at_traceon; }
   40160 
   40161 
   40162 { set +x
   40163 $as_echo "$at_srcdir/actions.at:161:  \$PREPARSER ./input"
   40164 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:161"
   40165 ( $at_check_trace;  $PREPARSER ./input
   40166 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40167 at_status=$? at_failed=false
   40168 $at_check_filter
   40169 echo stderr:; tee stderr <"$at_stderr"
   40170 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40171 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:161"
   40172 $at_failed && at_fn_log_failure
   40173 $at_traceon; }
   40174 
   40175 { set +x
   40176 $as_echo "$at_srcdir/actions.at:161: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   40177 at_fn_check_prepare_trace "actions.at:161"
   40178 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   40179 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40180 at_status=$? at_failed=false
   40181 $at_check_filter
   40182 echo >>"$at_stderr"; $as_echo "0
   40183 0: syntax error
   40184 " | \
   40185   $at_diff - "$at_stderr" || at_failed=:
   40186 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40187 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
   40188 $at_failed && at_fn_log_failure
   40189 $at_traceon; }
   40190 
   40191 
   40192 
   40193   set +x
   40194   $at_times_p && times >"$at_times_file"
   40195 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   40196 read at_status <"$at_status_file"
   40197 #AT_STOP_155
   40198 #AT_START_156
   40199 at_fn_group_banner 156 'actions.at:244' \
   40200   "Location print: yacc.c " "                        " 9
   40201 at_xfail=no
   40202 (
   40203   $as_echo "156. $at_setup_line: testing $at_desc ..."
   40204   $at_traceon
   40205 
   40206 
   40207 
   40208 cat >input.y <<'_ATEOF'
   40209 %code top {
   40210 #include <config.h>
   40211 /* We don't need perfect functions for these tests. */
   40212 #undef malloc
   40213 #undef memcmp
   40214 #undef realloc
   40215 }
   40216 
   40217 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   40218 %locations
   40219 %debug
   40220 %skeleton "yacc.c"
   40221 
   40222 
   40223 %code
   40224 {
   40225 # include <stdio.h>
   40226 # include <stdlib.h> /* getenv */
   40227 static void yyerror ( const char *msg);
   40228 static int yylex (void);
   40229 }
   40230 %%
   40231 exp:;
   40232 %%
   40233 #include <stdio.h>
   40234 /* A C error reporting function.  */
   40235 static
   40236 void yyerror ( const char *msg)
   40237 {
   40238   YY_LOCATION_PRINT (stderr, (yylloc));
   40239   fprintf (stderr, ": ");
   40240   fprintf (stderr, "%s\n", msg);
   40241 }
   40242 #include <assert.h>
   40243 static
   40244 int yylex (void)
   40245 {
   40246   static char const input[] = "";
   40247   static size_t toknum = 0;
   40248   int res;
   40249   ;
   40250   assert (toknum < sizeof input / sizeof input[0]);
   40251   res = input[toknum++];
   40252   ;
   40253   (yylloc).first_line = (yylloc).last_line = 1;
   40254   (yylloc).first_column = (yylloc).last_column = toknum;
   40255   return res;
   40256 }
   40257 
   40258 int
   40259 main (void)
   40260 {
   40261 #define TEST(L1, C1, L2, C2)          \
   40262   (yylloc).first_line = L1;           \
   40263   (yylloc).first_column = C1;         \
   40264   (yylloc).last_line = L2;            \
   40265   (yylloc).last_column = C2;          \
   40266   YY_LOCATION_PRINT(stdout, (yylloc));\
   40267   putchar ('\n');
   40268 
   40269   TEST(1, 1, 1, 1);
   40270   TEST(2, 1, 2, 10);
   40271   TEST(3, 1, 4, 1);
   40272   TEST(5, 1, 6, 10);
   40273 
   40274   TEST(7, 2, 0, 2);
   40275   TEST(8, 0, 8, 0);
   40276   return 0;
   40277 }
   40278 _ATEOF
   40279 
   40280 
   40281 
   40282 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   40283   at_save_special_files
   40284   mkdir xml-tests
   40285     # Don't combine these Bison invocations since we want to be sure that
   40286   # --report=all isn't required to get the full XML file.
   40287   { set +x
   40288 $as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   40289                   --graph=xml-tests/test.dot -o input.c input.y"
   40290 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:244"
   40291 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   40292                   --graph=xml-tests/test.dot -o input.c input.y
   40293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40294 at_status=$? at_failed=false
   40295 $at_check_filter
   40296 echo stderr:; cat "$at_stderr"
   40297 echo stdout:; cat "$at_stdout"
   40298 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40299 $at_failed && at_fn_log_failure
   40300 $at_traceon; }
   40301 
   40302   { set +x
   40303 $as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   40304 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:244"
   40305 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   40306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40307 at_status=$? at_failed=false
   40308 $at_check_filter
   40309 echo stderr:; cat "$at_stderr"
   40310 echo stdout:; cat "$at_stdout"
   40311 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40312 $at_failed && at_fn_log_failure
   40313 $at_traceon; }
   40314 
   40315     cp xml-tests/test.output expout
   40316   { set +x
   40317 $as_echo "$at_srcdir/actions.at:244: \$XSLTPROC \\
   40318              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   40319              xml-tests/test.xml"
   40320 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:244"
   40321 ( $at_check_trace; $XSLTPROC \
   40322              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   40323              xml-tests/test.xml
   40324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40325 at_status=$? at_failed=false
   40326 $at_check_filter
   40327 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40328 $at_diff expout "$at_stdout" || at_failed=:
   40329 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40330 $at_failed && at_fn_log_failure
   40331 $at_traceon; }
   40332 
   40333   sort xml-tests/test.dot > expout
   40334   { set +x
   40335 $as_echo "$at_srcdir/actions.at:244: \$XSLTPROC \\
   40336              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   40337              xml-tests/test.xml | sort"
   40338 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:244"
   40339 ( $at_check_trace; $XSLTPROC \
   40340              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   40341              xml-tests/test.xml | sort
   40342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40343 at_status=$? at_failed=false
   40344 $at_check_filter
   40345 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40346 $at_diff expout "$at_stdout" || at_failed=:
   40347 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40348 $at_failed && at_fn_log_failure
   40349 $at_traceon; }
   40350 
   40351   rm -rf xml-tests expout
   40352   at_restore_special_files
   40353 fi
   40354 { set +x
   40355 $as_echo "$at_srcdir/actions.at:244: bison -o input.c input.y"
   40356 at_fn_check_prepare_trace "actions.at:244"
   40357 ( $at_check_trace; bison -o input.c input.y
   40358 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40359 at_status=$? at_failed=false
   40360 $at_check_filter
   40361 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40362 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40363 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40364 $at_failed && at_fn_log_failure
   40365 $at_traceon; }
   40366 
   40367 
   40368    { set +x
   40369 $as_echo "$at_srcdir/actions.at:244: \$BISON_C_WORKS"
   40370 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:244"
   40371 ( $at_check_trace; $BISON_C_WORKS
   40372 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40373 at_status=$? at_failed=false
   40374 $at_check_filter
   40375 echo stderr:; cat "$at_stderr"
   40376 echo stdout:; cat "$at_stdout"
   40377 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40378 $at_failed && at_fn_log_failure
   40379 $at_traceon; }
   40380 
   40381 { set +x
   40382 $as_echo "$at_srcdir/actions.at:244: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   40383 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:244"
   40384 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   40385 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40386 at_status=$? at_failed=false
   40387 $at_check_filter
   40388 echo stderr:; cat "$at_stderr"
   40389 echo stdout:; cat "$at_stdout"
   40390 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40391 $at_failed && at_fn_log_failure
   40392 $at_traceon; }
   40393 
   40394 
   40395 { set +x
   40396 $as_echo "$at_srcdir/actions.at:244:  \$PREPARSER ./input"
   40397 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:244"
   40398 ( $at_check_trace;  $PREPARSER ./input
   40399 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40400 at_status=$? at_failed=false
   40401 $at_check_filter
   40402 echo stderr:; tee stderr <"$at_stderr"
   40403 echo >>"$at_stdout"; $as_echo "1.1
   40404 2.1-9
   40405 3.1-4.0
   40406 5.1-6.9
   40407 7.2
   40408 8.0
   40409 " | \
   40410   $at_diff - "$at_stdout" || at_failed=:
   40411 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40412 $at_failed && at_fn_log_failure
   40413 $at_traceon; }
   40414 
   40415 { set +x
   40416 $as_echo "$at_srcdir/actions.at:244: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   40417 at_fn_check_prepare_trace "actions.at:244"
   40418 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   40419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40420 at_status=$? at_failed=false
   40421 $at_check_filter
   40422 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40423 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40424 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244"
   40425 $at_failed && at_fn_log_failure
   40426 $at_traceon; }
   40427 
   40428 
   40429 
   40430   set +x
   40431   $at_times_p && times >"$at_times_file"
   40432 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   40433 read at_status <"$at_status_file"
   40434 #AT_STOP_156
   40435 #AT_START_157
   40436 at_fn_group_banner 157 'actions.at:245' \
   40437   "Location print: glr.c " "                         " 9
   40438 at_xfail=no
   40439 (
   40440   $as_echo "157. $at_setup_line: testing $at_desc ..."
   40441   $at_traceon
   40442 
   40443 
   40444 
   40445 cat >input.y <<'_ATEOF'
   40446 %code top {
   40447 #include <config.h>
   40448 /* We don't need perfect functions for these tests. */
   40449 #undef malloc
   40450 #undef memcmp
   40451 #undef realloc
   40452 }
   40453 
   40454 %defines /* FIXME: Required by lalr1.cc in Bison 2.6. */
   40455 %locations
   40456 %debug
   40457 %skeleton "glr.c"
   40458 
   40459 
   40460 %code
   40461 {
   40462 # include <stdio.h>
   40463 # include <stdlib.h> /* getenv */
   40464 static void yyerror ( const char *msg);
   40465 static int yylex (void);
   40466 }
   40467 %%
   40468 exp:;
   40469 %%
   40470 #include <stdio.h>
   40471 /* A C error reporting function.  */
   40472 static
   40473 void yyerror ( const char *msg)
   40474 {
   40475   YY_LOCATION_PRINT (stderr, (yylloc));
   40476   fprintf (stderr, ": ");
   40477   fprintf (stderr, "%s\n", msg);
   40478 }
   40479 #include <assert.h>
   40480 static
   40481 int yylex (void)
   40482 {
   40483   static char const input[] = "";
   40484   static size_t toknum = 0;
   40485   int res;
   40486   ;
   40487   assert (toknum < sizeof input / sizeof input[0]);
   40488   res = input[toknum++];
   40489   ;
   40490   (yylloc).first_line = (yylloc).last_line = 1;
   40491   (yylloc).first_column = (yylloc).last_column = toknum;
   40492   return res;
   40493 }
   40494 
   40495 int
   40496 main (void)
   40497 {
   40498 #define TEST(L1, C1, L2, C2)          \
   40499   (yylloc).first_line = L1;           \
   40500   (yylloc).first_column = C1;         \
   40501   (yylloc).last_line = L2;            \
   40502   (yylloc).last_column = C2;          \
   40503   YY_LOCATION_PRINT(stdout, (yylloc));\
   40504   putchar ('\n');
   40505 
   40506   TEST(1, 1, 1, 1);
   40507   TEST(2, 1, 2, 10);
   40508   TEST(3, 1, 4, 1);
   40509   TEST(5, 1, 6, 10);
   40510 
   40511   TEST(7, 2, 0, 2);
   40512   TEST(8, 0, 8, 0);
   40513   return 0;
   40514 }
   40515 _ATEOF
   40516 
   40517 
   40518 
   40519 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   40520   at_save_special_files
   40521   mkdir xml-tests
   40522     # Don't combine these Bison invocations since we want to be sure that
   40523   # --report=all isn't required to get the full XML file.
   40524   { set +x
   40525 $as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   40526                   --graph=xml-tests/test.dot -o input.c input.y"
   40527 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:245"
   40528 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   40529                   --graph=xml-tests/test.dot -o input.c input.y
   40530 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40531 at_status=$? at_failed=false
   40532 $at_check_filter
   40533 echo stderr:; cat "$at_stderr"
   40534 echo stdout:; cat "$at_stdout"
   40535 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40536 $at_failed && at_fn_log_failure
   40537 $at_traceon; }
   40538 
   40539   { set +x
   40540 $as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   40541 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:245"
   40542 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   40543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40544 at_status=$? at_failed=false
   40545 $at_check_filter
   40546 echo stderr:; cat "$at_stderr"
   40547 echo stdout:; cat "$at_stdout"
   40548 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40549 $at_failed && at_fn_log_failure
   40550 $at_traceon; }
   40551 
   40552     cp xml-tests/test.output expout
   40553   { set +x
   40554 $as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\
   40555              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   40556              xml-tests/test.xml"
   40557 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245"
   40558 ( $at_check_trace; $XSLTPROC \
   40559              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   40560              xml-tests/test.xml
   40561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40562 at_status=$? at_failed=false
   40563 $at_check_filter
   40564 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40565 $at_diff expout "$at_stdout" || at_failed=:
   40566 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40567 $at_failed && at_fn_log_failure
   40568 $at_traceon; }
   40569 
   40570   sort xml-tests/test.dot > expout
   40571   { set +x
   40572 $as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\
   40573              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   40574              xml-tests/test.xml | sort"
   40575 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245"
   40576 ( $at_check_trace; $XSLTPROC \
   40577              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   40578              xml-tests/test.xml | sort
   40579 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40580 at_status=$? at_failed=false
   40581 $at_check_filter
   40582 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40583 $at_diff expout "$at_stdout" || at_failed=:
   40584 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40585 $at_failed && at_fn_log_failure
   40586 $at_traceon; }
   40587 
   40588   rm -rf xml-tests expout
   40589   at_restore_special_files
   40590 fi
   40591 { set +x
   40592 $as_echo "$at_srcdir/actions.at:245: bison -o input.c input.y"
   40593 at_fn_check_prepare_trace "actions.at:245"
   40594 ( $at_check_trace; bison -o input.c input.y
   40595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40596 at_status=$? at_failed=false
   40597 $at_check_filter
   40598 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40599 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40600 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40601 $at_failed && at_fn_log_failure
   40602 $at_traceon; }
   40603 
   40604 
   40605    { set +x
   40606 $as_echo "$at_srcdir/actions.at:245: \$BISON_C_WORKS"
   40607 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:245"
   40608 ( $at_check_trace; $BISON_C_WORKS
   40609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40610 at_status=$? at_failed=false
   40611 $at_check_filter
   40612 echo stderr:; cat "$at_stderr"
   40613 echo stdout:; cat "$at_stdout"
   40614 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40615 $at_failed && at_fn_log_failure
   40616 $at_traceon; }
   40617 
   40618 { set +x
   40619 $as_echo "$at_srcdir/actions.at:245: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   40620 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:245"
   40621 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   40622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40623 at_status=$? at_failed=false
   40624 $at_check_filter
   40625 echo stderr:; cat "$at_stderr"
   40626 echo stdout:; cat "$at_stdout"
   40627 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40628 $at_failed && at_fn_log_failure
   40629 $at_traceon; }
   40630 
   40631 
   40632 { set +x
   40633 $as_echo "$at_srcdir/actions.at:245:  \$PREPARSER ./input"
   40634 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:245"
   40635 ( $at_check_trace;  $PREPARSER ./input
   40636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40637 at_status=$? at_failed=false
   40638 $at_check_filter
   40639 echo stderr:; tee stderr <"$at_stderr"
   40640 echo >>"$at_stdout"; $as_echo "1.1
   40641 2.1-9
   40642 3.1-4.0
   40643 5.1-6.9
   40644 7.2
   40645 8.0
   40646 " | \
   40647   $at_diff - "$at_stdout" || at_failed=:
   40648 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40649 $at_failed && at_fn_log_failure
   40650 $at_traceon; }
   40651 
   40652 { set +x
   40653 $as_echo "$at_srcdir/actions.at:245: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   40654 at_fn_check_prepare_trace "actions.at:245"
   40655 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   40656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40657 at_status=$? at_failed=false
   40658 $at_check_filter
   40659 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40660 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40661 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245"
   40662 $at_failed && at_fn_log_failure
   40663 $at_traceon; }
   40664 
   40665 
   40666 
   40667   set +x
   40668   $at_times_p && times >"$at_times_file"
   40669 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   40670 read at_status <"$at_status_file"
   40671 #AT_STOP_157
   40672 #AT_START_158
   40673 at_fn_group_banner 158 'actions.at:257' \
   40674   "Exotic Dollars" "                                 " 9
   40675 at_xfail=no
   40676 (
   40677   $as_echo "158. $at_setup_line: testing $at_desc ..."
   40678   $at_traceon
   40679 
   40680 
   40681 
   40682 cat >input.y <<'_ATEOF'
   40683 %code top {
   40684 #include <config.h>
   40685 /* We don't need perfect functions for these tests. */
   40686 #undef malloc
   40687 #undef memcmp
   40688 #undef realloc
   40689 }
   40690 
   40691 %error-verbose
   40692 %debug
   40693 %{
   40694 static void yyerror ( const char *msg);
   40695 static int yylex (void);
   40696 # define USE(Var)
   40697 %}
   40698 
   40699 %union
   40700 {
   40701   int val;
   40702 };
   40703 
   40704 %type <val> a_1 a_2 a_5
   40705             sum_of_the_five_previous_values
   40706 
   40707 %%
   40708 exp: a_1 a_2 { $<val>$ = 3; } { $<val>$ = $<val>3 + 1; } a_5
   40709      sum_of_the_five_previous_values
   40710     {
   40711        USE (($1, $2, $<foo>3, $<foo>4, $5));
   40712        printf ("%d\n", $6);
   40713     }
   40714 ;
   40715 a_1: { $$ = 1; };
   40716 a_2: { $$ = 2; };
   40717 a_5: { $$ = 5; };
   40718 
   40719 sum_of_the_five_previous_values:
   40720     {
   40721        $$ = $<val>0 + $<val>-1 + $<val>-2 + $<val>-3 + $<val>-4;
   40722     }
   40723 ;
   40724 
   40725 %%
   40726 #include <stdio.h>
   40727 /* A C error reporting function.  */
   40728 static
   40729 void yyerror ( const char *msg)
   40730 {
   40731   fprintf (stderr, "%s\n", msg);
   40732 }
   40733 #include <assert.h>
   40734 static
   40735 int yylex (void)
   40736 {
   40737   static char const input[] = "";
   40738   static size_t toknum = 0;
   40739   int res;
   40740   ;
   40741   assert (toknum < sizeof input / sizeof input[0]);
   40742   res = input[toknum++];
   40743   ;
   40744   return res;
   40745 }
   40746 int
   40747 main (void)
   40748 {
   40749   return yyparse ();
   40750 }
   40751 _ATEOF
   40752 
   40753 
   40754 
   40755 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   40756   at_save_special_files
   40757   mkdir xml-tests
   40758     # Don't combine these Bison invocations since we want to be sure that
   40759   # --report=all isn't required to get the full XML file.
   40760   { set +x
   40761 $as_echo "$at_srcdir/actions.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   40762                   --graph=xml-tests/test.dot -d -v -o input.c input.y"
   40763 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:305"
   40764 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   40765                   --graph=xml-tests/test.dot -d -v -o input.c input.y
   40766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40767 at_status=$? at_failed=false
   40768 $at_check_filter
   40769 echo stderr:; cat "$at_stderr"
   40770 echo stdout:; cat "$at_stdout"
   40771 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305"
   40772 $at_failed && at_fn_log_failure
   40773 $at_traceon; }
   40774 
   40775   { set +x
   40776 $as_echo "$at_srcdir/actions.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y"
   40777 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:305"
   40778 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -d -v -o input.c input.y
   40779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40780 at_status=$? at_failed=false
   40781 $at_check_filter
   40782 echo stderr:; cat "$at_stderr"
   40783 echo stdout:; cat "$at_stdout"
   40784 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305"
   40785 $at_failed && at_fn_log_failure
   40786 $at_traceon; }
   40787 
   40788     cp xml-tests/test.output expout
   40789   { set +x
   40790 $as_echo "$at_srcdir/actions.at:305: \$XSLTPROC \\
   40791              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   40792              xml-tests/test.xml"
   40793 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:305"
   40794 ( $at_check_trace; $XSLTPROC \
   40795              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   40796              xml-tests/test.xml
   40797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40798 at_status=$? at_failed=false
   40799 $at_check_filter
   40800 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40801 $at_diff expout "$at_stdout" || at_failed=:
   40802 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305"
   40803 $at_failed && at_fn_log_failure
   40804 $at_traceon; }
   40805 
   40806   sort xml-tests/test.dot > expout
   40807   { set +x
   40808 $as_echo "$at_srcdir/actions.at:305: \$XSLTPROC \\
   40809              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   40810              xml-tests/test.xml | sort"
   40811 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:305"
   40812 ( $at_check_trace; $XSLTPROC \
   40813              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   40814              xml-tests/test.xml | sort
   40815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40816 at_status=$? at_failed=false
   40817 $at_check_filter
   40818 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40819 $at_diff expout "$at_stdout" || at_failed=:
   40820 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305"
   40821 $at_failed && at_fn_log_failure
   40822 $at_traceon; }
   40823 
   40824   rm -rf xml-tests expout
   40825   at_restore_special_files
   40826 fi
   40827 { set +x
   40828 $as_echo "$at_srcdir/actions.at:305: bison -d -v -o input.c input.y"
   40829 at_fn_check_prepare_trace "actions.at:305"
   40830 ( $at_check_trace; bison -d -v -o input.c input.y
   40831 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40832 at_status=$? at_failed=false
   40833 $at_check_filter
   40834 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40835 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40836 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:305"
   40837 $at_failed && at_fn_log_failure
   40838 $at_traceon; }
   40839 
   40840 
   40841 { set +x
   40842 $as_echo "$at_srcdir/actions.at:306: \$BISON_C_WORKS"
   40843 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:306"
   40844 ( $at_check_trace; $BISON_C_WORKS
   40845 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40846 at_status=$? at_failed=false
   40847 $at_check_filter
   40848 echo stderr:; cat "$at_stderr"
   40849 echo stdout:; cat "$at_stdout"
   40850 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:306"
   40851 $at_failed && at_fn_log_failure
   40852 $at_traceon; }
   40853 
   40854 { set +x
   40855 $as_echo "$at_srcdir/actions.at:306: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   40856 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:306"
   40857 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   40858 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40859 at_status=$? at_failed=false
   40860 $at_check_filter
   40861 echo stderr:; cat "$at_stderr"
   40862 echo stdout:; cat "$at_stdout"
   40863 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:306"
   40864 $at_failed && at_fn_log_failure
   40865 $at_traceon; }
   40866 
   40867 { set +x
   40868 $as_echo "$at_srcdir/actions.at:307:  \$PREPARSER ./input"
   40869 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:307"
   40870 ( $at_check_trace;  $PREPARSER ./input
   40871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40872 at_status=$? at_failed=false
   40873 $at_check_filter
   40874 echo stderr:; tee stderr <"$at_stderr"
   40875 echo >>"$at_stdout"; $as_echo "15
   40876 " | \
   40877   $at_diff - "$at_stdout" || at_failed=:
   40878 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:307"
   40879 $at_failed && at_fn_log_failure
   40880 $at_traceon; }
   40881 
   40882 { set +x
   40883 $as_echo "$at_srcdir/actions.at:307: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   40884 at_fn_check_prepare_trace "actions.at:307"
   40885 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   40886 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40887 at_status=$? at_failed=false
   40888 $at_check_filter
   40889 at_fn_diff_devnull "$at_stderr" || at_failed=:
   40890 at_fn_diff_devnull "$at_stdout" || at_failed=:
   40891 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:307"
   40892 $at_failed && at_fn_log_failure
   40893 $at_traceon; }
   40894 
   40895 
   40896 
   40897 # Make sure that fields after $n or $-n are parsed correctly.  At one
   40898 # point while implementing dashes in symbol names, we were dropping
   40899 # fields after $-n.
   40900 cat >input.y <<'_ATEOF'
   40901 %code top {
   40902 #include <config.h>
   40903 /* We don't need perfect functions for these tests. */
   40904 #undef malloc
   40905 #undef memcmp
   40906 #undef realloc
   40907 }
   40908 
   40909 
   40910 %{
   40911 #include <stdio.h>
   40912 static void yyerror ( const char *msg);
   40913 static int yylex (void);
   40914   typedef struct { int val; } stype;
   40915 # define YYSTYPE stype
   40916 %}
   40917 
   40918 %%
   40919 start: one two { $$.val = $1.val + $2.val; } sum ;
   40920 one: { $$.val = 1; } ;
   40921 two: { $$.val = 2; } ;
   40922 sum: { printf ("%d\n", $0.val + $-1.val + $-2.val); } ;
   40923 
   40924 %%
   40925 #include <stdio.h>
   40926 /* A C error reporting function.  */
   40927 static
   40928 void yyerror ( const char *msg)
   40929 {
   40930   fprintf (stderr, "%s\n", msg);
   40931 }
   40932 #include <assert.h>
   40933 static
   40934 int yylex (void)
   40935 {
   40936   static char const input[] = "";
   40937   static size_t toknum = 0;
   40938   int res;
   40939   ;
   40940   assert (toknum < sizeof input / sizeof input[0]);
   40941   res = input[toknum++];
   40942   ;
   40943   return res;
   40944 }
   40945 int
   40946 main (void)
   40947 {
   40948   return yyparse ();
   40949 }
   40950 _ATEOF
   40951 
   40952 
   40953 
   40954 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   40955   at_save_special_files
   40956   mkdir xml-tests
   40957     # Don't combine these Bison invocations since we want to be sure that
   40958   # --report=all isn't required to get the full XML file.
   40959   { set +x
   40960 $as_echo "$at_srcdir/actions.at:340: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   40961                   --graph=xml-tests/test.dot -o input.c input.y"
   40962 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:340"
   40963 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   40964                   --graph=xml-tests/test.dot -o input.c input.y
   40965 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40966 at_status=$? at_failed=false
   40967 $at_check_filter
   40968 echo stderr:; cat "$at_stderr"
   40969 echo stdout:; cat "$at_stdout"
   40970 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   40971 $at_failed && at_fn_log_failure
   40972 $at_traceon; }
   40973 
   40974   { set +x
   40975 $as_echo "$at_srcdir/actions.at:340: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   40976 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:340"
   40977 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   40978 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40979 at_status=$? at_failed=false
   40980 $at_check_filter
   40981 echo stderr:; cat "$at_stderr"
   40982 echo stdout:; cat "$at_stdout"
   40983 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   40984 $at_failed && at_fn_log_failure
   40985 $at_traceon; }
   40986 
   40987     cp xml-tests/test.output expout
   40988   { set +x
   40989 $as_echo "$at_srcdir/actions.at:340: \$XSLTPROC \\
   40990              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   40991              xml-tests/test.xml"
   40992 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:340"
   40993 ( $at_check_trace; $XSLTPROC \
   40994              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   40995              xml-tests/test.xml
   40996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   40997 at_status=$? at_failed=false
   40998 $at_check_filter
   40999 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41000 $at_diff expout "$at_stdout" || at_failed=:
   41001 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   41002 $at_failed && at_fn_log_failure
   41003 $at_traceon; }
   41004 
   41005   sort xml-tests/test.dot > expout
   41006   { set +x
   41007 $as_echo "$at_srcdir/actions.at:340: \$XSLTPROC \\
   41008              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   41009              xml-tests/test.xml | sort"
   41010 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:340"
   41011 ( $at_check_trace; $XSLTPROC \
   41012              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   41013              xml-tests/test.xml | sort
   41014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41015 at_status=$? at_failed=false
   41016 $at_check_filter
   41017 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41018 $at_diff expout "$at_stdout" || at_failed=:
   41019 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   41020 $at_failed && at_fn_log_failure
   41021 $at_traceon; }
   41022 
   41023   rm -rf xml-tests expout
   41024   at_restore_special_files
   41025 fi
   41026 { set +x
   41027 $as_echo "$at_srcdir/actions.at:340: bison -o input.c input.y"
   41028 at_fn_check_prepare_trace "actions.at:340"
   41029 ( $at_check_trace; bison -o input.c input.y
   41030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41031 at_status=$? at_failed=false
   41032 $at_check_filter
   41033 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41034 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41035 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   41036 $at_failed && at_fn_log_failure
   41037 $at_traceon; }
   41038 
   41039 
   41040    { set +x
   41041 $as_echo "$at_srcdir/actions.at:340: \$BISON_C_WORKS"
   41042 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:340"
   41043 ( $at_check_trace; $BISON_C_WORKS
   41044 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41045 at_status=$? at_failed=false
   41046 $at_check_filter
   41047 echo stderr:; cat "$at_stderr"
   41048 echo stdout:; cat "$at_stdout"
   41049 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   41050 $at_failed && at_fn_log_failure
   41051 $at_traceon; }
   41052 
   41053 { set +x
   41054 $as_echo "$at_srcdir/actions.at:340: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   41055 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:340"
   41056 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   41057 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41058 at_status=$? at_failed=false
   41059 $at_check_filter
   41060 echo stderr:; cat "$at_stderr"
   41061 echo stdout:; cat "$at_stdout"
   41062 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:340"
   41063 $at_failed && at_fn_log_failure
   41064 $at_traceon; }
   41065 
   41066 
   41067 { set +x
   41068 $as_echo "$at_srcdir/actions.at:341:  \$PREPARSER ./input"
   41069 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:341"
   41070 ( $at_check_trace;  $PREPARSER ./input
   41071 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41072 at_status=$? at_failed=false
   41073 $at_check_filter
   41074 echo stderr:; tee stderr <"$at_stderr"
   41075 echo >>"$at_stdout"; $as_echo "6
   41076 " | \
   41077   $at_diff - "$at_stdout" || at_failed=:
   41078 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:341"
   41079 $at_failed && at_fn_log_failure
   41080 $at_traceon; }
   41081 
   41082 { set +x
   41083 $as_echo "$at_srcdir/actions.at:341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   41084 at_fn_check_prepare_trace "actions.at:341"
   41085 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   41086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41087 at_status=$? at_failed=false
   41088 $at_check_filter
   41089 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41090 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41091 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:341"
   41092 $at_failed && at_fn_log_failure
   41093 $at_traceon; }
   41094 
   41095 
   41096 
   41097 
   41098   set +x
   41099   $at_times_p && times >"$at_times_file"
   41100 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   41101 read at_status <"$at_status_file"
   41102 #AT_STOP_158
   41103 #AT_START_159
   41104 at_fn_group_banner 159 'actions.at:751' \
   41105   "Printers and Destructors" "                       " 9
   41106 at_xfail=no
   41107 (
   41108   $as_echo "159. $at_setup_line: testing $at_desc ..."
   41109   $at_traceon
   41110 
   41111 
   41112 
   41113 # Make sure complex $n work.
   41114 
   41115 # Be sure to pass all the %directives to this macro to have correct
   41116 # helping macros.  So don't put any directly in the Bison file.
   41117 
   41118 cat >input.y <<'_ATEOF'
   41119 %code top {
   41120 #include <config.h>
   41121 /* We don't need perfect functions for these tests. */
   41122 #undef malloc
   41123 #undef memcmp
   41124 #undef realloc
   41125 }
   41126 
   41127 %code requires {
   41128 #include <stdio.h>
   41129 #include <stdlib.h>
   41130 #include <string.h>
   41131 #include <assert.h>
   41132 
   41133 #define YYINITDEPTH 10
   41134 #define YYMAXDEPTH 10
   41135 #define RANGE(Location) (Location).first_line, (Location).last_line
   41136 
   41137 /* Display the symbol type Symbol.  */
   41138 #define V(Symbol, Value, Location, Sep) \
   41139    fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
   41140 }
   41141 
   41142 %error-verbose
   41143 %debug
   41144 %verbose
   41145 %locations
   41146 
   41147 
   41148 
   41149 %code {
   41150 
   41151 static int yylex (void);
   41152 static void yyerror ( const char *msg);
   41153 }
   41154 
   41155 
   41156 
   41157 /* FIXME: This %printer isn't actually tested.  */
   41158 %printer
   41159   {
   41160     fprintf (yyoutput, "%d", $$);
   41161   }
   41162   input line thing 'x' 'y'
   41163 
   41164 %destructor
   41165   { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   41166   input
   41167 
   41168 %destructor
   41169   { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   41170   line
   41171 
   41172 %destructor
   41173   { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   41174   thing
   41175 
   41176 %destructor
   41177   { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   41178   'x'
   41179 
   41180 %destructor
   41181   { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   41182   'y'
   41183 
   41184 %token END 0
   41185 %destructor
   41186   { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
   41187   END
   41188 
   41189 %%
   41190 /*
   41191    This grammar is made to exercise error recovery.
   41192    "Lines" starting with `(' support error recovery, with
   41193    ')' as synchronizing token.  Lines starting with 'x' can never
   41194    be recovered from if in error.
   41195 */
   41196 
   41197 input:
   41198   /* Nothing. */
   41199     {
   41200       $$ = 0;
   41201       V(input, $$, @$, ": /* Nothing */\n");
   41202     }
   41203 | line input /* Right recursive to load the stack so that popping at
   41204                 END can be exercised.  */
   41205     {
   41206       $$ = 2;
   41207       V(input, $$, @$, ": ");
   41208       V(line,  $1, @1, " ");
   41209       V(input, $2, @2, "\n");
   41210     }
   41211 ;
   41212 
   41213 line:
   41214   thing thing thing ';'
   41215     {
   41216       $$ = $1;
   41217       V(line,  $$, @$, ": ");
   41218       V(thing, $1, @1, " ");
   41219       V(thing, $2, @2, " ");
   41220       V(thing, $3, @3, " ");
   41221       V(;,     $4, @4, "\n");
   41222     }
   41223 | '(' thing thing ')'
   41224     {
   41225       $$ = $1;
   41226       V(line,  $$, @$, ": ");
   41227       V('(',   $1, @1, " ");
   41228       V(thing, $2, @2, " ");
   41229       V(thing, $3, @3, " ");
   41230       V(')',   $4, @4, "\n");
   41231     }
   41232 | '(' thing ')'
   41233     {
   41234       $$ = $1;
   41235       V(line,  $$, @$, ": ");
   41236       V('(',   $1, @1, " ");
   41237       V(thing, $2, @2, " ");
   41238       V(')',   $3, @3, "\n");
   41239     }
   41240 | '(' error ')'
   41241     {
   41242       $$ = -1;
   41243       V(line,  $$, @$, ": ");
   41244       V('(',   $1, @1, " ");
   41245       fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
   41246       V(')',   $3, @3, "\n");
   41247     }
   41248 ;
   41249 
   41250 thing:
   41251   'x'
   41252     {
   41253       $$ = $1;
   41254       V(thing, $$, @$, ": ");
   41255       V('x',   $1, @1, "\n");
   41256     }
   41257 ;
   41258 %%
   41259 /* Alias to ARGV[1]. */
   41260 const char *source = YY_NULL;
   41261 
   41262 #include <stdio.h>
   41263 /* A C error reporting function.  */
   41264 static
   41265 void yyerror ( const char *msg)
   41266 {
   41267   YY_LOCATION_PRINT (stderr, (yylloc));
   41268   fprintf (stderr, ": ");
   41269   fprintf (stderr, "%s\n", msg);
   41270 }
   41271 
   41272 static
   41273 int yylex (void)
   41274 {
   41275   static unsigned int counter = 0;
   41276 
   41277   int c = (yylval) = counter++;
   41278   /* As in BASIC, line numbers go from 10 to 10.  */
   41279   (yylloc).first_line = (yylloc).first_column = 10 * c;
   41280   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   41281   assert (0 <= c && c <= strlen (source));
   41282   if (source[c])
   41283     fprintf (stderr, "sending: '%c'", source[c]);
   41284   else
   41285     fprintf (stderr, "sending: END");
   41286   fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
   41287   return source[c];
   41288 }
   41289 
   41290 
   41291 int
   41292 main (int argc, const char *argv[])
   41293 {
   41294   int status;
   41295   yydebug = !!getenv ("YYDEBUG");
   41296   assert (argc == 2);
   41297   source = argv[1];
   41298   status = yyparse ();
   41299   switch (status)
   41300     {
   41301       case 0: fprintf (stderr, "Successful parse.\n"); break;
   41302       case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
   41303       default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
   41304     }
   41305   return status;
   41306 }
   41307 _ATEOF
   41308 
   41309 
   41310 
   41311 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   41312   at_save_special_files
   41313   mkdir xml-tests
   41314     # Don't combine these Bison invocations since we want to be sure that
   41315   # --report=all isn't required to get the full XML file.
   41316   { set +x
   41317 $as_echo "$at_srcdir/actions.at:751: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   41318                   --graph=xml-tests/test.dot -o input.c input.y"
   41319 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:751"
   41320 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   41321                   --graph=xml-tests/test.dot -o input.c input.y
   41322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41323 at_status=$? at_failed=false
   41324 $at_check_filter
   41325 echo stderr:; cat "$at_stderr"
   41326 echo stdout:; cat "$at_stdout"
   41327 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41328 $at_failed && at_fn_log_failure
   41329 $at_traceon; }
   41330 
   41331   { set +x
   41332 $as_echo "$at_srcdir/actions.at:751: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   41333 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:751"
   41334 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   41335 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41336 at_status=$? at_failed=false
   41337 $at_check_filter
   41338 echo stderr:; cat "$at_stderr"
   41339 echo stdout:; cat "$at_stdout"
   41340 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41341 $at_failed && at_fn_log_failure
   41342 $at_traceon; }
   41343 
   41344     cp xml-tests/test.output expout
   41345   { set +x
   41346 $as_echo "$at_srcdir/actions.at:751: \$XSLTPROC \\
   41347              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   41348              xml-tests/test.xml"
   41349 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:751"
   41350 ( $at_check_trace; $XSLTPROC \
   41351              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   41352              xml-tests/test.xml
   41353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41354 at_status=$? at_failed=false
   41355 $at_check_filter
   41356 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41357 $at_diff expout "$at_stdout" || at_failed=:
   41358 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41359 $at_failed && at_fn_log_failure
   41360 $at_traceon; }
   41361 
   41362   sort xml-tests/test.dot > expout
   41363   { set +x
   41364 $as_echo "$at_srcdir/actions.at:751: \$XSLTPROC \\
   41365              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   41366              xml-tests/test.xml | sort"
   41367 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:751"
   41368 ( $at_check_trace; $XSLTPROC \
   41369              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   41370              xml-tests/test.xml | sort
   41371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41372 at_status=$? at_failed=false
   41373 $at_check_filter
   41374 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41375 $at_diff expout "$at_stdout" || at_failed=:
   41376 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41377 $at_failed && at_fn_log_failure
   41378 $at_traceon; }
   41379 
   41380   rm -rf xml-tests expout
   41381   at_restore_special_files
   41382 fi
   41383 { set +x
   41384 $as_echo "$at_srcdir/actions.at:751: bison -o input.c input.y"
   41385 at_fn_check_prepare_trace "actions.at:751"
   41386 ( $at_check_trace; bison -o input.c input.y
   41387 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41388 at_status=$? at_failed=false
   41389 $at_check_filter
   41390 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41391 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41392 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41393 $at_failed && at_fn_log_failure
   41394 $at_traceon; }
   41395 
   41396 
   41397    { set +x
   41398 $as_echo "$at_srcdir/actions.at:751: \$BISON_C_WORKS"
   41399 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:751"
   41400 ( $at_check_trace; $BISON_C_WORKS
   41401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41402 at_status=$? at_failed=false
   41403 $at_check_filter
   41404 echo stderr:; cat "$at_stderr"
   41405 echo stdout:; cat "$at_stdout"
   41406 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41407 $at_failed && at_fn_log_failure
   41408 $at_traceon; }
   41409 
   41410 { set +x
   41411 $as_echo "$at_srcdir/actions.at:751: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   41412 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:751"
   41413 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   41414 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41415 at_status=$? at_failed=false
   41416 $at_check_filter
   41417 echo stderr:; cat "$at_stderr"
   41418 echo stdout:; cat "$at_stdout"
   41419 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41420 $at_failed && at_fn_log_failure
   41421 $at_traceon; }
   41422 
   41423 
   41424 
   41425 
   41426 # Check the location of "empty"
   41427 # -----------------------------
   41428 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   41429 # an empty "line" nterm.
   41430 # FIXME: This location is not satisfying.  Depend on the lookahead?
   41431 { set +x
   41432 $as_echo "$at_srcdir/actions.at:751:  \$PREPARSER ./input '(x)'"
   41433 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:751"
   41434 ( $at_check_trace;  $PREPARSER ./input '(x)'
   41435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41436 at_status=$? at_failed=false
   41437 $at_check_filter
   41438 echo stderr:; tee stderr <"$at_stderr"
   41439 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41440 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41441 $at_failed && at_fn_log_failure
   41442 $at_traceon; }
   41443 
   41444 { set +x
   41445 $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   41446 at_fn_check_prepare_trace "actions.at:751"
   41447 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   41448 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41449 at_status=$? at_failed=false
   41450 $at_check_filter
   41451 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   41452 sending: 'x' (1@10-19)
   41453 thing (1@10-19): 'x' (1@10-19)
   41454 sending: ')' (2@20-29)
   41455 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   41456 sending: END (3@30-39)
   41457 input (0@29-29): /* Nothing */
   41458 input (2@0-29): line (0@0-29) input (0@29-29)
   41459 Freeing token END (3@30-39)
   41460 Freeing nterm input (2@0-29)
   41461 Successful parse.
   41462 " | \
   41463   $at_diff - "$at_stderr" || at_failed=:
   41464 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41465 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41466 $at_failed && at_fn_log_failure
   41467 $at_traceon; }
   41468 
   41469 
   41470 
   41471 
   41472 # Check locations in error recovery
   41473 # ---------------------------------
   41474 # '(y)' is an error, but can be recovered from.  But what's the location
   41475 # of the error itself ('y'), and of the resulting reduction ('(error)').
   41476 { set +x
   41477 $as_echo "$at_srcdir/actions.at:751:  \$PREPARSER ./input '(y)'"
   41478 at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:751"
   41479 ( $at_check_trace;  $PREPARSER ./input '(y)'
   41480 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41481 at_status=$? at_failed=false
   41482 $at_check_filter
   41483 echo stderr:; tee stderr <"$at_stderr"
   41484 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41485 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41486 $at_failed && at_fn_log_failure
   41487 $at_traceon; }
   41488 
   41489 { set +x
   41490 $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   41491 at_fn_check_prepare_trace "actions.at:751"
   41492 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   41493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41494 at_status=$? at_failed=false
   41495 $at_check_filter
   41496 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   41497 sending: 'y' (1@10-19)
   41498 10.10-19.18: syntax error, unexpected 'y', expecting 'x'
   41499 Freeing token 'y' (1@10-19)
   41500 sending: ')' (2@20-29)
   41501 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   41502 sending: END (3@30-39)
   41503 input (0@29-29): /* Nothing */
   41504 input (2@0-29): line (-1@0-29) input (0@29-29)
   41505 Freeing token END (3@30-39)
   41506 Freeing nterm input (2@0-29)
   41507 Successful parse.
   41508 " | \
   41509   $at_diff - "$at_stderr" || at_failed=:
   41510 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41511 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41512 $at_failed && at_fn_log_failure
   41513 $at_traceon; }
   41514 
   41515 
   41516 
   41517 
   41518 # Syntax errors caught by the parser
   41519 # ----------------------------------
   41520 # Exercise the discarding of stack top and input until `error'
   41521 # can be reduced.
   41522 #
   41523 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   41524 #
   41525 # Load the stack and provoke an error that cannot be caught by the
   41526 # grammar, to check that the stack is cleared.  And make sure the
   41527 # lookahead is freed.
   41528 #
   41529 #     '(', 'x', ')',
   41530 #     '(', 'x', ')',
   41531 #     'y'
   41532 { set +x
   41533 $as_echo "$at_srcdir/actions.at:751:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   41534 at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:751"
   41535 ( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
   41536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41537 at_status=$? at_failed=false
   41538 $at_check_filter
   41539 echo stderr:; tee stderr <"$at_stderr"
   41540 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41541 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:751"
   41542 $at_failed && at_fn_log_failure
   41543 $at_traceon; }
   41544 
   41545 { set +x
   41546 $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   41547 at_fn_check_prepare_trace "actions.at:751"
   41548 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   41549 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41550 at_status=$? at_failed=false
   41551 $at_check_filter
   41552 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   41553 sending: 'x' (1@10-19)
   41554 thing (1@10-19): 'x' (1@10-19)
   41555 sending: 'x' (2@20-29)
   41556 thing (2@20-29): 'x' (2@20-29)
   41557 sending: 'x' (3@30-39)
   41558 30.30-39.38: syntax error, unexpected 'x', expecting ')'
   41559 Freeing nterm thing (2@20-29)
   41560 Freeing nterm thing (1@10-19)
   41561 Freeing token 'x' (3@30-39)
   41562 sending: 'x' (4@40-49)
   41563 Freeing token 'x' (4@40-49)
   41564 sending: 'x' (5@50-59)
   41565 Freeing token 'x' (5@50-59)
   41566 sending: ')' (6@60-69)
   41567 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   41568 sending: '(' (7@70-79)
   41569 sending: 'x' (8@80-89)
   41570 thing (8@80-89): 'x' (8@80-89)
   41571 sending: ')' (9@90-99)
   41572 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   41573 sending: '(' (10@100-109)
   41574 sending: 'x' (11@110-119)
   41575 thing (11@110-119): 'x' (11@110-119)
   41576 sending: ')' (12@120-129)
   41577 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   41578 sending: 'y' (13@130-139)
   41579 input (0@129-129): /* Nothing */
   41580 input (2@100-129): line (10@100-129) input (0@129-129)
   41581 input (2@70-129): line (7@70-99) input (2@100-129)
   41582 input (2@0-129): line (-1@0-69) input (2@70-129)
   41583 130.130-139.138: syntax error, unexpected 'y', expecting END
   41584 Freeing nterm input (2@0-129)
   41585 Freeing token 'y' (13@130-139)
   41586 Parsing FAILED.
   41587 " | \
   41588   $at_diff - "$at_stderr" || at_failed=:
   41589 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41590 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41591 $at_failed && at_fn_log_failure
   41592 $at_traceon; }
   41593 
   41594 
   41595 
   41596 
   41597 # Syntax error caught by the parser where lookahead = END
   41598 # --------------------------------------------------------
   41599 # Load the stack and provoke an error that cannot be caught by the
   41600 # grammar, to check that the stack is cleared.  And make sure the
   41601 # lookahead is freed.
   41602 #
   41603 #     '(', 'x', ')',
   41604 #     '(', 'x', ')',
   41605 #     'x'
   41606 { set +x
   41607 $as_echo "$at_srcdir/actions.at:751:  \$PREPARSER ./input '(x)(x)x'"
   41608 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:751"
   41609 ( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
   41610 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41611 at_status=$? at_failed=false
   41612 $at_check_filter
   41613 echo stderr:; tee stderr <"$at_stderr"
   41614 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41615 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:751"
   41616 $at_failed && at_fn_log_failure
   41617 $at_traceon; }
   41618 
   41619 { set +x
   41620 $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   41621 at_fn_check_prepare_trace "actions.at:751"
   41622 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   41623 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41624 at_status=$? at_failed=false
   41625 $at_check_filter
   41626 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   41627 sending: 'x' (1@10-19)
   41628 thing (1@10-19): 'x' (1@10-19)
   41629 sending: ')' (2@20-29)
   41630 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   41631 sending: '(' (3@30-39)
   41632 sending: 'x' (4@40-49)
   41633 thing (4@40-49): 'x' (4@40-49)
   41634 sending: ')' (5@50-59)
   41635 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   41636 sending: 'x' (6@60-69)
   41637 thing (6@60-69): 'x' (6@60-69)
   41638 sending: END (7@70-79)
   41639 70.70-79.78: syntax error, unexpected END, expecting 'x'
   41640 Freeing nterm thing (6@60-69)
   41641 Freeing nterm line (3@30-59)
   41642 Freeing nterm line (0@0-29)
   41643 Freeing token END (7@70-79)
   41644 Parsing FAILED.
   41645 " | \
   41646   $at_diff - "$at_stderr" || at_failed=:
   41647 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41648 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41649 $at_failed && at_fn_log_failure
   41650 $at_traceon; }
   41651 
   41652 
   41653 
   41654 
   41655 # Check destruction upon stack overflow
   41656 # -------------------------------------
   41657 # Upon stack overflow, all symbols on the stack should be destroyed.
   41658 # Only check for yacc.c.
   41659 
   41660 { set +x
   41661 $as_echo "$at_srcdir/actions.at:751:  \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
   41662 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:751"
   41663 ( $at_check_trace;  $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'
   41664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41665 at_status=$? at_failed=false
   41666 $at_check_filter
   41667 echo stderr:; tee stderr <"$at_stderr"
   41668 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41669 at_fn_check_status 2 $at_status "$at_srcdir/actions.at:751"
   41670 $at_failed && at_fn_log_failure
   41671 $at_traceon; }
   41672 
   41673 { set +x
   41674 $as_echo "$at_srcdir/actions.at:751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   41675 at_fn_check_prepare_trace "actions.at:751"
   41676 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   41677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41678 at_status=$? at_failed=false
   41679 $at_check_filter
   41680 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   41681 sending: 'x' (1@10-19)
   41682 thing (1@10-19): 'x' (1@10-19)
   41683 sending: ')' (2@20-29)
   41684 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   41685 sending: '(' (3@30-39)
   41686 sending: 'x' (4@40-49)
   41687 thing (4@40-49): 'x' (4@40-49)
   41688 sending: ')' (5@50-59)
   41689 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   41690 sending: '(' (6@60-69)
   41691 sending: 'x' (7@70-79)
   41692 thing (7@70-79): 'x' (7@70-79)
   41693 sending: ')' (8@80-89)
   41694 line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
   41695 sending: '(' (9@90-99)
   41696 sending: 'x' (10@100-109)
   41697 thing (10@100-109): 'x' (10@100-109)
   41698 sending: ')' (11@110-119)
   41699 line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
   41700 sending: '(' (12@120-129)
   41701 sending: 'x' (13@130-139)
   41702 thing (13@130-139): 'x' (13@130-139)
   41703 sending: ')' (14@140-149)
   41704 line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
   41705 sending: '(' (15@150-159)
   41706 sending: 'x' (16@160-169)
   41707 thing (16@160-169): 'x' (16@160-169)
   41708 sending: ')' (17@170-179)
   41709 line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
   41710 sending: '(' (18@180-189)
   41711 sending: 'x' (19@190-199)
   41712 thing (19@190-199): 'x' (19@190-199)
   41713 sending: ')' (20@200-209)
   41714 200.200-209.208: memory exhausted
   41715 Freeing nterm thing (19@190-199)
   41716 Freeing nterm line (15@150-179)
   41717 Freeing nterm line (12@120-149)
   41718 Freeing nterm line (9@90-119)
   41719 Freeing nterm line (6@60-89)
   41720 Freeing nterm line (3@30-59)
   41721 Freeing nterm line (0@0-29)
   41722 Parsing FAILED (status 2).
   41723 " | \
   41724   $at_diff - "$at_stderr" || at_failed=:
   41725 at_fn_diff_devnull "$at_stdout" || at_failed=:
   41726 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:751"
   41727 $at_failed && at_fn_log_failure
   41728 $at_traceon; }
   41729 
   41730 
   41731 
   41732 
   41733 
   41734 
   41735 
   41736   set +x
   41737   $at_times_p && times >"$at_times_file"
   41738 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   41739 read at_status <"$at_status_file"
   41740 #AT_STOP_159
   41741 #AT_START_160
   41742 at_fn_group_banner 160 'actions.at:752' \
   41743   "Printers and Destructors with union" "            " 9
   41744 at_xfail=no
   41745 (
   41746   $as_echo "160. $at_setup_line: testing $at_desc ..."
   41747   $at_traceon
   41748 
   41749 
   41750 
   41751 # Make sure complex $n work.
   41752 
   41753 # Be sure to pass all the %directives to this macro to have correct
   41754 # helping macros.  So don't put any directly in the Bison file.
   41755 
   41756 cat >input.y <<'_ATEOF'
   41757 %code top {
   41758 #include <config.h>
   41759 /* We don't need perfect functions for these tests. */
   41760 #undef malloc
   41761 #undef memcmp
   41762 #undef realloc
   41763 }
   41764 
   41765 %code requires {
   41766 #include <stdio.h>
   41767 #include <stdlib.h>
   41768 #include <string.h>
   41769 #include <assert.h>
   41770 
   41771 #define YYINITDEPTH 10
   41772 #define YYMAXDEPTH 10
   41773 #define RANGE(Location) (Location).first_line, (Location).last_line
   41774 
   41775 /* Display the symbol type Symbol.  */
   41776 #define V(Symbol, Value, Location, Sep) \
   41777    fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
   41778 }
   41779 
   41780 %error-verbose
   41781 %debug
   41782 %verbose
   41783 %locations
   41784 
   41785 %union
   41786 {
   41787   int ival;
   41788 }
   41789 
   41790 %code provides {
   41791 
   41792 static int yylex (void);
   41793 static void yyerror ( const char *msg);
   41794 }
   41795 
   41796 %type <ival> '(' 'x' 'y' ')' ';' thing line input END
   41797 
   41798 /* FIXME: This %printer isn't actually tested.  */
   41799 %printer
   41800   {
   41801     fprintf (yyoutput, "%d", $$);
   41802   }
   41803   input line thing 'x' 'y'
   41804 
   41805 %destructor
   41806   { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   41807   input
   41808 
   41809 %destructor
   41810   { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   41811   line
   41812 
   41813 %destructor
   41814   { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   41815   thing
   41816 
   41817 %destructor
   41818   { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   41819   'x'
   41820 
   41821 %destructor
   41822   { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   41823   'y'
   41824 
   41825 %token END 0
   41826 %destructor
   41827   { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
   41828   END
   41829 
   41830 %%
   41831 /*
   41832    This grammar is made to exercise error recovery.
   41833    "Lines" starting with `(' support error recovery, with
   41834    ')' as synchronizing token.  Lines starting with 'x' can never
   41835    be recovered from if in error.
   41836 */
   41837 
   41838 input:
   41839   /* Nothing. */
   41840     {
   41841       $$ = 0;
   41842       V(input, $$, @$, ": /* Nothing */\n");
   41843     }
   41844 | line input /* Right recursive to load the stack so that popping at
   41845                 END can be exercised.  */
   41846     {
   41847       $$ = 2;
   41848       V(input, $$, @$, ": ");
   41849       V(line,  $1, @1, " ");
   41850       V(input, $2, @2, "\n");
   41851     }
   41852 ;
   41853 
   41854 line:
   41855   thing thing thing ';'
   41856     {
   41857       $$ = $1;
   41858       V(line,  $$, @$, ": ");
   41859       V(thing, $1, @1, " ");
   41860       V(thing, $2, @2, " ");
   41861       V(thing, $3, @3, " ");
   41862       V(;,     $4, @4, "\n");
   41863     }
   41864 | '(' thing thing ')'
   41865     {
   41866       $$ = $1;
   41867       V(line,  $$, @$, ": ");
   41868       V('(',   $1, @1, " ");
   41869       V(thing, $2, @2, " ");
   41870       V(thing, $3, @3, " ");
   41871       V(')',   $4, @4, "\n");
   41872     }
   41873 | '(' thing ')'
   41874     {
   41875       $$ = $1;
   41876       V(line,  $$, @$, ": ");
   41877       V('(',   $1, @1, " ");
   41878       V(thing, $2, @2, " ");
   41879       V(')',   $3, @3, "\n");
   41880     }
   41881 | '(' error ')'
   41882     {
   41883       $$ = -1;
   41884       V(line,  $$, @$, ": ");
   41885       V('(',   $1, @1, " ");
   41886       fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
   41887       V(')',   $3, @3, "\n");
   41888     }
   41889 ;
   41890 
   41891 thing:
   41892   'x'
   41893     {
   41894       $$ = $1;
   41895       V(thing, $$, @$, ": ");
   41896       V('x',   $1, @1, "\n");
   41897     }
   41898 ;
   41899 %%
   41900 /* Alias to ARGV[1]. */
   41901 const char *source = YY_NULL;
   41902 
   41903 #include <stdio.h>
   41904 /* A C error reporting function.  */
   41905 static
   41906 void yyerror ( const char *msg)
   41907 {
   41908   YY_LOCATION_PRINT (stderr, (yylloc));
   41909   fprintf (stderr, ": ");
   41910   fprintf (stderr, "%s\n", msg);
   41911 }
   41912 
   41913 static
   41914 int yylex (void)
   41915 {
   41916   static unsigned int counter = 0;
   41917 
   41918   int c = (yylval).ival = counter++;
   41919   /* As in BASIC, line numbers go from 10 to 10.  */
   41920   (yylloc).first_line = (yylloc).first_column = 10 * c;
   41921   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   41922   assert (0 <= c && c <= strlen (source));
   41923   if (source[c])
   41924     fprintf (stderr, "sending: '%c'", source[c]);
   41925   else
   41926     fprintf (stderr, "sending: END");
   41927   fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
   41928   return source[c];
   41929 }
   41930 
   41931 
   41932 int
   41933 main (int argc, const char *argv[])
   41934 {
   41935   int status;
   41936   yydebug = !!getenv ("YYDEBUG");
   41937   assert (argc == 2);
   41938   source = argv[1];
   41939   status = yyparse ();
   41940   switch (status)
   41941     {
   41942       case 0: fprintf (stderr, "Successful parse.\n"); break;
   41943       case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
   41944       default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
   41945     }
   41946   return status;
   41947 }
   41948 _ATEOF
   41949 
   41950 
   41951 
   41952 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   41953   at_save_special_files
   41954   mkdir xml-tests
   41955     # Don't combine these Bison invocations since we want to be sure that
   41956   # --report=all isn't required to get the full XML file.
   41957   { set +x
   41958 $as_echo "$at_srcdir/actions.at:752: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   41959                   --graph=xml-tests/test.dot -o input.c input.y"
   41960 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:752"
   41961 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   41962                   --graph=xml-tests/test.dot -o input.c input.y
   41963 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41964 at_status=$? at_failed=false
   41965 $at_check_filter
   41966 echo stderr:; cat "$at_stderr"
   41967 echo stdout:; cat "$at_stdout"
   41968 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   41969 $at_failed && at_fn_log_failure
   41970 $at_traceon; }
   41971 
   41972   { set +x
   41973 $as_echo "$at_srcdir/actions.at:752: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   41974 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:752"
   41975 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   41976 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41977 at_status=$? at_failed=false
   41978 $at_check_filter
   41979 echo stderr:; cat "$at_stderr"
   41980 echo stdout:; cat "$at_stdout"
   41981 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   41982 $at_failed && at_fn_log_failure
   41983 $at_traceon; }
   41984 
   41985     cp xml-tests/test.output expout
   41986   { set +x
   41987 $as_echo "$at_srcdir/actions.at:752: \$XSLTPROC \\
   41988              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   41989              xml-tests/test.xml"
   41990 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:752"
   41991 ( $at_check_trace; $XSLTPROC \
   41992              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   41993              xml-tests/test.xml
   41994 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   41995 at_status=$? at_failed=false
   41996 $at_check_filter
   41997 at_fn_diff_devnull "$at_stderr" || at_failed=:
   41998 $at_diff expout "$at_stdout" || at_failed=:
   41999 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42000 $at_failed && at_fn_log_failure
   42001 $at_traceon; }
   42002 
   42003   sort xml-tests/test.dot > expout
   42004   { set +x
   42005 $as_echo "$at_srcdir/actions.at:752: \$XSLTPROC \\
   42006              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   42007              xml-tests/test.xml | sort"
   42008 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:752"
   42009 ( $at_check_trace; $XSLTPROC \
   42010              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   42011              xml-tests/test.xml | sort
   42012 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42013 at_status=$? at_failed=false
   42014 $at_check_filter
   42015 at_fn_diff_devnull "$at_stderr" || at_failed=:
   42016 $at_diff expout "$at_stdout" || at_failed=:
   42017 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42018 $at_failed && at_fn_log_failure
   42019 $at_traceon; }
   42020 
   42021   rm -rf xml-tests expout
   42022   at_restore_special_files
   42023 fi
   42024 { set +x
   42025 $as_echo "$at_srcdir/actions.at:752: bison -o input.c input.y"
   42026 at_fn_check_prepare_trace "actions.at:752"
   42027 ( $at_check_trace; bison -o input.c input.y
   42028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42029 at_status=$? at_failed=false
   42030 $at_check_filter
   42031 at_fn_diff_devnull "$at_stderr" || at_failed=:
   42032 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42033 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42034 $at_failed && at_fn_log_failure
   42035 $at_traceon; }
   42036 
   42037 
   42038    { set +x
   42039 $as_echo "$at_srcdir/actions.at:752: \$BISON_C_WORKS"
   42040 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:752"
   42041 ( $at_check_trace; $BISON_C_WORKS
   42042 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42043 at_status=$? at_failed=false
   42044 $at_check_filter
   42045 echo stderr:; cat "$at_stderr"
   42046 echo stdout:; cat "$at_stdout"
   42047 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42048 $at_failed && at_fn_log_failure
   42049 $at_traceon; }
   42050 
   42051 { set +x
   42052 $as_echo "$at_srcdir/actions.at:752: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   42053 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:752"
   42054 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   42055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42056 at_status=$? at_failed=false
   42057 $at_check_filter
   42058 echo stderr:; cat "$at_stderr"
   42059 echo stdout:; cat "$at_stdout"
   42060 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42061 $at_failed && at_fn_log_failure
   42062 $at_traceon; }
   42063 
   42064 
   42065 
   42066 
   42067 # Check the location of "empty"
   42068 # -----------------------------
   42069 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   42070 # an empty "line" nterm.
   42071 # FIXME: This location is not satisfying.  Depend on the lookahead?
   42072 { set +x
   42073 $as_echo "$at_srcdir/actions.at:752:  \$PREPARSER ./input '(x)'"
   42074 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:752"
   42075 ( $at_check_trace;  $PREPARSER ./input '(x)'
   42076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42077 at_status=$? at_failed=false
   42078 $at_check_filter
   42079 echo stderr:; tee stderr <"$at_stderr"
   42080 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42081 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42082 $at_failed && at_fn_log_failure
   42083 $at_traceon; }
   42084 
   42085 { set +x
   42086 $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42087 at_fn_check_prepare_trace "actions.at:752"
   42088 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42089 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42090 at_status=$? at_failed=false
   42091 $at_check_filter
   42092 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42093 sending: 'x' (1@10-19)
   42094 thing (1@10-19): 'x' (1@10-19)
   42095 sending: ')' (2@20-29)
   42096 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   42097 sending: END (3@30-39)
   42098 input (0@29-29): /* Nothing */
   42099 input (2@0-29): line (0@0-29) input (0@29-29)
   42100 Freeing token END (3@30-39)
   42101 Freeing nterm input (2@0-29)
   42102 Successful parse.
   42103 " | \
   42104   $at_diff - "$at_stderr" || at_failed=:
   42105 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42106 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42107 $at_failed && at_fn_log_failure
   42108 $at_traceon; }
   42109 
   42110 
   42111 
   42112 
   42113 # Check locations in error recovery
   42114 # ---------------------------------
   42115 # '(y)' is an error, but can be recovered from.  But what's the location
   42116 # of the error itself ('y'), and of the resulting reduction ('(error)').
   42117 { set +x
   42118 $as_echo "$at_srcdir/actions.at:752:  \$PREPARSER ./input '(y)'"
   42119 at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:752"
   42120 ( $at_check_trace;  $PREPARSER ./input '(y)'
   42121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42122 at_status=$? at_failed=false
   42123 $at_check_filter
   42124 echo stderr:; tee stderr <"$at_stderr"
   42125 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42126 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42127 $at_failed && at_fn_log_failure
   42128 $at_traceon; }
   42129 
   42130 { set +x
   42131 $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42132 at_fn_check_prepare_trace "actions.at:752"
   42133 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42134 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42135 at_status=$? at_failed=false
   42136 $at_check_filter
   42137 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42138 sending: 'y' (1@10-19)
   42139 10.10-19.18: syntax error, unexpected 'y', expecting 'x'
   42140 Freeing token 'y' (1@10-19)
   42141 sending: ')' (2@20-29)
   42142 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   42143 sending: END (3@30-39)
   42144 input (0@29-29): /* Nothing */
   42145 input (2@0-29): line (-1@0-29) input (0@29-29)
   42146 Freeing token END (3@30-39)
   42147 Freeing nterm input (2@0-29)
   42148 Successful parse.
   42149 " | \
   42150   $at_diff - "$at_stderr" || at_failed=:
   42151 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42152 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42153 $at_failed && at_fn_log_failure
   42154 $at_traceon; }
   42155 
   42156 
   42157 
   42158 
   42159 # Syntax errors caught by the parser
   42160 # ----------------------------------
   42161 # Exercise the discarding of stack top and input until `error'
   42162 # can be reduced.
   42163 #
   42164 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   42165 #
   42166 # Load the stack and provoke an error that cannot be caught by the
   42167 # grammar, to check that the stack is cleared.  And make sure the
   42168 # lookahead is freed.
   42169 #
   42170 #     '(', 'x', ')',
   42171 #     '(', 'x', ')',
   42172 #     'y'
   42173 { set +x
   42174 $as_echo "$at_srcdir/actions.at:752:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   42175 at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:752"
   42176 ( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
   42177 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42178 at_status=$? at_failed=false
   42179 $at_check_filter
   42180 echo stderr:; tee stderr <"$at_stderr"
   42181 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42182 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:752"
   42183 $at_failed && at_fn_log_failure
   42184 $at_traceon; }
   42185 
   42186 { set +x
   42187 $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42188 at_fn_check_prepare_trace "actions.at:752"
   42189 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42191 at_status=$? at_failed=false
   42192 $at_check_filter
   42193 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42194 sending: 'x' (1@10-19)
   42195 thing (1@10-19): 'x' (1@10-19)
   42196 sending: 'x' (2@20-29)
   42197 thing (2@20-29): 'x' (2@20-29)
   42198 sending: 'x' (3@30-39)
   42199 30.30-39.38: syntax error, unexpected 'x', expecting ')'
   42200 Freeing nterm thing (2@20-29)
   42201 Freeing nterm thing (1@10-19)
   42202 Freeing token 'x' (3@30-39)
   42203 sending: 'x' (4@40-49)
   42204 Freeing token 'x' (4@40-49)
   42205 sending: 'x' (5@50-59)
   42206 Freeing token 'x' (5@50-59)
   42207 sending: ')' (6@60-69)
   42208 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   42209 sending: '(' (7@70-79)
   42210 sending: 'x' (8@80-89)
   42211 thing (8@80-89): 'x' (8@80-89)
   42212 sending: ')' (9@90-99)
   42213 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   42214 sending: '(' (10@100-109)
   42215 sending: 'x' (11@110-119)
   42216 thing (11@110-119): 'x' (11@110-119)
   42217 sending: ')' (12@120-129)
   42218 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   42219 sending: 'y' (13@130-139)
   42220 input (0@129-129): /* Nothing */
   42221 input (2@100-129): line (10@100-129) input (0@129-129)
   42222 input (2@70-129): line (7@70-99) input (2@100-129)
   42223 input (2@0-129): line (-1@0-69) input (2@70-129)
   42224 130.130-139.138: syntax error, unexpected 'y', expecting END
   42225 Freeing nterm input (2@0-129)
   42226 Freeing token 'y' (13@130-139)
   42227 Parsing FAILED.
   42228 " | \
   42229   $at_diff - "$at_stderr" || at_failed=:
   42230 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42231 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42232 $at_failed && at_fn_log_failure
   42233 $at_traceon; }
   42234 
   42235 
   42236 
   42237 
   42238 # Syntax error caught by the parser where lookahead = END
   42239 # --------------------------------------------------------
   42240 # Load the stack and provoke an error that cannot be caught by the
   42241 # grammar, to check that the stack is cleared.  And make sure the
   42242 # lookahead is freed.
   42243 #
   42244 #     '(', 'x', ')',
   42245 #     '(', 'x', ')',
   42246 #     'x'
   42247 { set +x
   42248 $as_echo "$at_srcdir/actions.at:752:  \$PREPARSER ./input '(x)(x)x'"
   42249 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:752"
   42250 ( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
   42251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42252 at_status=$? at_failed=false
   42253 $at_check_filter
   42254 echo stderr:; tee stderr <"$at_stderr"
   42255 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42256 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:752"
   42257 $at_failed && at_fn_log_failure
   42258 $at_traceon; }
   42259 
   42260 { set +x
   42261 $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42262 at_fn_check_prepare_trace "actions.at:752"
   42263 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42265 at_status=$? at_failed=false
   42266 $at_check_filter
   42267 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42268 sending: 'x' (1@10-19)
   42269 thing (1@10-19): 'x' (1@10-19)
   42270 sending: ')' (2@20-29)
   42271 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   42272 sending: '(' (3@30-39)
   42273 sending: 'x' (4@40-49)
   42274 thing (4@40-49): 'x' (4@40-49)
   42275 sending: ')' (5@50-59)
   42276 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   42277 sending: 'x' (6@60-69)
   42278 thing (6@60-69): 'x' (6@60-69)
   42279 sending: END (7@70-79)
   42280 70.70-79.78: syntax error, unexpected END, expecting 'x'
   42281 Freeing nterm thing (6@60-69)
   42282 Freeing nterm line (3@30-59)
   42283 Freeing nterm line (0@0-29)
   42284 Freeing token END (7@70-79)
   42285 Parsing FAILED.
   42286 " | \
   42287   $at_diff - "$at_stderr" || at_failed=:
   42288 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42289 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42290 $at_failed && at_fn_log_failure
   42291 $at_traceon; }
   42292 
   42293 
   42294 
   42295 
   42296 # Check destruction upon stack overflow
   42297 # -------------------------------------
   42298 # Upon stack overflow, all symbols on the stack should be destroyed.
   42299 # Only check for yacc.c.
   42300 
   42301 { set +x
   42302 $as_echo "$at_srcdir/actions.at:752:  \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
   42303 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:752"
   42304 ( $at_check_trace;  $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'
   42305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42306 at_status=$? at_failed=false
   42307 $at_check_filter
   42308 echo stderr:; tee stderr <"$at_stderr"
   42309 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42310 at_fn_check_status 2 $at_status "$at_srcdir/actions.at:752"
   42311 $at_failed && at_fn_log_failure
   42312 $at_traceon; }
   42313 
   42314 { set +x
   42315 $as_echo "$at_srcdir/actions.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42316 at_fn_check_prepare_trace "actions.at:752"
   42317 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42318 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42319 at_status=$? at_failed=false
   42320 $at_check_filter
   42321 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42322 sending: 'x' (1@10-19)
   42323 thing (1@10-19): 'x' (1@10-19)
   42324 sending: ')' (2@20-29)
   42325 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   42326 sending: '(' (3@30-39)
   42327 sending: 'x' (4@40-49)
   42328 thing (4@40-49): 'x' (4@40-49)
   42329 sending: ')' (5@50-59)
   42330 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   42331 sending: '(' (6@60-69)
   42332 sending: 'x' (7@70-79)
   42333 thing (7@70-79): 'x' (7@70-79)
   42334 sending: ')' (8@80-89)
   42335 line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
   42336 sending: '(' (9@90-99)
   42337 sending: 'x' (10@100-109)
   42338 thing (10@100-109): 'x' (10@100-109)
   42339 sending: ')' (11@110-119)
   42340 line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
   42341 sending: '(' (12@120-129)
   42342 sending: 'x' (13@130-139)
   42343 thing (13@130-139): 'x' (13@130-139)
   42344 sending: ')' (14@140-149)
   42345 line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
   42346 sending: '(' (15@150-159)
   42347 sending: 'x' (16@160-169)
   42348 thing (16@160-169): 'x' (16@160-169)
   42349 sending: ')' (17@170-179)
   42350 line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
   42351 sending: '(' (18@180-189)
   42352 sending: 'x' (19@190-199)
   42353 thing (19@190-199): 'x' (19@190-199)
   42354 sending: ')' (20@200-209)
   42355 200.200-209.208: memory exhausted
   42356 Freeing nterm thing (19@190-199)
   42357 Freeing nterm line (15@150-179)
   42358 Freeing nterm line (12@120-149)
   42359 Freeing nterm line (9@90-119)
   42360 Freeing nterm line (6@60-89)
   42361 Freeing nterm line (3@30-59)
   42362 Freeing nterm line (0@0-29)
   42363 Parsing FAILED (status 2).
   42364 " | \
   42365   $at_diff - "$at_stderr" || at_failed=:
   42366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42367 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:752"
   42368 $at_failed && at_fn_log_failure
   42369 $at_traceon; }
   42370 
   42371 
   42372 
   42373 
   42374 
   42375 
   42376 
   42377   set +x
   42378   $at_times_p && times >"$at_times_file"
   42379 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   42380 read at_status <"$at_status_file"
   42381 #AT_STOP_160
   42382 #AT_START_161
   42383 at_fn_group_banner 161 'actions.at:754' \
   42384   "Printers and Destructors: %defines %skeleton \"lalr1.cc\"" "" 9
   42385 at_xfail=no
   42386 (
   42387   $as_echo "161. $at_setup_line: testing $at_desc ..."
   42388   $at_traceon
   42389 
   42390 
   42391 
   42392 # Make sure complex $n work.
   42393 
   42394 # Be sure to pass all the %directives to this macro to have correct
   42395 # helping macros.  So don't put any directly in the Bison file.
   42396 
   42397 cat >input.y <<'_ATEOF'
   42398 %code top {
   42399 #include <config.h>
   42400 /* We don't need perfect functions for these tests. */
   42401 #undef malloc
   42402 #undef memcmp
   42403 #undef realloc
   42404 }
   42405 
   42406 %code requires {
   42407 #include <stdio.h>
   42408 #include <stdlib.h>
   42409 #include <string.h>
   42410 #include <assert.h>
   42411 
   42412 #define YYINITDEPTH 10
   42413 #define YYMAXDEPTH 10
   42414 #define RANGE(Location) (Location).begin.line, (Location).end.line
   42415 
   42416 /* Display the symbol type Symbol.  */
   42417 #define V(Symbol, Value, Location, Sep) \
   42418    fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
   42419 }
   42420 
   42421 %error-verbose
   42422 %debug
   42423 %verbose
   42424 %locations
   42425 %defines %skeleton "lalr1.cc"
   42426 
   42427 %define global_tokens_and_yystype
   42428 %code {
   42429 typedef yy::location YYLTYPE;
   42430 static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   42431 
   42432 }
   42433 
   42434 
   42435 
   42436 /* FIXME: This %printer isn't actually tested.  */
   42437 %printer
   42438   {
   42439     debug_stream () << $$;;
   42440   }
   42441   input line thing 'x' 'y'
   42442 
   42443 %destructor
   42444   { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   42445   input
   42446 
   42447 %destructor
   42448   { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   42449   line
   42450 
   42451 %destructor
   42452   { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   42453   thing
   42454 
   42455 %destructor
   42456   { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   42457   'x'
   42458 
   42459 %destructor
   42460   { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   42461   'y'
   42462 
   42463 %token END 0
   42464 %destructor
   42465   { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
   42466   END
   42467 
   42468 %%
   42469 /*
   42470    This grammar is made to exercise error recovery.
   42471    "Lines" starting with `(' support error recovery, with
   42472    ')' as synchronizing token.  Lines starting with 'x' can never
   42473    be recovered from if in error.
   42474 */
   42475 
   42476 input:
   42477   /* Nothing. */
   42478     {
   42479       $$ = 0;
   42480       V(input, $$, @$, ": /* Nothing */\n");
   42481     }
   42482 | line input /* Right recursive to load the stack so that popping at
   42483                 END can be exercised.  */
   42484     {
   42485       $$ = 2;
   42486       V(input, $$, @$, ": ");
   42487       V(line,  $1, @1, " ");
   42488       V(input, $2, @2, "\n");
   42489     }
   42490 ;
   42491 
   42492 line:
   42493   thing thing thing ';'
   42494     {
   42495       $$ = $1;
   42496       V(line,  $$, @$, ": ");
   42497       V(thing, $1, @1, " ");
   42498       V(thing, $2, @2, " ");
   42499       V(thing, $3, @3, " ");
   42500       V(;,     $4, @4, "\n");
   42501     }
   42502 | '(' thing thing ')'
   42503     {
   42504       $$ = $1;
   42505       V(line,  $$, @$, ": ");
   42506       V('(',   $1, @1, " ");
   42507       V(thing, $2, @2, " ");
   42508       V(thing, $3, @3, " ");
   42509       V(')',   $4, @4, "\n");
   42510     }
   42511 | '(' thing ')'
   42512     {
   42513       $$ = $1;
   42514       V(line,  $$, @$, ": ");
   42515       V('(',   $1, @1, " ");
   42516       V(thing, $2, @2, " ");
   42517       V(')',   $3, @3, "\n");
   42518     }
   42519 | '(' error ')'
   42520     {
   42521       $$ = -1;
   42522       V(line,  $$, @$, ": ");
   42523       V('(',   $1, @1, " ");
   42524       fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
   42525       V(')',   $3, @3, "\n");
   42526     }
   42527 ;
   42528 
   42529 thing:
   42530   'x'
   42531     {
   42532       $$ = $1;
   42533       V(thing, $$, @$, ": ");
   42534       V('x',   $1, @1, "\n");
   42535     }
   42536 ;
   42537 %%
   42538 /* Alias to ARGV[1]. */
   42539 const char *source = YY_NULL;
   42540 
   42541 /* A C++ error reporting function.  */
   42542 void
   42543 yy::parser::error (const location_type& l, const std::string& m)
   42544 {
   42545   (void) l;
   42546   std::cerr << l << ": " << m << std::endl;
   42547 }
   42548 
   42549 static
   42550 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   42551 {
   42552   static unsigned int counter = 0;
   42553 
   42554   int c = (*lvalp) = counter++;
   42555   /* As in BASIC, line numbers go from 10 to 10.  */
   42556   (*llocp).begin.line = (*llocp).begin.column = 10 * c;
   42557   (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
   42558   assert (0 <= c && c <= strlen (source));
   42559   if (source[c])
   42560     fprintf (stderr, "sending: '%c'", source[c]);
   42561   else
   42562     fprintf (stderr, "sending: END");
   42563   fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
   42564   return source[c];
   42565 }
   42566 static bool yydebug;
   42567 int
   42568 yyparse ()
   42569 {
   42570   yy::parser parser;
   42571   parser.set_debug_level (yydebug);
   42572   return parser.parse ();
   42573 }
   42574 
   42575 
   42576 int
   42577 main (int argc, const char *argv[])
   42578 {
   42579   int status;
   42580   yydebug = !!getenv ("YYDEBUG");
   42581   assert (argc == 2);
   42582   source = argv[1];
   42583   status = yyparse ();
   42584   switch (status)
   42585     {
   42586       case 0: fprintf (stderr, "Successful parse.\n"); break;
   42587       case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
   42588       default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
   42589     }
   42590   return status;
   42591 }
   42592 _ATEOF
   42593 
   42594 
   42595 
   42596 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   42597   at_save_special_files
   42598   mkdir xml-tests
   42599     # Don't combine these Bison invocations since we want to be sure that
   42600   # --report=all isn't required to get the full XML file.
   42601   { set +x
   42602 $as_echo "$at_srcdir/actions.at:754: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   42603                   --graph=xml-tests/test.dot -o input.cc input.y"
   42604 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:754"
   42605 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   42606                   --graph=xml-tests/test.dot -o input.cc input.y
   42607 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42608 at_status=$? at_failed=false
   42609 $at_check_filter
   42610 echo stderr:; cat "$at_stderr"
   42611 echo stdout:; cat "$at_stdout"
   42612 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42613 $at_failed && at_fn_log_failure
   42614 $at_traceon; }
   42615 
   42616   { set +x
   42617 $as_echo "$at_srcdir/actions.at:754: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   42618 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:754"
   42619 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   42620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42621 at_status=$? at_failed=false
   42622 $at_check_filter
   42623 echo stderr:; cat "$at_stderr"
   42624 echo stdout:; cat "$at_stdout"
   42625 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42626 $at_failed && at_fn_log_failure
   42627 $at_traceon; }
   42628 
   42629     cp xml-tests/test.output expout
   42630   { set +x
   42631 $as_echo "$at_srcdir/actions.at:754: \$XSLTPROC \\
   42632              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   42633              xml-tests/test.xml"
   42634 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:754"
   42635 ( $at_check_trace; $XSLTPROC \
   42636              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   42637              xml-tests/test.xml
   42638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42639 at_status=$? at_failed=false
   42640 $at_check_filter
   42641 at_fn_diff_devnull "$at_stderr" || at_failed=:
   42642 $at_diff expout "$at_stdout" || at_failed=:
   42643 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42644 $at_failed && at_fn_log_failure
   42645 $at_traceon; }
   42646 
   42647   sort xml-tests/test.dot > expout
   42648   { set +x
   42649 $as_echo "$at_srcdir/actions.at:754: \$XSLTPROC \\
   42650              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   42651              xml-tests/test.xml | sort"
   42652 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:754"
   42653 ( $at_check_trace; $XSLTPROC \
   42654              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   42655              xml-tests/test.xml | sort
   42656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42657 at_status=$? at_failed=false
   42658 $at_check_filter
   42659 at_fn_diff_devnull "$at_stderr" || at_failed=:
   42660 $at_diff expout "$at_stdout" || at_failed=:
   42661 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42662 $at_failed && at_fn_log_failure
   42663 $at_traceon; }
   42664 
   42665   rm -rf xml-tests expout
   42666   at_restore_special_files
   42667 fi
   42668 { set +x
   42669 $as_echo "$at_srcdir/actions.at:754: bison -o input.cc input.y"
   42670 at_fn_check_prepare_trace "actions.at:754"
   42671 ( $at_check_trace; bison -o input.cc input.y
   42672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42673 at_status=$? at_failed=false
   42674 $at_check_filter
   42675 at_fn_diff_devnull "$at_stderr" || at_failed=:
   42676 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42677 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42678 $at_failed && at_fn_log_failure
   42679 $at_traceon; }
   42680 
   42681 
   42682 
   42683 { set +x
   42684 $as_echo "$at_srcdir/actions.at:754: \$BISON_CXX_WORKS"
   42685 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:754"
   42686 ( $at_check_trace; $BISON_CXX_WORKS
   42687 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42688 at_status=$? at_failed=false
   42689 $at_check_filter
   42690 echo stderr:; cat "$at_stderr"
   42691 echo stdout:; cat "$at_stdout"
   42692 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42693 $at_failed && at_fn_log_failure
   42694 $at_traceon; }
   42695 
   42696 { set +x
   42697 $as_echo "$at_srcdir/actions.at:754: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   42698 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:754"
   42699 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   42700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42701 at_status=$? at_failed=false
   42702 $at_check_filter
   42703 echo stderr:; cat "$at_stderr"
   42704 echo stdout:; cat "$at_stdout"
   42705 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42706 $at_failed && at_fn_log_failure
   42707 $at_traceon; }
   42708 
   42709 
   42710 
   42711 
   42712 # Check the location of "empty"
   42713 # -----------------------------
   42714 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   42715 # an empty "line" nterm.
   42716 # FIXME: This location is not satisfying.  Depend on the lookahead?
   42717 { set +x
   42718 $as_echo "$at_srcdir/actions.at:754:  \$PREPARSER ./input '(x)'"
   42719 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:754"
   42720 ( $at_check_trace;  $PREPARSER ./input '(x)'
   42721 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42722 at_status=$? at_failed=false
   42723 $at_check_filter
   42724 echo stderr:; tee stderr <"$at_stderr"
   42725 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42726 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42727 $at_failed && at_fn_log_failure
   42728 $at_traceon; }
   42729 
   42730 { set +x
   42731 $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42732 at_fn_check_prepare_trace "actions.at:754"
   42733 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42735 at_status=$? at_failed=false
   42736 $at_check_filter
   42737 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42738 sending: 'x' (1@10-19)
   42739 thing (1@10-19): 'x' (1@10-19)
   42740 sending: ')' (2@20-29)
   42741 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   42742 sending: END (3@30-39)
   42743 input (0@29-29): /* Nothing */
   42744 input (2@0-29): line (0@0-29) input (0@29-29)
   42745 Freeing token END (3@30-39)
   42746 Freeing nterm input (2@0-29)
   42747 Successful parse.
   42748 " | \
   42749   $at_diff - "$at_stderr" || at_failed=:
   42750 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42751 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42752 $at_failed && at_fn_log_failure
   42753 $at_traceon; }
   42754 
   42755 
   42756 
   42757 
   42758 # Check locations in error recovery
   42759 # ---------------------------------
   42760 # '(y)' is an error, but can be recovered from.  But what's the location
   42761 # of the error itself ('y'), and of the resulting reduction ('(error)').
   42762 { set +x
   42763 $as_echo "$at_srcdir/actions.at:754:  \$PREPARSER ./input '(y)'"
   42764 at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:754"
   42765 ( $at_check_trace;  $PREPARSER ./input '(y)'
   42766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42767 at_status=$? at_failed=false
   42768 $at_check_filter
   42769 echo stderr:; tee stderr <"$at_stderr"
   42770 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42771 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42772 $at_failed && at_fn_log_failure
   42773 $at_traceon; }
   42774 
   42775 { set +x
   42776 $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42777 at_fn_check_prepare_trace "actions.at:754"
   42778 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42780 at_status=$? at_failed=false
   42781 $at_check_filter
   42782 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42783 sending: 'y' (1@10-19)
   42784 10.10-19.18: syntax error, unexpected 'y', expecting 'x'
   42785 Freeing token 'y' (1@10-19)
   42786 sending: ')' (2@20-29)
   42787 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   42788 sending: END (3@30-39)
   42789 input (0@29-29): /* Nothing */
   42790 input (2@0-29): line (-1@0-29) input (0@29-29)
   42791 Freeing token END (3@30-39)
   42792 Freeing nterm input (2@0-29)
   42793 Successful parse.
   42794 " | \
   42795   $at_diff - "$at_stderr" || at_failed=:
   42796 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42797 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42798 $at_failed && at_fn_log_failure
   42799 $at_traceon; }
   42800 
   42801 
   42802 
   42803 
   42804 # Syntax errors caught by the parser
   42805 # ----------------------------------
   42806 # Exercise the discarding of stack top and input until `error'
   42807 # can be reduced.
   42808 #
   42809 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   42810 #
   42811 # Load the stack and provoke an error that cannot be caught by the
   42812 # grammar, to check that the stack is cleared.  And make sure the
   42813 # lookahead is freed.
   42814 #
   42815 #     '(', 'x', ')',
   42816 #     '(', 'x', ')',
   42817 #     'y'
   42818 { set +x
   42819 $as_echo "$at_srcdir/actions.at:754:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   42820 at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:754"
   42821 ( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
   42822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42823 at_status=$? at_failed=false
   42824 $at_check_filter
   42825 echo stderr:; tee stderr <"$at_stderr"
   42826 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42827 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:754"
   42828 $at_failed && at_fn_log_failure
   42829 $at_traceon; }
   42830 
   42831 { set +x
   42832 $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42833 at_fn_check_prepare_trace "actions.at:754"
   42834 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42836 at_status=$? at_failed=false
   42837 $at_check_filter
   42838 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42839 sending: 'x' (1@10-19)
   42840 thing (1@10-19): 'x' (1@10-19)
   42841 sending: 'x' (2@20-29)
   42842 thing (2@20-29): 'x' (2@20-29)
   42843 sending: 'x' (3@30-39)
   42844 30.30-39.38: syntax error, unexpected 'x', expecting ')'
   42845 Freeing nterm thing (2@20-29)
   42846 Freeing nterm thing (1@10-19)
   42847 Freeing token 'x' (3@30-39)
   42848 sending: 'x' (4@40-49)
   42849 Freeing token 'x' (4@40-49)
   42850 sending: 'x' (5@50-59)
   42851 Freeing token 'x' (5@50-59)
   42852 sending: ')' (6@60-69)
   42853 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   42854 sending: '(' (7@70-79)
   42855 sending: 'x' (8@80-89)
   42856 thing (8@80-89): 'x' (8@80-89)
   42857 sending: ')' (9@90-99)
   42858 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   42859 sending: '(' (10@100-109)
   42860 sending: 'x' (11@110-119)
   42861 thing (11@110-119): 'x' (11@110-119)
   42862 sending: ')' (12@120-129)
   42863 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   42864 sending: 'y' (13@130-139)
   42865 input (0@129-129): /* Nothing */
   42866 input (2@100-129): line (10@100-129) input (0@129-129)
   42867 input (2@70-129): line (7@70-99) input (2@100-129)
   42868 input (2@0-129): line (-1@0-69) input (2@70-129)
   42869 130.130-139.138: syntax error, unexpected 'y', expecting END
   42870 Freeing nterm input (2@0-129)
   42871 Freeing token 'y' (13@130-139)
   42872 Parsing FAILED.
   42873 " | \
   42874   $at_diff - "$at_stderr" || at_failed=:
   42875 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42876 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42877 $at_failed && at_fn_log_failure
   42878 $at_traceon; }
   42879 
   42880 
   42881 
   42882 
   42883 # Syntax error caught by the parser where lookahead = END
   42884 # --------------------------------------------------------
   42885 # Load the stack and provoke an error that cannot be caught by the
   42886 # grammar, to check that the stack is cleared.  And make sure the
   42887 # lookahead is freed.
   42888 #
   42889 #     '(', 'x', ')',
   42890 #     '(', 'x', ')',
   42891 #     'x'
   42892 { set +x
   42893 $as_echo "$at_srcdir/actions.at:754:  \$PREPARSER ./input '(x)(x)x'"
   42894 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:754"
   42895 ( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
   42896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42897 at_status=$? at_failed=false
   42898 $at_check_filter
   42899 echo stderr:; tee stderr <"$at_stderr"
   42900 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42901 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:754"
   42902 $at_failed && at_fn_log_failure
   42903 $at_traceon; }
   42904 
   42905 { set +x
   42906 $as_echo "$at_srcdir/actions.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   42907 at_fn_check_prepare_trace "actions.at:754"
   42908 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   42909 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   42910 at_status=$? at_failed=false
   42911 $at_check_filter
   42912 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   42913 sending: 'x' (1@10-19)
   42914 thing (1@10-19): 'x' (1@10-19)
   42915 sending: ')' (2@20-29)
   42916 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   42917 sending: '(' (3@30-39)
   42918 sending: 'x' (4@40-49)
   42919 thing (4@40-49): 'x' (4@40-49)
   42920 sending: ')' (5@50-59)
   42921 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   42922 sending: 'x' (6@60-69)
   42923 thing (6@60-69): 'x' (6@60-69)
   42924 sending: END (7@70-79)
   42925 70.70-79.78: syntax error, unexpected END, expecting 'x'
   42926 Freeing nterm thing (6@60-69)
   42927 Freeing nterm line (3@30-59)
   42928 Freeing nterm line (0@0-29)
   42929 Freeing token END (7@70-79)
   42930 Parsing FAILED.
   42931 " | \
   42932   $at_diff - "$at_stderr" || at_failed=:
   42933 at_fn_diff_devnull "$at_stdout" || at_failed=:
   42934 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:754"
   42935 $at_failed && at_fn_log_failure
   42936 $at_traceon; }
   42937 
   42938 
   42939 
   42940 
   42941 # Check destruction upon stack overflow
   42942 # -------------------------------------
   42943 # Upon stack overflow, all symbols on the stack should be destroyed.
   42944 # Only check for yacc.c.
   42945 
   42946 
   42947 
   42948 
   42949 
   42950   set +x
   42951   $at_times_p && times >"$at_times_file"
   42952 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   42953 read at_status <"$at_status_file"
   42954 #AT_STOP_161
   42955 #AT_START_162
   42956 at_fn_group_banner 162 'actions.at:755' \
   42957   "Printers and Destructors with union: %defines %skeleton \"lalr1.cc\"" "" 9
   42958 at_xfail=no
   42959 (
   42960   $as_echo "162. $at_setup_line: testing $at_desc ..."
   42961   $at_traceon
   42962 
   42963 
   42964 
   42965 # Make sure complex $n work.
   42966 
   42967 # Be sure to pass all the %directives to this macro to have correct
   42968 # helping macros.  So don't put any directly in the Bison file.
   42969 
   42970 cat >input.y <<'_ATEOF'
   42971 %code top {
   42972 #include <config.h>
   42973 /* We don't need perfect functions for these tests. */
   42974 #undef malloc
   42975 #undef memcmp
   42976 #undef realloc
   42977 }
   42978 
   42979 %code requires {
   42980 #include <stdio.h>
   42981 #include <stdlib.h>
   42982 #include <string.h>
   42983 #include <assert.h>
   42984 
   42985 #define YYINITDEPTH 10
   42986 #define YYMAXDEPTH 10
   42987 #define RANGE(Location) (Location).begin.line, (Location).end.line
   42988 
   42989 /* Display the symbol type Symbol.  */
   42990 #define V(Symbol, Value, Location, Sep) \
   42991    fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
   42992 }
   42993 
   42994 %error-verbose
   42995 %debug
   42996 %verbose
   42997 %locations
   42998 %defines %skeleton "lalr1.cc"
   42999 %union
   43000 {
   43001   int ival;
   43002 }
   43003 %define global_tokens_and_yystype
   43004 %code provides {
   43005 typedef yy::location YYLTYPE;
   43006 static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   43007 
   43008 }
   43009 
   43010 %type <ival> '(' 'x' 'y' ')' ';' thing line input END
   43011 
   43012 /* FIXME: This %printer isn't actually tested.  */
   43013 %printer
   43014   {
   43015     debug_stream () << $$;;
   43016   }
   43017   input line thing 'x' 'y'
   43018 
   43019 %destructor
   43020   { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   43021   input
   43022 
   43023 %destructor
   43024   { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   43025   line
   43026 
   43027 %destructor
   43028   { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   43029   thing
   43030 
   43031 %destructor
   43032   { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   43033   'x'
   43034 
   43035 %destructor
   43036   { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   43037   'y'
   43038 
   43039 %token END 0
   43040 %destructor
   43041   { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
   43042   END
   43043 
   43044 %%
   43045 /*
   43046    This grammar is made to exercise error recovery.
   43047    "Lines" starting with `(' support error recovery, with
   43048    ')' as synchronizing token.  Lines starting with 'x' can never
   43049    be recovered from if in error.
   43050 */
   43051 
   43052 input:
   43053   /* Nothing. */
   43054     {
   43055       $$ = 0;
   43056       V(input, $$, @$, ": /* Nothing */\n");
   43057     }
   43058 | line input /* Right recursive to load the stack so that popping at
   43059                 END can be exercised.  */
   43060     {
   43061       $$ = 2;
   43062       V(input, $$, @$, ": ");
   43063       V(line,  $1, @1, " ");
   43064       V(input, $2, @2, "\n");
   43065     }
   43066 ;
   43067 
   43068 line:
   43069   thing thing thing ';'
   43070     {
   43071       $$ = $1;
   43072       V(line,  $$, @$, ": ");
   43073       V(thing, $1, @1, " ");
   43074       V(thing, $2, @2, " ");
   43075       V(thing, $3, @3, " ");
   43076       V(;,     $4, @4, "\n");
   43077     }
   43078 | '(' thing thing ')'
   43079     {
   43080       $$ = $1;
   43081       V(line,  $$, @$, ": ");
   43082       V('(',   $1, @1, " ");
   43083       V(thing, $2, @2, " ");
   43084       V(thing, $3, @3, " ");
   43085       V(')',   $4, @4, "\n");
   43086     }
   43087 | '(' thing ')'
   43088     {
   43089       $$ = $1;
   43090       V(line,  $$, @$, ": ");
   43091       V('(',   $1, @1, " ");
   43092       V(thing, $2, @2, " ");
   43093       V(')',   $3, @3, "\n");
   43094     }
   43095 | '(' error ')'
   43096     {
   43097       $$ = -1;
   43098       V(line,  $$, @$, ": ");
   43099       V('(',   $1, @1, " ");
   43100       fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
   43101       V(')',   $3, @3, "\n");
   43102     }
   43103 ;
   43104 
   43105 thing:
   43106   'x'
   43107     {
   43108       $$ = $1;
   43109       V(thing, $$, @$, ": ");
   43110       V('x',   $1, @1, "\n");
   43111     }
   43112 ;
   43113 %%
   43114 /* Alias to ARGV[1]. */
   43115 const char *source = YY_NULL;
   43116 
   43117 /* A C++ error reporting function.  */
   43118 void
   43119 yy::parser::error (const location_type& l, const std::string& m)
   43120 {
   43121   (void) l;
   43122   std::cerr << l << ": " << m << std::endl;
   43123 }
   43124 
   43125 static
   43126 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   43127 {
   43128   static unsigned int counter = 0;
   43129 
   43130   int c = (*lvalp).ival = counter++;
   43131   /* As in BASIC, line numbers go from 10 to 10.  */
   43132   (*llocp).begin.line = (*llocp).begin.column = 10 * c;
   43133   (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
   43134   assert (0 <= c && c <= strlen (source));
   43135   if (source[c])
   43136     fprintf (stderr, "sending: '%c'", source[c]);
   43137   else
   43138     fprintf (stderr, "sending: END");
   43139   fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
   43140   return source[c];
   43141 }
   43142 static bool yydebug;
   43143 int
   43144 yyparse ()
   43145 {
   43146   yy::parser parser;
   43147   parser.set_debug_level (yydebug);
   43148   return parser.parse ();
   43149 }
   43150 
   43151 
   43152 int
   43153 main (int argc, const char *argv[])
   43154 {
   43155   int status;
   43156   yydebug = !!getenv ("YYDEBUG");
   43157   assert (argc == 2);
   43158   source = argv[1];
   43159   status = yyparse ();
   43160   switch (status)
   43161     {
   43162       case 0: fprintf (stderr, "Successful parse.\n"); break;
   43163       case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
   43164       default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
   43165     }
   43166   return status;
   43167 }
   43168 _ATEOF
   43169 
   43170 
   43171 
   43172 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   43173   at_save_special_files
   43174   mkdir xml-tests
   43175     # Don't combine these Bison invocations since we want to be sure that
   43176   # --report=all isn't required to get the full XML file.
   43177   { set +x
   43178 $as_echo "$at_srcdir/actions.at:755: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   43179                   --graph=xml-tests/test.dot -o input.cc input.y"
   43180 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:755"
   43181 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   43182                   --graph=xml-tests/test.dot -o input.cc input.y
   43183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43184 at_status=$? at_failed=false
   43185 $at_check_filter
   43186 echo stderr:; cat "$at_stderr"
   43187 echo stdout:; cat "$at_stdout"
   43188 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43189 $at_failed && at_fn_log_failure
   43190 $at_traceon; }
   43191 
   43192   { set +x
   43193 $as_echo "$at_srcdir/actions.at:755: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   43194 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:755"
   43195 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   43196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43197 at_status=$? at_failed=false
   43198 $at_check_filter
   43199 echo stderr:; cat "$at_stderr"
   43200 echo stdout:; cat "$at_stdout"
   43201 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43202 $at_failed && at_fn_log_failure
   43203 $at_traceon; }
   43204 
   43205     cp xml-tests/test.output expout
   43206   { set +x
   43207 $as_echo "$at_srcdir/actions.at:755: \$XSLTPROC \\
   43208              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   43209              xml-tests/test.xml"
   43210 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:755"
   43211 ( $at_check_trace; $XSLTPROC \
   43212              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   43213              xml-tests/test.xml
   43214 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43215 at_status=$? at_failed=false
   43216 $at_check_filter
   43217 at_fn_diff_devnull "$at_stderr" || at_failed=:
   43218 $at_diff expout "$at_stdout" || at_failed=:
   43219 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43220 $at_failed && at_fn_log_failure
   43221 $at_traceon; }
   43222 
   43223   sort xml-tests/test.dot > expout
   43224   { set +x
   43225 $as_echo "$at_srcdir/actions.at:755: \$XSLTPROC \\
   43226              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   43227              xml-tests/test.xml | sort"
   43228 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:755"
   43229 ( $at_check_trace; $XSLTPROC \
   43230              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   43231              xml-tests/test.xml | sort
   43232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43233 at_status=$? at_failed=false
   43234 $at_check_filter
   43235 at_fn_diff_devnull "$at_stderr" || at_failed=:
   43236 $at_diff expout "$at_stdout" || at_failed=:
   43237 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43238 $at_failed && at_fn_log_failure
   43239 $at_traceon; }
   43240 
   43241   rm -rf xml-tests expout
   43242   at_restore_special_files
   43243 fi
   43244 { set +x
   43245 $as_echo "$at_srcdir/actions.at:755: bison -o input.cc input.y"
   43246 at_fn_check_prepare_trace "actions.at:755"
   43247 ( $at_check_trace; bison -o input.cc input.y
   43248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43249 at_status=$? at_failed=false
   43250 $at_check_filter
   43251 at_fn_diff_devnull "$at_stderr" || at_failed=:
   43252 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43253 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43254 $at_failed && at_fn_log_failure
   43255 $at_traceon; }
   43256 
   43257 
   43258 
   43259 { set +x
   43260 $as_echo "$at_srcdir/actions.at:755: \$BISON_CXX_WORKS"
   43261 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:755"
   43262 ( $at_check_trace; $BISON_CXX_WORKS
   43263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43264 at_status=$? at_failed=false
   43265 $at_check_filter
   43266 echo stderr:; cat "$at_stderr"
   43267 echo stdout:; cat "$at_stdout"
   43268 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43269 $at_failed && at_fn_log_failure
   43270 $at_traceon; }
   43271 
   43272 { set +x
   43273 $as_echo "$at_srcdir/actions.at:755: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   43274 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:755"
   43275 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   43276 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43277 at_status=$? at_failed=false
   43278 $at_check_filter
   43279 echo stderr:; cat "$at_stderr"
   43280 echo stdout:; cat "$at_stdout"
   43281 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43282 $at_failed && at_fn_log_failure
   43283 $at_traceon; }
   43284 
   43285 
   43286 
   43287 
   43288 # Check the location of "empty"
   43289 # -----------------------------
   43290 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   43291 # an empty "line" nterm.
   43292 # FIXME: This location is not satisfying.  Depend on the lookahead?
   43293 { set +x
   43294 $as_echo "$at_srcdir/actions.at:755:  \$PREPARSER ./input '(x)'"
   43295 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:755"
   43296 ( $at_check_trace;  $PREPARSER ./input '(x)'
   43297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43298 at_status=$? at_failed=false
   43299 $at_check_filter
   43300 echo stderr:; tee stderr <"$at_stderr"
   43301 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43302 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43303 $at_failed && at_fn_log_failure
   43304 $at_traceon; }
   43305 
   43306 { set +x
   43307 $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43308 at_fn_check_prepare_trace "actions.at:755"
   43309 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43310 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43311 at_status=$? at_failed=false
   43312 $at_check_filter
   43313 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43314 sending: 'x' (1@10-19)
   43315 thing (1@10-19): 'x' (1@10-19)
   43316 sending: ')' (2@20-29)
   43317 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   43318 sending: END (3@30-39)
   43319 input (0@29-29): /* Nothing */
   43320 input (2@0-29): line (0@0-29) input (0@29-29)
   43321 Freeing token END (3@30-39)
   43322 Freeing nterm input (2@0-29)
   43323 Successful parse.
   43324 " | \
   43325   $at_diff - "$at_stderr" || at_failed=:
   43326 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43327 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43328 $at_failed && at_fn_log_failure
   43329 $at_traceon; }
   43330 
   43331 
   43332 
   43333 
   43334 # Check locations in error recovery
   43335 # ---------------------------------
   43336 # '(y)' is an error, but can be recovered from.  But what's the location
   43337 # of the error itself ('y'), and of the resulting reduction ('(error)').
   43338 { set +x
   43339 $as_echo "$at_srcdir/actions.at:755:  \$PREPARSER ./input '(y)'"
   43340 at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:755"
   43341 ( $at_check_trace;  $PREPARSER ./input '(y)'
   43342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43343 at_status=$? at_failed=false
   43344 $at_check_filter
   43345 echo stderr:; tee stderr <"$at_stderr"
   43346 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43347 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43348 $at_failed && at_fn_log_failure
   43349 $at_traceon; }
   43350 
   43351 { set +x
   43352 $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43353 at_fn_check_prepare_trace "actions.at:755"
   43354 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43356 at_status=$? at_failed=false
   43357 $at_check_filter
   43358 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43359 sending: 'y' (1@10-19)
   43360 10.10-19.18: syntax error, unexpected 'y', expecting 'x'
   43361 Freeing token 'y' (1@10-19)
   43362 sending: ')' (2@20-29)
   43363 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   43364 sending: END (3@30-39)
   43365 input (0@29-29): /* Nothing */
   43366 input (2@0-29): line (-1@0-29) input (0@29-29)
   43367 Freeing token END (3@30-39)
   43368 Freeing nterm input (2@0-29)
   43369 Successful parse.
   43370 " | \
   43371   $at_diff - "$at_stderr" || at_failed=:
   43372 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43373 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43374 $at_failed && at_fn_log_failure
   43375 $at_traceon; }
   43376 
   43377 
   43378 
   43379 
   43380 # Syntax errors caught by the parser
   43381 # ----------------------------------
   43382 # Exercise the discarding of stack top and input until `error'
   43383 # can be reduced.
   43384 #
   43385 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   43386 #
   43387 # Load the stack and provoke an error that cannot be caught by the
   43388 # grammar, to check that the stack is cleared.  And make sure the
   43389 # lookahead is freed.
   43390 #
   43391 #     '(', 'x', ')',
   43392 #     '(', 'x', ')',
   43393 #     'y'
   43394 { set +x
   43395 $as_echo "$at_srcdir/actions.at:755:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   43396 at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:755"
   43397 ( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
   43398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43399 at_status=$? at_failed=false
   43400 $at_check_filter
   43401 echo stderr:; tee stderr <"$at_stderr"
   43402 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43403 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:755"
   43404 $at_failed && at_fn_log_failure
   43405 $at_traceon; }
   43406 
   43407 { set +x
   43408 $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43409 at_fn_check_prepare_trace "actions.at:755"
   43410 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43412 at_status=$? at_failed=false
   43413 $at_check_filter
   43414 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43415 sending: 'x' (1@10-19)
   43416 thing (1@10-19): 'x' (1@10-19)
   43417 sending: 'x' (2@20-29)
   43418 thing (2@20-29): 'x' (2@20-29)
   43419 sending: 'x' (3@30-39)
   43420 30.30-39.38: syntax error, unexpected 'x', expecting ')'
   43421 Freeing nterm thing (2@20-29)
   43422 Freeing nterm thing (1@10-19)
   43423 Freeing token 'x' (3@30-39)
   43424 sending: 'x' (4@40-49)
   43425 Freeing token 'x' (4@40-49)
   43426 sending: 'x' (5@50-59)
   43427 Freeing token 'x' (5@50-59)
   43428 sending: ')' (6@60-69)
   43429 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   43430 sending: '(' (7@70-79)
   43431 sending: 'x' (8@80-89)
   43432 thing (8@80-89): 'x' (8@80-89)
   43433 sending: ')' (9@90-99)
   43434 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   43435 sending: '(' (10@100-109)
   43436 sending: 'x' (11@110-119)
   43437 thing (11@110-119): 'x' (11@110-119)
   43438 sending: ')' (12@120-129)
   43439 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   43440 sending: 'y' (13@130-139)
   43441 input (0@129-129): /* Nothing */
   43442 input (2@100-129): line (10@100-129) input (0@129-129)
   43443 input (2@70-129): line (7@70-99) input (2@100-129)
   43444 input (2@0-129): line (-1@0-69) input (2@70-129)
   43445 130.130-139.138: syntax error, unexpected 'y', expecting END
   43446 Freeing nterm input (2@0-129)
   43447 Freeing token 'y' (13@130-139)
   43448 Parsing FAILED.
   43449 " | \
   43450   $at_diff - "$at_stderr" || at_failed=:
   43451 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43452 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43453 $at_failed && at_fn_log_failure
   43454 $at_traceon; }
   43455 
   43456 
   43457 
   43458 
   43459 # Syntax error caught by the parser where lookahead = END
   43460 # --------------------------------------------------------
   43461 # Load the stack and provoke an error that cannot be caught by the
   43462 # grammar, to check that the stack is cleared.  And make sure the
   43463 # lookahead is freed.
   43464 #
   43465 #     '(', 'x', ')',
   43466 #     '(', 'x', ')',
   43467 #     'x'
   43468 { set +x
   43469 $as_echo "$at_srcdir/actions.at:755:  \$PREPARSER ./input '(x)(x)x'"
   43470 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:755"
   43471 ( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
   43472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43473 at_status=$? at_failed=false
   43474 $at_check_filter
   43475 echo stderr:; tee stderr <"$at_stderr"
   43476 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43477 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:755"
   43478 $at_failed && at_fn_log_failure
   43479 $at_traceon; }
   43480 
   43481 { set +x
   43482 $as_echo "$at_srcdir/actions.at:755: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43483 at_fn_check_prepare_trace "actions.at:755"
   43484 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43486 at_status=$? at_failed=false
   43487 $at_check_filter
   43488 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43489 sending: 'x' (1@10-19)
   43490 thing (1@10-19): 'x' (1@10-19)
   43491 sending: ')' (2@20-29)
   43492 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   43493 sending: '(' (3@30-39)
   43494 sending: 'x' (4@40-49)
   43495 thing (4@40-49): 'x' (4@40-49)
   43496 sending: ')' (5@50-59)
   43497 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   43498 sending: 'x' (6@60-69)
   43499 thing (6@60-69): 'x' (6@60-69)
   43500 sending: END (7@70-79)
   43501 70.70-79.78: syntax error, unexpected END, expecting 'x'
   43502 Freeing nterm thing (6@60-69)
   43503 Freeing nterm line (3@30-59)
   43504 Freeing nterm line (0@0-29)
   43505 Freeing token END (7@70-79)
   43506 Parsing FAILED.
   43507 " | \
   43508   $at_diff - "$at_stderr" || at_failed=:
   43509 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43510 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:755"
   43511 $at_failed && at_fn_log_failure
   43512 $at_traceon; }
   43513 
   43514 
   43515 
   43516 
   43517 # Check destruction upon stack overflow
   43518 # -------------------------------------
   43519 # Upon stack overflow, all symbols on the stack should be destroyed.
   43520 # Only check for yacc.c.
   43521 
   43522 
   43523 
   43524 
   43525 
   43526   set +x
   43527   $at_times_p && times >"$at_times_file"
   43528 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   43529 read at_status <"$at_status_file"
   43530 #AT_STOP_162
   43531 #AT_START_163
   43532 at_fn_group_banner 163 'actions.at:757' \
   43533   "Printers and Destructors: %glr-parser" "          " 9
   43534 at_xfail=no
   43535 (
   43536   $as_echo "163. $at_setup_line: testing $at_desc ..."
   43537   $at_traceon
   43538 
   43539 
   43540 
   43541 # Make sure complex $n work.
   43542 
   43543 # Be sure to pass all the %directives to this macro to have correct
   43544 # helping macros.  So don't put any directly in the Bison file.
   43545 
   43546 cat >input.y <<'_ATEOF'
   43547 %code top {
   43548 #include <config.h>
   43549 /* We don't need perfect functions for these tests. */
   43550 #undef malloc
   43551 #undef memcmp
   43552 #undef realloc
   43553 }
   43554 
   43555 %code requires {
   43556 #include <stdio.h>
   43557 #include <stdlib.h>
   43558 #include <string.h>
   43559 #include <assert.h>
   43560 
   43561 #define YYINITDEPTH 10
   43562 #define YYMAXDEPTH 10
   43563 #define RANGE(Location) (Location).first_line, (Location).last_line
   43564 
   43565 /* Display the symbol type Symbol.  */
   43566 #define V(Symbol, Value, Location, Sep) \
   43567    fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
   43568 }
   43569 
   43570 %error-verbose
   43571 %debug
   43572 %verbose
   43573 %locations
   43574 %glr-parser
   43575 
   43576 
   43577 %code {
   43578 
   43579 static int yylex (void);
   43580 static void yyerror ( const char *msg);
   43581 }
   43582 
   43583 
   43584 
   43585 /* FIXME: This %printer isn't actually tested.  */
   43586 %printer
   43587   {
   43588     fprintf (yyoutput, "%d", $$);
   43589   }
   43590   input line thing 'x' 'y'
   43591 
   43592 %destructor
   43593   { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   43594   input
   43595 
   43596 %destructor
   43597   { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   43598   line
   43599 
   43600 %destructor
   43601   { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   43602   thing
   43603 
   43604 %destructor
   43605   { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   43606   'x'
   43607 
   43608 %destructor
   43609   { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   43610   'y'
   43611 
   43612 %token END 0
   43613 %destructor
   43614   { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
   43615   END
   43616 
   43617 %%
   43618 /*
   43619    This grammar is made to exercise error recovery.
   43620    "Lines" starting with `(' support error recovery, with
   43621    ')' as synchronizing token.  Lines starting with 'x' can never
   43622    be recovered from if in error.
   43623 */
   43624 
   43625 input:
   43626   /* Nothing. */
   43627     {
   43628       $$ = 0;
   43629       V(input, $$, @$, ": /* Nothing */\n");
   43630     }
   43631 | line input /* Right recursive to load the stack so that popping at
   43632                 END can be exercised.  */
   43633     {
   43634       $$ = 2;
   43635       V(input, $$, @$, ": ");
   43636       V(line,  $1, @1, " ");
   43637       V(input, $2, @2, "\n");
   43638     }
   43639 ;
   43640 
   43641 line:
   43642   thing thing thing ';'
   43643     {
   43644       $$ = $1;
   43645       V(line,  $$, @$, ": ");
   43646       V(thing, $1, @1, " ");
   43647       V(thing, $2, @2, " ");
   43648       V(thing, $3, @3, " ");
   43649       V(;,     $4, @4, "\n");
   43650     }
   43651 | '(' thing thing ')'
   43652     {
   43653       $$ = $1;
   43654       V(line,  $$, @$, ": ");
   43655       V('(',   $1, @1, " ");
   43656       V(thing, $2, @2, " ");
   43657       V(thing, $3, @3, " ");
   43658       V(')',   $4, @4, "\n");
   43659     }
   43660 | '(' thing ')'
   43661     {
   43662       $$ = $1;
   43663       V(line,  $$, @$, ": ");
   43664       V('(',   $1, @1, " ");
   43665       V(thing, $2, @2, " ");
   43666       V(')',   $3, @3, "\n");
   43667     }
   43668 | '(' error ')'
   43669     {
   43670       $$ = -1;
   43671       V(line,  $$, @$, ": ");
   43672       V('(',   $1, @1, " ");
   43673       fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
   43674       V(')',   $3, @3, "\n");
   43675     }
   43676 ;
   43677 
   43678 thing:
   43679   'x'
   43680     {
   43681       $$ = $1;
   43682       V(thing, $$, @$, ": ");
   43683       V('x',   $1, @1, "\n");
   43684     }
   43685 ;
   43686 %%
   43687 /* Alias to ARGV[1]. */
   43688 const char *source = YY_NULL;
   43689 
   43690 #include <stdio.h>
   43691 /* A C error reporting function.  */
   43692 static
   43693 void yyerror ( const char *msg)
   43694 {
   43695   YY_LOCATION_PRINT (stderr, (yylloc));
   43696   fprintf (stderr, ": ");
   43697   fprintf (stderr, "%s\n", msg);
   43698 }
   43699 
   43700 static
   43701 int yylex (void)
   43702 {
   43703   static unsigned int counter = 0;
   43704 
   43705   int c = (yylval) = counter++;
   43706   /* As in BASIC, line numbers go from 10 to 10.  */
   43707   (yylloc).first_line = (yylloc).first_column = 10 * c;
   43708   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   43709   assert (0 <= c && c <= strlen (source));
   43710   if (source[c])
   43711     fprintf (stderr, "sending: '%c'", source[c]);
   43712   else
   43713     fprintf (stderr, "sending: END");
   43714   fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
   43715   return source[c];
   43716 }
   43717 
   43718 
   43719 int
   43720 main (int argc, const char *argv[])
   43721 {
   43722   int status;
   43723   yydebug = !!getenv ("YYDEBUG");
   43724   assert (argc == 2);
   43725   source = argv[1];
   43726   status = yyparse ();
   43727   switch (status)
   43728     {
   43729       case 0: fprintf (stderr, "Successful parse.\n"); break;
   43730       case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
   43731       default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
   43732     }
   43733   return status;
   43734 }
   43735 _ATEOF
   43736 
   43737 
   43738 
   43739 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   43740   at_save_special_files
   43741   mkdir xml-tests
   43742     # Don't combine these Bison invocations since we want to be sure that
   43743   # --report=all isn't required to get the full XML file.
   43744   { set +x
   43745 $as_echo "$at_srcdir/actions.at:757: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   43746                   --graph=xml-tests/test.dot -o input.c input.y"
   43747 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:757"
   43748 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   43749                   --graph=xml-tests/test.dot -o input.c input.y
   43750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43751 at_status=$? at_failed=false
   43752 $at_check_filter
   43753 echo stderr:; cat "$at_stderr"
   43754 echo stdout:; cat "$at_stdout"
   43755 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43756 $at_failed && at_fn_log_failure
   43757 $at_traceon; }
   43758 
   43759   { set +x
   43760 $as_echo "$at_srcdir/actions.at:757: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   43761 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:757"
   43762 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   43763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43764 at_status=$? at_failed=false
   43765 $at_check_filter
   43766 echo stderr:; cat "$at_stderr"
   43767 echo stdout:; cat "$at_stdout"
   43768 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43769 $at_failed && at_fn_log_failure
   43770 $at_traceon; }
   43771 
   43772     cp xml-tests/test.output expout
   43773   { set +x
   43774 $as_echo "$at_srcdir/actions.at:757: \$XSLTPROC \\
   43775              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   43776              xml-tests/test.xml"
   43777 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:757"
   43778 ( $at_check_trace; $XSLTPROC \
   43779              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   43780              xml-tests/test.xml
   43781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43782 at_status=$? at_failed=false
   43783 $at_check_filter
   43784 at_fn_diff_devnull "$at_stderr" || at_failed=:
   43785 $at_diff expout "$at_stdout" || at_failed=:
   43786 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43787 $at_failed && at_fn_log_failure
   43788 $at_traceon; }
   43789 
   43790   sort xml-tests/test.dot > expout
   43791   { set +x
   43792 $as_echo "$at_srcdir/actions.at:757: \$XSLTPROC \\
   43793              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   43794              xml-tests/test.xml | sort"
   43795 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:757"
   43796 ( $at_check_trace; $XSLTPROC \
   43797              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   43798              xml-tests/test.xml | sort
   43799 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43800 at_status=$? at_failed=false
   43801 $at_check_filter
   43802 at_fn_diff_devnull "$at_stderr" || at_failed=:
   43803 $at_diff expout "$at_stdout" || at_failed=:
   43804 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43805 $at_failed && at_fn_log_failure
   43806 $at_traceon; }
   43807 
   43808   rm -rf xml-tests expout
   43809   at_restore_special_files
   43810 fi
   43811 { set +x
   43812 $as_echo "$at_srcdir/actions.at:757: bison -o input.c input.y"
   43813 at_fn_check_prepare_trace "actions.at:757"
   43814 ( $at_check_trace; bison -o input.c input.y
   43815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43816 at_status=$? at_failed=false
   43817 $at_check_filter
   43818 at_fn_diff_devnull "$at_stderr" || at_failed=:
   43819 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43820 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43821 $at_failed && at_fn_log_failure
   43822 $at_traceon; }
   43823 
   43824 
   43825    { set +x
   43826 $as_echo "$at_srcdir/actions.at:757: \$BISON_C_WORKS"
   43827 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:757"
   43828 ( $at_check_trace; $BISON_C_WORKS
   43829 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43830 at_status=$? at_failed=false
   43831 $at_check_filter
   43832 echo stderr:; cat "$at_stderr"
   43833 echo stdout:; cat "$at_stdout"
   43834 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43835 $at_failed && at_fn_log_failure
   43836 $at_traceon; }
   43837 
   43838 { set +x
   43839 $as_echo "$at_srcdir/actions.at:757: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   43840 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:757"
   43841 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   43842 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43843 at_status=$? at_failed=false
   43844 $at_check_filter
   43845 echo stderr:; cat "$at_stderr"
   43846 echo stdout:; cat "$at_stdout"
   43847 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43848 $at_failed && at_fn_log_failure
   43849 $at_traceon; }
   43850 
   43851 
   43852 
   43853 
   43854 # Check the location of "empty"
   43855 # -----------------------------
   43856 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   43857 # an empty "line" nterm.
   43858 # FIXME: This location is not satisfying.  Depend on the lookahead?
   43859 { set +x
   43860 $as_echo "$at_srcdir/actions.at:757:  \$PREPARSER ./input '(x)'"
   43861 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:757"
   43862 ( $at_check_trace;  $PREPARSER ./input '(x)'
   43863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43864 at_status=$? at_failed=false
   43865 $at_check_filter
   43866 echo stderr:; tee stderr <"$at_stderr"
   43867 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43868 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43869 $at_failed && at_fn_log_failure
   43870 $at_traceon; }
   43871 
   43872 { set +x
   43873 $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43874 at_fn_check_prepare_trace "actions.at:757"
   43875 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43877 at_status=$? at_failed=false
   43878 $at_check_filter
   43879 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43880 sending: 'x' (1@10-19)
   43881 thing (1@10-19): 'x' (1@10-19)
   43882 sending: ')' (2@20-29)
   43883 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   43884 sending: END (3@30-39)
   43885 input (0@29-29): /* Nothing */
   43886 input (2@0-29): line (0@0-29) input (0@29-29)
   43887 Freeing token END (3@30-39)
   43888 Freeing nterm input (2@0-29)
   43889 Successful parse.
   43890 " | \
   43891   $at_diff - "$at_stderr" || at_failed=:
   43892 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43893 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43894 $at_failed && at_fn_log_failure
   43895 $at_traceon; }
   43896 
   43897 
   43898 
   43899 
   43900 # Check locations in error recovery
   43901 # ---------------------------------
   43902 # '(y)' is an error, but can be recovered from.  But what's the location
   43903 # of the error itself ('y'), and of the resulting reduction ('(error)').
   43904 { set +x
   43905 $as_echo "$at_srcdir/actions.at:757:  \$PREPARSER ./input '(y)'"
   43906 at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:757"
   43907 ( $at_check_trace;  $PREPARSER ./input '(y)'
   43908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43909 at_status=$? at_failed=false
   43910 $at_check_filter
   43911 echo stderr:; tee stderr <"$at_stderr"
   43912 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43913 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43914 $at_failed && at_fn_log_failure
   43915 $at_traceon; }
   43916 
   43917 { set +x
   43918 $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43919 at_fn_check_prepare_trace "actions.at:757"
   43920 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43922 at_status=$? at_failed=false
   43923 $at_check_filter
   43924 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43925 sending: 'y' (1@10-19)
   43926 10.10-19.18: syntax error, unexpected 'y', expecting 'x'
   43927 Freeing token 'y' (1@10-19)
   43928 sending: ')' (2@20-29)
   43929 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   43930 sending: END (3@30-39)
   43931 input (0@29-29): /* Nothing */
   43932 input (2@0-29): line (-1@0-29) input (0@29-29)
   43933 Freeing token END (3@30-39)
   43934 Freeing nterm input (2@0-29)
   43935 Successful parse.
   43936 " | \
   43937   $at_diff - "$at_stderr" || at_failed=:
   43938 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43939 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   43940 $at_failed && at_fn_log_failure
   43941 $at_traceon; }
   43942 
   43943 
   43944 
   43945 
   43946 # Syntax errors caught by the parser
   43947 # ----------------------------------
   43948 # Exercise the discarding of stack top and input until `error'
   43949 # can be reduced.
   43950 #
   43951 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   43952 #
   43953 # Load the stack and provoke an error that cannot be caught by the
   43954 # grammar, to check that the stack is cleared.  And make sure the
   43955 # lookahead is freed.
   43956 #
   43957 #     '(', 'x', ')',
   43958 #     '(', 'x', ')',
   43959 #     'y'
   43960 { set +x
   43961 $as_echo "$at_srcdir/actions.at:757:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   43962 at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:757"
   43963 ( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
   43964 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43965 at_status=$? at_failed=false
   43966 $at_check_filter
   43967 echo stderr:; tee stderr <"$at_stderr"
   43968 at_fn_diff_devnull "$at_stdout" || at_failed=:
   43969 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:757"
   43970 $at_failed && at_fn_log_failure
   43971 $at_traceon; }
   43972 
   43973 { set +x
   43974 $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   43975 at_fn_check_prepare_trace "actions.at:757"
   43976 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   43977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   43978 at_status=$? at_failed=false
   43979 $at_check_filter
   43980 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   43981 sending: 'x' (1@10-19)
   43982 thing (1@10-19): 'x' (1@10-19)
   43983 sending: 'x' (2@20-29)
   43984 thing (2@20-29): 'x' (2@20-29)
   43985 sending: 'x' (3@30-39)
   43986 30.30-39.38: syntax error, unexpected 'x', expecting ')'
   43987 Freeing nterm thing (2@20-29)
   43988 Freeing nterm thing (1@10-19)
   43989 Freeing token 'x' (3@30-39)
   43990 sending: 'x' (4@40-49)
   43991 Freeing token 'x' (4@40-49)
   43992 sending: 'x' (5@50-59)
   43993 Freeing token 'x' (5@50-59)
   43994 sending: ')' (6@60-69)
   43995 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   43996 sending: '(' (7@70-79)
   43997 sending: 'x' (8@80-89)
   43998 thing (8@80-89): 'x' (8@80-89)
   43999 sending: ')' (9@90-99)
   44000 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   44001 sending: '(' (10@100-109)
   44002 sending: 'x' (11@110-119)
   44003 thing (11@110-119): 'x' (11@110-119)
   44004 sending: ')' (12@120-129)
   44005 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   44006 sending: 'y' (13@130-139)
   44007 input (0@129-129): /* Nothing */
   44008 input (2@100-129): line (10@100-129) input (0@129-129)
   44009 input (2@70-129): line (7@70-99) input (2@100-129)
   44010 input (2@0-129): line (-1@0-69) input (2@70-129)
   44011 130.130-139.138: syntax error, unexpected 'y', expecting END
   44012 Freeing nterm input (2@0-129)
   44013 Freeing token 'y' (13@130-139)
   44014 Parsing FAILED.
   44015 " | \
   44016   $at_diff - "$at_stderr" || at_failed=:
   44017 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44018 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   44019 $at_failed && at_fn_log_failure
   44020 $at_traceon; }
   44021 
   44022 
   44023 
   44024 
   44025 # Syntax error caught by the parser where lookahead = END
   44026 # --------------------------------------------------------
   44027 # Load the stack and provoke an error that cannot be caught by the
   44028 # grammar, to check that the stack is cleared.  And make sure the
   44029 # lookahead is freed.
   44030 #
   44031 #     '(', 'x', ')',
   44032 #     '(', 'x', ')',
   44033 #     'x'
   44034 { set +x
   44035 $as_echo "$at_srcdir/actions.at:757:  \$PREPARSER ./input '(x)(x)x'"
   44036 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:757"
   44037 ( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
   44038 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44039 at_status=$? at_failed=false
   44040 $at_check_filter
   44041 echo stderr:; tee stderr <"$at_stderr"
   44042 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44043 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:757"
   44044 $at_failed && at_fn_log_failure
   44045 $at_traceon; }
   44046 
   44047 { set +x
   44048 $as_echo "$at_srcdir/actions.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   44049 at_fn_check_prepare_trace "actions.at:757"
   44050 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   44051 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44052 at_status=$? at_failed=false
   44053 $at_check_filter
   44054 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   44055 sending: 'x' (1@10-19)
   44056 thing (1@10-19): 'x' (1@10-19)
   44057 sending: ')' (2@20-29)
   44058 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   44059 sending: '(' (3@30-39)
   44060 sending: 'x' (4@40-49)
   44061 thing (4@40-49): 'x' (4@40-49)
   44062 sending: ')' (5@50-59)
   44063 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   44064 sending: 'x' (6@60-69)
   44065 thing (6@60-69): 'x' (6@60-69)
   44066 sending: END (7@70-79)
   44067 70.70-79.78: syntax error, unexpected END, expecting 'x'
   44068 Freeing nterm thing (6@60-69)
   44069 Freeing nterm line (3@30-59)
   44070 Freeing nterm line (0@0-29)
   44071 Freeing token END (7@70-79)
   44072 Parsing FAILED.
   44073 " | \
   44074   $at_diff - "$at_stderr" || at_failed=:
   44075 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44076 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:757"
   44077 $at_failed && at_fn_log_failure
   44078 $at_traceon; }
   44079 
   44080 
   44081 
   44082 
   44083 # Check destruction upon stack overflow
   44084 # -------------------------------------
   44085 # Upon stack overflow, all symbols on the stack should be destroyed.
   44086 # Only check for yacc.c.
   44087 
   44088 
   44089 
   44090 
   44091 
   44092   set +x
   44093   $at_times_p && times >"$at_times_file"
   44094 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   44095 read at_status <"$at_status_file"
   44096 #AT_STOP_163
   44097 #AT_START_164
   44098 at_fn_group_banner 164 'actions.at:758' \
   44099   "Printers and Destructors with union: %glr-parser" "" 9
   44100 at_xfail=no
   44101 (
   44102   $as_echo "164. $at_setup_line: testing $at_desc ..."
   44103   $at_traceon
   44104 
   44105 
   44106 
   44107 # Make sure complex $n work.
   44108 
   44109 # Be sure to pass all the %directives to this macro to have correct
   44110 # helping macros.  So don't put any directly in the Bison file.
   44111 
   44112 cat >input.y <<'_ATEOF'
   44113 %code top {
   44114 #include <config.h>
   44115 /* We don't need perfect functions for these tests. */
   44116 #undef malloc
   44117 #undef memcmp
   44118 #undef realloc
   44119 }
   44120 
   44121 %code requires {
   44122 #include <stdio.h>
   44123 #include <stdlib.h>
   44124 #include <string.h>
   44125 #include <assert.h>
   44126 
   44127 #define YYINITDEPTH 10
   44128 #define YYMAXDEPTH 10
   44129 #define RANGE(Location) (Location).first_line, (Location).last_line
   44130 
   44131 /* Display the symbol type Symbol.  */
   44132 #define V(Symbol, Value, Location, Sep) \
   44133    fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
   44134 }
   44135 
   44136 %error-verbose
   44137 %debug
   44138 %verbose
   44139 %locations
   44140 %glr-parser
   44141 %union
   44142 {
   44143   int ival;
   44144 }
   44145 
   44146 %code provides {
   44147 
   44148 static int yylex (void);
   44149 static void yyerror ( const char *msg);
   44150 }
   44151 
   44152 %type <ival> '(' 'x' 'y' ')' ';' thing line input END
   44153 
   44154 /* FIXME: This %printer isn't actually tested.  */
   44155 %printer
   44156   {
   44157     fprintf (yyoutput, "%d", $$);
   44158   }
   44159   input line thing 'x' 'y'
   44160 
   44161 %destructor
   44162   { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   44163   input
   44164 
   44165 %destructor
   44166   { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   44167   line
   44168 
   44169 %destructor
   44170   { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   44171   thing
   44172 
   44173 %destructor
   44174   { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   44175   'x'
   44176 
   44177 %destructor
   44178   { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   44179   'y'
   44180 
   44181 %token END 0
   44182 %destructor
   44183   { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
   44184   END
   44185 
   44186 %%
   44187 /*
   44188    This grammar is made to exercise error recovery.
   44189    "Lines" starting with `(' support error recovery, with
   44190    ')' as synchronizing token.  Lines starting with 'x' can never
   44191    be recovered from if in error.
   44192 */
   44193 
   44194 input:
   44195   /* Nothing. */
   44196     {
   44197       $$ = 0;
   44198       V(input, $$, @$, ": /* Nothing */\n");
   44199     }
   44200 | line input /* Right recursive to load the stack so that popping at
   44201                 END can be exercised.  */
   44202     {
   44203       $$ = 2;
   44204       V(input, $$, @$, ": ");
   44205       V(line,  $1, @1, " ");
   44206       V(input, $2, @2, "\n");
   44207     }
   44208 ;
   44209 
   44210 line:
   44211   thing thing thing ';'
   44212     {
   44213       $$ = $1;
   44214       V(line,  $$, @$, ": ");
   44215       V(thing, $1, @1, " ");
   44216       V(thing, $2, @2, " ");
   44217       V(thing, $3, @3, " ");
   44218       V(;,     $4, @4, "\n");
   44219     }
   44220 | '(' thing thing ')'
   44221     {
   44222       $$ = $1;
   44223       V(line,  $$, @$, ": ");
   44224       V('(',   $1, @1, " ");
   44225       V(thing, $2, @2, " ");
   44226       V(thing, $3, @3, " ");
   44227       V(')',   $4, @4, "\n");
   44228     }
   44229 | '(' thing ')'
   44230     {
   44231       $$ = $1;
   44232       V(line,  $$, @$, ": ");
   44233       V('(',   $1, @1, " ");
   44234       V(thing, $2, @2, " ");
   44235       V(')',   $3, @3, "\n");
   44236     }
   44237 | '(' error ')'
   44238     {
   44239       $$ = -1;
   44240       V(line,  $$, @$, ": ");
   44241       V('(',   $1, @1, " ");
   44242       fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
   44243       V(')',   $3, @3, "\n");
   44244     }
   44245 ;
   44246 
   44247 thing:
   44248   'x'
   44249     {
   44250       $$ = $1;
   44251       V(thing, $$, @$, ": ");
   44252       V('x',   $1, @1, "\n");
   44253     }
   44254 ;
   44255 %%
   44256 /* Alias to ARGV[1]. */
   44257 const char *source = YY_NULL;
   44258 
   44259 #include <stdio.h>
   44260 /* A C error reporting function.  */
   44261 static
   44262 void yyerror ( const char *msg)
   44263 {
   44264   YY_LOCATION_PRINT (stderr, (yylloc));
   44265   fprintf (stderr, ": ");
   44266   fprintf (stderr, "%s\n", msg);
   44267 }
   44268 
   44269 static
   44270 int yylex (void)
   44271 {
   44272   static unsigned int counter = 0;
   44273 
   44274   int c = (yylval).ival = counter++;
   44275   /* As in BASIC, line numbers go from 10 to 10.  */
   44276   (yylloc).first_line = (yylloc).first_column = 10 * c;
   44277   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   44278   assert (0 <= c && c <= strlen (source));
   44279   if (source[c])
   44280     fprintf (stderr, "sending: '%c'", source[c]);
   44281   else
   44282     fprintf (stderr, "sending: END");
   44283   fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
   44284   return source[c];
   44285 }
   44286 
   44287 
   44288 int
   44289 main (int argc, const char *argv[])
   44290 {
   44291   int status;
   44292   yydebug = !!getenv ("YYDEBUG");
   44293   assert (argc == 2);
   44294   source = argv[1];
   44295   status = yyparse ();
   44296   switch (status)
   44297     {
   44298       case 0: fprintf (stderr, "Successful parse.\n"); break;
   44299       case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
   44300       default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
   44301     }
   44302   return status;
   44303 }
   44304 _ATEOF
   44305 
   44306 
   44307 
   44308 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   44309   at_save_special_files
   44310   mkdir xml-tests
   44311     # Don't combine these Bison invocations since we want to be sure that
   44312   # --report=all isn't required to get the full XML file.
   44313   { set +x
   44314 $as_echo "$at_srcdir/actions.at:758: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   44315                   --graph=xml-tests/test.dot -o input.c input.y"
   44316 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:758"
   44317 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   44318                   --graph=xml-tests/test.dot -o input.c input.y
   44319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44320 at_status=$? at_failed=false
   44321 $at_check_filter
   44322 echo stderr:; cat "$at_stderr"
   44323 echo stdout:; cat "$at_stdout"
   44324 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44325 $at_failed && at_fn_log_failure
   44326 $at_traceon; }
   44327 
   44328   { set +x
   44329 $as_echo "$at_srcdir/actions.at:758: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   44330 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:758"
   44331 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   44332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44333 at_status=$? at_failed=false
   44334 $at_check_filter
   44335 echo stderr:; cat "$at_stderr"
   44336 echo stdout:; cat "$at_stdout"
   44337 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44338 $at_failed && at_fn_log_failure
   44339 $at_traceon; }
   44340 
   44341     cp xml-tests/test.output expout
   44342   { set +x
   44343 $as_echo "$at_srcdir/actions.at:758: \$XSLTPROC \\
   44344              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   44345              xml-tests/test.xml"
   44346 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:758"
   44347 ( $at_check_trace; $XSLTPROC \
   44348              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   44349              xml-tests/test.xml
   44350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44351 at_status=$? at_failed=false
   44352 $at_check_filter
   44353 at_fn_diff_devnull "$at_stderr" || at_failed=:
   44354 $at_diff expout "$at_stdout" || at_failed=:
   44355 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44356 $at_failed && at_fn_log_failure
   44357 $at_traceon; }
   44358 
   44359   sort xml-tests/test.dot > expout
   44360   { set +x
   44361 $as_echo "$at_srcdir/actions.at:758: \$XSLTPROC \\
   44362              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   44363              xml-tests/test.xml | sort"
   44364 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:758"
   44365 ( $at_check_trace; $XSLTPROC \
   44366              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   44367              xml-tests/test.xml | sort
   44368 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44369 at_status=$? at_failed=false
   44370 $at_check_filter
   44371 at_fn_diff_devnull "$at_stderr" || at_failed=:
   44372 $at_diff expout "$at_stdout" || at_failed=:
   44373 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44374 $at_failed && at_fn_log_failure
   44375 $at_traceon; }
   44376 
   44377   rm -rf xml-tests expout
   44378   at_restore_special_files
   44379 fi
   44380 { set +x
   44381 $as_echo "$at_srcdir/actions.at:758: bison -o input.c input.y"
   44382 at_fn_check_prepare_trace "actions.at:758"
   44383 ( $at_check_trace; bison -o input.c input.y
   44384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44385 at_status=$? at_failed=false
   44386 $at_check_filter
   44387 at_fn_diff_devnull "$at_stderr" || at_failed=:
   44388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44389 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44390 $at_failed && at_fn_log_failure
   44391 $at_traceon; }
   44392 
   44393 
   44394    { set +x
   44395 $as_echo "$at_srcdir/actions.at:758: \$BISON_C_WORKS"
   44396 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:758"
   44397 ( $at_check_trace; $BISON_C_WORKS
   44398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44399 at_status=$? at_failed=false
   44400 $at_check_filter
   44401 echo stderr:; cat "$at_stderr"
   44402 echo stdout:; cat "$at_stdout"
   44403 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44404 $at_failed && at_fn_log_failure
   44405 $at_traceon; }
   44406 
   44407 { set +x
   44408 $as_echo "$at_srcdir/actions.at:758: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   44409 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:758"
   44410 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   44411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44412 at_status=$? at_failed=false
   44413 $at_check_filter
   44414 echo stderr:; cat "$at_stderr"
   44415 echo stdout:; cat "$at_stdout"
   44416 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44417 $at_failed && at_fn_log_failure
   44418 $at_traceon; }
   44419 
   44420 
   44421 
   44422 
   44423 # Check the location of "empty"
   44424 # -----------------------------
   44425 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   44426 # an empty "line" nterm.
   44427 # FIXME: This location is not satisfying.  Depend on the lookahead?
   44428 { set +x
   44429 $as_echo "$at_srcdir/actions.at:758:  \$PREPARSER ./input '(x)'"
   44430 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:758"
   44431 ( $at_check_trace;  $PREPARSER ./input '(x)'
   44432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44433 at_status=$? at_failed=false
   44434 $at_check_filter
   44435 echo stderr:; tee stderr <"$at_stderr"
   44436 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44437 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44438 $at_failed && at_fn_log_failure
   44439 $at_traceon; }
   44440 
   44441 { set +x
   44442 $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   44443 at_fn_check_prepare_trace "actions.at:758"
   44444 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   44445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44446 at_status=$? at_failed=false
   44447 $at_check_filter
   44448 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   44449 sending: 'x' (1@10-19)
   44450 thing (1@10-19): 'x' (1@10-19)
   44451 sending: ')' (2@20-29)
   44452 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   44453 sending: END (3@30-39)
   44454 input (0@29-29): /* Nothing */
   44455 input (2@0-29): line (0@0-29) input (0@29-29)
   44456 Freeing token END (3@30-39)
   44457 Freeing nterm input (2@0-29)
   44458 Successful parse.
   44459 " | \
   44460   $at_diff - "$at_stderr" || at_failed=:
   44461 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44462 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44463 $at_failed && at_fn_log_failure
   44464 $at_traceon; }
   44465 
   44466 
   44467 
   44468 
   44469 # Check locations in error recovery
   44470 # ---------------------------------
   44471 # '(y)' is an error, but can be recovered from.  But what's the location
   44472 # of the error itself ('y'), and of the resulting reduction ('(error)').
   44473 { set +x
   44474 $as_echo "$at_srcdir/actions.at:758:  \$PREPARSER ./input '(y)'"
   44475 at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:758"
   44476 ( $at_check_trace;  $PREPARSER ./input '(y)'
   44477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44478 at_status=$? at_failed=false
   44479 $at_check_filter
   44480 echo stderr:; tee stderr <"$at_stderr"
   44481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44482 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44483 $at_failed && at_fn_log_failure
   44484 $at_traceon; }
   44485 
   44486 { set +x
   44487 $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   44488 at_fn_check_prepare_trace "actions.at:758"
   44489 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   44490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44491 at_status=$? at_failed=false
   44492 $at_check_filter
   44493 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   44494 sending: 'y' (1@10-19)
   44495 10.10-19.18: syntax error, unexpected 'y', expecting 'x'
   44496 Freeing token 'y' (1@10-19)
   44497 sending: ')' (2@20-29)
   44498 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   44499 sending: END (3@30-39)
   44500 input (0@29-29): /* Nothing */
   44501 input (2@0-29): line (-1@0-29) input (0@29-29)
   44502 Freeing token END (3@30-39)
   44503 Freeing nterm input (2@0-29)
   44504 Successful parse.
   44505 " | \
   44506   $at_diff - "$at_stderr" || at_failed=:
   44507 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44508 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44509 $at_failed && at_fn_log_failure
   44510 $at_traceon; }
   44511 
   44512 
   44513 
   44514 
   44515 # Syntax errors caught by the parser
   44516 # ----------------------------------
   44517 # Exercise the discarding of stack top and input until `error'
   44518 # can be reduced.
   44519 #
   44520 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   44521 #
   44522 # Load the stack and provoke an error that cannot be caught by the
   44523 # grammar, to check that the stack is cleared.  And make sure the
   44524 # lookahead is freed.
   44525 #
   44526 #     '(', 'x', ')',
   44527 #     '(', 'x', ')',
   44528 #     'y'
   44529 { set +x
   44530 $as_echo "$at_srcdir/actions.at:758:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   44531 at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:758"
   44532 ( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
   44533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44534 at_status=$? at_failed=false
   44535 $at_check_filter
   44536 echo stderr:; tee stderr <"$at_stderr"
   44537 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44538 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:758"
   44539 $at_failed && at_fn_log_failure
   44540 $at_traceon; }
   44541 
   44542 { set +x
   44543 $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   44544 at_fn_check_prepare_trace "actions.at:758"
   44545 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   44546 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44547 at_status=$? at_failed=false
   44548 $at_check_filter
   44549 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   44550 sending: 'x' (1@10-19)
   44551 thing (1@10-19): 'x' (1@10-19)
   44552 sending: 'x' (2@20-29)
   44553 thing (2@20-29): 'x' (2@20-29)
   44554 sending: 'x' (3@30-39)
   44555 30.30-39.38: syntax error, unexpected 'x', expecting ')'
   44556 Freeing nterm thing (2@20-29)
   44557 Freeing nterm thing (1@10-19)
   44558 Freeing token 'x' (3@30-39)
   44559 sending: 'x' (4@40-49)
   44560 Freeing token 'x' (4@40-49)
   44561 sending: 'x' (5@50-59)
   44562 Freeing token 'x' (5@50-59)
   44563 sending: ')' (6@60-69)
   44564 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   44565 sending: '(' (7@70-79)
   44566 sending: 'x' (8@80-89)
   44567 thing (8@80-89): 'x' (8@80-89)
   44568 sending: ')' (9@90-99)
   44569 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   44570 sending: '(' (10@100-109)
   44571 sending: 'x' (11@110-119)
   44572 thing (11@110-119): 'x' (11@110-119)
   44573 sending: ')' (12@120-129)
   44574 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   44575 sending: 'y' (13@130-139)
   44576 input (0@129-129): /* Nothing */
   44577 input (2@100-129): line (10@100-129) input (0@129-129)
   44578 input (2@70-129): line (7@70-99) input (2@100-129)
   44579 input (2@0-129): line (-1@0-69) input (2@70-129)
   44580 130.130-139.138: syntax error, unexpected 'y', expecting END
   44581 Freeing nterm input (2@0-129)
   44582 Freeing token 'y' (13@130-139)
   44583 Parsing FAILED.
   44584 " | \
   44585   $at_diff - "$at_stderr" || at_failed=:
   44586 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44587 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44588 $at_failed && at_fn_log_failure
   44589 $at_traceon; }
   44590 
   44591 
   44592 
   44593 
   44594 # Syntax error caught by the parser where lookahead = END
   44595 # --------------------------------------------------------
   44596 # Load the stack and provoke an error that cannot be caught by the
   44597 # grammar, to check that the stack is cleared.  And make sure the
   44598 # lookahead is freed.
   44599 #
   44600 #     '(', 'x', ')',
   44601 #     '(', 'x', ')',
   44602 #     'x'
   44603 { set +x
   44604 $as_echo "$at_srcdir/actions.at:758:  \$PREPARSER ./input '(x)(x)x'"
   44605 at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:758"
   44606 ( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
   44607 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44608 at_status=$? at_failed=false
   44609 $at_check_filter
   44610 echo stderr:; tee stderr <"$at_stderr"
   44611 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44612 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:758"
   44613 $at_failed && at_fn_log_failure
   44614 $at_traceon; }
   44615 
   44616 { set +x
   44617 $as_echo "$at_srcdir/actions.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   44618 at_fn_check_prepare_trace "actions.at:758"
   44619 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   44620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44621 at_status=$? at_failed=false
   44622 $at_check_filter
   44623 echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9)
   44624 sending: 'x' (1@10-19)
   44625 thing (1@10-19): 'x' (1@10-19)
   44626 sending: ')' (2@20-29)
   44627 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   44628 sending: '(' (3@30-39)
   44629 sending: 'x' (4@40-49)
   44630 thing (4@40-49): 'x' (4@40-49)
   44631 sending: ')' (5@50-59)
   44632 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   44633 sending: 'x' (6@60-69)
   44634 thing (6@60-69): 'x' (6@60-69)
   44635 sending: END (7@70-79)
   44636 70.70-79.78: syntax error, unexpected END, expecting 'x'
   44637 Freeing nterm thing (6@60-69)
   44638 Freeing nterm line (3@30-59)
   44639 Freeing nterm line (0@0-29)
   44640 Freeing token END (7@70-79)
   44641 Parsing FAILED.
   44642 " | \
   44643   $at_diff - "$at_stderr" || at_failed=:
   44644 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44645 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:758"
   44646 $at_failed && at_fn_log_failure
   44647 $at_traceon; }
   44648 
   44649 
   44650 
   44651 
   44652 # Check destruction upon stack overflow
   44653 # -------------------------------------
   44654 # Upon stack overflow, all symbols on the stack should be destroyed.
   44655 # Only check for yacc.c.
   44656 
   44657 
   44658 
   44659 
   44660 
   44661   set +x
   44662   $at_times_p && times >"$at_times_file"
   44663 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   44664 read at_status <"$at_status_file"
   44665 #AT_STOP_164
   44666 #AT_START_165
   44667 at_fn_group_banner 165 'actions.at:769' \
   44668   "Default tagless %printer and %destructor" "       " 9
   44669 at_xfail=no
   44670 (
   44671   $as_echo "165. $at_setup_line: testing $at_desc ..."
   44672   $at_traceon
   44673 
   44674 
   44675 cat >input.y <<'_ATEOF'
   44676 %code top {
   44677 #include <config.h>
   44678 /* We don't need perfect functions for these tests. */
   44679 #undef malloc
   44680 #undef memcmp
   44681 #undef realloc
   44682 }
   44683 
   44684 %error-verbose
   44685 %debug
   44686 %locations
   44687 
   44688 %{
   44689 # include <stdio.h>
   44690 # include <stdlib.h>
   44691 static int yylex (void);
   44692 static void yyerror ( const char *msg);
   44693 # define USE(SYM)
   44694 %}
   44695 
   44696 %printer {
   44697   fprintf (yyoutput, "<*> printer should not be called.\n");
   44698 } <*>
   44699 
   44700 %printer {
   44701   fprintf (yyoutput, "<> printer for '%c' @ %d", $$, @$.first_column);
   44702 } <>
   44703 %destructor {
   44704   fprintf (stdout, "<> destructor for '%c' @ %d.\n", $$, @$.first_column);
   44705 } <>
   44706 
   44707 %printer {
   44708   fprintf (yyoutput, "'b'/'c' printer for '%c' @ %d", $$, @$.first_column);
   44709 } 'b' 'c'
   44710 %destructor {
   44711   fprintf (stdout, "'b'/'c' destructor for '%c' @ %d.\n", $$, @$.first_column);
   44712 } 'b' 'c'
   44713 
   44714 %destructor {
   44715   fprintf (yyoutput, "<*> destructor should not be called.\n");
   44716 } <*>
   44717 
   44718 %%
   44719 
   44720 start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ;
   44721 
   44722 %%
   44723 #include <stdio.h>
   44724 /* A C error reporting function.  */
   44725 static
   44726 void yyerror ( const char *msg)
   44727 {
   44728   YY_LOCATION_PRINT (stderr, (yylloc));
   44729   fprintf (stderr, ": ");
   44730   fprintf (stderr, "%s\n", msg);
   44731 }
   44732 #include <assert.h>
   44733 static
   44734 int yylex (void)
   44735 {
   44736   static char const input[] = "abcd";
   44737   static size_t toknum = 0;
   44738   int res;
   44739   ;
   44740   assert (toknum < sizeof input / sizeof input[0]);
   44741   res = input[toknum++];
   44742   yylval = res;
   44743   (yylloc).first_line = (yylloc).last_line = 1;
   44744   (yylloc).first_column = (yylloc).last_column = toknum;
   44745   return res;
   44746 }
   44747 
   44748 int
   44749 main (void)
   44750 {
   44751   yydebug = 1;
   44752   return yyparse ();
   44753 }
   44754 _ATEOF
   44755 
   44756 
   44757 
   44758 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   44759   at_save_special_files
   44760   mkdir xml-tests
   44761     # Don't combine these Bison invocations since we want to be sure that
   44762   # --report=all isn't required to get the full XML file.
   44763   { set +x
   44764 $as_echo "$at_srcdir/actions.at:822: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   44765                   --graph=xml-tests/test.dot -o input.c input.y"
   44766 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:822"
   44767 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   44768                   --graph=xml-tests/test.dot -o input.c input.y
   44769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44770 at_status=$? at_failed=false
   44771 $at_check_filter
   44772 echo stderr:; cat "$at_stderr"
   44773 echo stdout:; cat "$at_stdout"
   44774 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822"
   44775 $at_failed && at_fn_log_failure
   44776 $at_traceon; }
   44777 
   44778   { set +x
   44779 $as_echo "$at_srcdir/actions.at:822: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   44780 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:822"
   44781 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   44782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44783 at_status=$? at_failed=false
   44784 $at_check_filter
   44785 echo stderr:; cat "$at_stderr"
   44786 echo stdout:; cat "$at_stdout"
   44787 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822"
   44788 $at_failed && at_fn_log_failure
   44789 $at_traceon; }
   44790 
   44791     cp xml-tests/test.output expout
   44792   { set +x
   44793 $as_echo "$at_srcdir/actions.at:822: \$XSLTPROC \\
   44794              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   44795              xml-tests/test.xml"
   44796 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:822"
   44797 ( $at_check_trace; $XSLTPROC \
   44798              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   44799              xml-tests/test.xml
   44800 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44801 at_status=$? at_failed=false
   44802 $at_check_filter
   44803 at_fn_diff_devnull "$at_stderr" || at_failed=:
   44804 $at_diff expout "$at_stdout" || at_failed=:
   44805 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822"
   44806 $at_failed && at_fn_log_failure
   44807 $at_traceon; }
   44808 
   44809   sort xml-tests/test.dot > expout
   44810   { set +x
   44811 $as_echo "$at_srcdir/actions.at:822: \$XSLTPROC \\
   44812              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   44813              xml-tests/test.xml | sort"
   44814 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:822"
   44815 ( $at_check_trace; $XSLTPROC \
   44816              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   44817              xml-tests/test.xml | sort
   44818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44819 at_status=$? at_failed=false
   44820 $at_check_filter
   44821 at_fn_diff_devnull "$at_stderr" || at_failed=:
   44822 $at_diff expout "$at_stdout" || at_failed=:
   44823 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822"
   44824 $at_failed && at_fn_log_failure
   44825 $at_traceon; }
   44826 
   44827   rm -rf xml-tests expout
   44828   at_restore_special_files
   44829 fi
   44830 { set +x
   44831 $as_echo "$at_srcdir/actions.at:822: bison -o input.c input.y"
   44832 at_fn_check_prepare_trace "actions.at:822"
   44833 ( $at_check_trace; bison -o input.c input.y
   44834 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44835 at_status=$? at_failed=false
   44836 $at_check_filter
   44837 at_fn_diff_devnull "$at_stderr" || at_failed=:
   44838 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44839 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:822"
   44840 $at_failed && at_fn_log_failure
   44841 $at_traceon; }
   44842 
   44843 
   44844 { set +x
   44845 $as_echo "$at_srcdir/actions.at:823: \$BISON_C_WORKS"
   44846 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:823"
   44847 ( $at_check_trace; $BISON_C_WORKS
   44848 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44849 at_status=$? at_failed=false
   44850 $at_check_filter
   44851 echo stderr:; cat "$at_stderr"
   44852 echo stdout:; cat "$at_stdout"
   44853 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:823"
   44854 $at_failed && at_fn_log_failure
   44855 $at_traceon; }
   44856 
   44857 { set +x
   44858 $as_echo "$at_srcdir/actions.at:823: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   44859 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:823"
   44860 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   44861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44862 at_status=$? at_failed=false
   44863 $at_check_filter
   44864 echo stderr:; cat "$at_stderr"
   44865 echo stdout:; cat "$at_stdout"
   44866 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:823"
   44867 $at_failed && at_fn_log_failure
   44868 $at_traceon; }
   44869 
   44870 { set +x
   44871 $as_echo "$at_srcdir/actions.at:824:  \$PREPARSER ./input"
   44872 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:824"
   44873 ( $at_check_trace;  $PREPARSER ./input
   44874 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44875 at_status=$? at_failed=false
   44876 $at_check_filter
   44877 echo stderr:; tee stderr <"$at_stderr"
   44878 echo >>"$at_stdout"; $as_echo "<> destructor for 'd' @ 4.
   44879 'b'/'c' destructor for 'c' @ 3.
   44880 'b'/'c' destructor for 'b' @ 2.
   44881 <> destructor for 'a' @ 1.
   44882 " | \
   44883   $at_diff - "$at_stdout" || at_failed=:
   44884 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:824"
   44885 $at_failed && at_fn_log_failure
   44886 $at_traceon; }
   44887 
   44888 { set +x
   44889 $as_echo "$at_srcdir/actions.at:824: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   44890 at_fn_check_prepare_trace "actions.at:824"
   44891 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   44892 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   44893 at_status=$? at_failed=false
   44894 $at_check_filter
   44895 echo >>"$at_stderr"; $as_echo "Starting parse
   44896 Entering state 0
   44897 Reading a token: Next token is token 'a' (1.1: <> printer for 'a' @ 1)
   44898 Shifting token 'a' (1.1: <> printer for 'a' @ 1)
   44899 Entering state 1
   44900 Reading a token: Next token is token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
   44901 Shifting token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
   44902 Entering state 3
   44903 Reading a token: Next token is token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
   44904 Shifting token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
   44905 Entering state 5
   44906 Reading a token: Next token is token 'd' (1.4: <> printer for 'd' @ 4)
   44907 Shifting token 'd' (1.4: <> printer for 'd' @ 4)
   44908 Entering state 6
   44909 Reading a token: Now at end of input.
   44910 1.5: syntax error, unexpected \$end, expecting 'e'
   44911 Error: popping token 'd' (1.4: <> printer for 'd' @ 4)
   44912 Stack now 0 1 3 5
   44913 Error: popping token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
   44914 Stack now 0 1 3
   44915 Error: popping token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
   44916 Stack now 0 1
   44917 Error: popping token 'a' (1.1: <> printer for 'a' @ 1)
   44918 Stack now 0
   44919 Cleanup: discarding lookahead token \$end (1.5: )
   44920 Stack now 0
   44921 " | \
   44922   $at_diff - "$at_stderr" || at_failed=:
   44923 at_fn_diff_devnull "$at_stdout" || at_failed=:
   44924 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:824"
   44925 $at_failed && at_fn_log_failure
   44926 $at_traceon; }
   44927 
   44928 
   44929 
   44930 
   44931   set +x
   44932   $at_times_p && times >"$at_times_file"
   44933 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   44934 read at_status <"$at_status_file"
   44935 #AT_STOP_165
   44936 #AT_START_166
   44937 at_fn_group_banner 166 'actions.at:867' \
   44938   "Default tagged and per-type %printer and %destructor" "" 9
   44939 at_xfail=no
   44940 (
   44941   $as_echo "166. $at_setup_line: testing $at_desc ..."
   44942   $at_traceon
   44943 
   44944 
   44945 cat >input.y <<'_ATEOF'
   44946 %code top {
   44947 #include <config.h>
   44948 /* We don't need perfect functions for these tests. */
   44949 #undef malloc
   44950 #undef memcmp
   44951 #undef realloc
   44952 }
   44953 
   44954 %error-verbose
   44955 %debug
   44956 
   44957 %{
   44958 # include <stdio.h>
   44959 # include <stdlib.h>
   44960 static void yyerror ( const char *msg);
   44961 static int yylex (void);
   44962 # define USE(SYM)
   44963 %}
   44964 
   44965 %printer {
   44966   fprintf (yyoutput, "<> printer should not be called.\n");
   44967 } <>
   44968 
   44969 %union { int field0; int field1; int field2; }
   44970 %type <field0> start 'a' 'g'
   44971 %type <field1> 'e'
   44972 %type <field2> 'f'
   44973 %printer {
   44974   fprintf (yyoutput, "<*>/<field2>/e printer");
   44975 } <*> 'e' <field2>
   44976 %destructor {
   44977   fprintf (stdout, "<*>/<field2>/e destructor.\n");
   44978 } <*> 'e' <field2>
   44979 
   44980 %type <field1> 'b'
   44981 %printer { fprintf (yyoutput, "<field1> printer"); } <field1>
   44982 %destructor { fprintf (stdout, "<field1> destructor.\n"); } <field1>
   44983 
   44984 %type <field0> 'c'
   44985 %printer { fprintf (yyoutput, "'c' printer"); } 'c'
   44986 %destructor { fprintf (stdout, "'c' destructor.\n"); } 'c'
   44987 
   44988 %type <field1> 'd'
   44989 %printer { fprintf (yyoutput, "'d' printer"); } 'd'
   44990 %destructor { fprintf (stdout, "'d' destructor.\n"); } 'd'
   44991 
   44992 %destructor {
   44993   fprintf (yyoutput, "<> destructor should not be called.\n");
   44994 } <>
   44995 
   44996 %%
   44997 
   44998 start:
   44999   'a' 'b' 'c' 'd' 'e' 'f' 'g'
   45000     {
   45001       USE(($1, $2, $3, $4, $5, $6, $7));
   45002       $$ = 'S';
   45003     }
   45004   ;
   45005 
   45006 %%
   45007 #include <stdio.h>
   45008 /* A C error reporting function.  */
   45009 static
   45010 void yyerror ( const char *msg)
   45011 {
   45012   fprintf (stderr, "%s\n", msg);
   45013 }
   45014 #include <assert.h>
   45015 static
   45016 int yylex (void)
   45017 {
   45018   static char const input[] = "abcdef";
   45019   static size_t toknum = 0;
   45020   int res;
   45021   ;
   45022   assert (toknum < sizeof input / sizeof input[0]);
   45023   res = input[toknum++];
   45024   ;
   45025   return res;
   45026 }
   45027 
   45028 int
   45029 main (void)
   45030 {
   45031   yydebug = 1;
   45032   return yyparse ();
   45033 }
   45034 _ATEOF
   45035 
   45036 
   45037 
   45038 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   45039   at_save_special_files
   45040   mkdir xml-tests
   45041     # Don't combine these Bison invocations since we want to be sure that
   45042   # --report=all isn't required to get the full XML file.
   45043   { set +x
   45044 $as_echo "$at_srcdir/actions.at:934: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   45045                   --graph=xml-tests/test.dot -o input.c input.y"
   45046 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:934"
   45047 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   45048                   --graph=xml-tests/test.dot -o input.c input.y
   45049 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45050 at_status=$? at_failed=false
   45051 $at_check_filter
   45052 echo stderr:; cat "$at_stderr"
   45053 echo stdout:; cat "$at_stdout"
   45054 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934"
   45055 $at_failed && at_fn_log_failure
   45056 $at_traceon; }
   45057 
   45058   { set +x
   45059 $as_echo "$at_srcdir/actions.at:934: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   45060 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:934"
   45061 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   45062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45063 at_status=$? at_failed=false
   45064 $at_check_filter
   45065 echo stderr:; cat "$at_stderr"
   45066 echo stdout:; cat "$at_stdout"
   45067 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934"
   45068 $at_failed && at_fn_log_failure
   45069 $at_traceon; }
   45070 
   45071     cp xml-tests/test.output expout
   45072   { set +x
   45073 $as_echo "$at_srcdir/actions.at:934: \$XSLTPROC \\
   45074              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   45075              xml-tests/test.xml"
   45076 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:934"
   45077 ( $at_check_trace; $XSLTPROC \
   45078              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   45079              xml-tests/test.xml
   45080 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45081 at_status=$? at_failed=false
   45082 $at_check_filter
   45083 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45084 $at_diff expout "$at_stdout" || at_failed=:
   45085 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934"
   45086 $at_failed && at_fn_log_failure
   45087 $at_traceon; }
   45088 
   45089   sort xml-tests/test.dot > expout
   45090   { set +x
   45091 $as_echo "$at_srcdir/actions.at:934: \$XSLTPROC \\
   45092              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   45093              xml-tests/test.xml | sort"
   45094 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:934"
   45095 ( $at_check_trace; $XSLTPROC \
   45096              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   45097              xml-tests/test.xml | sort
   45098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45099 at_status=$? at_failed=false
   45100 $at_check_filter
   45101 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45102 $at_diff expout "$at_stdout" || at_failed=:
   45103 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934"
   45104 $at_failed && at_fn_log_failure
   45105 $at_traceon; }
   45106 
   45107   rm -rf xml-tests expout
   45108   at_restore_special_files
   45109 fi
   45110 { set +x
   45111 $as_echo "$at_srcdir/actions.at:934: bison -o input.c input.y"
   45112 at_fn_check_prepare_trace "actions.at:934"
   45113 ( $at_check_trace; bison -o input.c input.y
   45114 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45115 at_status=$? at_failed=false
   45116 $at_check_filter
   45117 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45118 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45119 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:934"
   45120 $at_failed && at_fn_log_failure
   45121 $at_traceon; }
   45122 
   45123 
   45124 { set +x
   45125 $as_echo "$at_srcdir/actions.at:935: \$BISON_C_WORKS"
   45126 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:935"
   45127 ( $at_check_trace; $BISON_C_WORKS
   45128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45129 at_status=$? at_failed=false
   45130 $at_check_filter
   45131 echo stderr:; cat "$at_stderr"
   45132 echo stdout:; cat "$at_stdout"
   45133 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:935"
   45134 $at_failed && at_fn_log_failure
   45135 $at_traceon; }
   45136 
   45137 { set +x
   45138 $as_echo "$at_srcdir/actions.at:935: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   45139 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:935"
   45140 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   45141 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45142 at_status=$? at_failed=false
   45143 $at_check_filter
   45144 echo stderr:; cat "$at_stderr"
   45145 echo stdout:; cat "$at_stdout"
   45146 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:935"
   45147 $at_failed && at_fn_log_failure
   45148 $at_traceon; }
   45149 
   45150 { set +x
   45151 $as_echo "$at_srcdir/actions.at:936:  \$PREPARSER ./input"
   45152 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:936"
   45153 ( $at_check_trace;  $PREPARSER ./input
   45154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45155 at_status=$? at_failed=false
   45156 $at_check_filter
   45157 echo stderr:; tee stderr <"$at_stderr"
   45158 echo >>"$at_stdout"; $as_echo "<*>/<field2>/e destructor.
   45159 <*>/<field2>/e destructor.
   45160 'd' destructor.
   45161 'c' destructor.
   45162 <field1> destructor.
   45163 <*>/<field2>/e destructor.
   45164 " | \
   45165   $at_diff - "$at_stdout" || at_failed=:
   45166 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:936"
   45167 $at_failed && at_fn_log_failure
   45168 $at_traceon; }
   45169 
   45170 { set +x
   45171 $as_echo "$at_srcdir/actions.at:936: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   45172 at_fn_check_prepare_trace "actions.at:936"
   45173 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   45174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45175 at_status=$? at_failed=false
   45176 $at_check_filter
   45177 echo >>"$at_stderr"; $as_echo "Starting parse
   45178 Entering state 0
   45179 Reading a token: Next token is token 'a' (<*>/<field2>/e printer)
   45180 Shifting token 'a' (<*>/<field2>/e printer)
   45181 Entering state 1
   45182 Reading a token: Next token is token 'b' (<field1> printer)
   45183 Shifting token 'b' (<field1> printer)
   45184 Entering state 3
   45185 Reading a token: Next token is token 'c' ('c' printer)
   45186 Shifting token 'c' ('c' printer)
   45187 Entering state 5
   45188 Reading a token: Next token is token 'd' ('d' printer)
   45189 Shifting token 'd' ('d' printer)
   45190 Entering state 6
   45191 Reading a token: Next token is token 'e' (<*>/<field2>/e printer)
   45192 Shifting token 'e' (<*>/<field2>/e printer)
   45193 Entering state 7
   45194 Reading a token: Next token is token 'f' (<*>/<field2>/e printer)
   45195 Shifting token 'f' (<*>/<field2>/e printer)
   45196 Entering state 8
   45197 Reading a token: Now at end of input.
   45198 syntax error, unexpected \$end, expecting 'g'
   45199 Error: popping token 'f' (<*>/<field2>/e printer)
   45200 Stack now 0 1 3 5 6 7
   45201 Error: popping token 'e' (<*>/<field2>/e printer)
   45202 Stack now 0 1 3 5 6
   45203 Error: popping token 'd' ('d' printer)
   45204 Stack now 0 1 3 5
   45205 Error: popping token 'c' ('c' printer)
   45206 Stack now 0 1 3
   45207 Error: popping token 'b' (<field1> printer)
   45208 Stack now 0 1
   45209 Error: popping token 'a' (<*>/<field2>/e printer)
   45210 Stack now 0
   45211 Cleanup: discarding lookahead token \$end ()
   45212 Stack now 0
   45213 " | \
   45214   $at_diff - "$at_stderr" || at_failed=:
   45215 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45216 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:936"
   45217 $at_failed && at_fn_log_failure
   45218 $at_traceon; }
   45219 
   45220 
   45221 
   45222 
   45223   set +x
   45224   $at_times_p && times >"$at_times_file"
   45225 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   45226 read at_status <"$at_status_file"
   45227 #AT_STOP_166
   45228 #AT_START_167
   45229 at_fn_group_banner 167 'actions.at:991' \
   45230   "Default %printer and %destructor for user-defined end token" "" 9
   45231 at_xfail=no
   45232 (
   45233   $as_echo "167. $at_setup_line: testing $at_desc ..."
   45234   $at_traceon
   45235 
   45236 
   45237 # _AT_CHECK_DEFAULT_PRINTER_AND_DESTRUCTOR_FOR_END_TOKEN(TYPED)
   45238 # -------------------------------------------------------------
   45239 
   45240 
   45241 
   45242 
   45243 
   45244 cat >input0.y <<'_ATEOF'
   45245 %code top {
   45246 #include <config.h>
   45247 /* We don't need perfect functions for these tests. */
   45248 #undef malloc
   45249 #undef memcmp
   45250 #undef realloc
   45251 }
   45252 
   45253 %error-verbose
   45254 %debug
   45255 %locations
   45256 
   45257 %{
   45258 # include <stdio.h>
   45259 # include <stdlib.h>
   45260 static void yyerror ( const char *msg);
   45261 static int yylex (void);
   45262 # define USE(SYM)
   45263 %}
   45264 
   45265 %destructor {
   45266   fprintf (yyoutput, "<*> destructor should not be called.\n");
   45267 } <*>
   45268 
   45269 %token END 0
   45270 %printer {
   45271   fprintf (yyoutput, "<> for '%c' @ %d", $$, @$.first_column);
   45272 } <>
   45273 %destructor {
   45274   fprintf (stdout, "<> for '%c' @ %d.\n", $$, @$.first_column);
   45275 } <>
   45276 
   45277 %printer {
   45278   fprintf (yyoutput, "<*> printer should not be called.\n");
   45279 } <*>
   45280 
   45281 
   45282 
   45283 
   45284 %%
   45285 
   45286 start: { $$ = 'S'; } ;
   45287 
   45288 %%
   45289 
   45290 static int
   45291 yylex (void)
   45292 {
   45293   static int called;
   45294   if (called++)
   45295     abort ();
   45296   yylval = 'E';
   45297   yylloc.first_line = yylloc.last_line = 1;
   45298   yylloc.first_column = yylloc.last_column = 1;
   45299   return 0;
   45300 }
   45301 #include <stdio.h>
   45302 /* A C error reporting function.  */
   45303 static
   45304 void yyerror ( const char *msg)
   45305 {
   45306   YY_LOCATION_PRINT (stderr, (yylloc));
   45307   fprintf (stderr, ": ");
   45308   fprintf (stderr, "%s\n", msg);
   45309 }
   45310 
   45311 int
   45312 main (void)
   45313 {
   45314   yydebug = 1;
   45315   return yyparse ();
   45316 }
   45317 _ATEOF
   45318 
   45319 
   45320 
   45321 
   45322 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   45323   at_save_special_files
   45324   mkdir xml-tests
   45325     # Don't combine these Bison invocations since we want to be sure that
   45326   # --report=all isn't required to get the full XML file.
   45327   { set +x
   45328 $as_echo "$at_srcdir/actions.at:1087: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   45329                   --graph=xml-tests/test.dot -o input0.c input0.y"
   45330 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1087"
   45331 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   45332                   --graph=xml-tests/test.dot -o input0.c input0.y
   45333 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45334 at_status=$? at_failed=false
   45335 $at_check_filter
   45336 echo stderr:; cat "$at_stderr"
   45337 echo stdout:; cat "$at_stdout"
   45338 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45339 $at_failed && at_fn_log_failure
   45340 $at_traceon; }
   45341 
   45342   { set +x
   45343 $as_echo "$at_srcdir/actions.at:1087: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input0.c input0.y"
   45344 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input0.c input0.y" "actions.at:1087"
   45345 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input0.c input0.y
   45346 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45347 at_status=$? at_failed=false
   45348 $at_check_filter
   45349 echo stderr:; cat "$at_stderr"
   45350 echo stdout:; cat "$at_stdout"
   45351 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45352 $at_failed && at_fn_log_failure
   45353 $at_traceon; }
   45354 
   45355     cp xml-tests/test.output expout
   45356   { set +x
   45357 $as_echo "$at_srcdir/actions.at:1087: \$XSLTPROC \\
   45358              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   45359              xml-tests/test.xml"
   45360 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1087"
   45361 ( $at_check_trace; $XSLTPROC \
   45362              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   45363              xml-tests/test.xml
   45364 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45365 at_status=$? at_failed=false
   45366 $at_check_filter
   45367 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45368 $at_diff expout "$at_stdout" || at_failed=:
   45369 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45370 $at_failed && at_fn_log_failure
   45371 $at_traceon; }
   45372 
   45373   sort xml-tests/test.dot > expout
   45374   { set +x
   45375 $as_echo "$at_srcdir/actions.at:1087: \$XSLTPROC \\
   45376              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   45377              xml-tests/test.xml | sort"
   45378 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1087"
   45379 ( $at_check_trace; $XSLTPROC \
   45380              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   45381              xml-tests/test.xml | sort
   45382 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45383 at_status=$? at_failed=false
   45384 $at_check_filter
   45385 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45386 $at_diff expout "$at_stdout" || at_failed=:
   45387 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45388 $at_failed && at_fn_log_failure
   45389 $at_traceon; }
   45390 
   45391   rm -rf xml-tests expout
   45392   at_restore_special_files
   45393 fi
   45394 { set +x
   45395 $as_echo "$at_srcdir/actions.at:1087: bison -o input0.c input0.y"
   45396 at_fn_check_prepare_trace "actions.at:1087"
   45397 ( $at_check_trace; bison -o input0.c input0.y
   45398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45399 at_status=$? at_failed=false
   45400 $at_check_filter
   45401 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45402 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45403 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45404 $at_failed && at_fn_log_failure
   45405 $at_traceon; }
   45406 
   45407 
   45408 { set +x
   45409 $as_echo "$at_srcdir/actions.at:1087: \$BISON_C_WORKS"
   45410 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1087"
   45411 ( $at_check_trace; $BISON_C_WORKS
   45412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45413 at_status=$? at_failed=false
   45414 $at_check_filter
   45415 echo stderr:; cat "$at_stderr"
   45416 echo stdout:; cat "$at_stdout"
   45417 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45418 $at_failed && at_fn_log_failure
   45419 $at_traceon; }
   45420 
   45421 { set +x
   45422 $as_echo "$at_srcdir/actions.at:1087: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input0 input0.c \$LIBS"
   45423 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS" "actions.at:1087"
   45424 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS
   45425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45426 at_status=$? at_failed=false
   45427 $at_check_filter
   45428 echo stderr:; cat "$at_stderr"
   45429 echo stdout:; cat "$at_stdout"
   45430 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45431 $at_failed && at_fn_log_failure
   45432 $at_traceon; }
   45433 
   45434 { set +x
   45435 $as_echo "$at_srcdir/actions.at:1087:  \$PREPARSER ./input0"
   45436 at_fn_check_prepare_dynamic " $PREPARSER ./input0" "actions.at:1087"
   45437 ( $at_check_trace;  $PREPARSER ./input0
   45438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45439 at_status=$? at_failed=false
   45440 $at_check_filter
   45441 echo stderr:; tee stderr <"$at_stderr"
   45442 echo >>"$at_stdout"; $as_echo "<> for 'E' @ 1.
   45443 <> for 'S' @ 1.
   45444 " | \
   45445   $at_diff - "$at_stdout" || at_failed=:
   45446 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45447 $at_failed && at_fn_log_failure
   45448 $at_traceon; }
   45449 
   45450 { set +x
   45451 $as_echo "$at_srcdir/actions.at:1087: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   45452 at_fn_check_prepare_trace "actions.at:1087"
   45453 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   45454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45455 at_status=$? at_failed=false
   45456 $at_check_filter
   45457 echo >>"$at_stderr"; $as_echo "Starting parse
   45458 Entering state 0
   45459 Reducing stack by rule 1 (line 42):
   45460 -> \$\$ = nterm start (1.1: <> for 'S' @ 1)
   45461 Stack now 0
   45462 Entering state 1
   45463 Reading a token: Now at end of input.
   45464 Shifting token END (1.1: <> for 'E' @ 1)
   45465 Entering state 2
   45466 Stack now 0 1 2
   45467 Cleanup: popping token END (1.1: <> for 'E' @ 1)
   45468 Cleanup: popping nterm start (1.1: <> for 'S' @ 1)
   45469 " | \
   45470   $at_diff - "$at_stderr" || at_failed=:
   45471 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45472 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087"
   45473 $at_failed && at_fn_log_failure
   45474 $at_traceon; }
   45475 
   45476 
   45477 
   45478 
   45479 
   45480 
   45481 
   45482 
   45483 
   45484 cat >input1.y <<'_ATEOF'
   45485 %code top {
   45486 #include <config.h>
   45487 /* We don't need perfect functions for these tests. */
   45488 #undef malloc
   45489 #undef memcmp
   45490 #undef realloc
   45491 }
   45492 
   45493 %error-verbose
   45494 %debug
   45495 %locations
   45496 
   45497 %{
   45498 # include <stdio.h>
   45499 # include <stdlib.h>
   45500 static void yyerror ( const char *msg);
   45501 static int yylex (void);
   45502 # define USE(SYM)
   45503 %}
   45504 
   45505 %destructor {
   45506   fprintf (yyoutput, "<> destructor should not be called.\n");
   45507 } <>
   45508 
   45509 %token END 0
   45510 %printer {
   45511   fprintf (yyoutput, "<*> for '%c' @ %d", $$, @$.first_column);
   45512 } <*>
   45513 %destructor {
   45514   fprintf (stdout, "<*> for '%c' @ %d.\n", $$, @$.first_column);
   45515 } <*>
   45516 
   45517 %printer {
   45518   fprintf (yyoutput, "<> printer should not be called.\n");
   45519 } <>
   45520 
   45521 %union { char tag; }
   45522 %type <tag> start END
   45523 
   45524 %%
   45525 
   45526 start: { $$ = 'S'; } ;
   45527 
   45528 %%
   45529 
   45530 static int
   45531 yylex (void)
   45532 {
   45533   static int called;
   45534   if (called++)
   45535     abort ();
   45536   yylval.tag = 'E';
   45537   yylloc.first_line = yylloc.last_line = 1;
   45538   yylloc.first_column = yylloc.last_column = 1;
   45539   return 0;
   45540 }
   45541 #include <stdio.h>
   45542 /* A C error reporting function.  */
   45543 static
   45544 void yyerror ( const char *msg)
   45545 {
   45546   YY_LOCATION_PRINT (stderr, (yylloc));
   45547   fprintf (stderr, ": ");
   45548   fprintf (stderr, "%s\n", msg);
   45549 }
   45550 
   45551 int
   45552 main (void)
   45553 {
   45554   yydebug = 1;
   45555   return yyparse ();
   45556 }
   45557 _ATEOF
   45558 
   45559 
   45560 
   45561 
   45562 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   45563   at_save_special_files
   45564   mkdir xml-tests
   45565     # Don't combine these Bison invocations since we want to be sure that
   45566   # --report=all isn't required to get the full XML file.
   45567   { set +x
   45568 $as_echo "$at_srcdir/actions.at:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   45569                   --graph=xml-tests/test.dot -o input1.c input1.y"
   45570 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1088"
   45571 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   45572                   --graph=xml-tests/test.dot -o input1.c input1.y
   45573 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45574 at_status=$? at_failed=false
   45575 $at_check_filter
   45576 echo stderr:; cat "$at_stderr"
   45577 echo stdout:; cat "$at_stdout"
   45578 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45579 $at_failed && at_fn_log_failure
   45580 $at_traceon; }
   45581 
   45582   { set +x
   45583 $as_echo "$at_srcdir/actions.at:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y"
   45584 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1088"
   45585 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y
   45586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45587 at_status=$? at_failed=false
   45588 $at_check_filter
   45589 echo stderr:; cat "$at_stderr"
   45590 echo stdout:; cat "$at_stdout"
   45591 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45592 $at_failed && at_fn_log_failure
   45593 $at_traceon; }
   45594 
   45595     cp xml-tests/test.output expout
   45596   { set +x
   45597 $as_echo "$at_srcdir/actions.at:1088: \$XSLTPROC \\
   45598              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   45599              xml-tests/test.xml"
   45600 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1088"
   45601 ( $at_check_trace; $XSLTPROC \
   45602              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   45603              xml-tests/test.xml
   45604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45605 at_status=$? at_failed=false
   45606 $at_check_filter
   45607 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45608 $at_diff expout "$at_stdout" || at_failed=:
   45609 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45610 $at_failed && at_fn_log_failure
   45611 $at_traceon; }
   45612 
   45613   sort xml-tests/test.dot > expout
   45614   { set +x
   45615 $as_echo "$at_srcdir/actions.at:1088: \$XSLTPROC \\
   45616              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   45617              xml-tests/test.xml | sort"
   45618 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1088"
   45619 ( $at_check_trace; $XSLTPROC \
   45620              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   45621              xml-tests/test.xml | sort
   45622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45623 at_status=$? at_failed=false
   45624 $at_check_filter
   45625 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45626 $at_diff expout "$at_stdout" || at_failed=:
   45627 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45628 $at_failed && at_fn_log_failure
   45629 $at_traceon; }
   45630 
   45631   rm -rf xml-tests expout
   45632   at_restore_special_files
   45633 fi
   45634 { set +x
   45635 $as_echo "$at_srcdir/actions.at:1088: bison -o input1.c input1.y"
   45636 at_fn_check_prepare_trace "actions.at:1088"
   45637 ( $at_check_trace; bison -o input1.c input1.y
   45638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45639 at_status=$? at_failed=false
   45640 $at_check_filter
   45641 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45642 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45643 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45644 $at_failed && at_fn_log_failure
   45645 $at_traceon; }
   45646 
   45647 
   45648 { set +x
   45649 $as_echo "$at_srcdir/actions.at:1088: \$BISON_C_WORKS"
   45650 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1088"
   45651 ( $at_check_trace; $BISON_C_WORKS
   45652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45653 at_status=$? at_failed=false
   45654 $at_check_filter
   45655 echo stderr:; cat "$at_stderr"
   45656 echo stdout:; cat "$at_stdout"
   45657 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45658 $at_failed && at_fn_log_failure
   45659 $at_traceon; }
   45660 
   45661 { set +x
   45662 $as_echo "$at_srcdir/actions.at:1088: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input1 input1.c \$LIBS"
   45663 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS" "actions.at:1088"
   45664 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS
   45665 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45666 at_status=$? at_failed=false
   45667 $at_check_filter
   45668 echo stderr:; cat "$at_stderr"
   45669 echo stdout:; cat "$at_stdout"
   45670 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45671 $at_failed && at_fn_log_failure
   45672 $at_traceon; }
   45673 
   45674 { set +x
   45675 $as_echo "$at_srcdir/actions.at:1088:  \$PREPARSER ./input1"
   45676 at_fn_check_prepare_dynamic " $PREPARSER ./input1" "actions.at:1088"
   45677 ( $at_check_trace;  $PREPARSER ./input1
   45678 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45679 at_status=$? at_failed=false
   45680 $at_check_filter
   45681 echo stderr:; tee stderr <"$at_stderr"
   45682 echo >>"$at_stdout"; $as_echo "<*> for 'E' @ 1.
   45683 <*> for 'S' @ 1.
   45684 " | \
   45685   $at_diff - "$at_stdout" || at_failed=:
   45686 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45687 $at_failed && at_fn_log_failure
   45688 $at_traceon; }
   45689 
   45690 { set +x
   45691 $as_echo "$at_srcdir/actions.at:1088: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   45692 at_fn_check_prepare_trace "actions.at:1088"
   45693 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   45694 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45695 at_status=$? at_failed=false
   45696 $at_check_filter
   45697 echo >>"$at_stderr"; $as_echo "Starting parse
   45698 Entering state 0
   45699 Reducing stack by rule 1 (line 42):
   45700 -> \$\$ = nterm start (1.1: <*> for 'S' @ 1)
   45701 Stack now 0
   45702 Entering state 1
   45703 Reading a token: Now at end of input.
   45704 Shifting token END (1.1: <*> for 'E' @ 1)
   45705 Entering state 2
   45706 Stack now 0 1 2
   45707 Cleanup: popping token END (1.1: <*> for 'E' @ 1)
   45708 Cleanup: popping nterm start (1.1: <*> for 'S' @ 1)
   45709 " | \
   45710   $at_diff - "$at_stderr" || at_failed=:
   45711 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45712 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088"
   45713 $at_failed && at_fn_log_failure
   45714 $at_traceon; }
   45715 
   45716 
   45717 
   45718 
   45719 
   45720 
   45721 
   45722   set +x
   45723   $at_times_p && times >"$at_times_file"
   45724 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   45725 read at_status <"$at_status_file"
   45726 #AT_STOP_167
   45727 #AT_START_168
   45728 at_fn_group_banner 168 'actions.at:1098' \
   45729   "Default %printer and %destructor are not for error or \$undefined" "" 9
   45730 at_xfail=no
   45731 (
   45732   $as_echo "168. $at_setup_line: testing $at_desc ..."
   45733   $at_traceon
   45734 
   45735 
   45736 # If Bison were to apply the default %printer and %destructor to the error
   45737 # token or to $undefined:
   45738 #   - For the error token:
   45739 #     - It would generate warnings for unused $n.
   45740 #     - It would invoke the %printer and %destructor on the error token's
   45741 #       semantic value, which would be initialized from the lookahead, which
   45742 #       would be destroyed separately.
   45743 #   - For $undefined, who knows what the semantic value would be.
   45744 
   45745 cat >input.y <<'_ATEOF'
   45746 %code top {
   45747 #include <config.h>
   45748 /* We don't need perfect functions for these tests. */
   45749 #undef malloc
   45750 #undef memcmp
   45751 #undef realloc
   45752 }
   45753 
   45754 %debug
   45755 
   45756 %{
   45757 # include <stdio.h>
   45758 # include <stdlib.h>
   45759 static void yyerror ( const char *msg);
   45760 static int yylex (void);
   45761 # define USE(SYM)
   45762 %}
   45763 
   45764 %printer {
   45765   fprintf (yyoutput, "'%c'", $$);
   45766 } <> <*>
   45767 %destructor {
   45768   fprintf (stderr, "DESTROY '%c'\n", $$);
   45769 } <> <*>
   45770 
   45771 %%
   45772 
   45773 start:
   45774   { $$ = 'S'; }
   45775   /* In order to reveal the problems that this bug caused during parsing, add
   45776    * $2 to USE.  */
   45777   | 'a' error 'b' 'c' { USE(($1, $3, $4)); $$ = 'S'; }
   45778   ;
   45779 
   45780 %%
   45781 #include <stdio.h>
   45782 /* A C error reporting function.  */
   45783 static
   45784 void yyerror ( const char *msg)
   45785 {
   45786   fprintf (stderr, "%s\n", msg);
   45787 }
   45788 #include <assert.h>
   45789 static
   45790 int yylex (void)
   45791 {
   45792   static char const input[] = "abd";
   45793   static size_t toknum = 0;
   45794   int res;
   45795   ;
   45796   assert (toknum < sizeof input / sizeof input[0]);
   45797   res = input[toknum++];
   45798   yylval = res;
   45799   return res;
   45800 }
   45801 int
   45802 main (void)
   45803 {
   45804   yydebug = 1;
   45805   return yyparse ();
   45806 }
   45807 _ATEOF
   45808 
   45809 
   45810 
   45811 
   45812 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   45813   at_save_special_files
   45814   mkdir xml-tests
   45815     # Don't combine these Bison invocations since we want to be sure that
   45816   # --report=all isn't required to get the full XML file.
   45817   { set +x
   45818 $as_echo "$at_srcdir/actions.at:1148: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   45819                   --graph=xml-tests/test.dot -o input.c input.y"
   45820 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1148"
   45821 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   45822                   --graph=xml-tests/test.dot -o input.c input.y
   45823 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45824 at_status=$? at_failed=false
   45825 $at_check_filter
   45826 echo stderr:; cat "$at_stderr"
   45827 echo stdout:; cat "$at_stdout"
   45828 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148"
   45829 $at_failed && at_fn_log_failure
   45830 $at_traceon; }
   45831 
   45832   { set +x
   45833 $as_echo "$at_srcdir/actions.at:1148: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   45834 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1148"
   45835 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   45836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45837 at_status=$? at_failed=false
   45838 $at_check_filter
   45839 echo stderr:; cat "$at_stderr"
   45840 echo stdout:; cat "$at_stdout"
   45841 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148"
   45842 $at_failed && at_fn_log_failure
   45843 $at_traceon; }
   45844 
   45845     cp xml-tests/test.output expout
   45846   { set +x
   45847 $as_echo "$at_srcdir/actions.at:1148: \$XSLTPROC \\
   45848              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   45849              xml-tests/test.xml"
   45850 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1148"
   45851 ( $at_check_trace; $XSLTPROC \
   45852              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   45853              xml-tests/test.xml
   45854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45855 at_status=$? at_failed=false
   45856 $at_check_filter
   45857 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45858 $at_diff expout "$at_stdout" || at_failed=:
   45859 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148"
   45860 $at_failed && at_fn_log_failure
   45861 $at_traceon; }
   45862 
   45863   sort xml-tests/test.dot > expout
   45864   { set +x
   45865 $as_echo "$at_srcdir/actions.at:1148: \$XSLTPROC \\
   45866              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   45867              xml-tests/test.xml | sort"
   45868 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1148"
   45869 ( $at_check_trace; $XSLTPROC \
   45870              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   45871              xml-tests/test.xml | sort
   45872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45873 at_status=$? at_failed=false
   45874 $at_check_filter
   45875 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45876 $at_diff expout "$at_stdout" || at_failed=:
   45877 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148"
   45878 $at_failed && at_fn_log_failure
   45879 $at_traceon; }
   45880 
   45881   rm -rf xml-tests expout
   45882   at_restore_special_files
   45883 fi
   45884 { set +x
   45885 $as_echo "$at_srcdir/actions.at:1148: bison -o input.c input.y"
   45886 at_fn_check_prepare_trace "actions.at:1148"
   45887 ( $at_check_trace; bison -o input.c input.y
   45888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45889 at_status=$? at_failed=false
   45890 $at_check_filter
   45891 at_fn_diff_devnull "$at_stderr" || at_failed=:
   45892 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45893 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1148"
   45894 $at_failed && at_fn_log_failure
   45895 $at_traceon; }
   45896 
   45897 
   45898 { set +x
   45899 $as_echo "$at_srcdir/actions.at:1149: \$BISON_C_WORKS"
   45900 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1149"
   45901 ( $at_check_trace; $BISON_C_WORKS
   45902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45903 at_status=$? at_failed=false
   45904 $at_check_filter
   45905 echo stderr:; cat "$at_stderr"
   45906 echo stdout:; cat "$at_stdout"
   45907 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1149"
   45908 $at_failed && at_fn_log_failure
   45909 $at_traceon; }
   45910 
   45911 { set +x
   45912 $as_echo "$at_srcdir/actions.at:1149: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   45913 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1149"
   45914 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   45915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45916 at_status=$? at_failed=false
   45917 $at_check_filter
   45918 echo stderr:; cat "$at_stderr"
   45919 echo stdout:; cat "$at_stdout"
   45920 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1149"
   45921 $at_failed && at_fn_log_failure
   45922 $at_traceon; }
   45923 
   45924 { set +x
   45925 $as_echo "$at_srcdir/actions.at:1150:  \$PREPARSER ./input"
   45926 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1150"
   45927 ( $at_check_trace;  $PREPARSER ./input
   45928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45929 at_status=$? at_failed=false
   45930 $at_check_filter
   45931 echo stderr:; tee stderr <"$at_stderr"
   45932 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45933 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1150"
   45934 $at_failed && at_fn_log_failure
   45935 $at_traceon; }
   45936 
   45937 { set +x
   45938 $as_echo "$at_srcdir/actions.at:1150: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   45939 at_fn_check_prepare_trace "actions.at:1150"
   45940 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   45941 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   45942 at_status=$? at_failed=false
   45943 $at_check_filter
   45944 echo >>"$at_stderr"; $as_echo "Starting parse
   45945 Entering state 0
   45946 Reading a token: Next token is token 'a' ('a')
   45947 Shifting token 'a' ('a')
   45948 Entering state 1
   45949 Reading a token: Next token is token 'b' ('b')
   45950 syntax error
   45951 Shifting token error ()
   45952 Entering state 3
   45953 Next token is token 'b' ('b')
   45954 Shifting token 'b' ('b')
   45955 Entering state 5
   45956 Reading a token: Next token is token \$undefined ()
   45957 Error: popping token 'b' ('b')
   45958 DESTROY 'b'
   45959 Stack now 0 1 3
   45960 Error: popping token error ()
   45961 Stack now 0 1
   45962 Shifting token error ()
   45963 Entering state 3
   45964 Next token is token \$undefined ()
   45965 Error: discarding token \$undefined ()
   45966 Error: popping token error ()
   45967 Stack now 0 1
   45968 Shifting token error ()
   45969 Entering state 3
   45970 Reading a token: Now at end of input.
   45971 Cleanup: discarding lookahead token \$end ()
   45972 Stack now 0 1 3
   45973 Cleanup: popping token error ()
   45974 Cleanup: popping token 'a' ('a')
   45975 DESTROY 'a'
   45976 " | \
   45977   $at_diff - "$at_stderr" || at_failed=:
   45978 at_fn_diff_devnull "$at_stdout" || at_failed=:
   45979 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1150"
   45980 $at_failed && at_fn_log_failure
   45981 $at_traceon; }
   45982 
   45983 
   45984 
   45985   set +x
   45986   $at_times_p && times >"$at_times_file"
   45987 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   45988 read at_status <"$at_status_file"
   45989 #AT_STOP_168
   45990 #AT_START_169
   45991 at_fn_group_banner 169 'actions.at:1193' \
   45992   "Default %printer and %destructor are not for \$accept" "" 9
   45993 at_xfail=no
   45994 (
   45995   $as_echo "169. $at_setup_line: testing $at_desc ..."
   45996   $at_traceon
   45997 
   45998 
   45999 # If YYSTYPE is a union and Bison were to apply the default %printer and
   46000 # %destructor to $accept:
   46001 #   - The %printer and %destructor code generated for $accept would always be
   46002 #     dead code because $accept is currently never shifted onto the stack.
   46003 #   - $$ for $accept would always be of type YYSTYPE because it's not possible
   46004 #     to declare `%type <field> $accept'.  (Also true for $undefined.)
   46005 #   - Thus, the compiler might complain that the user code assumes the wrong
   46006 #     type for $$ since the code might assume the type associated with a
   46007 #     specific union field, which is especially reasonable in C++ since that
   46008 #     type may be a base type.  This test case checks for this problem.  (Also
   46009 #     true for $undefined and the error token, so there are three warnings for
   46010 #     %printer and three for %destructor.)
   46011 
   46012 
   46013 cat >input.y <<'_ATEOF'
   46014 %code top {
   46015 #include <config.h>
   46016 /* We don't need perfect functions for these tests. */
   46017 #undef malloc
   46018 #undef memcmp
   46019 #undef realloc
   46020 }
   46021 
   46022 %debug /* So that %printer is actually compiled.  */
   46023 
   46024 %{
   46025 # include <stdio.h>
   46026 # include <stdlib.h>
   46027 static void yyerror ( const char *msg);
   46028 static int yylex (void);
   46029 # define USE(SYM)
   46030 %}
   46031 
   46032 %printer {
   46033   char chr = $$;
   46034   fprintf (yyoutput, "'%c'", chr);
   46035 } <> <*>
   46036 %destructor {
   46037   char chr = $$;
   46038   fprintf (stderr, "DESTROY '%c'\n", chr);
   46039 } <> <*>
   46040 
   46041 %union { char chr; }
   46042 %type <chr> start
   46043 
   46044 %%
   46045 
   46046 start: { USE($$); } ;
   46047 
   46048 %%
   46049 #include <stdio.h>
   46050 /* A C error reporting function.  */
   46051 static
   46052 void yyerror ( const char *msg)
   46053 {
   46054   fprintf (stderr, "%s\n", msg);
   46055 }
   46056 #include <assert.h>
   46057 static
   46058 int yylex (void)
   46059 {
   46060   static char const input[] = "";
   46061   static size_t toknum = 0;
   46062   int res;
   46063   ;
   46064   assert (toknum < sizeof input / sizeof input[0]);
   46065   res = input[toknum++];
   46066   ;
   46067   return res;
   46068 }
   46069 int
   46070 main (void)
   46071 {
   46072   return yyparse ();
   46073 }
   46074 _ATEOF
   46075 
   46076 
   46077 
   46078 
   46079 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   46080   at_save_special_files
   46081   mkdir xml-tests
   46082     # Don't combine these Bison invocations since we want to be sure that
   46083   # --report=all isn't required to get the full XML file.
   46084   { set +x
   46085 $as_echo "$at_srcdir/actions.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   46086                   --graph=xml-tests/test.dot -o input.c input.y"
   46087 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1247"
   46088 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   46089                   --graph=xml-tests/test.dot -o input.c input.y
   46090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46091 at_status=$? at_failed=false
   46092 $at_check_filter
   46093 echo stderr:; cat "$at_stderr"
   46094 echo stdout:; cat "$at_stdout"
   46095 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247"
   46096 $at_failed && at_fn_log_failure
   46097 $at_traceon; }
   46098 
   46099   { set +x
   46100 $as_echo "$at_srcdir/actions.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   46101 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1247"
   46102 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   46103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46104 at_status=$? at_failed=false
   46105 $at_check_filter
   46106 echo stderr:; cat "$at_stderr"
   46107 echo stdout:; cat "$at_stdout"
   46108 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247"
   46109 $at_failed && at_fn_log_failure
   46110 $at_traceon; }
   46111 
   46112     cp xml-tests/test.output expout
   46113   { set +x
   46114 $as_echo "$at_srcdir/actions.at:1247: \$XSLTPROC \\
   46115              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   46116              xml-tests/test.xml"
   46117 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1247"
   46118 ( $at_check_trace; $XSLTPROC \
   46119              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   46120              xml-tests/test.xml
   46121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46122 at_status=$? at_failed=false
   46123 $at_check_filter
   46124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46125 $at_diff expout "$at_stdout" || at_failed=:
   46126 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247"
   46127 $at_failed && at_fn_log_failure
   46128 $at_traceon; }
   46129 
   46130   sort xml-tests/test.dot > expout
   46131   { set +x
   46132 $as_echo "$at_srcdir/actions.at:1247: \$XSLTPROC \\
   46133              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   46134              xml-tests/test.xml | sort"
   46135 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1247"
   46136 ( $at_check_trace; $XSLTPROC \
   46137              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   46138              xml-tests/test.xml | sort
   46139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46140 at_status=$? at_failed=false
   46141 $at_check_filter
   46142 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46143 $at_diff expout "$at_stdout" || at_failed=:
   46144 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247"
   46145 $at_failed && at_fn_log_failure
   46146 $at_traceon; }
   46147 
   46148   rm -rf xml-tests expout
   46149   at_restore_special_files
   46150 fi
   46151 { set +x
   46152 $as_echo "$at_srcdir/actions.at:1247: bison -o input.c input.y"
   46153 at_fn_check_prepare_trace "actions.at:1247"
   46154 ( $at_check_trace; bison -o input.c input.y
   46155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46156 at_status=$? at_failed=false
   46157 $at_check_filter
   46158 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46159 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46160 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247"
   46161 $at_failed && at_fn_log_failure
   46162 $at_traceon; }
   46163 
   46164 
   46165 { set +x
   46166 $as_echo "$at_srcdir/actions.at:1248: \$BISON_C_WORKS"
   46167 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1248"
   46168 ( $at_check_trace; $BISON_C_WORKS
   46169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46170 at_status=$? at_failed=false
   46171 $at_check_filter
   46172 echo stderr:; cat "$at_stderr"
   46173 echo stdout:; cat "$at_stdout"
   46174 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1248"
   46175 $at_failed && at_fn_log_failure
   46176 $at_traceon; }
   46177 
   46178 { set +x
   46179 $as_echo "$at_srcdir/actions.at:1248: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   46180 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1248"
   46181 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   46182 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46183 at_status=$? at_failed=false
   46184 $at_check_filter
   46185 echo stderr:; cat "$at_stderr"
   46186 echo stdout:; cat "$at_stdout"
   46187 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1248"
   46188 $at_failed && at_fn_log_failure
   46189 $at_traceon; }
   46190 
   46191 
   46192   set +x
   46193   $at_times_p && times >"$at_times_file"
   46194 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   46195 read at_status <"$at_status_file"
   46196 #AT_STOP_169
   46197 #AT_START_170
   46198 at_fn_group_banner 170 'actions.at:1258' \
   46199   "Default %printer and %destructor for mid-rule values" "" 9
   46200 at_xfail=no
   46201 (
   46202   $as_echo "170. $at_setup_line: testing $at_desc ..."
   46203   $at_traceon
   46204 
   46205 
   46206 
   46207 cat >input.y <<'_ATEOF'
   46208 %code top {
   46209 #include <config.h>
   46210 /* We don't need perfect functions for these tests. */
   46211 #undef malloc
   46212 #undef memcmp
   46213 #undef realloc
   46214 }
   46215 
   46216 %debug /* So that %printer is actually compiled.  */
   46217 
   46218 %{
   46219 # include <stdio.h>
   46220 # include <stdlib.h>
   46221 static void yyerror ( const char *msg);
   46222 static int yylex (void);
   46223 # define USE(SYM)
   46224 # define YYLTYPE int
   46225 # define YYLLOC_DEFAULT(Current, Rhs, N) (void)(Rhs)
   46226 # define YY_LOCATION_PRINT(File, Loc)
   46227 %}
   46228 
   46229 %printer { fprintf (yyoutput, "%d", @$); } <>
   46230 %destructor { fprintf (stderr, "DESTROY %d\n", @$); } <>
   46231 %printer { fprintf (yyoutput, "<*> printer should not be called"); } <*>
   46232 %destructor { fprintf (yyoutput, "<*> destructor should not be called"); } <*>
   46233 
   46234 %%
   46235 
   46236 start:
   46237   {           @$ = 1; } // Not set or used.
   46238   { USE ($$); @$ = 2; } // Both set and used.
   46239   { USE ($$); @$ = 3; } // Only set.
   46240   {           @$ = 4; } // Only used.
   46241   'c'
   46242   { USE (($$, $2, $4, $5)); @$ = 0; }
   46243   ;
   46244 
   46245 %%
   46246 #include <stdio.h>
   46247 /* A C error reporting function.  */
   46248 static
   46249 void yyerror ( const char *msg)
   46250 {
   46251   fprintf (stderr, "%s\n", msg);
   46252 }
   46253 #include <assert.h>
   46254 static
   46255 int yylex (void)
   46256 {
   46257   static char const input[] = "";
   46258   static size_t toknum = 0;
   46259   int res;
   46260   ;
   46261   assert (toknum < sizeof input / sizeof input[0]);
   46262   res = input[toknum++];
   46263   ;
   46264   return res;
   46265 }
   46266 int
   46267 main (void)
   46268 {
   46269   yydebug = 1;
   46270   return yyparse ();
   46271 }
   46272 _ATEOF
   46273 
   46274 
   46275 
   46276 
   46277 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   46278   at_save_special_files
   46279   mkdir xml-tests
   46280     # Don't combine these Bison invocations since we want to be sure that
   46281   # --report=all isn't required to get the full XML file.
   46282   { set +x
   46283 $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   46284                   --graph=xml-tests/test.dot -o input.c input.y"
   46285 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1303"
   46286 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   46287                   --graph=xml-tests/test.dot -o input.c input.y
   46288 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46289 at_status=$? at_failed=false
   46290 $at_check_filter
   46291 echo stderr:; cat "$at_stderr"
   46292 echo stdout:; cat "$at_stdout"
   46293 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46294 $at_failed && at_fn_log_failure
   46295 $at_traceon; }
   46296 
   46297   { set +x
   46298 $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   46299 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1303"
   46300 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   46301 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46302 at_status=$? at_failed=false
   46303 $at_check_filter
   46304 echo stderr:; cat "$at_stderr"
   46305 echo stdout:; cat "$at_stdout"
   46306 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46307 $at_failed && at_fn_log_failure
   46308 $at_traceon; }
   46309 
   46310     cp xml-tests/test.output expout
   46311   { set +x
   46312 $as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\
   46313              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   46314              xml-tests/test.xml"
   46315 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303"
   46316 ( $at_check_trace; $XSLTPROC \
   46317              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   46318              xml-tests/test.xml
   46319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46320 at_status=$? at_failed=false
   46321 $at_check_filter
   46322 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46323 $at_diff expout "$at_stdout" || at_failed=:
   46324 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46325 $at_failed && at_fn_log_failure
   46326 $at_traceon; }
   46327 
   46328   sort xml-tests/test.dot > expout
   46329   { set +x
   46330 $as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\
   46331              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   46332              xml-tests/test.xml | sort"
   46333 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303"
   46334 ( $at_check_trace; $XSLTPROC \
   46335              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   46336              xml-tests/test.xml | sort
   46337 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46338 at_status=$? at_failed=false
   46339 $at_check_filter
   46340 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46341 $at_diff expout "$at_stdout" || at_failed=:
   46342 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46343 $at_failed && at_fn_log_failure
   46344 $at_traceon; }
   46345 
   46346   rm -rf xml-tests expout
   46347   at_restore_special_files
   46348 fi
   46349 { set +x
   46350 $as_echo "$at_srcdir/actions.at:1303: bison -o input.c input.y"
   46351 at_fn_check_prepare_trace "actions.at:1303"
   46352 ( $at_check_trace; bison -o input.c input.y
   46353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46354 at_status=$? at_failed=false
   46355 $at_check_filter
   46356 echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$
   46357 input.y:32.3-23: warning: unused value: \$3
   46358 " | \
   46359   $at_diff - "$at_stderr" || at_failed=:
   46360 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46361 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46362 $at_failed && at_fn_log_failure
   46363 $at_traceon; }
   46364 
   46365 # Defining POSIXLY_CORRECT causes bison to complain if options are
   46366 # added after the grammar file name, so skip these checks in that
   46367 # case.
   46368 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   46369   at_save_special_files
   46370 
   46371   # To avoid expanding it repeatedly, store specified stdout.
   46372   : >expout
   46373 
   46374   # Run with -Werror.
   46375   { set +x
   46376 $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror"
   46377 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "actions.at:1303"
   46378 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror
   46379 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46380 at_status=$? at_failed=false
   46381 $at_check_filter
   46382 echo stderr:; tee stderr <"$at_stderr"
   46383 $at_diff expout "$at_stdout" || at_failed=:
   46384 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1303"
   46385 $at_failed && at_fn_log_failure
   46386 $at_traceon; }
   46387 
   46388 
   46389   # Build expected stderr up to and including the "warnings being
   46390   # treated as errors" message.
   46391   cat >at-bison-check-warnings <<'_ATEOF'
   46392 input.y:33.3-23: warning: unset value: $$
   46393 input.y:32.3-23: warning: unused value: $3
   46394 _ATEOF
   46395 
   46396   at_bison_check_first=`sed -n \
   46397     '/: warning: /{=;q;}' at-bison-check-warnings`
   46398   : ${at_bison_check_first:=1}
   46399   at_bison_check_first_tmp=`sed -n \
   46400     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   46401   : ${at_bison_check_first_tmp:=1}
   46402   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   46403     at_bison_check_first=$at_bison_check_first_tmp
   46404   fi
   46405   if test $at_bison_check_first -gt 1; then
   46406     sed -n "1,`expr $at_bison_check_first - 1`"p \
   46407       at-bison-check-warnings > experr
   46408   fi
   46409   echo 'bison: warnings being treated as errors' >> experr
   46410 
   46411   # Finish building expected stderr and check.  Unlike warnings,
   46412   # complaints cause bison to exit early.  Thus, with -Werror, bison
   46413   # does not necessarily report all warnings that it does without
   46414   # -Werror, but it at least reports one.
   46415   at_bison_check_last=`sed -n '$=' stderr`
   46416   : ${at_bison_check_last:=1}
   46417   at_bison_check_last=`expr $at_bison_check_last - 1`
   46418   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   46419     at-bison-check-warnings >> experr
   46420   { set +x
   46421 $as_echo "$at_srcdir/actions.at:1303: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   46422               stderr 1>&2"
   46423 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1303"
   46424 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   46425               stderr 1>&2
   46426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46427 at_status=$? at_failed=false
   46428 $at_check_filter
   46429 $at_diff experr "$at_stderr" || at_failed=:
   46430 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46431 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46432 $at_failed && at_fn_log_failure
   46433 $at_traceon; }
   46434 
   46435 
   46436   # Now check --warnings=error.
   46437   cp stderr experr
   46438   { set +x
   46439 $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error"
   46440 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "actions.at:1303"
   46441 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error
   46442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46443 at_status=$? at_failed=false
   46444 $at_check_filter
   46445 $at_diff experr "$at_stderr" || at_failed=:
   46446 $at_diff expout "$at_stdout" || at_failed=:
   46447 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1303"
   46448 $at_failed && at_fn_log_failure
   46449 $at_traceon; }
   46450 
   46451 
   46452   # Now check -Wnone and --warnings=none by making sure that
   46453   # -Werror doesn't change the exit status when -Wnone or
   46454   # --warnings=none is specified.
   46455   { set +x
   46456 $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror"
   46457 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "actions.at:1303"
   46458 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror
   46459 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46460 at_status=$? at_failed=false
   46461 $at_check_filter
   46462 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46463 $at_diff expout "$at_stdout" || at_failed=:
   46464 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46465 $at_failed && at_fn_log_failure
   46466 $at_traceon; }
   46467 
   46468   { set +x
   46469 $as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror"
   46470 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "actions.at:1303"
   46471 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror
   46472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46473 at_status=$? at_failed=false
   46474 $at_check_filter
   46475 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46476 $at_diff expout "$at_stdout" || at_failed=:
   46477 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
   46478 $at_failed && at_fn_log_failure
   46479 $at_traceon; }
   46480 
   46481 
   46482   at_restore_special_files
   46483 fi
   46484 
   46485 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   46486   at_save_special_files
   46487   mkdir xml-tests
   46488     # Don't combine these Bison invocations since we want to be sure that
   46489   # --report=all isn't required to get the full XML file.
   46490   { set +x
   46491 $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   46492                   --graph=xml-tests/test.dot -fcaret -o input.c input.y"
   46493 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1308"
   46494 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   46495                   --graph=xml-tests/test.dot -fcaret -o input.c input.y
   46496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46497 at_status=$? at_failed=false
   46498 $at_check_filter
   46499 echo stderr:; cat "$at_stderr"
   46500 echo stdout:; cat "$at_stdout"
   46501 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46502 $at_failed && at_fn_log_failure
   46503 $at_traceon; }
   46504 
   46505   { set +x
   46506 $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y"
   46507 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1308"
   46508 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y
   46509 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46510 at_status=$? at_failed=false
   46511 $at_check_filter
   46512 echo stderr:; cat "$at_stderr"
   46513 echo stdout:; cat "$at_stdout"
   46514 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46515 $at_failed && at_fn_log_failure
   46516 $at_traceon; }
   46517 
   46518     cp xml-tests/test.output expout
   46519   { set +x
   46520 $as_echo "$at_srcdir/actions.at:1308: \$XSLTPROC \\
   46521              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   46522              xml-tests/test.xml"
   46523 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1308"
   46524 ( $at_check_trace; $XSLTPROC \
   46525              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   46526              xml-tests/test.xml
   46527 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46528 at_status=$? at_failed=false
   46529 $at_check_filter
   46530 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46531 $at_diff expout "$at_stdout" || at_failed=:
   46532 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46533 $at_failed && at_fn_log_failure
   46534 $at_traceon; }
   46535 
   46536   sort xml-tests/test.dot > expout
   46537   { set +x
   46538 $as_echo "$at_srcdir/actions.at:1308: \$XSLTPROC \\
   46539              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   46540              xml-tests/test.xml | sort"
   46541 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1308"
   46542 ( $at_check_trace; $XSLTPROC \
   46543              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   46544              xml-tests/test.xml | sort
   46545 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46546 at_status=$? at_failed=false
   46547 $at_check_filter
   46548 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46549 $at_diff expout "$at_stdout" || at_failed=:
   46550 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46551 $at_failed && at_fn_log_failure
   46552 $at_traceon; }
   46553 
   46554   rm -rf xml-tests expout
   46555   at_restore_special_files
   46556 fi
   46557 { set +x
   46558 $as_echo "$at_srcdir/actions.at:1308: bison -fcaret -o input.c input.y"
   46559 at_fn_check_prepare_trace "actions.at:1308"
   46560 ( $at_check_trace; bison -fcaret -o input.c input.y
   46561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46562 at_status=$? at_failed=false
   46563 $at_check_filter
   46564 echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$
   46565    {           @\$ = 4; } // Only used.
   46566    ^^^^^^^^^^^^^^^^^^^^^
   46567 input.y:32.3-23: warning: unused value: \$3
   46568    { USE (\$\$); @\$ = 3; } // Only set.
   46569    ^^^^^^^^^^^^^^^^^^^^^
   46570 " | \
   46571   $at_diff - "$at_stderr" || at_failed=:
   46572 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46573 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46574 $at_failed && at_fn_log_failure
   46575 $at_traceon; }
   46576 
   46577 # Defining POSIXLY_CORRECT causes bison to complain if options are
   46578 # added after the grammar file name, so skip these checks in that
   46579 # case.
   46580 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   46581   at_save_special_files
   46582 
   46583   # To avoid expanding it repeatedly, store specified stdout.
   46584   : >expout
   46585 
   46586   # Run with -Werror.
   46587   { set +x
   46588 $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror"
   46589 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "actions.at:1308"
   46590 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror
   46591 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46592 at_status=$? at_failed=false
   46593 $at_check_filter
   46594 echo stderr:; tee stderr <"$at_stderr"
   46595 $at_diff expout "$at_stdout" || at_failed=:
   46596 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1308"
   46597 $at_failed && at_fn_log_failure
   46598 $at_traceon; }
   46599 
   46600 
   46601   # Build expected stderr up to and including the "warnings being
   46602   # treated as errors" message.
   46603   cat >at-bison-check-warnings <<'_ATEOF'
   46604 input.y:33.3-23: warning: unset value: $$
   46605    {           @$ = 4; } // Only used.
   46606    ^^^^^^^^^^^^^^^^^^^^^
   46607 input.y:32.3-23: warning: unused value: $3
   46608    { USE ($$); @$ = 3; } // Only set.
   46609    ^^^^^^^^^^^^^^^^^^^^^
   46610 _ATEOF
   46611 
   46612   at_bison_check_first=`sed -n \
   46613     '/: warning: /{=;q;}' at-bison-check-warnings`
   46614   : ${at_bison_check_first:=1}
   46615   at_bison_check_first_tmp=`sed -n \
   46616     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   46617   : ${at_bison_check_first_tmp:=1}
   46618   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   46619     at_bison_check_first=$at_bison_check_first_tmp
   46620   fi
   46621   if test $at_bison_check_first -gt 1; then
   46622     sed -n "1,`expr $at_bison_check_first - 1`"p \
   46623       at-bison-check-warnings > experr
   46624   fi
   46625   echo 'bison: warnings being treated as errors' >> experr
   46626 
   46627   # Finish building expected stderr and check.  Unlike warnings,
   46628   # complaints cause bison to exit early.  Thus, with -Werror, bison
   46629   # does not necessarily report all warnings that it does without
   46630   # -Werror, but it at least reports one.
   46631   at_bison_check_last=`sed -n '$=' stderr`
   46632   : ${at_bison_check_last:=1}
   46633   at_bison_check_last=`expr $at_bison_check_last - 1`
   46634   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   46635     at-bison-check-warnings >> experr
   46636   { set +x
   46637 $as_echo "$at_srcdir/actions.at:1308: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   46638               stderr 1>&2"
   46639 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1308"
   46640 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   46641               stderr 1>&2
   46642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46643 at_status=$? at_failed=false
   46644 $at_check_filter
   46645 $at_diff experr "$at_stderr" || at_failed=:
   46646 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46647 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46648 $at_failed && at_fn_log_failure
   46649 $at_traceon; }
   46650 
   46651 
   46652   # Now check --warnings=error.
   46653   cp stderr experr
   46654   { set +x
   46655 $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error"
   46656 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "actions.at:1308"
   46657 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error
   46658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46659 at_status=$? at_failed=false
   46660 $at_check_filter
   46661 $at_diff experr "$at_stderr" || at_failed=:
   46662 $at_diff expout "$at_stdout" || at_failed=:
   46663 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1308"
   46664 $at_failed && at_fn_log_failure
   46665 $at_traceon; }
   46666 
   46667 
   46668   # Now check -Wnone and --warnings=none by making sure that
   46669   # -Werror doesn't change the exit status when -Wnone or
   46670   # --warnings=none is specified.
   46671   { set +x
   46672 $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror"
   46673 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "actions.at:1308"
   46674 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror
   46675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46676 at_status=$? at_failed=false
   46677 $at_check_filter
   46678 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46679 $at_diff expout "$at_stdout" || at_failed=:
   46680 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46681 $at_failed && at_fn_log_failure
   46682 $at_traceon; }
   46683 
   46684   { set +x
   46685 $as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror"
   46686 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "actions.at:1308"
   46687 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror
   46688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46689 at_status=$? at_failed=false
   46690 $at_check_filter
   46691 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46692 $at_diff expout "$at_stdout" || at_failed=:
   46693 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1308"
   46694 $at_failed && at_fn_log_failure
   46695 $at_traceon; }
   46696 
   46697 
   46698   at_restore_special_files
   46699 fi
   46700 
   46701 { set +x
   46702 $as_echo "$at_srcdir/actions.at:1317: \$BISON_C_WORKS"
   46703 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1317"
   46704 ( $at_check_trace; $BISON_C_WORKS
   46705 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46706 at_status=$? at_failed=false
   46707 $at_check_filter
   46708 echo stderr:; cat "$at_stderr"
   46709 echo stdout:; cat "$at_stdout"
   46710 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1317"
   46711 $at_failed && at_fn_log_failure
   46712 $at_traceon; }
   46713 
   46714 { set +x
   46715 $as_echo "$at_srcdir/actions.at:1317: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   46716 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1317"
   46717 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   46718 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46719 at_status=$? at_failed=false
   46720 $at_check_filter
   46721 echo stderr:; cat "$at_stderr"
   46722 echo stdout:; cat "$at_stdout"
   46723 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1317"
   46724 $at_failed && at_fn_log_failure
   46725 $at_traceon; }
   46726 
   46727 { set +x
   46728 $as_echo "$at_srcdir/actions.at:1318:  \$PREPARSER ./input"
   46729 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1318"
   46730 ( $at_check_trace;  $PREPARSER ./input
   46731 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46732 at_status=$? at_failed=false
   46733 $at_check_filter
   46734 echo stderr:; tee stderr <"$at_stderr"
   46735 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46736 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1318"
   46737 $at_failed && at_fn_log_failure
   46738 $at_traceon; }
   46739 
   46740 { set +x
   46741 $as_echo "$at_srcdir/actions.at:1318: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   46742 at_fn_check_prepare_trace "actions.at:1318"
   46743 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   46744 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46745 at_status=$? at_failed=false
   46746 $at_check_filter
   46747 echo >>"$at_stderr"; $as_echo "Starting parse
   46748 Entering state 0
   46749 Reducing stack by rule 1 (line 30):
   46750 -> \$\$ = nterm \$@1 (: )
   46751 Stack now 0
   46752 Entering state 2
   46753 Reducing stack by rule 2 (line 31):
   46754 -> \$\$ = nterm @2 (: 2)
   46755 Stack now 0 2
   46756 Entering state 4
   46757 Reducing stack by rule 3 (line 32):
   46758 -> \$\$ = nterm @3 (: 3)
   46759 Stack now 0 2 4
   46760 Entering state 5
   46761 Reducing stack by rule 4 (line 33):
   46762 -> \$\$ = nterm @4 (: 4)
   46763 Stack now 0 2 4 5
   46764 Entering state 6
   46765 Reading a token: Now at end of input.
   46766 syntax error
   46767 Error: popping nterm @4 (: 4)
   46768 DESTROY 4
   46769 Stack now 0 2 4 5
   46770 Error: popping nterm @3 (: 3)
   46771 DESTROY 3
   46772 Stack now 0 2 4
   46773 Error: popping nterm @2 (: 2)
   46774 DESTROY 2
   46775 Stack now 0 2
   46776 Error: popping nterm \$@1 (: )
   46777 Stack now 0
   46778 Cleanup: discarding lookahead token \$end (: )
   46779 Stack now 0
   46780 " | \
   46781   $at_diff - "$at_stderr" || at_failed=:
   46782 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46783 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1318"
   46784 $at_failed && at_fn_log_failure
   46785 $at_traceon; }
   46786 
   46787 
   46788 
   46789   set +x
   46790   $at_times_p && times >"$at_times_file"
   46791 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   46792 read at_status <"$at_status_file"
   46793 #AT_STOP_170
   46794 #AT_START_171
   46795 at_fn_group_banner 171 'actions.at:1406' \
   46796   "@\$ in %initial-action implies %locations" "       " 9
   46797 at_xfail=no
   46798 (
   46799   $as_echo "171. $at_setup_line: testing $at_desc ..."
   46800   $at_traceon
   46801 
   46802 
   46803 cat >input.y <<'_ATEOF'
   46804 %code top {
   46805 #include <config.h>
   46806 /* We don't need perfect functions for these tests. */
   46807 #undef malloc
   46808 #undef memcmp
   46809 #undef realloc
   46810 }
   46811 
   46812 %code {
   46813   #include <stdio.h>
   46814 static void yyerror ( const char *msg);
   46815 static int yylex (void);
   46816 }
   46817 
   46818 %debug
   46819 
   46820 %initial-action {
   46821   fprintf (stderr, "%d\n", @$.first_line);
   46822 }
   46823 
   46824 %%
   46825 
   46826 start:  ;
   46827 
   46828 %%
   46829 
   46830 static int
   46831 yylex (void)
   46832 {
   46833   return 0;
   46834 }
   46835 
   46836 #include <stdio.h>
   46837 /* A C error reporting function.  */
   46838 static
   46839 void yyerror ( const char *msg)
   46840 {
   46841   fprintf (stderr, "%s\n", msg);
   46842 }
   46843 int
   46844 main (void)
   46845 {
   46846   return yyparse ();
   46847 }
   46848 _ATEOF
   46849 
   46850 
   46851 
   46852 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   46853   at_save_special_files
   46854   mkdir xml-tests
   46855     # Don't combine these Bison invocations since we want to be sure that
   46856   # --report=all isn't required to get the full XML file.
   46857   { set +x
   46858 $as_echo "$at_srcdir/actions.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   46859                   --graph=xml-tests/test.dot -o input.c input.y"
   46860 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1406"
   46861 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   46862                   --graph=xml-tests/test.dot -o input.c input.y
   46863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46864 at_status=$? at_failed=false
   46865 $at_check_filter
   46866 echo stderr:; cat "$at_stderr"
   46867 echo stdout:; cat "$at_stdout"
   46868 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46869 $at_failed && at_fn_log_failure
   46870 $at_traceon; }
   46871 
   46872   { set +x
   46873 $as_echo "$at_srcdir/actions.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   46874 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1406"
   46875 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   46876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46877 at_status=$? at_failed=false
   46878 $at_check_filter
   46879 echo stderr:; cat "$at_stderr"
   46880 echo stdout:; cat "$at_stdout"
   46881 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46882 $at_failed && at_fn_log_failure
   46883 $at_traceon; }
   46884 
   46885     cp xml-tests/test.output expout
   46886   { set +x
   46887 $as_echo "$at_srcdir/actions.at:1406: \$XSLTPROC \\
   46888              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   46889              xml-tests/test.xml"
   46890 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1406"
   46891 ( $at_check_trace; $XSLTPROC \
   46892              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   46893              xml-tests/test.xml
   46894 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46895 at_status=$? at_failed=false
   46896 $at_check_filter
   46897 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46898 $at_diff expout "$at_stdout" || at_failed=:
   46899 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46900 $at_failed && at_fn_log_failure
   46901 $at_traceon; }
   46902 
   46903   sort xml-tests/test.dot > expout
   46904   { set +x
   46905 $as_echo "$at_srcdir/actions.at:1406: \$XSLTPROC \\
   46906              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   46907              xml-tests/test.xml | sort"
   46908 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1406"
   46909 ( $at_check_trace; $XSLTPROC \
   46910              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   46911              xml-tests/test.xml | sort
   46912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46913 at_status=$? at_failed=false
   46914 $at_check_filter
   46915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46916 $at_diff expout "$at_stdout" || at_failed=:
   46917 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46918 $at_failed && at_fn_log_failure
   46919 $at_traceon; }
   46920 
   46921   rm -rf xml-tests expout
   46922   at_restore_special_files
   46923 fi
   46924 { set +x
   46925 $as_echo "$at_srcdir/actions.at:1406: bison -o input.c input.y"
   46926 at_fn_check_prepare_trace "actions.at:1406"
   46927 ( $at_check_trace; bison -o input.c input.y
   46928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46929 at_status=$? at_failed=false
   46930 $at_check_filter
   46931 at_fn_diff_devnull "$at_stderr" || at_failed=:
   46932 at_fn_diff_devnull "$at_stdout" || at_failed=:
   46933 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46934 $at_failed && at_fn_log_failure
   46935 $at_traceon; }
   46936 
   46937 
   46938 { set +x
   46939 $as_echo "$at_srcdir/actions.at:1406: \$BISON_C_WORKS"
   46940 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1406"
   46941 ( $at_check_trace; $BISON_C_WORKS
   46942 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46943 at_status=$? at_failed=false
   46944 $at_check_filter
   46945 echo stderr:; cat "$at_stderr"
   46946 echo stdout:; cat "$at_stdout"
   46947 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46948 $at_failed && at_fn_log_failure
   46949 $at_traceon; }
   46950 
   46951 { set +x
   46952 $as_echo "$at_srcdir/actions.at:1406: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   46953 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1406"
   46954 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   46955 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   46956 at_status=$? at_failed=false
   46957 $at_check_filter
   46958 echo stderr:; cat "$at_stderr"
   46959 echo stdout:; cat "$at_stdout"
   46960 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1406"
   46961 $at_failed && at_fn_log_failure
   46962 $at_traceon; }
   46963 
   46964 
   46965   set +x
   46966   $at_times_p && times >"$at_times_file"
   46967 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   46968 read at_status <"$at_status_file"
   46969 #AT_STOP_171
   46970 #AT_START_172
   46971 at_fn_group_banner 172 'actions.at:1407' \
   46972   "@\$ in %destructor implies %locations" "           " 9
   46973 at_xfail=no
   46974 (
   46975   $as_echo "172. $at_setup_line: testing $at_desc ..."
   46976   $at_traceon
   46977 
   46978 
   46979 cat >input.y <<'_ATEOF'
   46980 %code top {
   46981 #include <config.h>
   46982 /* We don't need perfect functions for these tests. */
   46983 #undef malloc
   46984 #undef memcmp
   46985 #undef realloc
   46986 }
   46987 
   46988 %code {
   46989   #include <stdio.h>
   46990 static void yyerror ( const char *msg);
   46991 static int yylex (void);
   46992 }
   46993 
   46994 %debug
   46995 
   46996 %destructor {
   46997   fprintf (stderr, "%d\n", @$.first_line);
   46998 } start
   46999 
   47000 %%
   47001 
   47002 start:  ;
   47003 
   47004 %%
   47005 
   47006 static int
   47007 yylex (void)
   47008 {
   47009   return 0;
   47010 }
   47011 
   47012 #include <stdio.h>
   47013 /* A C error reporting function.  */
   47014 static
   47015 void yyerror ( const char *msg)
   47016 {
   47017   fprintf (stderr, "%s\n", msg);
   47018 }
   47019 int
   47020 main (void)
   47021 {
   47022   return yyparse ();
   47023 }
   47024 _ATEOF
   47025 
   47026 
   47027 
   47028 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   47029   at_save_special_files
   47030   mkdir xml-tests
   47031     # Don't combine these Bison invocations since we want to be sure that
   47032   # --report=all isn't required to get the full XML file.
   47033   { set +x
   47034 $as_echo "$at_srcdir/actions.at:1407: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   47035                   --graph=xml-tests/test.dot -o input.c input.y"
   47036 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1407"
   47037 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   47038                   --graph=xml-tests/test.dot -o input.c input.y
   47039 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47040 at_status=$? at_failed=false
   47041 $at_check_filter
   47042 echo stderr:; cat "$at_stderr"
   47043 echo stdout:; cat "$at_stdout"
   47044 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47045 $at_failed && at_fn_log_failure
   47046 $at_traceon; }
   47047 
   47048   { set +x
   47049 $as_echo "$at_srcdir/actions.at:1407: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   47050 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1407"
   47051 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   47052 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47053 at_status=$? at_failed=false
   47054 $at_check_filter
   47055 echo stderr:; cat "$at_stderr"
   47056 echo stdout:; cat "$at_stdout"
   47057 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47058 $at_failed && at_fn_log_failure
   47059 $at_traceon; }
   47060 
   47061     cp xml-tests/test.output expout
   47062   { set +x
   47063 $as_echo "$at_srcdir/actions.at:1407: \$XSLTPROC \\
   47064              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   47065              xml-tests/test.xml"
   47066 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1407"
   47067 ( $at_check_trace; $XSLTPROC \
   47068              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   47069              xml-tests/test.xml
   47070 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47071 at_status=$? at_failed=false
   47072 $at_check_filter
   47073 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47074 $at_diff expout "$at_stdout" || at_failed=:
   47075 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47076 $at_failed && at_fn_log_failure
   47077 $at_traceon; }
   47078 
   47079   sort xml-tests/test.dot > expout
   47080   { set +x
   47081 $as_echo "$at_srcdir/actions.at:1407: \$XSLTPROC \\
   47082              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   47083              xml-tests/test.xml | sort"
   47084 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1407"
   47085 ( $at_check_trace; $XSLTPROC \
   47086              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   47087              xml-tests/test.xml | sort
   47088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47089 at_status=$? at_failed=false
   47090 $at_check_filter
   47091 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47092 $at_diff expout "$at_stdout" || at_failed=:
   47093 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47094 $at_failed && at_fn_log_failure
   47095 $at_traceon; }
   47096 
   47097   rm -rf xml-tests expout
   47098   at_restore_special_files
   47099 fi
   47100 { set +x
   47101 $as_echo "$at_srcdir/actions.at:1407: bison -o input.c input.y"
   47102 at_fn_check_prepare_trace "actions.at:1407"
   47103 ( $at_check_trace; bison -o input.c input.y
   47104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47105 at_status=$? at_failed=false
   47106 $at_check_filter
   47107 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47108 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47109 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47110 $at_failed && at_fn_log_failure
   47111 $at_traceon; }
   47112 
   47113 
   47114 { set +x
   47115 $as_echo "$at_srcdir/actions.at:1407: \$BISON_C_WORKS"
   47116 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1407"
   47117 ( $at_check_trace; $BISON_C_WORKS
   47118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47119 at_status=$? at_failed=false
   47120 $at_check_filter
   47121 echo stderr:; cat "$at_stderr"
   47122 echo stdout:; cat "$at_stdout"
   47123 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47124 $at_failed && at_fn_log_failure
   47125 $at_traceon; }
   47126 
   47127 { set +x
   47128 $as_echo "$at_srcdir/actions.at:1407: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   47129 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1407"
   47130 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   47131 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47132 at_status=$? at_failed=false
   47133 $at_check_filter
   47134 echo stderr:; cat "$at_stderr"
   47135 echo stdout:; cat "$at_stdout"
   47136 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1407"
   47137 $at_failed && at_fn_log_failure
   47138 $at_traceon; }
   47139 
   47140 
   47141   set +x
   47142   $at_times_p && times >"$at_times_file"
   47143 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   47144 read at_status <"$at_status_file"
   47145 #AT_STOP_172
   47146 #AT_START_173
   47147 at_fn_group_banner 173 'actions.at:1408' \
   47148   "@\$ in %printer implies %locations" "              " 9
   47149 at_xfail=no
   47150 (
   47151   $as_echo "173. $at_setup_line: testing $at_desc ..."
   47152   $at_traceon
   47153 
   47154 
   47155 cat >input.y <<'_ATEOF'
   47156 %code top {
   47157 #include <config.h>
   47158 /* We don't need perfect functions for these tests. */
   47159 #undef malloc
   47160 #undef memcmp
   47161 #undef realloc
   47162 }
   47163 
   47164 %code {
   47165   #include <stdio.h>
   47166 static void yyerror ( const char *msg);
   47167 static int yylex (void);
   47168 }
   47169 
   47170 %debug
   47171 
   47172 %printer {
   47173   fprintf (stderr, "%d\n", @$.first_line);
   47174 } start
   47175 
   47176 %%
   47177 
   47178 start:  ;
   47179 
   47180 %%
   47181 
   47182 static int
   47183 yylex (void)
   47184 {
   47185   return 0;
   47186 }
   47187 
   47188 #include <stdio.h>
   47189 /* A C error reporting function.  */
   47190 static
   47191 void yyerror ( const char *msg)
   47192 {
   47193   fprintf (stderr, "%s\n", msg);
   47194 }
   47195 int
   47196 main (void)
   47197 {
   47198   return yyparse ();
   47199 }
   47200 _ATEOF
   47201 
   47202 
   47203 
   47204 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   47205   at_save_special_files
   47206   mkdir xml-tests
   47207     # Don't combine these Bison invocations since we want to be sure that
   47208   # --report=all isn't required to get the full XML file.
   47209   { set +x
   47210 $as_echo "$at_srcdir/actions.at:1408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   47211                   --graph=xml-tests/test.dot -o input.c input.y"
   47212 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1408"
   47213 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   47214                   --graph=xml-tests/test.dot -o input.c input.y
   47215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47216 at_status=$? at_failed=false
   47217 $at_check_filter
   47218 echo stderr:; cat "$at_stderr"
   47219 echo stdout:; cat "$at_stdout"
   47220 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47221 $at_failed && at_fn_log_failure
   47222 $at_traceon; }
   47223 
   47224   { set +x
   47225 $as_echo "$at_srcdir/actions.at:1408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   47226 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1408"
   47227 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   47228 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47229 at_status=$? at_failed=false
   47230 $at_check_filter
   47231 echo stderr:; cat "$at_stderr"
   47232 echo stdout:; cat "$at_stdout"
   47233 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47234 $at_failed && at_fn_log_failure
   47235 $at_traceon; }
   47236 
   47237     cp xml-tests/test.output expout
   47238   { set +x
   47239 $as_echo "$at_srcdir/actions.at:1408: \$XSLTPROC \\
   47240              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   47241              xml-tests/test.xml"
   47242 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1408"
   47243 ( $at_check_trace; $XSLTPROC \
   47244              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   47245              xml-tests/test.xml
   47246 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47247 at_status=$? at_failed=false
   47248 $at_check_filter
   47249 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47250 $at_diff expout "$at_stdout" || at_failed=:
   47251 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47252 $at_failed && at_fn_log_failure
   47253 $at_traceon; }
   47254 
   47255   sort xml-tests/test.dot > expout
   47256   { set +x
   47257 $as_echo "$at_srcdir/actions.at:1408: \$XSLTPROC \\
   47258              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   47259              xml-tests/test.xml | sort"
   47260 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1408"
   47261 ( $at_check_trace; $XSLTPROC \
   47262              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   47263              xml-tests/test.xml | sort
   47264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47265 at_status=$? at_failed=false
   47266 $at_check_filter
   47267 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47268 $at_diff expout "$at_stdout" || at_failed=:
   47269 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47270 $at_failed && at_fn_log_failure
   47271 $at_traceon; }
   47272 
   47273   rm -rf xml-tests expout
   47274   at_restore_special_files
   47275 fi
   47276 { set +x
   47277 $as_echo "$at_srcdir/actions.at:1408: bison -o input.c input.y"
   47278 at_fn_check_prepare_trace "actions.at:1408"
   47279 ( $at_check_trace; bison -o input.c input.y
   47280 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47281 at_status=$? at_failed=false
   47282 $at_check_filter
   47283 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47284 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47285 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47286 $at_failed && at_fn_log_failure
   47287 $at_traceon; }
   47288 
   47289 
   47290 { set +x
   47291 $as_echo "$at_srcdir/actions.at:1408: \$BISON_C_WORKS"
   47292 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1408"
   47293 ( $at_check_trace; $BISON_C_WORKS
   47294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47295 at_status=$? at_failed=false
   47296 $at_check_filter
   47297 echo stderr:; cat "$at_stderr"
   47298 echo stdout:; cat "$at_stdout"
   47299 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47300 $at_failed && at_fn_log_failure
   47301 $at_traceon; }
   47302 
   47303 { set +x
   47304 $as_echo "$at_srcdir/actions.at:1408: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   47305 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1408"
   47306 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   47307 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47308 at_status=$? at_failed=false
   47309 $at_check_filter
   47310 echo stderr:; cat "$at_stderr"
   47311 echo stdout:; cat "$at_stdout"
   47312 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1408"
   47313 $at_failed && at_fn_log_failure
   47314 $at_traceon; }
   47315 
   47316 
   47317   set +x
   47318   $at_times_p && times >"$at_times_file"
   47319 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   47320 read at_status <"$at_status_file"
   47321 #AT_STOP_173
   47322 #AT_START_174
   47323 at_fn_group_banner 174 'actions.at:1529' \
   47324   "Qualified \$\$ in actions: yacc.c" "                " 9
   47325 at_xfail=no
   47326 (
   47327   $as_echo "174. $at_setup_line: testing $at_desc ..."
   47328   $at_traceon
   47329 
   47330 
   47331 
   47332 
   47333 cat >input.y <<'_ATEOF'
   47334 %code top {
   47335 #include <config.h>
   47336 /* We don't need perfect functions for these tests. */
   47337 #undef malloc
   47338 #undef memcmp
   47339 #undef realloc
   47340 }
   47341 
   47342 %skeleton "yacc.c"
   47343 %defines   // FIXME: Mandated by lalr1.cc in Bison 2.6.
   47344 %locations // FIXME: Mandated by lalr1.cc in Bison 2.6.
   47345 %debug
   47346 %code requires
   47347 {
   47348   typedef struct sem_type
   47349   {
   47350     int ival;
   47351     float fval;
   47352   } sem_type;
   47353 
   47354 # define YYSTYPE sem_type
   47355 
   47356 
   47357 # include <stdio.h>
   47358   static void
   47359   report (FILE* yyo, int ival, float fval)
   47360   {
   47361     fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
   47362   }
   47363 
   47364 }
   47365 
   47366 %code
   47367 {
   47368   static void yyerror ( const char *msg);
   47369   static int yylex (void);
   47370 }
   47371 
   47372 %token UNTYPED
   47373 %token <ival> INT
   47374 %type <fval> float
   47375 %printer { report (yyo, $$,       $<fval>$); } <ival>;
   47376 %printer { report (yyo, $<ival>$, $$      ); } <fval>;
   47377 %printer { report (yyo, $<ival>$, $<fval>$); } <>;
   47378 
   47379 %initial-action
   47380 {
   47381   $<ival>$ = 42;
   47382   $<fval>$ = 4.2;
   47383 }
   47384 
   47385 %%
   47386 float: UNTYPED INT
   47387 {
   47388   $$       = $<fval>1 + $<fval>2;
   47389   $<ival>$ = $<ival>1 + $2;
   47390 };
   47391 %%
   47392 #include <stdio.h>
   47393 /* A C error reporting function.  */
   47394 static
   47395 void yyerror ( const char *msg)
   47396 {
   47397   YY_LOCATION_PRINT (stderr, (yylloc));
   47398   fprintf (stderr, ": ");
   47399   fprintf (stderr, "%s\n", msg);
   47400 }
   47401 #include <assert.h>
   47402 static
   47403 int yylex (void)
   47404 {
   47405   static int const input[] = {UNTYPED, INT, EOF};
   47406   static size_t toknum = 0;
   47407   int res;
   47408   ;
   47409   assert (toknum < sizeof input / sizeof input[0]);
   47410   res = input[toknum++];
   47411   (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;;
   47412   (yylloc).first_line = (yylloc).last_line = 1;
   47413   (yylloc).first_column = (yylloc).last_column = toknum;
   47414   return res;
   47415 }
   47416 int
   47417 main (void)
   47418 {
   47419   yydebug = 1;
   47420   return yyparse ();
   47421 }
   47422 _ATEOF
   47423 
   47424 
   47425 
   47426 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   47427   at_save_special_files
   47428   mkdir xml-tests
   47429     # Don't combine these Bison invocations since we want to be sure that
   47430   # --report=all isn't required to get the full XML file.
   47431   { set +x
   47432 $as_echo "$at_srcdir/actions.at:1529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   47433                   --graph=xml-tests/test.dot -o input.c input.y"
   47434 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1529"
   47435 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   47436                   --graph=xml-tests/test.dot -o input.c input.y
   47437 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47438 at_status=$? at_failed=false
   47439 $at_check_filter
   47440 echo stderr:; cat "$at_stderr"
   47441 echo stdout:; cat "$at_stdout"
   47442 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47443 $at_failed && at_fn_log_failure
   47444 $at_traceon; }
   47445 
   47446   { set +x
   47447 $as_echo "$at_srcdir/actions.at:1529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   47448 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1529"
   47449 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   47450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47451 at_status=$? at_failed=false
   47452 $at_check_filter
   47453 echo stderr:; cat "$at_stderr"
   47454 echo stdout:; cat "$at_stdout"
   47455 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47456 $at_failed && at_fn_log_failure
   47457 $at_traceon; }
   47458 
   47459     cp xml-tests/test.output expout
   47460   { set +x
   47461 $as_echo "$at_srcdir/actions.at:1529: \$XSLTPROC \\
   47462              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   47463              xml-tests/test.xml"
   47464 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1529"
   47465 ( $at_check_trace; $XSLTPROC \
   47466              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   47467              xml-tests/test.xml
   47468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47469 at_status=$? at_failed=false
   47470 $at_check_filter
   47471 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47472 $at_diff expout "$at_stdout" || at_failed=:
   47473 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47474 $at_failed && at_fn_log_failure
   47475 $at_traceon; }
   47476 
   47477   sort xml-tests/test.dot > expout
   47478   { set +x
   47479 $as_echo "$at_srcdir/actions.at:1529: \$XSLTPROC \\
   47480              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   47481              xml-tests/test.xml | sort"
   47482 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1529"
   47483 ( $at_check_trace; $XSLTPROC \
   47484              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   47485              xml-tests/test.xml | sort
   47486 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47487 at_status=$? at_failed=false
   47488 $at_check_filter
   47489 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47490 $at_diff expout "$at_stdout" || at_failed=:
   47491 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47492 $at_failed && at_fn_log_failure
   47493 $at_traceon; }
   47494 
   47495   rm -rf xml-tests expout
   47496   at_restore_special_files
   47497 fi
   47498 { set +x
   47499 $as_echo "$at_srcdir/actions.at:1529: bison -o input.c input.y"
   47500 at_fn_check_prepare_trace "actions.at:1529"
   47501 ( $at_check_trace; bison -o input.c input.y
   47502 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47503 at_status=$? at_failed=false
   47504 $at_check_filter
   47505 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47506 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47507 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47508 $at_failed && at_fn_log_failure
   47509 $at_traceon; }
   47510 
   47511 
   47512    { set +x
   47513 $as_echo "$at_srcdir/actions.at:1529: \$BISON_C_WORKS"
   47514 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1529"
   47515 ( $at_check_trace; $BISON_C_WORKS
   47516 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47517 at_status=$? at_failed=false
   47518 $at_check_filter
   47519 echo stderr:; cat "$at_stderr"
   47520 echo stdout:; cat "$at_stdout"
   47521 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47522 $at_failed && at_fn_log_failure
   47523 $at_traceon; }
   47524 
   47525 { set +x
   47526 $as_echo "$at_srcdir/actions.at:1529: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   47527 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1529"
   47528 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   47529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47530 at_status=$? at_failed=false
   47531 $at_check_filter
   47532 echo stderr:; cat "$at_stderr"
   47533 echo stdout:; cat "$at_stdout"
   47534 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47535 $at_failed && at_fn_log_failure
   47536 $at_traceon; }
   47537 
   47538 
   47539 { set +x
   47540 $as_echo "$at_srcdir/actions.at:1529:  \$PREPARSER ./input"
   47541 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1529"
   47542 ( $at_check_trace;  $PREPARSER ./input
   47543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47544 at_status=$? at_failed=false
   47545 $at_check_filter
   47546 echo stderr:; tee stderr <"$at_stderr"
   47547 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47548 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47549 $at_failed && at_fn_log_failure
   47550 $at_traceon; }
   47551 
   47552 { set +x
   47553 $as_echo "$at_srcdir/actions.at:1529: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   47554 at_fn_check_prepare_trace "actions.at:1529"
   47555 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   47556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47557 at_status=$? at_failed=false
   47558 $at_check_filter
   47559 echo stderr:; tee stderr <"$at_stderr"
   47560 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47561 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47562 $at_failed && at_fn_log_failure
   47563 $at_traceon; }
   47564 
   47565 
   47566 # Don't be too picky on the traces, GLR is not exactly the same.  Keep
   47567 # only the lines from the printer.
   47568 #
   47569 # Don't care about locations.  FIXME: remove their removal when Bison
   47570 # supports C++ without locations.
   47571 { set +x
   47572 $as_echo "$at_srcdir/actions.at:1529: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr"
   47573 at_fn_check_prepare_trace "actions.at:1529"
   47574 ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr
   47575 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47576 at_status=$? at_failed=false
   47577 $at_check_filter
   47578 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47579 echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
   47580 Shifting token UNTYPED (ival: 10, fval: 0.1)
   47581 Reading a token: Next token is token INT (ival: 20, fval: 0.2)
   47582 Shifting token INT (ival: 20, fval: 0.2)
   47583    \$1 = token UNTYPED (ival: 10, fval: 0.1)
   47584    \$2 = token INT (ival: 20, fval: 0.2)
   47585 -> \$\$ = nterm float (ival: 30, fval: 0.3)
   47586 Cleanup: popping nterm float (ival: 30, fval: 0.3)
   47587 " | \
   47588   $at_diff - "$at_stdout" || at_failed=:
   47589 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529"
   47590 $at_failed && at_fn_log_failure
   47591 $at_traceon; }
   47592 
   47593 
   47594 
   47595 
   47596   set +x
   47597   $at_times_p && times >"$at_times_file"
   47598 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   47599 read at_status <"$at_status_file"
   47600 #AT_STOP_174
   47601 #AT_START_175
   47602 at_fn_group_banner 175 'actions.at:1530' \
   47603   "Qualified \$\$ in actions: glr.c" "                 " 9
   47604 at_xfail=no
   47605 (
   47606   $as_echo "175. $at_setup_line: testing $at_desc ..."
   47607   $at_traceon
   47608 
   47609 
   47610 
   47611 
   47612 cat >input.y <<'_ATEOF'
   47613 %code top {
   47614 #include <config.h>
   47615 /* We don't need perfect functions for these tests. */
   47616 #undef malloc
   47617 #undef memcmp
   47618 #undef realloc
   47619 }
   47620 
   47621 %skeleton "glr.c"
   47622 %defines   // FIXME: Mandated by lalr1.cc in Bison 2.6.
   47623 %locations // FIXME: Mandated by lalr1.cc in Bison 2.6.
   47624 %debug
   47625 %code requires
   47626 {
   47627   typedef struct sem_type
   47628   {
   47629     int ival;
   47630     float fval;
   47631   } sem_type;
   47632 
   47633 # define YYSTYPE sem_type
   47634 
   47635 
   47636 # include <stdio.h>
   47637   static void
   47638   report (FILE* yyo, int ival, float fval)
   47639   {
   47640     fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
   47641   }
   47642 
   47643 }
   47644 
   47645 %code
   47646 {
   47647   static void yyerror ( const char *msg);
   47648   static int yylex (void);
   47649 }
   47650 
   47651 %token UNTYPED
   47652 %token <ival> INT
   47653 %type <fval> float
   47654 %printer { report (yyo, $$,       $<fval>$); } <ival>;
   47655 %printer { report (yyo, $<ival>$, $$      ); } <fval>;
   47656 %printer { report (yyo, $<ival>$, $<fval>$); } <>;
   47657 
   47658 %initial-action
   47659 {
   47660   $<ival>$ = 42;
   47661   $<fval>$ = 4.2;
   47662 }
   47663 
   47664 %%
   47665 float: UNTYPED INT
   47666 {
   47667   $$       = $<fval>1 + $<fval>2;
   47668   $<ival>$ = $<ival>1 + $2;
   47669 };
   47670 %%
   47671 #include <stdio.h>
   47672 /* A C error reporting function.  */
   47673 static
   47674 void yyerror ( const char *msg)
   47675 {
   47676   YY_LOCATION_PRINT (stderr, (yylloc));
   47677   fprintf (stderr, ": ");
   47678   fprintf (stderr, "%s\n", msg);
   47679 }
   47680 #include <assert.h>
   47681 static
   47682 int yylex (void)
   47683 {
   47684   static int const input[] = {UNTYPED, INT, EOF};
   47685   static size_t toknum = 0;
   47686   int res;
   47687   ;
   47688   assert (toknum < sizeof input / sizeof input[0]);
   47689   res = input[toknum++];
   47690   (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;;
   47691   (yylloc).first_line = (yylloc).last_line = 1;
   47692   (yylloc).first_column = (yylloc).last_column = toknum;
   47693   return res;
   47694 }
   47695 int
   47696 main (void)
   47697 {
   47698   yydebug = 1;
   47699   return yyparse ();
   47700 }
   47701 _ATEOF
   47702 
   47703 
   47704 
   47705 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   47706   at_save_special_files
   47707   mkdir xml-tests
   47708     # Don't combine these Bison invocations since we want to be sure that
   47709   # --report=all isn't required to get the full XML file.
   47710   { set +x
   47711 $as_echo "$at_srcdir/actions.at:1530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   47712                   --graph=xml-tests/test.dot -o input.c input.y"
   47713 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1530"
   47714 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   47715                   --graph=xml-tests/test.dot -o input.c input.y
   47716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47717 at_status=$? at_failed=false
   47718 $at_check_filter
   47719 echo stderr:; cat "$at_stderr"
   47720 echo stdout:; cat "$at_stdout"
   47721 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47722 $at_failed && at_fn_log_failure
   47723 $at_traceon; }
   47724 
   47725   { set +x
   47726 $as_echo "$at_srcdir/actions.at:1530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   47727 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1530"
   47728 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   47729 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47730 at_status=$? at_failed=false
   47731 $at_check_filter
   47732 echo stderr:; cat "$at_stderr"
   47733 echo stdout:; cat "$at_stdout"
   47734 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47735 $at_failed && at_fn_log_failure
   47736 $at_traceon; }
   47737 
   47738     cp xml-tests/test.output expout
   47739   { set +x
   47740 $as_echo "$at_srcdir/actions.at:1530: \$XSLTPROC \\
   47741              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   47742              xml-tests/test.xml"
   47743 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1530"
   47744 ( $at_check_trace; $XSLTPROC \
   47745              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   47746              xml-tests/test.xml
   47747 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47748 at_status=$? at_failed=false
   47749 $at_check_filter
   47750 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47751 $at_diff expout "$at_stdout" || at_failed=:
   47752 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47753 $at_failed && at_fn_log_failure
   47754 $at_traceon; }
   47755 
   47756   sort xml-tests/test.dot > expout
   47757   { set +x
   47758 $as_echo "$at_srcdir/actions.at:1530: \$XSLTPROC \\
   47759              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   47760              xml-tests/test.xml | sort"
   47761 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1530"
   47762 ( $at_check_trace; $XSLTPROC \
   47763              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   47764              xml-tests/test.xml | sort
   47765 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47766 at_status=$? at_failed=false
   47767 $at_check_filter
   47768 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47769 $at_diff expout "$at_stdout" || at_failed=:
   47770 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47771 $at_failed && at_fn_log_failure
   47772 $at_traceon; }
   47773 
   47774   rm -rf xml-tests expout
   47775   at_restore_special_files
   47776 fi
   47777 { set +x
   47778 $as_echo "$at_srcdir/actions.at:1530: bison -o input.c input.y"
   47779 at_fn_check_prepare_trace "actions.at:1530"
   47780 ( $at_check_trace; bison -o input.c input.y
   47781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47782 at_status=$? at_failed=false
   47783 $at_check_filter
   47784 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47785 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47786 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47787 $at_failed && at_fn_log_failure
   47788 $at_traceon; }
   47789 
   47790 
   47791    { set +x
   47792 $as_echo "$at_srcdir/actions.at:1530: \$BISON_C_WORKS"
   47793 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1530"
   47794 ( $at_check_trace; $BISON_C_WORKS
   47795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47796 at_status=$? at_failed=false
   47797 $at_check_filter
   47798 echo stderr:; cat "$at_stderr"
   47799 echo stdout:; cat "$at_stdout"
   47800 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47801 $at_failed && at_fn_log_failure
   47802 $at_traceon; }
   47803 
   47804 { set +x
   47805 $as_echo "$at_srcdir/actions.at:1530: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   47806 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1530"
   47807 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   47808 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47809 at_status=$? at_failed=false
   47810 $at_check_filter
   47811 echo stderr:; cat "$at_stderr"
   47812 echo stdout:; cat "$at_stdout"
   47813 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47814 $at_failed && at_fn_log_failure
   47815 $at_traceon; }
   47816 
   47817 
   47818 { set +x
   47819 $as_echo "$at_srcdir/actions.at:1530:  \$PREPARSER ./input"
   47820 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1530"
   47821 ( $at_check_trace;  $PREPARSER ./input
   47822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47823 at_status=$? at_failed=false
   47824 $at_check_filter
   47825 echo stderr:; tee stderr <"$at_stderr"
   47826 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47827 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47828 $at_failed && at_fn_log_failure
   47829 $at_traceon; }
   47830 
   47831 { set +x
   47832 $as_echo "$at_srcdir/actions.at:1530: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   47833 at_fn_check_prepare_trace "actions.at:1530"
   47834 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   47835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47836 at_status=$? at_failed=false
   47837 $at_check_filter
   47838 echo stderr:; tee stderr <"$at_stderr"
   47839 at_fn_diff_devnull "$at_stdout" || at_failed=:
   47840 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47841 $at_failed && at_fn_log_failure
   47842 $at_traceon; }
   47843 
   47844 
   47845 # Don't be too picky on the traces, GLR is not exactly the same.  Keep
   47846 # only the lines from the printer.
   47847 #
   47848 # Don't care about locations.  FIXME: remove their removal when Bison
   47849 # supports C++ without locations.
   47850 { set +x
   47851 $as_echo "$at_srcdir/actions.at:1530: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr"
   47852 at_fn_check_prepare_trace "actions.at:1530"
   47853 ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr
   47854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47855 at_status=$? at_failed=false
   47856 $at_check_filter
   47857 at_fn_diff_devnull "$at_stderr" || at_failed=:
   47858 echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
   47859 Shifting token UNTYPED (ival: 10, fval: 0.1)
   47860 Reading a token: Next token is token INT (ival: 20, fval: 0.2)
   47861 Shifting token INT (ival: 20, fval: 0.2)
   47862    \$1 = token UNTYPED (ival: 10, fval: 0.1)
   47863    \$2 = token INT (ival: 20, fval: 0.2)
   47864 -> \$\$ = nterm float (ival: 30, fval: 0.3)
   47865 Cleanup: popping nterm float (ival: 30, fval: 0.3)
   47866 " | \
   47867   $at_diff - "$at_stdout" || at_failed=:
   47868 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530"
   47869 $at_failed && at_fn_log_failure
   47870 $at_traceon; }
   47871 
   47872 
   47873 
   47874 
   47875   set +x
   47876   $at_times_p && times >"$at_times_file"
   47877 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   47878 read at_status <"$at_status_file"
   47879 #AT_STOP_175
   47880 #AT_START_176
   47881 at_fn_group_banner 176 'actions.at:1531' \
   47882   "Qualified \$\$ in actions: lalr1.cc" "              " 9
   47883 at_xfail=no
   47884 (
   47885   $as_echo "176. $at_setup_line: testing $at_desc ..."
   47886   $at_traceon
   47887 
   47888 
   47889 
   47890 
   47891 cat >input.y <<'_ATEOF'
   47892 %code top {
   47893 #include <config.h>
   47894 /* We don't need perfect functions for these tests. */
   47895 #undef malloc
   47896 #undef memcmp
   47897 #undef realloc
   47898 }
   47899 
   47900 %skeleton "lalr1.cc"
   47901 %defines   // FIXME: Mandated by lalr1.cc in Bison 2.6.
   47902 %locations // FIXME: Mandated by lalr1.cc in Bison 2.6.
   47903 %debug
   47904 %code requires
   47905 {
   47906   typedef struct sem_type
   47907   {
   47908     int ival;
   47909     float fval;
   47910   } sem_type;
   47911 
   47912 # define YYSTYPE sem_type
   47913 
   47914 
   47915 # include <iostream>
   47916   static void
   47917   report (std::ostream& yyo, int ival, float fval)
   47918   {
   47919     yyo << "ival: " << ival << ", fval: " <<  fval;
   47920   }
   47921 
   47922 }
   47923 
   47924 %code
   47925 {
   47926 
   47927   static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   47928 }
   47929 
   47930 %token UNTYPED
   47931 %token <ival> INT
   47932 %type <fval> float
   47933 %printer { report (yyo, $$,       $<fval>$); } <ival>;
   47934 %printer { report (yyo, $<ival>$, $$      ); } <fval>;
   47935 %printer { report (yyo, $<ival>$, $<fval>$); } <>;
   47936 
   47937 %initial-action
   47938 {
   47939   $<ival>$ = 42;
   47940   $<fval>$ = 4.2;
   47941 }
   47942 
   47943 %%
   47944 float: UNTYPED INT
   47945 {
   47946   $$       = $<fval>1 + $<fval>2;
   47947   $<ival>$ = $<ival>1 + $2;
   47948 };
   47949 %%
   47950 /* A C++ error reporting function.  */
   47951 void
   47952 yy::parser::error (const location_type& l, const std::string& m)
   47953 {
   47954   (void) l;
   47955   std::cerr << l << ": " << m << std::endl;
   47956 }
   47957 #include <assert.h>
   47958 static
   47959 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   47960 {
   47961   static int const input[] = {yy::parser::token::UNTYPED,
   47962                                  yy::parser::token::INT,
   47963                                   EOF};
   47964   static size_t toknum = 0;
   47965   int res;
   47966   (void) lvalp;(void) llocp;
   47967   assert (toknum < sizeof input / sizeof input[0]);
   47968   res = input[toknum++];
   47969   (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;;
   47970   (*llocp).begin.line = (*llocp).end.line = 1;
   47971   (*llocp).begin.column = (*llocp).end.column = toknum;
   47972   return res;
   47973 }
   47974 int
   47975 main (void)
   47976 {
   47977   yy::parser p;
   47978   p.set_debug_level(1);
   47979   return p.parse ();
   47980 }
   47981 _ATEOF
   47982 
   47983 
   47984 
   47985 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   47986   at_save_special_files
   47987   mkdir xml-tests
   47988     # Don't combine these Bison invocations since we want to be sure that
   47989   # --report=all isn't required to get the full XML file.
   47990   { set +x
   47991 $as_echo "$at_srcdir/actions.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   47992                   --graph=xml-tests/test.dot -o input.cc input.y"
   47993 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1531"
   47994 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   47995                   --graph=xml-tests/test.dot -o input.cc input.y
   47996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   47997 at_status=$? at_failed=false
   47998 $at_check_filter
   47999 echo stderr:; cat "$at_stderr"
   48000 echo stdout:; cat "$at_stdout"
   48001 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48002 $at_failed && at_fn_log_failure
   48003 $at_traceon; }
   48004 
   48005   { set +x
   48006 $as_echo "$at_srcdir/actions.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   48007 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1531"
   48008 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   48009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48010 at_status=$? at_failed=false
   48011 $at_check_filter
   48012 echo stderr:; cat "$at_stderr"
   48013 echo stdout:; cat "$at_stdout"
   48014 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48015 $at_failed && at_fn_log_failure
   48016 $at_traceon; }
   48017 
   48018     cp xml-tests/test.output expout
   48019   { set +x
   48020 $as_echo "$at_srcdir/actions.at:1531: \$XSLTPROC \\
   48021              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   48022              xml-tests/test.xml"
   48023 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1531"
   48024 ( $at_check_trace; $XSLTPROC \
   48025              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   48026              xml-tests/test.xml
   48027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48028 at_status=$? at_failed=false
   48029 $at_check_filter
   48030 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48031 $at_diff expout "$at_stdout" || at_failed=:
   48032 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48033 $at_failed && at_fn_log_failure
   48034 $at_traceon; }
   48035 
   48036   sort xml-tests/test.dot > expout
   48037   { set +x
   48038 $as_echo "$at_srcdir/actions.at:1531: \$XSLTPROC \\
   48039              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   48040              xml-tests/test.xml | sort"
   48041 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1531"
   48042 ( $at_check_trace; $XSLTPROC \
   48043              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   48044              xml-tests/test.xml | sort
   48045 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48046 at_status=$? at_failed=false
   48047 $at_check_filter
   48048 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48049 $at_diff expout "$at_stdout" || at_failed=:
   48050 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48051 $at_failed && at_fn_log_failure
   48052 $at_traceon; }
   48053 
   48054   rm -rf xml-tests expout
   48055   at_restore_special_files
   48056 fi
   48057 { set +x
   48058 $as_echo "$at_srcdir/actions.at:1531: bison -o input.cc input.y"
   48059 at_fn_check_prepare_trace "actions.at:1531"
   48060 ( $at_check_trace; bison -o input.cc input.y
   48061 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48062 at_status=$? at_failed=false
   48063 $at_check_filter
   48064 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48065 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48066 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48067 $at_failed && at_fn_log_failure
   48068 $at_traceon; }
   48069 
   48070 
   48071 
   48072 { set +x
   48073 $as_echo "$at_srcdir/actions.at:1531: \$BISON_CXX_WORKS"
   48074 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1531"
   48075 ( $at_check_trace; $BISON_CXX_WORKS
   48076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48077 at_status=$? at_failed=false
   48078 $at_check_filter
   48079 echo stderr:; cat "$at_stderr"
   48080 echo stdout:; cat "$at_stdout"
   48081 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48082 $at_failed && at_fn_log_failure
   48083 $at_traceon; }
   48084 
   48085 { set +x
   48086 $as_echo "$at_srcdir/actions.at:1531: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   48087 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1531"
   48088 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   48089 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48090 at_status=$? at_failed=false
   48091 $at_check_filter
   48092 echo stderr:; cat "$at_stderr"
   48093 echo stdout:; cat "$at_stdout"
   48094 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48095 $at_failed && at_fn_log_failure
   48096 $at_traceon; }
   48097 
   48098 
   48099 { set +x
   48100 $as_echo "$at_srcdir/actions.at:1531:  \$PREPARSER ./input"
   48101 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1531"
   48102 ( $at_check_trace;  $PREPARSER ./input
   48103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48104 at_status=$? at_failed=false
   48105 $at_check_filter
   48106 echo stderr:; tee stderr <"$at_stderr"
   48107 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48108 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48109 $at_failed && at_fn_log_failure
   48110 $at_traceon; }
   48111 
   48112 { set +x
   48113 $as_echo "$at_srcdir/actions.at:1531: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   48114 at_fn_check_prepare_trace "actions.at:1531"
   48115 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   48116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48117 at_status=$? at_failed=false
   48118 $at_check_filter
   48119 echo stderr:; tee stderr <"$at_stderr"
   48120 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48121 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48122 $at_failed && at_fn_log_failure
   48123 $at_traceon; }
   48124 
   48125 
   48126 # Don't be too picky on the traces, GLR is not exactly the same.  Keep
   48127 # only the lines from the printer.
   48128 #
   48129 # Don't care about locations.  FIXME: remove their removal when Bison
   48130 # supports C++ without locations.
   48131 { set +x
   48132 $as_echo "$at_srcdir/actions.at:1531: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr"
   48133 at_fn_check_prepare_trace "actions.at:1531"
   48134 ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr
   48135 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48136 at_status=$? at_failed=false
   48137 $at_check_filter
   48138 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48139 echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
   48140 Shifting token UNTYPED (ival: 10, fval: 0.1)
   48141 Reading a token: Next token is token INT (ival: 20, fval: 0.2)
   48142 Shifting token INT (ival: 20, fval: 0.2)
   48143    \$1 = token UNTYPED (ival: 10, fval: 0.1)
   48144    \$2 = token INT (ival: 20, fval: 0.2)
   48145 -> \$\$ = nterm float (ival: 30, fval: 0.3)
   48146 Cleanup: popping nterm float (ival: 30, fval: 0.3)
   48147 " | \
   48148   $at_diff - "$at_stdout" || at_failed=:
   48149 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531"
   48150 $at_failed && at_fn_log_failure
   48151 $at_traceon; }
   48152 
   48153 
   48154 
   48155 
   48156   set +x
   48157   $at_times_p && times >"$at_times_file"
   48158 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   48159 read at_status <"$at_status_file"
   48160 #AT_STOP_176
   48161 #AT_START_177
   48162 at_fn_group_banner 177 'actions.at:1532' \
   48163   "Qualified \$\$ in actions: glr.cc" "                " 9
   48164 at_xfail=no
   48165 (
   48166   $as_echo "177. $at_setup_line: testing $at_desc ..."
   48167   $at_traceon
   48168 
   48169 
   48170 
   48171 
   48172 cat >input.y <<'_ATEOF'
   48173 %code top {
   48174 #include <config.h>
   48175 /* We don't need perfect functions for these tests. */
   48176 #undef malloc
   48177 #undef memcmp
   48178 #undef realloc
   48179 }
   48180 
   48181 %skeleton "glr.cc"
   48182 %defines   // FIXME: Mandated by lalr1.cc in Bison 2.6.
   48183 %locations // FIXME: Mandated by lalr1.cc in Bison 2.6.
   48184 %debug
   48185 %code requires
   48186 {
   48187   typedef struct sem_type
   48188   {
   48189     int ival;
   48190     float fval;
   48191   } sem_type;
   48192 
   48193 # define YYSTYPE sem_type
   48194 
   48195 
   48196 # include <iostream>
   48197   static void
   48198   report (std::ostream& yyo, int ival, float fval)
   48199   {
   48200     yyo << "ival: " << ival << ", fval: " <<  fval;
   48201   }
   48202 
   48203 }
   48204 
   48205 %code
   48206 {
   48207 
   48208   static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   48209 }
   48210 
   48211 %token UNTYPED
   48212 %token <ival> INT
   48213 %type <fval> float
   48214 %printer { report (yyo, $$,       $<fval>$); } <ival>;
   48215 %printer { report (yyo, $<ival>$, $$      ); } <fval>;
   48216 %printer { report (yyo, $<ival>$, $<fval>$); } <>;
   48217 
   48218 %initial-action
   48219 {
   48220   $<ival>$ = 42;
   48221   $<fval>$ = 4.2;
   48222 }
   48223 
   48224 %%
   48225 float: UNTYPED INT
   48226 {
   48227   $$       = $<fval>1 + $<fval>2;
   48228   $<ival>$ = $<ival>1 + $2;
   48229 };
   48230 %%
   48231 /* A C++ error reporting function.  */
   48232 void
   48233 yy::parser::error (const location_type& l, const std::string& m)
   48234 {
   48235   (void) l;
   48236   std::cerr << l << ": " << m << std::endl;
   48237 }
   48238 #include <assert.h>
   48239 static
   48240 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   48241 {
   48242   static int const input[] = {yy::parser::token::UNTYPED,
   48243                                  yy::parser::token::INT,
   48244                                   EOF};
   48245   static size_t toknum = 0;
   48246   int res;
   48247   (void) lvalp;(void) llocp;
   48248   assert (toknum < sizeof input / sizeof input[0]);
   48249   res = input[toknum++];
   48250   (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;;
   48251   (*llocp).begin.line = (*llocp).end.line = 1;
   48252   (*llocp).begin.column = (*llocp).end.column = toknum;
   48253   return res;
   48254 }
   48255 int
   48256 main (void)
   48257 {
   48258   yy::parser p;
   48259   p.set_debug_level(1);
   48260   return p.parse ();
   48261 }
   48262 _ATEOF
   48263 
   48264 
   48265 
   48266 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   48267   at_save_special_files
   48268   mkdir xml-tests
   48269     # Don't combine these Bison invocations since we want to be sure that
   48270   # --report=all isn't required to get the full XML file.
   48271   { set +x
   48272 $as_echo "$at_srcdir/actions.at:1532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   48273                   --graph=xml-tests/test.dot -o input.cc input.y"
   48274 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1532"
   48275 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   48276                   --graph=xml-tests/test.dot -o input.cc input.y
   48277 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48278 at_status=$? at_failed=false
   48279 $at_check_filter
   48280 echo stderr:; cat "$at_stderr"
   48281 echo stdout:; cat "$at_stdout"
   48282 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48283 $at_failed && at_fn_log_failure
   48284 $at_traceon; }
   48285 
   48286   { set +x
   48287 $as_echo "$at_srcdir/actions.at:1532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   48288 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1532"
   48289 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   48290 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48291 at_status=$? at_failed=false
   48292 $at_check_filter
   48293 echo stderr:; cat "$at_stderr"
   48294 echo stdout:; cat "$at_stdout"
   48295 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48296 $at_failed && at_fn_log_failure
   48297 $at_traceon; }
   48298 
   48299     cp xml-tests/test.output expout
   48300   { set +x
   48301 $as_echo "$at_srcdir/actions.at:1532: \$XSLTPROC \\
   48302              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   48303              xml-tests/test.xml"
   48304 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1532"
   48305 ( $at_check_trace; $XSLTPROC \
   48306              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   48307              xml-tests/test.xml
   48308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48309 at_status=$? at_failed=false
   48310 $at_check_filter
   48311 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48312 $at_diff expout "$at_stdout" || at_failed=:
   48313 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48314 $at_failed && at_fn_log_failure
   48315 $at_traceon; }
   48316 
   48317   sort xml-tests/test.dot > expout
   48318   { set +x
   48319 $as_echo "$at_srcdir/actions.at:1532: \$XSLTPROC \\
   48320              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   48321              xml-tests/test.xml | sort"
   48322 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1532"
   48323 ( $at_check_trace; $XSLTPROC \
   48324              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   48325              xml-tests/test.xml | sort
   48326 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48327 at_status=$? at_failed=false
   48328 $at_check_filter
   48329 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48330 $at_diff expout "$at_stdout" || at_failed=:
   48331 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48332 $at_failed && at_fn_log_failure
   48333 $at_traceon; }
   48334 
   48335   rm -rf xml-tests expout
   48336   at_restore_special_files
   48337 fi
   48338 { set +x
   48339 $as_echo "$at_srcdir/actions.at:1532: bison -o input.cc input.y"
   48340 at_fn_check_prepare_trace "actions.at:1532"
   48341 ( $at_check_trace; bison -o input.cc input.y
   48342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48343 at_status=$? at_failed=false
   48344 $at_check_filter
   48345 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48346 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48347 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48348 $at_failed && at_fn_log_failure
   48349 $at_traceon; }
   48350 
   48351 
   48352 
   48353 { set +x
   48354 $as_echo "$at_srcdir/actions.at:1532: \$BISON_CXX_WORKS"
   48355 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1532"
   48356 ( $at_check_trace; $BISON_CXX_WORKS
   48357 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48358 at_status=$? at_failed=false
   48359 $at_check_filter
   48360 echo stderr:; cat "$at_stderr"
   48361 echo stdout:; cat "$at_stdout"
   48362 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48363 $at_failed && at_fn_log_failure
   48364 $at_traceon; }
   48365 
   48366 { set +x
   48367 $as_echo "$at_srcdir/actions.at:1532: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   48368 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1532"
   48369 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   48370 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48371 at_status=$? at_failed=false
   48372 $at_check_filter
   48373 echo stderr:; cat "$at_stderr"
   48374 echo stdout:; cat "$at_stdout"
   48375 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48376 $at_failed && at_fn_log_failure
   48377 $at_traceon; }
   48378 
   48379 
   48380 { set +x
   48381 $as_echo "$at_srcdir/actions.at:1532:  \$PREPARSER ./input"
   48382 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1532"
   48383 ( $at_check_trace;  $PREPARSER ./input
   48384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48385 at_status=$? at_failed=false
   48386 $at_check_filter
   48387 echo stderr:; tee stderr <"$at_stderr"
   48388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48389 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48390 $at_failed && at_fn_log_failure
   48391 $at_traceon; }
   48392 
   48393 { set +x
   48394 $as_echo "$at_srcdir/actions.at:1532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   48395 at_fn_check_prepare_trace "actions.at:1532"
   48396 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   48397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48398 at_status=$? at_failed=false
   48399 $at_check_filter
   48400 echo stderr:; tee stderr <"$at_stderr"
   48401 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48402 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48403 $at_failed && at_fn_log_failure
   48404 $at_traceon; }
   48405 
   48406 
   48407 # Don't be too picky on the traces, GLR is not exactly the same.  Keep
   48408 # only the lines from the printer.
   48409 #
   48410 # Don't care about locations.  FIXME: remove their removal when Bison
   48411 # supports C++ without locations.
   48412 { set +x
   48413 $as_echo "$at_srcdir/actions.at:1532: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr"
   48414 at_fn_check_prepare_trace "actions.at:1532"
   48415 ( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr
   48416 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48417 at_status=$? at_failed=false
   48418 $at_check_filter
   48419 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48420 echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
   48421 Shifting token UNTYPED (ival: 10, fval: 0.1)
   48422 Reading a token: Next token is token INT (ival: 20, fval: 0.2)
   48423 Shifting token INT (ival: 20, fval: 0.2)
   48424    \$1 = token UNTYPED (ival: 10, fval: 0.1)
   48425    \$2 = token INT (ival: 20, fval: 0.2)
   48426 -> \$\$ = nterm float (ival: 30, fval: 0.3)
   48427 Cleanup: popping nterm float (ival: 30, fval: 0.3)
   48428 " | \
   48429   $at_diff - "$at_stdout" || at_failed=:
   48430 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532"
   48431 $at_failed && at_fn_log_failure
   48432 $at_traceon; }
   48433 
   48434 
   48435 
   48436 
   48437   set +x
   48438   $at_times_p && times >"$at_times_file"
   48439 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   48440 read at_status <"$at_status_file"
   48441 #AT_STOP_177
   48442 #AT_START_178
   48443 at_fn_group_banner 178 'actions.at:1540' \
   48444   "Fix user actions without a trailing semicolon" "  " 9
   48445 at_xfail=no
   48446 (
   48447   $as_echo "178. $at_setup_line: testing $at_desc ..."
   48448   $at_traceon
   48449 
   48450 
   48451 # This feature is undocumented, but we accidentally broke it in 2.3a,
   48452 # and there was a complaint at:
   48453 # <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
   48454 
   48455 cat >input.y <<'_ATEOF'
   48456 %%
   48457 start: test2 test1 test0 testc;
   48458 
   48459 test2
   48460 : 'a' { semi;			/* TEST:N:2 */ }
   48461 | 'b' { if (0) {no_semi}	/* TEST:N:2 */ }
   48462 | 'c' { if (0) {semi;}		/* TEST:N:2 */ }
   48463 | 'd' { semi;   no_semi		/* TEST:Y:2 */ }
   48464 | 'e' { semi(); no_semi()	/* TEST:Y:2 */ }
   48465 | 'f' { semi[]; no_semi[]	/* TEST:Y:2 */ }
   48466 | 'g' { semi++; no_semi++	/* TEST:Y:2 */ }
   48467 | 'h' { {no_semi} no_semi	/* TEST:Y:2 */ }
   48468 | 'i' { {semi;}   no_semi	/* TEST:Y:2 */ }
   48469 ;
   48470 test1
   48471   : 'a' { semi;			// TEST:N:1 ;
   48472 } | 'b' { if (0) {no_semi}	// TEST:N:1 ;
   48473 } | 'c' { if (0) {semi;}	// TEST:N:1 ;
   48474 } | 'd' { semi;   no_semi	// TEST:Y:1 ;
   48475 } | 'e' { semi(); no_semi()	// TEST:Y:1 ;
   48476 } | 'f' { semi[]; no_semi[]	// TEST:Y:1 ;
   48477 } | 'g' { semi++; no_semi++	// TEST:Y:1 ;
   48478 } | 'h' { {no_semi} no_semi	// TEST:Y:1 ;
   48479 } | 'i' { {semi;}   no_semi	// TEST:Y:1 ;
   48480 } ;
   48481 test0
   48482   : 'a' { semi;			// TEST:N:1 {}
   48483 } | 'b' { if (0) {no_semi}	// TEST:N:1 {}
   48484 } | 'c' { if (0) {semi;}	// TEST:N:1 {}
   48485 } | 'd' { semi;   no_semi	// TEST:Y:1 {}
   48486 } | 'e' { semi(); no_semi()	// TEST:Y:1 {}
   48487 } | 'f' { semi[]; no_semi[]	// TEST:Y:1 {}
   48488 } | 'g' { semi++; no_semi++	// TEST:Y:1 {}
   48489 } | 'h' { {no_semi} no_semi	// TEST:Y:1 {}
   48490 } | 'i' { {semi;}   no_semi	// TEST:Y:1 {}
   48491 } ;
   48492 
   48493 testc
   48494 : 'a' {
   48495 #define TEST_MACRO_N \
   48496 []"broken\" $ @ $$ @$ [];\
   48497 string;"}
   48498 | 'b' {
   48499 no_semi
   48500 #define TEST_MACRO_N \
   48501 []"broken\" $ @ $$ @$ [];\
   48502 string;"}
   48503 _ATEOF
   48504 
   48505 
   48506 
   48507 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   48508   at_save_special_files
   48509   mkdir xml-tests
   48510     # Don't combine these Bison invocations since we want to be sure that
   48511   # --report=all isn't required to get the full XML file.
   48512   { set +x
   48513 $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   48514                   --graph=xml-tests/test.dot -o input.c input.y"
   48515 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1597"
   48516 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   48517                   --graph=xml-tests/test.dot -o input.c input.y
   48518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48519 at_status=$? at_failed=false
   48520 $at_check_filter
   48521 echo stderr:; cat "$at_stderr"
   48522 echo stdout:; cat "$at_stdout"
   48523 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48524 $at_failed && at_fn_log_failure
   48525 $at_traceon; }
   48526 
   48527   { set +x
   48528 $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   48529 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1597"
   48530 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   48531 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48532 at_status=$? at_failed=false
   48533 $at_check_filter
   48534 echo stderr:; cat "$at_stderr"
   48535 echo stdout:; cat "$at_stdout"
   48536 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48537 $at_failed && at_fn_log_failure
   48538 $at_traceon; }
   48539 
   48540     cp xml-tests/test.output expout
   48541   { set +x
   48542 $as_echo "$at_srcdir/actions.at:1597: \$XSLTPROC \\
   48543              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   48544              xml-tests/test.xml"
   48545 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1597"
   48546 ( $at_check_trace; $XSLTPROC \
   48547              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   48548              xml-tests/test.xml
   48549 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48550 at_status=$? at_failed=false
   48551 $at_check_filter
   48552 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48553 $at_diff expout "$at_stdout" || at_failed=:
   48554 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48555 $at_failed && at_fn_log_failure
   48556 $at_traceon; }
   48557 
   48558   sort xml-tests/test.dot > expout
   48559   { set +x
   48560 $as_echo "$at_srcdir/actions.at:1597: \$XSLTPROC \\
   48561              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   48562              xml-tests/test.xml | sort"
   48563 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1597"
   48564 ( $at_check_trace; $XSLTPROC \
   48565              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   48566              xml-tests/test.xml | sort
   48567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48568 at_status=$? at_failed=false
   48569 $at_check_filter
   48570 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48571 $at_diff expout "$at_stdout" || at_failed=:
   48572 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48573 $at_failed && at_fn_log_failure
   48574 $at_traceon; }
   48575 
   48576   rm -rf xml-tests expout
   48577   at_restore_special_files
   48578 fi
   48579 { set +x
   48580 $as_echo "$at_srcdir/actions.at:1597: bison -o input.c input.y"
   48581 at_fn_check_prepare_trace "actions.at:1597"
   48582 ( $at_check_trace; bison -o input.c input.y
   48583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48584 at_status=$? at_failed=false
   48585 $at_check_filter
   48586 echo >>"$at_stderr"; $as_echo "input.y:8.48: warning: a ';' might be needed at the end of action code
   48587 input.y:8.48:     future versions of Bison will not add the ';'
   48588 input.y:9.48: warning: a ';' might be needed at the end of action code
   48589 input.y:9.48:     future versions of Bison will not add the ';'
   48590 input.y:10.48: warning: a ';' might be needed at the end of action code
   48591 input.y:10.48:     future versions of Bison will not add the ';'
   48592 input.y:11.48: warning: a ';' might be needed at the end of action code
   48593 input.y:11.48:     future versions of Bison will not add the ';'
   48594 input.y:12.48: warning: a ';' might be needed at the end of action code
   48595 input.y:12.48:     future versions of Bison will not add the ';'
   48596 input.y:13.48: warning: a ';' might be needed at the end of action code
   48597 input.y:13.48:     future versions of Bison will not add the ';'
   48598 input.y:20.1: warning: a ';' might be needed at the end of action code
   48599 input.y:20.1:     future versions of Bison will not add the ';'
   48600 input.y:21.1: warning: a ';' might be needed at the end of action code
   48601 input.y:21.1:     future versions of Bison will not add the ';'
   48602 input.y:22.1: warning: a ';' might be needed at the end of action code
   48603 input.y:22.1:     future versions of Bison will not add the ';'
   48604 input.y:23.1: warning: a ';' might be needed at the end of action code
   48605 input.y:23.1:     future versions of Bison will not add the ';'
   48606 input.y:24.1: warning: a ';' might be needed at the end of action code
   48607 input.y:24.1:     future versions of Bison will not add the ';'
   48608 input.y:25.1: warning: a ';' might be needed at the end of action code
   48609 input.y:25.1:     future versions of Bison will not add the ';'
   48610 input.y:31.1: warning: a ';' might be needed at the end of action code
   48611 input.y:31.1:     future versions of Bison will not add the ';'
   48612 input.y:32.1: warning: a ';' might be needed at the end of action code
   48613 input.y:32.1:     future versions of Bison will not add the ';'
   48614 input.y:33.1: warning: a ';' might be needed at the end of action code
   48615 input.y:33.1:     future versions of Bison will not add the ';'
   48616 input.y:34.1: warning: a ';' might be needed at the end of action code
   48617 input.y:34.1:     future versions of Bison will not add the ';'
   48618 input.y:35.1: warning: a ';' might be needed at the end of action code
   48619 input.y:35.1:     future versions of Bison will not add the ';'
   48620 input.y:36.1: warning: a ';' might be needed at the end of action code
   48621 input.y:36.1:     future versions of Bison will not add the ';'
   48622 " | \
   48623   $at_diff - "$at_stderr" || at_failed=:
   48624 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48625 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48626 $at_failed && at_fn_log_failure
   48627 $at_traceon; }
   48628 
   48629 # Defining POSIXLY_CORRECT causes bison to complain if options are
   48630 # added after the grammar file name, so skip these checks in that
   48631 # case.
   48632 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   48633   at_save_special_files
   48634 
   48635   # To avoid expanding it repeatedly, store specified stdout.
   48636   : >expout
   48637 
   48638   # Run with -Werror.
   48639   { set +x
   48640 $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror"
   48641 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "actions.at:1597"
   48642 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror
   48643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48644 at_status=$? at_failed=false
   48645 $at_check_filter
   48646 echo stderr:; tee stderr <"$at_stderr"
   48647 $at_diff expout "$at_stdout" || at_failed=:
   48648 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1597"
   48649 $at_failed && at_fn_log_failure
   48650 $at_traceon; }
   48651 
   48652 
   48653   # Build expected stderr up to and including the "warnings being
   48654   # treated as errors" message.
   48655   cat >at-bison-check-warnings <<'_ATEOF'
   48656 input.y:8.48: warning: a ';' might be needed at the end of action code
   48657 input.y:8.48:     future versions of Bison will not add the ';'
   48658 input.y:9.48: warning: a ';' might be needed at the end of action code
   48659 input.y:9.48:     future versions of Bison will not add the ';'
   48660 input.y:10.48: warning: a ';' might be needed at the end of action code
   48661 input.y:10.48:     future versions of Bison will not add the ';'
   48662 input.y:11.48: warning: a ';' might be needed at the end of action code
   48663 input.y:11.48:     future versions of Bison will not add the ';'
   48664 input.y:12.48: warning: a ';' might be needed at the end of action code
   48665 input.y:12.48:     future versions of Bison will not add the ';'
   48666 input.y:13.48: warning: a ';' might be needed at the end of action code
   48667 input.y:13.48:     future versions of Bison will not add the ';'
   48668 input.y:20.1: warning: a ';' might be needed at the end of action code
   48669 input.y:20.1:     future versions of Bison will not add the ';'
   48670 input.y:21.1: warning: a ';' might be needed at the end of action code
   48671 input.y:21.1:     future versions of Bison will not add the ';'
   48672 input.y:22.1: warning: a ';' might be needed at the end of action code
   48673 input.y:22.1:     future versions of Bison will not add the ';'
   48674 input.y:23.1: warning: a ';' might be needed at the end of action code
   48675 input.y:23.1:     future versions of Bison will not add the ';'
   48676 input.y:24.1: warning: a ';' might be needed at the end of action code
   48677 input.y:24.1:     future versions of Bison will not add the ';'
   48678 input.y:25.1: warning: a ';' might be needed at the end of action code
   48679 input.y:25.1:     future versions of Bison will not add the ';'
   48680 input.y:31.1: warning: a ';' might be needed at the end of action code
   48681 input.y:31.1:     future versions of Bison will not add the ';'
   48682 input.y:32.1: warning: a ';' might be needed at the end of action code
   48683 input.y:32.1:     future versions of Bison will not add the ';'
   48684 input.y:33.1: warning: a ';' might be needed at the end of action code
   48685 input.y:33.1:     future versions of Bison will not add the ';'
   48686 input.y:34.1: warning: a ';' might be needed at the end of action code
   48687 input.y:34.1:     future versions of Bison will not add the ';'
   48688 input.y:35.1: warning: a ';' might be needed at the end of action code
   48689 input.y:35.1:     future versions of Bison will not add the ';'
   48690 input.y:36.1: warning: a ';' might be needed at the end of action code
   48691 input.y:36.1:     future versions of Bison will not add the ';'
   48692 _ATEOF
   48693 
   48694   at_bison_check_first=`sed -n \
   48695     '/: warning: /{=;q;}' at-bison-check-warnings`
   48696   : ${at_bison_check_first:=1}
   48697   at_bison_check_first_tmp=`sed -n \
   48698     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   48699   : ${at_bison_check_first_tmp:=1}
   48700   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   48701     at_bison_check_first=$at_bison_check_first_tmp
   48702   fi
   48703   if test $at_bison_check_first -gt 1; then
   48704     sed -n "1,`expr $at_bison_check_first - 1`"p \
   48705       at-bison-check-warnings > experr
   48706   fi
   48707   echo 'bison: warnings being treated as errors' >> experr
   48708 
   48709   # Finish building expected stderr and check.  Unlike warnings,
   48710   # complaints cause bison to exit early.  Thus, with -Werror, bison
   48711   # does not necessarily report all warnings that it does without
   48712   # -Werror, but it at least reports one.
   48713   at_bison_check_last=`sed -n '$=' stderr`
   48714   : ${at_bison_check_last:=1}
   48715   at_bison_check_last=`expr $at_bison_check_last - 1`
   48716   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   48717     at-bison-check-warnings >> experr
   48718   { set +x
   48719 $as_echo "$at_srcdir/actions.at:1597: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   48720               stderr 1>&2"
   48721 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1597"
   48722 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   48723               stderr 1>&2
   48724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48725 at_status=$? at_failed=false
   48726 $at_check_filter
   48727 $at_diff experr "$at_stderr" || at_failed=:
   48728 at_fn_diff_devnull "$at_stdout" || at_failed=:
   48729 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48730 $at_failed && at_fn_log_failure
   48731 $at_traceon; }
   48732 
   48733 
   48734   # Now check --warnings=error.
   48735   cp stderr experr
   48736   { set +x
   48737 $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error"
   48738 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "actions.at:1597"
   48739 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error
   48740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48741 at_status=$? at_failed=false
   48742 $at_check_filter
   48743 $at_diff experr "$at_stderr" || at_failed=:
   48744 $at_diff expout "$at_stdout" || at_failed=:
   48745 at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1597"
   48746 $at_failed && at_fn_log_failure
   48747 $at_traceon; }
   48748 
   48749 
   48750   # Now check -Wnone and --warnings=none by making sure that
   48751   # -Werror doesn't change the exit status when -Wnone or
   48752   # --warnings=none is specified.
   48753   { set +x
   48754 $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror"
   48755 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "actions.at:1597"
   48756 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror
   48757 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48758 at_status=$? at_failed=false
   48759 $at_check_filter
   48760 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48761 $at_diff expout "$at_stdout" || at_failed=:
   48762 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48763 $at_failed && at_fn_log_failure
   48764 $at_traceon; }
   48765 
   48766   { set +x
   48767 $as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror"
   48768 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "actions.at:1597"
   48769 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror
   48770 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48771 at_status=$? at_failed=false
   48772 $at_check_filter
   48773 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48774 $at_diff expout "$at_stdout" || at_failed=:
   48775 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1597"
   48776 $at_failed && at_fn_log_failure
   48777 $at_traceon; }
   48778 
   48779 
   48780   at_restore_special_files
   48781 fi
   48782 
   48783 { set +x
   48784 $as_echo "$at_srcdir/actions.at:1636: \$PERL -0777 -ne '
   48785 my \$count = 0;
   48786 s{/\\* TEST:N:2 \\*/ \\}\$}{ ++\$count; \"\" }gem;
   48787 printf \"\$count\\n\";' input.c"
   48788 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1636"
   48789 ( $at_check_trace; $PERL -0777 -ne '
   48790 my $count = 0;
   48791 s{/\* TEST:N:2 \*/ \}$}{ ++$count; "" }gem;
   48792 printf "$count\n";' input.c
   48793 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48794 at_status=$? at_failed=false
   48795 $at_check_filter
   48796 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48797 echo >>"$at_stdout"; $as_echo "3
   48798 " | \
   48799   $at_diff - "$at_stdout" || at_failed=:
   48800 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1636"
   48801 $at_failed && at_fn_log_failure
   48802 $at_traceon; }
   48803 
   48804 { set +x
   48805 $as_echo "$at_srcdir/actions.at:1637: \$PERL -0777 -ne '
   48806 my \$count = 0;
   48807 s{/\\* TEST:Y:2 \\*/ ;\\}\$}{ ++\$count; \"\" }gem;
   48808 printf \"\$count\\n\";' input.c"
   48809 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1637"
   48810 ( $at_check_trace; $PERL -0777 -ne '
   48811 my $count = 0;
   48812 s{/\* TEST:Y:2 \*/ ;\}$}{ ++$count; "" }gem;
   48813 printf "$count\n";' input.c
   48814 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48815 at_status=$? at_failed=false
   48816 $at_check_filter
   48817 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48818 echo >>"$at_stdout"; $as_echo "6
   48819 " | \
   48820   $at_diff - "$at_stdout" || at_failed=:
   48821 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1637"
   48822 $at_failed && at_fn_log_failure
   48823 $at_traceon; }
   48824 
   48825 { set +x
   48826 $as_echo "$at_srcdir/actions.at:1638: \$PERL -0777 -ne '
   48827 my \$count = 0;
   48828 s{// TEST:N:1 [;{}]*\\n\\}\$}{ ++\$count; \"\" }gem;
   48829 printf \"\$count\\n\";' input.c"
   48830 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1638"
   48831 ( $at_check_trace; $PERL -0777 -ne '
   48832 my $count = 0;
   48833 s{// TEST:N:1 [;{}]*\n\}$}{ ++$count; "" }gem;
   48834 printf "$count\n";' input.c
   48835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48836 at_status=$? at_failed=false
   48837 $at_check_filter
   48838 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48839 echo >>"$at_stdout"; $as_echo "6
   48840 " | \
   48841   $at_diff - "$at_stdout" || at_failed=:
   48842 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1638"
   48843 $at_failed && at_fn_log_failure
   48844 $at_traceon; }
   48845 
   48846 { set +x
   48847 $as_echo "$at_srcdir/actions.at:1639: \$PERL -0777 -ne '
   48848 my \$count = 0;
   48849 s{// TEST:Y:1 [;{}]*\\n;\\}\$}{ ++\$count; \"\" }gem;
   48850 printf \"\$count\\n\";' input.c"
   48851 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1639"
   48852 ( $at_check_trace; $PERL -0777 -ne '
   48853 my $count = 0;
   48854 s{// TEST:Y:1 [;{}]*\n;\}$}{ ++$count; "" }gem;
   48855 printf "$count\n";' input.c
   48856 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48857 at_status=$? at_failed=false
   48858 $at_check_filter
   48859 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48860 echo >>"$at_stdout"; $as_echo "12
   48861 " | \
   48862   $at_diff - "$at_stdout" || at_failed=:
   48863 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1639"
   48864 $at_failed && at_fn_log_failure
   48865 $at_traceon; }
   48866 
   48867 { set +x
   48868 $as_echo "$at_srcdir/actions.at:1640: \$PERL -0777 -ne '
   48869 my \$count = 0;
   48870 s{#define TEST_MACRO_N \\\\\\n\\[\\]\"broken\\\\\" \\\$ \\@ \\\$\\\$ \\@\\\$ \\[\\];\\\\\\nstring;\"\\}}{ ++\$count; \"\" }gem;
   48871 printf \"\$count\\n\";' input.c"
   48872 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1640"
   48873 ( $at_check_trace; $PERL -0777 -ne '
   48874 my $count = 0;
   48875 s{#define TEST_MACRO_N \\\n\[\]"broken\\" \$ \@ \$\$ \@\$ \[\];\\\nstring;"\}}{ ++$count; "" }gem;
   48876 printf "$count\n";' input.c
   48877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48878 at_status=$? at_failed=false
   48879 $at_check_filter
   48880 at_fn_diff_devnull "$at_stderr" || at_failed=:
   48881 echo >>"$at_stdout"; $as_echo "2
   48882 " | \
   48883   $at_diff - "$at_stdout" || at_failed=:
   48884 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1640"
   48885 $at_failed && at_fn_log_failure
   48886 $at_traceon; }
   48887 
   48888 
   48889   set +x
   48890   $at_times_p && times >"$at_times_file"
   48891 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   48892 read at_status <"$at_status_file"
   48893 #AT_STOP_178
   48894 #AT_START_179
   48895 at_fn_group_banner 179 'actions.at:1649' \
   48896   "Destroying lookahead assigned by semantic action" "" 9
   48897 at_xfail=no
   48898 (
   48899   $as_echo "179. $at_setup_line: testing $at_desc ..."
   48900   $at_traceon
   48901 
   48902 
   48903 
   48904 cat >input.y <<'_ATEOF'
   48905 %code top {
   48906 #include <config.h>
   48907 /* We don't need perfect functions for these tests. */
   48908 #undef malloc
   48909 #undef memcmp
   48910 #undef realloc
   48911 }
   48912 
   48913 
   48914 %code {
   48915   #include <assert.h>
   48916   #include <stdio.h>
   48917 static void yyerror ( const char *msg);
   48918 static int yylex (void);
   48919   #define USE(Var)
   48920 }
   48921 
   48922 %destructor { fprintf (stderr, "'a' destructor\n"); } 'a'
   48923 %destructor { fprintf (stderr, "'b' destructor\n"); } 'b'
   48924 
   48925 %%
   48926 
   48927 // In a previous version of Bison, yychar assigned by the semantic
   48928 // action below was not translated into yytoken before the lookahead was
   48929 // discarded and thus before its destructor (selected according to
   48930 // yytoken) was called in order to return from yyparse.  This would
   48931 // happen even if YYACCEPT was performed in a later semantic action as
   48932 // long as only consistent states with default reductions were visited
   48933 // in between.  However, we leave YYACCEPT in the same semantic action
   48934 // for this test in order to show that skeletons cannot simply translate
   48935 // immediately after every semantic action because a semantic action
   48936 // that has set yychar might not always return normally.  Instead,
   48937 // skeletons must translate before every use of yytoken.
   48938 start: 'a' accept { USE($1); } ;
   48939 accept: /*empty*/ {
   48940   assert (yychar == YYEMPTY);
   48941   yychar = 'b';
   48942   YYACCEPT;
   48943 } ;
   48944 
   48945 %%
   48946 #include <stdio.h>
   48947 /* A C error reporting function.  */
   48948 static
   48949 void yyerror ( const char *msg)
   48950 {
   48951   fprintf (stderr, "%s\n", msg);
   48952 }
   48953 #include <assert.h>
   48954 static
   48955 int yylex (void)
   48956 {
   48957   static char const input[] = "a";
   48958   static size_t toknum = 0;
   48959   int res;
   48960   ;
   48961   assert (toknum < sizeof input / sizeof input[0]);
   48962   res = input[toknum++];
   48963   ;
   48964   return res;
   48965 }
   48966 int
   48967 main (void)
   48968 {
   48969   return yyparse ();
   48970 }
   48971 _ATEOF
   48972 
   48973 
   48974 
   48975 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   48976   at_save_special_files
   48977   mkdir xml-tests
   48978     # Don't combine these Bison invocations since we want to be sure that
   48979   # --report=all isn't required to get the full XML file.
   48980   { set +x
   48981 $as_echo "$at_srcdir/actions.at:1695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   48982                   --graph=xml-tests/test.dot -o input.c input.y"
   48983 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1695"
   48984 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   48985                   --graph=xml-tests/test.dot -o input.c input.y
   48986 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   48987 at_status=$? at_failed=false
   48988 $at_check_filter
   48989 echo stderr:; cat "$at_stderr"
   48990 echo stdout:; cat "$at_stdout"
   48991 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695"
   48992 $at_failed && at_fn_log_failure
   48993 $at_traceon; }
   48994 
   48995   { set +x
   48996 $as_echo "$at_srcdir/actions.at:1695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   48997 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1695"
   48998 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   48999 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49000 at_status=$? at_failed=false
   49001 $at_check_filter
   49002 echo stderr:; cat "$at_stderr"
   49003 echo stdout:; cat "$at_stdout"
   49004 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695"
   49005 $at_failed && at_fn_log_failure
   49006 $at_traceon; }
   49007 
   49008     cp xml-tests/test.output expout
   49009   { set +x
   49010 $as_echo "$at_srcdir/actions.at:1695: \$XSLTPROC \\
   49011              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   49012              xml-tests/test.xml"
   49013 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1695"
   49014 ( $at_check_trace; $XSLTPROC \
   49015              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   49016              xml-tests/test.xml
   49017 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49018 at_status=$? at_failed=false
   49019 $at_check_filter
   49020 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49021 $at_diff expout "$at_stdout" || at_failed=:
   49022 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695"
   49023 $at_failed && at_fn_log_failure
   49024 $at_traceon; }
   49025 
   49026   sort xml-tests/test.dot > expout
   49027   { set +x
   49028 $as_echo "$at_srcdir/actions.at:1695: \$XSLTPROC \\
   49029              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   49030              xml-tests/test.xml | sort"
   49031 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1695"
   49032 ( $at_check_trace; $XSLTPROC \
   49033              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   49034              xml-tests/test.xml | sort
   49035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49036 at_status=$? at_failed=false
   49037 $at_check_filter
   49038 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49039 $at_diff expout "$at_stdout" || at_failed=:
   49040 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695"
   49041 $at_failed && at_fn_log_failure
   49042 $at_traceon; }
   49043 
   49044   rm -rf xml-tests expout
   49045   at_restore_special_files
   49046 fi
   49047 { set +x
   49048 $as_echo "$at_srcdir/actions.at:1695: bison -o input.c input.y"
   49049 at_fn_check_prepare_trace "actions.at:1695"
   49050 ( $at_check_trace; bison -o input.c input.y
   49051 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49052 at_status=$? at_failed=false
   49053 $at_check_filter
   49054 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49055 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49056 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1695"
   49057 $at_failed && at_fn_log_failure
   49058 $at_traceon; }
   49059 
   49060 
   49061 { set +x
   49062 $as_echo "$at_srcdir/actions.at:1696: \$BISON_C_WORKS"
   49063 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1696"
   49064 ( $at_check_trace; $BISON_C_WORKS
   49065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49066 at_status=$? at_failed=false
   49067 $at_check_filter
   49068 echo stderr:; cat "$at_stderr"
   49069 echo stdout:; cat "$at_stdout"
   49070 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1696"
   49071 $at_failed && at_fn_log_failure
   49072 $at_traceon; }
   49073 
   49074 { set +x
   49075 $as_echo "$at_srcdir/actions.at:1696: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   49076 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1696"
   49077 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   49078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49079 at_status=$? at_failed=false
   49080 $at_check_filter
   49081 echo stderr:; cat "$at_stderr"
   49082 echo stdout:; cat "$at_stdout"
   49083 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1696"
   49084 $at_failed && at_fn_log_failure
   49085 $at_traceon; }
   49086 
   49087 { set +x
   49088 $as_echo "$at_srcdir/actions.at:1697:  \$PREPARSER ./input"
   49089 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1697"
   49090 ( $at_check_trace;  $PREPARSER ./input
   49091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49092 at_status=$? at_failed=false
   49093 $at_check_filter
   49094 echo stderr:; tee stderr <"$at_stderr"
   49095 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49096 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1697"
   49097 $at_failed && at_fn_log_failure
   49098 $at_traceon; }
   49099 
   49100 { set +x
   49101 $as_echo "$at_srcdir/actions.at:1697: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   49102 at_fn_check_prepare_trace "actions.at:1697"
   49103 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   49104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49105 at_status=$? at_failed=false
   49106 $at_check_filter
   49107 echo >>"$at_stderr"; $as_echo "'b' destructor
   49108 'a' destructor
   49109 " | \
   49110   $at_diff - "$at_stderr" || at_failed=:
   49111 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49112 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1697"
   49113 $at_failed && at_fn_log_failure
   49114 $at_traceon; }
   49115 
   49116 
   49117 
   49118   set +x
   49119   $at_times_p && times >"$at_times_file"
   49120 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   49121 read at_status <"$at_status_file"
   49122 #AT_STOP_179
   49123 #AT_START_180
   49124 at_fn_group_banner 180 'actions.at:1708' \
   49125   "YYBACKUP" "                                       " 9
   49126 at_xfail=no
   49127 (
   49128   $as_echo "180. $at_setup_line: testing $at_desc ..."
   49129   $at_traceon
   49130 
   49131 
   49132 
   49133 
   49134 cat >input.y <<'_ATEOF'
   49135 %code top {
   49136 #include <config.h>
   49137 /* We don't need perfect functions for these tests. */
   49138 #undef malloc
   49139 #undef memcmp
   49140 #undef realloc
   49141 }
   49142 
   49143 
   49144 %error-verbose
   49145 %debug
   49146 %pure-parser
   49147 %code {
   49148 # include <stdio.h>
   49149 # include <stdlib.h>
   49150 # include <assert.h>
   49151 
   49152   static void yyerror ( const char *msg);
   49153   static int yylex (YYSTYPE *lvalp);
   49154 }
   49155 %%
   49156 input:
   49157   exp exp {}
   49158 ;
   49159 
   49160 exp:
   49161   'a'     { printf ("a: %d\n", $1); }
   49162 | 'b'     { YYBACKUP('a', 123); }
   49163 | 'c' 'd' { YYBACKUP('a', 456); }
   49164 ;
   49165 
   49166 %%
   49167 #include <stdio.h>
   49168 /* A C error reporting function.  */
   49169 static
   49170 void yyerror ( const char *msg)
   49171 {
   49172   fprintf (stderr, "%s\n", msg);
   49173 }
   49174 #include <assert.h>
   49175 static
   49176 int yylex (YYSTYPE *lvalp)
   49177 {
   49178   static char const input[] = "bcd";
   49179   static size_t toknum = 0;
   49180   int res;
   49181   (void) lvalp;;
   49182   assert (toknum < sizeof input / sizeof input[0]);
   49183   res = input[toknum++];
   49184   *lvalp = (toknum + 1) * 10;
   49185   return res;
   49186 }
   49187 
   49188 int
   49189 main (void)
   49190 {
   49191   yydebug = !!getenv("YYDEBUG");
   49192   return yyparse ();
   49193 }
   49194 _ATEOF
   49195 
   49196 
   49197 
   49198 
   49199 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   49200   at_save_special_files
   49201   mkdir xml-tests
   49202     # Don't combine these Bison invocations since we want to be sure that
   49203   # --report=all isn't required to get the full XML file.
   49204   { set +x
   49205 $as_echo "$at_srcdir/actions.at:1749: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   49206                   --graph=xml-tests/test.dot -o input.c input.y"
   49207 at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1749"
   49208 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   49209                   --graph=xml-tests/test.dot -o input.c input.y
   49210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49211 at_status=$? at_failed=false
   49212 $at_check_filter
   49213 echo stderr:; cat "$at_stderr"
   49214 echo stdout:; cat "$at_stdout"
   49215 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749"
   49216 $at_failed && at_fn_log_failure
   49217 $at_traceon; }
   49218 
   49219   { set +x
   49220 $as_echo "$at_srcdir/actions.at:1749: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   49221 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1749"
   49222 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   49223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49224 at_status=$? at_failed=false
   49225 $at_check_filter
   49226 echo stderr:; cat "$at_stderr"
   49227 echo stdout:; cat "$at_stdout"
   49228 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749"
   49229 $at_failed && at_fn_log_failure
   49230 $at_traceon; }
   49231 
   49232     cp xml-tests/test.output expout
   49233   { set +x
   49234 $as_echo "$at_srcdir/actions.at:1749: \$XSLTPROC \\
   49235              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   49236              xml-tests/test.xml"
   49237 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1749"
   49238 ( $at_check_trace; $XSLTPROC \
   49239              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   49240              xml-tests/test.xml
   49241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49242 at_status=$? at_failed=false
   49243 $at_check_filter
   49244 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49245 $at_diff expout "$at_stdout" || at_failed=:
   49246 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749"
   49247 $at_failed && at_fn_log_failure
   49248 $at_traceon; }
   49249 
   49250   sort xml-tests/test.dot > expout
   49251   { set +x
   49252 $as_echo "$at_srcdir/actions.at:1749: \$XSLTPROC \\
   49253              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   49254              xml-tests/test.xml | sort"
   49255 at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1749"
   49256 ( $at_check_trace; $XSLTPROC \
   49257              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   49258              xml-tests/test.xml | sort
   49259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49260 at_status=$? at_failed=false
   49261 $at_check_filter
   49262 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49263 $at_diff expout "$at_stdout" || at_failed=:
   49264 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749"
   49265 $at_failed && at_fn_log_failure
   49266 $at_traceon; }
   49267 
   49268   rm -rf xml-tests expout
   49269   at_restore_special_files
   49270 fi
   49271 { set +x
   49272 $as_echo "$at_srcdir/actions.at:1749: bison -o input.c input.y"
   49273 at_fn_check_prepare_trace "actions.at:1749"
   49274 ( $at_check_trace; bison -o input.c input.y
   49275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49276 at_status=$? at_failed=false
   49277 $at_check_filter
   49278 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49279 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49280 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1749"
   49281 $at_failed && at_fn_log_failure
   49282 $at_traceon; }
   49283 
   49284 
   49285 { set +x
   49286 $as_echo "$at_srcdir/actions.at:1750: \$BISON_C_WORKS"
   49287 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1750"
   49288 ( $at_check_trace; $BISON_C_WORKS
   49289 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49290 at_status=$? at_failed=false
   49291 $at_check_filter
   49292 echo stderr:; cat "$at_stderr"
   49293 echo stdout:; cat "$at_stdout"
   49294 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1750"
   49295 $at_failed && at_fn_log_failure
   49296 $at_traceon; }
   49297 
   49298 { set +x
   49299 $as_echo "$at_srcdir/actions.at:1750: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   49300 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1750"
   49301 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   49302 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49303 at_status=$? at_failed=false
   49304 $at_check_filter
   49305 echo stderr:; cat "$at_stderr"
   49306 echo stdout:; cat "$at_stdout"
   49307 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1750"
   49308 $at_failed && at_fn_log_failure
   49309 $at_traceon; }
   49310 
   49311 { set +x
   49312 $as_echo "$at_srcdir/actions.at:1751:  \$PREPARSER ./input"
   49313 at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1751"
   49314 ( $at_check_trace;  $PREPARSER ./input
   49315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49316 at_status=$? at_failed=false
   49317 $at_check_filter
   49318 echo stderr:; tee stderr <"$at_stderr"
   49319 echo >>"$at_stdout"; $as_echo "a: 123
   49320 a: 456
   49321 " | \
   49322   $at_diff - "$at_stdout" || at_failed=:
   49323 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1751"
   49324 $at_failed && at_fn_log_failure
   49325 $at_traceon; }
   49326 
   49327 { set +x
   49328 $as_echo "$at_srcdir/actions.at:1751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   49329 at_fn_check_prepare_trace "actions.at:1751"
   49330 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   49331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49332 at_status=$? at_failed=false
   49333 $at_check_filter
   49334 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49335 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49336 at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1751"
   49337 $at_failed && at_fn_log_failure
   49338 $at_traceon; }
   49339 
   49340 
   49341 
   49342   set +x
   49343   $at_times_p && times >"$at_times_file"
   49344 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   49345 read at_status <"$at_status_file"
   49346 #AT_STOP_180
   49347 #AT_START_181
   49348 at_fn_group_banner 181 'conflicts.at:31' \
   49349   "S/R in initial" "                                 " 10
   49350 at_xfail=no
   49351 (
   49352   $as_echo "181. $at_setup_line: testing $at_desc ..."
   49353   $at_traceon
   49354 
   49355 
   49356 cat >input.y <<'_ATEOF'
   49357 %expect 1
   49358 %%
   49359 exp: e 'e';
   49360 e: 'e' | /* Nothing. */;
   49361 _ATEOF
   49362 
   49363 
   49364 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   49365   at_save_special_files
   49366   mkdir xml-tests
   49367     # Don't combine these Bison invocations since we want to be sure that
   49368   # --report=all isn't required to get the full XML file.
   49369   { set +x
   49370 $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   49371                   --graph=xml-tests/test.dot -o input.c input.y"
   49372 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:40"
   49373 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   49374                   --graph=xml-tests/test.dot -o input.c input.y
   49375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49376 at_status=$? at_failed=false
   49377 $at_check_filter
   49378 echo stderr:; cat "$at_stderr"
   49379 echo stdout:; cat "$at_stdout"
   49380 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49381 $at_failed && at_fn_log_failure
   49382 $at_traceon; }
   49383 
   49384   { set +x
   49385 $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   49386 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:40"
   49387 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   49388 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49389 at_status=$? at_failed=false
   49390 $at_check_filter
   49391 echo stderr:; cat "$at_stderr"
   49392 echo stdout:; cat "$at_stdout"
   49393 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49394 $at_failed && at_fn_log_failure
   49395 $at_traceon; }
   49396 
   49397     cp xml-tests/test.output expout
   49398   { set +x
   49399 $as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\
   49400              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   49401              xml-tests/test.xml"
   49402 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40"
   49403 ( $at_check_trace; $XSLTPROC \
   49404              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   49405              xml-tests/test.xml
   49406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49407 at_status=$? at_failed=false
   49408 $at_check_filter
   49409 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49410 $at_diff expout "$at_stdout" || at_failed=:
   49411 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49412 $at_failed && at_fn_log_failure
   49413 $at_traceon; }
   49414 
   49415   sort xml-tests/test.dot > expout
   49416   { set +x
   49417 $as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\
   49418              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   49419              xml-tests/test.xml | sort"
   49420 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40"
   49421 ( $at_check_trace; $XSLTPROC \
   49422              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   49423              xml-tests/test.xml | sort
   49424 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49425 at_status=$? at_failed=false
   49426 $at_check_filter
   49427 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49428 $at_diff expout "$at_stdout" || at_failed=:
   49429 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49430 $at_failed && at_fn_log_failure
   49431 $at_traceon; }
   49432 
   49433   rm -rf xml-tests expout
   49434   at_restore_special_files
   49435 fi
   49436 { set +x
   49437 $as_echo "$at_srcdir/conflicts.at:40: bison -o input.c input.y"
   49438 at_fn_check_prepare_trace "conflicts.at:40"
   49439 ( $at_check_trace; bison -o input.c input.y
   49440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49441 at_status=$? at_failed=false
   49442 $at_check_filter
   49443 echo >>"$at_stderr"; $as_echo "input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */
   49444 " | \
   49445   $at_diff - "$at_stderr" || at_failed=:
   49446 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49447 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49448 $at_failed && at_fn_log_failure
   49449 $at_traceon; }
   49450 
   49451 # Defining POSIXLY_CORRECT causes bison to complain if options are
   49452 # added after the grammar file name, so skip these checks in that
   49453 # case.
   49454 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   49455   at_save_special_files
   49456 
   49457   # To avoid expanding it repeatedly, store specified stdout.
   49458   : >expout
   49459 
   49460   # Run with -Werror.
   49461   { set +x
   49462 $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror"
   49463 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "conflicts.at:40"
   49464 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror
   49465 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49466 at_status=$? at_failed=false
   49467 $at_check_filter
   49468 echo stderr:; tee stderr <"$at_stderr"
   49469 $at_diff expout "$at_stdout" || at_failed=:
   49470 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:40"
   49471 $at_failed && at_fn_log_failure
   49472 $at_traceon; }
   49473 
   49474 
   49475   # Build expected stderr up to and including the "warnings being
   49476   # treated as errors" message.
   49477   cat >at-bison-check-warnings <<'_ATEOF'
   49478 input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */
   49479 _ATEOF
   49480 
   49481   at_bison_check_first=`sed -n \
   49482     '/: warning: /{=;q;}' at-bison-check-warnings`
   49483   : ${at_bison_check_first:=1}
   49484   at_bison_check_first_tmp=`sed -n \
   49485     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   49486   : ${at_bison_check_first_tmp:=1}
   49487   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   49488     at_bison_check_first=$at_bison_check_first_tmp
   49489   fi
   49490   if test $at_bison_check_first -gt 1; then
   49491     sed -n "1,`expr $at_bison_check_first - 1`"p \
   49492       at-bison-check-warnings > experr
   49493   fi
   49494   echo 'bison: warnings being treated as errors' >> experr
   49495 
   49496   # Finish building expected stderr and check.  Unlike warnings,
   49497   # complaints cause bison to exit early.  Thus, with -Werror, bison
   49498   # does not necessarily report all warnings that it does without
   49499   # -Werror, but it at least reports one.
   49500   at_bison_check_last=`sed -n '$=' stderr`
   49501   : ${at_bison_check_last:=1}
   49502   at_bison_check_last=`expr $at_bison_check_last - 1`
   49503   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   49504     at-bison-check-warnings >> experr
   49505   { set +x
   49506 $as_echo "$at_srcdir/conflicts.at:40: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   49507               stderr 1>&2"
   49508 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:40"
   49509 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   49510               stderr 1>&2
   49511 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49512 at_status=$? at_failed=false
   49513 $at_check_filter
   49514 $at_diff experr "$at_stderr" || at_failed=:
   49515 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49516 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49517 $at_failed && at_fn_log_failure
   49518 $at_traceon; }
   49519 
   49520 
   49521   # Now check --warnings=error.
   49522   cp stderr experr
   49523   { set +x
   49524 $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error"
   49525 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "conflicts.at:40"
   49526 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error
   49527 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49528 at_status=$? at_failed=false
   49529 $at_check_filter
   49530 $at_diff experr "$at_stderr" || at_failed=:
   49531 $at_diff expout "$at_stdout" || at_failed=:
   49532 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:40"
   49533 $at_failed && at_fn_log_failure
   49534 $at_traceon; }
   49535 
   49536 
   49537   # Now check -Wnone and --warnings=none by making sure that
   49538   # -Werror doesn't change the exit status when -Wnone or
   49539   # --warnings=none is specified.
   49540   { set +x
   49541 $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror"
   49542 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "conflicts.at:40"
   49543 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror
   49544 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49545 at_status=$? at_failed=false
   49546 $at_check_filter
   49547 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49548 $at_diff expout "$at_stdout" || at_failed=:
   49549 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49550 $at_failed && at_fn_log_failure
   49551 $at_traceon; }
   49552 
   49553   { set +x
   49554 $as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror"
   49555 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "conflicts.at:40"
   49556 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror
   49557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49558 at_status=$? at_failed=false
   49559 $at_check_filter
   49560 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49561 $at_diff expout "$at_stdout" || at_failed=:
   49562 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
   49563 $at_failed && at_fn_log_failure
   49564 $at_traceon; }
   49565 
   49566 
   49567   at_restore_special_files
   49568 fi
   49569 
   49570 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   49571   at_save_special_files
   49572   mkdir xml-tests
   49573     # Don't combine these Bison invocations since we want to be sure that
   49574   # --report=all isn't required to get the full XML file.
   49575   { set +x
   49576 $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   49577                   --graph=xml-tests/test.dot -fcaret -o input.c input.y"
   49578 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:44"
   49579 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   49580                   --graph=xml-tests/test.dot -fcaret -o input.c input.y
   49581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49582 at_status=$? at_failed=false
   49583 $at_check_filter
   49584 echo stderr:; cat "$at_stderr"
   49585 echo stdout:; cat "$at_stdout"
   49586 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49587 $at_failed && at_fn_log_failure
   49588 $at_traceon; }
   49589 
   49590   { set +x
   49591 $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y"
   49592 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "conflicts.at:44"
   49593 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y
   49594 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49595 at_status=$? at_failed=false
   49596 $at_check_filter
   49597 echo stderr:; cat "$at_stderr"
   49598 echo stdout:; cat "$at_stdout"
   49599 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49600 $at_failed && at_fn_log_failure
   49601 $at_traceon; }
   49602 
   49603     cp xml-tests/test.output expout
   49604   { set +x
   49605 $as_echo "$at_srcdir/conflicts.at:44: \$XSLTPROC \\
   49606              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   49607              xml-tests/test.xml"
   49608 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:44"
   49609 ( $at_check_trace; $XSLTPROC \
   49610              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   49611              xml-tests/test.xml
   49612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49613 at_status=$? at_failed=false
   49614 $at_check_filter
   49615 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49616 $at_diff expout "$at_stdout" || at_failed=:
   49617 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49618 $at_failed && at_fn_log_failure
   49619 $at_traceon; }
   49620 
   49621   sort xml-tests/test.dot > expout
   49622   { set +x
   49623 $as_echo "$at_srcdir/conflicts.at:44: \$XSLTPROC \\
   49624              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   49625              xml-tests/test.xml | sort"
   49626 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:44"
   49627 ( $at_check_trace; $XSLTPROC \
   49628              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   49629              xml-tests/test.xml | sort
   49630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49631 at_status=$? at_failed=false
   49632 $at_check_filter
   49633 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49634 $at_diff expout "$at_stdout" || at_failed=:
   49635 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49636 $at_failed && at_fn_log_failure
   49637 $at_traceon; }
   49638 
   49639   rm -rf xml-tests expout
   49640   at_restore_special_files
   49641 fi
   49642 { set +x
   49643 $as_echo "$at_srcdir/conflicts.at:44: bison -fcaret -o input.c input.y"
   49644 at_fn_check_prepare_trace "conflicts.at:44"
   49645 ( $at_check_trace; bison -fcaret -o input.c input.y
   49646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49647 at_status=$? at_failed=false
   49648 $at_check_filter
   49649 echo >>"$at_stderr"; $as_echo "input.y:4.9: warning: rule useless in parser due to conflicts
   49650  e: 'e' | /* Nothing. */;
   49651          ^
   49652 " | \
   49653   $at_diff - "$at_stderr" || at_failed=:
   49654 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49655 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49656 $at_failed && at_fn_log_failure
   49657 $at_traceon; }
   49658 
   49659 # Defining POSIXLY_CORRECT causes bison to complain if options are
   49660 # added after the grammar file name, so skip these checks in that
   49661 # case.
   49662 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   49663   at_save_special_files
   49664 
   49665   # To avoid expanding it repeatedly, store specified stdout.
   49666   : >expout
   49667 
   49668   # Run with -Werror.
   49669   { set +x
   49670 $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror"
   49671 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "conflicts.at:44"
   49672 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror
   49673 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49674 at_status=$? at_failed=false
   49675 $at_check_filter
   49676 echo stderr:; tee stderr <"$at_stderr"
   49677 $at_diff expout "$at_stdout" || at_failed=:
   49678 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:44"
   49679 $at_failed && at_fn_log_failure
   49680 $at_traceon; }
   49681 
   49682 
   49683   # Build expected stderr up to and including the "warnings being
   49684   # treated as errors" message.
   49685   cat >at-bison-check-warnings <<'_ATEOF'
   49686 input.y:4.9: warning: rule useless in parser due to conflicts
   49687  e: 'e' | /* Nothing. */;
   49688          ^
   49689 _ATEOF
   49690 
   49691   at_bison_check_first=`sed -n \
   49692     '/: warning: /{=;q;}' at-bison-check-warnings`
   49693   : ${at_bison_check_first:=1}
   49694   at_bison_check_first_tmp=`sed -n \
   49695     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   49696   : ${at_bison_check_first_tmp:=1}
   49697   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   49698     at_bison_check_first=$at_bison_check_first_tmp
   49699   fi
   49700   if test $at_bison_check_first -gt 1; then
   49701     sed -n "1,`expr $at_bison_check_first - 1`"p \
   49702       at-bison-check-warnings > experr
   49703   fi
   49704   echo 'bison: warnings being treated as errors' >> experr
   49705 
   49706   # Finish building expected stderr and check.  Unlike warnings,
   49707   # complaints cause bison to exit early.  Thus, with -Werror, bison
   49708   # does not necessarily report all warnings that it does without
   49709   # -Werror, but it at least reports one.
   49710   at_bison_check_last=`sed -n '$=' stderr`
   49711   : ${at_bison_check_last:=1}
   49712   at_bison_check_last=`expr $at_bison_check_last - 1`
   49713   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   49714     at-bison-check-warnings >> experr
   49715   { set +x
   49716 $as_echo "$at_srcdir/conflicts.at:44: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   49717               stderr 1>&2"
   49718 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:44"
   49719 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   49720               stderr 1>&2
   49721 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49722 at_status=$? at_failed=false
   49723 $at_check_filter
   49724 $at_diff experr "$at_stderr" || at_failed=:
   49725 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49726 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49727 $at_failed && at_fn_log_failure
   49728 $at_traceon; }
   49729 
   49730 
   49731   # Now check --warnings=error.
   49732   cp stderr experr
   49733   { set +x
   49734 $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error"
   49735 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "conflicts.at:44"
   49736 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error
   49737 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49738 at_status=$? at_failed=false
   49739 $at_check_filter
   49740 $at_diff experr "$at_stderr" || at_failed=:
   49741 $at_diff expout "$at_stdout" || at_failed=:
   49742 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:44"
   49743 $at_failed && at_fn_log_failure
   49744 $at_traceon; }
   49745 
   49746 
   49747   # Now check -Wnone and --warnings=none by making sure that
   49748   # -Werror doesn't change the exit status when -Wnone or
   49749   # --warnings=none is specified.
   49750   { set +x
   49751 $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror"
   49752 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "conflicts.at:44"
   49753 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror
   49754 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49755 at_status=$? at_failed=false
   49756 $at_check_filter
   49757 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49758 $at_diff expout "$at_stdout" || at_failed=:
   49759 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49760 $at_failed && at_fn_log_failure
   49761 $at_traceon; }
   49762 
   49763   { set +x
   49764 $as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror"
   49765 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "conflicts.at:44"
   49766 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror
   49767 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49768 at_status=$? at_failed=false
   49769 $at_check_filter
   49770 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49771 $at_diff expout "$at_stdout" || at_failed=:
   49772 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:44"
   49773 $at_failed && at_fn_log_failure
   49774 $at_traceon; }
   49775 
   49776 
   49777   at_restore_special_files
   49778 fi
   49779 
   49780   set +x
   49781   $at_times_p && times >"$at_times_file"
   49782 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   49783 read at_status <"$at_status_file"
   49784 #AT_STOP_181
   49785 #AT_START_182
   49786 at_fn_group_banner 182 'conflicts.at:57' \
   49787   "%nonassoc and eof" "                              " 10
   49788 at_xfail=no
   49789 (
   49790   $as_echo "182. $at_setup_line: testing $at_desc ..."
   49791   $at_traceon
   49792 
   49793 
   49794 
   49795 cat >input.y <<'_ATEOF'
   49796 %code top {
   49797 #include <config.h>
   49798 /* We don't need perfect functions for these tests. */
   49799 #undef malloc
   49800 #undef memcmp
   49801 #undef realloc
   49802 }
   49803 
   49804 
   49805 %{
   49806 #include <stdio.h>
   49807 #include <stdlib.h>
   49808 #include <string.h>
   49809 #include <assert.h>
   49810 
   49811 #define YYERROR_VERBOSE 1
   49812 #include <stdio.h>
   49813 /* A C error reporting function.  */
   49814 static
   49815 void yyerror ( const char *msg)
   49816 {
   49817   fprintf (stderr, "%s\n", msg);
   49818 }
   49819 /* The current argument. */
   49820 static const char *input;
   49821 
   49822 static int
   49823 yylex (void)
   49824 {
   49825   static size_t toknum;
   49826   assert (toknum <= strlen (input));
   49827   return input[toknum++];
   49828 }
   49829 
   49830 %}
   49831 
   49832 %nonassoc '<' '>'
   49833 
   49834 %%
   49835 expr: expr '<' expr
   49836     | expr '>' expr
   49837     | '0'
   49838     ;
   49839 %%
   49840 int
   49841 main (int argc, const char *argv[])
   49842 {
   49843   input = argc <= 1 ? "" : argv[1];
   49844   return yyparse ();
   49845 }
   49846 _ATEOF
   49847 
   49848 
   49849 
   49850 
   49851 
   49852 
   49853 # Expected token list is missing.
   49854 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   49855   at_save_special_files
   49856   mkdir xml-tests
   49857     # Don't combine these Bison invocations since we want to be sure that
   49858   # --report=all isn't required to get the full XML file.
   49859   { set +x
   49860 $as_echo "$at_srcdir/conflicts.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   49861                   --graph=xml-tests/test.dot  -o input.c input.y"
   49862 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:123"
   49863 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   49864                   --graph=xml-tests/test.dot  -o input.c input.y
   49865 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49866 at_status=$? at_failed=false
   49867 $at_check_filter
   49868 echo stderr:; cat "$at_stderr"
   49869 echo stdout:; cat "$at_stdout"
   49870 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49871 $at_failed && at_fn_log_failure
   49872 $at_traceon; }
   49873 
   49874   { set +x
   49875 $as_echo "$at_srcdir/conflicts.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  -o input.c input.y"
   49876 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  -o input.c input.y" "conflicts.at:123"
   49877 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml  -o input.c input.y
   49878 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49879 at_status=$? at_failed=false
   49880 $at_check_filter
   49881 echo stderr:; cat "$at_stderr"
   49882 echo stdout:; cat "$at_stdout"
   49883 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49884 $at_failed && at_fn_log_failure
   49885 $at_traceon; }
   49886 
   49887     cp xml-tests/test.output expout
   49888   { set +x
   49889 $as_echo "$at_srcdir/conflicts.at:123: \$XSLTPROC \\
   49890              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   49891              xml-tests/test.xml"
   49892 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:123"
   49893 ( $at_check_trace; $XSLTPROC \
   49894              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   49895              xml-tests/test.xml
   49896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49897 at_status=$? at_failed=false
   49898 $at_check_filter
   49899 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49900 $at_diff expout "$at_stdout" || at_failed=:
   49901 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49902 $at_failed && at_fn_log_failure
   49903 $at_traceon; }
   49904 
   49905   sort xml-tests/test.dot > expout
   49906   { set +x
   49907 $as_echo "$at_srcdir/conflicts.at:123: \$XSLTPROC \\
   49908              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   49909              xml-tests/test.xml | sort"
   49910 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:123"
   49911 ( $at_check_trace; $XSLTPROC \
   49912              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   49913              xml-tests/test.xml | sort
   49914 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49915 at_status=$? at_failed=false
   49916 $at_check_filter
   49917 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49918 $at_diff expout "$at_stdout" || at_failed=:
   49919 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49920 $at_failed && at_fn_log_failure
   49921 $at_traceon; }
   49922 
   49923   rm -rf xml-tests expout
   49924   at_restore_special_files
   49925 fi
   49926 { set +x
   49927 $as_echo "$at_srcdir/conflicts.at:123: bison  -o input.c input.y"
   49928 at_fn_check_prepare_trace "conflicts.at:123"
   49929 ( $at_check_trace; bison  -o input.c input.y
   49930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49931 at_status=$? at_failed=false
   49932 $at_check_filter
   49933 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49934 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49935 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49936 $at_failed && at_fn_log_failure
   49937 $at_traceon; }
   49938 
   49939 
   49940 { set +x
   49941 $as_echo "$at_srcdir/conflicts.at:123: \$BISON_C_WORKS"
   49942 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:123"
   49943 ( $at_check_trace; $BISON_C_WORKS
   49944 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49945 at_status=$? at_failed=false
   49946 $at_check_filter
   49947 echo stderr:; cat "$at_stderr"
   49948 echo stdout:; cat "$at_stdout"
   49949 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49950 $at_failed && at_fn_log_failure
   49951 $at_traceon; }
   49952 
   49953 { set +x
   49954 $as_echo "$at_srcdir/conflicts.at:123: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   49955 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:123"
   49956 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   49957 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49958 at_status=$? at_failed=false
   49959 $at_check_filter
   49960 echo stderr:; cat "$at_stderr"
   49961 echo stdout:; cat "$at_stdout"
   49962 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49963 $at_failed && at_fn_log_failure
   49964 $at_traceon; }
   49965 
   49966 
   49967 
   49968 
   49969 { set +x
   49970 $as_echo "$at_srcdir/conflicts.at:123:  \$PREPARSER ./input '0<0'"
   49971 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:123"
   49972 ( $at_check_trace;  $PREPARSER ./input '0<0'
   49973 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49974 at_status=$? at_failed=false
   49975 $at_check_filter
   49976 echo stderr:; tee stderr <"$at_stderr"
   49977 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49978 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49979 $at_failed && at_fn_log_failure
   49980 $at_traceon; }
   49981 
   49982 { set +x
   49983 $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   49984 at_fn_check_prepare_trace "conflicts.at:123"
   49985 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   49986 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   49987 at_status=$? at_failed=false
   49988 $at_check_filter
   49989 at_fn_diff_devnull "$at_stderr" || at_failed=:
   49990 at_fn_diff_devnull "$at_stdout" || at_failed=:
   49991 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   49992 $at_failed && at_fn_log_failure
   49993 $at_traceon; }
   49994 
   49995 
   49996 { set +x
   49997 $as_echo "$at_srcdir/conflicts.at:123:  \$PREPARSER ./input '0<0<0'"
   49998 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:123"
   49999 ( $at_check_trace;  $PREPARSER ./input '0<0<0'
   50000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50001 at_status=$? at_failed=false
   50002 $at_check_filter
   50003 echo stderr:; tee stderr <"$at_stderr"
   50004 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50005 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123"
   50006 $at_failed && at_fn_log_failure
   50007 $at_traceon; }
   50008 
   50009 { set +x
   50010 $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50011 at_fn_check_prepare_trace "conflicts.at:123"
   50012 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50013 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50014 at_status=$? at_failed=false
   50015 $at_check_filter
   50016 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<'
   50017 " | \
   50018   $at_diff - "$at_stderr" || at_failed=:
   50019 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50020 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   50021 $at_failed && at_fn_log_failure
   50022 $at_traceon; }
   50023 
   50024 
   50025 
   50026 { set +x
   50027 $as_echo "$at_srcdir/conflicts.at:123:  \$PREPARSER ./input '0>0'"
   50028 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:123"
   50029 ( $at_check_trace;  $PREPARSER ./input '0>0'
   50030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50031 at_status=$? at_failed=false
   50032 $at_check_filter
   50033 echo stderr:; tee stderr <"$at_stderr"
   50034 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50035 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   50036 $at_failed && at_fn_log_failure
   50037 $at_traceon; }
   50038 
   50039 { set +x
   50040 $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50041 at_fn_check_prepare_trace "conflicts.at:123"
   50042 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50043 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50044 at_status=$? at_failed=false
   50045 $at_check_filter
   50046 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50047 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50048 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   50049 $at_failed && at_fn_log_failure
   50050 $at_traceon; }
   50051 
   50052 
   50053 { set +x
   50054 $as_echo "$at_srcdir/conflicts.at:123:  \$PREPARSER ./input '0>0>0'"
   50055 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:123"
   50056 ( $at_check_trace;  $PREPARSER ./input '0>0>0'
   50057 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50058 at_status=$? at_failed=false
   50059 $at_check_filter
   50060 echo stderr:; tee stderr <"$at_stderr"
   50061 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50062 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123"
   50063 $at_failed && at_fn_log_failure
   50064 $at_traceon; }
   50065 
   50066 { set +x
   50067 $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50068 at_fn_check_prepare_trace "conflicts.at:123"
   50069 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50070 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50071 at_status=$? at_failed=false
   50072 $at_check_filter
   50073 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>'
   50074 " | \
   50075   $at_diff - "$at_stderr" || at_failed=:
   50076 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50077 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   50078 $at_failed && at_fn_log_failure
   50079 $at_traceon; }
   50080 
   50081 
   50082 
   50083 { set +x
   50084 $as_echo "$at_srcdir/conflicts.at:123:  \$PREPARSER ./input '0<0>0'"
   50085 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:123"
   50086 ( $at_check_trace;  $PREPARSER ./input '0<0>0'
   50087 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50088 at_status=$? at_failed=false
   50089 $at_check_filter
   50090 echo stderr:; tee stderr <"$at_stderr"
   50091 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50092 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123"
   50093 $at_failed && at_fn_log_failure
   50094 $at_traceon; }
   50095 
   50096 { set +x
   50097 $as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50098 at_fn_check_prepare_trace "conflicts.at:123"
   50099 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50100 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50101 at_status=$? at_failed=false
   50102 $at_check_filter
   50103 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>'
   50104 " | \
   50105   $at_diff - "$at_stderr" || at_failed=:
   50106 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50107 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123"
   50108 $at_failed && at_fn_log_failure
   50109 $at_traceon; }
   50110 
   50111 
   50112 
   50113 
   50114 
   50115 # We must disable default reductions in inconsistent states in order to
   50116 # have an explicit list of all expected tokens.
   50117 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   50118   at_save_special_files
   50119   mkdir xml-tests
   50120     # Don't combine these Bison invocations since we want to be sure that
   50121   # --report=all isn't required to get the full XML file.
   50122   { set +x
   50123 $as_echo "$at_srcdir/conflicts.at:127: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   50124                   --graph=xml-tests/test.dot -Dlr.default-reductions=consistent -o input.c input.y"
   50125 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:127"
   50126 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   50127                   --graph=xml-tests/test.dot -Dlr.default-reductions=consistent -o input.c input.y
   50128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50129 at_status=$? at_failed=false
   50130 $at_check_filter
   50131 echo stderr:; cat "$at_stderr"
   50132 echo stdout:; cat "$at_stdout"
   50133 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50134 $at_failed && at_fn_log_failure
   50135 $at_traceon; }
   50136 
   50137   { set +x
   50138 $as_echo "$at_srcdir/conflicts.at:127: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y"
   50139 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y" "conflicts.at:127"
   50140 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y
   50141 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50142 at_status=$? at_failed=false
   50143 $at_check_filter
   50144 echo stderr:; cat "$at_stderr"
   50145 echo stdout:; cat "$at_stdout"
   50146 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50147 $at_failed && at_fn_log_failure
   50148 $at_traceon; }
   50149 
   50150     cp xml-tests/test.output expout
   50151   { set +x
   50152 $as_echo "$at_srcdir/conflicts.at:127: \$XSLTPROC \\
   50153              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   50154              xml-tests/test.xml"
   50155 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:127"
   50156 ( $at_check_trace; $XSLTPROC \
   50157              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   50158              xml-tests/test.xml
   50159 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50160 at_status=$? at_failed=false
   50161 $at_check_filter
   50162 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50163 $at_diff expout "$at_stdout" || at_failed=:
   50164 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50165 $at_failed && at_fn_log_failure
   50166 $at_traceon; }
   50167 
   50168   sort xml-tests/test.dot > expout
   50169   { set +x
   50170 $as_echo "$at_srcdir/conflicts.at:127: \$XSLTPROC \\
   50171              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   50172              xml-tests/test.xml | sort"
   50173 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:127"
   50174 ( $at_check_trace; $XSLTPROC \
   50175              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   50176              xml-tests/test.xml | sort
   50177 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50178 at_status=$? at_failed=false
   50179 $at_check_filter
   50180 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50181 $at_diff expout "$at_stdout" || at_failed=:
   50182 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50183 $at_failed && at_fn_log_failure
   50184 $at_traceon; }
   50185 
   50186   rm -rf xml-tests expout
   50187   at_restore_special_files
   50188 fi
   50189 { set +x
   50190 $as_echo "$at_srcdir/conflicts.at:127: bison -Dlr.default-reductions=consistent -o input.c input.y"
   50191 at_fn_check_prepare_trace "conflicts.at:127"
   50192 ( $at_check_trace; bison -Dlr.default-reductions=consistent -o input.c input.y
   50193 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50194 at_status=$? at_failed=false
   50195 $at_check_filter
   50196 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50197 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50198 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50199 $at_failed && at_fn_log_failure
   50200 $at_traceon; }
   50201 
   50202 
   50203 { set +x
   50204 $as_echo "$at_srcdir/conflicts.at:127: \$BISON_C_WORKS"
   50205 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:127"
   50206 ( $at_check_trace; $BISON_C_WORKS
   50207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50208 at_status=$? at_failed=false
   50209 $at_check_filter
   50210 echo stderr:; cat "$at_stderr"
   50211 echo stdout:; cat "$at_stdout"
   50212 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50213 $at_failed && at_fn_log_failure
   50214 $at_traceon; }
   50215 
   50216 { set +x
   50217 $as_echo "$at_srcdir/conflicts.at:127: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   50218 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:127"
   50219 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   50220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50221 at_status=$? at_failed=false
   50222 $at_check_filter
   50223 echo stderr:; cat "$at_stderr"
   50224 echo stdout:; cat "$at_stdout"
   50225 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50226 $at_failed && at_fn_log_failure
   50227 $at_traceon; }
   50228 
   50229 
   50230 
   50231 
   50232 { set +x
   50233 $as_echo "$at_srcdir/conflicts.at:127:  \$PREPARSER ./input '0<0'"
   50234 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:127"
   50235 ( $at_check_trace;  $PREPARSER ./input '0<0'
   50236 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50237 at_status=$? at_failed=false
   50238 $at_check_filter
   50239 echo stderr:; tee stderr <"$at_stderr"
   50240 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50241 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50242 $at_failed && at_fn_log_failure
   50243 $at_traceon; }
   50244 
   50245 { set +x
   50246 $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50247 at_fn_check_prepare_trace "conflicts.at:127"
   50248 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50249 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50250 at_status=$? at_failed=false
   50251 $at_check_filter
   50252 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50253 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50254 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50255 $at_failed && at_fn_log_failure
   50256 $at_traceon; }
   50257 
   50258 
   50259 { set +x
   50260 $as_echo "$at_srcdir/conflicts.at:127:  \$PREPARSER ./input '0<0<0'"
   50261 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:127"
   50262 ( $at_check_trace;  $PREPARSER ./input '0<0<0'
   50263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50264 at_status=$? at_failed=false
   50265 $at_check_filter
   50266 echo stderr:; tee stderr <"$at_stderr"
   50267 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50268 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127"
   50269 $at_failed && at_fn_log_failure
   50270 $at_traceon; }
   50271 
   50272 { set +x
   50273 $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50274 at_fn_check_prepare_trace "conflicts.at:127"
   50275 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50276 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50277 at_status=$? at_failed=false
   50278 $at_check_filter
   50279 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end
   50280 " | \
   50281   $at_diff - "$at_stderr" || at_failed=:
   50282 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50283 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50284 $at_failed && at_fn_log_failure
   50285 $at_traceon; }
   50286 
   50287 
   50288 
   50289 { set +x
   50290 $as_echo "$at_srcdir/conflicts.at:127:  \$PREPARSER ./input '0>0'"
   50291 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:127"
   50292 ( $at_check_trace;  $PREPARSER ./input '0>0'
   50293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50294 at_status=$? at_failed=false
   50295 $at_check_filter
   50296 echo stderr:; tee stderr <"$at_stderr"
   50297 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50298 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50299 $at_failed && at_fn_log_failure
   50300 $at_traceon; }
   50301 
   50302 { set +x
   50303 $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50304 at_fn_check_prepare_trace "conflicts.at:127"
   50305 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50307 at_status=$? at_failed=false
   50308 $at_check_filter
   50309 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50310 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50311 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50312 $at_failed && at_fn_log_failure
   50313 $at_traceon; }
   50314 
   50315 
   50316 { set +x
   50317 $as_echo "$at_srcdir/conflicts.at:127:  \$PREPARSER ./input '0>0>0'"
   50318 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:127"
   50319 ( $at_check_trace;  $PREPARSER ./input '0>0>0'
   50320 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50321 at_status=$? at_failed=false
   50322 $at_check_filter
   50323 echo stderr:; tee stderr <"$at_stderr"
   50324 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50325 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127"
   50326 $at_failed && at_fn_log_failure
   50327 $at_traceon; }
   50328 
   50329 { set +x
   50330 $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50331 at_fn_check_prepare_trace "conflicts.at:127"
   50332 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50333 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50334 at_status=$? at_failed=false
   50335 $at_check_filter
   50336 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
   50337 " | \
   50338   $at_diff - "$at_stderr" || at_failed=:
   50339 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50340 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50341 $at_failed && at_fn_log_failure
   50342 $at_traceon; }
   50343 
   50344 
   50345 
   50346 { set +x
   50347 $as_echo "$at_srcdir/conflicts.at:127:  \$PREPARSER ./input '0<0>0'"
   50348 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:127"
   50349 ( $at_check_trace;  $PREPARSER ./input '0<0>0'
   50350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50351 at_status=$? at_failed=false
   50352 $at_check_filter
   50353 echo stderr:; tee stderr <"$at_stderr"
   50354 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50355 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127"
   50356 $at_failed && at_fn_log_failure
   50357 $at_traceon; }
   50358 
   50359 { set +x
   50360 $as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50361 at_fn_check_prepare_trace "conflicts.at:127"
   50362 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50364 at_status=$? at_failed=false
   50365 $at_check_filter
   50366 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
   50367 " | \
   50368   $at_diff - "$at_stderr" || at_failed=:
   50369 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50370 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127"
   50371 $at_failed && at_fn_log_failure
   50372 $at_traceon; }
   50373 
   50374 
   50375 
   50376 
   50377 
   50378 # lr.default-reductions=consistent happens to work for this test case.
   50379 # However, for other grammars, lookahead sets can be merged for
   50380 # different left contexts, so it is still possible to have an incorrect
   50381 # expected list.  Canonical LR is almost a general solution (that is, it
   50382 # can fail only when %nonassoc is used), so make sure it gives the same
   50383 # result as above.
   50384 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   50385   at_save_special_files
   50386   mkdir xml-tests
   50387     # Don't combine these Bison invocations since we want to be sure that
   50388   # --report=all isn't required to get the full XML file.
   50389   { set +x
   50390 $as_echo "$at_srcdir/conflicts.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   50391                   --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y"
   50392 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:136"
   50393 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   50394                   --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y
   50395 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50396 at_status=$? at_failed=false
   50397 $at_check_filter
   50398 echo stderr:; cat "$at_stderr"
   50399 echo stdout:; cat "$at_stdout"
   50400 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50401 $at_failed && at_fn_log_failure
   50402 $at_traceon; }
   50403 
   50404   { set +x
   50405 $as_echo "$at_srcdir/conflicts.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y"
   50406 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:136"
   50407 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y
   50408 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50409 at_status=$? at_failed=false
   50410 $at_check_filter
   50411 echo stderr:; cat "$at_stderr"
   50412 echo stdout:; cat "$at_stdout"
   50413 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50414 $at_failed && at_fn_log_failure
   50415 $at_traceon; }
   50416 
   50417     cp xml-tests/test.output expout
   50418   { set +x
   50419 $as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\
   50420              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   50421              xml-tests/test.xml"
   50422 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136"
   50423 ( $at_check_trace; $XSLTPROC \
   50424              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   50425              xml-tests/test.xml
   50426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50427 at_status=$? at_failed=false
   50428 $at_check_filter
   50429 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50430 $at_diff expout "$at_stdout" || at_failed=:
   50431 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50432 $at_failed && at_fn_log_failure
   50433 $at_traceon; }
   50434 
   50435   sort xml-tests/test.dot > expout
   50436   { set +x
   50437 $as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\
   50438              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   50439              xml-tests/test.xml | sort"
   50440 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136"
   50441 ( $at_check_trace; $XSLTPROC \
   50442              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   50443              xml-tests/test.xml | sort
   50444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50445 at_status=$? at_failed=false
   50446 $at_check_filter
   50447 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50448 $at_diff expout "$at_stdout" || at_failed=:
   50449 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50450 $at_failed && at_fn_log_failure
   50451 $at_traceon; }
   50452 
   50453   rm -rf xml-tests expout
   50454   at_restore_special_files
   50455 fi
   50456 { set +x
   50457 $as_echo "$at_srcdir/conflicts.at:136: bison -Dlr.type=canonical-lr -o input.c input.y"
   50458 at_fn_check_prepare_trace "conflicts.at:136"
   50459 ( $at_check_trace; bison -Dlr.type=canonical-lr -o input.c input.y
   50460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50461 at_status=$? at_failed=false
   50462 $at_check_filter
   50463 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50464 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50465 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50466 $at_failed && at_fn_log_failure
   50467 $at_traceon; }
   50468 
   50469 
   50470 { set +x
   50471 $as_echo "$at_srcdir/conflicts.at:136: \$BISON_C_WORKS"
   50472 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:136"
   50473 ( $at_check_trace; $BISON_C_WORKS
   50474 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50475 at_status=$? at_failed=false
   50476 $at_check_filter
   50477 echo stderr:; cat "$at_stderr"
   50478 echo stdout:; cat "$at_stdout"
   50479 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50480 $at_failed && at_fn_log_failure
   50481 $at_traceon; }
   50482 
   50483 { set +x
   50484 $as_echo "$at_srcdir/conflicts.at:136: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   50485 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:136"
   50486 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   50487 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50488 at_status=$? at_failed=false
   50489 $at_check_filter
   50490 echo stderr:; cat "$at_stderr"
   50491 echo stdout:; cat "$at_stdout"
   50492 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50493 $at_failed && at_fn_log_failure
   50494 $at_traceon; }
   50495 
   50496 
   50497 
   50498 
   50499 { set +x
   50500 $as_echo "$at_srcdir/conflicts.at:136:  \$PREPARSER ./input '0<0'"
   50501 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:136"
   50502 ( $at_check_trace;  $PREPARSER ./input '0<0'
   50503 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50504 at_status=$? at_failed=false
   50505 $at_check_filter
   50506 echo stderr:; tee stderr <"$at_stderr"
   50507 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50508 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50509 $at_failed && at_fn_log_failure
   50510 $at_traceon; }
   50511 
   50512 { set +x
   50513 $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50514 at_fn_check_prepare_trace "conflicts.at:136"
   50515 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50516 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50517 at_status=$? at_failed=false
   50518 $at_check_filter
   50519 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50520 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50521 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50522 $at_failed && at_fn_log_failure
   50523 $at_traceon; }
   50524 
   50525 
   50526 { set +x
   50527 $as_echo "$at_srcdir/conflicts.at:136:  \$PREPARSER ./input '0<0<0'"
   50528 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:136"
   50529 ( $at_check_trace;  $PREPARSER ./input '0<0<0'
   50530 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50531 at_status=$? at_failed=false
   50532 $at_check_filter
   50533 echo stderr:; tee stderr <"$at_stderr"
   50534 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50535 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136"
   50536 $at_failed && at_fn_log_failure
   50537 $at_traceon; }
   50538 
   50539 { set +x
   50540 $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50541 at_fn_check_prepare_trace "conflicts.at:136"
   50542 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50544 at_status=$? at_failed=false
   50545 $at_check_filter
   50546 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end
   50547 " | \
   50548   $at_diff - "$at_stderr" || at_failed=:
   50549 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50550 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50551 $at_failed && at_fn_log_failure
   50552 $at_traceon; }
   50553 
   50554 
   50555 
   50556 { set +x
   50557 $as_echo "$at_srcdir/conflicts.at:136:  \$PREPARSER ./input '0>0'"
   50558 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:136"
   50559 ( $at_check_trace;  $PREPARSER ./input '0>0'
   50560 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50561 at_status=$? at_failed=false
   50562 $at_check_filter
   50563 echo stderr:; tee stderr <"$at_stderr"
   50564 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50565 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50566 $at_failed && at_fn_log_failure
   50567 $at_traceon; }
   50568 
   50569 { set +x
   50570 $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50571 at_fn_check_prepare_trace "conflicts.at:136"
   50572 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50573 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50574 at_status=$? at_failed=false
   50575 $at_check_filter
   50576 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50577 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50578 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50579 $at_failed && at_fn_log_failure
   50580 $at_traceon; }
   50581 
   50582 
   50583 { set +x
   50584 $as_echo "$at_srcdir/conflicts.at:136:  \$PREPARSER ./input '0>0>0'"
   50585 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:136"
   50586 ( $at_check_trace;  $PREPARSER ./input '0>0>0'
   50587 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50588 at_status=$? at_failed=false
   50589 $at_check_filter
   50590 echo stderr:; tee stderr <"$at_stderr"
   50591 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50592 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136"
   50593 $at_failed && at_fn_log_failure
   50594 $at_traceon; }
   50595 
   50596 { set +x
   50597 $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50598 at_fn_check_prepare_trace "conflicts.at:136"
   50599 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50600 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50601 at_status=$? at_failed=false
   50602 $at_check_filter
   50603 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
   50604 " | \
   50605   $at_diff - "$at_stderr" || at_failed=:
   50606 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50607 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50608 $at_failed && at_fn_log_failure
   50609 $at_traceon; }
   50610 
   50611 
   50612 
   50613 { set +x
   50614 $as_echo "$at_srcdir/conflicts.at:136:  \$PREPARSER ./input '0<0>0'"
   50615 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:136"
   50616 ( $at_check_trace;  $PREPARSER ./input '0<0>0'
   50617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50618 at_status=$? at_failed=false
   50619 $at_check_filter
   50620 echo stderr:; tee stderr <"$at_stderr"
   50621 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50622 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136"
   50623 $at_failed && at_fn_log_failure
   50624 $at_traceon; }
   50625 
   50626 { set +x
   50627 $as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50628 at_fn_check_prepare_trace "conflicts.at:136"
   50629 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50631 at_status=$? at_failed=false
   50632 $at_check_filter
   50633 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
   50634 " | \
   50635   $at_diff - "$at_stderr" || at_failed=:
   50636 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50637 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
   50638 $at_failed && at_fn_log_failure
   50639 $at_traceon; }
   50640 
   50641 
   50642 
   50643 
   50644 
   50645 # parse.lac=full is a completely general solution that does not require
   50646 # any of the above sacrifices.  Of course, it does not extend the
   50647 # language-recognition power of LALR to (IE)LR, but it does ensure that
   50648 # the reported list of expected tokens matches what the given parser
   50649 # would have accepted in place of the unexpected token.
   50650 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   50651   at_save_special_files
   50652   mkdir xml-tests
   50653     # Don't combine these Bison invocations since we want to be sure that
   50654   # --report=all isn't required to get the full XML file.
   50655   { set +x
   50656 $as_echo "$at_srcdir/conflicts.at:143: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   50657                   --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y"
   50658 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:143"
   50659 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   50660                   --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y
   50661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50662 at_status=$? at_failed=false
   50663 $at_check_filter
   50664 echo stderr:; cat "$at_stderr"
   50665 echo stdout:; cat "$at_stdout"
   50666 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50667 $at_failed && at_fn_log_failure
   50668 $at_traceon; }
   50669 
   50670   { set +x
   50671 $as_echo "$at_srcdir/conflicts.at:143: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y"
   50672 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" "conflicts.at:143"
   50673 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y
   50674 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50675 at_status=$? at_failed=false
   50676 $at_check_filter
   50677 echo stderr:; cat "$at_stderr"
   50678 echo stdout:; cat "$at_stdout"
   50679 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50680 $at_failed && at_fn_log_failure
   50681 $at_traceon; }
   50682 
   50683     cp xml-tests/test.output expout
   50684   { set +x
   50685 $as_echo "$at_srcdir/conflicts.at:143: \$XSLTPROC \\
   50686              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   50687              xml-tests/test.xml"
   50688 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:143"
   50689 ( $at_check_trace; $XSLTPROC \
   50690              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   50691              xml-tests/test.xml
   50692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50693 at_status=$? at_failed=false
   50694 $at_check_filter
   50695 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50696 $at_diff expout "$at_stdout" || at_failed=:
   50697 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50698 $at_failed && at_fn_log_failure
   50699 $at_traceon; }
   50700 
   50701   sort xml-tests/test.dot > expout
   50702   { set +x
   50703 $as_echo "$at_srcdir/conflicts.at:143: \$XSLTPROC \\
   50704              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   50705              xml-tests/test.xml | sort"
   50706 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:143"
   50707 ( $at_check_trace; $XSLTPROC \
   50708              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   50709              xml-tests/test.xml | sort
   50710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50711 at_status=$? at_failed=false
   50712 $at_check_filter
   50713 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50714 $at_diff expout "$at_stdout" || at_failed=:
   50715 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50716 $at_failed && at_fn_log_failure
   50717 $at_traceon; }
   50718 
   50719   rm -rf xml-tests expout
   50720   at_restore_special_files
   50721 fi
   50722 { set +x
   50723 $as_echo "$at_srcdir/conflicts.at:143: bison -Dparse.lac=full -o input.c input.y"
   50724 at_fn_check_prepare_trace "conflicts.at:143"
   50725 ( $at_check_trace; bison -Dparse.lac=full -o input.c input.y
   50726 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50727 at_status=$? at_failed=false
   50728 $at_check_filter
   50729 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50730 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50731 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50732 $at_failed && at_fn_log_failure
   50733 $at_traceon; }
   50734 
   50735 
   50736 { set +x
   50737 $as_echo "$at_srcdir/conflicts.at:143: \$BISON_C_WORKS"
   50738 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:143"
   50739 ( $at_check_trace; $BISON_C_WORKS
   50740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50741 at_status=$? at_failed=false
   50742 $at_check_filter
   50743 echo stderr:; cat "$at_stderr"
   50744 echo stdout:; cat "$at_stdout"
   50745 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50746 $at_failed && at_fn_log_failure
   50747 $at_traceon; }
   50748 
   50749 { set +x
   50750 $as_echo "$at_srcdir/conflicts.at:143: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   50751 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:143"
   50752 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   50753 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50754 at_status=$? at_failed=false
   50755 $at_check_filter
   50756 echo stderr:; cat "$at_stderr"
   50757 echo stdout:; cat "$at_stdout"
   50758 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50759 $at_failed && at_fn_log_failure
   50760 $at_traceon; }
   50761 
   50762 
   50763 
   50764 
   50765 { set +x
   50766 $as_echo "$at_srcdir/conflicts.at:143:  \$PREPARSER ./input '0<0'"
   50767 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:143"
   50768 ( $at_check_trace;  $PREPARSER ./input '0<0'
   50769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50770 at_status=$? at_failed=false
   50771 $at_check_filter
   50772 echo stderr:; tee stderr <"$at_stderr"
   50773 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50774 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50775 $at_failed && at_fn_log_failure
   50776 $at_traceon; }
   50777 
   50778 { set +x
   50779 $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50780 at_fn_check_prepare_trace "conflicts.at:143"
   50781 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50783 at_status=$? at_failed=false
   50784 $at_check_filter
   50785 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50786 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50787 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50788 $at_failed && at_fn_log_failure
   50789 $at_traceon; }
   50790 
   50791 
   50792 { set +x
   50793 $as_echo "$at_srcdir/conflicts.at:143:  \$PREPARSER ./input '0<0<0'"
   50794 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:143"
   50795 ( $at_check_trace;  $PREPARSER ./input '0<0<0'
   50796 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50797 at_status=$? at_failed=false
   50798 $at_check_filter
   50799 echo stderr:; tee stderr <"$at_stderr"
   50800 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50801 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143"
   50802 $at_failed && at_fn_log_failure
   50803 $at_traceon; }
   50804 
   50805 { set +x
   50806 $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50807 at_fn_check_prepare_trace "conflicts.at:143"
   50808 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50809 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50810 at_status=$? at_failed=false
   50811 $at_check_filter
   50812 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end
   50813 " | \
   50814   $at_diff - "$at_stderr" || at_failed=:
   50815 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50816 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50817 $at_failed && at_fn_log_failure
   50818 $at_traceon; }
   50819 
   50820 
   50821 
   50822 { set +x
   50823 $as_echo "$at_srcdir/conflicts.at:143:  \$PREPARSER ./input '0>0'"
   50824 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:143"
   50825 ( $at_check_trace;  $PREPARSER ./input '0>0'
   50826 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50827 at_status=$? at_failed=false
   50828 $at_check_filter
   50829 echo stderr:; tee stderr <"$at_stderr"
   50830 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50831 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50832 $at_failed && at_fn_log_failure
   50833 $at_traceon; }
   50834 
   50835 { set +x
   50836 $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50837 at_fn_check_prepare_trace "conflicts.at:143"
   50838 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50839 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50840 at_status=$? at_failed=false
   50841 $at_check_filter
   50842 at_fn_diff_devnull "$at_stderr" || at_failed=:
   50843 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50844 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50845 $at_failed && at_fn_log_failure
   50846 $at_traceon; }
   50847 
   50848 
   50849 { set +x
   50850 $as_echo "$at_srcdir/conflicts.at:143:  \$PREPARSER ./input '0>0>0'"
   50851 at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:143"
   50852 ( $at_check_trace;  $PREPARSER ./input '0>0>0'
   50853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50854 at_status=$? at_failed=false
   50855 $at_check_filter
   50856 echo stderr:; tee stderr <"$at_stderr"
   50857 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50858 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143"
   50859 $at_failed && at_fn_log_failure
   50860 $at_traceon; }
   50861 
   50862 { set +x
   50863 $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50864 at_fn_check_prepare_trace "conflicts.at:143"
   50865 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50866 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50867 at_status=$? at_failed=false
   50868 $at_check_filter
   50869 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
   50870 " | \
   50871   $at_diff - "$at_stderr" || at_failed=:
   50872 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50873 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50874 $at_failed && at_fn_log_failure
   50875 $at_traceon; }
   50876 
   50877 
   50878 
   50879 { set +x
   50880 $as_echo "$at_srcdir/conflicts.at:143:  \$PREPARSER ./input '0<0>0'"
   50881 at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:143"
   50882 ( $at_check_trace;  $PREPARSER ./input '0<0>0'
   50883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50884 at_status=$? at_failed=false
   50885 $at_check_filter
   50886 echo stderr:; tee stderr <"$at_stderr"
   50887 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50888 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143"
   50889 $at_failed && at_fn_log_failure
   50890 $at_traceon; }
   50891 
   50892 { set +x
   50893 $as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   50894 at_fn_check_prepare_trace "conflicts.at:143"
   50895 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   50896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   50897 at_status=$? at_failed=false
   50898 $at_check_filter
   50899 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end
   50900 " | \
   50901   $at_diff - "$at_stderr" || at_failed=:
   50902 at_fn_diff_devnull "$at_stdout" || at_failed=:
   50903 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143"
   50904 $at_failed && at_fn_log_failure
   50905 $at_traceon; }
   50906 
   50907 
   50908 
   50909 
   50910 
   50911 
   50912 
   50913   set +x
   50914   $at_times_p && times >"$at_times_file"
   50915 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   50916 read at_status <"$at_status_file"
   50917 #AT_STOP_182
   50918 #AT_START_183
   50919 at_fn_group_banner 183 'conflicts.at:155' \
   50920   "%error-verbose and consistent errors" "           " 10
   50921 at_xfail=no
   50922 (
   50923   $as_echo "183. $at_setup_line: testing $at_desc ..."
   50924   $at_traceon
   50925 
   50926 
   50927 
   50928 
   50929 
   50930 
   50931 
   50932 
   50933 # Unfortunately, no expected tokens are reported even though 'b' can be
   50934 # accepted.  Nevertheless, the main point of this test is to make sure
   50935 # that at least the unexpected token is reported.  In a previous version
   50936 # of Bison, it wasn't reported because the error is detected in a
   50937 # consistent state with an error action, and that case always triggered
   50938 # the simple "syntax error" message.
   50939 #
   50940 # The point isn't to test IELR here, but state merging happens to
   50941 # complicate this example.
   50942 
   50943 
   50944 
   50945 
   50946 
   50947 
   50948 cat >input.y <<'_ATEOF'
   50949 %code top {
   50950 #include <config.h>
   50951 /* We don't need perfect functions for these tests. */
   50952 #undef malloc
   50953 #undef memcmp
   50954 #undef realloc
   50955 }
   50956 
   50957 
   50958 
   50959 %code {
   50960   #include <assert.h>
   50961   #include <stdio.h>
   50962   static void yyerror ( const char *msg);
   50963   int yylex (YYSTYPE *lvalp);
   50964   #define USE(Var)
   50965 }
   50966 
   50967 %define api.pure
   50968 
   50969 %define lr.type ielr
   50970 
   50971 %error-verbose
   50972 
   50973 %%
   50974 
   50975 %nonassoc 'a';
   50976 
   50977 start: consistent-error-on-a-a 'a' ;
   50978 
   50979 consistent-error-on-a-a:
   50980     'a' default-reduction
   50981   | 'a' default-reduction 'a'
   50982   | 'a' shift
   50983   ;
   50984 
   50985 default-reduction: /*empty*/ ;
   50986 shift: 'b' ;
   50987 
   50988 // Provide another context in which all rules are useful so that this
   50989 // test case looks a little more realistic.
   50990 start: 'b' consistent-error-on-a-a 'c' ;
   50991 
   50992 
   50993 %%
   50994 
   50995 /*--------.
   50996 | yylex.  |
   50997 `--------*/
   50998 
   50999 int yylex (YYSTYPE *lvalp)
   51000 {
   51001   static char const *input = "a";
   51002   *lvalp = 1;
   51003   return *input++;
   51004 }
   51005 #include <stdio.h>
   51006 /* A C error reporting function.  */
   51007 static
   51008 void yyerror ( const char *msg)
   51009 {
   51010   fprintf (stderr, "%s\n", msg);
   51011 }
   51012 
   51013 
   51014 /*-------.
   51015 | main.  |
   51016 `-------*/
   51017 
   51018 int
   51019 main (void)
   51020 {
   51021   return yyparse ();
   51022 }
   51023 _ATEOF
   51024 
   51025 
   51026 
   51027 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   51028   at_save_special_files
   51029   mkdir xml-tests
   51030     # Don't combine these Bison invocations since we want to be sure that
   51031   # --report=all isn't required to get the full XML file.
   51032   { set +x
   51033 $as_echo "$at_srcdir/conflicts.at:299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   51034                   --graph=xml-tests/test.dot -o input.c input.y"
   51035 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:299"
   51036 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   51037                   --graph=xml-tests/test.dot -o input.c input.y
   51038 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51039 at_status=$? at_failed=false
   51040 $at_check_filter
   51041 echo stderr:; cat "$at_stderr"
   51042 echo stdout:; cat "$at_stdout"
   51043 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51044 $at_failed && at_fn_log_failure
   51045 $at_traceon; }
   51046 
   51047   { set +x
   51048 $as_echo "$at_srcdir/conflicts.at:299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   51049 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:299"
   51050 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   51051 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51052 at_status=$? at_failed=false
   51053 $at_check_filter
   51054 echo stderr:; cat "$at_stderr"
   51055 echo stdout:; cat "$at_stdout"
   51056 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51057 $at_failed && at_fn_log_failure
   51058 $at_traceon; }
   51059 
   51060     cp xml-tests/test.output expout
   51061   { set +x
   51062 $as_echo "$at_srcdir/conflicts.at:299: \$XSLTPROC \\
   51063              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   51064              xml-tests/test.xml"
   51065 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:299"
   51066 ( $at_check_trace; $XSLTPROC \
   51067              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   51068              xml-tests/test.xml
   51069 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51070 at_status=$? at_failed=false
   51071 $at_check_filter
   51072 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51073 $at_diff expout "$at_stdout" || at_failed=:
   51074 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51075 $at_failed && at_fn_log_failure
   51076 $at_traceon; }
   51077 
   51078   sort xml-tests/test.dot > expout
   51079   { set +x
   51080 $as_echo "$at_srcdir/conflicts.at:299: \$XSLTPROC \\
   51081              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   51082              xml-tests/test.xml | sort"
   51083 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:299"
   51084 ( $at_check_trace; $XSLTPROC \
   51085              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   51086              xml-tests/test.xml | sort
   51087 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51088 at_status=$? at_failed=false
   51089 $at_check_filter
   51090 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51091 $at_diff expout "$at_stdout" || at_failed=:
   51092 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51093 $at_failed && at_fn_log_failure
   51094 $at_traceon; }
   51095 
   51096   rm -rf xml-tests expout
   51097   at_restore_special_files
   51098 fi
   51099 { set +x
   51100 $as_echo "$at_srcdir/conflicts.at:299: bison -o input.c input.y"
   51101 at_fn_check_prepare_trace "conflicts.at:299"
   51102 ( $at_check_trace; bison -o input.c input.y
   51103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51104 at_status=$? at_failed=false
   51105 $at_check_filter
   51106 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51107 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51108 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51109 $at_failed && at_fn_log_failure
   51110 $at_traceon; }
   51111 
   51112 
   51113    { set +x
   51114 $as_echo "$at_srcdir/conflicts.at:299: \$BISON_C_WORKS"
   51115 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:299"
   51116 ( $at_check_trace; $BISON_C_WORKS
   51117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51118 at_status=$? at_failed=false
   51119 $at_check_filter
   51120 echo stderr:; cat "$at_stderr"
   51121 echo stdout:; cat "$at_stdout"
   51122 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51123 $at_failed && at_fn_log_failure
   51124 $at_traceon; }
   51125 
   51126 { set +x
   51127 $as_echo "$at_srcdir/conflicts.at:299: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   51128 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:299"
   51129 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   51130 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51131 at_status=$? at_failed=false
   51132 $at_check_filter
   51133 echo stderr:; cat "$at_stderr"
   51134 echo stdout:; cat "$at_stdout"
   51135 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51136 $at_failed && at_fn_log_failure
   51137 $at_traceon; }
   51138 
   51139 
   51140 
   51141 
   51142 
   51143 { set +x
   51144 $as_echo "$at_srcdir/conflicts.at:299:  \$PREPARSER ./input"
   51145 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:299"
   51146 ( $at_check_trace;  $PREPARSER ./input
   51147 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51148 at_status=$? at_failed=false
   51149 $at_check_filter
   51150 echo stderr:; tee stderr <"$at_stderr"
   51151 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51152 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:299"
   51153 $at_failed && at_fn_log_failure
   51154 $at_traceon; }
   51155 
   51156 { set +x
   51157 $as_echo "$at_srcdir/conflicts.at:299: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   51158 at_fn_check_prepare_trace "conflicts.at:299"
   51159 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   51160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51161 at_status=$? at_failed=false
   51162 $at_check_filter
   51163 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
   51164 " | \
   51165   $at_diff - "$at_stderr" || at_failed=:
   51166 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51167 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:299"
   51168 $at_failed && at_fn_log_failure
   51169 $at_traceon; }
   51170 
   51171 
   51172 
   51173 
   51174 
   51175 
   51176 
   51177 
   51178 
   51179 
   51180 
   51181 
   51182 
   51183 
   51184 cat >input.y <<'_ATEOF'
   51185 %code top {
   51186 #include <config.h>
   51187 /* We don't need perfect functions for these tests. */
   51188 #undef malloc
   51189 #undef memcmp
   51190 #undef realloc
   51191 }
   51192 
   51193 
   51194 
   51195 %code {
   51196   #include <assert.h>
   51197   #include <stdio.h>
   51198   static void yyerror ( const char *msg);
   51199   int yylex (YYSTYPE *lvalp);
   51200   #define USE(Var)
   51201 }
   51202 
   51203 %define api.pure
   51204 
   51205 %define lr.type ielr
   51206                              %glr-parser
   51207 
   51208 %error-verbose
   51209 
   51210 %%
   51211 
   51212 %nonassoc 'a';
   51213 
   51214 start: consistent-error-on-a-a 'a' ;
   51215 
   51216 consistent-error-on-a-a:
   51217     'a' default-reduction
   51218   | 'a' default-reduction 'a'
   51219   | 'a' shift
   51220   ;
   51221 
   51222 default-reduction: /*empty*/ ;
   51223 shift: 'b' ;
   51224 
   51225 // Provide another context in which all rules are useful so that this
   51226 // test case looks a little more realistic.
   51227 start: 'b' consistent-error-on-a-a 'c' ;
   51228 
   51229 
   51230 %%
   51231 
   51232 /*--------.
   51233 | yylex.  |
   51234 `--------*/
   51235 
   51236 int yylex (YYSTYPE *lvalp)
   51237 {
   51238   static char const *input = "a";
   51239   *lvalp = 1;
   51240   return *input++;
   51241 }
   51242 #include <stdio.h>
   51243 /* A C error reporting function.  */
   51244 static
   51245 void yyerror ( const char *msg)
   51246 {
   51247   fprintf (stderr, "%s\n", msg);
   51248 }
   51249 
   51250 
   51251 /*-------.
   51252 | main.  |
   51253 `-------*/
   51254 
   51255 int
   51256 main (void)
   51257 {
   51258   return yyparse ();
   51259 }
   51260 _ATEOF
   51261 
   51262 
   51263 
   51264 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   51265   at_save_special_files
   51266   mkdir xml-tests
   51267     # Don't combine these Bison invocations since we want to be sure that
   51268   # --report=all isn't required to get the full XML file.
   51269   { set +x
   51270 $as_echo "$at_srcdir/conflicts.at:303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   51271                   --graph=xml-tests/test.dot -o input.c input.y"
   51272 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:303"
   51273 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   51274                   --graph=xml-tests/test.dot -o input.c input.y
   51275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51276 at_status=$? at_failed=false
   51277 $at_check_filter
   51278 echo stderr:; cat "$at_stderr"
   51279 echo stdout:; cat "$at_stdout"
   51280 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51281 $at_failed && at_fn_log_failure
   51282 $at_traceon; }
   51283 
   51284   { set +x
   51285 $as_echo "$at_srcdir/conflicts.at:303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   51286 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:303"
   51287 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   51288 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51289 at_status=$? at_failed=false
   51290 $at_check_filter
   51291 echo stderr:; cat "$at_stderr"
   51292 echo stdout:; cat "$at_stdout"
   51293 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51294 $at_failed && at_fn_log_failure
   51295 $at_traceon; }
   51296 
   51297     cp xml-tests/test.output expout
   51298   { set +x
   51299 $as_echo "$at_srcdir/conflicts.at:303: \$XSLTPROC \\
   51300              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   51301              xml-tests/test.xml"
   51302 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:303"
   51303 ( $at_check_trace; $XSLTPROC \
   51304              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   51305              xml-tests/test.xml
   51306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51307 at_status=$? at_failed=false
   51308 $at_check_filter
   51309 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51310 $at_diff expout "$at_stdout" || at_failed=:
   51311 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51312 $at_failed && at_fn_log_failure
   51313 $at_traceon; }
   51314 
   51315   sort xml-tests/test.dot > expout
   51316   { set +x
   51317 $as_echo "$at_srcdir/conflicts.at:303: \$XSLTPROC \\
   51318              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   51319              xml-tests/test.xml | sort"
   51320 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:303"
   51321 ( $at_check_trace; $XSLTPROC \
   51322              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   51323              xml-tests/test.xml | sort
   51324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51325 at_status=$? at_failed=false
   51326 $at_check_filter
   51327 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51328 $at_diff expout "$at_stdout" || at_failed=:
   51329 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51330 $at_failed && at_fn_log_failure
   51331 $at_traceon; }
   51332 
   51333   rm -rf xml-tests expout
   51334   at_restore_special_files
   51335 fi
   51336 { set +x
   51337 $as_echo "$at_srcdir/conflicts.at:303: bison -o input.c input.y"
   51338 at_fn_check_prepare_trace "conflicts.at:303"
   51339 ( $at_check_trace; bison -o input.c input.y
   51340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51341 at_status=$? at_failed=false
   51342 $at_check_filter
   51343 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51344 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51345 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51346 $at_failed && at_fn_log_failure
   51347 $at_traceon; }
   51348 
   51349 
   51350    { set +x
   51351 $as_echo "$at_srcdir/conflicts.at:303: \$BISON_C_WORKS"
   51352 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:303"
   51353 ( $at_check_trace; $BISON_C_WORKS
   51354 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51355 at_status=$? at_failed=false
   51356 $at_check_filter
   51357 echo stderr:; cat "$at_stderr"
   51358 echo stdout:; cat "$at_stdout"
   51359 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51360 $at_failed && at_fn_log_failure
   51361 $at_traceon; }
   51362 
   51363 { set +x
   51364 $as_echo "$at_srcdir/conflicts.at:303: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   51365 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:303"
   51366 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   51367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51368 at_status=$? at_failed=false
   51369 $at_check_filter
   51370 echo stderr:; cat "$at_stderr"
   51371 echo stdout:; cat "$at_stdout"
   51372 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51373 $at_failed && at_fn_log_failure
   51374 $at_traceon; }
   51375 
   51376 
   51377 
   51378 
   51379 
   51380 { set +x
   51381 $as_echo "$at_srcdir/conflicts.at:303:  \$PREPARSER ./input"
   51382 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:303"
   51383 ( $at_check_trace;  $PREPARSER ./input
   51384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51385 at_status=$? at_failed=false
   51386 $at_check_filter
   51387 echo stderr:; tee stderr <"$at_stderr"
   51388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51389 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:303"
   51390 $at_failed && at_fn_log_failure
   51391 $at_traceon; }
   51392 
   51393 { set +x
   51394 $as_echo "$at_srcdir/conflicts.at:303: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   51395 at_fn_check_prepare_trace "conflicts.at:303"
   51396 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   51397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51398 at_status=$? at_failed=false
   51399 $at_check_filter
   51400 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
   51401 " | \
   51402   $at_diff - "$at_stderr" || at_failed=:
   51403 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51404 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:303"
   51405 $at_failed && at_fn_log_failure
   51406 $at_traceon; }
   51407 
   51408 
   51409 
   51410 
   51411 
   51412 
   51413 
   51414 
   51415 
   51416 
   51417 
   51418 
   51419 
   51420 
   51421 cat >input.y <<'_ATEOF'
   51422 %code top {
   51423 #include <config.h>
   51424 /* We don't need perfect functions for these tests. */
   51425 #undef malloc
   51426 #undef memcmp
   51427 #undef realloc
   51428 }
   51429 
   51430 
   51431 
   51432 %code {
   51433   #include <cassert>
   51434   #include <string>
   51435   int yylex (yy::parser::semantic_type *lvalp);
   51436   #define USE(Var)
   51437 }
   51438 
   51439 %defines
   51440 
   51441 %define lr.type ielr
   51442                              %language "c++"
   51443 
   51444 %error-verbose
   51445 
   51446 %%
   51447 
   51448 %nonassoc 'a';
   51449 
   51450 start: consistent-error-on-a-a 'a' ;
   51451 
   51452 consistent-error-on-a-a:
   51453     'a' default-reduction
   51454   | 'a' default-reduction 'a'
   51455   | 'a' shift
   51456   ;
   51457 
   51458 default-reduction: /*empty*/ ;
   51459 shift: 'b' ;
   51460 
   51461 // Provide another context in which all rules are useful so that this
   51462 // test case looks a little more realistic.
   51463 start: 'b' consistent-error-on-a-a 'c' ;
   51464 
   51465 
   51466 %%
   51467 
   51468 /*--------.
   51469 | yylex.  |
   51470 `--------*/
   51471 
   51472 int yylex (yy::parser::semantic_type *lvalp)
   51473 {
   51474   static char const *input = "a";
   51475   *lvalp = 1;
   51476   return *input++;
   51477 }
   51478 /* A C++ error reporting function.  */
   51479 void
   51480 yy::parser::error (const location_type& l, const std::string& m)
   51481 {
   51482   (void) l;
   51483   std::cerr << m << std::endl;
   51484 }
   51485 
   51486 
   51487 /*-------.
   51488 | main.  |
   51489 `-------*/
   51490 
   51491 int
   51492 main (void)
   51493 {
   51494   yy::parser parser;
   51495   return parser.parse ();
   51496 }
   51497 _ATEOF
   51498 
   51499 
   51500 
   51501 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   51502   at_save_special_files
   51503   mkdir xml-tests
   51504     # Don't combine these Bison invocations since we want to be sure that
   51505   # --report=all isn't required to get the full XML file.
   51506   { set +x
   51507 $as_echo "$at_srcdir/conflicts.at:308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   51508                   --graph=xml-tests/test.dot -o input.cc input.y"
   51509 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:308"
   51510 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   51511                   --graph=xml-tests/test.dot -o input.cc input.y
   51512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51513 at_status=$? at_failed=false
   51514 $at_check_filter
   51515 echo stderr:; cat "$at_stderr"
   51516 echo stdout:; cat "$at_stdout"
   51517 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51518 $at_failed && at_fn_log_failure
   51519 $at_traceon; }
   51520 
   51521   { set +x
   51522 $as_echo "$at_srcdir/conflicts.at:308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   51523 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:308"
   51524 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   51525 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51526 at_status=$? at_failed=false
   51527 $at_check_filter
   51528 echo stderr:; cat "$at_stderr"
   51529 echo stdout:; cat "$at_stdout"
   51530 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51531 $at_failed && at_fn_log_failure
   51532 $at_traceon; }
   51533 
   51534     cp xml-tests/test.output expout
   51535   { set +x
   51536 $as_echo "$at_srcdir/conflicts.at:308: \$XSLTPROC \\
   51537              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   51538              xml-tests/test.xml"
   51539 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:308"
   51540 ( $at_check_trace; $XSLTPROC \
   51541              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   51542              xml-tests/test.xml
   51543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51544 at_status=$? at_failed=false
   51545 $at_check_filter
   51546 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51547 $at_diff expout "$at_stdout" || at_failed=:
   51548 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51549 $at_failed && at_fn_log_failure
   51550 $at_traceon; }
   51551 
   51552   sort xml-tests/test.dot > expout
   51553   { set +x
   51554 $as_echo "$at_srcdir/conflicts.at:308: \$XSLTPROC \\
   51555              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   51556              xml-tests/test.xml | sort"
   51557 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:308"
   51558 ( $at_check_trace; $XSLTPROC \
   51559              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   51560              xml-tests/test.xml | sort
   51561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51562 at_status=$? at_failed=false
   51563 $at_check_filter
   51564 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51565 $at_diff expout "$at_stdout" || at_failed=:
   51566 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51567 $at_failed && at_fn_log_failure
   51568 $at_traceon; }
   51569 
   51570   rm -rf xml-tests expout
   51571   at_restore_special_files
   51572 fi
   51573 { set +x
   51574 $as_echo "$at_srcdir/conflicts.at:308: bison -o input.cc input.y"
   51575 at_fn_check_prepare_trace "conflicts.at:308"
   51576 ( $at_check_trace; bison -o input.cc input.y
   51577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51578 at_status=$? at_failed=false
   51579 $at_check_filter
   51580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51581 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51582 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51583 $at_failed && at_fn_log_failure
   51584 $at_traceon; }
   51585 
   51586 
   51587 
   51588 { set +x
   51589 $as_echo "$at_srcdir/conflicts.at:308: \$BISON_CXX_WORKS"
   51590 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:308"
   51591 ( $at_check_trace; $BISON_CXX_WORKS
   51592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51593 at_status=$? at_failed=false
   51594 $at_check_filter
   51595 echo stderr:; cat "$at_stderr"
   51596 echo stdout:; cat "$at_stdout"
   51597 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51598 $at_failed && at_fn_log_failure
   51599 $at_traceon; }
   51600 
   51601 { set +x
   51602 $as_echo "$at_srcdir/conflicts.at:308: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   51603 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:308"
   51604 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   51605 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51606 at_status=$? at_failed=false
   51607 $at_check_filter
   51608 echo stderr:; cat "$at_stderr"
   51609 echo stdout:; cat "$at_stdout"
   51610 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51611 $at_failed && at_fn_log_failure
   51612 $at_traceon; }
   51613 
   51614 
   51615 
   51616 
   51617 
   51618 { set +x
   51619 $as_echo "$at_srcdir/conflicts.at:308:  \$PREPARSER ./input"
   51620 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:308"
   51621 ( $at_check_trace;  $PREPARSER ./input
   51622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51623 at_status=$? at_failed=false
   51624 $at_check_filter
   51625 echo stderr:; tee stderr <"$at_stderr"
   51626 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51627 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:308"
   51628 $at_failed && at_fn_log_failure
   51629 $at_traceon; }
   51630 
   51631 { set +x
   51632 $as_echo "$at_srcdir/conflicts.at:308: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   51633 at_fn_check_prepare_trace "conflicts.at:308"
   51634 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   51635 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51636 at_status=$? at_failed=false
   51637 $at_check_filter
   51638 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
   51639 " | \
   51640   $at_diff - "$at_stderr" || at_failed=:
   51641 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51642 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:308"
   51643 $at_failed && at_fn_log_failure
   51644 $at_traceon; }
   51645 
   51646 
   51647 
   51648 
   51649 
   51650 
   51651 
   51652 
   51653 
   51654 
   51655 
   51656 
   51657 
   51658 
   51659 cat >input.y <<'_ATEOF'
   51660 
   51661 
   51662 %code imports {
   51663   import java.io.IOException;
   51664 }
   51665 
   51666 %define lr.type ielr
   51667                              %language "java"
   51668 
   51669 %error-verbose
   51670 
   51671 %%
   51672 
   51673 %nonassoc 'a';
   51674 
   51675 start: consistent-error-on-a-a 'a' ;
   51676 
   51677 consistent-error-on-a-a:
   51678     'a' default-reduction
   51679   | 'a' default-reduction 'a'
   51680   | 'a' shift
   51681   ;
   51682 
   51683 default-reduction: /*empty*/ ;
   51684 shift: 'b' ;
   51685 
   51686 // Provide another context in which all rules are useful so that this
   51687 // test case looks a little more realistic.
   51688 start: 'b' consistent-error-on-a-a 'c' ;
   51689 
   51690 
   51691 %code lexer {
   51692 
   51693 /*--------.
   51694 | yylex.  |
   51695 `--------*/
   51696 
   51697 public String input = "a";
   51698 public int index = 0;
   51699 public int yylex ()
   51700 {
   51701   if (index < input.length ())
   51702     return input.charAt (index++);
   51703   else
   51704     return 0;
   51705 }
   51706 public Object getLVal ()
   51707 {
   51708   return new Integer(1);
   51709 }
   51710 
   51711   public void yyerror (String s)
   51712   {
   51713     System.err.println (s);
   51714   }
   51715 
   51716 };
   51717 
   51718 %%
   51719 
   51720 /*-------.
   51721 | main.  |
   51722 `-------*/
   51723 
   51724 class input
   51725 {
   51726   public static void main (String args[]) throws IOException
   51727   {
   51728     YYParser p = new YYParser ();
   51729     p.parse ();
   51730   }
   51731 }
   51732 _ATEOF
   51733 
   51734 
   51735 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   51736   at_save_special_files
   51737   mkdir xml-tests
   51738     # Don't combine these Bison invocations since we want to be sure that
   51739   # --report=all isn't required to get the full XML file.
   51740   { set +x
   51741 $as_echo "$at_srcdir/conflicts.at:313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   51742                   --graph=xml-tests/test.dot -o input.java input.y"
   51743 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:313"
   51744 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   51745                   --graph=xml-tests/test.dot -o input.java input.y
   51746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51747 at_status=$? at_failed=false
   51748 $at_check_filter
   51749 echo stderr:; cat "$at_stderr"
   51750 echo stdout:; cat "$at_stdout"
   51751 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51752 $at_failed && at_fn_log_failure
   51753 $at_traceon; }
   51754 
   51755   { set +x
   51756 $as_echo "$at_srcdir/conflicts.at:313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y"
   51757 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y" "conflicts.at:313"
   51758 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y
   51759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51760 at_status=$? at_failed=false
   51761 $at_check_filter
   51762 echo stderr:; cat "$at_stderr"
   51763 echo stdout:; cat "$at_stdout"
   51764 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51765 $at_failed && at_fn_log_failure
   51766 $at_traceon; }
   51767 
   51768     cp xml-tests/test.output expout
   51769   { set +x
   51770 $as_echo "$at_srcdir/conflicts.at:313: \$XSLTPROC \\
   51771              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   51772              xml-tests/test.xml"
   51773 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:313"
   51774 ( $at_check_trace; $XSLTPROC \
   51775              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   51776              xml-tests/test.xml
   51777 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51778 at_status=$? at_failed=false
   51779 $at_check_filter
   51780 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51781 $at_diff expout "$at_stdout" || at_failed=:
   51782 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51783 $at_failed && at_fn_log_failure
   51784 $at_traceon; }
   51785 
   51786   sort xml-tests/test.dot > expout
   51787   { set +x
   51788 $as_echo "$at_srcdir/conflicts.at:313: \$XSLTPROC \\
   51789              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   51790              xml-tests/test.xml | sort"
   51791 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:313"
   51792 ( $at_check_trace; $XSLTPROC \
   51793              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   51794              xml-tests/test.xml | sort
   51795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51796 at_status=$? at_failed=false
   51797 $at_check_filter
   51798 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51799 $at_diff expout "$at_stdout" || at_failed=:
   51800 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51801 $at_failed && at_fn_log_failure
   51802 $at_traceon; }
   51803 
   51804   rm -rf xml-tests expout
   51805   at_restore_special_files
   51806 fi
   51807 { set +x
   51808 $as_echo "$at_srcdir/conflicts.at:313: bison -o input.java input.y"
   51809 at_fn_check_prepare_trace "conflicts.at:313"
   51810 ( $at_check_trace; bison -o input.java input.y
   51811 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51812 at_status=$? at_failed=false
   51813 $at_check_filter
   51814 at_fn_diff_devnull "$at_stderr" || at_failed=:
   51815 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51816 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51817 $at_failed && at_fn_log_failure
   51818 $at_traceon; }
   51819 
   51820 
   51821 
   51822 $as_echo "conflicts.at:313" >"$at_check_line_file"
   51823 (test -z "$CONF_JAVAC") \
   51824   && at_fn_check_skip 77 "$at_srcdir/conflicts.at:313"
   51825 $as_echo "conflicts.at:313" >"$at_check_line_file"
   51826 (test -z "$CONF_JAVA") \
   51827   && at_fn_check_skip 77 "$at_srcdir/conflicts.at:313"
   51828 { set +x
   51829 $as_echo "$at_srcdir/conflicts.at:313: \$SHELL ../../../javacomp.sh input.java"
   51830 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "conflicts.at:313"
   51831 ( $at_check_trace; $SHELL ../../../javacomp.sh input.java
   51832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51833 at_status=$? at_failed=false
   51834 $at_check_filter
   51835 echo stderr:; cat "$at_stderr"
   51836 echo stdout:; cat "$at_stdout"
   51837 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51838 $at_failed && at_fn_log_failure
   51839 $at_traceon; }
   51840 
   51841 
   51842 
   51843 
   51844 
   51845 { set +x
   51846 $as_echo "$at_srcdir/conflicts.at:313:  \$SHELL ../../../javaexec.sh input"
   51847 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "conflicts.at:313"
   51848 ( $at_check_trace;  $SHELL ../../../javaexec.sh input
   51849 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51850 at_status=$? at_failed=false
   51851 $at_check_filter
   51852 echo >>"$at_stderr"; $as_echo "syntax error, unexpected end of input
   51853 " | \
   51854   $at_diff - "$at_stderr" || at_failed=:
   51855 at_fn_diff_devnull "$at_stdout" || at_failed=:
   51856 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:313"
   51857 $at_failed && at_fn_log_failure
   51858 $at_traceon; }
   51859 
   51860 
   51861 
   51862 
   51863 
   51864 
   51865 
   51866 
   51867 # Even canonical LR doesn't foresee the error for 'a'!
   51868 
   51869 
   51870 
   51871 
   51872 
   51873 
   51874 cat >input.y <<'_ATEOF'
   51875 %code top {
   51876 #include <config.h>
   51877 /* We don't need perfect functions for these tests. */
   51878 #undef malloc
   51879 #undef memcmp
   51880 #undef realloc
   51881 }
   51882 
   51883 
   51884 
   51885 %code {
   51886   #include <assert.h>
   51887   #include <stdio.h>
   51888   static void yyerror ( const char *msg);
   51889   int yylex (YYSTYPE *lvalp);
   51890   #define USE(Var)
   51891 }
   51892 
   51893 %define api.pure
   51894 
   51895 %define lr.type ielr
   51896                              %define lr.default-reductions consistent
   51897 
   51898 %error-verbose
   51899 
   51900 %%
   51901 
   51902 %nonassoc 'a';
   51903 
   51904 start: consistent-error-on-a-a 'a' ;
   51905 
   51906 consistent-error-on-a-a:
   51907     'a' default-reduction
   51908   | 'a' default-reduction 'a'
   51909   | 'a' shift
   51910   ;
   51911 
   51912 default-reduction: /*empty*/ ;
   51913 shift: 'b' ;
   51914 
   51915 // Provide another context in which all rules are useful so that this
   51916 // test case looks a little more realistic.
   51917 start: 'b' consistent-error-on-a-a 'c' ;
   51918 
   51919 
   51920 %%
   51921 
   51922 /*--------.
   51923 | yylex.  |
   51924 `--------*/
   51925 
   51926 int yylex (YYSTYPE *lvalp)
   51927 {
   51928   static char const *input = "a";
   51929   *lvalp = 1;
   51930   return *input++;
   51931 }
   51932 #include <stdio.h>
   51933 /* A C error reporting function.  */
   51934 static
   51935 void yyerror ( const char *msg)
   51936 {
   51937   fprintf (stderr, "%s\n", msg);
   51938 }
   51939 
   51940 
   51941 /*-------.
   51942 | main.  |
   51943 `-------*/
   51944 
   51945 int
   51946 main (void)
   51947 {
   51948   return yyparse ();
   51949 }
   51950 _ATEOF
   51951 
   51952 
   51953 
   51954 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   51955   at_save_special_files
   51956   mkdir xml-tests
   51957     # Don't combine these Bison invocations since we want to be sure that
   51958   # --report=all isn't required to get the full XML file.
   51959   { set +x
   51960 $as_echo "$at_srcdir/conflicts.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   51961                   --graph=xml-tests/test.dot -o input.c input.y"
   51962 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:320"
   51963 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   51964                   --graph=xml-tests/test.dot -o input.c input.y
   51965 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51966 at_status=$? at_failed=false
   51967 $at_check_filter
   51968 echo stderr:; cat "$at_stderr"
   51969 echo stdout:; cat "$at_stdout"
   51970 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   51971 $at_failed && at_fn_log_failure
   51972 $at_traceon; }
   51973 
   51974   { set +x
   51975 $as_echo "$at_srcdir/conflicts.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   51976 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:320"
   51977 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   51978 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51979 at_status=$? at_failed=false
   51980 $at_check_filter
   51981 echo stderr:; cat "$at_stderr"
   51982 echo stdout:; cat "$at_stdout"
   51983 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   51984 $at_failed && at_fn_log_failure
   51985 $at_traceon; }
   51986 
   51987     cp xml-tests/test.output expout
   51988   { set +x
   51989 $as_echo "$at_srcdir/conflicts.at:320: \$XSLTPROC \\
   51990              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   51991              xml-tests/test.xml"
   51992 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:320"
   51993 ( $at_check_trace; $XSLTPROC \
   51994              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   51995              xml-tests/test.xml
   51996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   51997 at_status=$? at_failed=false
   51998 $at_check_filter
   51999 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52000 $at_diff expout "$at_stdout" || at_failed=:
   52001 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   52002 $at_failed && at_fn_log_failure
   52003 $at_traceon; }
   52004 
   52005   sort xml-tests/test.dot > expout
   52006   { set +x
   52007 $as_echo "$at_srcdir/conflicts.at:320: \$XSLTPROC \\
   52008              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   52009              xml-tests/test.xml | sort"
   52010 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:320"
   52011 ( $at_check_trace; $XSLTPROC \
   52012              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   52013              xml-tests/test.xml | sort
   52014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52015 at_status=$? at_failed=false
   52016 $at_check_filter
   52017 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52018 $at_diff expout "$at_stdout" || at_failed=:
   52019 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   52020 $at_failed && at_fn_log_failure
   52021 $at_traceon; }
   52022 
   52023   rm -rf xml-tests expout
   52024   at_restore_special_files
   52025 fi
   52026 { set +x
   52027 $as_echo "$at_srcdir/conflicts.at:320: bison -o input.c input.y"
   52028 at_fn_check_prepare_trace "conflicts.at:320"
   52029 ( $at_check_trace; bison -o input.c input.y
   52030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52031 at_status=$? at_failed=false
   52032 $at_check_filter
   52033 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52034 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52035 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   52036 $at_failed && at_fn_log_failure
   52037 $at_traceon; }
   52038 
   52039 
   52040    { set +x
   52041 $as_echo "$at_srcdir/conflicts.at:320: \$BISON_C_WORKS"
   52042 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:320"
   52043 ( $at_check_trace; $BISON_C_WORKS
   52044 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52045 at_status=$? at_failed=false
   52046 $at_check_filter
   52047 echo stderr:; cat "$at_stderr"
   52048 echo stdout:; cat "$at_stdout"
   52049 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   52050 $at_failed && at_fn_log_failure
   52051 $at_traceon; }
   52052 
   52053 { set +x
   52054 $as_echo "$at_srcdir/conflicts.at:320: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   52055 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:320"
   52056 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   52057 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52058 at_status=$? at_failed=false
   52059 $at_check_filter
   52060 echo stderr:; cat "$at_stderr"
   52061 echo stdout:; cat "$at_stdout"
   52062 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   52063 $at_failed && at_fn_log_failure
   52064 $at_traceon; }
   52065 
   52066 
   52067 
   52068 
   52069 
   52070 { set +x
   52071 $as_echo "$at_srcdir/conflicts.at:320:  \$PREPARSER ./input"
   52072 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:320"
   52073 ( $at_check_trace;  $PREPARSER ./input
   52074 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52075 at_status=$? at_failed=false
   52076 $at_check_filter
   52077 echo stderr:; tee stderr <"$at_stderr"
   52078 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52079 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:320"
   52080 $at_failed && at_fn_log_failure
   52081 $at_traceon; }
   52082 
   52083 { set +x
   52084 $as_echo "$at_srcdir/conflicts.at:320: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   52085 at_fn_check_prepare_trace "conflicts.at:320"
   52086 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   52087 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52088 at_status=$? at_failed=false
   52089 $at_check_filter
   52090 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b'
   52091 " | \
   52092   $at_diff - "$at_stderr" || at_failed=:
   52093 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52094 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:320"
   52095 $at_failed && at_fn_log_failure
   52096 $at_traceon; }
   52097 
   52098 
   52099 
   52100 
   52101 
   52102 
   52103 
   52104 
   52105 
   52106 
   52107 
   52108 
   52109 
   52110 
   52111 cat >input.y <<'_ATEOF'
   52112 %code top {
   52113 #include <config.h>
   52114 /* We don't need perfect functions for these tests. */
   52115 #undef malloc
   52116 #undef memcmp
   52117 #undef realloc
   52118 }
   52119 
   52120 
   52121 
   52122 %code {
   52123   #include <assert.h>
   52124   #include <stdio.h>
   52125   static void yyerror ( const char *msg);
   52126   int yylex (YYSTYPE *lvalp);
   52127   #define USE(Var)
   52128 }
   52129 
   52130 %define api.pure
   52131 
   52132 %define lr.type ielr
   52133                              %define lr.default-reductions accepting
   52134 
   52135 %error-verbose
   52136 
   52137 %%
   52138 
   52139 %nonassoc 'a';
   52140 
   52141 start: consistent-error-on-a-a 'a' ;
   52142 
   52143 consistent-error-on-a-a:
   52144     'a' default-reduction
   52145   | 'a' default-reduction 'a'
   52146   | 'a' shift
   52147   ;
   52148 
   52149 default-reduction: /*empty*/ ;
   52150 shift: 'b' ;
   52151 
   52152 // Provide another context in which all rules are useful so that this
   52153 // test case looks a little more realistic.
   52154 start: 'b' consistent-error-on-a-a 'c' ;
   52155 
   52156 
   52157 %%
   52158 
   52159 /*--------.
   52160 | yylex.  |
   52161 `--------*/
   52162 
   52163 int yylex (YYSTYPE *lvalp)
   52164 {
   52165   static char const *input = "a";
   52166   *lvalp = 1;
   52167   return *input++;
   52168 }
   52169 #include <stdio.h>
   52170 /* A C error reporting function.  */
   52171 static
   52172 void yyerror ( const char *msg)
   52173 {
   52174   fprintf (stderr, "%s\n", msg);
   52175 }
   52176 
   52177 
   52178 /*-------.
   52179 | main.  |
   52180 `-------*/
   52181 
   52182 int
   52183 main (void)
   52184 {
   52185   return yyparse ();
   52186 }
   52187 _ATEOF
   52188 
   52189 
   52190 
   52191 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   52192   at_save_special_files
   52193   mkdir xml-tests
   52194     # Don't combine these Bison invocations since we want to be sure that
   52195   # --report=all isn't required to get the full XML file.
   52196   { set +x
   52197 $as_echo "$at_srcdir/conflicts.at:325: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   52198                   --graph=xml-tests/test.dot -o input.c input.y"
   52199 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:325"
   52200 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   52201                   --graph=xml-tests/test.dot -o input.c input.y
   52202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52203 at_status=$? at_failed=false
   52204 $at_check_filter
   52205 echo stderr:; cat "$at_stderr"
   52206 echo stdout:; cat "$at_stdout"
   52207 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52208 $at_failed && at_fn_log_failure
   52209 $at_traceon; }
   52210 
   52211   { set +x
   52212 $as_echo "$at_srcdir/conflicts.at:325: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   52213 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:325"
   52214 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   52215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52216 at_status=$? at_failed=false
   52217 $at_check_filter
   52218 echo stderr:; cat "$at_stderr"
   52219 echo stdout:; cat "$at_stdout"
   52220 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52221 $at_failed && at_fn_log_failure
   52222 $at_traceon; }
   52223 
   52224     cp xml-tests/test.output expout
   52225   { set +x
   52226 $as_echo "$at_srcdir/conflicts.at:325: \$XSLTPROC \\
   52227              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   52228              xml-tests/test.xml"
   52229 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:325"
   52230 ( $at_check_trace; $XSLTPROC \
   52231              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   52232              xml-tests/test.xml
   52233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52234 at_status=$? at_failed=false
   52235 $at_check_filter
   52236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52237 $at_diff expout "$at_stdout" || at_failed=:
   52238 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52239 $at_failed && at_fn_log_failure
   52240 $at_traceon; }
   52241 
   52242   sort xml-tests/test.dot > expout
   52243   { set +x
   52244 $as_echo "$at_srcdir/conflicts.at:325: \$XSLTPROC \\
   52245              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   52246              xml-tests/test.xml | sort"
   52247 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:325"
   52248 ( $at_check_trace; $XSLTPROC \
   52249              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   52250              xml-tests/test.xml | sort
   52251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52252 at_status=$? at_failed=false
   52253 $at_check_filter
   52254 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52255 $at_diff expout "$at_stdout" || at_failed=:
   52256 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52257 $at_failed && at_fn_log_failure
   52258 $at_traceon; }
   52259 
   52260   rm -rf xml-tests expout
   52261   at_restore_special_files
   52262 fi
   52263 { set +x
   52264 $as_echo "$at_srcdir/conflicts.at:325: bison -o input.c input.y"
   52265 at_fn_check_prepare_trace "conflicts.at:325"
   52266 ( $at_check_trace; bison -o input.c input.y
   52267 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52268 at_status=$? at_failed=false
   52269 $at_check_filter
   52270 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52271 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52272 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52273 $at_failed && at_fn_log_failure
   52274 $at_traceon; }
   52275 
   52276 
   52277    { set +x
   52278 $as_echo "$at_srcdir/conflicts.at:325: \$BISON_C_WORKS"
   52279 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:325"
   52280 ( $at_check_trace; $BISON_C_WORKS
   52281 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52282 at_status=$? at_failed=false
   52283 $at_check_filter
   52284 echo stderr:; cat "$at_stderr"
   52285 echo stdout:; cat "$at_stdout"
   52286 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52287 $at_failed && at_fn_log_failure
   52288 $at_traceon; }
   52289 
   52290 { set +x
   52291 $as_echo "$at_srcdir/conflicts.at:325: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   52292 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:325"
   52293 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   52294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52295 at_status=$? at_failed=false
   52296 $at_check_filter
   52297 echo stderr:; cat "$at_stderr"
   52298 echo stdout:; cat "$at_stdout"
   52299 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52300 $at_failed && at_fn_log_failure
   52301 $at_traceon; }
   52302 
   52303 
   52304 
   52305 
   52306 
   52307 { set +x
   52308 $as_echo "$at_srcdir/conflicts.at:325:  \$PREPARSER ./input"
   52309 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:325"
   52310 ( $at_check_trace;  $PREPARSER ./input
   52311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52312 at_status=$? at_failed=false
   52313 $at_check_filter
   52314 echo stderr:; tee stderr <"$at_stderr"
   52315 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52316 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:325"
   52317 $at_failed && at_fn_log_failure
   52318 $at_traceon; }
   52319 
   52320 { set +x
   52321 $as_echo "$at_srcdir/conflicts.at:325: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   52322 at_fn_check_prepare_trace "conflicts.at:325"
   52323 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   52324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52325 at_status=$? at_failed=false
   52326 $at_check_filter
   52327 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b'
   52328 " | \
   52329   $at_diff - "$at_stderr" || at_failed=:
   52330 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52331 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:325"
   52332 $at_failed && at_fn_log_failure
   52333 $at_traceon; }
   52334 
   52335 
   52336 
   52337 
   52338 
   52339 
   52340 
   52341 
   52342 
   52343 
   52344 
   52345 
   52346 
   52347 
   52348 cat >input.y <<'_ATEOF'
   52349 %code top {
   52350 #include <config.h>
   52351 /* We don't need perfect functions for these tests. */
   52352 #undef malloc
   52353 #undef memcmp
   52354 #undef realloc
   52355 }
   52356 
   52357 
   52358 
   52359 %code {
   52360   #include <assert.h>
   52361   #include <stdio.h>
   52362   static void yyerror ( const char *msg);
   52363   int yylex (YYSTYPE *lvalp);
   52364   #define USE(Var)
   52365 }
   52366 
   52367 %define api.pure
   52368 
   52369 %define lr.type canonical-lr
   52370 
   52371 %error-verbose
   52372 
   52373 %%
   52374 
   52375 %nonassoc 'a';
   52376 
   52377 start: consistent-error-on-a-a 'a' ;
   52378 
   52379 consistent-error-on-a-a:
   52380     'a' default-reduction
   52381   | 'a' default-reduction 'a'
   52382   | 'a' shift
   52383   ;
   52384 
   52385 default-reduction: /*empty*/ ;
   52386 shift: 'b' ;
   52387 
   52388 // Provide another context in which all rules are useful so that this
   52389 // test case looks a little more realistic.
   52390 start: 'b' consistent-error-on-a-a 'c' ;
   52391 
   52392 
   52393 %%
   52394 
   52395 /*--------.
   52396 | yylex.  |
   52397 `--------*/
   52398 
   52399 int yylex (YYSTYPE *lvalp)
   52400 {
   52401   static char const *input = "a";
   52402   *lvalp = 1;
   52403   return *input++;
   52404 }
   52405 #include <stdio.h>
   52406 /* A C error reporting function.  */
   52407 static
   52408 void yyerror ( const char *msg)
   52409 {
   52410   fprintf (stderr, "%s\n", msg);
   52411 }
   52412 
   52413 
   52414 /*-------.
   52415 | main.  |
   52416 `-------*/
   52417 
   52418 int
   52419 main (void)
   52420 {
   52421   return yyparse ();
   52422 }
   52423 _ATEOF
   52424 
   52425 
   52426 
   52427 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   52428   at_save_special_files
   52429   mkdir xml-tests
   52430     # Don't combine these Bison invocations since we want to be sure that
   52431   # --report=all isn't required to get the full XML file.
   52432   { set +x
   52433 $as_echo "$at_srcdir/conflicts.at:330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   52434                   --graph=xml-tests/test.dot -o input.c input.y"
   52435 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:330"
   52436 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   52437                   --graph=xml-tests/test.dot -o input.c input.y
   52438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52439 at_status=$? at_failed=false
   52440 $at_check_filter
   52441 echo stderr:; cat "$at_stderr"
   52442 echo stdout:; cat "$at_stdout"
   52443 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52444 $at_failed && at_fn_log_failure
   52445 $at_traceon; }
   52446 
   52447   { set +x
   52448 $as_echo "$at_srcdir/conflicts.at:330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   52449 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:330"
   52450 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   52451 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52452 at_status=$? at_failed=false
   52453 $at_check_filter
   52454 echo stderr:; cat "$at_stderr"
   52455 echo stdout:; cat "$at_stdout"
   52456 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52457 $at_failed && at_fn_log_failure
   52458 $at_traceon; }
   52459 
   52460     cp xml-tests/test.output expout
   52461   { set +x
   52462 $as_echo "$at_srcdir/conflicts.at:330: \$XSLTPROC \\
   52463              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   52464              xml-tests/test.xml"
   52465 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:330"
   52466 ( $at_check_trace; $XSLTPROC \
   52467              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   52468              xml-tests/test.xml
   52469 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52470 at_status=$? at_failed=false
   52471 $at_check_filter
   52472 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52473 $at_diff expout "$at_stdout" || at_failed=:
   52474 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52475 $at_failed && at_fn_log_failure
   52476 $at_traceon; }
   52477 
   52478   sort xml-tests/test.dot > expout
   52479   { set +x
   52480 $as_echo "$at_srcdir/conflicts.at:330: \$XSLTPROC \\
   52481              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   52482              xml-tests/test.xml | sort"
   52483 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:330"
   52484 ( $at_check_trace; $XSLTPROC \
   52485              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   52486              xml-tests/test.xml | sort
   52487 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52488 at_status=$? at_failed=false
   52489 $at_check_filter
   52490 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52491 $at_diff expout "$at_stdout" || at_failed=:
   52492 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52493 $at_failed && at_fn_log_failure
   52494 $at_traceon; }
   52495 
   52496   rm -rf xml-tests expout
   52497   at_restore_special_files
   52498 fi
   52499 { set +x
   52500 $as_echo "$at_srcdir/conflicts.at:330: bison -o input.c input.y"
   52501 at_fn_check_prepare_trace "conflicts.at:330"
   52502 ( $at_check_trace; bison -o input.c input.y
   52503 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52504 at_status=$? at_failed=false
   52505 $at_check_filter
   52506 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52507 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52508 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52509 $at_failed && at_fn_log_failure
   52510 $at_traceon; }
   52511 
   52512 
   52513    { set +x
   52514 $as_echo "$at_srcdir/conflicts.at:330: \$BISON_C_WORKS"
   52515 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:330"
   52516 ( $at_check_trace; $BISON_C_WORKS
   52517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52518 at_status=$? at_failed=false
   52519 $at_check_filter
   52520 echo stderr:; cat "$at_stderr"
   52521 echo stdout:; cat "$at_stdout"
   52522 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52523 $at_failed && at_fn_log_failure
   52524 $at_traceon; }
   52525 
   52526 { set +x
   52527 $as_echo "$at_srcdir/conflicts.at:330: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   52528 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:330"
   52529 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   52530 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52531 at_status=$? at_failed=false
   52532 $at_check_filter
   52533 echo stderr:; cat "$at_stderr"
   52534 echo stdout:; cat "$at_stdout"
   52535 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52536 $at_failed && at_fn_log_failure
   52537 $at_traceon; }
   52538 
   52539 
   52540 
   52541 
   52542 
   52543 { set +x
   52544 $as_echo "$at_srcdir/conflicts.at:330:  \$PREPARSER ./input"
   52545 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:330"
   52546 ( $at_check_trace;  $PREPARSER ./input
   52547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52548 at_status=$? at_failed=false
   52549 $at_check_filter
   52550 echo stderr:; tee stderr <"$at_stderr"
   52551 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52552 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:330"
   52553 $at_failed && at_fn_log_failure
   52554 $at_traceon; }
   52555 
   52556 { set +x
   52557 $as_echo "$at_srcdir/conflicts.at:330: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   52558 at_fn_check_prepare_trace "conflicts.at:330"
   52559 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   52560 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52561 at_status=$? at_failed=false
   52562 $at_check_filter
   52563 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b'
   52564 " | \
   52565   $at_diff - "$at_stderr" || at_failed=:
   52566 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52567 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:330"
   52568 $at_failed && at_fn_log_failure
   52569 $at_traceon; }
   52570 
   52571 
   52572 
   52573 
   52574 
   52575 
   52576 
   52577 
   52578 
   52579 # Only LAC gets it right.
   52580 
   52581 
   52582 
   52583 
   52584 
   52585 
   52586 cat >input.y <<'_ATEOF'
   52587 %code top {
   52588 #include <config.h>
   52589 /* We don't need perfect functions for these tests. */
   52590 #undef malloc
   52591 #undef memcmp
   52592 #undef realloc
   52593 }
   52594 
   52595 
   52596 
   52597 %code {
   52598   #include <assert.h>
   52599   #include <stdio.h>
   52600   static void yyerror ( const char *msg);
   52601   int yylex (YYSTYPE *lvalp);
   52602   #define USE(Var)
   52603 }
   52604 
   52605 %define api.pure
   52606 
   52607 %define lr.type canonical-lr
   52608                              %define parse.lac full
   52609 
   52610 %error-verbose
   52611 
   52612 %%
   52613 
   52614 %nonassoc 'a';
   52615 
   52616 start: consistent-error-on-a-a 'a' ;
   52617 
   52618 consistent-error-on-a-a:
   52619     'a' default-reduction
   52620   | 'a' default-reduction 'a'
   52621   | 'a' shift
   52622   ;
   52623 
   52624 default-reduction: /*empty*/ ;
   52625 shift: 'b' ;
   52626 
   52627 // Provide another context in which all rules are useful so that this
   52628 // test case looks a little more realistic.
   52629 start: 'b' consistent-error-on-a-a 'c' ;
   52630 
   52631 
   52632 %%
   52633 
   52634 /*--------.
   52635 | yylex.  |
   52636 `--------*/
   52637 
   52638 int yylex (YYSTYPE *lvalp)
   52639 {
   52640   static char const *input = "a";
   52641   *lvalp = 1;
   52642   return *input++;
   52643 }
   52644 #include <stdio.h>
   52645 /* A C error reporting function.  */
   52646 static
   52647 void yyerror ( const char *msg)
   52648 {
   52649   fprintf (stderr, "%s\n", msg);
   52650 }
   52651 
   52652 
   52653 /*-------.
   52654 | main.  |
   52655 `-------*/
   52656 
   52657 int
   52658 main (void)
   52659 {
   52660   return yyparse ();
   52661 }
   52662 _ATEOF
   52663 
   52664 
   52665 
   52666 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   52667   at_save_special_files
   52668   mkdir xml-tests
   52669     # Don't combine these Bison invocations since we want to be sure that
   52670   # --report=all isn't required to get the full XML file.
   52671   { set +x
   52672 $as_echo "$at_srcdir/conflicts.at:336: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   52673                   --graph=xml-tests/test.dot -o input.c input.y"
   52674 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:336"
   52675 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   52676                   --graph=xml-tests/test.dot -o input.c input.y
   52677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52678 at_status=$? at_failed=false
   52679 $at_check_filter
   52680 echo stderr:; cat "$at_stderr"
   52681 echo stdout:; cat "$at_stdout"
   52682 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52683 $at_failed && at_fn_log_failure
   52684 $at_traceon; }
   52685 
   52686   { set +x
   52687 $as_echo "$at_srcdir/conflicts.at:336: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   52688 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:336"
   52689 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   52690 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52691 at_status=$? at_failed=false
   52692 $at_check_filter
   52693 echo stderr:; cat "$at_stderr"
   52694 echo stdout:; cat "$at_stdout"
   52695 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52696 $at_failed && at_fn_log_failure
   52697 $at_traceon; }
   52698 
   52699     cp xml-tests/test.output expout
   52700   { set +x
   52701 $as_echo "$at_srcdir/conflicts.at:336: \$XSLTPROC \\
   52702              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   52703              xml-tests/test.xml"
   52704 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:336"
   52705 ( $at_check_trace; $XSLTPROC \
   52706              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   52707              xml-tests/test.xml
   52708 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52709 at_status=$? at_failed=false
   52710 $at_check_filter
   52711 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52712 $at_diff expout "$at_stdout" || at_failed=:
   52713 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52714 $at_failed && at_fn_log_failure
   52715 $at_traceon; }
   52716 
   52717   sort xml-tests/test.dot > expout
   52718   { set +x
   52719 $as_echo "$at_srcdir/conflicts.at:336: \$XSLTPROC \\
   52720              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   52721              xml-tests/test.xml | sort"
   52722 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:336"
   52723 ( $at_check_trace; $XSLTPROC \
   52724              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   52725              xml-tests/test.xml | sort
   52726 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52727 at_status=$? at_failed=false
   52728 $at_check_filter
   52729 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52730 $at_diff expout "$at_stdout" || at_failed=:
   52731 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52732 $at_failed && at_fn_log_failure
   52733 $at_traceon; }
   52734 
   52735   rm -rf xml-tests expout
   52736   at_restore_special_files
   52737 fi
   52738 { set +x
   52739 $as_echo "$at_srcdir/conflicts.at:336: bison -o input.c input.y"
   52740 at_fn_check_prepare_trace "conflicts.at:336"
   52741 ( $at_check_trace; bison -o input.c input.y
   52742 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52743 at_status=$? at_failed=false
   52744 $at_check_filter
   52745 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52746 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52747 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52748 $at_failed && at_fn_log_failure
   52749 $at_traceon; }
   52750 
   52751 
   52752    { set +x
   52753 $as_echo "$at_srcdir/conflicts.at:336: \$BISON_C_WORKS"
   52754 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:336"
   52755 ( $at_check_trace; $BISON_C_WORKS
   52756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52757 at_status=$? at_failed=false
   52758 $at_check_filter
   52759 echo stderr:; cat "$at_stderr"
   52760 echo stdout:; cat "$at_stdout"
   52761 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52762 $at_failed && at_fn_log_failure
   52763 $at_traceon; }
   52764 
   52765 { set +x
   52766 $as_echo "$at_srcdir/conflicts.at:336: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   52767 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:336"
   52768 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   52769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52770 at_status=$? at_failed=false
   52771 $at_check_filter
   52772 echo stderr:; cat "$at_stderr"
   52773 echo stdout:; cat "$at_stdout"
   52774 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52775 $at_failed && at_fn_log_failure
   52776 $at_traceon; }
   52777 
   52778 
   52779 
   52780 
   52781 
   52782 { set +x
   52783 $as_echo "$at_srcdir/conflicts.at:336:  \$PREPARSER ./input"
   52784 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:336"
   52785 ( $at_check_trace;  $PREPARSER ./input
   52786 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52787 at_status=$? at_failed=false
   52788 $at_check_filter
   52789 echo stderr:; tee stderr <"$at_stderr"
   52790 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52791 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:336"
   52792 $at_failed && at_fn_log_failure
   52793 $at_traceon; }
   52794 
   52795 { set +x
   52796 $as_echo "$at_srcdir/conflicts.at:336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   52797 at_fn_check_prepare_trace "conflicts.at:336"
   52798 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   52799 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52800 at_status=$? at_failed=false
   52801 $at_check_filter
   52802 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b'
   52803 " | \
   52804   $at_diff - "$at_stderr" || at_failed=:
   52805 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52806 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:336"
   52807 $at_failed && at_fn_log_failure
   52808 $at_traceon; }
   52809 
   52810 
   52811 
   52812 
   52813 
   52814 
   52815 
   52816 
   52817 
   52818 
   52819 
   52820 
   52821 
   52822 
   52823 cat >input.y <<'_ATEOF'
   52824 %code top {
   52825 #include <config.h>
   52826 /* We don't need perfect functions for these tests. */
   52827 #undef malloc
   52828 #undef memcmp
   52829 #undef realloc
   52830 }
   52831 
   52832 
   52833 
   52834 %code {
   52835   #include <assert.h>
   52836   #include <stdio.h>
   52837   static void yyerror ( const char *msg);
   52838   int yylex (YYSTYPE *lvalp);
   52839   #define USE(Var)
   52840 }
   52841 
   52842 %define api.pure
   52843 
   52844 %define lr.type ielr
   52845                              %define parse.lac full
   52846 
   52847 %error-verbose
   52848 
   52849 %%
   52850 
   52851 %nonassoc 'a';
   52852 
   52853 start: consistent-error-on-a-a 'a' ;
   52854 
   52855 consistent-error-on-a-a:
   52856     'a' default-reduction
   52857   | 'a' default-reduction 'a'
   52858   | 'a' shift
   52859   ;
   52860 
   52861 default-reduction: /*empty*/ ;
   52862 shift: 'b' ;
   52863 
   52864 // Provide another context in which all rules are useful so that this
   52865 // test case looks a little more realistic.
   52866 start: 'b' consistent-error-on-a-a 'c' ;
   52867 
   52868 
   52869 %%
   52870 
   52871 /*--------.
   52872 | yylex.  |
   52873 `--------*/
   52874 
   52875 int yylex (YYSTYPE *lvalp)
   52876 {
   52877   static char const *input = "a";
   52878   *lvalp = 1;
   52879   return *input++;
   52880 }
   52881 #include <stdio.h>
   52882 /* A C error reporting function.  */
   52883 static
   52884 void yyerror ( const char *msg)
   52885 {
   52886   fprintf (stderr, "%s\n", msg);
   52887 }
   52888 
   52889 
   52890 /*-------.
   52891 | main.  |
   52892 `-------*/
   52893 
   52894 int
   52895 main (void)
   52896 {
   52897   return yyparse ();
   52898 }
   52899 _ATEOF
   52900 
   52901 
   52902 
   52903 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   52904   at_save_special_files
   52905   mkdir xml-tests
   52906     # Don't combine these Bison invocations since we want to be sure that
   52907   # --report=all isn't required to get the full XML file.
   52908   { set +x
   52909 $as_echo "$at_srcdir/conflicts.at:341: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   52910                   --graph=xml-tests/test.dot -o input.c input.y"
   52911 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:341"
   52912 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   52913                   --graph=xml-tests/test.dot -o input.c input.y
   52914 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52915 at_status=$? at_failed=false
   52916 $at_check_filter
   52917 echo stderr:; cat "$at_stderr"
   52918 echo stdout:; cat "$at_stdout"
   52919 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   52920 $at_failed && at_fn_log_failure
   52921 $at_traceon; }
   52922 
   52923   { set +x
   52924 $as_echo "$at_srcdir/conflicts.at:341: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   52925 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:341"
   52926 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   52927 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52928 at_status=$? at_failed=false
   52929 $at_check_filter
   52930 echo stderr:; cat "$at_stderr"
   52931 echo stdout:; cat "$at_stdout"
   52932 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   52933 $at_failed && at_fn_log_failure
   52934 $at_traceon; }
   52935 
   52936     cp xml-tests/test.output expout
   52937   { set +x
   52938 $as_echo "$at_srcdir/conflicts.at:341: \$XSLTPROC \\
   52939              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   52940              xml-tests/test.xml"
   52941 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:341"
   52942 ( $at_check_trace; $XSLTPROC \
   52943              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   52944              xml-tests/test.xml
   52945 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52946 at_status=$? at_failed=false
   52947 $at_check_filter
   52948 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52949 $at_diff expout "$at_stdout" || at_failed=:
   52950 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   52951 $at_failed && at_fn_log_failure
   52952 $at_traceon; }
   52953 
   52954   sort xml-tests/test.dot > expout
   52955   { set +x
   52956 $as_echo "$at_srcdir/conflicts.at:341: \$XSLTPROC \\
   52957              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   52958              xml-tests/test.xml | sort"
   52959 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:341"
   52960 ( $at_check_trace; $XSLTPROC \
   52961              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   52962              xml-tests/test.xml | sort
   52963 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52964 at_status=$? at_failed=false
   52965 $at_check_filter
   52966 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52967 $at_diff expout "$at_stdout" || at_failed=:
   52968 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   52969 $at_failed && at_fn_log_failure
   52970 $at_traceon; }
   52971 
   52972   rm -rf xml-tests expout
   52973   at_restore_special_files
   52974 fi
   52975 { set +x
   52976 $as_echo "$at_srcdir/conflicts.at:341: bison -o input.c input.y"
   52977 at_fn_check_prepare_trace "conflicts.at:341"
   52978 ( $at_check_trace; bison -o input.c input.y
   52979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52980 at_status=$? at_failed=false
   52981 $at_check_filter
   52982 at_fn_diff_devnull "$at_stderr" || at_failed=:
   52983 at_fn_diff_devnull "$at_stdout" || at_failed=:
   52984 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   52985 $at_failed && at_fn_log_failure
   52986 $at_traceon; }
   52987 
   52988 
   52989    { set +x
   52990 $as_echo "$at_srcdir/conflicts.at:341: \$BISON_C_WORKS"
   52991 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:341"
   52992 ( $at_check_trace; $BISON_C_WORKS
   52993 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   52994 at_status=$? at_failed=false
   52995 $at_check_filter
   52996 echo stderr:; cat "$at_stderr"
   52997 echo stdout:; cat "$at_stdout"
   52998 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   52999 $at_failed && at_fn_log_failure
   53000 $at_traceon; }
   53001 
   53002 { set +x
   53003 $as_echo "$at_srcdir/conflicts.at:341: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   53004 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:341"
   53005 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   53006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53007 at_status=$? at_failed=false
   53008 $at_check_filter
   53009 echo stderr:; cat "$at_stderr"
   53010 echo stdout:; cat "$at_stdout"
   53011 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   53012 $at_failed && at_fn_log_failure
   53013 $at_traceon; }
   53014 
   53015 
   53016 
   53017 
   53018 
   53019 { set +x
   53020 $as_echo "$at_srcdir/conflicts.at:341:  \$PREPARSER ./input"
   53021 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:341"
   53022 ( $at_check_trace;  $PREPARSER ./input
   53023 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53024 at_status=$? at_failed=false
   53025 $at_check_filter
   53026 echo stderr:; tee stderr <"$at_stderr"
   53027 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53028 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:341"
   53029 $at_failed && at_fn_log_failure
   53030 $at_traceon; }
   53031 
   53032 { set +x
   53033 $as_echo "$at_srcdir/conflicts.at:341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   53034 at_fn_check_prepare_trace "conflicts.at:341"
   53035 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   53036 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53037 at_status=$? at_failed=false
   53038 $at_check_filter
   53039 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b'
   53040 " | \
   53041   $at_diff - "$at_stderr" || at_failed=:
   53042 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53043 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:341"
   53044 $at_failed && at_fn_log_failure
   53045 $at_traceon; }
   53046 
   53047 
   53048 
   53049 
   53050 
   53051 
   53052 
   53053 
   53054 
   53055 
   53056 
   53057 
   53058 
   53059 
   53060 
   53061 
   53062 
   53063 
   53064 
   53065 
   53066 
   53067 cat >input.y <<'_ATEOF'
   53068 %code top {
   53069 #include <config.h>
   53070 /* We don't need perfect functions for these tests. */
   53071 #undef malloc
   53072 #undef memcmp
   53073 #undef realloc
   53074 }
   53075 
   53076 
   53077 
   53078 %code {
   53079   #include <assert.h>
   53080   #include <stdio.h>
   53081   static void yyerror ( const char *msg);
   53082   int yylex (YYSTYPE *lvalp);
   53083   #define USE(Var)
   53084 }
   53085 
   53086 %define api.pure
   53087 
   53088 
   53089 
   53090 %error-verbose
   53091 
   53092 %%
   53093 
   53094 %nonassoc 'a';
   53095 
   53096 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   53097 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   53098 // tokens are returned by yylex, which sets $$ = 1.
   53099 %destructor {
   53100   if (!$$)
   53101     fprintf (stderr, "Wrong destructor.\n");
   53102 } 'a';
   53103 
   53104 // Rather than depend on an inconsistent state to induce reading a
   53105 // lookahead as in the previous grammar, just assign the lookahead in a
   53106 // semantic action.  That lookahead isn't needed before either error
   53107 // action is encountered.  In a previous version of Bison, this was a
   53108 // problem as it meant yychar was not translated into yytoken before
   53109 // either error action.  The second error action thus invoked a
   53110 // destructor that it selected according to the incorrect yytoken.  The
   53111 // first error action would have reported an incorrect unexpected token
   53112 // except that, due to the bug described in the previous grammar, the
   53113 // unexpected token was not reported at all.
   53114 start: error-reduce consistent-error 'a' { USE ($3); } ;
   53115 
   53116 error-reduce:
   53117   'a' 'a' consistent-reduction consistent-error 'a'
   53118   { USE (($1, $2, $5)); }
   53119 | 'a' error
   53120   { USE ($1); }
   53121 ;
   53122 
   53123 consistent-reduction: /*empty*/ {
   53124   assert (yychar == YYEMPTY);
   53125   yylval = 0;
   53126   yychar = 'b';
   53127 } ;
   53128 
   53129 consistent-error:
   53130   'a' { USE ($1); }
   53131 | /*empty*/ %prec 'a'
   53132 ;
   53133 
   53134 // Provide another context in which all rules are useful so that this
   53135 // test case looks a little more realistic.
   53136 start: 'b' consistent-error 'b' ;
   53137 
   53138 
   53139 %%
   53140 
   53141 /*--------.
   53142 | yylex.  |
   53143 `--------*/
   53144 
   53145 int yylex (YYSTYPE *lvalp)
   53146 {
   53147   static char const *input = "aa";
   53148   *lvalp = 1;
   53149   return *input++;
   53150 }
   53151 #include <stdio.h>
   53152 /* A C error reporting function.  */
   53153 static
   53154 void yyerror ( const char *msg)
   53155 {
   53156   fprintf (stderr, "%s\n", msg);
   53157 }
   53158 
   53159 
   53160 /*-------.
   53161 | main.  |
   53162 `-------*/
   53163 
   53164 int
   53165 main (void)
   53166 {
   53167   return yyparse ();
   53168 }
   53169 _ATEOF
   53170 
   53171 
   53172 
   53173 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   53174   at_save_special_files
   53175   mkdir xml-tests
   53176     # Don't combine these Bison invocations since we want to be sure that
   53177   # --report=all isn't required to get the full XML file.
   53178   { set +x
   53179 $as_echo "$at_srcdir/conflicts.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   53180                   --graph=xml-tests/test.dot -o input.c input.y"
   53181 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:397"
   53182 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   53183                   --graph=xml-tests/test.dot -o input.c input.y
   53184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53185 at_status=$? at_failed=false
   53186 $at_check_filter
   53187 echo stderr:; cat "$at_stderr"
   53188 echo stdout:; cat "$at_stdout"
   53189 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53190 $at_failed && at_fn_log_failure
   53191 $at_traceon; }
   53192 
   53193   { set +x
   53194 $as_echo "$at_srcdir/conflicts.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   53195 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:397"
   53196 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   53197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53198 at_status=$? at_failed=false
   53199 $at_check_filter
   53200 echo stderr:; cat "$at_stderr"
   53201 echo stdout:; cat "$at_stdout"
   53202 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53203 $at_failed && at_fn_log_failure
   53204 $at_traceon; }
   53205 
   53206     cp xml-tests/test.output expout
   53207   { set +x
   53208 $as_echo "$at_srcdir/conflicts.at:397: \$XSLTPROC \\
   53209              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   53210              xml-tests/test.xml"
   53211 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:397"
   53212 ( $at_check_trace; $XSLTPROC \
   53213              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   53214              xml-tests/test.xml
   53215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53216 at_status=$? at_failed=false
   53217 $at_check_filter
   53218 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53219 $at_diff expout "$at_stdout" || at_failed=:
   53220 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53221 $at_failed && at_fn_log_failure
   53222 $at_traceon; }
   53223 
   53224   sort xml-tests/test.dot > expout
   53225   { set +x
   53226 $as_echo "$at_srcdir/conflicts.at:397: \$XSLTPROC \\
   53227              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   53228              xml-tests/test.xml | sort"
   53229 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:397"
   53230 ( $at_check_trace; $XSLTPROC \
   53231              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   53232              xml-tests/test.xml | sort
   53233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53234 at_status=$? at_failed=false
   53235 $at_check_filter
   53236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53237 $at_diff expout "$at_stdout" || at_failed=:
   53238 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53239 $at_failed && at_fn_log_failure
   53240 $at_traceon; }
   53241 
   53242   rm -rf xml-tests expout
   53243   at_restore_special_files
   53244 fi
   53245 { set +x
   53246 $as_echo "$at_srcdir/conflicts.at:397: bison -o input.c input.y"
   53247 at_fn_check_prepare_trace "conflicts.at:397"
   53248 ( $at_check_trace; bison -o input.c input.y
   53249 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53250 at_status=$? at_failed=false
   53251 $at_check_filter
   53252 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53253 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53254 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53255 $at_failed && at_fn_log_failure
   53256 $at_traceon; }
   53257 
   53258 
   53259    { set +x
   53260 $as_echo "$at_srcdir/conflicts.at:397: \$BISON_C_WORKS"
   53261 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:397"
   53262 ( $at_check_trace; $BISON_C_WORKS
   53263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53264 at_status=$? at_failed=false
   53265 $at_check_filter
   53266 echo stderr:; cat "$at_stderr"
   53267 echo stdout:; cat "$at_stdout"
   53268 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53269 $at_failed && at_fn_log_failure
   53270 $at_traceon; }
   53271 
   53272 { set +x
   53273 $as_echo "$at_srcdir/conflicts.at:397: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   53274 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:397"
   53275 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   53276 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53277 at_status=$? at_failed=false
   53278 $at_check_filter
   53279 echo stderr:; cat "$at_stderr"
   53280 echo stdout:; cat "$at_stdout"
   53281 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53282 $at_failed && at_fn_log_failure
   53283 $at_traceon; }
   53284 
   53285 
   53286 
   53287 
   53288 
   53289 { set +x
   53290 $as_echo "$at_srcdir/conflicts.at:397:  \$PREPARSER ./input"
   53291 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:397"
   53292 ( $at_check_trace;  $PREPARSER ./input
   53293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53294 at_status=$? at_failed=false
   53295 $at_check_filter
   53296 echo stderr:; tee stderr <"$at_stderr"
   53297 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53298 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:397"
   53299 $at_failed && at_fn_log_failure
   53300 $at_traceon; }
   53301 
   53302 { set +x
   53303 $as_echo "$at_srcdir/conflicts.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   53304 at_fn_check_prepare_trace "conflicts.at:397"
   53305 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   53306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53307 at_status=$? at_failed=false
   53308 $at_check_filter
   53309 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
   53310 " | \
   53311   $at_diff - "$at_stderr" || at_failed=:
   53312 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53313 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:397"
   53314 $at_failed && at_fn_log_failure
   53315 $at_traceon; }
   53316 
   53317 
   53318 
   53319 
   53320 
   53321 
   53322 
   53323 
   53324 
   53325 
   53326 
   53327 
   53328 
   53329 
   53330 cat >input.y <<'_ATEOF'
   53331 %code top {
   53332 #include <config.h>
   53333 /* We don't need perfect functions for these tests. */
   53334 #undef malloc
   53335 #undef memcmp
   53336 #undef realloc
   53337 }
   53338 
   53339 
   53340 
   53341 %code {
   53342   #include <assert.h>
   53343   #include <stdio.h>
   53344   static void yyerror ( const char *msg);
   53345   int yylex (YYSTYPE *lvalp);
   53346   #define USE(Var)
   53347 }
   53348 
   53349 %define api.pure
   53350 
   53351 %glr-parser
   53352 
   53353 %error-verbose
   53354 
   53355 %%
   53356 
   53357 %nonassoc 'a';
   53358 
   53359 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   53360 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   53361 // tokens are returned by yylex, which sets $$ = 1.
   53362 %destructor {
   53363   if (!$$)
   53364     fprintf (stderr, "Wrong destructor.\n");
   53365 } 'a';
   53366 
   53367 // Rather than depend on an inconsistent state to induce reading a
   53368 // lookahead as in the previous grammar, just assign the lookahead in a
   53369 // semantic action.  That lookahead isn't needed before either error
   53370 // action is encountered.  In a previous version of Bison, this was a
   53371 // problem as it meant yychar was not translated into yytoken before
   53372 // either error action.  The second error action thus invoked a
   53373 // destructor that it selected according to the incorrect yytoken.  The
   53374 // first error action would have reported an incorrect unexpected token
   53375 // except that, due to the bug described in the previous grammar, the
   53376 // unexpected token was not reported at all.
   53377 start: error-reduce consistent-error 'a' { USE ($3); } ;
   53378 
   53379 error-reduce:
   53380   'a' 'a' consistent-reduction consistent-error 'a'
   53381   { USE (($1, $2, $5)); }
   53382 | 'a' error
   53383   { USE ($1); }
   53384 ;
   53385 
   53386 consistent-reduction: /*empty*/ {
   53387   assert (yychar == YYEMPTY);
   53388   yylval = 0;
   53389   yychar = 'b';
   53390 } ;
   53391 
   53392 consistent-error:
   53393   'a' { USE ($1); }
   53394 | /*empty*/ %prec 'a'
   53395 ;
   53396 
   53397 // Provide another context in which all rules are useful so that this
   53398 // test case looks a little more realistic.
   53399 start: 'b' consistent-error 'b' ;
   53400 
   53401 
   53402 %%
   53403 
   53404 /*--------.
   53405 | yylex.  |
   53406 `--------*/
   53407 
   53408 int yylex (YYSTYPE *lvalp)
   53409 {
   53410   static char const *input = "aa";
   53411   *lvalp = 1;
   53412   return *input++;
   53413 }
   53414 #include <stdio.h>
   53415 /* A C error reporting function.  */
   53416 static
   53417 void yyerror ( const char *msg)
   53418 {
   53419   fprintf (stderr, "%s\n", msg);
   53420 }
   53421 
   53422 
   53423 /*-------.
   53424 | main.  |
   53425 `-------*/
   53426 
   53427 int
   53428 main (void)
   53429 {
   53430   return yyparse ();
   53431 }
   53432 _ATEOF
   53433 
   53434 
   53435 
   53436 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   53437   at_save_special_files
   53438   mkdir xml-tests
   53439     # Don't combine these Bison invocations since we want to be sure that
   53440   # --report=all isn't required to get the full XML file.
   53441   { set +x
   53442 $as_echo "$at_srcdir/conflicts.at:401: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   53443                   --graph=xml-tests/test.dot -o input.c input.y"
   53444 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:401"
   53445 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   53446                   --graph=xml-tests/test.dot -o input.c input.y
   53447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53448 at_status=$? at_failed=false
   53449 $at_check_filter
   53450 echo stderr:; cat "$at_stderr"
   53451 echo stdout:; cat "$at_stdout"
   53452 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53453 $at_failed && at_fn_log_failure
   53454 $at_traceon; }
   53455 
   53456   { set +x
   53457 $as_echo "$at_srcdir/conflicts.at:401: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   53458 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:401"
   53459 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   53460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53461 at_status=$? at_failed=false
   53462 $at_check_filter
   53463 echo stderr:; cat "$at_stderr"
   53464 echo stdout:; cat "$at_stdout"
   53465 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53466 $at_failed && at_fn_log_failure
   53467 $at_traceon; }
   53468 
   53469     cp xml-tests/test.output expout
   53470   { set +x
   53471 $as_echo "$at_srcdir/conflicts.at:401: \$XSLTPROC \\
   53472              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   53473              xml-tests/test.xml"
   53474 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:401"
   53475 ( $at_check_trace; $XSLTPROC \
   53476              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   53477              xml-tests/test.xml
   53478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53479 at_status=$? at_failed=false
   53480 $at_check_filter
   53481 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53482 $at_diff expout "$at_stdout" || at_failed=:
   53483 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53484 $at_failed && at_fn_log_failure
   53485 $at_traceon; }
   53486 
   53487   sort xml-tests/test.dot > expout
   53488   { set +x
   53489 $as_echo "$at_srcdir/conflicts.at:401: \$XSLTPROC \\
   53490              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   53491              xml-tests/test.xml | sort"
   53492 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:401"
   53493 ( $at_check_trace; $XSLTPROC \
   53494              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   53495              xml-tests/test.xml | sort
   53496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53497 at_status=$? at_failed=false
   53498 $at_check_filter
   53499 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53500 $at_diff expout "$at_stdout" || at_failed=:
   53501 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53502 $at_failed && at_fn_log_failure
   53503 $at_traceon; }
   53504 
   53505   rm -rf xml-tests expout
   53506   at_restore_special_files
   53507 fi
   53508 { set +x
   53509 $as_echo "$at_srcdir/conflicts.at:401: bison -o input.c input.y"
   53510 at_fn_check_prepare_trace "conflicts.at:401"
   53511 ( $at_check_trace; bison -o input.c input.y
   53512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53513 at_status=$? at_failed=false
   53514 $at_check_filter
   53515 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53516 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53517 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53518 $at_failed && at_fn_log_failure
   53519 $at_traceon; }
   53520 
   53521 
   53522    { set +x
   53523 $as_echo "$at_srcdir/conflicts.at:401: \$BISON_C_WORKS"
   53524 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:401"
   53525 ( $at_check_trace; $BISON_C_WORKS
   53526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53527 at_status=$? at_failed=false
   53528 $at_check_filter
   53529 echo stderr:; cat "$at_stderr"
   53530 echo stdout:; cat "$at_stdout"
   53531 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53532 $at_failed && at_fn_log_failure
   53533 $at_traceon; }
   53534 
   53535 { set +x
   53536 $as_echo "$at_srcdir/conflicts.at:401: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   53537 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:401"
   53538 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   53539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53540 at_status=$? at_failed=false
   53541 $at_check_filter
   53542 echo stderr:; cat "$at_stderr"
   53543 echo stdout:; cat "$at_stdout"
   53544 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53545 $at_failed && at_fn_log_failure
   53546 $at_traceon; }
   53547 
   53548 
   53549 
   53550 
   53551 
   53552 { set +x
   53553 $as_echo "$at_srcdir/conflicts.at:401:  \$PREPARSER ./input"
   53554 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:401"
   53555 ( $at_check_trace;  $PREPARSER ./input
   53556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53557 at_status=$? at_failed=false
   53558 $at_check_filter
   53559 echo stderr:; tee stderr <"$at_stderr"
   53560 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53561 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:401"
   53562 $at_failed && at_fn_log_failure
   53563 $at_traceon; }
   53564 
   53565 { set +x
   53566 $as_echo "$at_srcdir/conflicts.at:401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   53567 at_fn_check_prepare_trace "conflicts.at:401"
   53568 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   53569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53570 at_status=$? at_failed=false
   53571 $at_check_filter
   53572 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
   53573 " | \
   53574   $at_diff - "$at_stderr" || at_failed=:
   53575 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53576 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:401"
   53577 $at_failed && at_fn_log_failure
   53578 $at_traceon; }
   53579 
   53580 
   53581 
   53582 
   53583 
   53584 
   53585 
   53586 
   53587 
   53588 
   53589 
   53590 
   53591 
   53592 
   53593 cat >input.y <<'_ATEOF'
   53594 %code top {
   53595 #include <config.h>
   53596 /* We don't need perfect functions for these tests. */
   53597 #undef malloc
   53598 #undef memcmp
   53599 #undef realloc
   53600 }
   53601 
   53602 
   53603 
   53604 %code {
   53605   #include <cassert>
   53606   #include <string>
   53607   int yylex (yy::parser::semantic_type *lvalp);
   53608   #define USE(Var)
   53609 }
   53610 
   53611 %defines
   53612 
   53613 %language "c++"
   53614 
   53615 %error-verbose
   53616 
   53617 %%
   53618 
   53619 %nonassoc 'a';
   53620 
   53621 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   53622 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   53623 // tokens are returned by yylex, which sets $$ = 1.
   53624 %destructor {
   53625   if (!$$)
   53626     fprintf (stderr, "Wrong destructor.\n");
   53627 } 'a';
   53628 
   53629 // Rather than depend on an inconsistent state to induce reading a
   53630 // lookahead as in the previous grammar, just assign the lookahead in a
   53631 // semantic action.  That lookahead isn't needed before either error
   53632 // action is encountered.  In a previous version of Bison, this was a
   53633 // problem as it meant yychar was not translated into yytoken before
   53634 // either error action.  The second error action thus invoked a
   53635 // destructor that it selected according to the incorrect yytoken.  The
   53636 // first error action would have reported an incorrect unexpected token
   53637 // except that, due to the bug described in the previous grammar, the
   53638 // unexpected token was not reported at all.
   53639 start: error-reduce consistent-error 'a' { USE ($3); } ;
   53640 
   53641 error-reduce:
   53642   'a' 'a' consistent-reduction consistent-error 'a'
   53643   { USE (($1, $2, $5)); }
   53644 | 'a' error
   53645   { USE ($1); }
   53646 ;
   53647 
   53648 consistent-reduction: /*empty*/ {
   53649   assert (yychar == yyempty_);
   53650   yylval = 0;
   53651   yychar = 'b';
   53652 } ;
   53653 
   53654 consistent-error:
   53655   'a' { USE ($1); }
   53656 | /*empty*/ %prec 'a'
   53657 ;
   53658 
   53659 // Provide another context in which all rules are useful so that this
   53660 // test case looks a little more realistic.
   53661 start: 'b' consistent-error 'b' ;
   53662 
   53663 
   53664 %%
   53665 
   53666 /*--------.
   53667 | yylex.  |
   53668 `--------*/
   53669 
   53670 int yylex (yy::parser::semantic_type *lvalp)
   53671 {
   53672   static char const *input = "aa";
   53673   *lvalp = 1;
   53674   return *input++;
   53675 }
   53676 /* A C++ error reporting function.  */
   53677 void
   53678 yy::parser::error (const location_type& l, const std::string& m)
   53679 {
   53680   (void) l;
   53681   std::cerr << m << std::endl;
   53682 }
   53683 
   53684 
   53685 /*-------.
   53686 | main.  |
   53687 `-------*/
   53688 
   53689 int
   53690 main (void)
   53691 {
   53692   yy::parser parser;
   53693   return parser.parse ();
   53694 }
   53695 _ATEOF
   53696 
   53697 
   53698 
   53699 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   53700   at_save_special_files
   53701   mkdir xml-tests
   53702     # Don't combine these Bison invocations since we want to be sure that
   53703   # --report=all isn't required to get the full XML file.
   53704   { set +x
   53705 $as_echo "$at_srcdir/conflicts.at:405: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   53706                   --graph=xml-tests/test.dot -o input.cc input.y"
   53707 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:405"
   53708 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   53709                   --graph=xml-tests/test.dot -o input.cc input.y
   53710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53711 at_status=$? at_failed=false
   53712 $at_check_filter
   53713 echo stderr:; cat "$at_stderr"
   53714 echo stdout:; cat "$at_stdout"
   53715 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53716 $at_failed && at_fn_log_failure
   53717 $at_traceon; }
   53718 
   53719   { set +x
   53720 $as_echo "$at_srcdir/conflicts.at:405: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   53721 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:405"
   53722 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   53723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53724 at_status=$? at_failed=false
   53725 $at_check_filter
   53726 echo stderr:; cat "$at_stderr"
   53727 echo stdout:; cat "$at_stdout"
   53728 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53729 $at_failed && at_fn_log_failure
   53730 $at_traceon; }
   53731 
   53732     cp xml-tests/test.output expout
   53733   { set +x
   53734 $as_echo "$at_srcdir/conflicts.at:405: \$XSLTPROC \\
   53735              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   53736              xml-tests/test.xml"
   53737 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:405"
   53738 ( $at_check_trace; $XSLTPROC \
   53739              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   53740              xml-tests/test.xml
   53741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53742 at_status=$? at_failed=false
   53743 $at_check_filter
   53744 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53745 $at_diff expout "$at_stdout" || at_failed=:
   53746 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53747 $at_failed && at_fn_log_failure
   53748 $at_traceon; }
   53749 
   53750   sort xml-tests/test.dot > expout
   53751   { set +x
   53752 $as_echo "$at_srcdir/conflicts.at:405: \$XSLTPROC \\
   53753              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   53754              xml-tests/test.xml | sort"
   53755 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:405"
   53756 ( $at_check_trace; $XSLTPROC \
   53757              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   53758              xml-tests/test.xml | sort
   53759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53760 at_status=$? at_failed=false
   53761 $at_check_filter
   53762 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53763 $at_diff expout "$at_stdout" || at_failed=:
   53764 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53765 $at_failed && at_fn_log_failure
   53766 $at_traceon; }
   53767 
   53768   rm -rf xml-tests expout
   53769   at_restore_special_files
   53770 fi
   53771 { set +x
   53772 $as_echo "$at_srcdir/conflicts.at:405: bison -o input.cc input.y"
   53773 at_fn_check_prepare_trace "conflicts.at:405"
   53774 ( $at_check_trace; bison -o input.cc input.y
   53775 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53776 at_status=$? at_failed=false
   53777 $at_check_filter
   53778 at_fn_diff_devnull "$at_stderr" || at_failed=:
   53779 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53780 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53781 $at_failed && at_fn_log_failure
   53782 $at_traceon; }
   53783 
   53784 
   53785 
   53786 { set +x
   53787 $as_echo "$at_srcdir/conflicts.at:405: \$BISON_CXX_WORKS"
   53788 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:405"
   53789 ( $at_check_trace; $BISON_CXX_WORKS
   53790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53791 at_status=$? at_failed=false
   53792 $at_check_filter
   53793 echo stderr:; cat "$at_stderr"
   53794 echo stdout:; cat "$at_stdout"
   53795 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53796 $at_failed && at_fn_log_failure
   53797 $at_traceon; }
   53798 
   53799 { set +x
   53800 $as_echo "$at_srcdir/conflicts.at:405: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   53801 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:405"
   53802 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   53803 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53804 at_status=$? at_failed=false
   53805 $at_check_filter
   53806 echo stderr:; cat "$at_stderr"
   53807 echo stdout:; cat "$at_stdout"
   53808 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53809 $at_failed && at_fn_log_failure
   53810 $at_traceon; }
   53811 
   53812 
   53813 
   53814 
   53815 
   53816 { set +x
   53817 $as_echo "$at_srcdir/conflicts.at:405:  \$PREPARSER ./input"
   53818 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:405"
   53819 ( $at_check_trace;  $PREPARSER ./input
   53820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53821 at_status=$? at_failed=false
   53822 $at_check_filter
   53823 echo stderr:; tee stderr <"$at_stderr"
   53824 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53825 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:405"
   53826 $at_failed && at_fn_log_failure
   53827 $at_traceon; }
   53828 
   53829 { set +x
   53830 $as_echo "$at_srcdir/conflicts.at:405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   53831 at_fn_check_prepare_trace "conflicts.at:405"
   53832 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   53833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53834 at_status=$? at_failed=false
   53835 $at_check_filter
   53836 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
   53837 " | \
   53838   $at_diff - "$at_stderr" || at_failed=:
   53839 at_fn_diff_devnull "$at_stdout" || at_failed=:
   53840 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:405"
   53841 $at_failed && at_fn_log_failure
   53842 $at_traceon; }
   53843 
   53844 
   53845 
   53846 
   53847 
   53848 
   53849 
   53850 
   53851 # No Java test because yychar cannot be manipulated by users.
   53852 
   53853 
   53854 
   53855 
   53856 
   53857 
   53858 
   53859 cat >input.y <<'_ATEOF'
   53860 %code top {
   53861 #include <config.h>
   53862 /* We don't need perfect functions for these tests. */
   53863 #undef malloc
   53864 #undef memcmp
   53865 #undef realloc
   53866 }
   53867 
   53868 
   53869 
   53870 %code {
   53871   #include <assert.h>
   53872   #include <stdio.h>
   53873   static void yyerror ( const char *msg);
   53874   int yylex (YYSTYPE *lvalp);
   53875   #define USE(Var)
   53876 }
   53877 
   53878 %define api.pure
   53879 
   53880 %define lr.default-reductions consistent
   53881 
   53882 %error-verbose
   53883 
   53884 %%
   53885 
   53886 %nonassoc 'a';
   53887 
   53888 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   53889 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   53890 // tokens are returned by yylex, which sets $$ = 1.
   53891 %destructor {
   53892   if (!$$)
   53893     fprintf (stderr, "Wrong destructor.\n");
   53894 } 'a';
   53895 
   53896 // Rather than depend on an inconsistent state to induce reading a
   53897 // lookahead as in the previous grammar, just assign the lookahead in a
   53898 // semantic action.  That lookahead isn't needed before either error
   53899 // action is encountered.  In a previous version of Bison, this was a
   53900 // problem as it meant yychar was not translated into yytoken before
   53901 // either error action.  The second error action thus invoked a
   53902 // destructor that it selected according to the incorrect yytoken.  The
   53903 // first error action would have reported an incorrect unexpected token
   53904 // except that, due to the bug described in the previous grammar, the
   53905 // unexpected token was not reported at all.
   53906 start: error-reduce consistent-error 'a' { USE ($3); } ;
   53907 
   53908 error-reduce:
   53909   'a' 'a' consistent-reduction consistent-error 'a'
   53910   { USE (($1, $2, $5)); }
   53911 | 'a' error
   53912   { USE ($1); }
   53913 ;
   53914 
   53915 consistent-reduction: /*empty*/ {
   53916   assert (yychar == YYEMPTY);
   53917   yylval = 0;
   53918   yychar = 'b';
   53919 } ;
   53920 
   53921 consistent-error:
   53922   'a' { USE ($1); }
   53923 | /*empty*/ %prec 'a'
   53924 ;
   53925 
   53926 // Provide another context in which all rules are useful so that this
   53927 // test case looks a little more realistic.
   53928 start: 'b' consistent-error 'b' ;
   53929 
   53930 
   53931 %%
   53932 
   53933 /*--------.
   53934 | yylex.  |
   53935 `--------*/
   53936 
   53937 int yylex (YYSTYPE *lvalp)
   53938 {
   53939   static char const *input = "aa";
   53940   *lvalp = 1;
   53941   return *input++;
   53942 }
   53943 #include <stdio.h>
   53944 /* A C error reporting function.  */
   53945 static
   53946 void yyerror ( const char *msg)
   53947 {
   53948   fprintf (stderr, "%s\n", msg);
   53949 }
   53950 
   53951 
   53952 /*-------.
   53953 | main.  |
   53954 `-------*/
   53955 
   53956 int
   53957 main (void)
   53958 {
   53959   return yyparse ();
   53960 }
   53961 _ATEOF
   53962 
   53963 
   53964 
   53965 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   53966   at_save_special_files
   53967   mkdir xml-tests
   53968     # Don't combine these Bison invocations since we want to be sure that
   53969   # --report=all isn't required to get the full XML file.
   53970   { set +x
   53971 $as_echo "$at_srcdir/conflicts.at:411: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   53972                   --graph=xml-tests/test.dot -o input.c input.y"
   53973 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:411"
   53974 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   53975                   --graph=xml-tests/test.dot -o input.c input.y
   53976 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53977 at_status=$? at_failed=false
   53978 $at_check_filter
   53979 echo stderr:; cat "$at_stderr"
   53980 echo stdout:; cat "$at_stdout"
   53981 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   53982 $at_failed && at_fn_log_failure
   53983 $at_traceon; }
   53984 
   53985   { set +x
   53986 $as_echo "$at_srcdir/conflicts.at:411: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   53987 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:411"
   53988 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   53989 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   53990 at_status=$? at_failed=false
   53991 $at_check_filter
   53992 echo stderr:; cat "$at_stderr"
   53993 echo stdout:; cat "$at_stdout"
   53994 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   53995 $at_failed && at_fn_log_failure
   53996 $at_traceon; }
   53997 
   53998     cp xml-tests/test.output expout
   53999   { set +x
   54000 $as_echo "$at_srcdir/conflicts.at:411: \$XSLTPROC \\
   54001              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   54002              xml-tests/test.xml"
   54003 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:411"
   54004 ( $at_check_trace; $XSLTPROC \
   54005              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   54006              xml-tests/test.xml
   54007 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54008 at_status=$? at_failed=false
   54009 $at_check_filter
   54010 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54011 $at_diff expout "$at_stdout" || at_failed=:
   54012 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   54013 $at_failed && at_fn_log_failure
   54014 $at_traceon; }
   54015 
   54016   sort xml-tests/test.dot > expout
   54017   { set +x
   54018 $as_echo "$at_srcdir/conflicts.at:411: \$XSLTPROC \\
   54019              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   54020              xml-tests/test.xml | sort"
   54021 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:411"
   54022 ( $at_check_trace; $XSLTPROC \
   54023              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   54024              xml-tests/test.xml | sort
   54025 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54026 at_status=$? at_failed=false
   54027 $at_check_filter
   54028 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54029 $at_diff expout "$at_stdout" || at_failed=:
   54030 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   54031 $at_failed && at_fn_log_failure
   54032 $at_traceon; }
   54033 
   54034   rm -rf xml-tests expout
   54035   at_restore_special_files
   54036 fi
   54037 { set +x
   54038 $as_echo "$at_srcdir/conflicts.at:411: bison -o input.c input.y"
   54039 at_fn_check_prepare_trace "conflicts.at:411"
   54040 ( $at_check_trace; bison -o input.c input.y
   54041 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54042 at_status=$? at_failed=false
   54043 $at_check_filter
   54044 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54045 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54046 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   54047 $at_failed && at_fn_log_failure
   54048 $at_traceon; }
   54049 
   54050 
   54051    { set +x
   54052 $as_echo "$at_srcdir/conflicts.at:411: \$BISON_C_WORKS"
   54053 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:411"
   54054 ( $at_check_trace; $BISON_C_WORKS
   54055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54056 at_status=$? at_failed=false
   54057 $at_check_filter
   54058 echo stderr:; cat "$at_stderr"
   54059 echo stdout:; cat "$at_stdout"
   54060 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   54061 $at_failed && at_fn_log_failure
   54062 $at_traceon; }
   54063 
   54064 { set +x
   54065 $as_echo "$at_srcdir/conflicts.at:411: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   54066 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:411"
   54067 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   54068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54069 at_status=$? at_failed=false
   54070 $at_check_filter
   54071 echo stderr:; cat "$at_stderr"
   54072 echo stdout:; cat "$at_stdout"
   54073 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   54074 $at_failed && at_fn_log_failure
   54075 $at_traceon; }
   54076 
   54077 
   54078 
   54079 
   54080 
   54081 { set +x
   54082 $as_echo "$at_srcdir/conflicts.at:411:  \$PREPARSER ./input"
   54083 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:411"
   54084 ( $at_check_trace;  $PREPARSER ./input
   54085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54086 at_status=$? at_failed=false
   54087 $at_check_filter
   54088 echo stderr:; tee stderr <"$at_stderr"
   54089 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54090 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:411"
   54091 $at_failed && at_fn_log_failure
   54092 $at_traceon; }
   54093 
   54094 { set +x
   54095 $as_echo "$at_srcdir/conflicts.at:411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   54096 at_fn_check_prepare_trace "conflicts.at:411"
   54097 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   54098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54099 at_status=$? at_failed=false
   54100 $at_check_filter
   54101 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
   54102 " | \
   54103   $at_diff - "$at_stderr" || at_failed=:
   54104 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54105 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:411"
   54106 $at_failed && at_fn_log_failure
   54107 $at_traceon; }
   54108 
   54109 
   54110 
   54111 
   54112 
   54113 
   54114 
   54115 
   54116 
   54117 # Canonical LR doesn't foresee the error for 'a'!
   54118 
   54119 
   54120 
   54121 
   54122 
   54123 
   54124 cat >input.y <<'_ATEOF'
   54125 %code top {
   54126 #include <config.h>
   54127 /* We don't need perfect functions for these tests. */
   54128 #undef malloc
   54129 #undef memcmp
   54130 #undef realloc
   54131 }
   54132 
   54133 
   54134 
   54135 %code {
   54136   #include <assert.h>
   54137   #include <stdio.h>
   54138   static void yyerror ( const char *msg);
   54139   int yylex (YYSTYPE *lvalp);
   54140   #define USE(Var)
   54141 }
   54142 
   54143 %define api.pure
   54144 
   54145 %define lr.default-reductions accepting
   54146 
   54147 %error-verbose
   54148 
   54149 %%
   54150 
   54151 %nonassoc 'a';
   54152 
   54153 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   54154 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   54155 // tokens are returned by yylex, which sets $$ = 1.
   54156 %destructor {
   54157   if (!$$)
   54158     fprintf (stderr, "Wrong destructor.\n");
   54159 } 'a';
   54160 
   54161 // Rather than depend on an inconsistent state to induce reading a
   54162 // lookahead as in the previous grammar, just assign the lookahead in a
   54163 // semantic action.  That lookahead isn't needed before either error
   54164 // action is encountered.  In a previous version of Bison, this was a
   54165 // problem as it meant yychar was not translated into yytoken before
   54166 // either error action.  The second error action thus invoked a
   54167 // destructor that it selected according to the incorrect yytoken.  The
   54168 // first error action would have reported an incorrect unexpected token
   54169 // except that, due to the bug described in the previous grammar, the
   54170 // unexpected token was not reported at all.
   54171 start: error-reduce consistent-error 'a' { USE ($3); } ;
   54172 
   54173 error-reduce:
   54174   'a' 'a' consistent-reduction consistent-error 'a'
   54175   { USE (($1, $2, $5)); }
   54176 | 'a' error
   54177   { USE ($1); }
   54178 ;
   54179 
   54180 consistent-reduction: /*empty*/ {
   54181   assert (yychar == YYEMPTY);
   54182   yylval = 0;
   54183   yychar = 'b';
   54184 } ;
   54185 
   54186 consistent-error:
   54187   'a' { USE ($1); }
   54188 | /*empty*/ %prec 'a'
   54189 ;
   54190 
   54191 // Provide another context in which all rules are useful so that this
   54192 // test case looks a little more realistic.
   54193 start: 'b' consistent-error 'b' ;
   54194 
   54195 
   54196 %%
   54197 
   54198 /*--------.
   54199 | yylex.  |
   54200 `--------*/
   54201 
   54202 int yylex (YYSTYPE *lvalp)
   54203 {
   54204   static char const *input = "aa";
   54205   *lvalp = 1;
   54206   return *input++;
   54207 }
   54208 #include <stdio.h>
   54209 /* A C error reporting function.  */
   54210 static
   54211 void yyerror ( const char *msg)
   54212 {
   54213   fprintf (stderr, "%s\n", msg);
   54214 }
   54215 
   54216 
   54217 /*-------.
   54218 | main.  |
   54219 `-------*/
   54220 
   54221 int
   54222 main (void)
   54223 {
   54224   return yyparse ();
   54225 }
   54226 _ATEOF
   54227 
   54228 
   54229 
   54230 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   54231   at_save_special_files
   54232   mkdir xml-tests
   54233     # Don't combine these Bison invocations since we want to be sure that
   54234   # --report=all isn't required to get the full XML file.
   54235   { set +x
   54236 $as_echo "$at_srcdir/conflicts.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   54237                   --graph=xml-tests/test.dot -o input.c input.y"
   54238 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:417"
   54239 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   54240                   --graph=xml-tests/test.dot -o input.c input.y
   54241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54242 at_status=$? at_failed=false
   54243 $at_check_filter
   54244 echo stderr:; cat "$at_stderr"
   54245 echo stdout:; cat "$at_stdout"
   54246 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54247 $at_failed && at_fn_log_failure
   54248 $at_traceon; }
   54249 
   54250   { set +x
   54251 $as_echo "$at_srcdir/conflicts.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   54252 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:417"
   54253 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   54254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54255 at_status=$? at_failed=false
   54256 $at_check_filter
   54257 echo stderr:; cat "$at_stderr"
   54258 echo stdout:; cat "$at_stdout"
   54259 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54260 $at_failed && at_fn_log_failure
   54261 $at_traceon; }
   54262 
   54263     cp xml-tests/test.output expout
   54264   { set +x
   54265 $as_echo "$at_srcdir/conflicts.at:417: \$XSLTPROC \\
   54266              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   54267              xml-tests/test.xml"
   54268 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:417"
   54269 ( $at_check_trace; $XSLTPROC \
   54270              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   54271              xml-tests/test.xml
   54272 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54273 at_status=$? at_failed=false
   54274 $at_check_filter
   54275 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54276 $at_diff expout "$at_stdout" || at_failed=:
   54277 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54278 $at_failed && at_fn_log_failure
   54279 $at_traceon; }
   54280 
   54281   sort xml-tests/test.dot > expout
   54282   { set +x
   54283 $as_echo "$at_srcdir/conflicts.at:417: \$XSLTPROC \\
   54284              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   54285              xml-tests/test.xml | sort"
   54286 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:417"
   54287 ( $at_check_trace; $XSLTPROC \
   54288              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   54289              xml-tests/test.xml | sort
   54290 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54291 at_status=$? at_failed=false
   54292 $at_check_filter
   54293 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54294 $at_diff expout "$at_stdout" || at_failed=:
   54295 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54296 $at_failed && at_fn_log_failure
   54297 $at_traceon; }
   54298 
   54299   rm -rf xml-tests expout
   54300   at_restore_special_files
   54301 fi
   54302 { set +x
   54303 $as_echo "$at_srcdir/conflicts.at:417: bison -o input.c input.y"
   54304 at_fn_check_prepare_trace "conflicts.at:417"
   54305 ( $at_check_trace; bison -o input.c input.y
   54306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54307 at_status=$? at_failed=false
   54308 $at_check_filter
   54309 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54310 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54311 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54312 $at_failed && at_fn_log_failure
   54313 $at_traceon; }
   54314 
   54315 
   54316    { set +x
   54317 $as_echo "$at_srcdir/conflicts.at:417: \$BISON_C_WORKS"
   54318 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:417"
   54319 ( $at_check_trace; $BISON_C_WORKS
   54320 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54321 at_status=$? at_failed=false
   54322 $at_check_filter
   54323 echo stderr:; cat "$at_stderr"
   54324 echo stdout:; cat "$at_stdout"
   54325 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54326 $at_failed && at_fn_log_failure
   54327 $at_traceon; }
   54328 
   54329 { set +x
   54330 $as_echo "$at_srcdir/conflicts.at:417: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   54331 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:417"
   54332 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   54333 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54334 at_status=$? at_failed=false
   54335 $at_check_filter
   54336 echo stderr:; cat "$at_stderr"
   54337 echo stdout:; cat "$at_stdout"
   54338 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54339 $at_failed && at_fn_log_failure
   54340 $at_traceon; }
   54341 
   54342 
   54343 
   54344 
   54345 
   54346 { set +x
   54347 $as_echo "$at_srcdir/conflicts.at:417:  \$PREPARSER ./input"
   54348 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:417"
   54349 ( $at_check_trace;  $PREPARSER ./input
   54350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54351 at_status=$? at_failed=false
   54352 $at_check_filter
   54353 echo stderr:; tee stderr <"$at_stderr"
   54354 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54355 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:417"
   54356 $at_failed && at_fn_log_failure
   54357 $at_traceon; }
   54358 
   54359 { set +x
   54360 $as_echo "$at_srcdir/conflicts.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   54361 at_fn_check_prepare_trace "conflicts.at:417"
   54362 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   54363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54364 at_status=$? at_failed=false
   54365 $at_check_filter
   54366 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a'
   54367 " | \
   54368   $at_diff - "$at_stderr" || at_failed=:
   54369 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54370 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:417"
   54371 $at_failed && at_fn_log_failure
   54372 $at_traceon; }
   54373 
   54374 
   54375 
   54376 
   54377 
   54378 
   54379 
   54380 
   54381 
   54382 
   54383 
   54384 
   54385 
   54386 
   54387 cat >input.y <<'_ATEOF'
   54388 %code top {
   54389 #include <config.h>
   54390 /* We don't need perfect functions for these tests. */
   54391 #undef malloc
   54392 #undef memcmp
   54393 #undef realloc
   54394 }
   54395 
   54396 
   54397 
   54398 %code {
   54399   #include <assert.h>
   54400   #include <stdio.h>
   54401   static void yyerror ( const char *msg);
   54402   int yylex (YYSTYPE *lvalp);
   54403   #define USE(Var)
   54404 }
   54405 
   54406 %define api.pure
   54407 
   54408 %define lr.type canonical-lr
   54409 
   54410 %error-verbose
   54411 
   54412 %%
   54413 
   54414 %nonassoc 'a';
   54415 
   54416 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   54417 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   54418 // tokens are returned by yylex, which sets $$ = 1.
   54419 %destructor {
   54420   if (!$$)
   54421     fprintf (stderr, "Wrong destructor.\n");
   54422 } 'a';
   54423 
   54424 // Rather than depend on an inconsistent state to induce reading a
   54425 // lookahead as in the previous grammar, just assign the lookahead in a
   54426 // semantic action.  That lookahead isn't needed before either error
   54427 // action is encountered.  In a previous version of Bison, this was a
   54428 // problem as it meant yychar was not translated into yytoken before
   54429 // either error action.  The second error action thus invoked a
   54430 // destructor that it selected according to the incorrect yytoken.  The
   54431 // first error action would have reported an incorrect unexpected token
   54432 // except that, due to the bug described in the previous grammar, the
   54433 // unexpected token was not reported at all.
   54434 start: error-reduce consistent-error 'a' { USE ($3); } ;
   54435 
   54436 error-reduce:
   54437   'a' 'a' consistent-reduction consistent-error 'a'
   54438   { USE (($1, $2, $5)); }
   54439 | 'a' error
   54440   { USE ($1); }
   54441 ;
   54442 
   54443 consistent-reduction: /*empty*/ {
   54444   assert (yychar == YYEMPTY);
   54445   yylval = 0;
   54446   yychar = 'b';
   54447 } ;
   54448 
   54449 consistent-error:
   54450   'a' { USE ($1); }
   54451 | /*empty*/ %prec 'a'
   54452 ;
   54453 
   54454 // Provide another context in which all rules are useful so that this
   54455 // test case looks a little more realistic.
   54456 start: 'b' consistent-error 'b' ;
   54457 
   54458 
   54459 %%
   54460 
   54461 /*--------.
   54462 | yylex.  |
   54463 `--------*/
   54464 
   54465 int yylex (YYSTYPE *lvalp)
   54466 {
   54467   static char const *input = "aa";
   54468   *lvalp = 1;
   54469   return *input++;
   54470 }
   54471 #include <stdio.h>
   54472 /* A C error reporting function.  */
   54473 static
   54474 void yyerror ( const char *msg)
   54475 {
   54476   fprintf (stderr, "%s\n", msg);
   54477 }
   54478 
   54479 
   54480 /*-------.
   54481 | main.  |
   54482 `-------*/
   54483 
   54484 int
   54485 main (void)
   54486 {
   54487   return yyparse ();
   54488 }
   54489 _ATEOF
   54490 
   54491 
   54492 
   54493 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   54494   at_save_special_files
   54495   mkdir xml-tests
   54496     # Don't combine these Bison invocations since we want to be sure that
   54497   # --report=all isn't required to get the full XML file.
   54498   { set +x
   54499 $as_echo "$at_srcdir/conflicts.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   54500                   --graph=xml-tests/test.dot -o input.c input.y"
   54501 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:421"
   54502 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   54503                   --graph=xml-tests/test.dot -o input.c input.y
   54504 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54505 at_status=$? at_failed=false
   54506 $at_check_filter
   54507 echo stderr:; cat "$at_stderr"
   54508 echo stdout:; cat "$at_stdout"
   54509 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54510 $at_failed && at_fn_log_failure
   54511 $at_traceon; }
   54512 
   54513   { set +x
   54514 $as_echo "$at_srcdir/conflicts.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   54515 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:421"
   54516 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   54517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54518 at_status=$? at_failed=false
   54519 $at_check_filter
   54520 echo stderr:; cat "$at_stderr"
   54521 echo stdout:; cat "$at_stdout"
   54522 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54523 $at_failed && at_fn_log_failure
   54524 $at_traceon; }
   54525 
   54526     cp xml-tests/test.output expout
   54527   { set +x
   54528 $as_echo "$at_srcdir/conflicts.at:421: \$XSLTPROC \\
   54529              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   54530              xml-tests/test.xml"
   54531 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:421"
   54532 ( $at_check_trace; $XSLTPROC \
   54533              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   54534              xml-tests/test.xml
   54535 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54536 at_status=$? at_failed=false
   54537 $at_check_filter
   54538 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54539 $at_diff expout "$at_stdout" || at_failed=:
   54540 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54541 $at_failed && at_fn_log_failure
   54542 $at_traceon; }
   54543 
   54544   sort xml-tests/test.dot > expout
   54545   { set +x
   54546 $as_echo "$at_srcdir/conflicts.at:421: \$XSLTPROC \\
   54547              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   54548              xml-tests/test.xml | sort"
   54549 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:421"
   54550 ( $at_check_trace; $XSLTPROC \
   54551              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   54552              xml-tests/test.xml | sort
   54553 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54554 at_status=$? at_failed=false
   54555 $at_check_filter
   54556 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54557 $at_diff expout "$at_stdout" || at_failed=:
   54558 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54559 $at_failed && at_fn_log_failure
   54560 $at_traceon; }
   54561 
   54562   rm -rf xml-tests expout
   54563   at_restore_special_files
   54564 fi
   54565 { set +x
   54566 $as_echo "$at_srcdir/conflicts.at:421: bison -o input.c input.y"
   54567 at_fn_check_prepare_trace "conflicts.at:421"
   54568 ( $at_check_trace; bison -o input.c input.y
   54569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54570 at_status=$? at_failed=false
   54571 $at_check_filter
   54572 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54574 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54575 $at_failed && at_fn_log_failure
   54576 $at_traceon; }
   54577 
   54578 
   54579    { set +x
   54580 $as_echo "$at_srcdir/conflicts.at:421: \$BISON_C_WORKS"
   54581 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:421"
   54582 ( $at_check_trace; $BISON_C_WORKS
   54583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54584 at_status=$? at_failed=false
   54585 $at_check_filter
   54586 echo stderr:; cat "$at_stderr"
   54587 echo stdout:; cat "$at_stdout"
   54588 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54589 $at_failed && at_fn_log_failure
   54590 $at_traceon; }
   54591 
   54592 { set +x
   54593 $as_echo "$at_srcdir/conflicts.at:421: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   54594 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:421"
   54595 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   54596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54597 at_status=$? at_failed=false
   54598 $at_check_filter
   54599 echo stderr:; cat "$at_stderr"
   54600 echo stdout:; cat "$at_stdout"
   54601 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54602 $at_failed && at_fn_log_failure
   54603 $at_traceon; }
   54604 
   54605 
   54606 
   54607 
   54608 
   54609 { set +x
   54610 $as_echo "$at_srcdir/conflicts.at:421:  \$PREPARSER ./input"
   54611 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:421"
   54612 ( $at_check_trace;  $PREPARSER ./input
   54613 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54614 at_status=$? at_failed=false
   54615 $at_check_filter
   54616 echo stderr:; tee stderr <"$at_stderr"
   54617 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54618 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:421"
   54619 $at_failed && at_fn_log_failure
   54620 $at_traceon; }
   54621 
   54622 { set +x
   54623 $as_echo "$at_srcdir/conflicts.at:421: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   54624 at_fn_check_prepare_trace "conflicts.at:421"
   54625 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   54626 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54627 at_status=$? at_failed=false
   54628 $at_check_filter
   54629 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a'
   54630 " | \
   54631   $at_diff - "$at_stderr" || at_failed=:
   54632 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54633 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:421"
   54634 $at_failed && at_fn_log_failure
   54635 $at_traceon; }
   54636 
   54637 
   54638 
   54639 
   54640 
   54641 
   54642 
   54643 
   54644 
   54645 
   54646 
   54647 
   54648 
   54649 
   54650 
   54651 cat >input.y <<'_ATEOF'
   54652 %code top {
   54653 #include <config.h>
   54654 /* We don't need perfect functions for these tests. */
   54655 #undef malloc
   54656 #undef memcmp
   54657 #undef realloc
   54658 }
   54659 
   54660 
   54661 
   54662 %code {
   54663   #include <assert.h>
   54664   #include <stdio.h>
   54665   static void yyerror ( const char *msg);
   54666   int yylex (YYSTYPE *lvalp);
   54667   #define USE(Var)
   54668 }
   54669 
   54670 %define api.pure
   54671 
   54672 %define parse.lac full
   54673 
   54674 %error-verbose
   54675 
   54676 %%
   54677 
   54678 %nonassoc 'a';
   54679 
   54680 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   54681 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   54682 // tokens are returned by yylex, which sets $$ = 1.
   54683 %destructor {
   54684   if (!$$)
   54685     fprintf (stderr, "Wrong destructor.\n");
   54686 } 'a';
   54687 
   54688 // Rather than depend on an inconsistent state to induce reading a
   54689 // lookahead as in the previous grammar, just assign the lookahead in a
   54690 // semantic action.  That lookahead isn't needed before either error
   54691 // action is encountered.  In a previous version of Bison, this was a
   54692 // problem as it meant yychar was not translated into yytoken before
   54693 // either error action.  The second error action thus invoked a
   54694 // destructor that it selected according to the incorrect yytoken.  The
   54695 // first error action would have reported an incorrect unexpected token
   54696 // except that, due to the bug described in the previous grammar, the
   54697 // unexpected token was not reported at all.
   54698 start: error-reduce consistent-error 'a' { USE ($3); } ;
   54699 
   54700 error-reduce:
   54701   'a' 'a' consistent-reduction consistent-error 'a'
   54702   { USE (($1, $2, $5)); }
   54703 | 'a' error
   54704   { USE ($1); }
   54705 ;
   54706 
   54707 consistent-reduction: /*empty*/ {
   54708   assert (yychar == YYEMPTY);
   54709   yylval = 0;
   54710   yychar = 'b';
   54711 } ;
   54712 
   54713 consistent-error:
   54714   'a' { USE ($1); }
   54715 | /*empty*/ %prec 'a'
   54716 ;
   54717 
   54718 // Provide another context in which all rules are useful so that this
   54719 // test case looks a little more realistic.
   54720 start: 'b' consistent-error 'b' ;
   54721 
   54722 
   54723 %%
   54724 
   54725 /*--------.
   54726 | yylex.  |
   54727 `--------*/
   54728 
   54729 int yylex (YYSTYPE *lvalp)
   54730 {
   54731   static char const *input = "aa";
   54732   *lvalp = 1;
   54733   return *input++;
   54734 }
   54735 #include <stdio.h>
   54736 /* A C error reporting function.  */
   54737 static
   54738 void yyerror ( const char *msg)
   54739 {
   54740   fprintf (stderr, "%s\n", msg);
   54741 }
   54742 
   54743 
   54744 /*-------.
   54745 | main.  |
   54746 `-------*/
   54747 
   54748 int
   54749 main (void)
   54750 {
   54751   return yyparse ();
   54752 }
   54753 _ATEOF
   54754 
   54755 
   54756 
   54757 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   54758   at_save_special_files
   54759   mkdir xml-tests
   54760     # Don't combine these Bison invocations since we want to be sure that
   54761   # --report=all isn't required to get the full XML file.
   54762   { set +x
   54763 $as_echo "$at_srcdir/conflicts.at:426: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   54764                   --graph=xml-tests/test.dot -o input.c input.y"
   54765 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:426"
   54766 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   54767                   --graph=xml-tests/test.dot -o input.c input.y
   54768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54769 at_status=$? at_failed=false
   54770 $at_check_filter
   54771 echo stderr:; cat "$at_stderr"
   54772 echo stdout:; cat "$at_stdout"
   54773 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54774 $at_failed && at_fn_log_failure
   54775 $at_traceon; }
   54776 
   54777   { set +x
   54778 $as_echo "$at_srcdir/conflicts.at:426: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   54779 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:426"
   54780 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   54781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54782 at_status=$? at_failed=false
   54783 $at_check_filter
   54784 echo stderr:; cat "$at_stderr"
   54785 echo stdout:; cat "$at_stdout"
   54786 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54787 $at_failed && at_fn_log_failure
   54788 $at_traceon; }
   54789 
   54790     cp xml-tests/test.output expout
   54791   { set +x
   54792 $as_echo "$at_srcdir/conflicts.at:426: \$XSLTPROC \\
   54793              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   54794              xml-tests/test.xml"
   54795 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:426"
   54796 ( $at_check_trace; $XSLTPROC \
   54797              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   54798              xml-tests/test.xml
   54799 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54800 at_status=$? at_failed=false
   54801 $at_check_filter
   54802 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54803 $at_diff expout "$at_stdout" || at_failed=:
   54804 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54805 $at_failed && at_fn_log_failure
   54806 $at_traceon; }
   54807 
   54808   sort xml-tests/test.dot > expout
   54809   { set +x
   54810 $as_echo "$at_srcdir/conflicts.at:426: \$XSLTPROC \\
   54811              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   54812              xml-tests/test.xml | sort"
   54813 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:426"
   54814 ( $at_check_trace; $XSLTPROC \
   54815              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   54816              xml-tests/test.xml | sort
   54817 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54818 at_status=$? at_failed=false
   54819 $at_check_filter
   54820 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54821 $at_diff expout "$at_stdout" || at_failed=:
   54822 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54823 $at_failed && at_fn_log_failure
   54824 $at_traceon; }
   54825 
   54826   rm -rf xml-tests expout
   54827   at_restore_special_files
   54828 fi
   54829 { set +x
   54830 $as_echo "$at_srcdir/conflicts.at:426: bison -o input.c input.y"
   54831 at_fn_check_prepare_trace "conflicts.at:426"
   54832 ( $at_check_trace; bison -o input.c input.y
   54833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54834 at_status=$? at_failed=false
   54835 $at_check_filter
   54836 at_fn_diff_devnull "$at_stderr" || at_failed=:
   54837 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54838 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54839 $at_failed && at_fn_log_failure
   54840 $at_traceon; }
   54841 
   54842 
   54843    { set +x
   54844 $as_echo "$at_srcdir/conflicts.at:426: \$BISON_C_WORKS"
   54845 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:426"
   54846 ( $at_check_trace; $BISON_C_WORKS
   54847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54848 at_status=$? at_failed=false
   54849 $at_check_filter
   54850 echo stderr:; cat "$at_stderr"
   54851 echo stdout:; cat "$at_stdout"
   54852 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54853 $at_failed && at_fn_log_failure
   54854 $at_traceon; }
   54855 
   54856 { set +x
   54857 $as_echo "$at_srcdir/conflicts.at:426: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   54858 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:426"
   54859 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   54860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54861 at_status=$? at_failed=false
   54862 $at_check_filter
   54863 echo stderr:; cat "$at_stderr"
   54864 echo stdout:; cat "$at_stdout"
   54865 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54866 $at_failed && at_fn_log_failure
   54867 $at_traceon; }
   54868 
   54869 
   54870 
   54871 
   54872 
   54873 { set +x
   54874 $as_echo "$at_srcdir/conflicts.at:426:  \$PREPARSER ./input"
   54875 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:426"
   54876 ( $at_check_trace;  $PREPARSER ./input
   54877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54878 at_status=$? at_failed=false
   54879 $at_check_filter
   54880 echo stderr:; tee stderr <"$at_stderr"
   54881 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54882 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:426"
   54883 $at_failed && at_fn_log_failure
   54884 $at_traceon; }
   54885 
   54886 { set +x
   54887 $as_echo "$at_srcdir/conflicts.at:426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   54888 at_fn_check_prepare_trace "conflicts.at:426"
   54889 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   54890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   54891 at_status=$? at_failed=false
   54892 $at_check_filter
   54893 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b'
   54894 " | \
   54895   $at_diff - "$at_stderr" || at_failed=:
   54896 at_fn_diff_devnull "$at_stdout" || at_failed=:
   54897 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:426"
   54898 $at_failed && at_fn_log_failure
   54899 $at_traceon; }
   54900 
   54901 
   54902 
   54903 
   54904 
   54905 
   54906 
   54907 
   54908 
   54909 
   54910 
   54911 
   54912 
   54913 
   54914 cat >input.y <<'_ATEOF'
   54915 %code top {
   54916 #include <config.h>
   54917 /* We don't need perfect functions for these tests. */
   54918 #undef malloc
   54919 #undef memcmp
   54920 #undef realloc
   54921 }
   54922 
   54923 
   54924 
   54925 %code {
   54926   #include <assert.h>
   54927   #include <stdio.h>
   54928   static void yyerror ( const char *msg);
   54929   int yylex (YYSTYPE *lvalp);
   54930   #define USE(Var)
   54931 }
   54932 
   54933 %define api.pure
   54934 
   54935 %define parse.lac full
   54936                              %define lr.default-reductions accepting
   54937 
   54938 %error-verbose
   54939 
   54940 %%
   54941 
   54942 %nonassoc 'a';
   54943 
   54944 // If $$ = 0 here, then we know that the 'a' destructor is being invoked
   54945 // incorrectly for the 'b' set in the semantic action below.  All 'a'
   54946 // tokens are returned by yylex, which sets $$ = 1.
   54947 %destructor {
   54948   if (!$$)
   54949     fprintf (stderr, "Wrong destructor.\n");
   54950 } 'a';
   54951 
   54952 // Rather than depend on an inconsistent state to induce reading a
   54953 // lookahead as in the previous grammar, just assign the lookahead in a
   54954 // semantic action.  That lookahead isn't needed before either error
   54955 // action is encountered.  In a previous version of Bison, this was a
   54956 // problem as it meant yychar was not translated into yytoken before
   54957 // either error action.  The second error action thus invoked a
   54958 // destructor that it selected according to the incorrect yytoken.  The
   54959 // first error action would have reported an incorrect unexpected token
   54960 // except that, due to the bug described in the previous grammar, the
   54961 // unexpected token was not reported at all.
   54962 start: error-reduce consistent-error 'a' { USE ($3); } ;
   54963 
   54964 error-reduce:
   54965   'a' 'a' consistent-reduction consistent-error 'a'
   54966   { USE (($1, $2, $5)); }
   54967 | 'a' error
   54968   { USE ($1); }
   54969 ;
   54970 
   54971 consistent-reduction: /*empty*/ {
   54972   assert (yychar == YYEMPTY);
   54973   yylval = 0;
   54974   yychar = 'b';
   54975 } ;
   54976 
   54977 consistent-error:
   54978   'a' { USE ($1); }
   54979 | /*empty*/ %prec 'a'
   54980 ;
   54981 
   54982 // Provide another context in which all rules are useful so that this
   54983 // test case looks a little more realistic.
   54984 start: 'b' consistent-error 'b' ;
   54985 
   54986 
   54987 %%
   54988 
   54989 /*--------.
   54990 | yylex.  |
   54991 `--------*/
   54992 
   54993 int yylex (YYSTYPE *lvalp)
   54994 {
   54995   static char const *input = "aa";
   54996   *lvalp = 1;
   54997   return *input++;
   54998 }
   54999 #include <stdio.h>
   55000 /* A C error reporting function.  */
   55001 static
   55002 void yyerror ( const char *msg)
   55003 {
   55004   fprintf (stderr, "%s\n", msg);
   55005 }
   55006 
   55007 
   55008 /*-------.
   55009 | main.  |
   55010 `-------*/
   55011 
   55012 int
   55013 main (void)
   55014 {
   55015   return yyparse ();
   55016 }
   55017 _ATEOF
   55018 
   55019 
   55020 
   55021 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   55022   at_save_special_files
   55023   mkdir xml-tests
   55024     # Don't combine these Bison invocations since we want to be sure that
   55025   # --report=all isn't required to get the full XML file.
   55026   { set +x
   55027 $as_echo "$at_srcdir/conflicts.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   55028                   --graph=xml-tests/test.dot -o input.c input.y"
   55029 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:430"
   55030 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   55031                   --graph=xml-tests/test.dot -o input.c input.y
   55032 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55033 at_status=$? at_failed=false
   55034 $at_check_filter
   55035 echo stderr:; cat "$at_stderr"
   55036 echo stdout:; cat "$at_stdout"
   55037 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55038 $at_failed && at_fn_log_failure
   55039 $at_traceon; }
   55040 
   55041   { set +x
   55042 $as_echo "$at_srcdir/conflicts.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   55043 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:430"
   55044 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   55045 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55046 at_status=$? at_failed=false
   55047 $at_check_filter
   55048 echo stderr:; cat "$at_stderr"
   55049 echo stdout:; cat "$at_stdout"
   55050 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55051 $at_failed && at_fn_log_failure
   55052 $at_traceon; }
   55053 
   55054     cp xml-tests/test.output expout
   55055   { set +x
   55056 $as_echo "$at_srcdir/conflicts.at:430: \$XSLTPROC \\
   55057              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   55058              xml-tests/test.xml"
   55059 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:430"
   55060 ( $at_check_trace; $XSLTPROC \
   55061              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   55062              xml-tests/test.xml
   55063 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55064 at_status=$? at_failed=false
   55065 $at_check_filter
   55066 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55067 $at_diff expout "$at_stdout" || at_failed=:
   55068 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55069 $at_failed && at_fn_log_failure
   55070 $at_traceon; }
   55071 
   55072   sort xml-tests/test.dot > expout
   55073   { set +x
   55074 $as_echo "$at_srcdir/conflicts.at:430: \$XSLTPROC \\
   55075              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   55076              xml-tests/test.xml | sort"
   55077 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:430"
   55078 ( $at_check_trace; $XSLTPROC \
   55079              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   55080              xml-tests/test.xml | sort
   55081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55082 at_status=$? at_failed=false
   55083 $at_check_filter
   55084 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55085 $at_diff expout "$at_stdout" || at_failed=:
   55086 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55087 $at_failed && at_fn_log_failure
   55088 $at_traceon; }
   55089 
   55090   rm -rf xml-tests expout
   55091   at_restore_special_files
   55092 fi
   55093 { set +x
   55094 $as_echo "$at_srcdir/conflicts.at:430: bison -o input.c input.y"
   55095 at_fn_check_prepare_trace "conflicts.at:430"
   55096 ( $at_check_trace; bison -o input.c input.y
   55097 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55098 at_status=$? at_failed=false
   55099 $at_check_filter
   55100 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55101 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55102 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55103 $at_failed && at_fn_log_failure
   55104 $at_traceon; }
   55105 
   55106 
   55107    { set +x
   55108 $as_echo "$at_srcdir/conflicts.at:430: \$BISON_C_WORKS"
   55109 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:430"
   55110 ( $at_check_trace; $BISON_C_WORKS
   55111 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55112 at_status=$? at_failed=false
   55113 $at_check_filter
   55114 echo stderr:; cat "$at_stderr"
   55115 echo stdout:; cat "$at_stdout"
   55116 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55117 $at_failed && at_fn_log_failure
   55118 $at_traceon; }
   55119 
   55120 { set +x
   55121 $as_echo "$at_srcdir/conflicts.at:430: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   55122 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:430"
   55123 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   55124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55125 at_status=$? at_failed=false
   55126 $at_check_filter
   55127 echo stderr:; cat "$at_stderr"
   55128 echo stdout:; cat "$at_stdout"
   55129 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55130 $at_failed && at_fn_log_failure
   55131 $at_traceon; }
   55132 
   55133 
   55134 
   55135 
   55136 
   55137 { set +x
   55138 $as_echo "$at_srcdir/conflicts.at:430:  \$PREPARSER ./input"
   55139 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:430"
   55140 ( $at_check_trace;  $PREPARSER ./input
   55141 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55142 at_status=$? at_failed=false
   55143 $at_check_filter
   55144 echo stderr:; tee stderr <"$at_stderr"
   55145 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55146 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:430"
   55147 $at_failed && at_fn_log_failure
   55148 $at_traceon; }
   55149 
   55150 { set +x
   55151 $as_echo "$at_srcdir/conflicts.at:430: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   55152 at_fn_check_prepare_trace "conflicts.at:430"
   55153 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   55154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55155 at_status=$? at_failed=false
   55156 $at_check_filter
   55157 echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end
   55158 " | \
   55159   $at_diff - "$at_stderr" || at_failed=:
   55160 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55161 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:430"
   55162 $at_failed && at_fn_log_failure
   55163 $at_traceon; }
   55164 
   55165 
   55166 
   55167 
   55168 
   55169 
   55170 
   55171 
   55172 
   55173 
   55174 
   55175 
   55176 
   55177 
   55178   set +x
   55179   $at_times_p && times >"$at_times_file"
   55180 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   55181 read at_status <"$at_status_file"
   55182 #AT_STOP_183
   55183 #AT_START_184
   55184 at_fn_group_banner 184 'conflicts.at:456' \
   55185   "LAC: %nonassoc requires splitting canonical LR states" "" 10
   55186 at_xfail=no
   55187 (
   55188   $as_echo "184. $at_setup_line: testing $at_desc ..."
   55189   $at_traceon
   55190 
   55191 
   55192 cat >input.y <<'_ATEOF'
   55193 %code top {
   55194 #include <config.h>
   55195 /* We don't need perfect functions for these tests. */
   55196 #undef malloc
   55197 #undef memcmp
   55198 #undef realloc
   55199 }
   55200 
   55201 %code {
   55202   #include <stdio.h>
   55203   static void yyerror ( const char *msg);
   55204   static int yylex (void);
   55205 }
   55206 
   55207 %error-verbose
   55208 %nonassoc 'a'
   55209 
   55210 %%
   55211 
   55212 start:
   55213   'a' problem 'a' // First context.
   55214 | 'b' problem 'b' // Second context.
   55215 | 'c' reduce-nonassoc // Just makes reduce-nonassoc useful.
   55216 ;
   55217 
   55218 problem:
   55219   look reduce-nonassoc
   55220 | look 'a'
   55221 | look 'b'
   55222 ;
   55223 
   55224 // For the state reached after shifting the 'a' in these productions,
   55225 // lookahead sets are the same in both the first and second contexts.
   55226 // Thus, canonical LR reuses the same state for both contexts.  However,
   55227 // the lookahead 'a' for the reduction "look: 'a'" later becomes an
   55228 // error action only in the first context.  In order to immediately
   55229 // detect the syntax error on 'a' here for only the first context, this
   55230 // canonical LR state would have to be split into two states, and the
   55231 // 'a' lookahead would have to be removed from only one of the states.
   55232 look:
   55233   'a' // Reduction lookahead set is always ['a', 'b'].
   55234 | 'a' 'b'
   55235 | 'a' 'c' // 'c' is forgotten as an expected token.
   55236 ;
   55237 
   55238 reduce-nonassoc: %prec 'a';
   55239 
   55240 %%
   55241 #include <stdio.h>
   55242 /* A C error reporting function.  */
   55243 static
   55244 void yyerror ( const char *msg)
   55245 {
   55246   fprintf (stderr, "%s\n", msg);
   55247 }
   55248 #include <assert.h>
   55249 static
   55250 int yylex (void)
   55251 {
   55252   static char const input[] = "aaa";
   55253   static size_t toknum = 0;
   55254   int res;
   55255   ;
   55256   assert (toknum < sizeof input / sizeof input[0]);
   55257   res = input[toknum++];
   55258   ;
   55259   return res;
   55260 }
   55261 
   55262 int
   55263 main (void)
   55264 {
   55265   return yyparse ();
   55266 }
   55267 _ATEOF
   55268 
   55269 
   55270 
   55271 
   55272 # Show canonical LR's failure.
   55273 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   55274   at_save_special_files
   55275   mkdir xml-tests
   55276     # Don't combine these Bison invocations since we want to be sure that
   55277   # --report=all isn't required to get the full XML file.
   55278   { set +x
   55279 $as_echo "$at_srcdir/conflicts.at:511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   55280                   --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y"
   55281 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:511"
   55282 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   55283                   --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y
   55284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55285 at_status=$? at_failed=false
   55286 $at_check_filter
   55287 echo stderr:; cat "$at_stderr"
   55288 echo stdout:; cat "$at_stdout"
   55289 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511"
   55290 $at_failed && at_fn_log_failure
   55291 $at_traceon; }
   55292 
   55293   { set +x
   55294 $as_echo "$at_srcdir/conflicts.at:511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y"
   55295 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:511"
   55296 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y
   55297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55298 at_status=$? at_failed=false
   55299 $at_check_filter
   55300 echo stderr:; cat "$at_stderr"
   55301 echo stdout:; cat "$at_stdout"
   55302 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511"
   55303 $at_failed && at_fn_log_failure
   55304 $at_traceon; }
   55305 
   55306     cp xml-tests/test.output expout
   55307   { set +x
   55308 $as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\
   55309              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   55310              xml-tests/test.xml"
   55311 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:511"
   55312 ( $at_check_trace; $XSLTPROC \
   55313              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   55314              xml-tests/test.xml
   55315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55316 at_status=$? at_failed=false
   55317 $at_check_filter
   55318 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55319 $at_diff expout "$at_stdout" || at_failed=:
   55320 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511"
   55321 $at_failed && at_fn_log_failure
   55322 $at_traceon; }
   55323 
   55324   sort xml-tests/test.dot > expout
   55325   { set +x
   55326 $as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\
   55327              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   55328              xml-tests/test.xml | sort"
   55329 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:511"
   55330 ( $at_check_trace; $XSLTPROC \
   55331              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   55332              xml-tests/test.xml | sort
   55333 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55334 at_status=$? at_failed=false
   55335 $at_check_filter
   55336 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55337 $at_diff expout "$at_stdout" || at_failed=:
   55338 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511"
   55339 $at_failed && at_fn_log_failure
   55340 $at_traceon; }
   55341 
   55342   rm -rf xml-tests expout
   55343   at_restore_special_files
   55344 fi
   55345 { set +x
   55346 $as_echo "$at_srcdir/conflicts.at:511: bison -Dlr.type=canonical-lr -o input.c input.y"
   55347 at_fn_check_prepare_trace "conflicts.at:511"
   55348 ( $at_check_trace; bison -Dlr.type=canonical-lr -o input.c input.y
   55349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55350 at_status=$? at_failed=false
   55351 $at_check_filter
   55352 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce
   55353 " | \
   55354   $at_diff - "$at_stderr" || at_failed=:
   55355 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55356 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511"
   55357 $at_failed && at_fn_log_failure
   55358 $at_traceon; }
   55359 
   55360 
   55361 { set +x
   55362 $as_echo "$at_srcdir/conflicts.at:515: \$BISON_C_WORKS"
   55363 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:515"
   55364 ( $at_check_trace; $BISON_C_WORKS
   55365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55366 at_status=$? at_failed=false
   55367 $at_check_filter
   55368 echo stderr:; cat "$at_stderr"
   55369 echo stdout:; cat "$at_stdout"
   55370 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:515"
   55371 $at_failed && at_fn_log_failure
   55372 $at_traceon; }
   55373 
   55374 { set +x
   55375 $as_echo "$at_srcdir/conflicts.at:515: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   55376 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:515"
   55377 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   55378 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55379 at_status=$? at_failed=false
   55380 $at_check_filter
   55381 echo stderr:; cat "$at_stderr"
   55382 echo stdout:; cat "$at_stdout"
   55383 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:515"
   55384 $at_failed && at_fn_log_failure
   55385 $at_traceon; }
   55386 
   55387 { set +x
   55388 $as_echo "$at_srcdir/conflicts.at:516:  \$PREPARSER ./input"
   55389 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:516"
   55390 ( $at_check_trace;  $PREPARSER ./input
   55391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55392 at_status=$? at_failed=false
   55393 $at_check_filter
   55394 echo stderr:; tee stderr <"$at_stderr"
   55395 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55396 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:516"
   55397 $at_failed && at_fn_log_failure
   55398 $at_traceon; }
   55399 
   55400 { set +x
   55401 $as_echo "$at_srcdir/conflicts.at:516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   55402 at_fn_check_prepare_trace "conflicts.at:516"
   55403 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   55404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55405 at_status=$? at_failed=false
   55406 $at_check_filter
   55407 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b'
   55408 " | \
   55409   $at_diff - "$at_stderr" || at_failed=:
   55410 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55411 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:516"
   55412 $at_failed && at_fn_log_failure
   55413 $at_traceon; }
   55414 
   55415 
   55416 
   55417 # It's corrected by LAC.
   55418 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   55419   at_save_special_files
   55420   mkdir xml-tests
   55421     # Don't combine these Bison invocations since we want to be sure that
   55422   # --report=all isn't required to get the full XML file.
   55423   { set +x
   55424 $as_echo "$at_srcdir/conflicts.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   55425                   --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \\
   55426                  -o input.c input.y"
   55427 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521"
   55428 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   55429                   --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \
   55430                  -o input.c input.y
   55431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55432 at_status=$? at_failed=false
   55433 $at_check_filter
   55434 echo stderr:; cat "$at_stderr"
   55435 echo stdout:; cat "$at_stdout"
   55436 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521"
   55437 $at_failed && at_fn_log_failure
   55438 $at_traceon; }
   55439 
   55440   { set +x
   55441 $as_echo "$at_srcdir/conflicts.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \\
   55442                  -o input.c input.y"
   55443 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521"
   55444 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \
   55445                  -o input.c input.y
   55446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55447 at_status=$? at_failed=false
   55448 $at_check_filter
   55449 echo stderr:; cat "$at_stderr"
   55450 echo stdout:; cat "$at_stdout"
   55451 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521"
   55452 $at_failed && at_fn_log_failure
   55453 $at_traceon; }
   55454 
   55455     cp xml-tests/test.output expout
   55456   { set +x
   55457 $as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\
   55458              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   55459              xml-tests/test.xml"
   55460 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:521"
   55461 ( $at_check_trace; $XSLTPROC \
   55462              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   55463              xml-tests/test.xml
   55464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55465 at_status=$? at_failed=false
   55466 $at_check_filter
   55467 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55468 $at_diff expout "$at_stdout" || at_failed=:
   55469 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521"
   55470 $at_failed && at_fn_log_failure
   55471 $at_traceon; }
   55472 
   55473   sort xml-tests/test.dot > expout
   55474   { set +x
   55475 $as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\
   55476              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   55477              xml-tests/test.xml | sort"
   55478 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:521"
   55479 ( $at_check_trace; $XSLTPROC \
   55480              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   55481              xml-tests/test.xml | sort
   55482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55483 at_status=$? at_failed=false
   55484 $at_check_filter
   55485 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55486 $at_diff expout "$at_stdout" || at_failed=:
   55487 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521"
   55488 $at_failed && at_fn_log_failure
   55489 $at_traceon; }
   55490 
   55491   rm -rf xml-tests expout
   55492   at_restore_special_files
   55493 fi
   55494 { set +x
   55495 $as_echo "$at_srcdir/conflicts.at:521: bison -Dlr.type=canonical-lr -Dparse.lac=full \\
   55496                  -o input.c input.y"
   55497 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521"
   55498 ( $at_check_trace; bison -Dlr.type=canonical-lr -Dparse.lac=full \
   55499                  -o input.c input.y
   55500 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55501 at_status=$? at_failed=false
   55502 $at_check_filter
   55503 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce
   55504 " | \
   55505   $at_diff - "$at_stderr" || at_failed=:
   55506 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55507 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521"
   55508 $at_failed && at_fn_log_failure
   55509 $at_traceon; }
   55510 
   55511 
   55512 { set +x
   55513 $as_echo "$at_srcdir/conflicts.at:525: \$BISON_C_WORKS"
   55514 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:525"
   55515 ( $at_check_trace; $BISON_C_WORKS
   55516 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55517 at_status=$? at_failed=false
   55518 $at_check_filter
   55519 echo stderr:; cat "$at_stderr"
   55520 echo stdout:; cat "$at_stdout"
   55521 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:525"
   55522 $at_failed && at_fn_log_failure
   55523 $at_traceon; }
   55524 
   55525 { set +x
   55526 $as_echo "$at_srcdir/conflicts.at:525: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   55527 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:525"
   55528 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   55529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55530 at_status=$? at_failed=false
   55531 $at_check_filter
   55532 echo stderr:; cat "$at_stderr"
   55533 echo stdout:; cat "$at_stdout"
   55534 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:525"
   55535 $at_failed && at_fn_log_failure
   55536 $at_traceon; }
   55537 
   55538 { set +x
   55539 $as_echo "$at_srcdir/conflicts.at:526:  \$PREPARSER ./input"
   55540 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:526"
   55541 ( $at_check_trace;  $PREPARSER ./input
   55542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55543 at_status=$? at_failed=false
   55544 $at_check_filter
   55545 echo stderr:; tee stderr <"$at_stderr"
   55546 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55547 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:526"
   55548 $at_failed && at_fn_log_failure
   55549 $at_traceon; }
   55550 
   55551 { set +x
   55552 $as_echo "$at_srcdir/conflicts.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   55553 at_fn_check_prepare_trace "conflicts.at:526"
   55554 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   55555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55556 at_status=$? at_failed=false
   55557 $at_check_filter
   55558 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c'
   55559 " | \
   55560   $at_diff - "$at_stderr" || at_failed=:
   55561 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55562 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:526"
   55563 $at_failed && at_fn_log_failure
   55564 $at_traceon; }
   55565 
   55566 
   55567 
   55568 # IELR is sufficient when LAC is used.
   55569 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   55570   at_save_special_files
   55571   mkdir xml-tests
   55572     # Don't combine these Bison invocations since we want to be sure that
   55573   # --report=all isn't required to get the full XML file.
   55574   { set +x
   55575 $as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   55576                   --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
   55577 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:531"
   55578 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   55579                   --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y
   55580 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55581 at_status=$? at_failed=false
   55582 $at_check_filter
   55583 echo stderr:; cat "$at_stderr"
   55584 echo stdout:; cat "$at_stdout"
   55585 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531"
   55586 $at_failed && at_fn_log_failure
   55587 $at_traceon; }
   55588 
   55589   { set +x
   55590 $as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
   55591 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" "conflicts.at:531"
   55592 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y
   55593 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55594 at_status=$? at_failed=false
   55595 $at_check_filter
   55596 echo stderr:; cat "$at_stderr"
   55597 echo stdout:; cat "$at_stdout"
   55598 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531"
   55599 $at_failed && at_fn_log_failure
   55600 $at_traceon; }
   55601 
   55602     cp xml-tests/test.output expout
   55603   { set +x
   55604 $as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\
   55605              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   55606              xml-tests/test.xml"
   55607 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:531"
   55608 ( $at_check_trace; $XSLTPROC \
   55609              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   55610              xml-tests/test.xml
   55611 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55612 at_status=$? at_failed=false
   55613 $at_check_filter
   55614 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55615 $at_diff expout "$at_stdout" || at_failed=:
   55616 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531"
   55617 $at_failed && at_fn_log_failure
   55618 $at_traceon; }
   55619 
   55620   sort xml-tests/test.dot > expout
   55621   { set +x
   55622 $as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\
   55623              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   55624              xml-tests/test.xml | sort"
   55625 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:531"
   55626 ( $at_check_trace; $XSLTPROC \
   55627              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   55628              xml-tests/test.xml | sort
   55629 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55630 at_status=$? at_failed=false
   55631 $at_check_filter
   55632 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55633 $at_diff expout "$at_stdout" || at_failed=:
   55634 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531"
   55635 $at_failed && at_fn_log_failure
   55636 $at_traceon; }
   55637 
   55638   rm -rf xml-tests expout
   55639   at_restore_special_files
   55640 fi
   55641 { set +x
   55642 $as_echo "$at_srcdir/conflicts.at:531: bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
   55643 at_fn_check_prepare_trace "conflicts.at:531"
   55644 ( $at_check_trace; bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y
   55645 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55646 at_status=$? at_failed=false
   55647 $at_check_filter
   55648 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce
   55649 " | \
   55650   $at_diff - "$at_stderr" || at_failed=:
   55651 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55652 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:531"
   55653 $at_failed && at_fn_log_failure
   55654 $at_traceon; }
   55655 
   55656 
   55657 { set +x
   55658 $as_echo "$at_srcdir/conflicts.at:535: \$BISON_C_WORKS"
   55659 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:535"
   55660 ( $at_check_trace; $BISON_C_WORKS
   55661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55662 at_status=$? at_failed=false
   55663 $at_check_filter
   55664 echo stderr:; cat "$at_stderr"
   55665 echo stdout:; cat "$at_stdout"
   55666 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
   55667 $at_failed && at_fn_log_failure
   55668 $at_traceon; }
   55669 
   55670 { set +x
   55671 $as_echo "$at_srcdir/conflicts.at:535: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   55672 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:535"
   55673 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   55674 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55675 at_status=$? at_failed=false
   55676 $at_check_filter
   55677 echo stderr:; cat "$at_stderr"
   55678 echo stdout:; cat "$at_stdout"
   55679 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
   55680 $at_failed && at_fn_log_failure
   55681 $at_traceon; }
   55682 
   55683 { set +x
   55684 $as_echo "$at_srcdir/conflicts.at:536:  \$PREPARSER ./input"
   55685 at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:536"
   55686 ( $at_check_trace;  $PREPARSER ./input
   55687 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55688 at_status=$? at_failed=false
   55689 $at_check_filter
   55690 echo stderr:; tee stderr <"$at_stderr"
   55691 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55692 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:536"
   55693 $at_failed && at_fn_log_failure
   55694 $at_traceon; }
   55695 
   55696 { set +x
   55697 $as_echo "$at_srcdir/conflicts.at:536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   55698 at_fn_check_prepare_trace "conflicts.at:536"
   55699 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   55700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55701 at_status=$? at_failed=false
   55702 $at_check_filter
   55703 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c'
   55704 " | \
   55705   $at_diff - "$at_stderr" || at_failed=:
   55706 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55707 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:536"
   55708 $at_failed && at_fn_log_failure
   55709 $at_traceon; }
   55710 
   55711 
   55712 
   55713   set +x
   55714   $at_times_p && times >"$at_times_file"
   55715 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   55716 read at_status <"$at_status_file"
   55717 #AT_STOP_184
   55718 #AT_START_185
   55719 at_fn_group_banner 185 'conflicts.at:546' \
   55720   "Unresolved SR Conflicts" "                        " 10
   55721 at_xfail=no
   55722 (
   55723   $as_echo "185. $at_setup_line: testing $at_desc ..."
   55724   $at_traceon
   55725 
   55726 
   55727 
   55728 
   55729 cat >input.y <<'_ATEOF'
   55730 %token NUM OP
   55731 %%
   55732 exp: exp OP exp | NUM;
   55733 _ATEOF
   55734 
   55735 
   55736 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   55737   at_save_special_files
   55738   mkdir xml-tests
   55739     # Don't combine these Bison invocations since we want to be sure that
   55740   # --report=all isn't required to get the full XML file.
   55741   { set +x
   55742 $as_echo "$at_srcdir/conflicts.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   55743                   --graph=xml-tests/test.dot -o input.c --report=all input.y"
   55744 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:556"
   55745 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   55746                   --graph=xml-tests/test.dot -o input.c --report=all input.y
   55747 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55748 at_status=$? at_failed=false
   55749 $at_check_filter
   55750 echo stderr:; cat "$at_stderr"
   55751 echo stdout:; cat "$at_stdout"
   55752 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556"
   55753 $at_failed && at_fn_log_failure
   55754 $at_traceon; }
   55755 
   55756   { set +x
   55757 $as_echo "$at_srcdir/conflicts.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y"
   55758 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:556"
   55759 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y
   55760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55761 at_status=$? at_failed=false
   55762 $at_check_filter
   55763 echo stderr:; cat "$at_stderr"
   55764 echo stdout:; cat "$at_stdout"
   55765 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556"
   55766 $at_failed && at_fn_log_failure
   55767 $at_traceon; }
   55768 
   55769     cp xml-tests/test.output expout
   55770   { set +x
   55771 $as_echo "$at_srcdir/conflicts.at:556: \$XSLTPROC \\
   55772              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   55773              xml-tests/test.xml"
   55774 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:556"
   55775 ( $at_check_trace; $XSLTPROC \
   55776              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   55777              xml-tests/test.xml
   55778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55779 at_status=$? at_failed=false
   55780 $at_check_filter
   55781 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55782 $at_diff expout "$at_stdout" || at_failed=:
   55783 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556"
   55784 $at_failed && at_fn_log_failure
   55785 $at_traceon; }
   55786 
   55787   sort xml-tests/test.dot > expout
   55788   { set +x
   55789 $as_echo "$at_srcdir/conflicts.at:556: \$XSLTPROC \\
   55790              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   55791              xml-tests/test.xml | sort"
   55792 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:556"
   55793 ( $at_check_trace; $XSLTPROC \
   55794              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   55795              xml-tests/test.xml | sort
   55796 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55797 at_status=$? at_failed=false
   55798 $at_check_filter
   55799 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55800 $at_diff expout "$at_stdout" || at_failed=:
   55801 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556"
   55802 $at_failed && at_fn_log_failure
   55803 $at_traceon; }
   55804 
   55805   rm -rf xml-tests expout
   55806   at_restore_special_files
   55807 fi
   55808 { set +x
   55809 $as_echo "$at_srcdir/conflicts.at:556: bison -o input.c --report=all input.y"
   55810 at_fn_check_prepare_trace "conflicts.at:556"
   55811 ( $at_check_trace; bison -o input.c --report=all input.y
   55812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55813 at_status=$? at_failed=false
   55814 $at_check_filter
   55815 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
   55816 " | \
   55817   $at_diff - "$at_stderr" || at_failed=:
   55818 at_fn_diff_devnull "$at_stdout" || at_failed=:
   55819 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556"
   55820 $at_failed && at_fn_log_failure
   55821 $at_traceon; }
   55822 
   55823 
   55824 
   55825 # Check the contents of the report.
   55826 { set +x
   55827 $as_echo "$at_srcdir/conflicts.at:561: cat input.output"
   55828 at_fn_check_prepare_trace "conflicts.at:561"
   55829 ( $at_check_trace; cat input.output
   55830 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55831 at_status=$? at_failed=false
   55832 $at_check_filter
   55833 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55834 echo >>"$at_stdout"; $as_echo "State 5 conflicts: 1 shift/reduce
   55835 
   55836 
   55837 Grammar
   55838 
   55839     0 \$accept: exp \$end
   55840 
   55841     1 exp: exp OP exp
   55842     2    | NUM
   55843 
   55844 
   55845 Terminals, with rules where they appear
   55846 
   55847 \$end (0) 0
   55848 error (256)
   55849 NUM (258) 2
   55850 OP (259) 1
   55851 
   55852 
   55853 Nonterminals, with rules where they appear
   55854 
   55855 \$accept (5)
   55856     on left: 0
   55857 exp (6)
   55858     on left: 1 2, on right: 0 1
   55859 
   55860 
   55861 State 0
   55862 
   55863     0 \$accept: . exp \$end
   55864     1 exp: . exp OP exp
   55865     2    | . NUM
   55866 
   55867     NUM  shift, and go to state 1
   55868 
   55869     exp  go to state 2
   55870 
   55871 
   55872 State 1
   55873 
   55874     2 exp: NUM .
   55875 
   55876     \$default  reduce using rule 2 (exp)
   55877 
   55878 
   55879 State 2
   55880 
   55881     0 \$accept: exp . \$end
   55882     1 exp: exp . OP exp
   55883 
   55884     \$end  shift, and go to state 3
   55885     OP    shift, and go to state 4
   55886 
   55887 
   55888 State 3
   55889 
   55890     0 \$accept: exp \$end .
   55891 
   55892     \$default  accept
   55893 
   55894 
   55895 State 4
   55896 
   55897     1 exp: . exp OP exp
   55898     1    | exp OP . exp
   55899     2    | . NUM
   55900 
   55901     NUM  shift, and go to state 1
   55902 
   55903     exp  go to state 5
   55904 
   55905 
   55906 State 5
   55907 
   55908     1 exp: exp . OP exp
   55909     1    | exp OP exp .  [\$end, OP]
   55910 
   55911     OP  shift, and go to state 4
   55912 
   55913     OP        [reduce using rule 1 (exp)]
   55914     \$default  reduce using rule 1 (exp)
   55915 " | \
   55916   $at_diff - "$at_stdout" || at_failed=:
   55917 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:561"
   55918 $at_failed && at_fn_log_failure
   55919 $at_traceon; }
   55920 
   55921 
   55922   set +x
   55923   $at_times_p && times >"$at_times_file"
   55924 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   55925 read at_status <"$at_status_file"
   55926 #AT_STOP_185
   55927 #AT_START_186
   55928 at_fn_group_banner 186 'conflicts.at:653' \
   55929   "Resolved SR Conflicts" "                          " 10
   55930 at_xfail=no
   55931 (
   55932   $as_echo "186. $at_setup_line: testing $at_desc ..."
   55933   $at_traceon
   55934 
   55935 
   55936 
   55937 
   55938 cat >input.y <<'_ATEOF'
   55939 %token NUM OP
   55940 %left OP
   55941 %%
   55942 exp: exp OP exp | NUM;
   55943 _ATEOF
   55944 
   55945 
   55946 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   55947   at_save_special_files
   55948   mkdir xml-tests
   55949     # Don't combine these Bison invocations since we want to be sure that
   55950   # --report=all isn't required to get the full XML file.
   55951   { set +x
   55952 $as_echo "$at_srcdir/conflicts.at:664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   55953                   --graph=xml-tests/test.dot -o input.c --report=all input.y"
   55954 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:664"
   55955 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   55956                   --graph=xml-tests/test.dot -o input.c --report=all input.y
   55957 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55958 at_status=$? at_failed=false
   55959 $at_check_filter
   55960 echo stderr:; cat "$at_stderr"
   55961 echo stdout:; cat "$at_stdout"
   55962 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664"
   55963 $at_failed && at_fn_log_failure
   55964 $at_traceon; }
   55965 
   55966   { set +x
   55967 $as_echo "$at_srcdir/conflicts.at:664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y"
   55968 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:664"
   55969 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y
   55970 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55971 at_status=$? at_failed=false
   55972 $at_check_filter
   55973 echo stderr:; cat "$at_stderr"
   55974 echo stdout:; cat "$at_stdout"
   55975 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664"
   55976 $at_failed && at_fn_log_failure
   55977 $at_traceon; }
   55978 
   55979     cp xml-tests/test.output expout
   55980   { set +x
   55981 $as_echo "$at_srcdir/conflicts.at:664: \$XSLTPROC \\
   55982              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   55983              xml-tests/test.xml"
   55984 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:664"
   55985 ( $at_check_trace; $XSLTPROC \
   55986              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   55987              xml-tests/test.xml
   55988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   55989 at_status=$? at_failed=false
   55990 $at_check_filter
   55991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   55992 $at_diff expout "$at_stdout" || at_failed=:
   55993 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664"
   55994 $at_failed && at_fn_log_failure
   55995 $at_traceon; }
   55996 
   55997   sort xml-tests/test.dot > expout
   55998   { set +x
   55999 $as_echo "$at_srcdir/conflicts.at:664: \$XSLTPROC \\
   56000              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   56001              xml-tests/test.xml | sort"
   56002 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:664"
   56003 ( $at_check_trace; $XSLTPROC \
   56004              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   56005              xml-tests/test.xml | sort
   56006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56007 at_status=$? at_failed=false
   56008 $at_check_filter
   56009 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56010 $at_diff expout "$at_stdout" || at_failed=:
   56011 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664"
   56012 $at_failed && at_fn_log_failure
   56013 $at_traceon; }
   56014 
   56015   rm -rf xml-tests expout
   56016   at_restore_special_files
   56017 fi
   56018 { set +x
   56019 $as_echo "$at_srcdir/conflicts.at:664: bison -o input.c --report=all input.y"
   56020 at_fn_check_prepare_trace "conflicts.at:664"
   56021 ( $at_check_trace; bison -o input.c --report=all input.y
   56022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56023 at_status=$? at_failed=false
   56024 $at_check_filter
   56025 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56026 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56027 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:664"
   56028 $at_failed && at_fn_log_failure
   56029 $at_traceon; }
   56030 
   56031 
   56032 
   56033 # Check the contents of the report.
   56034 { set +x
   56035 $as_echo "$at_srcdir/conflicts.at:667: cat input.output"
   56036 at_fn_check_prepare_trace "conflicts.at:667"
   56037 ( $at_check_trace; cat input.output
   56038 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56039 at_status=$? at_failed=false
   56040 $at_check_filter
   56041 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56042 echo >>"$at_stdout"; $as_echo "Grammar
   56043 
   56044     0 \$accept: exp \$end
   56045 
   56046     1 exp: exp OP exp
   56047     2    | NUM
   56048 
   56049 
   56050 Terminals, with rules where they appear
   56051 
   56052 \$end (0) 0
   56053 error (256)
   56054 NUM (258) 2
   56055 OP (259) 1
   56056 
   56057 
   56058 Nonterminals, with rules where they appear
   56059 
   56060 \$accept (5)
   56061     on left: 0
   56062 exp (6)
   56063     on left: 1 2, on right: 0 1
   56064 
   56065 
   56066 State 0
   56067 
   56068     0 \$accept: . exp \$end
   56069     1 exp: . exp OP exp
   56070     2    | . NUM
   56071 
   56072     NUM  shift, and go to state 1
   56073 
   56074     exp  go to state 2
   56075 
   56076 
   56077 State 1
   56078 
   56079     2 exp: NUM .
   56080 
   56081     \$default  reduce using rule 2 (exp)
   56082 
   56083 
   56084 State 2
   56085 
   56086     0 \$accept: exp . \$end
   56087     1 exp: exp . OP exp
   56088 
   56089     \$end  shift, and go to state 3
   56090     OP    shift, and go to state 4
   56091 
   56092 
   56093 State 3
   56094 
   56095     0 \$accept: exp \$end .
   56096 
   56097     \$default  accept
   56098 
   56099 
   56100 State 4
   56101 
   56102     1 exp: . exp OP exp
   56103     1    | exp OP . exp
   56104     2    | . NUM
   56105 
   56106     NUM  shift, and go to state 1
   56107 
   56108     exp  go to state 5
   56109 
   56110 
   56111 State 5
   56112 
   56113     1 exp: exp . OP exp
   56114     1    | exp OP exp .  [\$end, OP]
   56115 
   56116     \$default  reduce using rule 1 (exp)
   56117 
   56118     Conflict between rule 1 and token OP resolved as reduce (%left OP).
   56119 " | \
   56120   $at_diff - "$at_stdout" || at_failed=:
   56121 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:667"
   56122 $at_failed && at_fn_log_failure
   56123 $at_traceon; }
   56124 
   56125 
   56126   set +x
   56127   $at_times_p && times >"$at_times_file"
   56128 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56129 read at_status <"$at_status_file"
   56130 #AT_STOP_186
   56131 #AT_START_187
   56132 at_fn_group_banner 187 'conflicts.at:775' \
   56133   "Defaulted Conflicted Reduction" "                 " 10
   56134 at_xfail=no
   56135 (
   56136   $as_echo "187. $at_setup_line: testing $at_desc ..."
   56137   $at_traceon
   56138 
   56139 
   56140 
   56141 cat >input.y <<'_ATEOF'
   56142 %%
   56143 exp: num | id;
   56144 num: '0';
   56145 id : '0';
   56146 %%
   56147 _ATEOF
   56148 
   56149 
   56150 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   56151   at_save_special_files
   56152   mkdir xml-tests
   56153     # Don't combine these Bison invocations since we want to be sure that
   56154   # --report=all isn't required to get the full XML file.
   56155   { set +x
   56156 $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   56157                   --graph=xml-tests/test.dot -o input.c --report=all input.y"
   56158 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:786"
   56159 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   56160                   --graph=xml-tests/test.dot -o input.c --report=all input.y
   56161 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56162 at_status=$? at_failed=false
   56163 $at_check_filter
   56164 echo stderr:; cat "$at_stderr"
   56165 echo stdout:; cat "$at_stdout"
   56166 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56167 $at_failed && at_fn_log_failure
   56168 $at_traceon; }
   56169 
   56170   { set +x
   56171 $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y"
   56172 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:786"
   56173 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y
   56174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56175 at_status=$? at_failed=false
   56176 $at_check_filter
   56177 echo stderr:; cat "$at_stderr"
   56178 echo stdout:; cat "$at_stdout"
   56179 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56180 $at_failed && at_fn_log_failure
   56181 $at_traceon; }
   56182 
   56183     cp xml-tests/test.output expout
   56184   { set +x
   56185 $as_echo "$at_srcdir/conflicts.at:786: \$XSLTPROC \\
   56186              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   56187              xml-tests/test.xml"
   56188 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:786"
   56189 ( $at_check_trace; $XSLTPROC \
   56190              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   56191              xml-tests/test.xml
   56192 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56193 at_status=$? at_failed=false
   56194 $at_check_filter
   56195 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56196 $at_diff expout "$at_stdout" || at_failed=:
   56197 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56198 $at_failed && at_fn_log_failure
   56199 $at_traceon; }
   56200 
   56201   sort xml-tests/test.dot > expout
   56202   { set +x
   56203 $as_echo "$at_srcdir/conflicts.at:786: \$XSLTPROC \\
   56204              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   56205              xml-tests/test.xml | sort"
   56206 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:786"
   56207 ( $at_check_trace; $XSLTPROC \
   56208              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   56209              xml-tests/test.xml | sort
   56210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56211 at_status=$? at_failed=false
   56212 $at_check_filter
   56213 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56214 $at_diff expout "$at_stdout" || at_failed=:
   56215 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56216 $at_failed && at_fn_log_failure
   56217 $at_traceon; }
   56218 
   56219   rm -rf xml-tests expout
   56220   at_restore_special_files
   56221 fi
   56222 { set +x
   56223 $as_echo "$at_srcdir/conflicts.at:786: bison -o input.c --report=all input.y"
   56224 at_fn_check_prepare_trace "conflicts.at:786"
   56225 ( $at_check_trace; bison -o input.c --report=all input.y
   56226 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56227 at_status=$? at_failed=false
   56228 $at_check_filter
   56229 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
   56230 input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
   56231 " | \
   56232   $at_diff - "$at_stderr" || at_failed=:
   56233 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56234 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56235 $at_failed && at_fn_log_failure
   56236 $at_traceon; }
   56237 
   56238 # Defining POSIXLY_CORRECT causes bison to complain if options are
   56239 # added after the grammar file name, so skip these checks in that
   56240 # case.
   56241 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   56242   at_save_special_files
   56243 
   56244   # To avoid expanding it repeatedly, store specified stdout.
   56245   : >expout
   56246 
   56247   # Run with -Werror.
   56248   { set +x
   56249 $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror"
   56250 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror" "conflicts.at:786"
   56251 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror
   56252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56253 at_status=$? at_failed=false
   56254 $at_check_filter
   56255 echo stderr:; tee stderr <"$at_stderr"
   56256 $at_diff expout "$at_stdout" || at_failed=:
   56257 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:786"
   56258 $at_failed && at_fn_log_failure
   56259 $at_traceon; }
   56260 
   56261 
   56262   # Build expected stderr up to and including the "warnings being
   56263   # treated as errors" message.
   56264   cat >at-bison-check-warnings <<'_ATEOF'
   56265 input.y: conflicts: 1 reduce/reduce
   56266 input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
   56267 _ATEOF
   56268 
   56269   at_bison_check_first=`sed -n \
   56270     '/: warning: /{=;q;}' at-bison-check-warnings`
   56271   : ${at_bison_check_first:=1}
   56272   at_bison_check_first_tmp=`sed -n \
   56273     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   56274   : ${at_bison_check_first_tmp:=1}
   56275   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   56276     at_bison_check_first=$at_bison_check_first_tmp
   56277   fi
   56278   if test $at_bison_check_first -gt 1; then
   56279     sed -n "1,`expr $at_bison_check_first - 1`"p \
   56280       at-bison-check-warnings > experr
   56281   fi
   56282   echo 'bison: warnings being treated as errors' >> experr
   56283 
   56284   # Finish building expected stderr and check.  Unlike warnings,
   56285   # complaints cause bison to exit early.  Thus, with -Werror, bison
   56286   # does not necessarily report all warnings that it does without
   56287   # -Werror, but it at least reports one.
   56288   at_bison_check_last=`sed -n '$=' stderr`
   56289   : ${at_bison_check_last:=1}
   56290   at_bison_check_last=`expr $at_bison_check_last - 1`
   56291   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   56292     at-bison-check-warnings >> experr
   56293   { set +x
   56294 $as_echo "$at_srcdir/conflicts.at:786: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   56295               stderr 1>&2"
   56296 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:786"
   56297 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   56298               stderr 1>&2
   56299 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56300 at_status=$? at_failed=false
   56301 $at_check_filter
   56302 $at_diff experr "$at_stderr" || at_failed=:
   56303 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56304 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56305 $at_failed && at_fn_log_failure
   56306 $at_traceon; }
   56307 
   56308 
   56309   # Now check --warnings=error.
   56310   cp stderr experr
   56311   { set +x
   56312 $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error"
   56313 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error" "conflicts.at:786"
   56314 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error
   56315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56316 at_status=$? at_failed=false
   56317 $at_check_filter
   56318 $at_diff experr "$at_stderr" || at_failed=:
   56319 $at_diff expout "$at_stdout" || at_failed=:
   56320 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:786"
   56321 $at_failed && at_fn_log_failure
   56322 $at_traceon; }
   56323 
   56324 
   56325   # Now check -Wnone and --warnings=none by making sure that
   56326   # -Werror doesn't change the exit status when -Wnone or
   56327   # --warnings=none is specified.
   56328   { set +x
   56329 $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror"
   56330 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror" "conflicts.at:786"
   56331 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror
   56332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56333 at_status=$? at_failed=false
   56334 $at_check_filter
   56335 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56336 $at_diff expout "$at_stdout" || at_failed=:
   56337 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56338 $at_failed && at_fn_log_failure
   56339 $at_traceon; }
   56340 
   56341   { set +x
   56342 $as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror"
   56343 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror" "conflicts.at:786"
   56344 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror
   56345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56346 at_status=$? at_failed=false
   56347 $at_check_filter
   56348 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56349 $at_diff expout "$at_stdout" || at_failed=:
   56350 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786"
   56351 $at_failed && at_fn_log_failure
   56352 $at_traceon; }
   56353 
   56354 
   56355   at_restore_special_files
   56356 fi
   56357 
   56358 # Check the contents of the report.
   56359 { set +x
   56360 $as_echo "$at_srcdir/conflicts.at:792: cat input.output"
   56361 at_fn_check_prepare_trace "conflicts.at:792"
   56362 ( $at_check_trace; cat input.output
   56363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56364 at_status=$? at_failed=false
   56365 $at_check_filter
   56366 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56367 echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts
   56368 
   56369     4 id: '0'
   56370 
   56371 
   56372 State 1 conflicts: 1 reduce/reduce
   56373 
   56374 
   56375 Grammar
   56376 
   56377     0 \$accept: exp \$end
   56378 
   56379     1 exp: num
   56380     2    | id
   56381 
   56382     3 num: '0'
   56383 
   56384     4 id: '0'
   56385 
   56386 
   56387 Terminals, with rules where they appear
   56388 
   56389 \$end (0) 0
   56390 '0' (48) 3 4
   56391 error (256)
   56392 
   56393 
   56394 Nonterminals, with rules where they appear
   56395 
   56396 \$accept (4)
   56397     on left: 0
   56398 exp (5)
   56399     on left: 1 2, on right: 0
   56400 num (6)
   56401     on left: 3, on right: 1
   56402 id (7)
   56403     on left: 4, on right: 2
   56404 
   56405 
   56406 State 0
   56407 
   56408     0 \$accept: . exp \$end
   56409     1 exp: . num
   56410     2    | . id
   56411     3 num: . '0'
   56412     4 id: . '0'
   56413 
   56414     '0'  shift, and go to state 1
   56415 
   56416     exp  go to state 2
   56417     num  go to state 3
   56418     id   go to state 4
   56419 
   56420 
   56421 State 1
   56422 
   56423     3 num: '0' .  [\$end]
   56424     4 id: '0' .  [\$end]
   56425 
   56426     \$end      reduce using rule 3 (num)
   56427     \$end      [reduce using rule 4 (id)]
   56428     \$default  reduce using rule 3 (num)
   56429 
   56430 
   56431 State 2
   56432 
   56433     0 \$accept: exp . \$end
   56434 
   56435     \$end  shift, and go to state 5
   56436 
   56437 
   56438 State 3
   56439 
   56440     1 exp: num .
   56441 
   56442     \$default  reduce using rule 1 (exp)
   56443 
   56444 
   56445 State 4
   56446 
   56447     2 exp: id .
   56448 
   56449     \$default  reduce using rule 2 (exp)
   56450 
   56451 
   56452 State 5
   56453 
   56454     0 \$accept: exp \$end .
   56455 
   56456     \$default  accept
   56457 " | \
   56458   $at_diff - "$at_stdout" || at_failed=:
   56459 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:792"
   56460 $at_failed && at_fn_log_failure
   56461 $at_traceon; }
   56462 
   56463 
   56464   set +x
   56465   $at_times_p && times >"$at_times_file"
   56466 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56467 read at_status <"$at_status_file"
   56468 #AT_STOP_187
   56469 #AT_START_188
   56470 at_fn_group_banner 188 'conflicts.at:894' \
   56471   "%expect not enough" "                             " 10
   56472 at_xfail=no
   56473 (
   56474   $as_echo "188. $at_setup_line: testing $at_desc ..."
   56475   $at_traceon
   56476 
   56477 
   56478 cat >input.y <<'_ATEOF'
   56479 %token NUM OP
   56480 %expect 0
   56481 %%
   56482 exp: exp OP exp | NUM;
   56483 _ATEOF
   56484 
   56485 
   56486 
   56487 { set +x
   56488 $as_echo "$at_srcdir/conflicts.at:903: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
   56489 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:903"
   56490 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
   56491 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56492 at_status=$? at_failed=false
   56493 $at_check_filter
   56494 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
   56495 input.y: error: expected 0 shift/reduce conflicts
   56496 " | \
   56497   $at_diff - "$at_stderr" || at_failed=:
   56498 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56499 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:903"
   56500 $at_failed && at_fn_log_failure
   56501 $at_traceon; }
   56502 
   56503 
   56504   set +x
   56505   $at_times_p && times >"$at_times_file"
   56506 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56507 read at_status <"$at_status_file"
   56508 #AT_STOP_188
   56509 #AT_START_189
   56510 at_fn_group_banner 189 'conflicts.at:914' \
   56511   "%expect right" "                                  " 10
   56512 at_xfail=no
   56513 (
   56514   $as_echo "189. $at_setup_line: testing $at_desc ..."
   56515   $at_traceon
   56516 
   56517 
   56518 cat >input.y <<'_ATEOF'
   56519 %token NUM OP
   56520 %expect 1
   56521 %%
   56522 exp: exp OP exp | NUM;
   56523 _ATEOF
   56524 
   56525 
   56526 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   56527   at_save_special_files
   56528   mkdir xml-tests
   56529     # Don't combine these Bison invocations since we want to be sure that
   56530   # --report=all isn't required to get the full XML file.
   56531   { set +x
   56532 $as_echo "$at_srcdir/conflicts.at:923: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   56533                   --graph=xml-tests/test.dot -o input.c input.y"
   56534 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:923"
   56535 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   56536                   --graph=xml-tests/test.dot -o input.c input.y
   56537 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56538 at_status=$? at_failed=false
   56539 $at_check_filter
   56540 echo stderr:; cat "$at_stderr"
   56541 echo stdout:; cat "$at_stdout"
   56542 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923"
   56543 $at_failed && at_fn_log_failure
   56544 $at_traceon; }
   56545 
   56546   { set +x
   56547 $as_echo "$at_srcdir/conflicts.at:923: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   56548 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:923"
   56549 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   56550 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56551 at_status=$? at_failed=false
   56552 $at_check_filter
   56553 echo stderr:; cat "$at_stderr"
   56554 echo stdout:; cat "$at_stdout"
   56555 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923"
   56556 $at_failed && at_fn_log_failure
   56557 $at_traceon; }
   56558 
   56559     cp xml-tests/test.output expout
   56560   { set +x
   56561 $as_echo "$at_srcdir/conflicts.at:923: \$XSLTPROC \\
   56562              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   56563              xml-tests/test.xml"
   56564 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:923"
   56565 ( $at_check_trace; $XSLTPROC \
   56566              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   56567              xml-tests/test.xml
   56568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56569 at_status=$? at_failed=false
   56570 $at_check_filter
   56571 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56572 $at_diff expout "$at_stdout" || at_failed=:
   56573 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923"
   56574 $at_failed && at_fn_log_failure
   56575 $at_traceon; }
   56576 
   56577   sort xml-tests/test.dot > expout
   56578   { set +x
   56579 $as_echo "$at_srcdir/conflicts.at:923: \$XSLTPROC \\
   56580              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   56581              xml-tests/test.xml | sort"
   56582 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:923"
   56583 ( $at_check_trace; $XSLTPROC \
   56584              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   56585              xml-tests/test.xml | sort
   56586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56587 at_status=$? at_failed=false
   56588 $at_check_filter
   56589 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56590 $at_diff expout "$at_stdout" || at_failed=:
   56591 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923"
   56592 $at_failed && at_fn_log_failure
   56593 $at_traceon; }
   56594 
   56595   rm -rf xml-tests expout
   56596   at_restore_special_files
   56597 fi
   56598 { set +x
   56599 $as_echo "$at_srcdir/conflicts.at:923: bison -o input.c input.y"
   56600 at_fn_check_prepare_trace "conflicts.at:923"
   56601 ( $at_check_trace; bison -o input.c input.y
   56602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56603 at_status=$? at_failed=false
   56604 $at_check_filter
   56605 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56606 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56607 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:923"
   56608 $at_failed && at_fn_log_failure
   56609 $at_traceon; }
   56610 
   56611 
   56612   set +x
   56613   $at_times_p && times >"$at_times_file"
   56614 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56615 read at_status <"$at_status_file"
   56616 #AT_STOP_189
   56617 #AT_START_190
   56618 at_fn_group_banner 190 'conflicts.at:931' \
   56619   "%expect too much" "                               " 10
   56620 at_xfail=no
   56621 (
   56622   $as_echo "190. $at_setup_line: testing $at_desc ..."
   56623   $at_traceon
   56624 
   56625 
   56626 cat >input.y <<'_ATEOF'
   56627 %token NUM OP
   56628 %expect 2
   56629 %%
   56630 exp: exp OP exp | NUM;
   56631 _ATEOF
   56632 
   56633 
   56634 
   56635 { set +x
   56636 $as_echo "$at_srcdir/conflicts.at:940: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
   56637 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:940"
   56638 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
   56639 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56640 at_status=$? at_failed=false
   56641 $at_check_filter
   56642 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
   56643 input.y: error: expected 2 shift/reduce conflicts
   56644 " | \
   56645   $at_diff - "$at_stderr" || at_failed=:
   56646 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56647 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:940"
   56648 $at_failed && at_fn_log_failure
   56649 $at_traceon; }
   56650 
   56651 
   56652   set +x
   56653   $at_times_p && times >"$at_times_file"
   56654 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56655 read at_status <"$at_status_file"
   56656 #AT_STOP_190
   56657 #AT_START_191
   56658 at_fn_group_banner 191 'conflicts.at:951' \
   56659   "%expect with reduce conflicts" "                  " 10
   56660 at_xfail=no
   56661 (
   56662   $as_echo "191. $at_setup_line: testing $at_desc ..."
   56663   $at_traceon
   56664 
   56665 
   56666 cat >input.y <<'_ATEOF'
   56667 %expect 0
   56668 %%
   56669 program: a 'a' | a a;
   56670 a: 'a';
   56671 _ATEOF
   56672 
   56673 
   56674 
   56675 { set +x
   56676 $as_echo "$at_srcdir/conflicts.at:960: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
   56677 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:960"
   56678 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
   56679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56680 at_status=$? at_failed=false
   56681 $at_check_filter
   56682 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
   56683 input.y: error: expected 0 reduce/reduce conflicts
   56684 " | \
   56685   $at_diff - "$at_stderr" || at_failed=:
   56686 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56687 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:960"
   56688 $at_failed && at_fn_log_failure
   56689 $at_traceon; }
   56690 
   56691 
   56692   set +x
   56693   $at_times_p && times >"$at_times_file"
   56694 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56695 read at_status <"$at_status_file"
   56696 #AT_STOP_191
   56697 #AT_START_192
   56698 at_fn_group_banner 192 'conflicts.at:971' \
   56699   "%prec with user string" "                         " 10
   56700 at_xfail=no
   56701 (
   56702   $as_echo "192. $at_setup_line: testing $at_desc ..."
   56703   $at_traceon
   56704 
   56705 
   56706 cat >input.y <<'_ATEOF'
   56707 %%
   56708 exp:
   56709   "foo" %prec "foo"
   56710 ;
   56711 _ATEOF
   56712 
   56713 
   56714 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   56715   at_save_special_files
   56716   mkdir xml-tests
   56717     # Don't combine these Bison invocations since we want to be sure that
   56718   # --report=all isn't required to get the full XML file.
   56719   { set +x
   56720 $as_echo "$at_srcdir/conflicts.at:980: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   56721                   --graph=xml-tests/test.dot -o input.c input.y"
   56722 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:980"
   56723 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   56724                   --graph=xml-tests/test.dot -o input.c input.y
   56725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56726 at_status=$? at_failed=false
   56727 $at_check_filter
   56728 echo stderr:; cat "$at_stderr"
   56729 echo stdout:; cat "$at_stdout"
   56730 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980"
   56731 $at_failed && at_fn_log_failure
   56732 $at_traceon; }
   56733 
   56734   { set +x
   56735 $as_echo "$at_srcdir/conflicts.at:980: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   56736 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:980"
   56737 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   56738 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56739 at_status=$? at_failed=false
   56740 $at_check_filter
   56741 echo stderr:; cat "$at_stderr"
   56742 echo stdout:; cat "$at_stdout"
   56743 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980"
   56744 $at_failed && at_fn_log_failure
   56745 $at_traceon; }
   56746 
   56747     cp xml-tests/test.output expout
   56748   { set +x
   56749 $as_echo "$at_srcdir/conflicts.at:980: \$XSLTPROC \\
   56750              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   56751              xml-tests/test.xml"
   56752 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:980"
   56753 ( $at_check_trace; $XSLTPROC \
   56754              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   56755              xml-tests/test.xml
   56756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56757 at_status=$? at_failed=false
   56758 $at_check_filter
   56759 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56760 $at_diff expout "$at_stdout" || at_failed=:
   56761 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980"
   56762 $at_failed && at_fn_log_failure
   56763 $at_traceon; }
   56764 
   56765   sort xml-tests/test.dot > expout
   56766   { set +x
   56767 $as_echo "$at_srcdir/conflicts.at:980: \$XSLTPROC \\
   56768              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   56769              xml-tests/test.xml | sort"
   56770 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:980"
   56771 ( $at_check_trace; $XSLTPROC \
   56772              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   56773              xml-tests/test.xml | sort
   56774 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56775 at_status=$? at_failed=false
   56776 $at_check_filter
   56777 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56778 $at_diff expout "$at_stdout" || at_failed=:
   56779 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980"
   56780 $at_failed && at_fn_log_failure
   56781 $at_traceon; }
   56782 
   56783   rm -rf xml-tests expout
   56784   at_restore_special_files
   56785 fi
   56786 { set +x
   56787 $as_echo "$at_srcdir/conflicts.at:980: bison -o input.c input.y"
   56788 at_fn_check_prepare_trace "conflicts.at:980"
   56789 ( $at_check_trace; bison -o input.c input.y
   56790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56791 at_status=$? at_failed=false
   56792 $at_check_filter
   56793 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56794 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56795 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980"
   56796 $at_failed && at_fn_log_failure
   56797 $at_traceon; }
   56798 
   56799 
   56800   set +x
   56801   $at_times_p && times >"$at_times_file"
   56802 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56803 read at_status <"$at_status_file"
   56804 #AT_STOP_192
   56805 #AT_START_193
   56806 at_fn_group_banner 193 'conflicts.at:988' \
   56807   "%no-default-prec without %prec" "                 " 10
   56808 at_xfail=no
   56809 (
   56810   $as_echo "193. $at_setup_line: testing $at_desc ..."
   56811   $at_traceon
   56812 
   56813 
   56814 cat >input.y <<'_ATEOF'
   56815 %left '+'
   56816 %left '*'
   56817 
   56818 %%
   56819 
   56820 %no-default-prec;
   56821 
   56822 e:   e '+' e
   56823    | e '*' e
   56824    | '0'
   56825    ;
   56826 _ATEOF
   56827 
   56828 
   56829 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   56830   at_save_special_files
   56831   mkdir xml-tests
   56832     # Don't combine these Bison invocations since we want to be sure that
   56833   # --report=all isn't required to get the full XML file.
   56834   { set +x
   56835 $as_echo "$at_srcdir/conflicts.at:1004: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   56836                   --graph=xml-tests/test.dot -o input.c input.y"
   56837 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1004"
   56838 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   56839                   --graph=xml-tests/test.dot -o input.c input.y
   56840 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56841 at_status=$? at_failed=false
   56842 $at_check_filter
   56843 echo stderr:; cat "$at_stderr"
   56844 echo stdout:; cat "$at_stdout"
   56845 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004"
   56846 $at_failed && at_fn_log_failure
   56847 $at_traceon; }
   56848 
   56849   { set +x
   56850 $as_echo "$at_srcdir/conflicts.at:1004: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   56851 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1004"
   56852 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   56853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56854 at_status=$? at_failed=false
   56855 $at_check_filter
   56856 echo stderr:; cat "$at_stderr"
   56857 echo stdout:; cat "$at_stdout"
   56858 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004"
   56859 $at_failed && at_fn_log_failure
   56860 $at_traceon; }
   56861 
   56862     cp xml-tests/test.output expout
   56863   { set +x
   56864 $as_echo "$at_srcdir/conflicts.at:1004: \$XSLTPROC \\
   56865              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   56866              xml-tests/test.xml"
   56867 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1004"
   56868 ( $at_check_trace; $XSLTPROC \
   56869              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   56870              xml-tests/test.xml
   56871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56872 at_status=$? at_failed=false
   56873 $at_check_filter
   56874 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56875 $at_diff expout "$at_stdout" || at_failed=:
   56876 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004"
   56877 $at_failed && at_fn_log_failure
   56878 $at_traceon; }
   56879 
   56880   sort xml-tests/test.dot > expout
   56881   { set +x
   56882 $as_echo "$at_srcdir/conflicts.at:1004: \$XSLTPROC \\
   56883              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   56884              xml-tests/test.xml | sort"
   56885 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1004"
   56886 ( $at_check_trace; $XSLTPROC \
   56887              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   56888              xml-tests/test.xml | sort
   56889 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56890 at_status=$? at_failed=false
   56891 $at_check_filter
   56892 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56893 $at_diff expout "$at_stdout" || at_failed=:
   56894 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004"
   56895 $at_failed && at_fn_log_failure
   56896 $at_traceon; }
   56897 
   56898   rm -rf xml-tests expout
   56899   at_restore_special_files
   56900 fi
   56901 { set +x
   56902 $as_echo "$at_srcdir/conflicts.at:1004: bison -o input.c input.y"
   56903 at_fn_check_prepare_trace "conflicts.at:1004"
   56904 ( $at_check_trace; bison -o input.c input.y
   56905 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56906 at_status=$? at_failed=false
   56907 $at_check_filter
   56908 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 4 shift/reduce
   56909 " | \
   56910   $at_diff - "$at_stderr" || at_failed=:
   56911 at_fn_diff_devnull "$at_stdout" || at_failed=:
   56912 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004"
   56913 $at_failed && at_fn_log_failure
   56914 $at_traceon; }
   56915 
   56916 
   56917   set +x
   56918   $at_times_p && times >"$at_times_file"
   56919 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   56920 read at_status <"$at_status_file"
   56921 #AT_STOP_193
   56922 #AT_START_194
   56923 at_fn_group_banner 194 'conflicts.at:1014' \
   56924   "%no-default-prec with %prec" "                    " 10
   56925 at_xfail=no
   56926 (
   56927   $as_echo "194. $at_setup_line: testing $at_desc ..."
   56928   $at_traceon
   56929 
   56930 
   56931 cat >input.y <<'_ATEOF'
   56932 %left '+'
   56933 %left '*'
   56934 
   56935 %%
   56936 
   56937 %no-default-prec;
   56938 
   56939 e:   e '+' e %prec '+'
   56940    | e '*' e %prec '*'
   56941    | '0'
   56942    ;
   56943 _ATEOF
   56944 
   56945 
   56946 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   56947   at_save_special_files
   56948   mkdir xml-tests
   56949     # Don't combine these Bison invocations since we want to be sure that
   56950   # --report=all isn't required to get the full XML file.
   56951   { set +x
   56952 $as_echo "$at_srcdir/conflicts.at:1030: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   56953                   --graph=xml-tests/test.dot -o input.c input.y"
   56954 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1030"
   56955 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   56956                   --graph=xml-tests/test.dot -o input.c input.y
   56957 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56958 at_status=$? at_failed=false
   56959 $at_check_filter
   56960 echo stderr:; cat "$at_stderr"
   56961 echo stdout:; cat "$at_stdout"
   56962 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030"
   56963 $at_failed && at_fn_log_failure
   56964 $at_traceon; }
   56965 
   56966   { set +x
   56967 $as_echo "$at_srcdir/conflicts.at:1030: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   56968 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1030"
   56969 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   56970 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56971 at_status=$? at_failed=false
   56972 $at_check_filter
   56973 echo stderr:; cat "$at_stderr"
   56974 echo stdout:; cat "$at_stdout"
   56975 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030"
   56976 $at_failed && at_fn_log_failure
   56977 $at_traceon; }
   56978 
   56979     cp xml-tests/test.output expout
   56980   { set +x
   56981 $as_echo "$at_srcdir/conflicts.at:1030: \$XSLTPROC \\
   56982              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   56983              xml-tests/test.xml"
   56984 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1030"
   56985 ( $at_check_trace; $XSLTPROC \
   56986              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   56987              xml-tests/test.xml
   56988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   56989 at_status=$? at_failed=false
   56990 $at_check_filter
   56991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   56992 $at_diff expout "$at_stdout" || at_failed=:
   56993 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030"
   56994 $at_failed && at_fn_log_failure
   56995 $at_traceon; }
   56996 
   56997   sort xml-tests/test.dot > expout
   56998   { set +x
   56999 $as_echo "$at_srcdir/conflicts.at:1030: \$XSLTPROC \\
   57000              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   57001              xml-tests/test.xml | sort"
   57002 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1030"
   57003 ( $at_check_trace; $XSLTPROC \
   57004              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   57005              xml-tests/test.xml | sort
   57006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57007 at_status=$? at_failed=false
   57008 $at_check_filter
   57009 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57010 $at_diff expout "$at_stdout" || at_failed=:
   57011 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030"
   57012 $at_failed && at_fn_log_failure
   57013 $at_traceon; }
   57014 
   57015   rm -rf xml-tests expout
   57016   at_restore_special_files
   57017 fi
   57018 { set +x
   57019 $as_echo "$at_srcdir/conflicts.at:1030: bison -o input.c input.y"
   57020 at_fn_check_prepare_trace "conflicts.at:1030"
   57021 ( $at_check_trace; bison -o input.c input.y
   57022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57023 at_status=$? at_failed=false
   57024 $at_check_filter
   57025 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57026 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57027 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1030"
   57028 $at_failed && at_fn_log_failure
   57029 $at_traceon; }
   57030 
   57031 
   57032   set +x
   57033   $at_times_p && times >"$at_times_file"
   57034 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   57035 read at_status <"$at_status_file"
   57036 #AT_STOP_194
   57037 #AT_START_195
   57038 at_fn_group_banner 195 'conflicts.at:1038' \
   57039   "%default-prec" "                                  " 10
   57040 at_xfail=no
   57041 (
   57042   $as_echo "195. $at_setup_line: testing $at_desc ..."
   57043   $at_traceon
   57044 
   57045 
   57046 cat >input.y <<'_ATEOF'
   57047 %left '+'
   57048 %left '*'
   57049 
   57050 %%
   57051 
   57052 %default-prec;
   57053 
   57054 e:   e '+' e
   57055    | e '*' e
   57056    | '0'
   57057    ;
   57058 _ATEOF
   57059 
   57060 
   57061 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   57062   at_save_special_files
   57063   mkdir xml-tests
   57064     # Don't combine these Bison invocations since we want to be sure that
   57065   # --report=all isn't required to get the full XML file.
   57066   { set +x
   57067 $as_echo "$at_srcdir/conflicts.at:1054: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   57068                   --graph=xml-tests/test.dot -o input.c input.y"
   57069 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1054"
   57070 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   57071                   --graph=xml-tests/test.dot -o input.c input.y
   57072 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57073 at_status=$? at_failed=false
   57074 $at_check_filter
   57075 echo stderr:; cat "$at_stderr"
   57076 echo stdout:; cat "$at_stdout"
   57077 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054"
   57078 $at_failed && at_fn_log_failure
   57079 $at_traceon; }
   57080 
   57081   { set +x
   57082 $as_echo "$at_srcdir/conflicts.at:1054: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   57083 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1054"
   57084 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   57085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57086 at_status=$? at_failed=false
   57087 $at_check_filter
   57088 echo stderr:; cat "$at_stderr"
   57089 echo stdout:; cat "$at_stdout"
   57090 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054"
   57091 $at_failed && at_fn_log_failure
   57092 $at_traceon; }
   57093 
   57094     cp xml-tests/test.output expout
   57095   { set +x
   57096 $as_echo "$at_srcdir/conflicts.at:1054: \$XSLTPROC \\
   57097              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   57098              xml-tests/test.xml"
   57099 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1054"
   57100 ( $at_check_trace; $XSLTPROC \
   57101              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   57102              xml-tests/test.xml
   57103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57104 at_status=$? at_failed=false
   57105 $at_check_filter
   57106 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57107 $at_diff expout "$at_stdout" || at_failed=:
   57108 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054"
   57109 $at_failed && at_fn_log_failure
   57110 $at_traceon; }
   57111 
   57112   sort xml-tests/test.dot > expout
   57113   { set +x
   57114 $as_echo "$at_srcdir/conflicts.at:1054: \$XSLTPROC \\
   57115              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   57116              xml-tests/test.xml | sort"
   57117 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1054"
   57118 ( $at_check_trace; $XSLTPROC \
   57119              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   57120              xml-tests/test.xml | sort
   57121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57122 at_status=$? at_failed=false
   57123 $at_check_filter
   57124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57125 $at_diff expout "$at_stdout" || at_failed=:
   57126 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054"
   57127 $at_failed && at_fn_log_failure
   57128 $at_traceon; }
   57129 
   57130   rm -rf xml-tests expout
   57131   at_restore_special_files
   57132 fi
   57133 { set +x
   57134 $as_echo "$at_srcdir/conflicts.at:1054: bison -o input.c input.y"
   57135 at_fn_check_prepare_trace "conflicts.at:1054"
   57136 ( $at_check_trace; bison -o input.c input.y
   57137 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57138 at_status=$? at_failed=false
   57139 $at_check_filter
   57140 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57141 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57142 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054"
   57143 $at_failed && at_fn_log_failure
   57144 $at_traceon; }
   57145 
   57146 
   57147   set +x
   57148   $at_times_p && times >"$at_times_file"
   57149 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   57150 read at_status <"$at_status_file"
   57151 #AT_STOP_195
   57152 #AT_START_196
   57153 at_fn_group_banner 196 'conflicts.at:1062' \
   57154   "Unreachable States After Conflict Resolution" "   " 10
   57155 at_xfail=no
   57156 (
   57157   $as_echo "196. $at_setup_line: testing $at_desc ..."
   57158   $at_traceon
   57159 
   57160 
   57161 # If conflict resolution makes states unreachable, remove those states, report
   57162 # rules that are then unused, and don't report conflicts in those states.  Test
   57163 # what happens when a nonterminal becomes useless as a result of state removal
   57164 # since that causes lalr.o's goto map to be rewritten.
   57165 
   57166 cat >input.y <<'_ATEOF'
   57167 %output "input.c"
   57168 %left 'a'
   57169 
   57170 %%
   57171 
   57172 start: resolved_conflict 'a' reported_conflicts 'a' ;
   57173 
   57174 /* S/R conflict resolved as reduce, so the state with item
   57175  * (resolved_conflict: 'a' . unreachable1) and all it transition successors are
   57176  * unreachable, and the associated production is useless.  */
   57177 resolved_conflict:
   57178     'a' unreachable1
   57179   | %prec 'a'
   57180   ;
   57181 
   57182 /* S/R conflict that need not be reported since it is unreachable because of
   57183  * the previous conflict resolution.  Nonterminal unreachable1 and all its
   57184  * productions are useless.  */
   57185 unreachable1:
   57186     'a' unreachable2
   57187   |
   57188   ;
   57189 
   57190 /* Likewise for a R/R conflict and nonterminal unreachable2.  */
   57191 unreachable2: | ;
   57192 
   57193 /* Make sure remaining S/R and R/R conflicts are still reported correctly even
   57194  * when their states are renumbered due to state removal.  */
   57195 reported_conflicts:
   57196     'a'
   57197   | 'a'
   57198   |
   57199   ;
   57200 
   57201 _ATEOF
   57202 
   57203 
   57204 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   57205   at_save_special_files
   57206   mkdir xml-tests
   57207     # Don't combine these Bison invocations since we want to be sure that
   57208   # --report=all isn't required to get the full XML file.
   57209   { set +x
   57210 $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   57211                   --graph=xml-tests/test.dot --report=all input.y"
   57212 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1106"
   57213 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   57214                   --graph=xml-tests/test.dot --report=all input.y
   57215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57216 at_status=$? at_failed=false
   57217 $at_check_filter
   57218 echo stderr:; cat "$at_stderr"
   57219 echo stdout:; cat "$at_stdout"
   57220 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57221 $at_failed && at_fn_log_failure
   57222 $at_traceon; }
   57223 
   57224   { set +x
   57225 $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y"
   57226 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" "conflicts.at:1106"
   57227 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y
   57228 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57229 at_status=$? at_failed=false
   57230 $at_check_filter
   57231 echo stderr:; cat "$at_stderr"
   57232 echo stdout:; cat "$at_stdout"
   57233 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57234 $at_failed && at_fn_log_failure
   57235 $at_traceon; }
   57236 
   57237     cp xml-tests/test.output expout
   57238   { set +x
   57239 $as_echo "$at_srcdir/conflicts.at:1106: \$XSLTPROC \\
   57240              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   57241              xml-tests/test.xml"
   57242 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1106"
   57243 ( $at_check_trace; $XSLTPROC \
   57244              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   57245              xml-tests/test.xml
   57246 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57247 at_status=$? at_failed=false
   57248 $at_check_filter
   57249 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57250 $at_diff expout "$at_stdout" || at_failed=:
   57251 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57252 $at_failed && at_fn_log_failure
   57253 $at_traceon; }
   57254 
   57255   sort xml-tests/test.dot > expout
   57256   { set +x
   57257 $as_echo "$at_srcdir/conflicts.at:1106: \$XSLTPROC \\
   57258              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   57259              xml-tests/test.xml | sort"
   57260 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1106"
   57261 ( $at_check_trace; $XSLTPROC \
   57262              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   57263              xml-tests/test.xml | sort
   57264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57265 at_status=$? at_failed=false
   57266 $at_check_filter
   57267 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57268 $at_diff expout "$at_stdout" || at_failed=:
   57269 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57270 $at_failed && at_fn_log_failure
   57271 $at_traceon; }
   57272 
   57273   rm -rf xml-tests expout
   57274   at_restore_special_files
   57275 fi
   57276 { set +x
   57277 $as_echo "$at_srcdir/conflicts.at:1106: bison --report=all input.y"
   57278 at_fn_check_prepare_trace "conflicts.at:1106"
   57279 ( $at_check_trace; bison --report=all input.y
   57280 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57281 at_status=$? at_failed=false
   57282 $at_check_filter
   57283 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
   57284 input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
   57285 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
   57286 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
   57287 input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
   57288 input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
   57289 input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
   57290 input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
   57291 " | \
   57292   $at_diff - "$at_stderr" || at_failed=:
   57293 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57294 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57295 $at_failed && at_fn_log_failure
   57296 $at_traceon; }
   57297 
   57298 # Defining POSIXLY_CORRECT causes bison to complain if options are
   57299 # added after the grammar file name, so skip these checks in that
   57300 # case.
   57301 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   57302   at_save_special_files
   57303 
   57304   # To avoid expanding it repeatedly, store specified stdout.
   57305   : >expout
   57306 
   57307   # Run with -Werror.
   57308   { set +x
   57309 $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Werror"
   57310 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Werror" "conflicts.at:1106"
   57311 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y -Werror
   57312 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57313 at_status=$? at_failed=false
   57314 $at_check_filter
   57315 echo stderr:; tee stderr <"$at_stderr"
   57316 $at_diff expout "$at_stdout" || at_failed=:
   57317 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1106"
   57318 $at_failed && at_fn_log_failure
   57319 $at_traceon; }
   57320 
   57321 
   57322   # Build expected stderr up to and including the "warnings being
   57323   # treated as errors" message.
   57324   cat >at-bison-check-warnings <<'_ATEOF'
   57325 input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
   57326 input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
   57327 input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
   57328 input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
   57329 input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
   57330 input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
   57331 input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
   57332 input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
   57333 _ATEOF
   57334 
   57335   at_bison_check_first=`sed -n \
   57336     '/: warning: /{=;q;}' at-bison-check-warnings`
   57337   : ${at_bison_check_first:=1}
   57338   at_bison_check_first_tmp=`sed -n \
   57339     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   57340   : ${at_bison_check_first_tmp:=1}
   57341   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   57342     at_bison_check_first=$at_bison_check_first_tmp
   57343   fi
   57344   if test $at_bison_check_first -gt 1; then
   57345     sed -n "1,`expr $at_bison_check_first - 1`"p \
   57346       at-bison-check-warnings > experr
   57347   fi
   57348   echo 'bison: warnings being treated as errors' >> experr
   57349 
   57350   # Finish building expected stderr and check.  Unlike warnings,
   57351   # complaints cause bison to exit early.  Thus, with -Werror, bison
   57352   # does not necessarily report all warnings that it does without
   57353   # -Werror, but it at least reports one.
   57354   at_bison_check_last=`sed -n '$=' stderr`
   57355   : ${at_bison_check_last:=1}
   57356   at_bison_check_last=`expr $at_bison_check_last - 1`
   57357   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   57358     at-bison-check-warnings >> experr
   57359   { set +x
   57360 $as_echo "$at_srcdir/conflicts.at:1106: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   57361               stderr 1>&2"
   57362 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1106"
   57363 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   57364               stderr 1>&2
   57365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57366 at_status=$? at_failed=false
   57367 $at_check_filter
   57368 $at_diff experr "$at_stderr" || at_failed=:
   57369 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57370 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57371 $at_failed && at_fn_log_failure
   57372 $at_traceon; }
   57373 
   57374 
   57375   # Now check --warnings=error.
   57376   cp stderr experr
   57377   { set +x
   57378 $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error"
   57379 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error" "conflicts.at:1106"
   57380 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error
   57381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57382 at_status=$? at_failed=false
   57383 $at_check_filter
   57384 $at_diff experr "$at_stderr" || at_failed=:
   57385 $at_diff expout "$at_stdout" || at_failed=:
   57386 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1106"
   57387 $at_failed && at_fn_log_failure
   57388 $at_traceon; }
   57389 
   57390 
   57391   # Now check -Wnone and --warnings=none by making sure that
   57392   # -Werror doesn't change the exit status when -Wnone or
   57393   # --warnings=none is specified.
   57394   { set +x
   57395 $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror"
   57396 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror" "conflicts.at:1106"
   57397 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror
   57398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57399 at_status=$? at_failed=false
   57400 $at_check_filter
   57401 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57402 $at_diff expout "$at_stdout" || at_failed=:
   57403 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57404 $at_failed && at_fn_log_failure
   57405 $at_traceon; }
   57406 
   57407   { set +x
   57408 $as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror"
   57409 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror" "conflicts.at:1106"
   57410 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror
   57411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57412 at_status=$? at_failed=false
   57413 $at_check_filter
   57414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57415 $at_diff expout "$at_stdout" || at_failed=:
   57416 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106"
   57417 $at_failed && at_fn_log_failure
   57418 $at_traceon; }
   57419 
   57420 
   57421   at_restore_special_files
   57422 fi
   57423 
   57424 { set +x
   57425 $as_echo "$at_srcdir/conflicts.at:1117: cat input.output"
   57426 at_fn_check_prepare_trace "conflicts.at:1117"
   57427 ( $at_check_trace; cat input.output
   57428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57429 at_status=$? at_failed=false
   57430 $at_check_filter
   57431 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57432 echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts
   57433 
   57434     2 resolved_conflict: 'a' unreachable1
   57435 
   57436     4 unreachable1: 'a' unreachable2
   57437     5             | /* empty */
   57438 
   57439     6 unreachable2: /* empty */
   57440     7             | /* empty */
   57441 
   57442     9 reported_conflicts: 'a'
   57443    10                   | /* empty */
   57444 
   57445 
   57446 State 4 conflicts: 1 shift/reduce
   57447 State 5 conflicts: 1 reduce/reduce
   57448 
   57449 
   57450 Grammar
   57451 
   57452     0 \$accept: start \$end
   57453 
   57454     1 start: resolved_conflict 'a' reported_conflicts 'a'
   57455 
   57456     2 resolved_conflict: 'a' unreachable1
   57457     3                  | /* empty */
   57458 
   57459     4 unreachable1: 'a' unreachable2
   57460     5             | /* empty */
   57461 
   57462     6 unreachable2: /* empty */
   57463     7             | /* empty */
   57464 
   57465     8 reported_conflicts: 'a'
   57466     9                   | 'a'
   57467    10                   | /* empty */
   57468 
   57469 
   57470 Terminals, with rules where they appear
   57471 
   57472 \$end (0) 0
   57473 'a' (97) 1 2 4 8 9
   57474 error (256)
   57475 
   57476 
   57477 Nonterminals, with rules where they appear
   57478 
   57479 \$accept (4)
   57480     on left: 0
   57481 start (5)
   57482     on left: 1, on right: 0
   57483 resolved_conflict (6)
   57484     on left: 2 3, on right: 1
   57485 unreachable1 (7)
   57486     on left: 4 5, on right: 2
   57487 unreachable2 (8)
   57488     on left: 6 7, on right: 4
   57489 reported_conflicts (9)
   57490     on left: 8 9 10, on right: 1
   57491 
   57492 
   57493 State 0
   57494 
   57495     0 \$accept: . start \$end
   57496     1 start: . resolved_conflict 'a' reported_conflicts 'a'
   57497     2 resolved_conflict: . 'a' unreachable1
   57498     3                  | .  ['a']
   57499 
   57500     \$default  reduce using rule 3 (resolved_conflict)
   57501 
   57502     start              go to state 1
   57503     resolved_conflict  go to state 2
   57504 
   57505     Conflict between rule 3 and token 'a' resolved as reduce (%left 'a').
   57506 
   57507 
   57508 State 1
   57509 
   57510     0 \$accept: start . \$end
   57511 
   57512     \$end  shift, and go to state 3
   57513 
   57514 
   57515 State 2
   57516 
   57517     1 start: resolved_conflict . 'a' reported_conflicts 'a'
   57518 
   57519     'a'  shift, and go to state 4
   57520 
   57521 
   57522 State 3
   57523 
   57524     0 \$accept: start \$end .
   57525 
   57526     \$default  accept
   57527 
   57528 
   57529 State 4
   57530 
   57531     1 start: resolved_conflict 'a' . reported_conflicts 'a'
   57532     8 reported_conflicts: . 'a'
   57533     9                   | . 'a'
   57534    10                   | .  ['a']
   57535 
   57536     'a'  shift, and go to state 5
   57537 
   57538     'a'  [reduce using rule 10 (reported_conflicts)]
   57539 
   57540     reported_conflicts  go to state 6
   57541 
   57542 
   57543 State 5
   57544 
   57545     8 reported_conflicts: 'a' .  ['a']
   57546     9                   | 'a' .  ['a']
   57547 
   57548     'a'       reduce using rule 8 (reported_conflicts)
   57549     'a'       [reduce using rule 9 (reported_conflicts)]
   57550     \$default  reduce using rule 8 (reported_conflicts)
   57551 
   57552 
   57553 State 6
   57554 
   57555     1 start: resolved_conflict 'a' reported_conflicts . 'a'
   57556 
   57557     'a'  shift, and go to state 7
   57558 
   57559 
   57560 State 7
   57561 
   57562     1 start: resolved_conflict 'a' reported_conflicts 'a' .
   57563 
   57564     \$default  reduce using rule 1 (start)
   57565 " | \
   57566   $at_diff - "$at_stdout" || at_failed=:
   57567 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1117"
   57568 $at_failed && at_fn_log_failure
   57569 $at_traceon; }
   57570 
   57571 
   57572 cat >input-keep.y <<'_ATEOF'
   57573 %define lr.keep-unreachable-states
   57574 _ATEOF
   57575 
   57576 { set +x
   57577 $as_echo "$at_srcdir/conflicts.at:1256: cat input.y >> input-keep.y"
   57578 at_fn_check_prepare_trace "conflicts.at:1256"
   57579 ( $at_check_trace; cat input.y >> input-keep.y
   57580 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57581 at_status=$? at_failed=false
   57582 $at_check_filter
   57583 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57584 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57585 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1256"
   57586 $at_failed && at_fn_log_failure
   57587 $at_traceon; }
   57588 
   57589 
   57590 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   57591   at_save_special_files
   57592   mkdir xml-tests
   57593     # Don't combine these Bison invocations since we want to be sure that
   57594   # --report=all isn't required to get the full XML file.
   57595   { set +x
   57596 $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   57597                   --graph=xml-tests/test.dot input-keep.y"
   57598 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1258"
   57599 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   57600                   --graph=xml-tests/test.dot input-keep.y
   57601 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57602 at_status=$? at_failed=false
   57603 $at_check_filter
   57604 echo stderr:; cat "$at_stderr"
   57605 echo stdout:; cat "$at_stdout"
   57606 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57607 $at_failed && at_fn_log_failure
   57608 $at_traceon; }
   57609 
   57610   { set +x
   57611 $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y"
   57612 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y" "conflicts.at:1258"
   57613 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y
   57614 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57615 at_status=$? at_failed=false
   57616 $at_check_filter
   57617 echo stderr:; cat "$at_stderr"
   57618 echo stdout:; cat "$at_stdout"
   57619 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57620 $at_failed && at_fn_log_failure
   57621 $at_traceon; }
   57622 
   57623     cp xml-tests/test.output expout
   57624   { set +x
   57625 $as_echo "$at_srcdir/conflicts.at:1258: \$XSLTPROC \\
   57626              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   57627              xml-tests/test.xml"
   57628 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1258"
   57629 ( $at_check_trace; $XSLTPROC \
   57630              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   57631              xml-tests/test.xml
   57632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57633 at_status=$? at_failed=false
   57634 $at_check_filter
   57635 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57636 $at_diff expout "$at_stdout" || at_failed=:
   57637 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57638 $at_failed && at_fn_log_failure
   57639 $at_traceon; }
   57640 
   57641   sort xml-tests/test.dot > expout
   57642   { set +x
   57643 $as_echo "$at_srcdir/conflicts.at:1258: \$XSLTPROC \\
   57644              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   57645              xml-tests/test.xml | sort"
   57646 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1258"
   57647 ( $at_check_trace; $XSLTPROC \
   57648              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   57649              xml-tests/test.xml | sort
   57650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57651 at_status=$? at_failed=false
   57652 $at_check_filter
   57653 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57654 $at_diff expout "$at_stdout" || at_failed=:
   57655 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57656 $at_failed && at_fn_log_failure
   57657 $at_traceon; }
   57658 
   57659   rm -rf xml-tests expout
   57660   at_restore_special_files
   57661 fi
   57662 { set +x
   57663 $as_echo "$at_srcdir/conflicts.at:1258: bison input-keep.y"
   57664 at_fn_check_prepare_trace "conflicts.at:1258"
   57665 ( $at_check_trace; bison input-keep.y
   57666 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57667 at_status=$? at_failed=false
   57668 $at_check_filter
   57669 echo >>"$at_stderr"; $as_echo "input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
   57670 input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
   57671 input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
   57672 input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
   57673 input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
   57674 " | \
   57675   $at_diff - "$at_stderr" || at_failed=:
   57676 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57677 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57678 $at_failed && at_fn_log_failure
   57679 $at_traceon; }
   57680 
   57681 # Defining POSIXLY_CORRECT causes bison to complain if options are
   57682 # added after the grammar file name, so skip these checks in that
   57683 # case.
   57684 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   57685   at_save_special_files
   57686 
   57687   # To avoid expanding it repeatedly, store specified stdout.
   57688   : >expout
   57689 
   57690   # Run with -Werror.
   57691   { set +x
   57692 $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Werror"
   57693 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Werror" "conflicts.at:1258"
   57694 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y -Werror
   57695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57696 at_status=$? at_failed=false
   57697 $at_check_filter
   57698 echo stderr:; tee stderr <"$at_stderr"
   57699 $at_diff expout "$at_stdout" || at_failed=:
   57700 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1258"
   57701 $at_failed && at_fn_log_failure
   57702 $at_traceon; }
   57703 
   57704 
   57705   # Build expected stderr up to and including the "warnings being
   57706   # treated as errors" message.
   57707   cat >at-bison-check-warnings <<'_ATEOF'
   57708 input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
   57709 input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
   57710 input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
   57711 input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
   57712 input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
   57713 _ATEOF
   57714 
   57715   at_bison_check_first=`sed -n \
   57716     '/: warning: /{=;q;}' at-bison-check-warnings`
   57717   : ${at_bison_check_first:=1}
   57718   at_bison_check_first_tmp=`sed -n \
   57719     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   57720   : ${at_bison_check_first_tmp:=1}
   57721   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   57722     at_bison_check_first=$at_bison_check_first_tmp
   57723   fi
   57724   if test $at_bison_check_first -gt 1; then
   57725     sed -n "1,`expr $at_bison_check_first - 1`"p \
   57726       at-bison-check-warnings > experr
   57727   fi
   57728   echo 'bison: warnings being treated as errors' >> experr
   57729 
   57730   # Finish building expected stderr and check.  Unlike warnings,
   57731   # complaints cause bison to exit early.  Thus, with -Werror, bison
   57732   # does not necessarily report all warnings that it does without
   57733   # -Werror, but it at least reports one.
   57734   at_bison_check_last=`sed -n '$=' stderr`
   57735   : ${at_bison_check_last:=1}
   57736   at_bison_check_last=`expr $at_bison_check_last - 1`
   57737   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   57738     at-bison-check-warnings >> experr
   57739   { set +x
   57740 $as_echo "$at_srcdir/conflicts.at:1258: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   57741               stderr 1>&2"
   57742 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1258"
   57743 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   57744               stderr 1>&2
   57745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57746 at_status=$? at_failed=false
   57747 $at_check_filter
   57748 $at_diff experr "$at_stderr" || at_failed=:
   57749 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57750 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57751 $at_failed && at_fn_log_failure
   57752 $at_traceon; }
   57753 
   57754 
   57755   # Now check --warnings=error.
   57756   cp stderr experr
   57757   { set +x
   57758 $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=error"
   57759 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=error" "conflicts.at:1258"
   57760 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y --warnings=error
   57761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57762 at_status=$? at_failed=false
   57763 $at_check_filter
   57764 $at_diff experr "$at_stderr" || at_failed=:
   57765 $at_diff expout "$at_stdout" || at_failed=:
   57766 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1258"
   57767 $at_failed && at_fn_log_failure
   57768 $at_traceon; }
   57769 
   57770 
   57771   # Now check -Wnone and --warnings=none by making sure that
   57772   # -Werror doesn't change the exit status when -Wnone or
   57773   # --warnings=none is specified.
   57774   { set +x
   57775 $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror"
   57776 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror" "conflicts.at:1258"
   57777 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror
   57778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57779 at_status=$? at_failed=false
   57780 $at_check_filter
   57781 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57782 $at_diff expout "$at_stdout" || at_failed=:
   57783 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57784 $at_failed && at_fn_log_failure
   57785 $at_traceon; }
   57786 
   57787   { set +x
   57788 $as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror"
   57789 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror" "conflicts.at:1258"
   57790 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror
   57791 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57792 at_status=$? at_failed=false
   57793 $at_check_filter
   57794 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57795 $at_diff expout "$at_stdout" || at_failed=:
   57796 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258"
   57797 $at_failed && at_fn_log_failure
   57798 $at_traceon; }
   57799 
   57800 
   57801   at_restore_special_files
   57802 fi
   57803 
   57804   set +x
   57805   $at_times_p && times >"$at_times_file"
   57806 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   57807 read at_status <"$at_status_file"
   57808 #AT_STOP_196
   57809 #AT_START_197
   57810 at_fn_group_banner 197 'conflicts.at:1273' \
   57811   "Solved conflicts report for multiple reductions in a state" "" 10
   57812 at_xfail=no
   57813 (
   57814   $as_echo "197. $at_setup_line: testing $at_desc ..."
   57815   $at_traceon
   57816 
   57817 
   57818 # Used to lose earlier solved conflict messages even within a single S/R/R.
   57819 
   57820 cat >input.y <<'_ATEOF'
   57821 %left 'a'
   57822 %right 'b'
   57823 %right 'c'
   57824 %right 'd'
   57825 %%
   57826 start:
   57827     'a'
   57828   | empty_a 'a'
   57829   | 'b'
   57830   | empty_b 'b'
   57831   | 'c'
   57832   | empty_c1 'c'
   57833   | empty_c2 'c'
   57834   | empty_c3 'c'
   57835   ;
   57836 empty_a: %prec 'a' ;
   57837 empty_b: %prec 'b' ;
   57838 empty_c1: %prec 'c' ;
   57839 empty_c2: %prec 'c' ;
   57840 empty_c3: %prec 'd' ;
   57841 _ATEOF
   57842 
   57843 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   57844   at_save_special_files
   57845   mkdir xml-tests
   57846     # Don't combine these Bison invocations since we want to be sure that
   57847   # --report=all isn't required to get the full XML file.
   57848   { set +x
   57849 $as_echo "$at_srcdir/conflicts.at:1299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   57850                   --graph=xml-tests/test.dot --report=all -o input.c input.y"
   57851 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1299"
   57852 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   57853                   --graph=xml-tests/test.dot --report=all -o input.c input.y
   57854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57855 at_status=$? at_failed=false
   57856 $at_check_filter
   57857 echo stderr:; cat "$at_stderr"
   57858 echo stdout:; cat "$at_stdout"
   57859 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299"
   57860 $at_failed && at_fn_log_failure
   57861 $at_traceon; }
   57862 
   57863   { set +x
   57864 $as_echo "$at_srcdir/conflicts.at:1299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y"
   57865 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1299"
   57866 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y
   57867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57868 at_status=$? at_failed=false
   57869 $at_check_filter
   57870 echo stderr:; cat "$at_stderr"
   57871 echo stdout:; cat "$at_stdout"
   57872 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299"
   57873 $at_failed && at_fn_log_failure
   57874 $at_traceon; }
   57875 
   57876     cp xml-tests/test.output expout
   57877   { set +x
   57878 $as_echo "$at_srcdir/conflicts.at:1299: \$XSLTPROC \\
   57879              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   57880              xml-tests/test.xml"
   57881 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1299"
   57882 ( $at_check_trace; $XSLTPROC \
   57883              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   57884              xml-tests/test.xml
   57885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57886 at_status=$? at_failed=false
   57887 $at_check_filter
   57888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57889 $at_diff expout "$at_stdout" || at_failed=:
   57890 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299"
   57891 $at_failed && at_fn_log_failure
   57892 $at_traceon; }
   57893 
   57894   sort xml-tests/test.dot > expout
   57895   { set +x
   57896 $as_echo "$at_srcdir/conflicts.at:1299: \$XSLTPROC \\
   57897              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   57898              xml-tests/test.xml | sort"
   57899 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1299"
   57900 ( $at_check_trace; $XSLTPROC \
   57901              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   57902              xml-tests/test.xml | sort
   57903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57904 at_status=$? at_failed=false
   57905 $at_check_filter
   57906 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57907 $at_diff expout "$at_stdout" || at_failed=:
   57908 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299"
   57909 $at_failed && at_fn_log_failure
   57910 $at_traceon; }
   57911 
   57912   rm -rf xml-tests expout
   57913   at_restore_special_files
   57914 fi
   57915 { set +x
   57916 $as_echo "$at_srcdir/conflicts.at:1299: bison --report=all -o input.c input.y"
   57917 at_fn_check_prepare_trace "conflicts.at:1299"
   57918 ( $at_check_trace; bison --report=all -o input.c input.y
   57919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57920 at_status=$? at_failed=false
   57921 $at_check_filter
   57922 echo stderr:; cat "$at_stderr"
   57923 at_fn_diff_devnull "$at_stdout" || at_failed=:
   57924 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299"
   57925 $at_failed && at_fn_log_failure
   57926 $at_traceon; }
   57927 
   57928 
   57929 { set +x
   57930 $as_echo "$at_srcdir/conflicts.at:1300: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
   57931 at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1300"
   57932 ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p'
   57933 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   57934 at_status=$? at_failed=false
   57935 $at_check_filter
   57936 at_fn_diff_devnull "$at_stderr" || at_failed=:
   57937 echo >>"$at_stdout"; $as_echo "State 0
   57938 
   57939     0 \$accept: . start \$end
   57940     1 start: . 'a'
   57941     2      | . empty_a 'a'
   57942     3      | . 'b'
   57943     4      | . empty_b 'b'
   57944     5      | . 'c'
   57945     6      | . empty_c1 'c'
   57946     7      | . empty_c2 'c'
   57947     8      | . empty_c3 'c'
   57948     9 empty_a: .  ['a']
   57949    10 empty_b: .  []
   57950    11 empty_c1: .  []
   57951    12 empty_c2: .  []
   57952    13 empty_c3: .  ['c']
   57953 
   57954     'b'  shift, and go to state 1
   57955 
   57956     'c'       reduce using rule 13 (empty_c3)
   57957     \$default  reduce using rule 9 (empty_a)
   57958 
   57959     start     go to state 2
   57960     empty_a   go to state 3
   57961     empty_b   go to state 4
   57962     empty_c1  go to state 5
   57963     empty_c2  go to state 6
   57964     empty_c3  go to state 7
   57965 
   57966     Conflict between rule 9 and token 'a' resolved as reduce (%left 'a').
   57967     Conflict between rule 10 and token 'b' resolved as shift (%right 'b').
   57968     Conflict between rule 11 and token 'c' resolved as shift (%right 'c').
   57969     Conflict between rule 12 and token 'c' resolved as shift (%right 'c').
   57970     Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd').
   57971 
   57972 
   57973 State 1
   57974 " | \
   57975   $at_diff - "$at_stdout" || at_failed=:
   57976 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1300"
   57977 $at_failed && at_fn_log_failure
   57978 $at_traceon; }
   57979 
   57980 
   57981   set +x
   57982   $at_times_p && times >"$at_times_file"
   57983 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   57984 read at_status <"$at_status_file"
   57985 #AT_STOP_197
   57986 #AT_START_198
   57987 at_fn_group_banner 198 'conflicts.at:1353' \
   57988   "%nonassoc error actions for multiple reductions in a state" "" 10
   57989 at_xfail=no
   57990 (
   57991   $as_echo "198. $at_setup_line: testing $at_desc ..."
   57992   $at_traceon
   57993 
   57994 
   57995 cat >input.y <<'_ATEOF'
   57996 %nonassoc 'a' 'b' 'c'
   57997 %%
   57998 start:
   57999     'a'
   58000   | empty_a 'a'
   58001   | 'b'
   58002   | empty_b 'b'
   58003   | 'c'
   58004   | empty_c1 'c'
   58005   | empty_c2 'c'
   58006   | empty_c3 'c'
   58007   ;
   58008 empty_a: %prec 'a' ;
   58009 empty_b: %prec 'b' ;
   58010 empty_c1: %prec 'c' ;
   58011 empty_c2: %prec 'c' ;
   58012 empty_c3: %prec 'c' ;
   58013 _ATEOF
   58014 
   58015 
   58016 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58017   at_save_special_files
   58018   mkdir xml-tests
   58019     # Don't combine these Bison invocations since we want to be sure that
   58020   # --report=all isn't required to get the full XML file.
   58021   { set +x
   58022 $as_echo "$at_srcdir/conflicts.at:1375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58023                   --graph=xml-tests/test.dot --report=all -o input.c input.y"
   58024 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1375"
   58025 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58026                   --graph=xml-tests/test.dot --report=all -o input.c input.y
   58027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58028 at_status=$? at_failed=false
   58029 $at_check_filter
   58030 echo stderr:; cat "$at_stderr"
   58031 echo stdout:; cat "$at_stdout"
   58032 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375"
   58033 $at_failed && at_fn_log_failure
   58034 $at_traceon; }
   58035 
   58036   { set +x
   58037 $as_echo "$at_srcdir/conflicts.at:1375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y"
   58038 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1375"
   58039 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y
   58040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58041 at_status=$? at_failed=false
   58042 $at_check_filter
   58043 echo stderr:; cat "$at_stderr"
   58044 echo stdout:; cat "$at_stdout"
   58045 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375"
   58046 $at_failed && at_fn_log_failure
   58047 $at_traceon; }
   58048 
   58049     cp xml-tests/test.output expout
   58050   { set +x
   58051 $as_echo "$at_srcdir/conflicts.at:1375: \$XSLTPROC \\
   58052              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   58053              xml-tests/test.xml"
   58054 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1375"
   58055 ( $at_check_trace; $XSLTPROC \
   58056              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   58057              xml-tests/test.xml
   58058 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58059 at_status=$? at_failed=false
   58060 $at_check_filter
   58061 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58062 $at_diff expout "$at_stdout" || at_failed=:
   58063 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375"
   58064 $at_failed && at_fn_log_failure
   58065 $at_traceon; }
   58066 
   58067   sort xml-tests/test.dot > expout
   58068   { set +x
   58069 $as_echo "$at_srcdir/conflicts.at:1375: \$XSLTPROC \\
   58070              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   58071              xml-tests/test.xml | sort"
   58072 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1375"
   58073 ( $at_check_trace; $XSLTPROC \
   58074              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   58075              xml-tests/test.xml | sort
   58076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58077 at_status=$? at_failed=false
   58078 $at_check_filter
   58079 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58080 $at_diff expout "$at_stdout" || at_failed=:
   58081 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375"
   58082 $at_failed && at_fn_log_failure
   58083 $at_traceon; }
   58084 
   58085   rm -rf xml-tests expout
   58086   at_restore_special_files
   58087 fi
   58088 { set +x
   58089 $as_echo "$at_srcdir/conflicts.at:1375: bison --report=all -o input.c input.y"
   58090 at_fn_check_prepare_trace "conflicts.at:1375"
   58091 ( $at_check_trace; bison --report=all -o input.c input.y
   58092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58093 at_status=$? at_failed=false
   58094 $at_check_filter
   58095 echo stderr:; cat "$at_stderr"
   58096 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58097 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375"
   58098 $at_failed && at_fn_log_failure
   58099 $at_traceon; }
   58100 
   58101 
   58102 { set +x
   58103 $as_echo "$at_srcdir/conflicts.at:1376: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
   58104 at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1376"
   58105 ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p'
   58106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58107 at_status=$? at_failed=false
   58108 $at_check_filter
   58109 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58110 echo >>"$at_stdout"; $as_echo "State 0
   58111 
   58112     0 \$accept: . start \$end
   58113     1 start: . 'a'
   58114     2      | . empty_a 'a'
   58115     3      | . 'b'
   58116     4      | . empty_b 'b'
   58117     5      | . 'c'
   58118     6      | . empty_c1 'c'
   58119     7      | . empty_c2 'c'
   58120     8      | . empty_c3 'c'
   58121     9 empty_a: .  []
   58122    10 empty_b: .  []
   58123    11 empty_c1: .  []
   58124    12 empty_c2: .  ['c']
   58125    13 empty_c3: .  ['c']
   58126 
   58127     'a'  error (nonassociative)
   58128     'b'  error (nonassociative)
   58129     'c'  error (nonassociative)
   58130 
   58131     'c'  [reduce using rule 12 (empty_c2)]
   58132     'c'  [reduce using rule 13 (empty_c3)]
   58133 
   58134     start     go to state 1
   58135     empty_a   go to state 2
   58136     empty_b   go to state 3
   58137     empty_c1  go to state 4
   58138     empty_c2  go to state 5
   58139     empty_c3  go to state 6
   58140 
   58141     Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a').
   58142     Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
   58143     Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').
   58144 
   58145 
   58146 State 1
   58147 " | \
   58148   $at_diff - "$at_stdout" || at_failed=:
   58149 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1376"
   58150 $at_failed && at_fn_log_failure
   58151 $at_traceon; }
   58152 
   58153   set +x
   58154   $at_times_p && times >"$at_times_file"
   58155 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   58156 read at_status <"$at_status_file"
   58157 #AT_STOP_198
   58158 #AT_START_199
   58159 at_fn_group_banner 199 'conflicts.at:1422' \
   58160   "-W versus %expect and %expect-rr" "               " 10
   58161 at_xfail=no
   58162 (
   58163   $as_echo "199. $at_setup_line: testing $at_desc ..."
   58164   $at_traceon
   58165 
   58166 
   58167 cat >sr-rr.y <<'_ATEOF'
   58168 %glr-parser
   58169 %%
   58170 start: 'a' | A 'a' | B 'a' ;
   58171 A: ;
   58172 B: ;
   58173 _ATEOF
   58174 
   58175 cat >sr.y <<'_ATEOF'
   58176 %glr-parser
   58177 %%
   58178 start: 'a' | A 'a' ;
   58179 A: ;
   58180 _ATEOF
   58181 
   58182 cat >rr.y <<'_ATEOF'
   58183 %glr-parser
   58184 %%
   58185 start: A | B ;
   58186 A: ;
   58187 B: ;
   58188 _ATEOF
   58189 
   58190 
   58191 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58192   at_save_special_files
   58193   mkdir xml-tests
   58194     # Don't combine these Bison invocations since we want to be sure that
   58195   # --report=all isn't required to get the full XML file.
   58196   { set +x
   58197 $as_echo "$at_srcdir/conflicts.at:1445: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58198                   --graph=xml-tests/test.dot sr-rr.y"
   58199 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1445"
   58200 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58201                   --graph=xml-tests/test.dot sr-rr.y
   58202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58203 at_status=$? at_failed=false
   58204 $at_check_filter
   58205 echo stderr:; cat "$at_stderr"
   58206 echo stdout:; cat "$at_stdout"
   58207 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445"
   58208 $at_failed && at_fn_log_failure
   58209 $at_traceon; }
   58210 
   58211   { set +x
   58212 $as_echo "$at_srcdir/conflicts.at:1445: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y"
   58213 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y" "conflicts.at:1445"
   58214 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y
   58215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58216 at_status=$? at_failed=false
   58217 $at_check_filter
   58218 echo stderr:; cat "$at_stderr"
   58219 echo stdout:; cat "$at_stdout"
   58220 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445"
   58221 $at_failed && at_fn_log_failure
   58222 $at_traceon; }
   58223 
   58224     cp xml-tests/test.output expout
   58225   { set +x
   58226 $as_echo "$at_srcdir/conflicts.at:1445: \$XSLTPROC \\
   58227              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   58228              xml-tests/test.xml"
   58229 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1445"
   58230 ( $at_check_trace; $XSLTPROC \
   58231              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   58232              xml-tests/test.xml
   58233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58234 at_status=$? at_failed=false
   58235 $at_check_filter
   58236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58237 $at_diff expout "$at_stdout" || at_failed=:
   58238 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445"
   58239 $at_failed && at_fn_log_failure
   58240 $at_traceon; }
   58241 
   58242   sort xml-tests/test.dot > expout
   58243   { set +x
   58244 $as_echo "$at_srcdir/conflicts.at:1445: \$XSLTPROC \\
   58245              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   58246              xml-tests/test.xml | sort"
   58247 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1445"
   58248 ( $at_check_trace; $XSLTPROC \
   58249              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   58250              xml-tests/test.xml | sort
   58251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58252 at_status=$? at_failed=false
   58253 $at_check_filter
   58254 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58255 $at_diff expout "$at_stdout" || at_failed=:
   58256 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445"
   58257 $at_failed && at_fn_log_failure
   58258 $at_traceon; }
   58259 
   58260   rm -rf xml-tests expout
   58261   at_restore_special_files
   58262 fi
   58263 { set +x
   58264 $as_echo "$at_srcdir/conflicts.at:1445: bison sr-rr.y"
   58265 at_fn_check_prepare_trace "conflicts.at:1445"
   58266 ( $at_check_trace; bison sr-rr.y
   58267 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58268 at_status=$? at_failed=false
   58269 $at_check_filter
   58270 echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce, 1 reduce/reduce
   58271 " | \
   58272   $at_diff - "$at_stderr" || at_failed=:
   58273 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58274 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1445"
   58275 $at_failed && at_fn_log_failure
   58276 $at_traceon; }
   58277 
   58278 
   58279 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58280   at_save_special_files
   58281   mkdir xml-tests
   58282     # Don't combine these Bison invocations since we want to be sure that
   58283   # --report=all isn't required to get the full XML file.
   58284   { set +x
   58285 $as_echo "$at_srcdir/conflicts.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58286                   --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y"
   58287 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1448"
   58288 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58289                   --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y
   58290 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58291 at_status=$? at_failed=false
   58292 $at_check_filter
   58293 echo stderr:; cat "$at_stderr"
   58294 echo stdout:; cat "$at_stdout"
   58295 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448"
   58296 $at_failed && at_fn_log_failure
   58297 $at_traceon; }
   58298 
   58299   { set +x
   58300 $as_echo "$at_srcdir/conflicts.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y"
   58301 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" "conflicts.at:1448"
   58302 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y
   58303 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58304 at_status=$? at_failed=false
   58305 $at_check_filter
   58306 echo stderr:; cat "$at_stderr"
   58307 echo stdout:; cat "$at_stdout"
   58308 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448"
   58309 $at_failed && at_fn_log_failure
   58310 $at_traceon; }
   58311 
   58312     cp xml-tests/test.output expout
   58313   { set +x
   58314 $as_echo "$at_srcdir/conflicts.at:1448: \$XSLTPROC \\
   58315              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   58316              xml-tests/test.xml"
   58317 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1448"
   58318 ( $at_check_trace; $XSLTPROC \
   58319              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   58320              xml-tests/test.xml
   58321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58322 at_status=$? at_failed=false
   58323 $at_check_filter
   58324 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58325 $at_diff expout "$at_stdout" || at_failed=:
   58326 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448"
   58327 $at_failed && at_fn_log_failure
   58328 $at_traceon; }
   58329 
   58330   sort xml-tests/test.dot > expout
   58331   { set +x
   58332 $as_echo "$at_srcdir/conflicts.at:1448: \$XSLTPROC \\
   58333              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   58334              xml-tests/test.xml | sort"
   58335 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1448"
   58336 ( $at_check_trace; $XSLTPROC \
   58337              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   58338              xml-tests/test.xml | sort
   58339 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58340 at_status=$? at_failed=false
   58341 $at_check_filter
   58342 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58343 $at_diff expout "$at_stdout" || at_failed=:
   58344 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448"
   58345 $at_failed && at_fn_log_failure
   58346 $at_traceon; }
   58347 
   58348   rm -rf xml-tests expout
   58349   at_restore_special_files
   58350 fi
   58351 { set +x
   58352 $as_echo "$at_srcdir/conflicts.at:1448: bison -Wno-conflicts-sr sr-rr.y"
   58353 at_fn_check_prepare_trace "conflicts.at:1448"
   58354 ( $at_check_trace; bison -Wno-conflicts-sr sr-rr.y
   58355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58356 at_status=$? at_failed=false
   58357 $at_check_filter
   58358 echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 reduce/reduce
   58359 " | \
   58360   $at_diff - "$at_stderr" || at_failed=:
   58361 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58362 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448"
   58363 $at_failed && at_fn_log_failure
   58364 $at_traceon; }
   58365 
   58366 
   58367 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58368   at_save_special_files
   58369   mkdir xml-tests
   58370     # Don't combine these Bison invocations since we want to be sure that
   58371   # --report=all isn't required to get the full XML file.
   58372   { set +x
   58373 $as_echo "$at_srcdir/conflicts.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58374                   --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y"
   58375 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1451"
   58376 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58377                   --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y
   58378 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58379 at_status=$? at_failed=false
   58380 $at_check_filter
   58381 echo stderr:; cat "$at_stderr"
   58382 echo stdout:; cat "$at_stdout"
   58383 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451"
   58384 $at_failed && at_fn_log_failure
   58385 $at_traceon; }
   58386 
   58387   { set +x
   58388 $as_echo "$at_srcdir/conflicts.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y"
   58389 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" "conflicts.at:1451"
   58390 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y
   58391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58392 at_status=$? at_failed=false
   58393 $at_check_filter
   58394 echo stderr:; cat "$at_stderr"
   58395 echo stdout:; cat "$at_stdout"
   58396 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451"
   58397 $at_failed && at_fn_log_failure
   58398 $at_traceon; }
   58399 
   58400     cp xml-tests/test.output expout
   58401   { set +x
   58402 $as_echo "$at_srcdir/conflicts.at:1451: \$XSLTPROC \\
   58403              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   58404              xml-tests/test.xml"
   58405 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1451"
   58406 ( $at_check_trace; $XSLTPROC \
   58407              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   58408              xml-tests/test.xml
   58409 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58410 at_status=$? at_failed=false
   58411 $at_check_filter
   58412 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58413 $at_diff expout "$at_stdout" || at_failed=:
   58414 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451"
   58415 $at_failed && at_fn_log_failure
   58416 $at_traceon; }
   58417 
   58418   sort xml-tests/test.dot > expout
   58419   { set +x
   58420 $as_echo "$at_srcdir/conflicts.at:1451: \$XSLTPROC \\
   58421              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   58422              xml-tests/test.xml | sort"
   58423 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1451"
   58424 ( $at_check_trace; $XSLTPROC \
   58425              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   58426              xml-tests/test.xml | sort
   58427 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58428 at_status=$? at_failed=false
   58429 $at_check_filter
   58430 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58431 $at_diff expout "$at_stdout" || at_failed=:
   58432 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451"
   58433 $at_failed && at_fn_log_failure
   58434 $at_traceon; }
   58435 
   58436   rm -rf xml-tests expout
   58437   at_restore_special_files
   58438 fi
   58439 { set +x
   58440 $as_echo "$at_srcdir/conflicts.at:1451: bison -Wno-conflicts-rr sr-rr.y"
   58441 at_fn_check_prepare_trace "conflicts.at:1451"
   58442 ( $at_check_trace; bison -Wno-conflicts-rr sr-rr.y
   58443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58444 at_status=$? at_failed=false
   58445 $at_check_filter
   58446 echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce
   58447 " | \
   58448   $at_diff - "$at_stderr" || at_failed=:
   58449 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58450 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451"
   58451 $at_failed && at_fn_log_failure
   58452 $at_traceon; }
   58453 
   58454 
   58455 
   58456 for gram in sr-rr sr rr; do
   58457   for sr_exp_i in '' 0 1 2; do
   58458     for rr_exp_i in '' 0 1 2; do
   58459       test -z "$sr_exp_i" && test -z "$rr_exp_i" && continue
   58460 
   58461       # Build grammar file.
   58462       sr_exp=0
   58463       rr_exp=0
   58464       file=$gram
   58465       directives=
   58466       if test -n "$sr_exp_i"; then
   58467         sr_exp=$sr_exp_i
   58468         file=$file-expect-$sr_exp
   58469         directives="%expect $sr_exp"
   58470       fi
   58471       if test -n "$rr_exp_i"; then
   58472         rr_exp=$rr_exp_i
   58473         file=$file-expect-rr-$rr_exp
   58474         directives="$directives %expect-rr $rr_exp"
   58475       fi
   58476       file=$file.y
   58477       echo "$directives" > $file
   58478       cat $gram.y >> $file
   58479 
   58480       # Count actual conflicts.
   58481       conflicts=
   58482       sr_count=0
   58483       rr_count=0
   58484       if test $gram = sr || test $gram = sr-rr; then
   58485         conflicts="1 shift/reduce"
   58486         sr_count=1
   58487       fi
   58488       if test $gram = rr || test $gram = sr-rr; then
   58489         if test -n "$conflicts"; then
   58490           conflicts="$conflicts, "
   58491         fi
   58492         conflicts="${conflicts}1 reduce/reduce"
   58493         rr_count=1
   58494       fi
   58495 
   58496       # Run tests.
   58497       if test $sr_count -eq $sr_exp && test $rr_count -eq $rr_exp; then
   58498         if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58499   at_save_special_files
   58500   mkdir xml-tests
   58501     # Don't combine these Bison invocations since we want to be sure that
   58502   # --report=all isn't required to get the full XML file.
   58503   { set +x
   58504 $as_echo "$at_srcdir/conflicts.at:1497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58505                   --graph=xml-tests/test.dot -Wnone \$file"
   58506 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1497"
   58507 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58508                   --graph=xml-tests/test.dot -Wnone $file
   58509 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58510 at_status=$? at_failed=false
   58511 $at_check_filter
   58512 echo stderr:; cat "$at_stderr"
   58513 echo stdout:; cat "$at_stdout"
   58514 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497"
   58515 $at_failed && at_fn_log_failure
   58516 $at_traceon; }
   58517 
   58518   { set +x
   58519 $as_echo "$at_srcdir/conflicts.at:1497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone \$file"
   58520 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone $file" "conflicts.at:1497"
   58521 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone $file
   58522 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58523 at_status=$? at_failed=false
   58524 $at_check_filter
   58525 echo stderr:; cat "$at_stderr"
   58526 echo stdout:; cat "$at_stdout"
   58527 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497"
   58528 $at_failed && at_fn_log_failure
   58529 $at_traceon; }
   58530 
   58531     cp xml-tests/test.output expout
   58532   { set +x
   58533 $as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\
   58534              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   58535              xml-tests/test.xml"
   58536 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1497"
   58537 ( $at_check_trace; $XSLTPROC \
   58538              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   58539              xml-tests/test.xml
   58540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58541 at_status=$? at_failed=false
   58542 $at_check_filter
   58543 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58544 $at_diff expout "$at_stdout" || at_failed=:
   58545 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497"
   58546 $at_failed && at_fn_log_failure
   58547 $at_traceon; }
   58548 
   58549   sort xml-tests/test.dot > expout
   58550   { set +x
   58551 $as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\
   58552              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   58553              xml-tests/test.xml | sort"
   58554 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1497"
   58555 ( $at_check_trace; $XSLTPROC \
   58556              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   58557              xml-tests/test.xml | sort
   58558 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58559 at_status=$? at_failed=false
   58560 $at_check_filter
   58561 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58562 $at_diff expout "$at_stdout" || at_failed=:
   58563 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497"
   58564 $at_failed && at_fn_log_failure
   58565 $at_traceon; }
   58566 
   58567   rm -rf xml-tests expout
   58568   at_restore_special_files
   58569 fi
   58570 { set +x
   58571 $as_echo "$at_srcdir/conflicts.at:1497: bison -Wnone \$file"
   58572 at_fn_check_prepare_dynamic "bison -Wnone $file" "conflicts.at:1497"
   58573 ( $at_check_trace; bison -Wnone $file
   58574 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58575 at_status=$? at_failed=false
   58576 $at_check_filter
   58577 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58578 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58579 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497"
   58580 $at_failed && at_fn_log_failure
   58581 $at_traceon; }
   58582 
   58583 
   58584         if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58585   at_save_special_files
   58586   mkdir xml-tests
   58587     # Don't combine these Bison invocations since we want to be sure that
   58588   # --report=all isn't required to get the full XML file.
   58589   { set +x
   58590 $as_echo "$at_srcdir/conflicts.at:1498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58591                   --graph=xml-tests/test.dot -Werror \$file"
   58592 at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1498"
   58593 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58594                   --graph=xml-tests/test.dot -Werror $file
   58595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58596 at_status=$? at_failed=false
   58597 $at_check_filter
   58598 echo stderr:; cat "$at_stderr"
   58599 echo stdout:; cat "$at_stdout"
   58600 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498"
   58601 $at_failed && at_fn_log_failure
   58602 $at_traceon; }
   58603 
   58604   { set +x
   58605 $as_echo "$at_srcdir/conflicts.at:1498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror \$file"
   58606 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror $file" "conflicts.at:1498"
   58607 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror $file
   58608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58609 at_status=$? at_failed=false
   58610 $at_check_filter
   58611 echo stderr:; cat "$at_stderr"
   58612 echo stdout:; cat "$at_stdout"
   58613 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498"
   58614 $at_failed && at_fn_log_failure
   58615 $at_traceon; }
   58616 
   58617     cp xml-tests/test.output expout
   58618   { set +x
   58619 $as_echo "$at_srcdir/conflicts.at:1498: \$XSLTPROC \\
   58620              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   58621              xml-tests/test.xml"
   58622 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1498"
   58623 ( $at_check_trace; $XSLTPROC \
   58624              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   58625              xml-tests/test.xml
   58626 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58627 at_status=$? at_failed=false
   58628 $at_check_filter
   58629 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58630 $at_diff expout "$at_stdout" || at_failed=:
   58631 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498"
   58632 $at_failed && at_fn_log_failure
   58633 $at_traceon; }
   58634 
   58635   sort xml-tests/test.dot > expout
   58636   { set +x
   58637 $as_echo "$at_srcdir/conflicts.at:1498: \$XSLTPROC \\
   58638              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   58639              xml-tests/test.xml | sort"
   58640 at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1498"
   58641 ( $at_check_trace; $XSLTPROC \
   58642              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   58643              xml-tests/test.xml | sort
   58644 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58645 at_status=$? at_failed=false
   58646 $at_check_filter
   58647 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58648 $at_diff expout "$at_stdout" || at_failed=:
   58649 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498"
   58650 $at_failed && at_fn_log_failure
   58651 $at_traceon; }
   58652 
   58653   rm -rf xml-tests expout
   58654   at_restore_special_files
   58655 fi
   58656 { set +x
   58657 $as_echo "$at_srcdir/conflicts.at:1498: bison -Werror \$file"
   58658 at_fn_check_prepare_dynamic "bison -Werror $file" "conflicts.at:1498"
   58659 ( $at_check_trace; bison -Werror $file
   58660 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58661 at_status=$? at_failed=false
   58662 $at_check_filter
   58663 at_fn_diff_devnull "$at_stderr" || at_failed=:
   58664 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58665 at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498"
   58666 $at_failed && at_fn_log_failure
   58667 $at_traceon; }
   58668 
   58669 
   58670       else
   58671         echo "$file: conflicts: $conflicts" > experr
   58672         if test $sr_count -ne $sr_exp; then
   58673           if test $sr_exp -ne 1; then s=s; else s= ; fi
   58674           echo "$file: error: expected $sr_exp shift/reduce conflict$s" >> experr
   58675         fi
   58676         if test $rr_count -ne $rr_exp; then
   58677           if test $rr_exp -ne 1; then s=s; else s= ; fi
   58678           echo "$file: error: expected $rr_exp reduce/reduce conflict$s" >> experr
   58679         fi
   58680 
   58681 { set +x
   58682 $as_echo "$at_srcdir/conflicts.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wnone \$file"
   58683 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wnone $file" "conflicts.at:1509"
   58684 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wnone $file
   58685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58686 at_status=$? at_failed=false
   58687 $at_check_filter
   58688 $at_diff experr "$at_stderr" || at_failed=:
   58689 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58690 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1509"
   58691 $at_failed && at_fn_log_failure
   58692 $at_traceon; }
   58693 
   58694 
   58695 
   58696 { set +x
   58697 $as_echo "$at_srcdir/conflicts.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror \$file"
   58698 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror $file" "conflicts.at:1510"
   58699 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror $file
   58700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58701 at_status=$? at_failed=false
   58702 $at_check_filter
   58703 $at_diff experr "$at_stderr" || at_failed=:
   58704 at_fn_diff_devnull "$at_stdout" || at_failed=:
   58705 at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1510"
   58706 $at_failed && at_fn_log_failure
   58707 $at_traceon; }
   58708 
   58709 
   58710       fi
   58711     done
   58712   done
   58713 done
   58714 
   58715   set +x
   58716   $at_times_p && times >"$at_times_file"
   58717 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   58718 read at_status <"$at_status_file"
   58719 #AT_STOP_199
   58720 #AT_START_200
   58721 at_fn_group_banner 200 'calc.at:597' \
   58722   "Calculator " "                                    " 11
   58723 at_xfail=no
   58724 (
   58725   $as_echo "200. $at_setup_line: testing $at_desc ..."
   58726   $at_traceon
   58727 
   58728 
   58729 
   58730 
   58731 
   58732 
   58733 
   58734 
   58735 
   58736 
   58737 cat >calc.y <<'_ATEOF'
   58738 %code top {
   58739 #include <config.h>
   58740 /* We don't need perfect functions for these tests. */
   58741 #undef malloc
   58742 #undef memcmp
   58743 #undef realloc
   58744 }
   58745 
   58746 /* Infix notation calculator--calc */
   58747 
   58748 
   58749 %code requires
   58750 {
   58751 
   58752   /* Exercise pre-prologue dependency to %union.  */
   58753   typedef int semantic_value;
   58754 }
   58755 
   58756 /* Exercise %union. */
   58757 %union
   58758 {
   58759   semantic_value ival;
   58760 };
   58761 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   58762 
   58763 %code provides
   58764 {
   58765   #include <stdio.h>
   58766   /* The input.  */
   58767   extern FILE *input;
   58768   extern semantic_value global_result;
   58769   extern int global_count;
   58770 }
   58771 
   58772 %code
   58773 {
   58774 #include <assert.h>
   58775 #include <string.h>
   58776 #define USE(Var)
   58777 
   58778 FILE *input;
   58779 static int power (int base, int exponent);
   58780 
   58781 static void yyerror ( const char *msg);
   58782 int yylex (void);
   58783 }
   58784 
   58785 
   58786 
   58787 /* Bison Declarations */
   58788 %token CALC_EOF 0 "end of input"
   58789 %token <ival> NUM "number"
   58790 %type  <ival> exp
   58791 
   58792 %nonassoc '=' /* comparison            */
   58793 %left '-' '+'
   58794 %left '*' '/'
   58795 %left NEG     /* negation--unary minus */
   58796 %right '^'    /* exponentiation        */
   58797 
   58798 /* Grammar follows */
   58799 %%
   58800 input:
   58801   line
   58802 | input line         {  }
   58803 ;
   58804 
   58805 line:
   58806   '\n'
   58807 | exp '\n'           { USE ($1); }
   58808 ;
   58809 
   58810 exp:
   58811   NUM                { $$ = $1;             }
   58812 | exp '=' exp
   58813   {
   58814     if ($1 != $3)
   58815       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   58816     $$ = $1;
   58817   }
   58818 | exp '+' exp        { $$ = $1 + $3;        }
   58819 | exp '-' exp        { $$ = $1 - $3;        }
   58820 | exp '*' exp        { $$ = $1 * $3;        }
   58821 | exp '/' exp        { $$ = $1 / $3;        }
   58822 | '-' exp  %prec NEG { $$ = -$2;            }
   58823 | exp '^' exp        { $$ = power ($1, $3); }
   58824 | '(' exp ')'        { $$ = $2;             }
   58825 | '(' error ')'      { $$ = 1111; yyerrok;  }
   58826 | '!'                { $$ = 0; YYERROR;     }
   58827 | '-' error          { $$ = 0; YYERROR;     }
   58828 ;
   58829 %%
   58830 
   58831 static int
   58832 power (int base, int exponent)
   58833 {
   58834   int res = 1;
   58835   assert (0 <= exponent);
   58836   for (/* Niente */; exponent; --exponent)
   58837     res *= base;
   58838   return res;
   58839 }
   58840 
   58841 
   58842 #include <stdio.h>
   58843 /* A C error reporting function.  */
   58844 static
   58845 void yyerror ( const char *msg)
   58846 {
   58847   fprintf (stderr, "%s\n", msg);
   58848 }
   58849 #include <ctype.h>
   58850 
   58851 int yylex (void);
   58852 static int get_char (void);
   58853 static void unget_char ( int c);
   58854 
   58855 
   58856 static int
   58857 get_char (void)
   58858 {
   58859   int res = getc (input);
   58860   ;
   58861 
   58862   return res;
   58863 }
   58864 
   58865 static void
   58866 unget_char ( int c)
   58867 {
   58868   ;
   58869 
   58870   ungetc (c, input);
   58871 }
   58872 
   58873 static int
   58874 read_signed_integer (void)
   58875 {
   58876   int c = get_char ();
   58877   int sign = 1;
   58878   int n = 0;
   58879 
   58880   ;
   58881   if (c == '-')
   58882     {
   58883       c = get_char ();
   58884       sign = -1;
   58885     }
   58886 
   58887   while (isdigit (c))
   58888     {
   58889       n = 10 * n + (c - '0');
   58890       c = get_char ();
   58891     }
   58892 
   58893   unget_char ( c);
   58894 
   58895   return sign * n;
   58896 }
   58897 
   58898 
   58899 /*---------------------------------------------------------------.
   58900 | Lexical analyzer returns an integer on the stack and the token |
   58901 | NUM, or the ASCII character read if not a number.  Skips all   |
   58902 | blanks and tabs, returns 0 for EOF.                            |
   58903 `---------------------------------------------------------------*/
   58904 
   58905 int yylex (void)
   58906 {
   58907   int c;
   58908   /* Skip current token, then white spaces.  */
   58909   do
   58910     {
   58911 
   58912     }
   58913   while ((c = get_char ()) == ' ' || c == '\t');
   58914 
   58915   /* process numbers   */
   58916   if (c == '.' || isdigit (c))
   58917     {
   58918       unget_char ( c);
   58919       (yylval).ival = read_signed_integer ();
   58920       return NUM;
   58921     }
   58922 
   58923   /* Return end-of-file.  */
   58924   if (c == EOF)
   58925     return CALC_EOF;
   58926 
   58927   /* Return single chars. */
   58928   return c;
   58929 }
   58930 
   58931 #include <assert.h>
   58932 #if HAVE_UNISTD_H
   58933 # include <unistd.h>
   58934 #else
   58935 # undef alarm
   58936 # define alarm(seconds) /* empty */
   58937 #endif
   58938 
   58939 
   58940 
   58941 semantic_value global_result = 0;
   58942 int global_count = 0;
   58943 
   58944 /* A C main function.  */
   58945 int
   58946 main (int argc, const char **argv)
   58947 {
   58948   semantic_value result = 0;
   58949   int count = 0;
   58950   int status;
   58951 
   58952   /* This used to be alarm (10), but that isn't enough time for
   58953      a July 1995 vintage DEC Alphastation 200 4/100 system,
   58954      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   58955   alarm (100);
   58956 
   58957   if (argc == 2)
   58958     input = fopen (argv[1], "r");
   58959   else
   58960     input = stdin;
   58961 
   58962   if (!input)
   58963     {
   58964       perror (argv[1]);
   58965       return 3;
   58966     }
   58967 
   58968 
   58969   status = yyparse ();
   58970   if (fclose (input))
   58971     perror ("fclose");
   58972   assert (global_result == result);
   58973   assert (global_count == count);
   58974   return status;
   58975 }
   58976 _ATEOF
   58977 
   58978 
   58979 
   58980 
   58981 
   58982 
   58983 
   58984 
   58985 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   58986   at_save_special_files
   58987   mkdir xml-tests
   58988     # Don't combine these Bison invocations since we want to be sure that
   58989   # --report=all isn't required to get the full XML file.
   58990   { set +x
   58991 $as_echo "$at_srcdir/calc.at:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   58992                   --graph=xml-tests/test.dot -o calc.c calc.y"
   58993 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:597"
   58994 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   58995                   --graph=xml-tests/test.dot -o calc.c calc.y
   58996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   58997 at_status=$? at_failed=false
   58998 $at_check_filter
   58999 echo stderr:; cat "$at_stderr"
   59000 echo stdout:; cat "$at_stdout"
   59001 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59002 $at_failed && at_fn_log_failure
   59003 $at_traceon; }
   59004 
   59005   { set +x
   59006 $as_echo "$at_srcdir/calc.at:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   59007 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:597"
   59008 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   59009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59010 at_status=$? at_failed=false
   59011 $at_check_filter
   59012 echo stderr:; cat "$at_stderr"
   59013 echo stdout:; cat "$at_stdout"
   59014 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59015 $at_failed && at_fn_log_failure
   59016 $at_traceon; }
   59017 
   59018     cp xml-tests/test.output expout
   59019   { set +x
   59020 $as_echo "$at_srcdir/calc.at:597: \$XSLTPROC \\
   59021              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   59022              xml-tests/test.xml"
   59023 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:597"
   59024 ( $at_check_trace; $XSLTPROC \
   59025              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   59026              xml-tests/test.xml
   59027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59028 at_status=$? at_failed=false
   59029 $at_check_filter
   59030 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59031 $at_diff expout "$at_stdout" || at_failed=:
   59032 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59033 $at_failed && at_fn_log_failure
   59034 $at_traceon; }
   59035 
   59036   sort xml-tests/test.dot > expout
   59037   { set +x
   59038 $as_echo "$at_srcdir/calc.at:597: \$XSLTPROC \\
   59039              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   59040              xml-tests/test.xml | sort"
   59041 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:597"
   59042 ( $at_check_trace; $XSLTPROC \
   59043              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   59044              xml-tests/test.xml | sort
   59045 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59046 at_status=$? at_failed=false
   59047 $at_check_filter
   59048 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59049 $at_diff expout "$at_stdout" || at_failed=:
   59050 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59051 $at_failed && at_fn_log_failure
   59052 $at_traceon; }
   59053 
   59054   rm -rf xml-tests expout
   59055   at_restore_special_files
   59056 fi
   59057 { set +x
   59058 $as_echo "$at_srcdir/calc.at:597: bison -o calc.c calc.y"
   59059 at_fn_check_prepare_trace "calc.at:597"
   59060 ( $at_check_trace; bison -o calc.c calc.y
   59061 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59062 at_status=$? at_failed=false
   59063 $at_check_filter
   59064 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59065 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59066 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59067 $at_failed && at_fn_log_failure
   59068 $at_traceon; }
   59069 
   59070 
   59071    { set +x
   59072 $as_echo "$at_srcdir/calc.at:597: \$BISON_C_WORKS"
   59073 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:597"
   59074 ( $at_check_trace; $BISON_C_WORKS
   59075 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59076 at_status=$? at_failed=false
   59077 $at_check_filter
   59078 echo stderr:; cat "$at_stderr"
   59079 echo stdout:; cat "$at_stdout"
   59080 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59081 $at_failed && at_fn_log_failure
   59082 $at_traceon; }
   59083 
   59084 { set +x
   59085 $as_echo "$at_srcdir/calc.at:597: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   59086 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:597"
   59087 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   59088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59089 at_status=$? at_failed=false
   59090 $at_check_filter
   59091 echo stderr:; cat "$at_stderr"
   59092 echo stdout:; cat "$at_stdout"
   59093 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59094 $at_failed && at_fn_log_failure
   59095 $at_traceon; }
   59096 
   59097 
   59098 { set +x
   59099 $as_echo "$at_srcdir/calc.at:597: \$PERL -ne '
   59100   chomp;
   59101   print \"\$.: {\$_}\\n\"
   59102     if (# No starting/ending empty lines.
   59103         (eof || \$. == 1) && /^\\s*\$/
   59104         # No trailing space.  FIXME: not ready for \"maint\".
   59105         # || /\\s\$/
   59106         )' calc.c
   59107 "
   59108 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:597"
   59109 ( $at_check_trace; $PERL -ne '
   59110   chomp;
   59111   print "$.: {$_}\n"
   59112     if (# No starting/ending empty lines.
   59113         (eof || $. == 1) && /^\s*$/
   59114         # No trailing space.  FIXME: not ready for "maint".
   59115         # || /\s$/
   59116         )' calc.c
   59117 
   59118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59119 at_status=$? at_failed=false
   59120 $at_check_filter
   59121 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59122 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59123 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59124 $at_failed && at_fn_log_failure
   59125 $at_traceon; }
   59126 
   59127 
   59128 
   59129 # Test the priorities.
   59130 cat >input <<'_ATEOF'
   59131 1 + 2 * 3 = 7
   59132 1 + 2 * -3 = -5
   59133 
   59134 -1^2 = -1
   59135 (-1)^2 = 1
   59136 
   59137 ---1 = -1
   59138 
   59139 1 - 2 - 3 = -4
   59140 1 - (2 - 3) = 2
   59141 
   59142 2^2^3 = 256
   59143 (2^2)^3 = 64
   59144 _ATEOF
   59145 
   59146 { set +x
   59147 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59148 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59149 ( $at_check_trace;  $PREPARSER ./calc input
   59150 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59151 at_status=$? at_failed=false
   59152 $at_check_filter
   59153 echo stderr:; tee stderr <"$at_stderr"
   59154 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59155 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59156 $at_failed && at_fn_log_failure
   59157 $at_traceon; }
   59158 
   59159 { set +x
   59160 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59161 at_fn_check_prepare_trace "calc.at:597"
   59162 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59163 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59164 at_status=$? at_failed=false
   59165 $at_check_filter
   59166 echo stderr:; tee stderr <"$at_stderr"
   59167 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59168 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59169 $at_failed && at_fn_log_failure
   59170 $at_traceon; }
   59171 
   59172 
   59173 
   59174 
   59175 # Some syntax errors.
   59176 cat >input <<'_ATEOF'
   59177 1 2
   59178 _ATEOF
   59179 
   59180 { set +x
   59181 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59182 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59183 ( $at_check_trace;  $PREPARSER ./calc input
   59184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59185 at_status=$? at_failed=false
   59186 $at_check_filter
   59187 echo stderr:; tee stderr <"$at_stderr"
   59188 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59189 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597"
   59190 $at_failed && at_fn_log_failure
   59191 $at_traceon; }
   59192 
   59193 { set +x
   59194 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59195 at_fn_check_prepare_trace "calc.at:597"
   59196 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59198 at_status=$? at_failed=false
   59199 $at_check_filter
   59200 echo stderr:; tee stderr <"$at_stderr"
   59201 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59202 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59203 $at_failed && at_fn_log_failure
   59204 $at_traceon; }
   59205 
   59206 
   59207 
   59208 # Normalize the observed and expected error messages, depending upon the
   59209 # options.
   59210 # 1. Remove the traces from observed.
   59211 sed '/^Starting/d
   59212 /^Entering/d
   59213 /^Stack/d
   59214 /^Reading/d
   59215 /^Reducing/d
   59216 /^Return/d
   59217 /^Shifting/d
   59218 /^state/d
   59219 /^Cleanup:/d
   59220 /^Error:/d
   59221 /^Next/d
   59222 /^Now/d
   59223 /^Discarding/d
   59224 / \$[0-9$]* = /d
   59225 /^yydestructor:/d' stderr >at-stderr
   59226 mv at-stderr stderr
   59227 # 2. Create the reference error message.
   59228 cat >expout <<'_ATEOF'
   59229 1.3: syntax error, unexpected number
   59230 _ATEOF
   59231 
   59232 # 3. If locations are not used, remove them.
   59233 sed 's/^[-0-9.]*: //' expout >at-expout
   59234 mv at-expout expout
   59235 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59236 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59237 mv at-expout expout
   59238 # 5. Check
   59239 { set +x
   59240 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59241 at_fn_check_prepare_trace "calc.at:597"
   59242 ( $at_check_trace; cat stderr
   59243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59244 at_status=$? at_failed=false
   59245 $at_check_filter
   59246 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59247 $at_diff expout "$at_stdout" || at_failed=:
   59248 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59249 $at_failed && at_fn_log_failure
   59250 $at_traceon; }
   59251 
   59252 
   59253 cat >input <<'_ATEOF'
   59254 1//2
   59255 _ATEOF
   59256 
   59257 { set +x
   59258 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59259 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59260 ( $at_check_trace;  $PREPARSER ./calc input
   59261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59262 at_status=$? at_failed=false
   59263 $at_check_filter
   59264 echo stderr:; tee stderr <"$at_stderr"
   59265 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59266 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597"
   59267 $at_failed && at_fn_log_failure
   59268 $at_traceon; }
   59269 
   59270 { set +x
   59271 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59272 at_fn_check_prepare_trace "calc.at:597"
   59273 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59274 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59275 at_status=$? at_failed=false
   59276 $at_check_filter
   59277 echo stderr:; tee stderr <"$at_stderr"
   59278 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59279 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59280 $at_failed && at_fn_log_failure
   59281 $at_traceon; }
   59282 
   59283 
   59284 
   59285 # Normalize the observed and expected error messages, depending upon the
   59286 # options.
   59287 # 1. Remove the traces from observed.
   59288 sed '/^Starting/d
   59289 /^Entering/d
   59290 /^Stack/d
   59291 /^Reading/d
   59292 /^Reducing/d
   59293 /^Return/d
   59294 /^Shifting/d
   59295 /^state/d
   59296 /^Cleanup:/d
   59297 /^Error:/d
   59298 /^Next/d
   59299 /^Now/d
   59300 /^Discarding/d
   59301 / \$[0-9$]* = /d
   59302 /^yydestructor:/d' stderr >at-stderr
   59303 mv at-stderr stderr
   59304 # 2. Create the reference error message.
   59305 cat >expout <<'_ATEOF'
   59306 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   59307 _ATEOF
   59308 
   59309 # 3. If locations are not used, remove them.
   59310 sed 's/^[-0-9.]*: //' expout >at-expout
   59311 mv at-expout expout
   59312 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59313 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59314 mv at-expout expout
   59315 # 5. Check
   59316 { set +x
   59317 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59318 at_fn_check_prepare_trace "calc.at:597"
   59319 ( $at_check_trace; cat stderr
   59320 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59321 at_status=$? at_failed=false
   59322 $at_check_filter
   59323 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59324 $at_diff expout "$at_stdout" || at_failed=:
   59325 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59326 $at_failed && at_fn_log_failure
   59327 $at_traceon; }
   59328 
   59329 
   59330 cat >input <<'_ATEOF'
   59331 error
   59332 _ATEOF
   59333 
   59334 { set +x
   59335 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59336 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59337 ( $at_check_trace;  $PREPARSER ./calc input
   59338 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59339 at_status=$? at_failed=false
   59340 $at_check_filter
   59341 echo stderr:; tee stderr <"$at_stderr"
   59342 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59343 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597"
   59344 $at_failed && at_fn_log_failure
   59345 $at_traceon; }
   59346 
   59347 { set +x
   59348 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59349 at_fn_check_prepare_trace "calc.at:597"
   59350 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59351 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59352 at_status=$? at_failed=false
   59353 $at_check_filter
   59354 echo stderr:; tee stderr <"$at_stderr"
   59355 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59356 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59357 $at_failed && at_fn_log_failure
   59358 $at_traceon; }
   59359 
   59360 
   59361 
   59362 # Normalize the observed and expected error messages, depending upon the
   59363 # options.
   59364 # 1. Remove the traces from observed.
   59365 sed '/^Starting/d
   59366 /^Entering/d
   59367 /^Stack/d
   59368 /^Reading/d
   59369 /^Reducing/d
   59370 /^Return/d
   59371 /^Shifting/d
   59372 /^state/d
   59373 /^Cleanup:/d
   59374 /^Error:/d
   59375 /^Next/d
   59376 /^Now/d
   59377 /^Discarding/d
   59378 / \$[0-9$]* = /d
   59379 /^yydestructor:/d' stderr >at-stderr
   59380 mv at-stderr stderr
   59381 # 2. Create the reference error message.
   59382 cat >expout <<'_ATEOF'
   59383 1.1: syntax error, unexpected $undefined
   59384 _ATEOF
   59385 
   59386 # 3. If locations are not used, remove them.
   59387 sed 's/^[-0-9.]*: //' expout >at-expout
   59388 mv at-expout expout
   59389 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59390 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59391 mv at-expout expout
   59392 # 5. Check
   59393 { set +x
   59394 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59395 at_fn_check_prepare_trace "calc.at:597"
   59396 ( $at_check_trace; cat stderr
   59397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59398 at_status=$? at_failed=false
   59399 $at_check_filter
   59400 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59401 $at_diff expout "$at_stdout" || at_failed=:
   59402 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59403 $at_failed && at_fn_log_failure
   59404 $at_traceon; }
   59405 
   59406 
   59407 cat >input <<'_ATEOF'
   59408 1 = 2 = 3
   59409 _ATEOF
   59410 
   59411 { set +x
   59412 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59413 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59414 ( $at_check_trace;  $PREPARSER ./calc input
   59415 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59416 at_status=$? at_failed=false
   59417 $at_check_filter
   59418 echo stderr:; tee stderr <"$at_stderr"
   59419 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59420 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597"
   59421 $at_failed && at_fn_log_failure
   59422 $at_traceon; }
   59423 
   59424 { set +x
   59425 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59426 at_fn_check_prepare_trace "calc.at:597"
   59427 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59429 at_status=$? at_failed=false
   59430 $at_check_filter
   59431 echo stderr:; tee stderr <"$at_stderr"
   59432 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59433 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59434 $at_failed && at_fn_log_failure
   59435 $at_traceon; }
   59436 
   59437 
   59438 
   59439 # Normalize the observed and expected error messages, depending upon the
   59440 # options.
   59441 # 1. Remove the traces from observed.
   59442 sed '/^Starting/d
   59443 /^Entering/d
   59444 /^Stack/d
   59445 /^Reading/d
   59446 /^Reducing/d
   59447 /^Return/d
   59448 /^Shifting/d
   59449 /^state/d
   59450 /^Cleanup:/d
   59451 /^Error:/d
   59452 /^Next/d
   59453 /^Now/d
   59454 /^Discarding/d
   59455 / \$[0-9$]* = /d
   59456 /^yydestructor:/d' stderr >at-stderr
   59457 mv at-stderr stderr
   59458 # 2. Create the reference error message.
   59459 cat >expout <<'_ATEOF'
   59460 1.7: syntax error, unexpected '='
   59461 _ATEOF
   59462 
   59463 # 3. If locations are not used, remove them.
   59464 sed 's/^[-0-9.]*: //' expout >at-expout
   59465 mv at-expout expout
   59466 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59467 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59468 mv at-expout expout
   59469 # 5. Check
   59470 { set +x
   59471 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59472 at_fn_check_prepare_trace "calc.at:597"
   59473 ( $at_check_trace; cat stderr
   59474 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59475 at_status=$? at_failed=false
   59476 $at_check_filter
   59477 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59478 $at_diff expout "$at_stdout" || at_failed=:
   59479 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59480 $at_failed && at_fn_log_failure
   59481 $at_traceon; }
   59482 
   59483 
   59484 cat >input <<'_ATEOF'
   59485 
   59486 +1
   59487 _ATEOF
   59488 
   59489 { set +x
   59490 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59491 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59492 ( $at_check_trace;  $PREPARSER ./calc input
   59493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59494 at_status=$? at_failed=false
   59495 $at_check_filter
   59496 echo stderr:; tee stderr <"$at_stderr"
   59497 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59498 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597"
   59499 $at_failed && at_fn_log_failure
   59500 $at_traceon; }
   59501 
   59502 { set +x
   59503 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59504 at_fn_check_prepare_trace "calc.at:597"
   59505 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59507 at_status=$? at_failed=false
   59508 $at_check_filter
   59509 echo stderr:; tee stderr <"$at_stderr"
   59510 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59511 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59512 $at_failed && at_fn_log_failure
   59513 $at_traceon; }
   59514 
   59515 
   59516 
   59517 # Normalize the observed and expected error messages, depending upon the
   59518 # options.
   59519 # 1. Remove the traces from observed.
   59520 sed '/^Starting/d
   59521 /^Entering/d
   59522 /^Stack/d
   59523 /^Reading/d
   59524 /^Reducing/d
   59525 /^Return/d
   59526 /^Shifting/d
   59527 /^state/d
   59528 /^Cleanup:/d
   59529 /^Error:/d
   59530 /^Next/d
   59531 /^Now/d
   59532 /^Discarding/d
   59533 / \$[0-9$]* = /d
   59534 /^yydestructor:/d' stderr >at-stderr
   59535 mv at-stderr stderr
   59536 # 2. Create the reference error message.
   59537 cat >expout <<'_ATEOF'
   59538 2.1: syntax error, unexpected '+'
   59539 _ATEOF
   59540 
   59541 # 3. If locations are not used, remove them.
   59542 sed 's/^[-0-9.]*: //' expout >at-expout
   59543 mv at-expout expout
   59544 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59545 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59546 mv at-expout expout
   59547 # 5. Check
   59548 { set +x
   59549 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59550 at_fn_check_prepare_trace "calc.at:597"
   59551 ( $at_check_trace; cat stderr
   59552 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59553 at_status=$? at_failed=false
   59554 $at_check_filter
   59555 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59556 $at_diff expout "$at_stdout" || at_failed=:
   59557 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59558 $at_failed && at_fn_log_failure
   59559 $at_traceon; }
   59560 
   59561 
   59562 # Exercise error messages with EOF: work on an empty file.
   59563 { set +x
   59564 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc /dev/null"
   59565 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:597"
   59566 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   59567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59568 at_status=$? at_failed=false
   59569 $at_check_filter
   59570 echo stderr:; tee stderr <"$at_stderr"
   59571 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59572 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597"
   59573 $at_failed && at_fn_log_failure
   59574 $at_traceon; }
   59575 
   59576 { set +x
   59577 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59578 at_fn_check_prepare_trace "calc.at:597"
   59579 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59580 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59581 at_status=$? at_failed=false
   59582 $at_check_filter
   59583 echo stderr:; tee stderr <"$at_stderr"
   59584 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59585 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59586 $at_failed && at_fn_log_failure
   59587 $at_traceon; }
   59588 
   59589 
   59590 
   59591 # Normalize the observed and expected error messages, depending upon the
   59592 # options.
   59593 # 1. Remove the traces from observed.
   59594 sed '/^Starting/d
   59595 /^Entering/d
   59596 /^Stack/d
   59597 /^Reading/d
   59598 /^Reducing/d
   59599 /^Return/d
   59600 /^Shifting/d
   59601 /^state/d
   59602 /^Cleanup:/d
   59603 /^Error:/d
   59604 /^Next/d
   59605 /^Now/d
   59606 /^Discarding/d
   59607 / \$[0-9$]* = /d
   59608 /^yydestructor:/d' stderr >at-stderr
   59609 mv at-stderr stderr
   59610 # 2. Create the reference error message.
   59611 cat >expout <<'_ATEOF'
   59612 1.1: syntax error, unexpected end of input
   59613 _ATEOF
   59614 
   59615 # 3. If locations are not used, remove them.
   59616 sed 's/^[-0-9.]*: //' expout >at-expout
   59617 mv at-expout expout
   59618 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59619 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59620 mv at-expout expout
   59621 # 5. Check
   59622 { set +x
   59623 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59624 at_fn_check_prepare_trace "calc.at:597"
   59625 ( $at_check_trace; cat stderr
   59626 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59627 at_status=$? at_failed=false
   59628 $at_check_filter
   59629 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59630 $at_diff expout "$at_stdout" || at_failed=:
   59631 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59632 $at_failed && at_fn_log_failure
   59633 $at_traceon; }
   59634 
   59635 
   59636 
   59637 # Exercise the error token: without it, we die at the first error,
   59638 # hence be sure to
   59639 #
   59640 # - have several errors which exercise different shift/discardings
   59641 #   - (): nothing to pop, nothing to discard
   59642 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   59643 #   - (* * *): nothing to pop, a lot to discard
   59644 #   - (1 + 2 * *): some to pop and discard
   59645 #
   59646 # - test the action associated to `error'
   59647 #
   59648 # - check the lookahead that triggers an error is not discarded
   59649 #   when we enter error recovery.  Below, the lookahead causing the
   59650 #   first error is ")", which is needed to recover from the error and
   59651 #   produce the "0" that triggers the "0 != 1" error.
   59652 #
   59653 cat >input <<'_ATEOF'
   59654 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   59655 _ATEOF
   59656 
   59657 { set +x
   59658 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59659 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59660 ( $at_check_trace;  $PREPARSER ./calc input
   59661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59662 at_status=$? at_failed=false
   59663 $at_check_filter
   59664 echo stderr:; tee stderr <"$at_stderr"
   59665 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59666 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59667 $at_failed && at_fn_log_failure
   59668 $at_traceon; }
   59669 
   59670 { set +x
   59671 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59672 at_fn_check_prepare_trace "calc.at:597"
   59673 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59674 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59675 at_status=$? at_failed=false
   59676 $at_check_filter
   59677 echo stderr:; tee stderr <"$at_stderr"
   59678 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59679 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59680 $at_failed && at_fn_log_failure
   59681 $at_traceon; }
   59682 
   59683 
   59684 
   59685 # Normalize the observed and expected error messages, depending upon the
   59686 # options.
   59687 # 1. Remove the traces from observed.
   59688 sed '/^Starting/d
   59689 /^Entering/d
   59690 /^Stack/d
   59691 /^Reading/d
   59692 /^Reducing/d
   59693 /^Return/d
   59694 /^Shifting/d
   59695 /^state/d
   59696 /^Cleanup:/d
   59697 /^Error:/d
   59698 /^Next/d
   59699 /^Now/d
   59700 /^Discarding/d
   59701 / \$[0-9$]* = /d
   59702 /^yydestructor:/d' stderr >at-stderr
   59703 mv at-stderr stderr
   59704 # 2. Create the reference error message.
   59705 cat >expout <<'_ATEOF'
   59706 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   59707 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   59708 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   59709 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   59710 calc: error: 4444 != 1
   59711 _ATEOF
   59712 
   59713 # 3. If locations are not used, remove them.
   59714 sed 's/^[-0-9.]*: //' expout >at-expout
   59715 mv at-expout expout
   59716 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59717 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59718 mv at-expout expout
   59719 # 5. Check
   59720 { set +x
   59721 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59722 at_fn_check_prepare_trace "calc.at:597"
   59723 ( $at_check_trace; cat stderr
   59724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59725 at_status=$? at_failed=false
   59726 $at_check_filter
   59727 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59728 $at_diff expout "$at_stdout" || at_failed=:
   59729 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59730 $at_failed && at_fn_log_failure
   59731 $at_traceon; }
   59732 
   59733 
   59734 
   59735 # The same, but this time exercising explicitly triggered syntax errors.
   59736 # POSIX says the lookahead causing the error should not be discarded.
   59737 cat >input <<'_ATEOF'
   59738 (!) + (1 2) = 1
   59739 _ATEOF
   59740 
   59741 { set +x
   59742 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59743 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59744 ( $at_check_trace;  $PREPARSER ./calc input
   59745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59746 at_status=$? at_failed=false
   59747 $at_check_filter
   59748 echo stderr:; tee stderr <"$at_stderr"
   59749 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59750 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59751 $at_failed && at_fn_log_failure
   59752 $at_traceon; }
   59753 
   59754 { set +x
   59755 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59756 at_fn_check_prepare_trace "calc.at:597"
   59757 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59759 at_status=$? at_failed=false
   59760 $at_check_filter
   59761 echo stderr:; tee stderr <"$at_stderr"
   59762 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59763 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59764 $at_failed && at_fn_log_failure
   59765 $at_traceon; }
   59766 
   59767 
   59768 
   59769 # Normalize the observed and expected error messages, depending upon the
   59770 # options.
   59771 # 1. Remove the traces from observed.
   59772 sed '/^Starting/d
   59773 /^Entering/d
   59774 /^Stack/d
   59775 /^Reading/d
   59776 /^Reducing/d
   59777 /^Return/d
   59778 /^Shifting/d
   59779 /^state/d
   59780 /^Cleanup:/d
   59781 /^Error:/d
   59782 /^Next/d
   59783 /^Now/d
   59784 /^Discarding/d
   59785 / \$[0-9$]* = /d
   59786 /^yydestructor:/d' stderr >at-stderr
   59787 mv at-stderr stderr
   59788 # 2. Create the reference error message.
   59789 cat >expout <<'_ATEOF'
   59790 1.10: syntax error, unexpected number
   59791 calc: error: 2222 != 1
   59792 _ATEOF
   59793 
   59794 # 3. If locations are not used, remove them.
   59795 sed 's/^[-0-9.]*: //' expout >at-expout
   59796 mv at-expout expout
   59797 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59798 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59799 mv at-expout expout
   59800 # 5. Check
   59801 { set +x
   59802 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59803 at_fn_check_prepare_trace "calc.at:597"
   59804 ( $at_check_trace; cat stderr
   59805 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59806 at_status=$? at_failed=false
   59807 $at_check_filter
   59808 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59809 $at_diff expout "$at_stdout" || at_failed=:
   59810 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59811 $at_failed && at_fn_log_failure
   59812 $at_traceon; }
   59813 
   59814 
   59815 cat >input <<'_ATEOF'
   59816 (- *) + (1 2) = 1
   59817 _ATEOF
   59818 
   59819 { set +x
   59820 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59821 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59822 ( $at_check_trace;  $PREPARSER ./calc input
   59823 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59824 at_status=$? at_failed=false
   59825 $at_check_filter
   59826 echo stderr:; tee stderr <"$at_stderr"
   59827 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59828 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59829 $at_failed && at_fn_log_failure
   59830 $at_traceon; }
   59831 
   59832 { set +x
   59833 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59834 at_fn_check_prepare_trace "calc.at:597"
   59835 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59837 at_status=$? at_failed=false
   59838 $at_check_filter
   59839 echo stderr:; tee stderr <"$at_stderr"
   59840 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59841 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59842 $at_failed && at_fn_log_failure
   59843 $at_traceon; }
   59844 
   59845 
   59846 
   59847 # Normalize the observed and expected error messages, depending upon the
   59848 # options.
   59849 # 1. Remove the traces from observed.
   59850 sed '/^Starting/d
   59851 /^Entering/d
   59852 /^Stack/d
   59853 /^Reading/d
   59854 /^Reducing/d
   59855 /^Return/d
   59856 /^Shifting/d
   59857 /^state/d
   59858 /^Cleanup:/d
   59859 /^Error:/d
   59860 /^Next/d
   59861 /^Now/d
   59862 /^Discarding/d
   59863 / \$[0-9$]* = /d
   59864 /^yydestructor:/d' stderr >at-stderr
   59865 mv at-stderr stderr
   59866 # 2. Create the reference error message.
   59867 cat >expout <<'_ATEOF'
   59868 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   59869 1.12: syntax error, unexpected number
   59870 calc: error: 2222 != 1
   59871 _ATEOF
   59872 
   59873 # 3. If locations are not used, remove them.
   59874 sed 's/^[-0-9.]*: //' expout >at-expout
   59875 mv at-expout expout
   59876 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59877 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59878 mv at-expout expout
   59879 # 5. Check
   59880 { set +x
   59881 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59882 at_fn_check_prepare_trace "calc.at:597"
   59883 ( $at_check_trace; cat stderr
   59884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59885 at_status=$? at_failed=false
   59886 $at_check_filter
   59887 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59888 $at_diff expout "$at_stdout" || at_failed=:
   59889 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59890 $at_failed && at_fn_log_failure
   59891 $at_traceon; }
   59892 
   59893 
   59894 
   59895 # Check that yyerrok works properly: second error is not reported,
   59896 # third and fourth are.  Parse status is succesfull.
   59897 cat >input <<'_ATEOF'
   59898 (* *) + (*) + (*)
   59899 _ATEOF
   59900 
   59901 { set +x
   59902 $as_echo "$at_srcdir/calc.at:597:  \$PREPARSER ./calc input"
   59903 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597"
   59904 ( $at_check_trace;  $PREPARSER ./calc input
   59905 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59906 at_status=$? at_failed=false
   59907 $at_check_filter
   59908 echo stderr:; tee stderr <"$at_stderr"
   59909 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59910 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59911 $at_failed && at_fn_log_failure
   59912 $at_traceon; }
   59913 
   59914 { set +x
   59915 $as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   59916 at_fn_check_prepare_trace "calc.at:597"
   59917 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   59918 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59919 at_status=$? at_failed=false
   59920 $at_check_filter
   59921 echo stderr:; tee stderr <"$at_stderr"
   59922 at_fn_diff_devnull "$at_stdout" || at_failed=:
   59923 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59924 $at_failed && at_fn_log_failure
   59925 $at_traceon; }
   59926 
   59927 
   59928 
   59929 # Normalize the observed and expected error messages, depending upon the
   59930 # options.
   59931 # 1. Remove the traces from observed.
   59932 sed '/^Starting/d
   59933 /^Entering/d
   59934 /^Stack/d
   59935 /^Reading/d
   59936 /^Reducing/d
   59937 /^Return/d
   59938 /^Shifting/d
   59939 /^state/d
   59940 /^Cleanup:/d
   59941 /^Error:/d
   59942 /^Next/d
   59943 /^Now/d
   59944 /^Discarding/d
   59945 / \$[0-9$]* = /d
   59946 /^yydestructor:/d' stderr >at-stderr
   59947 mv at-stderr stderr
   59948 # 2. Create the reference error message.
   59949 cat >expout <<'_ATEOF'
   59950 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   59951 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   59952 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   59953 _ATEOF
   59954 
   59955 # 3. If locations are not used, remove them.
   59956 sed 's/^[-0-9.]*: //' expout >at-expout
   59957 mv at-expout expout
   59958 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   59959 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   59960 mv at-expout expout
   59961 # 5. Check
   59962 { set +x
   59963 $as_echo "$at_srcdir/calc.at:597: cat stderr"
   59964 at_fn_check_prepare_trace "calc.at:597"
   59965 ( $at_check_trace; cat stderr
   59966 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   59967 at_status=$? at_failed=false
   59968 $at_check_filter
   59969 at_fn_diff_devnull "$at_stderr" || at_failed=:
   59970 $at_diff expout "$at_stdout" || at_failed=:
   59971 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597"
   59972 $at_failed && at_fn_log_failure
   59973 $at_traceon; }
   59974 
   59975 
   59976 
   59977 
   59978 
   59979   set +x
   59980   $at_times_p && times >"$at_times_file"
   59981 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   59982 read at_status <"$at_status_file"
   59983 #AT_STOP_200
   59984 #AT_START_201
   59985 at_fn_group_banner 201 'calc.at:599' \
   59986   "Calculator %defines" "                            " 11
   59987 at_xfail=no
   59988 (
   59989   $as_echo "201. $at_setup_line: testing $at_desc ..."
   59990   $at_traceon
   59991 
   59992 
   59993 
   59994 
   59995 
   59996 
   59997 
   59998 
   59999 
   60000 
   60001 cat >calc.y <<'_ATEOF'
   60002 %code top {
   60003 #include <config.h>
   60004 /* We don't need perfect functions for these tests. */
   60005 #undef malloc
   60006 #undef memcmp
   60007 #undef realloc
   60008 }
   60009 
   60010 /* Infix notation calculator--calc */
   60011 %defines
   60012 
   60013 %code requires
   60014 {
   60015 
   60016   /* Exercise pre-prologue dependency to %union.  */
   60017   typedef int semantic_value;
   60018 }
   60019 
   60020 /* Exercise %union. */
   60021 %union
   60022 {
   60023   semantic_value ival;
   60024 };
   60025 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   60026 
   60027 %code provides
   60028 {
   60029   #include <stdio.h>
   60030   /* The input.  */
   60031   extern FILE *input;
   60032   extern semantic_value global_result;
   60033   extern int global_count;
   60034 }
   60035 
   60036 %code
   60037 {
   60038 #include <assert.h>
   60039 #include <string.h>
   60040 #define USE(Var)
   60041 
   60042 FILE *input;
   60043 static int power (int base, int exponent);
   60044 
   60045 static void yyerror ( const char *msg);
   60046 int yylex (void);
   60047 }
   60048 
   60049 
   60050 
   60051 /* Bison Declarations */
   60052 %token CALC_EOF 0 "end of input"
   60053 %token <ival> NUM "number"
   60054 %type  <ival> exp
   60055 
   60056 %nonassoc '=' /* comparison            */
   60057 %left '-' '+'
   60058 %left '*' '/'
   60059 %left NEG     /* negation--unary minus */
   60060 %right '^'    /* exponentiation        */
   60061 
   60062 /* Grammar follows */
   60063 %%
   60064 input:
   60065   line
   60066 | input line         {  }
   60067 ;
   60068 
   60069 line:
   60070   '\n'
   60071 | exp '\n'           { USE ($1); }
   60072 ;
   60073 
   60074 exp:
   60075   NUM                { $$ = $1;             }
   60076 | exp '=' exp
   60077   {
   60078     if ($1 != $3)
   60079       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   60080     $$ = $1;
   60081   }
   60082 | exp '+' exp        { $$ = $1 + $3;        }
   60083 | exp '-' exp        { $$ = $1 - $3;        }
   60084 | exp '*' exp        { $$ = $1 * $3;        }
   60085 | exp '/' exp        { $$ = $1 / $3;        }
   60086 | '-' exp  %prec NEG { $$ = -$2;            }
   60087 | exp '^' exp        { $$ = power ($1, $3); }
   60088 | '(' exp ')'        { $$ = $2;             }
   60089 | '(' error ')'      { $$ = 1111; yyerrok;  }
   60090 | '!'                { $$ = 0; YYERROR;     }
   60091 | '-' error          { $$ = 0; YYERROR;     }
   60092 ;
   60093 %%
   60094 
   60095 static int
   60096 power (int base, int exponent)
   60097 {
   60098   int res = 1;
   60099   assert (0 <= exponent);
   60100   for (/* Niente */; exponent; --exponent)
   60101     res *= base;
   60102   return res;
   60103 }
   60104 
   60105 
   60106 #include <stdio.h>
   60107 /* A C error reporting function.  */
   60108 static
   60109 void yyerror ( const char *msg)
   60110 {
   60111   fprintf (stderr, "%s\n", msg);
   60112 }
   60113 _ATEOF
   60114 
   60115 
   60116 
   60117 cat >calc-lex.c <<'_ATEOF'
   60118 #include <config.h>
   60119 /* We don't need perfect functions for these tests. */
   60120 #undef malloc
   60121 #undef memcmp
   60122 #undef realloc
   60123 
   60124 #include "calc.h"
   60125 
   60126 #include <ctype.h>
   60127 
   60128 int yylex (void);
   60129 static int get_char (void);
   60130 static void unget_char ( int c);
   60131 
   60132 
   60133 static int
   60134 get_char (void)
   60135 {
   60136   int res = getc (input);
   60137   ;
   60138 
   60139   return res;
   60140 }
   60141 
   60142 static void
   60143 unget_char ( int c)
   60144 {
   60145   ;
   60146 
   60147   ungetc (c, input);
   60148 }
   60149 
   60150 static int
   60151 read_signed_integer (void)
   60152 {
   60153   int c = get_char ();
   60154   int sign = 1;
   60155   int n = 0;
   60156 
   60157   ;
   60158   if (c == '-')
   60159     {
   60160       c = get_char ();
   60161       sign = -1;
   60162     }
   60163 
   60164   while (isdigit (c))
   60165     {
   60166       n = 10 * n + (c - '0');
   60167       c = get_char ();
   60168     }
   60169 
   60170   unget_char ( c);
   60171 
   60172   return sign * n;
   60173 }
   60174 
   60175 
   60176 /*---------------------------------------------------------------.
   60177 | Lexical analyzer returns an integer on the stack and the token |
   60178 | NUM, or the ASCII character read if not a number.  Skips all   |
   60179 | blanks and tabs, returns 0 for EOF.                            |
   60180 `---------------------------------------------------------------*/
   60181 
   60182 int yylex (void)
   60183 {
   60184   int c;
   60185   /* Skip current token, then white spaces.  */
   60186   do
   60187     {
   60188 
   60189     }
   60190   while ((c = get_char ()) == ' ' || c == '\t');
   60191 
   60192   /* process numbers   */
   60193   if (c == '.' || isdigit (c))
   60194     {
   60195       unget_char ( c);
   60196       (yylval).ival = read_signed_integer ();
   60197       return NUM;
   60198     }
   60199 
   60200   /* Return end-of-file.  */
   60201   if (c == EOF)
   60202     return CALC_EOF;
   60203 
   60204   /* Return single chars. */
   60205   return c;
   60206 }
   60207 _ATEOF
   60208 
   60209 
   60210 cat >calc-main.c <<'_ATEOF'
   60211 #include <config.h>
   60212 /* We don't need perfect functions for these tests. */
   60213 #undef malloc
   60214 #undef memcmp
   60215 #undef realloc
   60216 
   60217 #include "calc.h"
   60218 
   60219 #include <assert.h>
   60220 #if HAVE_UNISTD_H
   60221 # include <unistd.h>
   60222 #else
   60223 # undef alarm
   60224 # define alarm(seconds) /* empty */
   60225 #endif
   60226 
   60227 
   60228 
   60229 semantic_value global_result = 0;
   60230 int global_count = 0;
   60231 
   60232 /* A C main function.  */
   60233 int
   60234 main (int argc, const char **argv)
   60235 {
   60236   semantic_value result = 0;
   60237   int count = 0;
   60238   int status;
   60239 
   60240   /* This used to be alarm (10), but that isn't enough time for
   60241      a July 1995 vintage DEC Alphastation 200 4/100 system,
   60242      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   60243   alarm (100);
   60244 
   60245   if (argc == 2)
   60246     input = fopen (argv[1], "r");
   60247   else
   60248     input = stdin;
   60249 
   60250   if (!input)
   60251     {
   60252       perror (argv[1]);
   60253       return 3;
   60254     }
   60255 
   60256 
   60257   status = yyparse ();
   60258   if (fclose (input))
   60259     perror ("fclose");
   60260   assert (global_result == result);
   60261   assert (global_count == count);
   60262   return status;
   60263 }
   60264 _ATEOF
   60265 
   60266 
   60267 
   60268 
   60269 
   60270 
   60271 
   60272 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   60273   at_save_special_files
   60274   mkdir xml-tests
   60275     # Don't combine these Bison invocations since we want to be sure that
   60276   # --report=all isn't required to get the full XML file.
   60277   { set +x
   60278 $as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   60279                   --graph=xml-tests/test.dot -o calc.c calc.y"
   60280 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599"
   60281 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   60282                   --graph=xml-tests/test.dot -o calc.c calc.y
   60283 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60284 at_status=$? at_failed=false
   60285 $at_check_filter
   60286 echo stderr:; cat "$at_stderr"
   60287 echo stdout:; cat "$at_stdout"
   60288 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60289 $at_failed && at_fn_log_failure
   60290 $at_traceon; }
   60291 
   60292   { set +x
   60293 $as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   60294 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:599"
   60295 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   60296 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60297 at_status=$? at_failed=false
   60298 $at_check_filter
   60299 echo stderr:; cat "$at_stderr"
   60300 echo stdout:; cat "$at_stdout"
   60301 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60302 $at_failed && at_fn_log_failure
   60303 $at_traceon; }
   60304 
   60305     cp xml-tests/test.output expout
   60306   { set +x
   60307 $as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\
   60308              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   60309              xml-tests/test.xml"
   60310 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599"
   60311 ( $at_check_trace; $XSLTPROC \
   60312              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   60313              xml-tests/test.xml
   60314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60315 at_status=$? at_failed=false
   60316 $at_check_filter
   60317 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60318 $at_diff expout "$at_stdout" || at_failed=:
   60319 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60320 $at_failed && at_fn_log_failure
   60321 $at_traceon; }
   60322 
   60323   sort xml-tests/test.dot > expout
   60324   { set +x
   60325 $as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\
   60326              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   60327              xml-tests/test.xml | sort"
   60328 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599"
   60329 ( $at_check_trace; $XSLTPROC \
   60330              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   60331              xml-tests/test.xml | sort
   60332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60333 at_status=$? at_failed=false
   60334 $at_check_filter
   60335 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60336 $at_diff expout "$at_stdout" || at_failed=:
   60337 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60338 $at_failed && at_fn_log_failure
   60339 $at_traceon; }
   60340 
   60341   rm -rf xml-tests expout
   60342   at_restore_special_files
   60343 fi
   60344 { set +x
   60345 $as_echo "$at_srcdir/calc.at:599: bison -o calc.c calc.y"
   60346 at_fn_check_prepare_trace "calc.at:599"
   60347 ( $at_check_trace; bison -o calc.c calc.y
   60348 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60349 at_status=$? at_failed=false
   60350 $at_check_filter
   60351 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60352 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60353 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60354 $at_failed && at_fn_log_failure
   60355 $at_traceon; }
   60356 
   60357 
   60358    { set +x
   60359 $as_echo "$at_srcdir/calc.at:599: \$BISON_C_WORKS"
   60360 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:599"
   60361 ( $at_check_trace; $BISON_C_WORKS
   60362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60363 at_status=$? at_failed=false
   60364 $at_check_filter
   60365 echo stderr:; cat "$at_stderr"
   60366 echo stdout:; cat "$at_stdout"
   60367 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60368 $at_failed && at_fn_log_failure
   60369 $at_traceon; }
   60370 
   60371 { set +x
   60372 $as_echo "$at_srcdir/calc.at:599: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   60373 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:599"
   60374 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   60375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60376 at_status=$? at_failed=false
   60377 $at_check_filter
   60378 echo stderr:; cat "$at_stderr"
   60379 echo stdout:; cat "$at_stdout"
   60380 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60381 $at_failed && at_fn_log_failure
   60382 $at_traceon; }
   60383 
   60384 
   60385 { set +x
   60386 $as_echo "$at_srcdir/calc.at:599: \$PERL -ne '
   60387   chomp;
   60388   print \"\$.: {\$_}\\n\"
   60389     if (# No starting/ending empty lines.
   60390         (eof || \$. == 1) && /^\\s*\$/
   60391         # No trailing space.  FIXME: not ready for \"maint\".
   60392         # || /\\s\$/
   60393         )' calc.c
   60394 "
   60395 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599"
   60396 ( $at_check_trace; $PERL -ne '
   60397   chomp;
   60398   print "$.: {$_}\n"
   60399     if (# No starting/ending empty lines.
   60400         (eof || $. == 1) && /^\s*$/
   60401         # No trailing space.  FIXME: not ready for "maint".
   60402         # || /\s$/
   60403         )' calc.c
   60404 
   60405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60406 at_status=$? at_failed=false
   60407 $at_check_filter
   60408 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60409 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60410 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60411 $at_failed && at_fn_log_failure
   60412 $at_traceon; }
   60413 
   60414 { set +x
   60415 $as_echo "$at_srcdir/calc.at:599: \$PERL -ne '
   60416   chomp;
   60417   print \"\$.: {\$_}\\n\"
   60418     if (# No starting/ending empty lines.
   60419         (eof || \$. == 1) && /^\\s*\$/
   60420         # No trailing space.  FIXME: not ready for \"maint\".
   60421         # || /\\s\$/
   60422         )' calc.h
   60423 "
   60424 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599"
   60425 ( $at_check_trace; $PERL -ne '
   60426   chomp;
   60427   print "$.: {$_}\n"
   60428     if (# No starting/ending empty lines.
   60429         (eof || $. == 1) && /^\s*$/
   60430         # No trailing space.  FIXME: not ready for "maint".
   60431         # || /\s$/
   60432         )' calc.h
   60433 
   60434 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60435 at_status=$? at_failed=false
   60436 $at_check_filter
   60437 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60438 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60439 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60440 $at_failed && at_fn_log_failure
   60441 $at_traceon; }
   60442 
   60443 
   60444 # Test the priorities.
   60445 cat >input <<'_ATEOF'
   60446 1 + 2 * 3 = 7
   60447 1 + 2 * -3 = -5
   60448 
   60449 -1^2 = -1
   60450 (-1)^2 = 1
   60451 
   60452 ---1 = -1
   60453 
   60454 1 - 2 - 3 = -4
   60455 1 - (2 - 3) = 2
   60456 
   60457 2^2^3 = 256
   60458 (2^2)^3 = 64
   60459 _ATEOF
   60460 
   60461 { set +x
   60462 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60463 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60464 ( $at_check_trace;  $PREPARSER ./calc input
   60465 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60466 at_status=$? at_failed=false
   60467 $at_check_filter
   60468 echo stderr:; tee stderr <"$at_stderr"
   60469 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60470 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60471 $at_failed && at_fn_log_failure
   60472 $at_traceon; }
   60473 
   60474 { set +x
   60475 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60476 at_fn_check_prepare_trace "calc.at:599"
   60477 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60479 at_status=$? at_failed=false
   60480 $at_check_filter
   60481 echo stderr:; tee stderr <"$at_stderr"
   60482 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60483 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60484 $at_failed && at_fn_log_failure
   60485 $at_traceon; }
   60486 
   60487 
   60488 
   60489 
   60490 # Some syntax errors.
   60491 cat >input <<'_ATEOF'
   60492 1 2
   60493 _ATEOF
   60494 
   60495 { set +x
   60496 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60497 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60498 ( $at_check_trace;  $PREPARSER ./calc input
   60499 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60500 at_status=$? at_failed=false
   60501 $at_check_filter
   60502 echo stderr:; tee stderr <"$at_stderr"
   60503 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60504 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
   60505 $at_failed && at_fn_log_failure
   60506 $at_traceon; }
   60507 
   60508 { set +x
   60509 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60510 at_fn_check_prepare_trace "calc.at:599"
   60511 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60513 at_status=$? at_failed=false
   60514 $at_check_filter
   60515 echo stderr:; tee stderr <"$at_stderr"
   60516 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60517 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60518 $at_failed && at_fn_log_failure
   60519 $at_traceon; }
   60520 
   60521 
   60522 
   60523 # Normalize the observed and expected error messages, depending upon the
   60524 # options.
   60525 # 1. Remove the traces from observed.
   60526 sed '/^Starting/d
   60527 /^Entering/d
   60528 /^Stack/d
   60529 /^Reading/d
   60530 /^Reducing/d
   60531 /^Return/d
   60532 /^Shifting/d
   60533 /^state/d
   60534 /^Cleanup:/d
   60535 /^Error:/d
   60536 /^Next/d
   60537 /^Now/d
   60538 /^Discarding/d
   60539 / \$[0-9$]* = /d
   60540 /^yydestructor:/d' stderr >at-stderr
   60541 mv at-stderr stderr
   60542 # 2. Create the reference error message.
   60543 cat >expout <<'_ATEOF'
   60544 1.3: syntax error, unexpected number
   60545 _ATEOF
   60546 
   60547 # 3. If locations are not used, remove them.
   60548 sed 's/^[-0-9.]*: //' expout >at-expout
   60549 mv at-expout expout
   60550 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   60551 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   60552 mv at-expout expout
   60553 # 5. Check
   60554 { set +x
   60555 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   60556 at_fn_check_prepare_trace "calc.at:599"
   60557 ( $at_check_trace; cat stderr
   60558 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60559 at_status=$? at_failed=false
   60560 $at_check_filter
   60561 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60562 $at_diff expout "$at_stdout" || at_failed=:
   60563 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60564 $at_failed && at_fn_log_failure
   60565 $at_traceon; }
   60566 
   60567 
   60568 cat >input <<'_ATEOF'
   60569 1//2
   60570 _ATEOF
   60571 
   60572 { set +x
   60573 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60574 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60575 ( $at_check_trace;  $PREPARSER ./calc input
   60576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60577 at_status=$? at_failed=false
   60578 $at_check_filter
   60579 echo stderr:; tee stderr <"$at_stderr"
   60580 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60581 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
   60582 $at_failed && at_fn_log_failure
   60583 $at_traceon; }
   60584 
   60585 { set +x
   60586 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60587 at_fn_check_prepare_trace "calc.at:599"
   60588 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60590 at_status=$? at_failed=false
   60591 $at_check_filter
   60592 echo stderr:; tee stderr <"$at_stderr"
   60593 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60594 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60595 $at_failed && at_fn_log_failure
   60596 $at_traceon; }
   60597 
   60598 
   60599 
   60600 # Normalize the observed and expected error messages, depending upon the
   60601 # options.
   60602 # 1. Remove the traces from observed.
   60603 sed '/^Starting/d
   60604 /^Entering/d
   60605 /^Stack/d
   60606 /^Reading/d
   60607 /^Reducing/d
   60608 /^Return/d
   60609 /^Shifting/d
   60610 /^state/d
   60611 /^Cleanup:/d
   60612 /^Error:/d
   60613 /^Next/d
   60614 /^Now/d
   60615 /^Discarding/d
   60616 / \$[0-9$]* = /d
   60617 /^yydestructor:/d' stderr >at-stderr
   60618 mv at-stderr stderr
   60619 # 2. Create the reference error message.
   60620 cat >expout <<'_ATEOF'
   60621 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   60622 _ATEOF
   60623 
   60624 # 3. If locations are not used, remove them.
   60625 sed 's/^[-0-9.]*: //' expout >at-expout
   60626 mv at-expout expout
   60627 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   60628 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   60629 mv at-expout expout
   60630 # 5. Check
   60631 { set +x
   60632 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   60633 at_fn_check_prepare_trace "calc.at:599"
   60634 ( $at_check_trace; cat stderr
   60635 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60636 at_status=$? at_failed=false
   60637 $at_check_filter
   60638 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60639 $at_diff expout "$at_stdout" || at_failed=:
   60640 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60641 $at_failed && at_fn_log_failure
   60642 $at_traceon; }
   60643 
   60644 
   60645 cat >input <<'_ATEOF'
   60646 error
   60647 _ATEOF
   60648 
   60649 { set +x
   60650 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60651 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60652 ( $at_check_trace;  $PREPARSER ./calc input
   60653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60654 at_status=$? at_failed=false
   60655 $at_check_filter
   60656 echo stderr:; tee stderr <"$at_stderr"
   60657 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60658 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
   60659 $at_failed && at_fn_log_failure
   60660 $at_traceon; }
   60661 
   60662 { set +x
   60663 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60664 at_fn_check_prepare_trace "calc.at:599"
   60665 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60666 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60667 at_status=$? at_failed=false
   60668 $at_check_filter
   60669 echo stderr:; tee stderr <"$at_stderr"
   60670 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60671 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60672 $at_failed && at_fn_log_failure
   60673 $at_traceon; }
   60674 
   60675 
   60676 
   60677 # Normalize the observed and expected error messages, depending upon the
   60678 # options.
   60679 # 1. Remove the traces from observed.
   60680 sed '/^Starting/d
   60681 /^Entering/d
   60682 /^Stack/d
   60683 /^Reading/d
   60684 /^Reducing/d
   60685 /^Return/d
   60686 /^Shifting/d
   60687 /^state/d
   60688 /^Cleanup:/d
   60689 /^Error:/d
   60690 /^Next/d
   60691 /^Now/d
   60692 /^Discarding/d
   60693 / \$[0-9$]* = /d
   60694 /^yydestructor:/d' stderr >at-stderr
   60695 mv at-stderr stderr
   60696 # 2. Create the reference error message.
   60697 cat >expout <<'_ATEOF'
   60698 1.1: syntax error, unexpected $undefined
   60699 _ATEOF
   60700 
   60701 # 3. If locations are not used, remove them.
   60702 sed 's/^[-0-9.]*: //' expout >at-expout
   60703 mv at-expout expout
   60704 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   60705 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   60706 mv at-expout expout
   60707 # 5. Check
   60708 { set +x
   60709 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   60710 at_fn_check_prepare_trace "calc.at:599"
   60711 ( $at_check_trace; cat stderr
   60712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60713 at_status=$? at_failed=false
   60714 $at_check_filter
   60715 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60716 $at_diff expout "$at_stdout" || at_failed=:
   60717 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60718 $at_failed && at_fn_log_failure
   60719 $at_traceon; }
   60720 
   60721 
   60722 cat >input <<'_ATEOF'
   60723 1 = 2 = 3
   60724 _ATEOF
   60725 
   60726 { set +x
   60727 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60728 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60729 ( $at_check_trace;  $PREPARSER ./calc input
   60730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60731 at_status=$? at_failed=false
   60732 $at_check_filter
   60733 echo stderr:; tee stderr <"$at_stderr"
   60734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60735 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
   60736 $at_failed && at_fn_log_failure
   60737 $at_traceon; }
   60738 
   60739 { set +x
   60740 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60741 at_fn_check_prepare_trace "calc.at:599"
   60742 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60744 at_status=$? at_failed=false
   60745 $at_check_filter
   60746 echo stderr:; tee stderr <"$at_stderr"
   60747 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60748 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60749 $at_failed && at_fn_log_failure
   60750 $at_traceon; }
   60751 
   60752 
   60753 
   60754 # Normalize the observed and expected error messages, depending upon the
   60755 # options.
   60756 # 1. Remove the traces from observed.
   60757 sed '/^Starting/d
   60758 /^Entering/d
   60759 /^Stack/d
   60760 /^Reading/d
   60761 /^Reducing/d
   60762 /^Return/d
   60763 /^Shifting/d
   60764 /^state/d
   60765 /^Cleanup:/d
   60766 /^Error:/d
   60767 /^Next/d
   60768 /^Now/d
   60769 /^Discarding/d
   60770 / \$[0-9$]* = /d
   60771 /^yydestructor:/d' stderr >at-stderr
   60772 mv at-stderr stderr
   60773 # 2. Create the reference error message.
   60774 cat >expout <<'_ATEOF'
   60775 1.7: syntax error, unexpected '='
   60776 _ATEOF
   60777 
   60778 # 3. If locations are not used, remove them.
   60779 sed 's/^[-0-9.]*: //' expout >at-expout
   60780 mv at-expout expout
   60781 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   60782 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   60783 mv at-expout expout
   60784 # 5. Check
   60785 { set +x
   60786 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   60787 at_fn_check_prepare_trace "calc.at:599"
   60788 ( $at_check_trace; cat stderr
   60789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60790 at_status=$? at_failed=false
   60791 $at_check_filter
   60792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60793 $at_diff expout "$at_stdout" || at_failed=:
   60794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60795 $at_failed && at_fn_log_failure
   60796 $at_traceon; }
   60797 
   60798 
   60799 cat >input <<'_ATEOF'
   60800 
   60801 +1
   60802 _ATEOF
   60803 
   60804 { set +x
   60805 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60806 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60807 ( $at_check_trace;  $PREPARSER ./calc input
   60808 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60809 at_status=$? at_failed=false
   60810 $at_check_filter
   60811 echo stderr:; tee stderr <"$at_stderr"
   60812 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60813 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
   60814 $at_failed && at_fn_log_failure
   60815 $at_traceon; }
   60816 
   60817 { set +x
   60818 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60819 at_fn_check_prepare_trace "calc.at:599"
   60820 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60822 at_status=$? at_failed=false
   60823 $at_check_filter
   60824 echo stderr:; tee stderr <"$at_stderr"
   60825 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60826 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60827 $at_failed && at_fn_log_failure
   60828 $at_traceon; }
   60829 
   60830 
   60831 
   60832 # Normalize the observed and expected error messages, depending upon the
   60833 # options.
   60834 # 1. Remove the traces from observed.
   60835 sed '/^Starting/d
   60836 /^Entering/d
   60837 /^Stack/d
   60838 /^Reading/d
   60839 /^Reducing/d
   60840 /^Return/d
   60841 /^Shifting/d
   60842 /^state/d
   60843 /^Cleanup:/d
   60844 /^Error:/d
   60845 /^Next/d
   60846 /^Now/d
   60847 /^Discarding/d
   60848 / \$[0-9$]* = /d
   60849 /^yydestructor:/d' stderr >at-stderr
   60850 mv at-stderr stderr
   60851 # 2. Create the reference error message.
   60852 cat >expout <<'_ATEOF'
   60853 2.1: syntax error, unexpected '+'
   60854 _ATEOF
   60855 
   60856 # 3. If locations are not used, remove them.
   60857 sed 's/^[-0-9.]*: //' expout >at-expout
   60858 mv at-expout expout
   60859 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   60860 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   60861 mv at-expout expout
   60862 # 5. Check
   60863 { set +x
   60864 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   60865 at_fn_check_prepare_trace "calc.at:599"
   60866 ( $at_check_trace; cat stderr
   60867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60868 at_status=$? at_failed=false
   60869 $at_check_filter
   60870 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60871 $at_diff expout "$at_stdout" || at_failed=:
   60872 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60873 $at_failed && at_fn_log_failure
   60874 $at_traceon; }
   60875 
   60876 
   60877 # Exercise error messages with EOF: work on an empty file.
   60878 { set +x
   60879 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc /dev/null"
   60880 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:599"
   60881 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   60882 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60883 at_status=$? at_failed=false
   60884 $at_check_filter
   60885 echo stderr:; tee stderr <"$at_stderr"
   60886 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60887 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
   60888 $at_failed && at_fn_log_failure
   60889 $at_traceon; }
   60890 
   60891 { set +x
   60892 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60893 at_fn_check_prepare_trace "calc.at:599"
   60894 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60895 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60896 at_status=$? at_failed=false
   60897 $at_check_filter
   60898 echo stderr:; tee stderr <"$at_stderr"
   60899 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60900 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60901 $at_failed && at_fn_log_failure
   60902 $at_traceon; }
   60903 
   60904 
   60905 
   60906 # Normalize the observed and expected error messages, depending upon the
   60907 # options.
   60908 # 1. Remove the traces from observed.
   60909 sed '/^Starting/d
   60910 /^Entering/d
   60911 /^Stack/d
   60912 /^Reading/d
   60913 /^Reducing/d
   60914 /^Return/d
   60915 /^Shifting/d
   60916 /^state/d
   60917 /^Cleanup:/d
   60918 /^Error:/d
   60919 /^Next/d
   60920 /^Now/d
   60921 /^Discarding/d
   60922 / \$[0-9$]* = /d
   60923 /^yydestructor:/d' stderr >at-stderr
   60924 mv at-stderr stderr
   60925 # 2. Create the reference error message.
   60926 cat >expout <<'_ATEOF'
   60927 1.1: syntax error, unexpected end of input
   60928 _ATEOF
   60929 
   60930 # 3. If locations are not used, remove them.
   60931 sed 's/^[-0-9.]*: //' expout >at-expout
   60932 mv at-expout expout
   60933 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   60934 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   60935 mv at-expout expout
   60936 # 5. Check
   60937 { set +x
   60938 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   60939 at_fn_check_prepare_trace "calc.at:599"
   60940 ( $at_check_trace; cat stderr
   60941 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60942 at_status=$? at_failed=false
   60943 $at_check_filter
   60944 at_fn_diff_devnull "$at_stderr" || at_failed=:
   60945 $at_diff expout "$at_stdout" || at_failed=:
   60946 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60947 $at_failed && at_fn_log_failure
   60948 $at_traceon; }
   60949 
   60950 
   60951 
   60952 # Exercise the error token: without it, we die at the first error,
   60953 # hence be sure to
   60954 #
   60955 # - have several errors which exercise different shift/discardings
   60956 #   - (): nothing to pop, nothing to discard
   60957 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   60958 #   - (* * *): nothing to pop, a lot to discard
   60959 #   - (1 + 2 * *): some to pop and discard
   60960 #
   60961 # - test the action associated to `error'
   60962 #
   60963 # - check the lookahead that triggers an error is not discarded
   60964 #   when we enter error recovery.  Below, the lookahead causing the
   60965 #   first error is ")", which is needed to recover from the error and
   60966 #   produce the "0" that triggers the "0 != 1" error.
   60967 #
   60968 cat >input <<'_ATEOF'
   60969 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   60970 _ATEOF
   60971 
   60972 { set +x
   60973 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   60974 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   60975 ( $at_check_trace;  $PREPARSER ./calc input
   60976 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60977 at_status=$? at_failed=false
   60978 $at_check_filter
   60979 echo stderr:; tee stderr <"$at_stderr"
   60980 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60981 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60982 $at_failed && at_fn_log_failure
   60983 $at_traceon; }
   60984 
   60985 { set +x
   60986 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   60987 at_fn_check_prepare_trace "calc.at:599"
   60988 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   60989 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   60990 at_status=$? at_failed=false
   60991 $at_check_filter
   60992 echo stderr:; tee stderr <"$at_stderr"
   60993 at_fn_diff_devnull "$at_stdout" || at_failed=:
   60994 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   60995 $at_failed && at_fn_log_failure
   60996 $at_traceon; }
   60997 
   60998 
   60999 
   61000 # Normalize the observed and expected error messages, depending upon the
   61001 # options.
   61002 # 1. Remove the traces from observed.
   61003 sed '/^Starting/d
   61004 /^Entering/d
   61005 /^Stack/d
   61006 /^Reading/d
   61007 /^Reducing/d
   61008 /^Return/d
   61009 /^Shifting/d
   61010 /^state/d
   61011 /^Cleanup:/d
   61012 /^Error:/d
   61013 /^Next/d
   61014 /^Now/d
   61015 /^Discarding/d
   61016 / \$[0-9$]* = /d
   61017 /^yydestructor:/d' stderr >at-stderr
   61018 mv at-stderr stderr
   61019 # 2. Create the reference error message.
   61020 cat >expout <<'_ATEOF'
   61021 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   61022 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   61023 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   61024 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   61025 calc: error: 4444 != 1
   61026 _ATEOF
   61027 
   61028 # 3. If locations are not used, remove them.
   61029 sed 's/^[-0-9.]*: //' expout >at-expout
   61030 mv at-expout expout
   61031 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61032 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61033 mv at-expout expout
   61034 # 5. Check
   61035 { set +x
   61036 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   61037 at_fn_check_prepare_trace "calc.at:599"
   61038 ( $at_check_trace; cat stderr
   61039 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61040 at_status=$? at_failed=false
   61041 $at_check_filter
   61042 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61043 $at_diff expout "$at_stdout" || at_failed=:
   61044 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61045 $at_failed && at_fn_log_failure
   61046 $at_traceon; }
   61047 
   61048 
   61049 
   61050 # The same, but this time exercising explicitly triggered syntax errors.
   61051 # POSIX says the lookahead causing the error should not be discarded.
   61052 cat >input <<'_ATEOF'
   61053 (!) + (1 2) = 1
   61054 _ATEOF
   61055 
   61056 { set +x
   61057 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   61058 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   61059 ( $at_check_trace;  $PREPARSER ./calc input
   61060 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61061 at_status=$? at_failed=false
   61062 $at_check_filter
   61063 echo stderr:; tee stderr <"$at_stderr"
   61064 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61065 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61066 $at_failed && at_fn_log_failure
   61067 $at_traceon; }
   61068 
   61069 { set +x
   61070 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61071 at_fn_check_prepare_trace "calc.at:599"
   61072 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61074 at_status=$? at_failed=false
   61075 $at_check_filter
   61076 echo stderr:; tee stderr <"$at_stderr"
   61077 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61078 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61079 $at_failed && at_fn_log_failure
   61080 $at_traceon; }
   61081 
   61082 
   61083 
   61084 # Normalize the observed and expected error messages, depending upon the
   61085 # options.
   61086 # 1. Remove the traces from observed.
   61087 sed '/^Starting/d
   61088 /^Entering/d
   61089 /^Stack/d
   61090 /^Reading/d
   61091 /^Reducing/d
   61092 /^Return/d
   61093 /^Shifting/d
   61094 /^state/d
   61095 /^Cleanup:/d
   61096 /^Error:/d
   61097 /^Next/d
   61098 /^Now/d
   61099 /^Discarding/d
   61100 / \$[0-9$]* = /d
   61101 /^yydestructor:/d' stderr >at-stderr
   61102 mv at-stderr stderr
   61103 # 2. Create the reference error message.
   61104 cat >expout <<'_ATEOF'
   61105 1.10: syntax error, unexpected number
   61106 calc: error: 2222 != 1
   61107 _ATEOF
   61108 
   61109 # 3. If locations are not used, remove them.
   61110 sed 's/^[-0-9.]*: //' expout >at-expout
   61111 mv at-expout expout
   61112 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61113 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61114 mv at-expout expout
   61115 # 5. Check
   61116 { set +x
   61117 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   61118 at_fn_check_prepare_trace "calc.at:599"
   61119 ( $at_check_trace; cat stderr
   61120 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61121 at_status=$? at_failed=false
   61122 $at_check_filter
   61123 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61124 $at_diff expout "$at_stdout" || at_failed=:
   61125 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61126 $at_failed && at_fn_log_failure
   61127 $at_traceon; }
   61128 
   61129 
   61130 cat >input <<'_ATEOF'
   61131 (- *) + (1 2) = 1
   61132 _ATEOF
   61133 
   61134 { set +x
   61135 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   61136 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   61137 ( $at_check_trace;  $PREPARSER ./calc input
   61138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61139 at_status=$? at_failed=false
   61140 $at_check_filter
   61141 echo stderr:; tee stderr <"$at_stderr"
   61142 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61143 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61144 $at_failed && at_fn_log_failure
   61145 $at_traceon; }
   61146 
   61147 { set +x
   61148 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61149 at_fn_check_prepare_trace "calc.at:599"
   61150 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61151 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61152 at_status=$? at_failed=false
   61153 $at_check_filter
   61154 echo stderr:; tee stderr <"$at_stderr"
   61155 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61156 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61157 $at_failed && at_fn_log_failure
   61158 $at_traceon; }
   61159 
   61160 
   61161 
   61162 # Normalize the observed and expected error messages, depending upon the
   61163 # options.
   61164 # 1. Remove the traces from observed.
   61165 sed '/^Starting/d
   61166 /^Entering/d
   61167 /^Stack/d
   61168 /^Reading/d
   61169 /^Reducing/d
   61170 /^Return/d
   61171 /^Shifting/d
   61172 /^state/d
   61173 /^Cleanup:/d
   61174 /^Error:/d
   61175 /^Next/d
   61176 /^Now/d
   61177 /^Discarding/d
   61178 / \$[0-9$]* = /d
   61179 /^yydestructor:/d' stderr >at-stderr
   61180 mv at-stderr stderr
   61181 # 2. Create the reference error message.
   61182 cat >expout <<'_ATEOF'
   61183 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   61184 1.12: syntax error, unexpected number
   61185 calc: error: 2222 != 1
   61186 _ATEOF
   61187 
   61188 # 3. If locations are not used, remove them.
   61189 sed 's/^[-0-9.]*: //' expout >at-expout
   61190 mv at-expout expout
   61191 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61192 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61193 mv at-expout expout
   61194 # 5. Check
   61195 { set +x
   61196 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   61197 at_fn_check_prepare_trace "calc.at:599"
   61198 ( $at_check_trace; cat stderr
   61199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61200 at_status=$? at_failed=false
   61201 $at_check_filter
   61202 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61203 $at_diff expout "$at_stdout" || at_failed=:
   61204 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61205 $at_failed && at_fn_log_failure
   61206 $at_traceon; }
   61207 
   61208 
   61209 
   61210 # Check that yyerrok works properly: second error is not reported,
   61211 # third and fourth are.  Parse status is succesfull.
   61212 cat >input <<'_ATEOF'
   61213 (* *) + (*) + (*)
   61214 _ATEOF
   61215 
   61216 { set +x
   61217 $as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
   61218 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
   61219 ( $at_check_trace;  $PREPARSER ./calc input
   61220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61221 at_status=$? at_failed=false
   61222 $at_check_filter
   61223 echo stderr:; tee stderr <"$at_stderr"
   61224 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61225 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61226 $at_failed && at_fn_log_failure
   61227 $at_traceon; }
   61228 
   61229 { set +x
   61230 $as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61231 at_fn_check_prepare_trace "calc.at:599"
   61232 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61234 at_status=$? at_failed=false
   61235 $at_check_filter
   61236 echo stderr:; tee stderr <"$at_stderr"
   61237 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61238 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61239 $at_failed && at_fn_log_failure
   61240 $at_traceon; }
   61241 
   61242 
   61243 
   61244 # Normalize the observed and expected error messages, depending upon the
   61245 # options.
   61246 # 1. Remove the traces from observed.
   61247 sed '/^Starting/d
   61248 /^Entering/d
   61249 /^Stack/d
   61250 /^Reading/d
   61251 /^Reducing/d
   61252 /^Return/d
   61253 /^Shifting/d
   61254 /^state/d
   61255 /^Cleanup:/d
   61256 /^Error:/d
   61257 /^Next/d
   61258 /^Now/d
   61259 /^Discarding/d
   61260 / \$[0-9$]* = /d
   61261 /^yydestructor:/d' stderr >at-stderr
   61262 mv at-stderr stderr
   61263 # 2. Create the reference error message.
   61264 cat >expout <<'_ATEOF'
   61265 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   61266 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   61267 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   61268 _ATEOF
   61269 
   61270 # 3. If locations are not used, remove them.
   61271 sed 's/^[-0-9.]*: //' expout >at-expout
   61272 mv at-expout expout
   61273 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61274 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61275 mv at-expout expout
   61276 # 5. Check
   61277 { set +x
   61278 $as_echo "$at_srcdir/calc.at:599: cat stderr"
   61279 at_fn_check_prepare_trace "calc.at:599"
   61280 ( $at_check_trace; cat stderr
   61281 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61282 at_status=$? at_failed=false
   61283 $at_check_filter
   61284 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61285 $at_diff expout "$at_stdout" || at_failed=:
   61286 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
   61287 $at_failed && at_fn_log_failure
   61288 $at_traceon; }
   61289 
   61290 
   61291 
   61292 
   61293 
   61294   set +x
   61295   $at_times_p && times >"$at_times_file"
   61296 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   61297 read at_status <"$at_status_file"
   61298 #AT_STOP_201
   61299 #AT_START_202
   61300 at_fn_group_banner 202 'calc.at:600' \
   61301   "Calculator %locations" "                          " 11
   61302 at_xfail=no
   61303 (
   61304   $as_echo "202. $at_setup_line: testing $at_desc ..."
   61305   $at_traceon
   61306 
   61307 
   61308 
   61309 
   61310 
   61311 
   61312 
   61313 
   61314 
   61315 
   61316 cat >calc.y <<'_ATEOF'
   61317 %code top {
   61318 #include <config.h>
   61319 /* We don't need perfect functions for these tests. */
   61320 #undef malloc
   61321 #undef memcmp
   61322 #undef realloc
   61323 }
   61324 
   61325 /* Infix notation calculator--calc */
   61326 %locations
   61327 
   61328 %code requires
   61329 {
   61330 
   61331   /* Exercise pre-prologue dependency to %union.  */
   61332   typedef int semantic_value;
   61333 }
   61334 
   61335 /* Exercise %union. */
   61336 %union
   61337 {
   61338   semantic_value ival;
   61339 };
   61340 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   61341 
   61342 %code provides
   61343 {
   61344   #include <stdio.h>
   61345   /* The input.  */
   61346   extern FILE *input;
   61347   extern semantic_value global_result;
   61348   extern int global_count;
   61349 }
   61350 
   61351 %code
   61352 {
   61353 #include <assert.h>
   61354 #include <string.h>
   61355 #define USE(Var)
   61356 
   61357 FILE *input;
   61358 static int power (int base, int exponent);
   61359 
   61360 static void yyerror ( const char *msg);
   61361 int yylex (void);
   61362 }
   61363 
   61364 
   61365 
   61366 /* Bison Declarations */
   61367 %token CALC_EOF 0 "end of input"
   61368 %token <ival> NUM "number"
   61369 %type  <ival> exp
   61370 
   61371 %nonassoc '=' /* comparison            */
   61372 %left '-' '+'
   61373 %left '*' '/'
   61374 %left NEG     /* negation--unary minus */
   61375 %right '^'    /* exponentiation        */
   61376 
   61377 /* Grammar follows */
   61378 %%
   61379 input:
   61380   line
   61381 | input line         {  }
   61382 ;
   61383 
   61384 line:
   61385   '\n'
   61386 | exp '\n'           { USE ($1); }
   61387 ;
   61388 
   61389 exp:
   61390   NUM                { $$ = $1;             }
   61391 | exp '=' exp
   61392   {
   61393     if ($1 != $3)
   61394       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   61395     $$ = $1;
   61396   }
   61397 | exp '+' exp        { $$ = $1 + $3;        }
   61398 | exp '-' exp        { $$ = $1 - $3;        }
   61399 | exp '*' exp        { $$ = $1 * $3;        }
   61400 | exp '/' exp        { $$ = $1 / $3;        }
   61401 | '-' exp  %prec NEG { $$ = -$2;            }
   61402 | exp '^' exp        { $$ = power ($1, $3); }
   61403 | '(' exp ')'        { $$ = $2;             }
   61404 | '(' error ')'      { $$ = 1111; yyerrok;  }
   61405 | '!'                { $$ = 0; YYERROR;     }
   61406 | '-' error          { $$ = 0; YYERROR;     }
   61407 ;
   61408 %%
   61409 
   61410 static int
   61411 power (int base, int exponent)
   61412 {
   61413   int res = 1;
   61414   assert (0 <= exponent);
   61415   for (/* Niente */; exponent; --exponent)
   61416     res *= base;
   61417   return res;
   61418 }
   61419 
   61420 
   61421 #include <stdio.h>
   61422 /* A C error reporting function.  */
   61423 static
   61424 void yyerror ( const char *msg)
   61425 {
   61426   YY_LOCATION_PRINT (stderr, (yylloc));
   61427   fprintf (stderr, ": ");
   61428   fprintf (stderr, "%s\n", msg);
   61429 }
   61430 #include <ctype.h>
   61431 
   61432 int yylex (void);
   61433 static int get_char (void);
   61434 static void unget_char ( int c);
   61435 
   61436 
   61437 static YYLTYPE last_yylloc;
   61438 
   61439 static int
   61440 get_char (void)
   61441 {
   61442   int res = getc (input);
   61443   ;
   61444 
   61445   last_yylloc = (yylloc);
   61446   if (res == '\n')
   61447     {
   61448       (yylloc).last_line++;
   61449       (yylloc).last_column = 1;
   61450     }
   61451   else
   61452     (yylloc).last_column++;
   61453 
   61454   return res;
   61455 }
   61456 
   61457 static void
   61458 unget_char ( int c)
   61459 {
   61460   ;
   61461 
   61462   /* Wrong when C == `\n'. */
   61463   (yylloc) = last_yylloc;
   61464 
   61465   ungetc (c, input);
   61466 }
   61467 
   61468 static int
   61469 read_signed_integer (void)
   61470 {
   61471   int c = get_char ();
   61472   int sign = 1;
   61473   int n = 0;
   61474 
   61475   ;
   61476   if (c == '-')
   61477     {
   61478       c = get_char ();
   61479       sign = -1;
   61480     }
   61481 
   61482   while (isdigit (c))
   61483     {
   61484       n = 10 * n + (c - '0');
   61485       c = get_char ();
   61486     }
   61487 
   61488   unget_char ( c);
   61489 
   61490   return sign * n;
   61491 }
   61492 
   61493 
   61494 /*---------------------------------------------------------------.
   61495 | Lexical analyzer returns an integer on the stack and the token |
   61496 | NUM, or the ASCII character read if not a number.  Skips all   |
   61497 | blanks and tabs, returns 0 for EOF.                            |
   61498 `---------------------------------------------------------------*/
   61499 
   61500 int yylex (void)
   61501 {
   61502   int c;
   61503   /* Skip current token, then white spaces.  */
   61504   do
   61505     {
   61506      (yylloc).first_column = (yylloc).last_column;
   61507       (yylloc).first_line   = (yylloc).last_line;
   61508 
   61509     }
   61510   while ((c = get_char ()) == ' ' || c == '\t');
   61511 
   61512   /* process numbers   */
   61513   if (c == '.' || isdigit (c))
   61514     {
   61515       unget_char ( c);
   61516       (yylval).ival = read_signed_integer ();
   61517       return NUM;
   61518     }
   61519 
   61520   /* Return end-of-file.  */
   61521   if (c == EOF)
   61522     return CALC_EOF;
   61523 
   61524   /* Return single chars. */
   61525   return c;
   61526 }
   61527 
   61528 #include <assert.h>
   61529 #if HAVE_UNISTD_H
   61530 # include <unistd.h>
   61531 #else
   61532 # undef alarm
   61533 # define alarm(seconds) /* empty */
   61534 #endif
   61535 
   61536 
   61537 
   61538 semantic_value global_result = 0;
   61539 int global_count = 0;
   61540 
   61541 /* A C main function.  */
   61542 int
   61543 main (int argc, const char **argv)
   61544 {
   61545   semantic_value result = 0;
   61546   int count = 0;
   61547   int status;
   61548 
   61549   /* This used to be alarm (10), but that isn't enough time for
   61550      a July 1995 vintage DEC Alphastation 200 4/100 system,
   61551      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   61552   alarm (100);
   61553 
   61554   if (argc == 2)
   61555     input = fopen (argv[1], "r");
   61556   else
   61557     input = stdin;
   61558 
   61559   if (!input)
   61560     {
   61561       perror (argv[1]);
   61562       return 3;
   61563     }
   61564 
   61565 
   61566   status = yyparse ();
   61567   if (fclose (input))
   61568     perror ("fclose");
   61569   assert (global_result == result);
   61570   assert (global_count == count);
   61571   return status;
   61572 }
   61573 _ATEOF
   61574 
   61575 
   61576 
   61577 
   61578 
   61579 
   61580 
   61581 
   61582 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   61583   at_save_special_files
   61584   mkdir xml-tests
   61585     # Don't combine these Bison invocations since we want to be sure that
   61586   # --report=all isn't required to get the full XML file.
   61587   { set +x
   61588 $as_echo "$at_srcdir/calc.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   61589                   --graph=xml-tests/test.dot -o calc.c calc.y"
   61590 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:600"
   61591 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   61592                   --graph=xml-tests/test.dot -o calc.c calc.y
   61593 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61594 at_status=$? at_failed=false
   61595 $at_check_filter
   61596 echo stderr:; cat "$at_stderr"
   61597 echo stdout:; cat "$at_stdout"
   61598 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61599 $at_failed && at_fn_log_failure
   61600 $at_traceon; }
   61601 
   61602   { set +x
   61603 $as_echo "$at_srcdir/calc.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   61604 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:600"
   61605 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   61606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61607 at_status=$? at_failed=false
   61608 $at_check_filter
   61609 echo stderr:; cat "$at_stderr"
   61610 echo stdout:; cat "$at_stdout"
   61611 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61612 $at_failed && at_fn_log_failure
   61613 $at_traceon; }
   61614 
   61615     cp xml-tests/test.output expout
   61616   { set +x
   61617 $as_echo "$at_srcdir/calc.at:600: \$XSLTPROC \\
   61618              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   61619              xml-tests/test.xml"
   61620 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:600"
   61621 ( $at_check_trace; $XSLTPROC \
   61622              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   61623              xml-tests/test.xml
   61624 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61625 at_status=$? at_failed=false
   61626 $at_check_filter
   61627 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61628 $at_diff expout "$at_stdout" || at_failed=:
   61629 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61630 $at_failed && at_fn_log_failure
   61631 $at_traceon; }
   61632 
   61633   sort xml-tests/test.dot > expout
   61634   { set +x
   61635 $as_echo "$at_srcdir/calc.at:600: \$XSLTPROC \\
   61636              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   61637              xml-tests/test.xml | sort"
   61638 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:600"
   61639 ( $at_check_trace; $XSLTPROC \
   61640              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   61641              xml-tests/test.xml | sort
   61642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61643 at_status=$? at_failed=false
   61644 $at_check_filter
   61645 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61646 $at_diff expout "$at_stdout" || at_failed=:
   61647 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61648 $at_failed && at_fn_log_failure
   61649 $at_traceon; }
   61650 
   61651   rm -rf xml-tests expout
   61652   at_restore_special_files
   61653 fi
   61654 { set +x
   61655 $as_echo "$at_srcdir/calc.at:600: bison -o calc.c calc.y"
   61656 at_fn_check_prepare_trace "calc.at:600"
   61657 ( $at_check_trace; bison -o calc.c calc.y
   61658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61659 at_status=$? at_failed=false
   61660 $at_check_filter
   61661 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61662 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61663 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61664 $at_failed && at_fn_log_failure
   61665 $at_traceon; }
   61666 
   61667 
   61668    { set +x
   61669 $as_echo "$at_srcdir/calc.at:600: \$BISON_C_WORKS"
   61670 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:600"
   61671 ( $at_check_trace; $BISON_C_WORKS
   61672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61673 at_status=$? at_failed=false
   61674 $at_check_filter
   61675 echo stderr:; cat "$at_stderr"
   61676 echo stdout:; cat "$at_stdout"
   61677 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61678 $at_failed && at_fn_log_failure
   61679 $at_traceon; }
   61680 
   61681 { set +x
   61682 $as_echo "$at_srcdir/calc.at:600: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   61683 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:600"
   61684 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   61685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61686 at_status=$? at_failed=false
   61687 $at_check_filter
   61688 echo stderr:; cat "$at_stderr"
   61689 echo stdout:; cat "$at_stdout"
   61690 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61691 $at_failed && at_fn_log_failure
   61692 $at_traceon; }
   61693 
   61694 
   61695 { set +x
   61696 $as_echo "$at_srcdir/calc.at:600: \$PERL -ne '
   61697   chomp;
   61698   print \"\$.: {\$_}\\n\"
   61699     if (# No starting/ending empty lines.
   61700         (eof || \$. == 1) && /^\\s*\$/
   61701         # No trailing space.  FIXME: not ready for \"maint\".
   61702         # || /\\s\$/
   61703         )' calc.c
   61704 "
   61705 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:600"
   61706 ( $at_check_trace; $PERL -ne '
   61707   chomp;
   61708   print "$.: {$_}\n"
   61709     if (# No starting/ending empty lines.
   61710         (eof || $. == 1) && /^\s*$/
   61711         # No trailing space.  FIXME: not ready for "maint".
   61712         # || /\s$/
   61713         )' calc.c
   61714 
   61715 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61716 at_status=$? at_failed=false
   61717 $at_check_filter
   61718 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61719 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61720 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61721 $at_failed && at_fn_log_failure
   61722 $at_traceon; }
   61723 
   61724 
   61725 
   61726 # Test the priorities.
   61727 cat >input <<'_ATEOF'
   61728 1 + 2 * 3 = 7
   61729 1 + 2 * -3 = -5
   61730 
   61731 -1^2 = -1
   61732 (-1)^2 = 1
   61733 
   61734 ---1 = -1
   61735 
   61736 1 - 2 - 3 = -4
   61737 1 - (2 - 3) = 2
   61738 
   61739 2^2^3 = 256
   61740 (2^2)^3 = 64
   61741 _ATEOF
   61742 
   61743 { set +x
   61744 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   61745 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   61746 ( $at_check_trace;  $PREPARSER ./calc input
   61747 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61748 at_status=$? at_failed=false
   61749 $at_check_filter
   61750 echo stderr:; tee stderr <"$at_stderr"
   61751 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61752 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61753 $at_failed && at_fn_log_failure
   61754 $at_traceon; }
   61755 
   61756 { set +x
   61757 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61758 at_fn_check_prepare_trace "calc.at:600"
   61759 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61761 at_status=$? at_failed=false
   61762 $at_check_filter
   61763 echo stderr:; tee stderr <"$at_stderr"
   61764 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61765 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61766 $at_failed && at_fn_log_failure
   61767 $at_traceon; }
   61768 
   61769 
   61770 
   61771 
   61772 # Some syntax errors.
   61773 cat >input <<'_ATEOF'
   61774 1 2
   61775 _ATEOF
   61776 
   61777 { set +x
   61778 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   61779 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   61780 ( $at_check_trace;  $PREPARSER ./calc input
   61781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61782 at_status=$? at_failed=false
   61783 $at_check_filter
   61784 echo stderr:; tee stderr <"$at_stderr"
   61785 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61786 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600"
   61787 $at_failed && at_fn_log_failure
   61788 $at_traceon; }
   61789 
   61790 { set +x
   61791 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61792 at_fn_check_prepare_trace "calc.at:600"
   61793 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61795 at_status=$? at_failed=false
   61796 $at_check_filter
   61797 echo stderr:; tee stderr <"$at_stderr"
   61798 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61799 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61800 $at_failed && at_fn_log_failure
   61801 $at_traceon; }
   61802 
   61803 
   61804 
   61805 # Normalize the observed and expected error messages, depending upon the
   61806 # options.
   61807 # 1. Remove the traces from observed.
   61808 sed '/^Starting/d
   61809 /^Entering/d
   61810 /^Stack/d
   61811 /^Reading/d
   61812 /^Reducing/d
   61813 /^Return/d
   61814 /^Shifting/d
   61815 /^state/d
   61816 /^Cleanup:/d
   61817 /^Error:/d
   61818 /^Next/d
   61819 /^Now/d
   61820 /^Discarding/d
   61821 / \$[0-9$]* = /d
   61822 /^yydestructor:/d' stderr >at-stderr
   61823 mv at-stderr stderr
   61824 # 2. Create the reference error message.
   61825 cat >expout <<'_ATEOF'
   61826 1.3: syntax error, unexpected number
   61827 _ATEOF
   61828 
   61829 # 3. If locations are not used, remove them.
   61830 
   61831 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61832 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61833 mv at-expout expout
   61834 # 5. Check
   61835 { set +x
   61836 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   61837 at_fn_check_prepare_trace "calc.at:600"
   61838 ( $at_check_trace; cat stderr
   61839 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61840 at_status=$? at_failed=false
   61841 $at_check_filter
   61842 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61843 $at_diff expout "$at_stdout" || at_failed=:
   61844 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61845 $at_failed && at_fn_log_failure
   61846 $at_traceon; }
   61847 
   61848 
   61849 cat >input <<'_ATEOF'
   61850 1//2
   61851 _ATEOF
   61852 
   61853 { set +x
   61854 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   61855 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   61856 ( $at_check_trace;  $PREPARSER ./calc input
   61857 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61858 at_status=$? at_failed=false
   61859 $at_check_filter
   61860 echo stderr:; tee stderr <"$at_stderr"
   61861 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61862 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600"
   61863 $at_failed && at_fn_log_failure
   61864 $at_traceon; }
   61865 
   61866 { set +x
   61867 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61868 at_fn_check_prepare_trace "calc.at:600"
   61869 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61870 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61871 at_status=$? at_failed=false
   61872 $at_check_filter
   61873 echo stderr:; tee stderr <"$at_stderr"
   61874 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61875 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61876 $at_failed && at_fn_log_failure
   61877 $at_traceon; }
   61878 
   61879 
   61880 
   61881 # Normalize the observed and expected error messages, depending upon the
   61882 # options.
   61883 # 1. Remove the traces from observed.
   61884 sed '/^Starting/d
   61885 /^Entering/d
   61886 /^Stack/d
   61887 /^Reading/d
   61888 /^Reducing/d
   61889 /^Return/d
   61890 /^Shifting/d
   61891 /^state/d
   61892 /^Cleanup:/d
   61893 /^Error:/d
   61894 /^Next/d
   61895 /^Now/d
   61896 /^Discarding/d
   61897 / \$[0-9$]* = /d
   61898 /^yydestructor:/d' stderr >at-stderr
   61899 mv at-stderr stderr
   61900 # 2. Create the reference error message.
   61901 cat >expout <<'_ATEOF'
   61902 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   61903 _ATEOF
   61904 
   61905 # 3. If locations are not used, remove them.
   61906 
   61907 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61908 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61909 mv at-expout expout
   61910 # 5. Check
   61911 { set +x
   61912 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   61913 at_fn_check_prepare_trace "calc.at:600"
   61914 ( $at_check_trace; cat stderr
   61915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61916 at_status=$? at_failed=false
   61917 $at_check_filter
   61918 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61919 $at_diff expout "$at_stdout" || at_failed=:
   61920 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61921 $at_failed && at_fn_log_failure
   61922 $at_traceon; }
   61923 
   61924 
   61925 cat >input <<'_ATEOF'
   61926 error
   61927 _ATEOF
   61928 
   61929 { set +x
   61930 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   61931 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   61932 ( $at_check_trace;  $PREPARSER ./calc input
   61933 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61934 at_status=$? at_failed=false
   61935 $at_check_filter
   61936 echo stderr:; tee stderr <"$at_stderr"
   61937 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61938 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600"
   61939 $at_failed && at_fn_log_failure
   61940 $at_traceon; }
   61941 
   61942 { set +x
   61943 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   61944 at_fn_check_prepare_trace "calc.at:600"
   61945 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   61946 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61947 at_status=$? at_failed=false
   61948 $at_check_filter
   61949 echo stderr:; tee stderr <"$at_stderr"
   61950 at_fn_diff_devnull "$at_stdout" || at_failed=:
   61951 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61952 $at_failed && at_fn_log_failure
   61953 $at_traceon; }
   61954 
   61955 
   61956 
   61957 # Normalize the observed and expected error messages, depending upon the
   61958 # options.
   61959 # 1. Remove the traces from observed.
   61960 sed '/^Starting/d
   61961 /^Entering/d
   61962 /^Stack/d
   61963 /^Reading/d
   61964 /^Reducing/d
   61965 /^Return/d
   61966 /^Shifting/d
   61967 /^state/d
   61968 /^Cleanup:/d
   61969 /^Error:/d
   61970 /^Next/d
   61971 /^Now/d
   61972 /^Discarding/d
   61973 / \$[0-9$]* = /d
   61974 /^yydestructor:/d' stderr >at-stderr
   61975 mv at-stderr stderr
   61976 # 2. Create the reference error message.
   61977 cat >expout <<'_ATEOF'
   61978 1.1: syntax error, unexpected $undefined
   61979 _ATEOF
   61980 
   61981 # 3. If locations are not used, remove them.
   61982 
   61983 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   61984 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   61985 mv at-expout expout
   61986 # 5. Check
   61987 { set +x
   61988 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   61989 at_fn_check_prepare_trace "calc.at:600"
   61990 ( $at_check_trace; cat stderr
   61991 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   61992 at_status=$? at_failed=false
   61993 $at_check_filter
   61994 at_fn_diff_devnull "$at_stderr" || at_failed=:
   61995 $at_diff expout "$at_stdout" || at_failed=:
   61996 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   61997 $at_failed && at_fn_log_failure
   61998 $at_traceon; }
   61999 
   62000 
   62001 cat >input <<'_ATEOF'
   62002 1 = 2 = 3
   62003 _ATEOF
   62004 
   62005 { set +x
   62006 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   62007 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   62008 ( $at_check_trace;  $PREPARSER ./calc input
   62009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62010 at_status=$? at_failed=false
   62011 $at_check_filter
   62012 echo stderr:; tee stderr <"$at_stderr"
   62013 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62014 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600"
   62015 $at_failed && at_fn_log_failure
   62016 $at_traceon; }
   62017 
   62018 { set +x
   62019 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62020 at_fn_check_prepare_trace "calc.at:600"
   62021 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62023 at_status=$? at_failed=false
   62024 $at_check_filter
   62025 echo stderr:; tee stderr <"$at_stderr"
   62026 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62027 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62028 $at_failed && at_fn_log_failure
   62029 $at_traceon; }
   62030 
   62031 
   62032 
   62033 # Normalize the observed and expected error messages, depending upon the
   62034 # options.
   62035 # 1. Remove the traces from observed.
   62036 sed '/^Starting/d
   62037 /^Entering/d
   62038 /^Stack/d
   62039 /^Reading/d
   62040 /^Reducing/d
   62041 /^Return/d
   62042 /^Shifting/d
   62043 /^state/d
   62044 /^Cleanup:/d
   62045 /^Error:/d
   62046 /^Next/d
   62047 /^Now/d
   62048 /^Discarding/d
   62049 / \$[0-9$]* = /d
   62050 /^yydestructor:/d' stderr >at-stderr
   62051 mv at-stderr stderr
   62052 # 2. Create the reference error message.
   62053 cat >expout <<'_ATEOF'
   62054 1.7: syntax error, unexpected '='
   62055 _ATEOF
   62056 
   62057 # 3. If locations are not used, remove them.
   62058 
   62059 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62060 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62061 mv at-expout expout
   62062 # 5. Check
   62063 { set +x
   62064 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62065 at_fn_check_prepare_trace "calc.at:600"
   62066 ( $at_check_trace; cat stderr
   62067 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62068 at_status=$? at_failed=false
   62069 $at_check_filter
   62070 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62071 $at_diff expout "$at_stdout" || at_failed=:
   62072 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62073 $at_failed && at_fn_log_failure
   62074 $at_traceon; }
   62075 
   62076 
   62077 cat >input <<'_ATEOF'
   62078 
   62079 +1
   62080 _ATEOF
   62081 
   62082 { set +x
   62083 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   62084 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   62085 ( $at_check_trace;  $PREPARSER ./calc input
   62086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62087 at_status=$? at_failed=false
   62088 $at_check_filter
   62089 echo stderr:; tee stderr <"$at_stderr"
   62090 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62091 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600"
   62092 $at_failed && at_fn_log_failure
   62093 $at_traceon; }
   62094 
   62095 { set +x
   62096 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62097 at_fn_check_prepare_trace "calc.at:600"
   62098 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62099 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62100 at_status=$? at_failed=false
   62101 $at_check_filter
   62102 echo stderr:; tee stderr <"$at_stderr"
   62103 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62104 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62105 $at_failed && at_fn_log_failure
   62106 $at_traceon; }
   62107 
   62108 
   62109 
   62110 # Normalize the observed and expected error messages, depending upon the
   62111 # options.
   62112 # 1. Remove the traces from observed.
   62113 sed '/^Starting/d
   62114 /^Entering/d
   62115 /^Stack/d
   62116 /^Reading/d
   62117 /^Reducing/d
   62118 /^Return/d
   62119 /^Shifting/d
   62120 /^state/d
   62121 /^Cleanup:/d
   62122 /^Error:/d
   62123 /^Next/d
   62124 /^Now/d
   62125 /^Discarding/d
   62126 / \$[0-9$]* = /d
   62127 /^yydestructor:/d' stderr >at-stderr
   62128 mv at-stderr stderr
   62129 # 2. Create the reference error message.
   62130 cat >expout <<'_ATEOF'
   62131 2.1: syntax error, unexpected '+'
   62132 _ATEOF
   62133 
   62134 # 3. If locations are not used, remove them.
   62135 
   62136 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62137 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62138 mv at-expout expout
   62139 # 5. Check
   62140 { set +x
   62141 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62142 at_fn_check_prepare_trace "calc.at:600"
   62143 ( $at_check_trace; cat stderr
   62144 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62145 at_status=$? at_failed=false
   62146 $at_check_filter
   62147 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62148 $at_diff expout "$at_stdout" || at_failed=:
   62149 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62150 $at_failed && at_fn_log_failure
   62151 $at_traceon; }
   62152 
   62153 
   62154 # Exercise error messages with EOF: work on an empty file.
   62155 { set +x
   62156 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc /dev/null"
   62157 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:600"
   62158 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   62159 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62160 at_status=$? at_failed=false
   62161 $at_check_filter
   62162 echo stderr:; tee stderr <"$at_stderr"
   62163 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62164 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600"
   62165 $at_failed && at_fn_log_failure
   62166 $at_traceon; }
   62167 
   62168 { set +x
   62169 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62170 at_fn_check_prepare_trace "calc.at:600"
   62171 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62173 at_status=$? at_failed=false
   62174 $at_check_filter
   62175 echo stderr:; tee stderr <"$at_stderr"
   62176 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62177 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62178 $at_failed && at_fn_log_failure
   62179 $at_traceon; }
   62180 
   62181 
   62182 
   62183 # Normalize the observed and expected error messages, depending upon the
   62184 # options.
   62185 # 1. Remove the traces from observed.
   62186 sed '/^Starting/d
   62187 /^Entering/d
   62188 /^Stack/d
   62189 /^Reading/d
   62190 /^Reducing/d
   62191 /^Return/d
   62192 /^Shifting/d
   62193 /^state/d
   62194 /^Cleanup:/d
   62195 /^Error:/d
   62196 /^Next/d
   62197 /^Now/d
   62198 /^Discarding/d
   62199 / \$[0-9$]* = /d
   62200 /^yydestructor:/d' stderr >at-stderr
   62201 mv at-stderr stderr
   62202 # 2. Create the reference error message.
   62203 cat >expout <<'_ATEOF'
   62204 1.1: syntax error, unexpected end of input
   62205 _ATEOF
   62206 
   62207 # 3. If locations are not used, remove them.
   62208 
   62209 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62210 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62211 mv at-expout expout
   62212 # 5. Check
   62213 { set +x
   62214 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62215 at_fn_check_prepare_trace "calc.at:600"
   62216 ( $at_check_trace; cat stderr
   62217 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62218 at_status=$? at_failed=false
   62219 $at_check_filter
   62220 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62221 $at_diff expout "$at_stdout" || at_failed=:
   62222 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62223 $at_failed && at_fn_log_failure
   62224 $at_traceon; }
   62225 
   62226 
   62227 
   62228 # Exercise the error token: without it, we die at the first error,
   62229 # hence be sure to
   62230 #
   62231 # - have several errors which exercise different shift/discardings
   62232 #   - (): nothing to pop, nothing to discard
   62233 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   62234 #   - (* * *): nothing to pop, a lot to discard
   62235 #   - (1 + 2 * *): some to pop and discard
   62236 #
   62237 # - test the action associated to `error'
   62238 #
   62239 # - check the lookahead that triggers an error is not discarded
   62240 #   when we enter error recovery.  Below, the lookahead causing the
   62241 #   first error is ")", which is needed to recover from the error and
   62242 #   produce the "0" that triggers the "0 != 1" error.
   62243 #
   62244 cat >input <<'_ATEOF'
   62245 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   62246 _ATEOF
   62247 
   62248 { set +x
   62249 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   62250 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   62251 ( $at_check_trace;  $PREPARSER ./calc input
   62252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62253 at_status=$? at_failed=false
   62254 $at_check_filter
   62255 echo stderr:; tee stderr <"$at_stderr"
   62256 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62257 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62258 $at_failed && at_fn_log_failure
   62259 $at_traceon; }
   62260 
   62261 { set +x
   62262 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62263 at_fn_check_prepare_trace "calc.at:600"
   62264 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62266 at_status=$? at_failed=false
   62267 $at_check_filter
   62268 echo stderr:; tee stderr <"$at_stderr"
   62269 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62270 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62271 $at_failed && at_fn_log_failure
   62272 $at_traceon; }
   62273 
   62274 
   62275 
   62276 # Normalize the observed and expected error messages, depending upon the
   62277 # options.
   62278 # 1. Remove the traces from observed.
   62279 sed '/^Starting/d
   62280 /^Entering/d
   62281 /^Stack/d
   62282 /^Reading/d
   62283 /^Reducing/d
   62284 /^Return/d
   62285 /^Shifting/d
   62286 /^state/d
   62287 /^Cleanup:/d
   62288 /^Error:/d
   62289 /^Next/d
   62290 /^Now/d
   62291 /^Discarding/d
   62292 / \$[0-9$]* = /d
   62293 /^yydestructor:/d' stderr >at-stderr
   62294 mv at-stderr stderr
   62295 # 2. Create the reference error message.
   62296 cat >expout <<'_ATEOF'
   62297 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   62298 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   62299 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   62300 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   62301 calc: error: 4444 != 1
   62302 _ATEOF
   62303 
   62304 # 3. If locations are not used, remove them.
   62305 
   62306 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62307 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62308 mv at-expout expout
   62309 # 5. Check
   62310 { set +x
   62311 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62312 at_fn_check_prepare_trace "calc.at:600"
   62313 ( $at_check_trace; cat stderr
   62314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62315 at_status=$? at_failed=false
   62316 $at_check_filter
   62317 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62318 $at_diff expout "$at_stdout" || at_failed=:
   62319 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62320 $at_failed && at_fn_log_failure
   62321 $at_traceon; }
   62322 
   62323 
   62324 
   62325 # The same, but this time exercising explicitly triggered syntax errors.
   62326 # POSIX says the lookahead causing the error should not be discarded.
   62327 cat >input <<'_ATEOF'
   62328 (!) + (1 2) = 1
   62329 _ATEOF
   62330 
   62331 { set +x
   62332 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   62333 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   62334 ( $at_check_trace;  $PREPARSER ./calc input
   62335 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62336 at_status=$? at_failed=false
   62337 $at_check_filter
   62338 echo stderr:; tee stderr <"$at_stderr"
   62339 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62340 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62341 $at_failed && at_fn_log_failure
   62342 $at_traceon; }
   62343 
   62344 { set +x
   62345 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62346 at_fn_check_prepare_trace "calc.at:600"
   62347 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62348 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62349 at_status=$? at_failed=false
   62350 $at_check_filter
   62351 echo stderr:; tee stderr <"$at_stderr"
   62352 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62353 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62354 $at_failed && at_fn_log_failure
   62355 $at_traceon; }
   62356 
   62357 
   62358 
   62359 # Normalize the observed and expected error messages, depending upon the
   62360 # options.
   62361 # 1. Remove the traces from observed.
   62362 sed '/^Starting/d
   62363 /^Entering/d
   62364 /^Stack/d
   62365 /^Reading/d
   62366 /^Reducing/d
   62367 /^Return/d
   62368 /^Shifting/d
   62369 /^state/d
   62370 /^Cleanup:/d
   62371 /^Error:/d
   62372 /^Next/d
   62373 /^Now/d
   62374 /^Discarding/d
   62375 / \$[0-9$]* = /d
   62376 /^yydestructor:/d' stderr >at-stderr
   62377 mv at-stderr stderr
   62378 # 2. Create the reference error message.
   62379 cat >expout <<'_ATEOF'
   62380 1.10: syntax error, unexpected number
   62381 calc: error: 2222 != 1
   62382 _ATEOF
   62383 
   62384 # 3. If locations are not used, remove them.
   62385 
   62386 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62387 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62388 mv at-expout expout
   62389 # 5. Check
   62390 { set +x
   62391 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62392 at_fn_check_prepare_trace "calc.at:600"
   62393 ( $at_check_trace; cat stderr
   62394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62395 at_status=$? at_failed=false
   62396 $at_check_filter
   62397 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62398 $at_diff expout "$at_stdout" || at_failed=:
   62399 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62400 $at_failed && at_fn_log_failure
   62401 $at_traceon; }
   62402 
   62403 
   62404 cat >input <<'_ATEOF'
   62405 (- *) + (1 2) = 1
   62406 _ATEOF
   62407 
   62408 { set +x
   62409 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   62410 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   62411 ( $at_check_trace;  $PREPARSER ./calc input
   62412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62413 at_status=$? at_failed=false
   62414 $at_check_filter
   62415 echo stderr:; tee stderr <"$at_stderr"
   62416 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62417 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62418 $at_failed && at_fn_log_failure
   62419 $at_traceon; }
   62420 
   62421 { set +x
   62422 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62423 at_fn_check_prepare_trace "calc.at:600"
   62424 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62426 at_status=$? at_failed=false
   62427 $at_check_filter
   62428 echo stderr:; tee stderr <"$at_stderr"
   62429 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62430 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62431 $at_failed && at_fn_log_failure
   62432 $at_traceon; }
   62433 
   62434 
   62435 
   62436 # Normalize the observed and expected error messages, depending upon the
   62437 # options.
   62438 # 1. Remove the traces from observed.
   62439 sed '/^Starting/d
   62440 /^Entering/d
   62441 /^Stack/d
   62442 /^Reading/d
   62443 /^Reducing/d
   62444 /^Return/d
   62445 /^Shifting/d
   62446 /^state/d
   62447 /^Cleanup:/d
   62448 /^Error:/d
   62449 /^Next/d
   62450 /^Now/d
   62451 /^Discarding/d
   62452 / \$[0-9$]* = /d
   62453 /^yydestructor:/d' stderr >at-stderr
   62454 mv at-stderr stderr
   62455 # 2. Create the reference error message.
   62456 cat >expout <<'_ATEOF'
   62457 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   62458 1.12: syntax error, unexpected number
   62459 calc: error: 2222 != 1
   62460 _ATEOF
   62461 
   62462 # 3. If locations are not used, remove them.
   62463 
   62464 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62465 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62466 mv at-expout expout
   62467 # 5. Check
   62468 { set +x
   62469 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62470 at_fn_check_prepare_trace "calc.at:600"
   62471 ( $at_check_trace; cat stderr
   62472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62473 at_status=$? at_failed=false
   62474 $at_check_filter
   62475 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62476 $at_diff expout "$at_stdout" || at_failed=:
   62477 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62478 $at_failed && at_fn_log_failure
   62479 $at_traceon; }
   62480 
   62481 
   62482 
   62483 # Check that yyerrok works properly: second error is not reported,
   62484 # third and fourth are.  Parse status is succesfull.
   62485 cat >input <<'_ATEOF'
   62486 (* *) + (*) + (*)
   62487 _ATEOF
   62488 
   62489 { set +x
   62490 $as_echo "$at_srcdir/calc.at:600:  \$PREPARSER ./calc input"
   62491 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600"
   62492 ( $at_check_trace;  $PREPARSER ./calc input
   62493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62494 at_status=$? at_failed=false
   62495 $at_check_filter
   62496 echo stderr:; tee stderr <"$at_stderr"
   62497 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62498 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62499 $at_failed && at_fn_log_failure
   62500 $at_traceon; }
   62501 
   62502 { set +x
   62503 $as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   62504 at_fn_check_prepare_trace "calc.at:600"
   62505 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   62506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62507 at_status=$? at_failed=false
   62508 $at_check_filter
   62509 echo stderr:; tee stderr <"$at_stderr"
   62510 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62511 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62512 $at_failed && at_fn_log_failure
   62513 $at_traceon; }
   62514 
   62515 
   62516 
   62517 # Normalize the observed and expected error messages, depending upon the
   62518 # options.
   62519 # 1. Remove the traces from observed.
   62520 sed '/^Starting/d
   62521 /^Entering/d
   62522 /^Stack/d
   62523 /^Reading/d
   62524 /^Reducing/d
   62525 /^Return/d
   62526 /^Shifting/d
   62527 /^state/d
   62528 /^Cleanup:/d
   62529 /^Error:/d
   62530 /^Next/d
   62531 /^Now/d
   62532 /^Discarding/d
   62533 / \$[0-9$]* = /d
   62534 /^yydestructor:/d' stderr >at-stderr
   62535 mv at-stderr stderr
   62536 # 2. Create the reference error message.
   62537 cat >expout <<'_ATEOF'
   62538 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   62539 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   62540 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   62541 _ATEOF
   62542 
   62543 # 3. If locations are not used, remove them.
   62544 
   62545 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   62546 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   62547 mv at-expout expout
   62548 # 5. Check
   62549 { set +x
   62550 $as_echo "$at_srcdir/calc.at:600: cat stderr"
   62551 at_fn_check_prepare_trace "calc.at:600"
   62552 ( $at_check_trace; cat stderr
   62553 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62554 at_status=$? at_failed=false
   62555 $at_check_filter
   62556 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62557 $at_diff expout "$at_stdout" || at_failed=:
   62558 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600"
   62559 $at_failed && at_fn_log_failure
   62560 $at_traceon; }
   62561 
   62562 
   62563 
   62564 
   62565 
   62566   set +x
   62567   $at_times_p && times >"$at_times_file"
   62568 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   62569 read at_status <"$at_status_file"
   62570 #AT_STOP_202
   62571 #AT_START_203
   62572 at_fn_group_banner 203 'calc.at:602' \
   62573   "Calculator %name-prefix=\"calc\"" "                 " 11
   62574 at_xfail=no
   62575 (
   62576   $as_echo "203. $at_setup_line: testing $at_desc ..."
   62577   $at_traceon
   62578 
   62579 
   62580 
   62581 
   62582 
   62583 
   62584 
   62585 
   62586 
   62587 
   62588 cat >calc.y <<'_ATEOF'
   62589 %code top {
   62590 #include <config.h>
   62591 /* We don't need perfect functions for these tests. */
   62592 #undef malloc
   62593 #undef memcmp
   62594 #undef realloc
   62595 }
   62596 
   62597 /* Infix notation calculator--calc */
   62598 %name-prefix="calc"
   62599 
   62600 %code requires
   62601 {
   62602 
   62603   /* Exercise pre-prologue dependency to %union.  */
   62604   typedef int semantic_value;
   62605 }
   62606 
   62607 /* Exercise %union. */
   62608 %union
   62609 {
   62610   semantic_value ival;
   62611 };
   62612 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   62613 
   62614 %code provides
   62615 {
   62616   #include <stdio.h>
   62617   /* The input.  */
   62618   extern FILE *input;
   62619   extern semantic_value global_result;
   62620   extern int global_count;
   62621 }
   62622 
   62623 %code
   62624 {
   62625 #include <assert.h>
   62626 #include <string.h>
   62627 #define USE(Var)
   62628 
   62629 FILE *input;
   62630 static int power (int base, int exponent);
   62631 
   62632 static void yyerror ( const char *msg);
   62633 int yylex (void);
   62634 }
   62635 
   62636 
   62637 
   62638 /* Bison Declarations */
   62639 %token CALC_EOF 0 "end of input"
   62640 %token <ival> NUM "number"
   62641 %type  <ival> exp
   62642 
   62643 %nonassoc '=' /* comparison            */
   62644 %left '-' '+'
   62645 %left '*' '/'
   62646 %left NEG     /* negation--unary minus */
   62647 %right '^'    /* exponentiation        */
   62648 
   62649 /* Grammar follows */
   62650 %%
   62651 input:
   62652   line
   62653 | input line         {  }
   62654 ;
   62655 
   62656 line:
   62657   '\n'
   62658 | exp '\n'           { USE ($1); }
   62659 ;
   62660 
   62661 exp:
   62662   NUM                { $$ = $1;             }
   62663 | exp '=' exp
   62664   {
   62665     if ($1 != $3)
   62666       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   62667     $$ = $1;
   62668   }
   62669 | exp '+' exp        { $$ = $1 + $3;        }
   62670 | exp '-' exp        { $$ = $1 - $3;        }
   62671 | exp '*' exp        { $$ = $1 * $3;        }
   62672 | exp '/' exp        { $$ = $1 / $3;        }
   62673 | '-' exp  %prec NEG { $$ = -$2;            }
   62674 | exp '^' exp        { $$ = power ($1, $3); }
   62675 | '(' exp ')'        { $$ = $2;             }
   62676 | '(' error ')'      { $$ = 1111; yyerrok;  }
   62677 | '!'                { $$ = 0; YYERROR;     }
   62678 | '-' error          { $$ = 0; YYERROR;     }
   62679 ;
   62680 %%
   62681 
   62682 static int
   62683 power (int base, int exponent)
   62684 {
   62685   int res = 1;
   62686   assert (0 <= exponent);
   62687   for (/* Niente */; exponent; --exponent)
   62688     res *= base;
   62689   return res;
   62690 }
   62691 
   62692 
   62693 #include <stdio.h>
   62694 /* A C error reporting function.  */
   62695 static
   62696 void yyerror ( const char *msg)
   62697 {
   62698   fprintf (stderr, "%s\n", msg);
   62699 }
   62700 #include <ctype.h>
   62701 
   62702 int yylex (void);
   62703 static int get_char (void);
   62704 static void unget_char ( int c);
   62705 
   62706 
   62707 static int
   62708 get_char (void)
   62709 {
   62710   int res = getc (input);
   62711   ;
   62712 
   62713   return res;
   62714 }
   62715 
   62716 static void
   62717 unget_char ( int c)
   62718 {
   62719   ;
   62720 
   62721   ungetc (c, input);
   62722 }
   62723 
   62724 static int
   62725 read_signed_integer (void)
   62726 {
   62727   int c = get_char ();
   62728   int sign = 1;
   62729   int n = 0;
   62730 
   62731   ;
   62732   if (c == '-')
   62733     {
   62734       c = get_char ();
   62735       sign = -1;
   62736     }
   62737 
   62738   while (isdigit (c))
   62739     {
   62740       n = 10 * n + (c - '0');
   62741       c = get_char ();
   62742     }
   62743 
   62744   unget_char ( c);
   62745 
   62746   return sign * n;
   62747 }
   62748 
   62749 
   62750 /*---------------------------------------------------------------.
   62751 | Lexical analyzer returns an integer on the stack and the token |
   62752 | NUM, or the ASCII character read if not a number.  Skips all   |
   62753 | blanks and tabs, returns 0 for EOF.                            |
   62754 `---------------------------------------------------------------*/
   62755 
   62756 int yylex (void)
   62757 {
   62758   int c;
   62759   /* Skip current token, then white spaces.  */
   62760   do
   62761     {
   62762 
   62763     }
   62764   while ((c = get_char ()) == ' ' || c == '\t');
   62765 
   62766   /* process numbers   */
   62767   if (c == '.' || isdigit (c))
   62768     {
   62769       unget_char ( c);
   62770       (yylval).ival = read_signed_integer ();
   62771       return NUM;
   62772     }
   62773 
   62774   /* Return end-of-file.  */
   62775   if (c == EOF)
   62776     return CALC_EOF;
   62777 
   62778   /* Return single chars. */
   62779   return c;
   62780 }
   62781 
   62782 #include <assert.h>
   62783 #if HAVE_UNISTD_H
   62784 # include <unistd.h>
   62785 #else
   62786 # undef alarm
   62787 # define alarm(seconds) /* empty */
   62788 #endif
   62789 
   62790 
   62791 
   62792 semantic_value global_result = 0;
   62793 int global_count = 0;
   62794 
   62795 /* A C main function.  */
   62796 int
   62797 main (int argc, const char **argv)
   62798 {
   62799   semantic_value result = 0;
   62800   int count = 0;
   62801   int status;
   62802 
   62803   /* This used to be alarm (10), but that isn't enough time for
   62804      a July 1995 vintage DEC Alphastation 200 4/100 system,
   62805      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   62806   alarm (100);
   62807 
   62808   if (argc == 2)
   62809     input = fopen (argv[1], "r");
   62810   else
   62811     input = stdin;
   62812 
   62813   if (!input)
   62814     {
   62815       perror (argv[1]);
   62816       return 3;
   62817     }
   62818 
   62819 
   62820   status = yyparse ();
   62821   if (fclose (input))
   62822     perror ("fclose");
   62823   assert (global_result == result);
   62824   assert (global_count == count);
   62825   return status;
   62826 }
   62827 _ATEOF
   62828 
   62829 
   62830 
   62831 
   62832 
   62833 
   62834 
   62835 
   62836 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   62837   at_save_special_files
   62838   mkdir xml-tests
   62839     # Don't combine these Bison invocations since we want to be sure that
   62840   # --report=all isn't required to get the full XML file.
   62841   { set +x
   62842 $as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   62843                   --graph=xml-tests/test.dot -o calc.c calc.y"
   62844 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602"
   62845 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   62846                   --graph=xml-tests/test.dot -o calc.c calc.y
   62847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62848 at_status=$? at_failed=false
   62849 $at_check_filter
   62850 echo stderr:; cat "$at_stderr"
   62851 echo stdout:; cat "$at_stdout"
   62852 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62853 $at_failed && at_fn_log_failure
   62854 $at_traceon; }
   62855 
   62856   { set +x
   62857 $as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   62858 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:602"
   62859 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   62860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62861 at_status=$? at_failed=false
   62862 $at_check_filter
   62863 echo stderr:; cat "$at_stderr"
   62864 echo stdout:; cat "$at_stdout"
   62865 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62866 $at_failed && at_fn_log_failure
   62867 $at_traceon; }
   62868 
   62869     cp xml-tests/test.output expout
   62870   { set +x
   62871 $as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\
   62872              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   62873              xml-tests/test.xml"
   62874 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:602"
   62875 ( $at_check_trace; $XSLTPROC \
   62876              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   62877              xml-tests/test.xml
   62878 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62879 at_status=$? at_failed=false
   62880 $at_check_filter
   62881 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62882 $at_diff expout "$at_stdout" || at_failed=:
   62883 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62884 $at_failed && at_fn_log_failure
   62885 $at_traceon; }
   62886 
   62887   sort xml-tests/test.dot > expout
   62888   { set +x
   62889 $as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\
   62890              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   62891              xml-tests/test.xml | sort"
   62892 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:602"
   62893 ( $at_check_trace; $XSLTPROC \
   62894              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   62895              xml-tests/test.xml | sort
   62896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62897 at_status=$? at_failed=false
   62898 $at_check_filter
   62899 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62900 $at_diff expout "$at_stdout" || at_failed=:
   62901 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62902 $at_failed && at_fn_log_failure
   62903 $at_traceon; }
   62904 
   62905   rm -rf xml-tests expout
   62906   at_restore_special_files
   62907 fi
   62908 { set +x
   62909 $as_echo "$at_srcdir/calc.at:602: bison -o calc.c calc.y"
   62910 at_fn_check_prepare_trace "calc.at:602"
   62911 ( $at_check_trace; bison -o calc.c calc.y
   62912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62913 at_status=$? at_failed=false
   62914 $at_check_filter
   62915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62916 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62917 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62918 $at_failed && at_fn_log_failure
   62919 $at_traceon; }
   62920 
   62921 
   62922    { set +x
   62923 $as_echo "$at_srcdir/calc.at:602: \$BISON_C_WORKS"
   62924 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:602"
   62925 ( $at_check_trace; $BISON_C_WORKS
   62926 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62927 at_status=$? at_failed=false
   62928 $at_check_filter
   62929 echo stderr:; cat "$at_stderr"
   62930 echo stdout:; cat "$at_stdout"
   62931 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62932 $at_failed && at_fn_log_failure
   62933 $at_traceon; }
   62934 
   62935 { set +x
   62936 $as_echo "$at_srcdir/calc.at:602: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   62937 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:602"
   62938 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   62939 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62940 at_status=$? at_failed=false
   62941 $at_check_filter
   62942 echo stderr:; cat "$at_stderr"
   62943 echo stdout:; cat "$at_stdout"
   62944 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62945 $at_failed && at_fn_log_failure
   62946 $at_traceon; }
   62947 
   62948 
   62949 { set +x
   62950 $as_echo "$at_srcdir/calc.at:602: \$PERL -ne '
   62951   chomp;
   62952   print \"\$.: {\$_}\\n\"
   62953     if (# No starting/ending empty lines.
   62954         (eof || \$. == 1) && /^\\s*\$/
   62955         # No trailing space.  FIXME: not ready for \"maint\".
   62956         # || /\\s\$/
   62957         )' calc.c
   62958 "
   62959 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602"
   62960 ( $at_check_trace; $PERL -ne '
   62961   chomp;
   62962   print "$.: {$_}\n"
   62963     if (# No starting/ending empty lines.
   62964         (eof || $. == 1) && /^\s*$/
   62965         # No trailing space.  FIXME: not ready for "maint".
   62966         # || /\s$/
   62967         )' calc.c
   62968 
   62969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   62970 at_status=$? at_failed=false
   62971 $at_check_filter
   62972 at_fn_diff_devnull "$at_stderr" || at_failed=:
   62973 at_fn_diff_devnull "$at_stdout" || at_failed=:
   62974 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   62975 $at_failed && at_fn_log_failure
   62976 $at_traceon; }
   62977 
   62978 
   62979 
   62980 # Test the priorities.
   62981 cat >input <<'_ATEOF'
   62982 1 + 2 * 3 = 7
   62983 1 + 2 * -3 = -5
   62984 
   62985 -1^2 = -1
   62986 (-1)^2 = 1
   62987 
   62988 ---1 = -1
   62989 
   62990 1 - 2 - 3 = -4
   62991 1 - (2 - 3) = 2
   62992 
   62993 2^2^3 = 256
   62994 (2^2)^3 = 64
   62995 _ATEOF
   62996 
   62997 { set +x
   62998 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   62999 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63000 ( $at_check_trace;  $PREPARSER ./calc input
   63001 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63002 at_status=$? at_failed=false
   63003 $at_check_filter
   63004 echo stderr:; tee stderr <"$at_stderr"
   63005 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63006 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63007 $at_failed && at_fn_log_failure
   63008 $at_traceon; }
   63009 
   63010 { set +x
   63011 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63012 at_fn_check_prepare_trace "calc.at:602"
   63013 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63015 at_status=$? at_failed=false
   63016 $at_check_filter
   63017 echo stderr:; tee stderr <"$at_stderr"
   63018 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63019 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63020 $at_failed && at_fn_log_failure
   63021 $at_traceon; }
   63022 
   63023 
   63024 
   63025 
   63026 # Some syntax errors.
   63027 cat >input <<'_ATEOF'
   63028 1 2
   63029 _ATEOF
   63030 
   63031 { set +x
   63032 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63033 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63034 ( $at_check_trace;  $PREPARSER ./calc input
   63035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63036 at_status=$? at_failed=false
   63037 $at_check_filter
   63038 echo stderr:; tee stderr <"$at_stderr"
   63039 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63040 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
   63041 $at_failed && at_fn_log_failure
   63042 $at_traceon; }
   63043 
   63044 { set +x
   63045 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63046 at_fn_check_prepare_trace "calc.at:602"
   63047 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63048 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63049 at_status=$? at_failed=false
   63050 $at_check_filter
   63051 echo stderr:; tee stderr <"$at_stderr"
   63052 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63053 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63054 $at_failed && at_fn_log_failure
   63055 $at_traceon; }
   63056 
   63057 
   63058 
   63059 # Normalize the observed and expected error messages, depending upon the
   63060 # options.
   63061 # 1. Remove the traces from observed.
   63062 sed '/^Starting/d
   63063 /^Entering/d
   63064 /^Stack/d
   63065 /^Reading/d
   63066 /^Reducing/d
   63067 /^Return/d
   63068 /^Shifting/d
   63069 /^state/d
   63070 /^Cleanup:/d
   63071 /^Error:/d
   63072 /^Next/d
   63073 /^Now/d
   63074 /^Discarding/d
   63075 / \$[0-9$]* = /d
   63076 /^yydestructor:/d' stderr >at-stderr
   63077 mv at-stderr stderr
   63078 # 2. Create the reference error message.
   63079 cat >expout <<'_ATEOF'
   63080 1.3: syntax error, unexpected number
   63081 _ATEOF
   63082 
   63083 # 3. If locations are not used, remove them.
   63084 sed 's/^[-0-9.]*: //' expout >at-expout
   63085 mv at-expout expout
   63086 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63087 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63088 mv at-expout expout
   63089 # 5. Check
   63090 { set +x
   63091 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63092 at_fn_check_prepare_trace "calc.at:602"
   63093 ( $at_check_trace; cat stderr
   63094 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63095 at_status=$? at_failed=false
   63096 $at_check_filter
   63097 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63098 $at_diff expout "$at_stdout" || at_failed=:
   63099 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63100 $at_failed && at_fn_log_failure
   63101 $at_traceon; }
   63102 
   63103 
   63104 cat >input <<'_ATEOF'
   63105 1//2
   63106 _ATEOF
   63107 
   63108 { set +x
   63109 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63110 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63111 ( $at_check_trace;  $PREPARSER ./calc input
   63112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63113 at_status=$? at_failed=false
   63114 $at_check_filter
   63115 echo stderr:; tee stderr <"$at_stderr"
   63116 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63117 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
   63118 $at_failed && at_fn_log_failure
   63119 $at_traceon; }
   63120 
   63121 { set +x
   63122 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63123 at_fn_check_prepare_trace "calc.at:602"
   63124 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63126 at_status=$? at_failed=false
   63127 $at_check_filter
   63128 echo stderr:; tee stderr <"$at_stderr"
   63129 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63130 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63131 $at_failed && at_fn_log_failure
   63132 $at_traceon; }
   63133 
   63134 
   63135 
   63136 # Normalize the observed and expected error messages, depending upon the
   63137 # options.
   63138 # 1. Remove the traces from observed.
   63139 sed '/^Starting/d
   63140 /^Entering/d
   63141 /^Stack/d
   63142 /^Reading/d
   63143 /^Reducing/d
   63144 /^Return/d
   63145 /^Shifting/d
   63146 /^state/d
   63147 /^Cleanup:/d
   63148 /^Error:/d
   63149 /^Next/d
   63150 /^Now/d
   63151 /^Discarding/d
   63152 / \$[0-9$]* = /d
   63153 /^yydestructor:/d' stderr >at-stderr
   63154 mv at-stderr stderr
   63155 # 2. Create the reference error message.
   63156 cat >expout <<'_ATEOF'
   63157 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   63158 _ATEOF
   63159 
   63160 # 3. If locations are not used, remove them.
   63161 sed 's/^[-0-9.]*: //' expout >at-expout
   63162 mv at-expout expout
   63163 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63164 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63165 mv at-expout expout
   63166 # 5. Check
   63167 { set +x
   63168 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63169 at_fn_check_prepare_trace "calc.at:602"
   63170 ( $at_check_trace; cat stderr
   63171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63172 at_status=$? at_failed=false
   63173 $at_check_filter
   63174 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63175 $at_diff expout "$at_stdout" || at_failed=:
   63176 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63177 $at_failed && at_fn_log_failure
   63178 $at_traceon; }
   63179 
   63180 
   63181 cat >input <<'_ATEOF'
   63182 error
   63183 _ATEOF
   63184 
   63185 { set +x
   63186 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63187 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63188 ( $at_check_trace;  $PREPARSER ./calc input
   63189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63190 at_status=$? at_failed=false
   63191 $at_check_filter
   63192 echo stderr:; tee stderr <"$at_stderr"
   63193 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63194 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
   63195 $at_failed && at_fn_log_failure
   63196 $at_traceon; }
   63197 
   63198 { set +x
   63199 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63200 at_fn_check_prepare_trace "calc.at:602"
   63201 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63203 at_status=$? at_failed=false
   63204 $at_check_filter
   63205 echo stderr:; tee stderr <"$at_stderr"
   63206 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63207 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63208 $at_failed && at_fn_log_failure
   63209 $at_traceon; }
   63210 
   63211 
   63212 
   63213 # Normalize the observed and expected error messages, depending upon the
   63214 # options.
   63215 # 1. Remove the traces from observed.
   63216 sed '/^Starting/d
   63217 /^Entering/d
   63218 /^Stack/d
   63219 /^Reading/d
   63220 /^Reducing/d
   63221 /^Return/d
   63222 /^Shifting/d
   63223 /^state/d
   63224 /^Cleanup:/d
   63225 /^Error:/d
   63226 /^Next/d
   63227 /^Now/d
   63228 /^Discarding/d
   63229 / \$[0-9$]* = /d
   63230 /^yydestructor:/d' stderr >at-stderr
   63231 mv at-stderr stderr
   63232 # 2. Create the reference error message.
   63233 cat >expout <<'_ATEOF'
   63234 1.1: syntax error, unexpected $undefined
   63235 _ATEOF
   63236 
   63237 # 3. If locations are not used, remove them.
   63238 sed 's/^[-0-9.]*: //' expout >at-expout
   63239 mv at-expout expout
   63240 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63241 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63242 mv at-expout expout
   63243 # 5. Check
   63244 { set +x
   63245 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63246 at_fn_check_prepare_trace "calc.at:602"
   63247 ( $at_check_trace; cat stderr
   63248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63249 at_status=$? at_failed=false
   63250 $at_check_filter
   63251 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63252 $at_diff expout "$at_stdout" || at_failed=:
   63253 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63254 $at_failed && at_fn_log_failure
   63255 $at_traceon; }
   63256 
   63257 
   63258 cat >input <<'_ATEOF'
   63259 1 = 2 = 3
   63260 _ATEOF
   63261 
   63262 { set +x
   63263 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63264 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63265 ( $at_check_trace;  $PREPARSER ./calc input
   63266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63267 at_status=$? at_failed=false
   63268 $at_check_filter
   63269 echo stderr:; tee stderr <"$at_stderr"
   63270 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63271 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
   63272 $at_failed && at_fn_log_failure
   63273 $at_traceon; }
   63274 
   63275 { set +x
   63276 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63277 at_fn_check_prepare_trace "calc.at:602"
   63278 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63280 at_status=$? at_failed=false
   63281 $at_check_filter
   63282 echo stderr:; tee stderr <"$at_stderr"
   63283 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63284 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63285 $at_failed && at_fn_log_failure
   63286 $at_traceon; }
   63287 
   63288 
   63289 
   63290 # Normalize the observed and expected error messages, depending upon the
   63291 # options.
   63292 # 1. Remove the traces from observed.
   63293 sed '/^Starting/d
   63294 /^Entering/d
   63295 /^Stack/d
   63296 /^Reading/d
   63297 /^Reducing/d
   63298 /^Return/d
   63299 /^Shifting/d
   63300 /^state/d
   63301 /^Cleanup:/d
   63302 /^Error:/d
   63303 /^Next/d
   63304 /^Now/d
   63305 /^Discarding/d
   63306 / \$[0-9$]* = /d
   63307 /^yydestructor:/d' stderr >at-stderr
   63308 mv at-stderr stderr
   63309 # 2. Create the reference error message.
   63310 cat >expout <<'_ATEOF'
   63311 1.7: syntax error, unexpected '='
   63312 _ATEOF
   63313 
   63314 # 3. If locations are not used, remove them.
   63315 sed 's/^[-0-9.]*: //' expout >at-expout
   63316 mv at-expout expout
   63317 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63318 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63319 mv at-expout expout
   63320 # 5. Check
   63321 { set +x
   63322 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63323 at_fn_check_prepare_trace "calc.at:602"
   63324 ( $at_check_trace; cat stderr
   63325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63326 at_status=$? at_failed=false
   63327 $at_check_filter
   63328 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63329 $at_diff expout "$at_stdout" || at_failed=:
   63330 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63331 $at_failed && at_fn_log_failure
   63332 $at_traceon; }
   63333 
   63334 
   63335 cat >input <<'_ATEOF'
   63336 
   63337 +1
   63338 _ATEOF
   63339 
   63340 { set +x
   63341 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63342 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63343 ( $at_check_trace;  $PREPARSER ./calc input
   63344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63345 at_status=$? at_failed=false
   63346 $at_check_filter
   63347 echo stderr:; tee stderr <"$at_stderr"
   63348 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63349 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
   63350 $at_failed && at_fn_log_failure
   63351 $at_traceon; }
   63352 
   63353 { set +x
   63354 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63355 at_fn_check_prepare_trace "calc.at:602"
   63356 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63357 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63358 at_status=$? at_failed=false
   63359 $at_check_filter
   63360 echo stderr:; tee stderr <"$at_stderr"
   63361 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63362 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63363 $at_failed && at_fn_log_failure
   63364 $at_traceon; }
   63365 
   63366 
   63367 
   63368 # Normalize the observed and expected error messages, depending upon the
   63369 # options.
   63370 # 1. Remove the traces from observed.
   63371 sed '/^Starting/d
   63372 /^Entering/d
   63373 /^Stack/d
   63374 /^Reading/d
   63375 /^Reducing/d
   63376 /^Return/d
   63377 /^Shifting/d
   63378 /^state/d
   63379 /^Cleanup:/d
   63380 /^Error:/d
   63381 /^Next/d
   63382 /^Now/d
   63383 /^Discarding/d
   63384 / \$[0-9$]* = /d
   63385 /^yydestructor:/d' stderr >at-stderr
   63386 mv at-stderr stderr
   63387 # 2. Create the reference error message.
   63388 cat >expout <<'_ATEOF'
   63389 2.1: syntax error, unexpected '+'
   63390 _ATEOF
   63391 
   63392 # 3. If locations are not used, remove them.
   63393 sed 's/^[-0-9.]*: //' expout >at-expout
   63394 mv at-expout expout
   63395 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63396 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63397 mv at-expout expout
   63398 # 5. Check
   63399 { set +x
   63400 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63401 at_fn_check_prepare_trace "calc.at:602"
   63402 ( $at_check_trace; cat stderr
   63403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63404 at_status=$? at_failed=false
   63405 $at_check_filter
   63406 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63407 $at_diff expout "$at_stdout" || at_failed=:
   63408 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63409 $at_failed && at_fn_log_failure
   63410 $at_traceon; }
   63411 
   63412 
   63413 # Exercise error messages with EOF: work on an empty file.
   63414 { set +x
   63415 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc /dev/null"
   63416 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:602"
   63417 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   63418 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63419 at_status=$? at_failed=false
   63420 $at_check_filter
   63421 echo stderr:; tee stderr <"$at_stderr"
   63422 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63423 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
   63424 $at_failed && at_fn_log_failure
   63425 $at_traceon; }
   63426 
   63427 { set +x
   63428 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63429 at_fn_check_prepare_trace "calc.at:602"
   63430 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63432 at_status=$? at_failed=false
   63433 $at_check_filter
   63434 echo stderr:; tee stderr <"$at_stderr"
   63435 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63436 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63437 $at_failed && at_fn_log_failure
   63438 $at_traceon; }
   63439 
   63440 
   63441 
   63442 # Normalize the observed and expected error messages, depending upon the
   63443 # options.
   63444 # 1. Remove the traces from observed.
   63445 sed '/^Starting/d
   63446 /^Entering/d
   63447 /^Stack/d
   63448 /^Reading/d
   63449 /^Reducing/d
   63450 /^Return/d
   63451 /^Shifting/d
   63452 /^state/d
   63453 /^Cleanup:/d
   63454 /^Error:/d
   63455 /^Next/d
   63456 /^Now/d
   63457 /^Discarding/d
   63458 / \$[0-9$]* = /d
   63459 /^yydestructor:/d' stderr >at-stderr
   63460 mv at-stderr stderr
   63461 # 2. Create the reference error message.
   63462 cat >expout <<'_ATEOF'
   63463 1.1: syntax error, unexpected end of input
   63464 _ATEOF
   63465 
   63466 # 3. If locations are not used, remove them.
   63467 sed 's/^[-0-9.]*: //' expout >at-expout
   63468 mv at-expout expout
   63469 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63470 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63471 mv at-expout expout
   63472 # 5. Check
   63473 { set +x
   63474 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63475 at_fn_check_prepare_trace "calc.at:602"
   63476 ( $at_check_trace; cat stderr
   63477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63478 at_status=$? at_failed=false
   63479 $at_check_filter
   63480 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63481 $at_diff expout "$at_stdout" || at_failed=:
   63482 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63483 $at_failed && at_fn_log_failure
   63484 $at_traceon; }
   63485 
   63486 
   63487 
   63488 # Exercise the error token: without it, we die at the first error,
   63489 # hence be sure to
   63490 #
   63491 # - have several errors which exercise different shift/discardings
   63492 #   - (): nothing to pop, nothing to discard
   63493 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   63494 #   - (* * *): nothing to pop, a lot to discard
   63495 #   - (1 + 2 * *): some to pop and discard
   63496 #
   63497 # - test the action associated to `error'
   63498 #
   63499 # - check the lookahead that triggers an error is not discarded
   63500 #   when we enter error recovery.  Below, the lookahead causing the
   63501 #   first error is ")", which is needed to recover from the error and
   63502 #   produce the "0" that triggers the "0 != 1" error.
   63503 #
   63504 cat >input <<'_ATEOF'
   63505 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   63506 _ATEOF
   63507 
   63508 { set +x
   63509 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63510 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63511 ( $at_check_trace;  $PREPARSER ./calc input
   63512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63513 at_status=$? at_failed=false
   63514 $at_check_filter
   63515 echo stderr:; tee stderr <"$at_stderr"
   63516 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63517 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63518 $at_failed && at_fn_log_failure
   63519 $at_traceon; }
   63520 
   63521 { set +x
   63522 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63523 at_fn_check_prepare_trace "calc.at:602"
   63524 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63525 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63526 at_status=$? at_failed=false
   63527 $at_check_filter
   63528 echo stderr:; tee stderr <"$at_stderr"
   63529 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63530 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63531 $at_failed && at_fn_log_failure
   63532 $at_traceon; }
   63533 
   63534 
   63535 
   63536 # Normalize the observed and expected error messages, depending upon the
   63537 # options.
   63538 # 1. Remove the traces from observed.
   63539 sed '/^Starting/d
   63540 /^Entering/d
   63541 /^Stack/d
   63542 /^Reading/d
   63543 /^Reducing/d
   63544 /^Return/d
   63545 /^Shifting/d
   63546 /^state/d
   63547 /^Cleanup:/d
   63548 /^Error:/d
   63549 /^Next/d
   63550 /^Now/d
   63551 /^Discarding/d
   63552 / \$[0-9$]* = /d
   63553 /^yydestructor:/d' stderr >at-stderr
   63554 mv at-stderr stderr
   63555 # 2. Create the reference error message.
   63556 cat >expout <<'_ATEOF'
   63557 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   63558 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   63559 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   63560 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   63561 calc: error: 4444 != 1
   63562 _ATEOF
   63563 
   63564 # 3. If locations are not used, remove them.
   63565 sed 's/^[-0-9.]*: //' expout >at-expout
   63566 mv at-expout expout
   63567 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63568 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63569 mv at-expout expout
   63570 # 5. Check
   63571 { set +x
   63572 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63573 at_fn_check_prepare_trace "calc.at:602"
   63574 ( $at_check_trace; cat stderr
   63575 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63576 at_status=$? at_failed=false
   63577 $at_check_filter
   63578 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63579 $at_diff expout "$at_stdout" || at_failed=:
   63580 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63581 $at_failed && at_fn_log_failure
   63582 $at_traceon; }
   63583 
   63584 
   63585 
   63586 # The same, but this time exercising explicitly triggered syntax errors.
   63587 # POSIX says the lookahead causing the error should not be discarded.
   63588 cat >input <<'_ATEOF'
   63589 (!) + (1 2) = 1
   63590 _ATEOF
   63591 
   63592 { set +x
   63593 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63594 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63595 ( $at_check_trace;  $PREPARSER ./calc input
   63596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63597 at_status=$? at_failed=false
   63598 $at_check_filter
   63599 echo stderr:; tee stderr <"$at_stderr"
   63600 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63601 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63602 $at_failed && at_fn_log_failure
   63603 $at_traceon; }
   63604 
   63605 { set +x
   63606 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63607 at_fn_check_prepare_trace "calc.at:602"
   63608 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63610 at_status=$? at_failed=false
   63611 $at_check_filter
   63612 echo stderr:; tee stderr <"$at_stderr"
   63613 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63614 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63615 $at_failed && at_fn_log_failure
   63616 $at_traceon; }
   63617 
   63618 
   63619 
   63620 # Normalize the observed and expected error messages, depending upon the
   63621 # options.
   63622 # 1. Remove the traces from observed.
   63623 sed '/^Starting/d
   63624 /^Entering/d
   63625 /^Stack/d
   63626 /^Reading/d
   63627 /^Reducing/d
   63628 /^Return/d
   63629 /^Shifting/d
   63630 /^state/d
   63631 /^Cleanup:/d
   63632 /^Error:/d
   63633 /^Next/d
   63634 /^Now/d
   63635 /^Discarding/d
   63636 / \$[0-9$]* = /d
   63637 /^yydestructor:/d' stderr >at-stderr
   63638 mv at-stderr stderr
   63639 # 2. Create the reference error message.
   63640 cat >expout <<'_ATEOF'
   63641 1.10: syntax error, unexpected number
   63642 calc: error: 2222 != 1
   63643 _ATEOF
   63644 
   63645 # 3. If locations are not used, remove them.
   63646 sed 's/^[-0-9.]*: //' expout >at-expout
   63647 mv at-expout expout
   63648 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63649 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63650 mv at-expout expout
   63651 # 5. Check
   63652 { set +x
   63653 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63654 at_fn_check_prepare_trace "calc.at:602"
   63655 ( $at_check_trace; cat stderr
   63656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63657 at_status=$? at_failed=false
   63658 $at_check_filter
   63659 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63660 $at_diff expout "$at_stdout" || at_failed=:
   63661 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63662 $at_failed && at_fn_log_failure
   63663 $at_traceon; }
   63664 
   63665 
   63666 cat >input <<'_ATEOF'
   63667 (- *) + (1 2) = 1
   63668 _ATEOF
   63669 
   63670 { set +x
   63671 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63672 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63673 ( $at_check_trace;  $PREPARSER ./calc input
   63674 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63675 at_status=$? at_failed=false
   63676 $at_check_filter
   63677 echo stderr:; tee stderr <"$at_stderr"
   63678 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63679 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63680 $at_failed && at_fn_log_failure
   63681 $at_traceon; }
   63682 
   63683 { set +x
   63684 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63685 at_fn_check_prepare_trace "calc.at:602"
   63686 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63687 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63688 at_status=$? at_failed=false
   63689 $at_check_filter
   63690 echo stderr:; tee stderr <"$at_stderr"
   63691 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63692 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63693 $at_failed && at_fn_log_failure
   63694 $at_traceon; }
   63695 
   63696 
   63697 
   63698 # Normalize the observed and expected error messages, depending upon the
   63699 # options.
   63700 # 1. Remove the traces from observed.
   63701 sed '/^Starting/d
   63702 /^Entering/d
   63703 /^Stack/d
   63704 /^Reading/d
   63705 /^Reducing/d
   63706 /^Return/d
   63707 /^Shifting/d
   63708 /^state/d
   63709 /^Cleanup:/d
   63710 /^Error:/d
   63711 /^Next/d
   63712 /^Now/d
   63713 /^Discarding/d
   63714 / \$[0-9$]* = /d
   63715 /^yydestructor:/d' stderr >at-stderr
   63716 mv at-stderr stderr
   63717 # 2. Create the reference error message.
   63718 cat >expout <<'_ATEOF'
   63719 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   63720 1.12: syntax error, unexpected number
   63721 calc: error: 2222 != 1
   63722 _ATEOF
   63723 
   63724 # 3. If locations are not used, remove them.
   63725 sed 's/^[-0-9.]*: //' expout >at-expout
   63726 mv at-expout expout
   63727 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63728 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63729 mv at-expout expout
   63730 # 5. Check
   63731 { set +x
   63732 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63733 at_fn_check_prepare_trace "calc.at:602"
   63734 ( $at_check_trace; cat stderr
   63735 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63736 at_status=$? at_failed=false
   63737 $at_check_filter
   63738 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63739 $at_diff expout "$at_stdout" || at_failed=:
   63740 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63741 $at_failed && at_fn_log_failure
   63742 $at_traceon; }
   63743 
   63744 
   63745 
   63746 # Check that yyerrok works properly: second error is not reported,
   63747 # third and fourth are.  Parse status is succesfull.
   63748 cat >input <<'_ATEOF'
   63749 (* *) + (*) + (*)
   63750 _ATEOF
   63751 
   63752 { set +x
   63753 $as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
   63754 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
   63755 ( $at_check_trace;  $PREPARSER ./calc input
   63756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63757 at_status=$? at_failed=false
   63758 $at_check_filter
   63759 echo stderr:; tee stderr <"$at_stderr"
   63760 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63761 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63762 $at_failed && at_fn_log_failure
   63763 $at_traceon; }
   63764 
   63765 { set +x
   63766 $as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   63767 at_fn_check_prepare_trace "calc.at:602"
   63768 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   63769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63770 at_status=$? at_failed=false
   63771 $at_check_filter
   63772 echo stderr:; tee stderr <"$at_stderr"
   63773 at_fn_diff_devnull "$at_stdout" || at_failed=:
   63774 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63775 $at_failed && at_fn_log_failure
   63776 $at_traceon; }
   63777 
   63778 
   63779 
   63780 # Normalize the observed and expected error messages, depending upon the
   63781 # options.
   63782 # 1. Remove the traces from observed.
   63783 sed '/^Starting/d
   63784 /^Entering/d
   63785 /^Stack/d
   63786 /^Reading/d
   63787 /^Reducing/d
   63788 /^Return/d
   63789 /^Shifting/d
   63790 /^state/d
   63791 /^Cleanup:/d
   63792 /^Error:/d
   63793 /^Next/d
   63794 /^Now/d
   63795 /^Discarding/d
   63796 / \$[0-9$]* = /d
   63797 /^yydestructor:/d' stderr >at-stderr
   63798 mv at-stderr stderr
   63799 # 2. Create the reference error message.
   63800 cat >expout <<'_ATEOF'
   63801 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   63802 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   63803 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   63804 _ATEOF
   63805 
   63806 # 3. If locations are not used, remove them.
   63807 sed 's/^[-0-9.]*: //' expout >at-expout
   63808 mv at-expout expout
   63809 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   63810 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   63811 mv at-expout expout
   63812 # 5. Check
   63813 { set +x
   63814 $as_echo "$at_srcdir/calc.at:602: cat stderr"
   63815 at_fn_check_prepare_trace "calc.at:602"
   63816 ( $at_check_trace; cat stderr
   63817 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   63818 at_status=$? at_failed=false
   63819 $at_check_filter
   63820 at_fn_diff_devnull "$at_stderr" || at_failed=:
   63821 $at_diff expout "$at_stdout" || at_failed=:
   63822 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
   63823 $at_failed && at_fn_log_failure
   63824 $at_traceon; }
   63825 
   63826 
   63827 
   63828 
   63829 
   63830   set +x
   63831   $at_times_p && times >"$at_times_file"
   63832 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   63833 read at_status <"$at_status_file"
   63834 #AT_STOP_203
   63835 #AT_START_204
   63836 at_fn_group_banner 204 'calc.at:603' \
   63837   "Calculator %verbose" "                            " 11
   63838 at_xfail=no
   63839 (
   63840   $as_echo "204. $at_setup_line: testing $at_desc ..."
   63841   $at_traceon
   63842 
   63843 
   63844 
   63845 
   63846 
   63847 
   63848 
   63849 
   63850 
   63851 
   63852 cat >calc.y <<'_ATEOF'
   63853 %code top {
   63854 #include <config.h>
   63855 /* We don't need perfect functions for these tests. */
   63856 #undef malloc
   63857 #undef memcmp
   63858 #undef realloc
   63859 }
   63860 
   63861 /* Infix notation calculator--calc */
   63862 %verbose
   63863 
   63864 %code requires
   63865 {
   63866 
   63867   /* Exercise pre-prologue dependency to %union.  */
   63868   typedef int semantic_value;
   63869 }
   63870 
   63871 /* Exercise %union. */
   63872 %union
   63873 {
   63874   semantic_value ival;
   63875 };
   63876 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   63877 
   63878 %code provides
   63879 {
   63880   #include <stdio.h>
   63881   /* The input.  */
   63882   extern FILE *input;
   63883   extern semantic_value global_result;
   63884   extern int global_count;
   63885 }
   63886 
   63887 %code
   63888 {
   63889 #include <assert.h>
   63890 #include <string.h>
   63891 #define USE(Var)
   63892 
   63893 FILE *input;
   63894 static int power (int base, int exponent);
   63895 
   63896 static void yyerror ( const char *msg);
   63897 int yylex (void);
   63898 }
   63899 
   63900 
   63901 
   63902 /* Bison Declarations */
   63903 %token CALC_EOF 0 "end of input"
   63904 %token <ival> NUM "number"
   63905 %type  <ival> exp
   63906 
   63907 %nonassoc '=' /* comparison            */
   63908 %left '-' '+'
   63909 %left '*' '/'
   63910 %left NEG     /* negation--unary minus */
   63911 %right '^'    /* exponentiation        */
   63912 
   63913 /* Grammar follows */
   63914 %%
   63915 input:
   63916   line
   63917 | input line         {  }
   63918 ;
   63919 
   63920 line:
   63921   '\n'
   63922 | exp '\n'           { USE ($1); }
   63923 ;
   63924 
   63925 exp:
   63926   NUM                { $$ = $1;             }
   63927 | exp '=' exp
   63928   {
   63929     if ($1 != $3)
   63930       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   63931     $$ = $1;
   63932   }
   63933 | exp '+' exp        { $$ = $1 + $3;        }
   63934 | exp '-' exp        { $$ = $1 - $3;        }
   63935 | exp '*' exp        { $$ = $1 * $3;        }
   63936 | exp '/' exp        { $$ = $1 / $3;        }
   63937 | '-' exp  %prec NEG { $$ = -$2;            }
   63938 | exp '^' exp        { $$ = power ($1, $3); }
   63939 | '(' exp ')'        { $$ = $2;             }
   63940 | '(' error ')'      { $$ = 1111; yyerrok;  }
   63941 | '!'                { $$ = 0; YYERROR;     }
   63942 | '-' error          { $$ = 0; YYERROR;     }
   63943 ;
   63944 %%
   63945 
   63946 static int
   63947 power (int base, int exponent)
   63948 {
   63949   int res = 1;
   63950   assert (0 <= exponent);
   63951   for (/* Niente */; exponent; --exponent)
   63952     res *= base;
   63953   return res;
   63954 }
   63955 
   63956 
   63957 #include <stdio.h>
   63958 /* A C error reporting function.  */
   63959 static
   63960 void yyerror ( const char *msg)
   63961 {
   63962   fprintf (stderr, "%s\n", msg);
   63963 }
   63964 #include <ctype.h>
   63965 
   63966 int yylex (void);
   63967 static int get_char (void);
   63968 static void unget_char ( int c);
   63969 
   63970 
   63971 static int
   63972 get_char (void)
   63973 {
   63974   int res = getc (input);
   63975   ;
   63976 
   63977   return res;
   63978 }
   63979 
   63980 static void
   63981 unget_char ( int c)
   63982 {
   63983   ;
   63984 
   63985   ungetc (c, input);
   63986 }
   63987 
   63988 static int
   63989 read_signed_integer (void)
   63990 {
   63991   int c = get_char ();
   63992   int sign = 1;
   63993   int n = 0;
   63994 
   63995   ;
   63996   if (c == '-')
   63997     {
   63998       c = get_char ();
   63999       sign = -1;
   64000     }
   64001 
   64002   while (isdigit (c))
   64003     {
   64004       n = 10 * n + (c - '0');
   64005       c = get_char ();
   64006     }
   64007 
   64008   unget_char ( c);
   64009 
   64010   return sign * n;
   64011 }
   64012 
   64013 
   64014 /*---------------------------------------------------------------.
   64015 | Lexical analyzer returns an integer on the stack and the token |
   64016 | NUM, or the ASCII character read if not a number.  Skips all   |
   64017 | blanks and tabs, returns 0 for EOF.                            |
   64018 `---------------------------------------------------------------*/
   64019 
   64020 int yylex (void)
   64021 {
   64022   int c;
   64023   /* Skip current token, then white spaces.  */
   64024   do
   64025     {
   64026 
   64027     }
   64028   while ((c = get_char ()) == ' ' || c == '\t');
   64029 
   64030   /* process numbers   */
   64031   if (c == '.' || isdigit (c))
   64032     {
   64033       unget_char ( c);
   64034       (yylval).ival = read_signed_integer ();
   64035       return NUM;
   64036     }
   64037 
   64038   /* Return end-of-file.  */
   64039   if (c == EOF)
   64040     return CALC_EOF;
   64041 
   64042   /* Return single chars. */
   64043   return c;
   64044 }
   64045 
   64046 #include <assert.h>
   64047 #if HAVE_UNISTD_H
   64048 # include <unistd.h>
   64049 #else
   64050 # undef alarm
   64051 # define alarm(seconds) /* empty */
   64052 #endif
   64053 
   64054 
   64055 
   64056 semantic_value global_result = 0;
   64057 int global_count = 0;
   64058 
   64059 /* A C main function.  */
   64060 int
   64061 main (int argc, const char **argv)
   64062 {
   64063   semantic_value result = 0;
   64064   int count = 0;
   64065   int status;
   64066 
   64067   /* This used to be alarm (10), but that isn't enough time for
   64068      a July 1995 vintage DEC Alphastation 200 4/100 system,
   64069      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   64070   alarm (100);
   64071 
   64072   if (argc == 2)
   64073     input = fopen (argv[1], "r");
   64074   else
   64075     input = stdin;
   64076 
   64077   if (!input)
   64078     {
   64079       perror (argv[1]);
   64080       return 3;
   64081     }
   64082 
   64083 
   64084   status = yyparse ();
   64085   if (fclose (input))
   64086     perror ("fclose");
   64087   assert (global_result == result);
   64088   assert (global_count == count);
   64089   return status;
   64090 }
   64091 _ATEOF
   64092 
   64093 
   64094 
   64095 
   64096 
   64097 
   64098 
   64099 
   64100 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   64101   at_save_special_files
   64102   mkdir xml-tests
   64103     # Don't combine these Bison invocations since we want to be sure that
   64104   # --report=all isn't required to get the full XML file.
   64105   { set +x
   64106 $as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   64107                   --graph=xml-tests/test.dot -o calc.c calc.y"
   64108 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603"
   64109 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   64110                   --graph=xml-tests/test.dot -o calc.c calc.y
   64111 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64112 at_status=$? at_failed=false
   64113 $at_check_filter
   64114 echo stderr:; cat "$at_stderr"
   64115 echo stdout:; cat "$at_stdout"
   64116 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64117 $at_failed && at_fn_log_failure
   64118 $at_traceon; }
   64119 
   64120   { set +x
   64121 $as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   64122 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:603"
   64123 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   64124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64125 at_status=$? at_failed=false
   64126 $at_check_filter
   64127 echo stderr:; cat "$at_stderr"
   64128 echo stdout:; cat "$at_stdout"
   64129 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64130 $at_failed && at_fn_log_failure
   64131 $at_traceon; }
   64132 
   64133     cp xml-tests/test.output expout
   64134   { set +x
   64135 $as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\
   64136              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   64137              xml-tests/test.xml"
   64138 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603"
   64139 ( $at_check_trace; $XSLTPROC \
   64140              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   64141              xml-tests/test.xml
   64142 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64143 at_status=$? at_failed=false
   64144 $at_check_filter
   64145 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64146 $at_diff expout "$at_stdout" || at_failed=:
   64147 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64148 $at_failed && at_fn_log_failure
   64149 $at_traceon; }
   64150 
   64151   sort xml-tests/test.dot > expout
   64152   { set +x
   64153 $as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\
   64154              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   64155              xml-tests/test.xml | sort"
   64156 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603"
   64157 ( $at_check_trace; $XSLTPROC \
   64158              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   64159              xml-tests/test.xml | sort
   64160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64161 at_status=$? at_failed=false
   64162 $at_check_filter
   64163 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64164 $at_diff expout "$at_stdout" || at_failed=:
   64165 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64166 $at_failed && at_fn_log_failure
   64167 $at_traceon; }
   64168 
   64169   rm -rf xml-tests expout
   64170   at_restore_special_files
   64171 fi
   64172 { set +x
   64173 $as_echo "$at_srcdir/calc.at:603: bison -o calc.c calc.y"
   64174 at_fn_check_prepare_trace "calc.at:603"
   64175 ( $at_check_trace; bison -o calc.c calc.y
   64176 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64177 at_status=$? at_failed=false
   64178 $at_check_filter
   64179 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64180 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64181 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64182 $at_failed && at_fn_log_failure
   64183 $at_traceon; }
   64184 
   64185 
   64186    { set +x
   64187 $as_echo "$at_srcdir/calc.at:603: \$BISON_C_WORKS"
   64188 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:603"
   64189 ( $at_check_trace; $BISON_C_WORKS
   64190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64191 at_status=$? at_failed=false
   64192 $at_check_filter
   64193 echo stderr:; cat "$at_stderr"
   64194 echo stdout:; cat "$at_stdout"
   64195 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64196 $at_failed && at_fn_log_failure
   64197 $at_traceon; }
   64198 
   64199 { set +x
   64200 $as_echo "$at_srcdir/calc.at:603: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   64201 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:603"
   64202 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   64203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64204 at_status=$? at_failed=false
   64205 $at_check_filter
   64206 echo stderr:; cat "$at_stderr"
   64207 echo stdout:; cat "$at_stdout"
   64208 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64209 $at_failed && at_fn_log_failure
   64210 $at_traceon; }
   64211 
   64212 
   64213 { set +x
   64214 $as_echo "$at_srcdir/calc.at:603: \$PERL -ne '
   64215   chomp;
   64216   print \"\$.: {\$_}\\n\"
   64217     if (# No starting/ending empty lines.
   64218         (eof || \$. == 1) && /^\\s*\$/
   64219         # No trailing space.  FIXME: not ready for \"maint\".
   64220         # || /\\s\$/
   64221         )' calc.c
   64222 "
   64223 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603"
   64224 ( $at_check_trace; $PERL -ne '
   64225   chomp;
   64226   print "$.: {$_}\n"
   64227     if (# No starting/ending empty lines.
   64228         (eof || $. == 1) && /^\s*$/
   64229         # No trailing space.  FIXME: not ready for "maint".
   64230         # || /\s$/
   64231         )' calc.c
   64232 
   64233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64234 at_status=$? at_failed=false
   64235 $at_check_filter
   64236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64237 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64238 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64239 $at_failed && at_fn_log_failure
   64240 $at_traceon; }
   64241 
   64242 
   64243 
   64244 # Test the priorities.
   64245 cat >input <<'_ATEOF'
   64246 1 + 2 * 3 = 7
   64247 1 + 2 * -3 = -5
   64248 
   64249 -1^2 = -1
   64250 (-1)^2 = 1
   64251 
   64252 ---1 = -1
   64253 
   64254 1 - 2 - 3 = -4
   64255 1 - (2 - 3) = 2
   64256 
   64257 2^2^3 = 256
   64258 (2^2)^3 = 64
   64259 _ATEOF
   64260 
   64261 { set +x
   64262 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64263 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64264 ( $at_check_trace;  $PREPARSER ./calc input
   64265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64266 at_status=$? at_failed=false
   64267 $at_check_filter
   64268 echo stderr:; tee stderr <"$at_stderr"
   64269 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64270 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64271 $at_failed && at_fn_log_failure
   64272 $at_traceon; }
   64273 
   64274 { set +x
   64275 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64276 at_fn_check_prepare_trace "calc.at:603"
   64277 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64279 at_status=$? at_failed=false
   64280 $at_check_filter
   64281 echo stderr:; tee stderr <"$at_stderr"
   64282 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64283 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64284 $at_failed && at_fn_log_failure
   64285 $at_traceon; }
   64286 
   64287 
   64288 
   64289 
   64290 # Some syntax errors.
   64291 cat >input <<'_ATEOF'
   64292 1 2
   64293 _ATEOF
   64294 
   64295 { set +x
   64296 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64297 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64298 ( $at_check_trace;  $PREPARSER ./calc input
   64299 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64300 at_status=$? at_failed=false
   64301 $at_check_filter
   64302 echo stderr:; tee stderr <"$at_stderr"
   64303 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64304 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
   64305 $at_failed && at_fn_log_failure
   64306 $at_traceon; }
   64307 
   64308 { set +x
   64309 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64310 at_fn_check_prepare_trace "calc.at:603"
   64311 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64312 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64313 at_status=$? at_failed=false
   64314 $at_check_filter
   64315 echo stderr:; tee stderr <"$at_stderr"
   64316 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64317 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64318 $at_failed && at_fn_log_failure
   64319 $at_traceon; }
   64320 
   64321 
   64322 
   64323 # Normalize the observed and expected error messages, depending upon the
   64324 # options.
   64325 # 1. Remove the traces from observed.
   64326 sed '/^Starting/d
   64327 /^Entering/d
   64328 /^Stack/d
   64329 /^Reading/d
   64330 /^Reducing/d
   64331 /^Return/d
   64332 /^Shifting/d
   64333 /^state/d
   64334 /^Cleanup:/d
   64335 /^Error:/d
   64336 /^Next/d
   64337 /^Now/d
   64338 /^Discarding/d
   64339 / \$[0-9$]* = /d
   64340 /^yydestructor:/d' stderr >at-stderr
   64341 mv at-stderr stderr
   64342 # 2. Create the reference error message.
   64343 cat >expout <<'_ATEOF'
   64344 1.3: syntax error, unexpected number
   64345 _ATEOF
   64346 
   64347 # 3. If locations are not used, remove them.
   64348 sed 's/^[-0-9.]*: //' expout >at-expout
   64349 mv at-expout expout
   64350 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64351 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64352 mv at-expout expout
   64353 # 5. Check
   64354 { set +x
   64355 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64356 at_fn_check_prepare_trace "calc.at:603"
   64357 ( $at_check_trace; cat stderr
   64358 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64359 at_status=$? at_failed=false
   64360 $at_check_filter
   64361 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64362 $at_diff expout "$at_stdout" || at_failed=:
   64363 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64364 $at_failed && at_fn_log_failure
   64365 $at_traceon; }
   64366 
   64367 
   64368 cat >input <<'_ATEOF'
   64369 1//2
   64370 _ATEOF
   64371 
   64372 { set +x
   64373 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64374 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64375 ( $at_check_trace;  $PREPARSER ./calc input
   64376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64377 at_status=$? at_failed=false
   64378 $at_check_filter
   64379 echo stderr:; tee stderr <"$at_stderr"
   64380 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64381 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
   64382 $at_failed && at_fn_log_failure
   64383 $at_traceon; }
   64384 
   64385 { set +x
   64386 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64387 at_fn_check_prepare_trace "calc.at:603"
   64388 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64390 at_status=$? at_failed=false
   64391 $at_check_filter
   64392 echo stderr:; tee stderr <"$at_stderr"
   64393 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64394 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64395 $at_failed && at_fn_log_failure
   64396 $at_traceon; }
   64397 
   64398 
   64399 
   64400 # Normalize the observed and expected error messages, depending upon the
   64401 # options.
   64402 # 1. Remove the traces from observed.
   64403 sed '/^Starting/d
   64404 /^Entering/d
   64405 /^Stack/d
   64406 /^Reading/d
   64407 /^Reducing/d
   64408 /^Return/d
   64409 /^Shifting/d
   64410 /^state/d
   64411 /^Cleanup:/d
   64412 /^Error:/d
   64413 /^Next/d
   64414 /^Now/d
   64415 /^Discarding/d
   64416 / \$[0-9$]* = /d
   64417 /^yydestructor:/d' stderr >at-stderr
   64418 mv at-stderr stderr
   64419 # 2. Create the reference error message.
   64420 cat >expout <<'_ATEOF'
   64421 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   64422 _ATEOF
   64423 
   64424 # 3. If locations are not used, remove them.
   64425 sed 's/^[-0-9.]*: //' expout >at-expout
   64426 mv at-expout expout
   64427 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64428 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64429 mv at-expout expout
   64430 # 5. Check
   64431 { set +x
   64432 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64433 at_fn_check_prepare_trace "calc.at:603"
   64434 ( $at_check_trace; cat stderr
   64435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64436 at_status=$? at_failed=false
   64437 $at_check_filter
   64438 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64439 $at_diff expout "$at_stdout" || at_failed=:
   64440 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64441 $at_failed && at_fn_log_failure
   64442 $at_traceon; }
   64443 
   64444 
   64445 cat >input <<'_ATEOF'
   64446 error
   64447 _ATEOF
   64448 
   64449 { set +x
   64450 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64451 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64452 ( $at_check_trace;  $PREPARSER ./calc input
   64453 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64454 at_status=$? at_failed=false
   64455 $at_check_filter
   64456 echo stderr:; tee stderr <"$at_stderr"
   64457 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64458 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
   64459 $at_failed && at_fn_log_failure
   64460 $at_traceon; }
   64461 
   64462 { set +x
   64463 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64464 at_fn_check_prepare_trace "calc.at:603"
   64465 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64466 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64467 at_status=$? at_failed=false
   64468 $at_check_filter
   64469 echo stderr:; tee stderr <"$at_stderr"
   64470 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64471 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64472 $at_failed && at_fn_log_failure
   64473 $at_traceon; }
   64474 
   64475 
   64476 
   64477 # Normalize the observed and expected error messages, depending upon the
   64478 # options.
   64479 # 1. Remove the traces from observed.
   64480 sed '/^Starting/d
   64481 /^Entering/d
   64482 /^Stack/d
   64483 /^Reading/d
   64484 /^Reducing/d
   64485 /^Return/d
   64486 /^Shifting/d
   64487 /^state/d
   64488 /^Cleanup:/d
   64489 /^Error:/d
   64490 /^Next/d
   64491 /^Now/d
   64492 /^Discarding/d
   64493 / \$[0-9$]* = /d
   64494 /^yydestructor:/d' stderr >at-stderr
   64495 mv at-stderr stderr
   64496 # 2. Create the reference error message.
   64497 cat >expout <<'_ATEOF'
   64498 1.1: syntax error, unexpected $undefined
   64499 _ATEOF
   64500 
   64501 # 3. If locations are not used, remove them.
   64502 sed 's/^[-0-9.]*: //' expout >at-expout
   64503 mv at-expout expout
   64504 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64505 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64506 mv at-expout expout
   64507 # 5. Check
   64508 { set +x
   64509 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64510 at_fn_check_prepare_trace "calc.at:603"
   64511 ( $at_check_trace; cat stderr
   64512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64513 at_status=$? at_failed=false
   64514 $at_check_filter
   64515 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64516 $at_diff expout "$at_stdout" || at_failed=:
   64517 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64518 $at_failed && at_fn_log_failure
   64519 $at_traceon; }
   64520 
   64521 
   64522 cat >input <<'_ATEOF'
   64523 1 = 2 = 3
   64524 _ATEOF
   64525 
   64526 { set +x
   64527 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64528 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64529 ( $at_check_trace;  $PREPARSER ./calc input
   64530 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64531 at_status=$? at_failed=false
   64532 $at_check_filter
   64533 echo stderr:; tee stderr <"$at_stderr"
   64534 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64535 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
   64536 $at_failed && at_fn_log_failure
   64537 $at_traceon; }
   64538 
   64539 { set +x
   64540 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64541 at_fn_check_prepare_trace "calc.at:603"
   64542 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64544 at_status=$? at_failed=false
   64545 $at_check_filter
   64546 echo stderr:; tee stderr <"$at_stderr"
   64547 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64548 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64549 $at_failed && at_fn_log_failure
   64550 $at_traceon; }
   64551 
   64552 
   64553 
   64554 # Normalize the observed and expected error messages, depending upon the
   64555 # options.
   64556 # 1. Remove the traces from observed.
   64557 sed '/^Starting/d
   64558 /^Entering/d
   64559 /^Stack/d
   64560 /^Reading/d
   64561 /^Reducing/d
   64562 /^Return/d
   64563 /^Shifting/d
   64564 /^state/d
   64565 /^Cleanup:/d
   64566 /^Error:/d
   64567 /^Next/d
   64568 /^Now/d
   64569 /^Discarding/d
   64570 / \$[0-9$]* = /d
   64571 /^yydestructor:/d' stderr >at-stderr
   64572 mv at-stderr stderr
   64573 # 2. Create the reference error message.
   64574 cat >expout <<'_ATEOF'
   64575 1.7: syntax error, unexpected '='
   64576 _ATEOF
   64577 
   64578 # 3. If locations are not used, remove them.
   64579 sed 's/^[-0-9.]*: //' expout >at-expout
   64580 mv at-expout expout
   64581 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64582 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64583 mv at-expout expout
   64584 # 5. Check
   64585 { set +x
   64586 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64587 at_fn_check_prepare_trace "calc.at:603"
   64588 ( $at_check_trace; cat stderr
   64589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64590 at_status=$? at_failed=false
   64591 $at_check_filter
   64592 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64593 $at_diff expout "$at_stdout" || at_failed=:
   64594 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64595 $at_failed && at_fn_log_failure
   64596 $at_traceon; }
   64597 
   64598 
   64599 cat >input <<'_ATEOF'
   64600 
   64601 +1
   64602 _ATEOF
   64603 
   64604 { set +x
   64605 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64606 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64607 ( $at_check_trace;  $PREPARSER ./calc input
   64608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64609 at_status=$? at_failed=false
   64610 $at_check_filter
   64611 echo stderr:; tee stderr <"$at_stderr"
   64612 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64613 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
   64614 $at_failed && at_fn_log_failure
   64615 $at_traceon; }
   64616 
   64617 { set +x
   64618 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64619 at_fn_check_prepare_trace "calc.at:603"
   64620 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64621 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64622 at_status=$? at_failed=false
   64623 $at_check_filter
   64624 echo stderr:; tee stderr <"$at_stderr"
   64625 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64626 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64627 $at_failed && at_fn_log_failure
   64628 $at_traceon; }
   64629 
   64630 
   64631 
   64632 # Normalize the observed and expected error messages, depending upon the
   64633 # options.
   64634 # 1. Remove the traces from observed.
   64635 sed '/^Starting/d
   64636 /^Entering/d
   64637 /^Stack/d
   64638 /^Reading/d
   64639 /^Reducing/d
   64640 /^Return/d
   64641 /^Shifting/d
   64642 /^state/d
   64643 /^Cleanup:/d
   64644 /^Error:/d
   64645 /^Next/d
   64646 /^Now/d
   64647 /^Discarding/d
   64648 / \$[0-9$]* = /d
   64649 /^yydestructor:/d' stderr >at-stderr
   64650 mv at-stderr stderr
   64651 # 2. Create the reference error message.
   64652 cat >expout <<'_ATEOF'
   64653 2.1: syntax error, unexpected '+'
   64654 _ATEOF
   64655 
   64656 # 3. If locations are not used, remove them.
   64657 sed 's/^[-0-9.]*: //' expout >at-expout
   64658 mv at-expout expout
   64659 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64660 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64661 mv at-expout expout
   64662 # 5. Check
   64663 { set +x
   64664 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64665 at_fn_check_prepare_trace "calc.at:603"
   64666 ( $at_check_trace; cat stderr
   64667 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64668 at_status=$? at_failed=false
   64669 $at_check_filter
   64670 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64671 $at_diff expout "$at_stdout" || at_failed=:
   64672 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64673 $at_failed && at_fn_log_failure
   64674 $at_traceon; }
   64675 
   64676 
   64677 # Exercise error messages with EOF: work on an empty file.
   64678 { set +x
   64679 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc /dev/null"
   64680 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:603"
   64681 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   64682 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64683 at_status=$? at_failed=false
   64684 $at_check_filter
   64685 echo stderr:; tee stderr <"$at_stderr"
   64686 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64687 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
   64688 $at_failed && at_fn_log_failure
   64689 $at_traceon; }
   64690 
   64691 { set +x
   64692 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64693 at_fn_check_prepare_trace "calc.at:603"
   64694 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64696 at_status=$? at_failed=false
   64697 $at_check_filter
   64698 echo stderr:; tee stderr <"$at_stderr"
   64699 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64700 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64701 $at_failed && at_fn_log_failure
   64702 $at_traceon; }
   64703 
   64704 
   64705 
   64706 # Normalize the observed and expected error messages, depending upon the
   64707 # options.
   64708 # 1. Remove the traces from observed.
   64709 sed '/^Starting/d
   64710 /^Entering/d
   64711 /^Stack/d
   64712 /^Reading/d
   64713 /^Reducing/d
   64714 /^Return/d
   64715 /^Shifting/d
   64716 /^state/d
   64717 /^Cleanup:/d
   64718 /^Error:/d
   64719 /^Next/d
   64720 /^Now/d
   64721 /^Discarding/d
   64722 / \$[0-9$]* = /d
   64723 /^yydestructor:/d' stderr >at-stderr
   64724 mv at-stderr stderr
   64725 # 2. Create the reference error message.
   64726 cat >expout <<'_ATEOF'
   64727 1.1: syntax error, unexpected end of input
   64728 _ATEOF
   64729 
   64730 # 3. If locations are not used, remove them.
   64731 sed 's/^[-0-9.]*: //' expout >at-expout
   64732 mv at-expout expout
   64733 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64734 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64735 mv at-expout expout
   64736 # 5. Check
   64737 { set +x
   64738 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64739 at_fn_check_prepare_trace "calc.at:603"
   64740 ( $at_check_trace; cat stderr
   64741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64742 at_status=$? at_failed=false
   64743 $at_check_filter
   64744 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64745 $at_diff expout "$at_stdout" || at_failed=:
   64746 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64747 $at_failed && at_fn_log_failure
   64748 $at_traceon; }
   64749 
   64750 
   64751 
   64752 # Exercise the error token: without it, we die at the first error,
   64753 # hence be sure to
   64754 #
   64755 # - have several errors which exercise different shift/discardings
   64756 #   - (): nothing to pop, nothing to discard
   64757 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   64758 #   - (* * *): nothing to pop, a lot to discard
   64759 #   - (1 + 2 * *): some to pop and discard
   64760 #
   64761 # - test the action associated to `error'
   64762 #
   64763 # - check the lookahead that triggers an error is not discarded
   64764 #   when we enter error recovery.  Below, the lookahead causing the
   64765 #   first error is ")", which is needed to recover from the error and
   64766 #   produce the "0" that triggers the "0 != 1" error.
   64767 #
   64768 cat >input <<'_ATEOF'
   64769 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   64770 _ATEOF
   64771 
   64772 { set +x
   64773 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64774 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64775 ( $at_check_trace;  $PREPARSER ./calc input
   64776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64777 at_status=$? at_failed=false
   64778 $at_check_filter
   64779 echo stderr:; tee stderr <"$at_stderr"
   64780 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64781 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64782 $at_failed && at_fn_log_failure
   64783 $at_traceon; }
   64784 
   64785 { set +x
   64786 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64787 at_fn_check_prepare_trace "calc.at:603"
   64788 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64790 at_status=$? at_failed=false
   64791 $at_check_filter
   64792 echo stderr:; tee stderr <"$at_stderr"
   64793 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64795 $at_failed && at_fn_log_failure
   64796 $at_traceon; }
   64797 
   64798 
   64799 
   64800 # Normalize the observed and expected error messages, depending upon the
   64801 # options.
   64802 # 1. Remove the traces from observed.
   64803 sed '/^Starting/d
   64804 /^Entering/d
   64805 /^Stack/d
   64806 /^Reading/d
   64807 /^Reducing/d
   64808 /^Return/d
   64809 /^Shifting/d
   64810 /^state/d
   64811 /^Cleanup:/d
   64812 /^Error:/d
   64813 /^Next/d
   64814 /^Now/d
   64815 /^Discarding/d
   64816 / \$[0-9$]* = /d
   64817 /^yydestructor:/d' stderr >at-stderr
   64818 mv at-stderr stderr
   64819 # 2. Create the reference error message.
   64820 cat >expout <<'_ATEOF'
   64821 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   64822 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   64823 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   64824 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   64825 calc: error: 4444 != 1
   64826 _ATEOF
   64827 
   64828 # 3. If locations are not used, remove them.
   64829 sed 's/^[-0-9.]*: //' expout >at-expout
   64830 mv at-expout expout
   64831 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64832 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64833 mv at-expout expout
   64834 # 5. Check
   64835 { set +x
   64836 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64837 at_fn_check_prepare_trace "calc.at:603"
   64838 ( $at_check_trace; cat stderr
   64839 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64840 at_status=$? at_failed=false
   64841 $at_check_filter
   64842 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64843 $at_diff expout "$at_stdout" || at_failed=:
   64844 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64845 $at_failed && at_fn_log_failure
   64846 $at_traceon; }
   64847 
   64848 
   64849 
   64850 # The same, but this time exercising explicitly triggered syntax errors.
   64851 # POSIX says the lookahead causing the error should not be discarded.
   64852 cat >input <<'_ATEOF'
   64853 (!) + (1 2) = 1
   64854 _ATEOF
   64855 
   64856 { set +x
   64857 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64858 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64859 ( $at_check_trace;  $PREPARSER ./calc input
   64860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64861 at_status=$? at_failed=false
   64862 $at_check_filter
   64863 echo stderr:; tee stderr <"$at_stderr"
   64864 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64865 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64866 $at_failed && at_fn_log_failure
   64867 $at_traceon; }
   64868 
   64869 { set +x
   64870 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64871 at_fn_check_prepare_trace "calc.at:603"
   64872 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64874 at_status=$? at_failed=false
   64875 $at_check_filter
   64876 echo stderr:; tee stderr <"$at_stderr"
   64877 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64878 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64879 $at_failed && at_fn_log_failure
   64880 $at_traceon; }
   64881 
   64882 
   64883 
   64884 # Normalize the observed and expected error messages, depending upon the
   64885 # options.
   64886 # 1. Remove the traces from observed.
   64887 sed '/^Starting/d
   64888 /^Entering/d
   64889 /^Stack/d
   64890 /^Reading/d
   64891 /^Reducing/d
   64892 /^Return/d
   64893 /^Shifting/d
   64894 /^state/d
   64895 /^Cleanup:/d
   64896 /^Error:/d
   64897 /^Next/d
   64898 /^Now/d
   64899 /^Discarding/d
   64900 / \$[0-9$]* = /d
   64901 /^yydestructor:/d' stderr >at-stderr
   64902 mv at-stderr stderr
   64903 # 2. Create the reference error message.
   64904 cat >expout <<'_ATEOF'
   64905 1.10: syntax error, unexpected number
   64906 calc: error: 2222 != 1
   64907 _ATEOF
   64908 
   64909 # 3. If locations are not used, remove them.
   64910 sed 's/^[-0-9.]*: //' expout >at-expout
   64911 mv at-expout expout
   64912 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64913 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64914 mv at-expout expout
   64915 # 5. Check
   64916 { set +x
   64917 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64918 at_fn_check_prepare_trace "calc.at:603"
   64919 ( $at_check_trace; cat stderr
   64920 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64921 at_status=$? at_failed=false
   64922 $at_check_filter
   64923 at_fn_diff_devnull "$at_stderr" || at_failed=:
   64924 $at_diff expout "$at_stdout" || at_failed=:
   64925 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64926 $at_failed && at_fn_log_failure
   64927 $at_traceon; }
   64928 
   64929 
   64930 cat >input <<'_ATEOF'
   64931 (- *) + (1 2) = 1
   64932 _ATEOF
   64933 
   64934 { set +x
   64935 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   64936 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   64937 ( $at_check_trace;  $PREPARSER ./calc input
   64938 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64939 at_status=$? at_failed=false
   64940 $at_check_filter
   64941 echo stderr:; tee stderr <"$at_stderr"
   64942 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64943 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64944 $at_failed && at_fn_log_failure
   64945 $at_traceon; }
   64946 
   64947 { set +x
   64948 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   64949 at_fn_check_prepare_trace "calc.at:603"
   64950 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   64951 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   64952 at_status=$? at_failed=false
   64953 $at_check_filter
   64954 echo stderr:; tee stderr <"$at_stderr"
   64955 at_fn_diff_devnull "$at_stdout" || at_failed=:
   64956 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   64957 $at_failed && at_fn_log_failure
   64958 $at_traceon; }
   64959 
   64960 
   64961 
   64962 # Normalize the observed and expected error messages, depending upon the
   64963 # options.
   64964 # 1. Remove the traces from observed.
   64965 sed '/^Starting/d
   64966 /^Entering/d
   64967 /^Stack/d
   64968 /^Reading/d
   64969 /^Reducing/d
   64970 /^Return/d
   64971 /^Shifting/d
   64972 /^state/d
   64973 /^Cleanup:/d
   64974 /^Error:/d
   64975 /^Next/d
   64976 /^Now/d
   64977 /^Discarding/d
   64978 / \$[0-9$]* = /d
   64979 /^yydestructor:/d' stderr >at-stderr
   64980 mv at-stderr stderr
   64981 # 2. Create the reference error message.
   64982 cat >expout <<'_ATEOF'
   64983 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   64984 1.12: syntax error, unexpected number
   64985 calc: error: 2222 != 1
   64986 _ATEOF
   64987 
   64988 # 3. If locations are not used, remove them.
   64989 sed 's/^[-0-9.]*: //' expout >at-expout
   64990 mv at-expout expout
   64991 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   64992 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   64993 mv at-expout expout
   64994 # 5. Check
   64995 { set +x
   64996 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   64997 at_fn_check_prepare_trace "calc.at:603"
   64998 ( $at_check_trace; cat stderr
   64999 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65000 at_status=$? at_failed=false
   65001 $at_check_filter
   65002 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65003 $at_diff expout "$at_stdout" || at_failed=:
   65004 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   65005 $at_failed && at_fn_log_failure
   65006 $at_traceon; }
   65007 
   65008 
   65009 
   65010 # Check that yyerrok works properly: second error is not reported,
   65011 # third and fourth are.  Parse status is succesfull.
   65012 cat >input <<'_ATEOF'
   65013 (* *) + (*) + (*)
   65014 _ATEOF
   65015 
   65016 { set +x
   65017 $as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
   65018 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
   65019 ( $at_check_trace;  $PREPARSER ./calc input
   65020 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65021 at_status=$? at_failed=false
   65022 $at_check_filter
   65023 echo stderr:; tee stderr <"$at_stderr"
   65024 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65025 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   65026 $at_failed && at_fn_log_failure
   65027 $at_traceon; }
   65028 
   65029 { set +x
   65030 $as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65031 at_fn_check_prepare_trace "calc.at:603"
   65032 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65034 at_status=$? at_failed=false
   65035 $at_check_filter
   65036 echo stderr:; tee stderr <"$at_stderr"
   65037 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65038 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   65039 $at_failed && at_fn_log_failure
   65040 $at_traceon; }
   65041 
   65042 
   65043 
   65044 # Normalize the observed and expected error messages, depending upon the
   65045 # options.
   65046 # 1. Remove the traces from observed.
   65047 sed '/^Starting/d
   65048 /^Entering/d
   65049 /^Stack/d
   65050 /^Reading/d
   65051 /^Reducing/d
   65052 /^Return/d
   65053 /^Shifting/d
   65054 /^state/d
   65055 /^Cleanup:/d
   65056 /^Error:/d
   65057 /^Next/d
   65058 /^Now/d
   65059 /^Discarding/d
   65060 / \$[0-9$]* = /d
   65061 /^yydestructor:/d' stderr >at-stderr
   65062 mv at-stderr stderr
   65063 # 2. Create the reference error message.
   65064 cat >expout <<'_ATEOF'
   65065 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   65066 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   65067 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   65068 _ATEOF
   65069 
   65070 # 3. If locations are not used, remove them.
   65071 sed 's/^[-0-9.]*: //' expout >at-expout
   65072 mv at-expout expout
   65073 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65074 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65075 mv at-expout expout
   65076 # 5. Check
   65077 { set +x
   65078 $as_echo "$at_srcdir/calc.at:603: cat stderr"
   65079 at_fn_check_prepare_trace "calc.at:603"
   65080 ( $at_check_trace; cat stderr
   65081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65082 at_status=$? at_failed=false
   65083 $at_check_filter
   65084 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65085 $at_diff expout "$at_stdout" || at_failed=:
   65086 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
   65087 $at_failed && at_fn_log_failure
   65088 $at_traceon; }
   65089 
   65090 
   65091 
   65092 
   65093 
   65094   set +x
   65095   $at_times_p && times >"$at_times_file"
   65096 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   65097 read at_status <"$at_status_file"
   65098 #AT_STOP_204
   65099 #AT_START_205
   65100 at_fn_group_banner 205 'calc.at:604' \
   65101   "Calculator %yacc" "                               " 11
   65102 at_xfail=no
   65103 (
   65104   $as_echo "205. $at_setup_line: testing $at_desc ..."
   65105   $at_traceon
   65106 
   65107 
   65108 
   65109 
   65110 
   65111 
   65112 
   65113 
   65114 
   65115 
   65116 cat >calc.y <<'_ATEOF'
   65117 %code top {
   65118 #include <config.h>
   65119 /* We don't need perfect functions for these tests. */
   65120 #undef malloc
   65121 #undef memcmp
   65122 #undef realloc
   65123 }
   65124 
   65125 /* Infix notation calculator--calc */
   65126 %yacc
   65127 
   65128 %code requires
   65129 {
   65130 
   65131   /* Exercise pre-prologue dependency to %union.  */
   65132   typedef int semantic_value;
   65133 }
   65134 
   65135 /* Exercise %union. */
   65136 %union
   65137 {
   65138   semantic_value ival;
   65139 };
   65140 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   65141 
   65142 %code provides
   65143 {
   65144   #include <stdio.h>
   65145   /* The input.  */
   65146   extern FILE *input;
   65147   extern semantic_value global_result;
   65148   extern int global_count;
   65149 }
   65150 
   65151 %code
   65152 {
   65153 #include <assert.h>
   65154 #include <string.h>
   65155 #define USE(Var)
   65156 
   65157 FILE *input;
   65158 static int power (int base, int exponent);
   65159 
   65160 static void yyerror ( const char *msg);
   65161 int yylex (void);
   65162 }
   65163 
   65164 
   65165 
   65166 /* Bison Declarations */
   65167 %token CALC_EOF 0 "end of input"
   65168 %token <ival> NUM "number"
   65169 %type  <ival> exp
   65170 
   65171 %nonassoc '=' /* comparison            */
   65172 %left '-' '+'
   65173 %left '*' '/'
   65174 %left NEG     /* negation--unary minus */
   65175 %right '^'    /* exponentiation        */
   65176 
   65177 /* Grammar follows */
   65178 %%
   65179 input:
   65180   line
   65181 | input line         {  }
   65182 ;
   65183 
   65184 line:
   65185   '\n'
   65186 | exp '\n'           { USE ($1); }
   65187 ;
   65188 
   65189 exp:
   65190   NUM                { $$ = $1;             }
   65191 | exp '=' exp
   65192   {
   65193     if ($1 != $3)
   65194       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   65195     $$ = $1;
   65196   }
   65197 | exp '+' exp        { $$ = $1 + $3;        }
   65198 | exp '-' exp        { $$ = $1 - $3;        }
   65199 | exp '*' exp        { $$ = $1 * $3;        }
   65200 | exp '/' exp        { $$ = $1 / $3;        }
   65201 | '-' exp  %prec NEG { $$ = -$2;            }
   65202 | exp '^' exp        { $$ = power ($1, $3); }
   65203 | '(' exp ')'        { $$ = $2;             }
   65204 | '(' error ')'      { $$ = 1111; yyerrok;  }
   65205 | '!'                { $$ = 0; YYERROR;     }
   65206 | '-' error          { $$ = 0; YYERROR;     }
   65207 ;
   65208 %%
   65209 
   65210 static int
   65211 power (int base, int exponent)
   65212 {
   65213   int res = 1;
   65214   assert (0 <= exponent);
   65215   for (/* Niente */; exponent; --exponent)
   65216     res *= base;
   65217   return res;
   65218 }
   65219 
   65220 
   65221 #include <stdio.h>
   65222 /* A C error reporting function.  */
   65223 static
   65224 void yyerror ( const char *msg)
   65225 {
   65226   fprintf (stderr, "%s\n", msg);
   65227 }
   65228 #include <ctype.h>
   65229 
   65230 int yylex (void);
   65231 static int get_char (void);
   65232 static void unget_char ( int c);
   65233 
   65234 
   65235 static int
   65236 get_char (void)
   65237 {
   65238   int res = getc (input);
   65239   ;
   65240 
   65241   return res;
   65242 }
   65243 
   65244 static void
   65245 unget_char ( int c)
   65246 {
   65247   ;
   65248 
   65249   ungetc (c, input);
   65250 }
   65251 
   65252 static int
   65253 read_signed_integer (void)
   65254 {
   65255   int c = get_char ();
   65256   int sign = 1;
   65257   int n = 0;
   65258 
   65259   ;
   65260   if (c == '-')
   65261     {
   65262       c = get_char ();
   65263       sign = -1;
   65264     }
   65265 
   65266   while (isdigit (c))
   65267     {
   65268       n = 10 * n + (c - '0');
   65269       c = get_char ();
   65270     }
   65271 
   65272   unget_char ( c);
   65273 
   65274   return sign * n;
   65275 }
   65276 
   65277 
   65278 /*---------------------------------------------------------------.
   65279 | Lexical analyzer returns an integer on the stack and the token |
   65280 | NUM, or the ASCII character read if not a number.  Skips all   |
   65281 | blanks and tabs, returns 0 for EOF.                            |
   65282 `---------------------------------------------------------------*/
   65283 
   65284 int yylex (void)
   65285 {
   65286   int c;
   65287   /* Skip current token, then white spaces.  */
   65288   do
   65289     {
   65290 
   65291     }
   65292   while ((c = get_char ()) == ' ' || c == '\t');
   65293 
   65294   /* process numbers   */
   65295   if (c == '.' || isdigit (c))
   65296     {
   65297       unget_char ( c);
   65298       (yylval).ival = read_signed_integer ();
   65299       return NUM;
   65300     }
   65301 
   65302   /* Return end-of-file.  */
   65303   if (c == EOF)
   65304     return CALC_EOF;
   65305 
   65306   /* Return single chars. */
   65307   return c;
   65308 }
   65309 
   65310 #include <assert.h>
   65311 #if HAVE_UNISTD_H
   65312 # include <unistd.h>
   65313 #else
   65314 # undef alarm
   65315 # define alarm(seconds) /* empty */
   65316 #endif
   65317 
   65318 
   65319 
   65320 semantic_value global_result = 0;
   65321 int global_count = 0;
   65322 
   65323 /* A C main function.  */
   65324 int
   65325 main (int argc, const char **argv)
   65326 {
   65327   semantic_value result = 0;
   65328   int count = 0;
   65329   int status;
   65330 
   65331   /* This used to be alarm (10), but that isn't enough time for
   65332      a July 1995 vintage DEC Alphastation 200 4/100 system,
   65333      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   65334   alarm (100);
   65335 
   65336   if (argc == 2)
   65337     input = fopen (argv[1], "r");
   65338   else
   65339     input = stdin;
   65340 
   65341   if (!input)
   65342     {
   65343       perror (argv[1]);
   65344       return 3;
   65345     }
   65346 
   65347 
   65348   status = yyparse ();
   65349   if (fclose (input))
   65350     perror ("fclose");
   65351   assert (global_result == result);
   65352   assert (global_count == count);
   65353   return status;
   65354 }
   65355 _ATEOF
   65356 
   65357 
   65358 
   65359 
   65360 
   65361 
   65362 
   65363 
   65364 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   65365   at_save_special_files
   65366   mkdir xml-tests
   65367     # Don't combine these Bison invocations since we want to be sure that
   65368   # --report=all isn't required to get the full XML file.
   65369   { set +x
   65370 $as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   65371                   --graph=xml-tests/test.dot -o calc.c calc.y"
   65372 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604"
   65373 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   65374                   --graph=xml-tests/test.dot -o calc.c calc.y
   65375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65376 at_status=$? at_failed=false
   65377 $at_check_filter
   65378 echo stderr:; cat "$at_stderr"
   65379 echo stdout:; cat "$at_stdout"
   65380 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65381 $at_failed && at_fn_log_failure
   65382 $at_traceon; }
   65383 
   65384   { set +x
   65385 $as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   65386 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:604"
   65387 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   65388 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65389 at_status=$? at_failed=false
   65390 $at_check_filter
   65391 echo stderr:; cat "$at_stderr"
   65392 echo stdout:; cat "$at_stdout"
   65393 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65394 $at_failed && at_fn_log_failure
   65395 $at_traceon; }
   65396 
   65397     cp xml-tests/test.output expout
   65398   { set +x
   65399 $as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\
   65400              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   65401              xml-tests/test.xml"
   65402 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604"
   65403 ( $at_check_trace; $XSLTPROC \
   65404              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   65405              xml-tests/test.xml
   65406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65407 at_status=$? at_failed=false
   65408 $at_check_filter
   65409 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65410 $at_diff expout "$at_stdout" || at_failed=:
   65411 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65412 $at_failed && at_fn_log_failure
   65413 $at_traceon; }
   65414 
   65415   sort xml-tests/test.dot > expout
   65416   { set +x
   65417 $as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\
   65418              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   65419              xml-tests/test.xml | sort"
   65420 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604"
   65421 ( $at_check_trace; $XSLTPROC \
   65422              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   65423              xml-tests/test.xml | sort
   65424 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65425 at_status=$? at_failed=false
   65426 $at_check_filter
   65427 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65428 $at_diff expout "$at_stdout" || at_failed=:
   65429 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65430 $at_failed && at_fn_log_failure
   65431 $at_traceon; }
   65432 
   65433   rm -rf xml-tests expout
   65434   at_restore_special_files
   65435 fi
   65436 { set +x
   65437 $as_echo "$at_srcdir/calc.at:604: bison -o calc.c calc.y"
   65438 at_fn_check_prepare_trace "calc.at:604"
   65439 ( $at_check_trace; bison -o calc.c calc.y
   65440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65441 at_status=$? at_failed=false
   65442 $at_check_filter
   65443 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65444 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65445 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65446 $at_failed && at_fn_log_failure
   65447 $at_traceon; }
   65448 
   65449 
   65450    { set +x
   65451 $as_echo "$at_srcdir/calc.at:604: \$BISON_C_WORKS"
   65452 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:604"
   65453 ( $at_check_trace; $BISON_C_WORKS
   65454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65455 at_status=$? at_failed=false
   65456 $at_check_filter
   65457 echo stderr:; cat "$at_stderr"
   65458 echo stdout:; cat "$at_stdout"
   65459 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65460 $at_failed && at_fn_log_failure
   65461 $at_traceon; }
   65462 
   65463 { set +x
   65464 $as_echo "$at_srcdir/calc.at:604: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   65465 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:604"
   65466 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   65467 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65468 at_status=$? at_failed=false
   65469 $at_check_filter
   65470 echo stderr:; cat "$at_stderr"
   65471 echo stdout:; cat "$at_stdout"
   65472 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65473 $at_failed && at_fn_log_failure
   65474 $at_traceon; }
   65475 
   65476 
   65477 { set +x
   65478 $as_echo "$at_srcdir/calc.at:604: \$PERL -ne '
   65479   chomp;
   65480   print \"\$.: {\$_}\\n\"
   65481     if (# No starting/ending empty lines.
   65482         (eof || \$. == 1) && /^\\s*\$/
   65483         # No trailing space.  FIXME: not ready for \"maint\".
   65484         # || /\\s\$/
   65485         )' calc.c
   65486 "
   65487 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604"
   65488 ( $at_check_trace; $PERL -ne '
   65489   chomp;
   65490   print "$.: {$_}\n"
   65491     if (# No starting/ending empty lines.
   65492         (eof || $. == 1) && /^\s*$/
   65493         # No trailing space.  FIXME: not ready for "maint".
   65494         # || /\s$/
   65495         )' calc.c
   65496 
   65497 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65498 at_status=$? at_failed=false
   65499 $at_check_filter
   65500 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65501 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65502 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65503 $at_failed && at_fn_log_failure
   65504 $at_traceon; }
   65505 
   65506 
   65507 
   65508 # Test the priorities.
   65509 cat >input <<'_ATEOF'
   65510 1 + 2 * 3 = 7
   65511 1 + 2 * -3 = -5
   65512 
   65513 -1^2 = -1
   65514 (-1)^2 = 1
   65515 
   65516 ---1 = -1
   65517 
   65518 1 - 2 - 3 = -4
   65519 1 - (2 - 3) = 2
   65520 
   65521 2^2^3 = 256
   65522 (2^2)^3 = 64
   65523 _ATEOF
   65524 
   65525 { set +x
   65526 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   65527 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   65528 ( $at_check_trace;  $PREPARSER ./calc input
   65529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65530 at_status=$? at_failed=false
   65531 $at_check_filter
   65532 echo stderr:; tee stderr <"$at_stderr"
   65533 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65534 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65535 $at_failed && at_fn_log_failure
   65536 $at_traceon; }
   65537 
   65538 { set +x
   65539 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65540 at_fn_check_prepare_trace "calc.at:604"
   65541 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65543 at_status=$? at_failed=false
   65544 $at_check_filter
   65545 echo stderr:; tee stderr <"$at_stderr"
   65546 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65547 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65548 $at_failed && at_fn_log_failure
   65549 $at_traceon; }
   65550 
   65551 
   65552 
   65553 
   65554 # Some syntax errors.
   65555 cat >input <<'_ATEOF'
   65556 1 2
   65557 _ATEOF
   65558 
   65559 { set +x
   65560 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   65561 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   65562 ( $at_check_trace;  $PREPARSER ./calc input
   65563 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65564 at_status=$? at_failed=false
   65565 $at_check_filter
   65566 echo stderr:; tee stderr <"$at_stderr"
   65567 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65568 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
   65569 $at_failed && at_fn_log_failure
   65570 $at_traceon; }
   65571 
   65572 { set +x
   65573 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65574 at_fn_check_prepare_trace "calc.at:604"
   65575 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65577 at_status=$? at_failed=false
   65578 $at_check_filter
   65579 echo stderr:; tee stderr <"$at_stderr"
   65580 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65581 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65582 $at_failed && at_fn_log_failure
   65583 $at_traceon; }
   65584 
   65585 
   65586 
   65587 # Normalize the observed and expected error messages, depending upon the
   65588 # options.
   65589 # 1. Remove the traces from observed.
   65590 sed '/^Starting/d
   65591 /^Entering/d
   65592 /^Stack/d
   65593 /^Reading/d
   65594 /^Reducing/d
   65595 /^Return/d
   65596 /^Shifting/d
   65597 /^state/d
   65598 /^Cleanup:/d
   65599 /^Error:/d
   65600 /^Next/d
   65601 /^Now/d
   65602 /^Discarding/d
   65603 / \$[0-9$]* = /d
   65604 /^yydestructor:/d' stderr >at-stderr
   65605 mv at-stderr stderr
   65606 # 2. Create the reference error message.
   65607 cat >expout <<'_ATEOF'
   65608 1.3: syntax error, unexpected number
   65609 _ATEOF
   65610 
   65611 # 3. If locations are not used, remove them.
   65612 sed 's/^[-0-9.]*: //' expout >at-expout
   65613 mv at-expout expout
   65614 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65615 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65616 mv at-expout expout
   65617 # 5. Check
   65618 { set +x
   65619 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   65620 at_fn_check_prepare_trace "calc.at:604"
   65621 ( $at_check_trace; cat stderr
   65622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65623 at_status=$? at_failed=false
   65624 $at_check_filter
   65625 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65626 $at_diff expout "$at_stdout" || at_failed=:
   65627 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65628 $at_failed && at_fn_log_failure
   65629 $at_traceon; }
   65630 
   65631 
   65632 cat >input <<'_ATEOF'
   65633 1//2
   65634 _ATEOF
   65635 
   65636 { set +x
   65637 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   65638 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   65639 ( $at_check_trace;  $PREPARSER ./calc input
   65640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65641 at_status=$? at_failed=false
   65642 $at_check_filter
   65643 echo stderr:; tee stderr <"$at_stderr"
   65644 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65645 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
   65646 $at_failed && at_fn_log_failure
   65647 $at_traceon; }
   65648 
   65649 { set +x
   65650 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65651 at_fn_check_prepare_trace "calc.at:604"
   65652 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65654 at_status=$? at_failed=false
   65655 $at_check_filter
   65656 echo stderr:; tee stderr <"$at_stderr"
   65657 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65658 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65659 $at_failed && at_fn_log_failure
   65660 $at_traceon; }
   65661 
   65662 
   65663 
   65664 # Normalize the observed and expected error messages, depending upon the
   65665 # options.
   65666 # 1. Remove the traces from observed.
   65667 sed '/^Starting/d
   65668 /^Entering/d
   65669 /^Stack/d
   65670 /^Reading/d
   65671 /^Reducing/d
   65672 /^Return/d
   65673 /^Shifting/d
   65674 /^state/d
   65675 /^Cleanup:/d
   65676 /^Error:/d
   65677 /^Next/d
   65678 /^Now/d
   65679 /^Discarding/d
   65680 / \$[0-9$]* = /d
   65681 /^yydestructor:/d' stderr >at-stderr
   65682 mv at-stderr stderr
   65683 # 2. Create the reference error message.
   65684 cat >expout <<'_ATEOF'
   65685 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   65686 _ATEOF
   65687 
   65688 # 3. If locations are not used, remove them.
   65689 sed 's/^[-0-9.]*: //' expout >at-expout
   65690 mv at-expout expout
   65691 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65692 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65693 mv at-expout expout
   65694 # 5. Check
   65695 { set +x
   65696 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   65697 at_fn_check_prepare_trace "calc.at:604"
   65698 ( $at_check_trace; cat stderr
   65699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65700 at_status=$? at_failed=false
   65701 $at_check_filter
   65702 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65703 $at_diff expout "$at_stdout" || at_failed=:
   65704 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65705 $at_failed && at_fn_log_failure
   65706 $at_traceon; }
   65707 
   65708 
   65709 cat >input <<'_ATEOF'
   65710 error
   65711 _ATEOF
   65712 
   65713 { set +x
   65714 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   65715 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   65716 ( $at_check_trace;  $PREPARSER ./calc input
   65717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65718 at_status=$? at_failed=false
   65719 $at_check_filter
   65720 echo stderr:; tee stderr <"$at_stderr"
   65721 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65722 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
   65723 $at_failed && at_fn_log_failure
   65724 $at_traceon; }
   65725 
   65726 { set +x
   65727 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65728 at_fn_check_prepare_trace "calc.at:604"
   65729 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65731 at_status=$? at_failed=false
   65732 $at_check_filter
   65733 echo stderr:; tee stderr <"$at_stderr"
   65734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65735 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65736 $at_failed && at_fn_log_failure
   65737 $at_traceon; }
   65738 
   65739 
   65740 
   65741 # Normalize the observed and expected error messages, depending upon the
   65742 # options.
   65743 # 1. Remove the traces from observed.
   65744 sed '/^Starting/d
   65745 /^Entering/d
   65746 /^Stack/d
   65747 /^Reading/d
   65748 /^Reducing/d
   65749 /^Return/d
   65750 /^Shifting/d
   65751 /^state/d
   65752 /^Cleanup:/d
   65753 /^Error:/d
   65754 /^Next/d
   65755 /^Now/d
   65756 /^Discarding/d
   65757 / \$[0-9$]* = /d
   65758 /^yydestructor:/d' stderr >at-stderr
   65759 mv at-stderr stderr
   65760 # 2. Create the reference error message.
   65761 cat >expout <<'_ATEOF'
   65762 1.1: syntax error, unexpected $undefined
   65763 _ATEOF
   65764 
   65765 # 3. If locations are not used, remove them.
   65766 sed 's/^[-0-9.]*: //' expout >at-expout
   65767 mv at-expout expout
   65768 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65769 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65770 mv at-expout expout
   65771 # 5. Check
   65772 { set +x
   65773 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   65774 at_fn_check_prepare_trace "calc.at:604"
   65775 ( $at_check_trace; cat stderr
   65776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65777 at_status=$? at_failed=false
   65778 $at_check_filter
   65779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65780 $at_diff expout "$at_stdout" || at_failed=:
   65781 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65782 $at_failed && at_fn_log_failure
   65783 $at_traceon; }
   65784 
   65785 
   65786 cat >input <<'_ATEOF'
   65787 1 = 2 = 3
   65788 _ATEOF
   65789 
   65790 { set +x
   65791 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   65792 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   65793 ( $at_check_trace;  $PREPARSER ./calc input
   65794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65795 at_status=$? at_failed=false
   65796 $at_check_filter
   65797 echo stderr:; tee stderr <"$at_stderr"
   65798 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65799 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
   65800 $at_failed && at_fn_log_failure
   65801 $at_traceon; }
   65802 
   65803 { set +x
   65804 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65805 at_fn_check_prepare_trace "calc.at:604"
   65806 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65807 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65808 at_status=$? at_failed=false
   65809 $at_check_filter
   65810 echo stderr:; tee stderr <"$at_stderr"
   65811 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65812 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65813 $at_failed && at_fn_log_failure
   65814 $at_traceon; }
   65815 
   65816 
   65817 
   65818 # Normalize the observed and expected error messages, depending upon the
   65819 # options.
   65820 # 1. Remove the traces from observed.
   65821 sed '/^Starting/d
   65822 /^Entering/d
   65823 /^Stack/d
   65824 /^Reading/d
   65825 /^Reducing/d
   65826 /^Return/d
   65827 /^Shifting/d
   65828 /^state/d
   65829 /^Cleanup:/d
   65830 /^Error:/d
   65831 /^Next/d
   65832 /^Now/d
   65833 /^Discarding/d
   65834 / \$[0-9$]* = /d
   65835 /^yydestructor:/d' stderr >at-stderr
   65836 mv at-stderr stderr
   65837 # 2. Create the reference error message.
   65838 cat >expout <<'_ATEOF'
   65839 1.7: syntax error, unexpected '='
   65840 _ATEOF
   65841 
   65842 # 3. If locations are not used, remove them.
   65843 sed 's/^[-0-9.]*: //' expout >at-expout
   65844 mv at-expout expout
   65845 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65846 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65847 mv at-expout expout
   65848 # 5. Check
   65849 { set +x
   65850 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   65851 at_fn_check_prepare_trace "calc.at:604"
   65852 ( $at_check_trace; cat stderr
   65853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65854 at_status=$? at_failed=false
   65855 $at_check_filter
   65856 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65857 $at_diff expout "$at_stdout" || at_failed=:
   65858 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65859 $at_failed && at_fn_log_failure
   65860 $at_traceon; }
   65861 
   65862 
   65863 cat >input <<'_ATEOF'
   65864 
   65865 +1
   65866 _ATEOF
   65867 
   65868 { set +x
   65869 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   65870 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   65871 ( $at_check_trace;  $PREPARSER ./calc input
   65872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65873 at_status=$? at_failed=false
   65874 $at_check_filter
   65875 echo stderr:; tee stderr <"$at_stderr"
   65876 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65877 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
   65878 $at_failed && at_fn_log_failure
   65879 $at_traceon; }
   65880 
   65881 { set +x
   65882 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65883 at_fn_check_prepare_trace "calc.at:604"
   65884 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65886 at_status=$? at_failed=false
   65887 $at_check_filter
   65888 echo stderr:; tee stderr <"$at_stderr"
   65889 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65890 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65891 $at_failed && at_fn_log_failure
   65892 $at_traceon; }
   65893 
   65894 
   65895 
   65896 # Normalize the observed and expected error messages, depending upon the
   65897 # options.
   65898 # 1. Remove the traces from observed.
   65899 sed '/^Starting/d
   65900 /^Entering/d
   65901 /^Stack/d
   65902 /^Reading/d
   65903 /^Reducing/d
   65904 /^Return/d
   65905 /^Shifting/d
   65906 /^state/d
   65907 /^Cleanup:/d
   65908 /^Error:/d
   65909 /^Next/d
   65910 /^Now/d
   65911 /^Discarding/d
   65912 / \$[0-9$]* = /d
   65913 /^yydestructor:/d' stderr >at-stderr
   65914 mv at-stderr stderr
   65915 # 2. Create the reference error message.
   65916 cat >expout <<'_ATEOF'
   65917 2.1: syntax error, unexpected '+'
   65918 _ATEOF
   65919 
   65920 # 3. If locations are not used, remove them.
   65921 sed 's/^[-0-9.]*: //' expout >at-expout
   65922 mv at-expout expout
   65923 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65924 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65925 mv at-expout expout
   65926 # 5. Check
   65927 { set +x
   65928 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   65929 at_fn_check_prepare_trace "calc.at:604"
   65930 ( $at_check_trace; cat stderr
   65931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65932 at_status=$? at_failed=false
   65933 $at_check_filter
   65934 at_fn_diff_devnull "$at_stderr" || at_failed=:
   65935 $at_diff expout "$at_stdout" || at_failed=:
   65936 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65937 $at_failed && at_fn_log_failure
   65938 $at_traceon; }
   65939 
   65940 
   65941 # Exercise error messages with EOF: work on an empty file.
   65942 { set +x
   65943 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc /dev/null"
   65944 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:604"
   65945 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   65946 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65947 at_status=$? at_failed=false
   65948 $at_check_filter
   65949 echo stderr:; tee stderr <"$at_stderr"
   65950 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65951 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
   65952 $at_failed && at_fn_log_failure
   65953 $at_traceon; }
   65954 
   65955 { set +x
   65956 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   65957 at_fn_check_prepare_trace "calc.at:604"
   65958 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   65959 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   65960 at_status=$? at_failed=false
   65961 $at_check_filter
   65962 echo stderr:; tee stderr <"$at_stderr"
   65963 at_fn_diff_devnull "$at_stdout" || at_failed=:
   65964 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   65965 $at_failed && at_fn_log_failure
   65966 $at_traceon; }
   65967 
   65968 
   65969 
   65970 # Normalize the observed and expected error messages, depending upon the
   65971 # options.
   65972 # 1. Remove the traces from observed.
   65973 sed '/^Starting/d
   65974 /^Entering/d
   65975 /^Stack/d
   65976 /^Reading/d
   65977 /^Reducing/d
   65978 /^Return/d
   65979 /^Shifting/d
   65980 /^state/d
   65981 /^Cleanup:/d
   65982 /^Error:/d
   65983 /^Next/d
   65984 /^Now/d
   65985 /^Discarding/d
   65986 / \$[0-9$]* = /d
   65987 /^yydestructor:/d' stderr >at-stderr
   65988 mv at-stderr stderr
   65989 # 2. Create the reference error message.
   65990 cat >expout <<'_ATEOF'
   65991 1.1: syntax error, unexpected end of input
   65992 _ATEOF
   65993 
   65994 # 3. If locations are not used, remove them.
   65995 sed 's/^[-0-9.]*: //' expout >at-expout
   65996 mv at-expout expout
   65997 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   65998 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   65999 mv at-expout expout
   66000 # 5. Check
   66001 { set +x
   66002 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   66003 at_fn_check_prepare_trace "calc.at:604"
   66004 ( $at_check_trace; cat stderr
   66005 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66006 at_status=$? at_failed=false
   66007 $at_check_filter
   66008 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66009 $at_diff expout "$at_stdout" || at_failed=:
   66010 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66011 $at_failed && at_fn_log_failure
   66012 $at_traceon; }
   66013 
   66014 
   66015 
   66016 # Exercise the error token: without it, we die at the first error,
   66017 # hence be sure to
   66018 #
   66019 # - have several errors which exercise different shift/discardings
   66020 #   - (): nothing to pop, nothing to discard
   66021 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   66022 #   - (* * *): nothing to pop, a lot to discard
   66023 #   - (1 + 2 * *): some to pop and discard
   66024 #
   66025 # - test the action associated to `error'
   66026 #
   66027 # - check the lookahead that triggers an error is not discarded
   66028 #   when we enter error recovery.  Below, the lookahead causing the
   66029 #   first error is ")", which is needed to recover from the error and
   66030 #   produce the "0" that triggers the "0 != 1" error.
   66031 #
   66032 cat >input <<'_ATEOF'
   66033 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   66034 _ATEOF
   66035 
   66036 { set +x
   66037 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   66038 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   66039 ( $at_check_trace;  $PREPARSER ./calc input
   66040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66041 at_status=$? at_failed=false
   66042 $at_check_filter
   66043 echo stderr:; tee stderr <"$at_stderr"
   66044 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66045 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66046 $at_failed && at_fn_log_failure
   66047 $at_traceon; }
   66048 
   66049 { set +x
   66050 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66051 at_fn_check_prepare_trace "calc.at:604"
   66052 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66054 at_status=$? at_failed=false
   66055 $at_check_filter
   66056 echo stderr:; tee stderr <"$at_stderr"
   66057 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66059 $at_failed && at_fn_log_failure
   66060 $at_traceon; }
   66061 
   66062 
   66063 
   66064 # Normalize the observed and expected error messages, depending upon the
   66065 # options.
   66066 # 1. Remove the traces from observed.
   66067 sed '/^Starting/d
   66068 /^Entering/d
   66069 /^Stack/d
   66070 /^Reading/d
   66071 /^Reducing/d
   66072 /^Return/d
   66073 /^Shifting/d
   66074 /^state/d
   66075 /^Cleanup:/d
   66076 /^Error:/d
   66077 /^Next/d
   66078 /^Now/d
   66079 /^Discarding/d
   66080 / \$[0-9$]* = /d
   66081 /^yydestructor:/d' stderr >at-stderr
   66082 mv at-stderr stderr
   66083 # 2. Create the reference error message.
   66084 cat >expout <<'_ATEOF'
   66085 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   66086 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   66087 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   66088 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   66089 calc: error: 4444 != 1
   66090 _ATEOF
   66091 
   66092 # 3. If locations are not used, remove them.
   66093 sed 's/^[-0-9.]*: //' expout >at-expout
   66094 mv at-expout expout
   66095 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   66096 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   66097 mv at-expout expout
   66098 # 5. Check
   66099 { set +x
   66100 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   66101 at_fn_check_prepare_trace "calc.at:604"
   66102 ( $at_check_trace; cat stderr
   66103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66104 at_status=$? at_failed=false
   66105 $at_check_filter
   66106 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66107 $at_diff expout "$at_stdout" || at_failed=:
   66108 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66109 $at_failed && at_fn_log_failure
   66110 $at_traceon; }
   66111 
   66112 
   66113 
   66114 # The same, but this time exercising explicitly triggered syntax errors.
   66115 # POSIX says the lookahead causing the error should not be discarded.
   66116 cat >input <<'_ATEOF'
   66117 (!) + (1 2) = 1
   66118 _ATEOF
   66119 
   66120 { set +x
   66121 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   66122 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   66123 ( $at_check_trace;  $PREPARSER ./calc input
   66124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66125 at_status=$? at_failed=false
   66126 $at_check_filter
   66127 echo stderr:; tee stderr <"$at_stderr"
   66128 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66129 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66130 $at_failed && at_fn_log_failure
   66131 $at_traceon; }
   66132 
   66133 { set +x
   66134 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66135 at_fn_check_prepare_trace "calc.at:604"
   66136 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66137 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66138 at_status=$? at_failed=false
   66139 $at_check_filter
   66140 echo stderr:; tee stderr <"$at_stderr"
   66141 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66142 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66143 $at_failed && at_fn_log_failure
   66144 $at_traceon; }
   66145 
   66146 
   66147 
   66148 # Normalize the observed and expected error messages, depending upon the
   66149 # options.
   66150 # 1. Remove the traces from observed.
   66151 sed '/^Starting/d
   66152 /^Entering/d
   66153 /^Stack/d
   66154 /^Reading/d
   66155 /^Reducing/d
   66156 /^Return/d
   66157 /^Shifting/d
   66158 /^state/d
   66159 /^Cleanup:/d
   66160 /^Error:/d
   66161 /^Next/d
   66162 /^Now/d
   66163 /^Discarding/d
   66164 / \$[0-9$]* = /d
   66165 /^yydestructor:/d' stderr >at-stderr
   66166 mv at-stderr stderr
   66167 # 2. Create the reference error message.
   66168 cat >expout <<'_ATEOF'
   66169 1.10: syntax error, unexpected number
   66170 calc: error: 2222 != 1
   66171 _ATEOF
   66172 
   66173 # 3. If locations are not used, remove them.
   66174 sed 's/^[-0-9.]*: //' expout >at-expout
   66175 mv at-expout expout
   66176 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   66177 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   66178 mv at-expout expout
   66179 # 5. Check
   66180 { set +x
   66181 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   66182 at_fn_check_prepare_trace "calc.at:604"
   66183 ( $at_check_trace; cat stderr
   66184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66185 at_status=$? at_failed=false
   66186 $at_check_filter
   66187 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66188 $at_diff expout "$at_stdout" || at_failed=:
   66189 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66190 $at_failed && at_fn_log_failure
   66191 $at_traceon; }
   66192 
   66193 
   66194 cat >input <<'_ATEOF'
   66195 (- *) + (1 2) = 1
   66196 _ATEOF
   66197 
   66198 { set +x
   66199 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   66200 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   66201 ( $at_check_trace;  $PREPARSER ./calc input
   66202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66203 at_status=$? at_failed=false
   66204 $at_check_filter
   66205 echo stderr:; tee stderr <"$at_stderr"
   66206 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66207 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66208 $at_failed && at_fn_log_failure
   66209 $at_traceon; }
   66210 
   66211 { set +x
   66212 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66213 at_fn_check_prepare_trace "calc.at:604"
   66214 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66216 at_status=$? at_failed=false
   66217 $at_check_filter
   66218 echo stderr:; tee stderr <"$at_stderr"
   66219 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66220 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66221 $at_failed && at_fn_log_failure
   66222 $at_traceon; }
   66223 
   66224 
   66225 
   66226 # Normalize the observed and expected error messages, depending upon the
   66227 # options.
   66228 # 1. Remove the traces from observed.
   66229 sed '/^Starting/d
   66230 /^Entering/d
   66231 /^Stack/d
   66232 /^Reading/d
   66233 /^Reducing/d
   66234 /^Return/d
   66235 /^Shifting/d
   66236 /^state/d
   66237 /^Cleanup:/d
   66238 /^Error:/d
   66239 /^Next/d
   66240 /^Now/d
   66241 /^Discarding/d
   66242 / \$[0-9$]* = /d
   66243 /^yydestructor:/d' stderr >at-stderr
   66244 mv at-stderr stderr
   66245 # 2. Create the reference error message.
   66246 cat >expout <<'_ATEOF'
   66247 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   66248 1.12: syntax error, unexpected number
   66249 calc: error: 2222 != 1
   66250 _ATEOF
   66251 
   66252 # 3. If locations are not used, remove them.
   66253 sed 's/^[-0-9.]*: //' expout >at-expout
   66254 mv at-expout expout
   66255 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   66256 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   66257 mv at-expout expout
   66258 # 5. Check
   66259 { set +x
   66260 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   66261 at_fn_check_prepare_trace "calc.at:604"
   66262 ( $at_check_trace; cat stderr
   66263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66264 at_status=$? at_failed=false
   66265 $at_check_filter
   66266 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66267 $at_diff expout "$at_stdout" || at_failed=:
   66268 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66269 $at_failed && at_fn_log_failure
   66270 $at_traceon; }
   66271 
   66272 
   66273 
   66274 # Check that yyerrok works properly: second error is not reported,
   66275 # third and fourth are.  Parse status is succesfull.
   66276 cat >input <<'_ATEOF'
   66277 (* *) + (*) + (*)
   66278 _ATEOF
   66279 
   66280 { set +x
   66281 $as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
   66282 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
   66283 ( $at_check_trace;  $PREPARSER ./calc input
   66284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66285 at_status=$? at_failed=false
   66286 $at_check_filter
   66287 echo stderr:; tee stderr <"$at_stderr"
   66288 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66289 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66290 $at_failed && at_fn_log_failure
   66291 $at_traceon; }
   66292 
   66293 { set +x
   66294 $as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66295 at_fn_check_prepare_trace "calc.at:604"
   66296 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66298 at_status=$? at_failed=false
   66299 $at_check_filter
   66300 echo stderr:; tee stderr <"$at_stderr"
   66301 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66302 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66303 $at_failed && at_fn_log_failure
   66304 $at_traceon; }
   66305 
   66306 
   66307 
   66308 # Normalize the observed and expected error messages, depending upon the
   66309 # options.
   66310 # 1. Remove the traces from observed.
   66311 sed '/^Starting/d
   66312 /^Entering/d
   66313 /^Stack/d
   66314 /^Reading/d
   66315 /^Reducing/d
   66316 /^Return/d
   66317 /^Shifting/d
   66318 /^state/d
   66319 /^Cleanup:/d
   66320 /^Error:/d
   66321 /^Next/d
   66322 /^Now/d
   66323 /^Discarding/d
   66324 / \$[0-9$]* = /d
   66325 /^yydestructor:/d' stderr >at-stderr
   66326 mv at-stderr stderr
   66327 # 2. Create the reference error message.
   66328 cat >expout <<'_ATEOF'
   66329 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   66330 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   66331 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   66332 _ATEOF
   66333 
   66334 # 3. If locations are not used, remove them.
   66335 sed 's/^[-0-9.]*: //' expout >at-expout
   66336 mv at-expout expout
   66337 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   66338 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   66339 mv at-expout expout
   66340 # 5. Check
   66341 { set +x
   66342 $as_echo "$at_srcdir/calc.at:604: cat stderr"
   66343 at_fn_check_prepare_trace "calc.at:604"
   66344 ( $at_check_trace; cat stderr
   66345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66346 at_status=$? at_failed=false
   66347 $at_check_filter
   66348 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66349 $at_diff expout "$at_stdout" || at_failed=:
   66350 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
   66351 $at_failed && at_fn_log_failure
   66352 $at_traceon; }
   66353 
   66354 
   66355 
   66356 
   66357 
   66358   set +x
   66359   $at_times_p && times >"$at_times_file"
   66360 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   66361 read at_status <"$at_status_file"
   66362 #AT_STOP_205
   66363 #AT_START_206
   66364 at_fn_group_banner 206 'calc.at:605' \
   66365   "Calculator %error-verbose" "                      " 11
   66366 at_xfail=no
   66367 (
   66368   $as_echo "206. $at_setup_line: testing $at_desc ..."
   66369   $at_traceon
   66370 
   66371 
   66372 
   66373 
   66374 
   66375 
   66376 
   66377 
   66378 
   66379 
   66380 cat >calc.y <<'_ATEOF'
   66381 %code top {
   66382 #include <config.h>
   66383 /* We don't need perfect functions for these tests. */
   66384 #undef malloc
   66385 #undef memcmp
   66386 #undef realloc
   66387 }
   66388 
   66389 /* Infix notation calculator--calc */
   66390 %error-verbose
   66391 
   66392 %code requires
   66393 {
   66394 
   66395   /* Exercise pre-prologue dependency to %union.  */
   66396   typedef int semantic_value;
   66397 }
   66398 
   66399 /* Exercise %union. */
   66400 %union
   66401 {
   66402   semantic_value ival;
   66403 };
   66404 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   66405 
   66406 %code provides
   66407 {
   66408   #include <stdio.h>
   66409   /* The input.  */
   66410   extern FILE *input;
   66411   extern semantic_value global_result;
   66412   extern int global_count;
   66413 }
   66414 
   66415 %code
   66416 {
   66417 #include <assert.h>
   66418 #include <string.h>
   66419 #define USE(Var)
   66420 
   66421 FILE *input;
   66422 static int power (int base, int exponent);
   66423 
   66424 static void yyerror ( const char *msg);
   66425 int yylex (void);
   66426 }
   66427 
   66428 
   66429 
   66430 /* Bison Declarations */
   66431 %token CALC_EOF 0 "end of input"
   66432 %token <ival> NUM "number"
   66433 %type  <ival> exp
   66434 
   66435 %nonassoc '=' /* comparison            */
   66436 %left '-' '+'
   66437 %left '*' '/'
   66438 %left NEG     /* negation--unary minus */
   66439 %right '^'    /* exponentiation        */
   66440 
   66441 /* Grammar follows */
   66442 %%
   66443 input:
   66444   line
   66445 | input line         {  }
   66446 ;
   66447 
   66448 line:
   66449   '\n'
   66450 | exp '\n'           { USE ($1); }
   66451 ;
   66452 
   66453 exp:
   66454   NUM                { $$ = $1;             }
   66455 | exp '=' exp
   66456   {
   66457     if ($1 != $3)
   66458       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   66459     $$ = $1;
   66460   }
   66461 | exp '+' exp        { $$ = $1 + $3;        }
   66462 | exp '-' exp        { $$ = $1 - $3;        }
   66463 | exp '*' exp        { $$ = $1 * $3;        }
   66464 | exp '/' exp        { $$ = $1 / $3;        }
   66465 | '-' exp  %prec NEG { $$ = -$2;            }
   66466 | exp '^' exp        { $$ = power ($1, $3); }
   66467 | '(' exp ')'        { $$ = $2;             }
   66468 | '(' error ')'      { $$ = 1111; yyerrok;  }
   66469 | '!'                { $$ = 0; YYERROR;     }
   66470 | '-' error          { $$ = 0; YYERROR;     }
   66471 ;
   66472 %%
   66473 
   66474 static int
   66475 power (int base, int exponent)
   66476 {
   66477   int res = 1;
   66478   assert (0 <= exponent);
   66479   for (/* Niente */; exponent; --exponent)
   66480     res *= base;
   66481   return res;
   66482 }
   66483 
   66484 
   66485 #include <stdio.h>
   66486 /* A C error reporting function.  */
   66487 static
   66488 void yyerror ( const char *msg)
   66489 {
   66490   fprintf (stderr, "%s\n", msg);
   66491 }
   66492 #include <ctype.h>
   66493 
   66494 int yylex (void);
   66495 static int get_char (void);
   66496 static void unget_char ( int c);
   66497 
   66498 
   66499 static int
   66500 get_char (void)
   66501 {
   66502   int res = getc (input);
   66503   ;
   66504 
   66505   return res;
   66506 }
   66507 
   66508 static void
   66509 unget_char ( int c)
   66510 {
   66511   ;
   66512 
   66513   ungetc (c, input);
   66514 }
   66515 
   66516 static int
   66517 read_signed_integer (void)
   66518 {
   66519   int c = get_char ();
   66520   int sign = 1;
   66521   int n = 0;
   66522 
   66523   ;
   66524   if (c == '-')
   66525     {
   66526       c = get_char ();
   66527       sign = -1;
   66528     }
   66529 
   66530   while (isdigit (c))
   66531     {
   66532       n = 10 * n + (c - '0');
   66533       c = get_char ();
   66534     }
   66535 
   66536   unget_char ( c);
   66537 
   66538   return sign * n;
   66539 }
   66540 
   66541 
   66542 /*---------------------------------------------------------------.
   66543 | Lexical analyzer returns an integer on the stack and the token |
   66544 | NUM, or the ASCII character read if not a number.  Skips all   |
   66545 | blanks and tabs, returns 0 for EOF.                            |
   66546 `---------------------------------------------------------------*/
   66547 
   66548 int yylex (void)
   66549 {
   66550   int c;
   66551   /* Skip current token, then white spaces.  */
   66552   do
   66553     {
   66554 
   66555     }
   66556   while ((c = get_char ()) == ' ' || c == '\t');
   66557 
   66558   /* process numbers   */
   66559   if (c == '.' || isdigit (c))
   66560     {
   66561       unget_char ( c);
   66562       (yylval).ival = read_signed_integer ();
   66563       return NUM;
   66564     }
   66565 
   66566   /* Return end-of-file.  */
   66567   if (c == EOF)
   66568     return CALC_EOF;
   66569 
   66570   /* Return single chars. */
   66571   return c;
   66572 }
   66573 
   66574 #include <assert.h>
   66575 #if HAVE_UNISTD_H
   66576 # include <unistd.h>
   66577 #else
   66578 # undef alarm
   66579 # define alarm(seconds) /* empty */
   66580 #endif
   66581 
   66582 
   66583 
   66584 semantic_value global_result = 0;
   66585 int global_count = 0;
   66586 
   66587 /* A C main function.  */
   66588 int
   66589 main (int argc, const char **argv)
   66590 {
   66591   semantic_value result = 0;
   66592   int count = 0;
   66593   int status;
   66594 
   66595   /* This used to be alarm (10), but that isn't enough time for
   66596      a July 1995 vintage DEC Alphastation 200 4/100 system,
   66597      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   66598   alarm (100);
   66599 
   66600   if (argc == 2)
   66601     input = fopen (argv[1], "r");
   66602   else
   66603     input = stdin;
   66604 
   66605   if (!input)
   66606     {
   66607       perror (argv[1]);
   66608       return 3;
   66609     }
   66610 
   66611 
   66612   status = yyparse ();
   66613   if (fclose (input))
   66614     perror ("fclose");
   66615   assert (global_result == result);
   66616   assert (global_count == count);
   66617   return status;
   66618 }
   66619 _ATEOF
   66620 
   66621 
   66622 
   66623 
   66624 
   66625 
   66626 
   66627 
   66628 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   66629   at_save_special_files
   66630   mkdir xml-tests
   66631     # Don't combine these Bison invocations since we want to be sure that
   66632   # --report=all isn't required to get the full XML file.
   66633   { set +x
   66634 $as_echo "$at_srcdir/calc.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   66635                   --graph=xml-tests/test.dot -o calc.c calc.y"
   66636 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:605"
   66637 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   66638                   --graph=xml-tests/test.dot -o calc.c calc.y
   66639 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66640 at_status=$? at_failed=false
   66641 $at_check_filter
   66642 echo stderr:; cat "$at_stderr"
   66643 echo stdout:; cat "$at_stdout"
   66644 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66645 $at_failed && at_fn_log_failure
   66646 $at_traceon; }
   66647 
   66648   { set +x
   66649 $as_echo "$at_srcdir/calc.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   66650 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:605"
   66651 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   66652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66653 at_status=$? at_failed=false
   66654 $at_check_filter
   66655 echo stderr:; cat "$at_stderr"
   66656 echo stdout:; cat "$at_stdout"
   66657 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66658 $at_failed && at_fn_log_failure
   66659 $at_traceon; }
   66660 
   66661     cp xml-tests/test.output expout
   66662   { set +x
   66663 $as_echo "$at_srcdir/calc.at:605: \$XSLTPROC \\
   66664              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   66665              xml-tests/test.xml"
   66666 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:605"
   66667 ( $at_check_trace; $XSLTPROC \
   66668              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   66669              xml-tests/test.xml
   66670 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66671 at_status=$? at_failed=false
   66672 $at_check_filter
   66673 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66674 $at_diff expout "$at_stdout" || at_failed=:
   66675 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66676 $at_failed && at_fn_log_failure
   66677 $at_traceon; }
   66678 
   66679   sort xml-tests/test.dot > expout
   66680   { set +x
   66681 $as_echo "$at_srcdir/calc.at:605: \$XSLTPROC \\
   66682              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   66683              xml-tests/test.xml | sort"
   66684 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:605"
   66685 ( $at_check_trace; $XSLTPROC \
   66686              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   66687              xml-tests/test.xml | sort
   66688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66689 at_status=$? at_failed=false
   66690 $at_check_filter
   66691 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66692 $at_diff expout "$at_stdout" || at_failed=:
   66693 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66694 $at_failed && at_fn_log_failure
   66695 $at_traceon; }
   66696 
   66697   rm -rf xml-tests expout
   66698   at_restore_special_files
   66699 fi
   66700 { set +x
   66701 $as_echo "$at_srcdir/calc.at:605: bison -o calc.c calc.y"
   66702 at_fn_check_prepare_trace "calc.at:605"
   66703 ( $at_check_trace; bison -o calc.c calc.y
   66704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66705 at_status=$? at_failed=false
   66706 $at_check_filter
   66707 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66708 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66709 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66710 $at_failed && at_fn_log_failure
   66711 $at_traceon; }
   66712 
   66713 
   66714    { set +x
   66715 $as_echo "$at_srcdir/calc.at:605: \$BISON_C_WORKS"
   66716 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:605"
   66717 ( $at_check_trace; $BISON_C_WORKS
   66718 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66719 at_status=$? at_failed=false
   66720 $at_check_filter
   66721 echo stderr:; cat "$at_stderr"
   66722 echo stdout:; cat "$at_stdout"
   66723 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66724 $at_failed && at_fn_log_failure
   66725 $at_traceon; }
   66726 
   66727 { set +x
   66728 $as_echo "$at_srcdir/calc.at:605: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   66729 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:605"
   66730 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   66731 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66732 at_status=$? at_failed=false
   66733 $at_check_filter
   66734 echo stderr:; cat "$at_stderr"
   66735 echo stdout:; cat "$at_stdout"
   66736 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66737 $at_failed && at_fn_log_failure
   66738 $at_traceon; }
   66739 
   66740 
   66741 { set +x
   66742 $as_echo "$at_srcdir/calc.at:605: \$PERL -ne '
   66743   chomp;
   66744   print \"\$.: {\$_}\\n\"
   66745     if (# No starting/ending empty lines.
   66746         (eof || \$. == 1) && /^\\s*\$/
   66747         # No trailing space.  FIXME: not ready for \"maint\".
   66748         # || /\\s\$/
   66749         )' calc.c
   66750 "
   66751 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:605"
   66752 ( $at_check_trace; $PERL -ne '
   66753   chomp;
   66754   print "$.: {$_}\n"
   66755     if (# No starting/ending empty lines.
   66756         (eof || $. == 1) && /^\s*$/
   66757         # No trailing space.  FIXME: not ready for "maint".
   66758         # || /\s$/
   66759         )' calc.c
   66760 
   66761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66762 at_status=$? at_failed=false
   66763 $at_check_filter
   66764 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66765 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66766 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66767 $at_failed && at_fn_log_failure
   66768 $at_traceon; }
   66769 
   66770 
   66771 
   66772 # Test the priorities.
   66773 cat >input <<'_ATEOF'
   66774 1 + 2 * 3 = 7
   66775 1 + 2 * -3 = -5
   66776 
   66777 -1^2 = -1
   66778 (-1)^2 = 1
   66779 
   66780 ---1 = -1
   66781 
   66782 1 - 2 - 3 = -4
   66783 1 - (2 - 3) = 2
   66784 
   66785 2^2^3 = 256
   66786 (2^2)^3 = 64
   66787 _ATEOF
   66788 
   66789 { set +x
   66790 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   66791 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   66792 ( $at_check_trace;  $PREPARSER ./calc input
   66793 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66794 at_status=$? at_failed=false
   66795 $at_check_filter
   66796 echo stderr:; tee stderr <"$at_stderr"
   66797 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66798 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66799 $at_failed && at_fn_log_failure
   66800 $at_traceon; }
   66801 
   66802 { set +x
   66803 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66804 at_fn_check_prepare_trace "calc.at:605"
   66805 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66807 at_status=$? at_failed=false
   66808 $at_check_filter
   66809 echo stderr:; tee stderr <"$at_stderr"
   66810 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66811 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66812 $at_failed && at_fn_log_failure
   66813 $at_traceon; }
   66814 
   66815 
   66816 
   66817 
   66818 # Some syntax errors.
   66819 cat >input <<'_ATEOF'
   66820 1 2
   66821 _ATEOF
   66822 
   66823 { set +x
   66824 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   66825 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   66826 ( $at_check_trace;  $PREPARSER ./calc input
   66827 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66828 at_status=$? at_failed=false
   66829 $at_check_filter
   66830 echo stderr:; tee stderr <"$at_stderr"
   66831 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66832 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605"
   66833 $at_failed && at_fn_log_failure
   66834 $at_traceon; }
   66835 
   66836 { set +x
   66837 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66838 at_fn_check_prepare_trace "calc.at:605"
   66839 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66840 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66841 at_status=$? at_failed=false
   66842 $at_check_filter
   66843 echo stderr:; tee stderr <"$at_stderr"
   66844 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66845 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66846 $at_failed && at_fn_log_failure
   66847 $at_traceon; }
   66848 
   66849 
   66850 
   66851 # Normalize the observed and expected error messages, depending upon the
   66852 # options.
   66853 # 1. Remove the traces from observed.
   66854 sed '/^Starting/d
   66855 /^Entering/d
   66856 /^Stack/d
   66857 /^Reading/d
   66858 /^Reducing/d
   66859 /^Return/d
   66860 /^Shifting/d
   66861 /^state/d
   66862 /^Cleanup:/d
   66863 /^Error:/d
   66864 /^Next/d
   66865 /^Now/d
   66866 /^Discarding/d
   66867 / \$[0-9$]* = /d
   66868 /^yydestructor:/d' stderr >at-stderr
   66869 mv at-stderr stderr
   66870 # 2. Create the reference error message.
   66871 cat >expout <<'_ATEOF'
   66872 1.3: syntax error, unexpected number
   66873 _ATEOF
   66874 
   66875 # 3. If locations are not used, remove them.
   66876 sed 's/^[-0-9.]*: //' expout >at-expout
   66877 mv at-expout expout
   66878 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   66879 
   66880 # 5. Check
   66881 { set +x
   66882 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   66883 at_fn_check_prepare_trace "calc.at:605"
   66884 ( $at_check_trace; cat stderr
   66885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66886 at_status=$? at_failed=false
   66887 $at_check_filter
   66888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66889 $at_diff expout "$at_stdout" || at_failed=:
   66890 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66891 $at_failed && at_fn_log_failure
   66892 $at_traceon; }
   66893 
   66894 
   66895 cat >input <<'_ATEOF'
   66896 1//2
   66897 _ATEOF
   66898 
   66899 { set +x
   66900 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   66901 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   66902 ( $at_check_trace;  $PREPARSER ./calc input
   66903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66904 at_status=$? at_failed=false
   66905 $at_check_filter
   66906 echo stderr:; tee stderr <"$at_stderr"
   66907 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66908 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605"
   66909 $at_failed && at_fn_log_failure
   66910 $at_traceon; }
   66911 
   66912 { set +x
   66913 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66914 at_fn_check_prepare_trace "calc.at:605"
   66915 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66916 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66917 at_status=$? at_failed=false
   66918 $at_check_filter
   66919 echo stderr:; tee stderr <"$at_stderr"
   66920 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66921 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66922 $at_failed && at_fn_log_failure
   66923 $at_traceon; }
   66924 
   66925 
   66926 
   66927 # Normalize the observed and expected error messages, depending upon the
   66928 # options.
   66929 # 1. Remove the traces from observed.
   66930 sed '/^Starting/d
   66931 /^Entering/d
   66932 /^Stack/d
   66933 /^Reading/d
   66934 /^Reducing/d
   66935 /^Return/d
   66936 /^Shifting/d
   66937 /^state/d
   66938 /^Cleanup:/d
   66939 /^Error:/d
   66940 /^Next/d
   66941 /^Now/d
   66942 /^Discarding/d
   66943 / \$[0-9$]* = /d
   66944 /^yydestructor:/d' stderr >at-stderr
   66945 mv at-stderr stderr
   66946 # 2. Create the reference error message.
   66947 cat >expout <<'_ATEOF'
   66948 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   66949 _ATEOF
   66950 
   66951 # 3. If locations are not used, remove them.
   66952 sed 's/^[-0-9.]*: //' expout >at-expout
   66953 mv at-expout expout
   66954 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   66955 
   66956 # 5. Check
   66957 { set +x
   66958 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   66959 at_fn_check_prepare_trace "calc.at:605"
   66960 ( $at_check_trace; cat stderr
   66961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66962 at_status=$? at_failed=false
   66963 $at_check_filter
   66964 at_fn_diff_devnull "$at_stderr" || at_failed=:
   66965 $at_diff expout "$at_stdout" || at_failed=:
   66966 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66967 $at_failed && at_fn_log_failure
   66968 $at_traceon; }
   66969 
   66970 
   66971 cat >input <<'_ATEOF'
   66972 error
   66973 _ATEOF
   66974 
   66975 { set +x
   66976 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   66977 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   66978 ( $at_check_trace;  $PREPARSER ./calc input
   66979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66980 at_status=$? at_failed=false
   66981 $at_check_filter
   66982 echo stderr:; tee stderr <"$at_stderr"
   66983 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66984 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605"
   66985 $at_failed && at_fn_log_failure
   66986 $at_traceon; }
   66987 
   66988 { set +x
   66989 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   66990 at_fn_check_prepare_trace "calc.at:605"
   66991 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   66992 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   66993 at_status=$? at_failed=false
   66994 $at_check_filter
   66995 echo stderr:; tee stderr <"$at_stderr"
   66996 at_fn_diff_devnull "$at_stdout" || at_failed=:
   66997 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   66998 $at_failed && at_fn_log_failure
   66999 $at_traceon; }
   67000 
   67001 
   67002 
   67003 # Normalize the observed and expected error messages, depending upon the
   67004 # options.
   67005 # 1. Remove the traces from observed.
   67006 sed '/^Starting/d
   67007 /^Entering/d
   67008 /^Stack/d
   67009 /^Reading/d
   67010 /^Reducing/d
   67011 /^Return/d
   67012 /^Shifting/d
   67013 /^state/d
   67014 /^Cleanup:/d
   67015 /^Error:/d
   67016 /^Next/d
   67017 /^Now/d
   67018 /^Discarding/d
   67019 / \$[0-9$]* = /d
   67020 /^yydestructor:/d' stderr >at-stderr
   67021 mv at-stderr stderr
   67022 # 2. Create the reference error message.
   67023 cat >expout <<'_ATEOF'
   67024 1.1: syntax error, unexpected $undefined
   67025 _ATEOF
   67026 
   67027 # 3. If locations are not used, remove them.
   67028 sed 's/^[-0-9.]*: //' expout >at-expout
   67029 mv at-expout expout
   67030 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67031 
   67032 # 5. Check
   67033 { set +x
   67034 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67035 at_fn_check_prepare_trace "calc.at:605"
   67036 ( $at_check_trace; cat stderr
   67037 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67038 at_status=$? at_failed=false
   67039 $at_check_filter
   67040 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67041 $at_diff expout "$at_stdout" || at_failed=:
   67042 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67043 $at_failed && at_fn_log_failure
   67044 $at_traceon; }
   67045 
   67046 
   67047 cat >input <<'_ATEOF'
   67048 1 = 2 = 3
   67049 _ATEOF
   67050 
   67051 { set +x
   67052 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   67053 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   67054 ( $at_check_trace;  $PREPARSER ./calc input
   67055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67056 at_status=$? at_failed=false
   67057 $at_check_filter
   67058 echo stderr:; tee stderr <"$at_stderr"
   67059 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67060 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605"
   67061 $at_failed && at_fn_log_failure
   67062 $at_traceon; }
   67063 
   67064 { set +x
   67065 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67066 at_fn_check_prepare_trace "calc.at:605"
   67067 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67069 at_status=$? at_failed=false
   67070 $at_check_filter
   67071 echo stderr:; tee stderr <"$at_stderr"
   67072 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67073 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67074 $at_failed && at_fn_log_failure
   67075 $at_traceon; }
   67076 
   67077 
   67078 
   67079 # Normalize the observed and expected error messages, depending upon the
   67080 # options.
   67081 # 1. Remove the traces from observed.
   67082 sed '/^Starting/d
   67083 /^Entering/d
   67084 /^Stack/d
   67085 /^Reading/d
   67086 /^Reducing/d
   67087 /^Return/d
   67088 /^Shifting/d
   67089 /^state/d
   67090 /^Cleanup:/d
   67091 /^Error:/d
   67092 /^Next/d
   67093 /^Now/d
   67094 /^Discarding/d
   67095 / \$[0-9$]* = /d
   67096 /^yydestructor:/d' stderr >at-stderr
   67097 mv at-stderr stderr
   67098 # 2. Create the reference error message.
   67099 cat >expout <<'_ATEOF'
   67100 1.7: syntax error, unexpected '='
   67101 _ATEOF
   67102 
   67103 # 3. If locations are not used, remove them.
   67104 sed 's/^[-0-9.]*: //' expout >at-expout
   67105 mv at-expout expout
   67106 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67107 
   67108 # 5. Check
   67109 { set +x
   67110 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67111 at_fn_check_prepare_trace "calc.at:605"
   67112 ( $at_check_trace; cat stderr
   67113 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67114 at_status=$? at_failed=false
   67115 $at_check_filter
   67116 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67117 $at_diff expout "$at_stdout" || at_failed=:
   67118 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67119 $at_failed && at_fn_log_failure
   67120 $at_traceon; }
   67121 
   67122 
   67123 cat >input <<'_ATEOF'
   67124 
   67125 +1
   67126 _ATEOF
   67127 
   67128 { set +x
   67129 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   67130 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   67131 ( $at_check_trace;  $PREPARSER ./calc input
   67132 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67133 at_status=$? at_failed=false
   67134 $at_check_filter
   67135 echo stderr:; tee stderr <"$at_stderr"
   67136 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67137 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605"
   67138 $at_failed && at_fn_log_failure
   67139 $at_traceon; }
   67140 
   67141 { set +x
   67142 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67143 at_fn_check_prepare_trace "calc.at:605"
   67144 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67145 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67146 at_status=$? at_failed=false
   67147 $at_check_filter
   67148 echo stderr:; tee stderr <"$at_stderr"
   67149 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67150 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67151 $at_failed && at_fn_log_failure
   67152 $at_traceon; }
   67153 
   67154 
   67155 
   67156 # Normalize the observed and expected error messages, depending upon the
   67157 # options.
   67158 # 1. Remove the traces from observed.
   67159 sed '/^Starting/d
   67160 /^Entering/d
   67161 /^Stack/d
   67162 /^Reading/d
   67163 /^Reducing/d
   67164 /^Return/d
   67165 /^Shifting/d
   67166 /^state/d
   67167 /^Cleanup:/d
   67168 /^Error:/d
   67169 /^Next/d
   67170 /^Now/d
   67171 /^Discarding/d
   67172 / \$[0-9$]* = /d
   67173 /^yydestructor:/d' stderr >at-stderr
   67174 mv at-stderr stderr
   67175 # 2. Create the reference error message.
   67176 cat >expout <<'_ATEOF'
   67177 2.1: syntax error, unexpected '+'
   67178 _ATEOF
   67179 
   67180 # 3. If locations are not used, remove them.
   67181 sed 's/^[-0-9.]*: //' expout >at-expout
   67182 mv at-expout expout
   67183 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67184 
   67185 # 5. Check
   67186 { set +x
   67187 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67188 at_fn_check_prepare_trace "calc.at:605"
   67189 ( $at_check_trace; cat stderr
   67190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67191 at_status=$? at_failed=false
   67192 $at_check_filter
   67193 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67194 $at_diff expout "$at_stdout" || at_failed=:
   67195 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67196 $at_failed && at_fn_log_failure
   67197 $at_traceon; }
   67198 
   67199 
   67200 # Exercise error messages with EOF: work on an empty file.
   67201 { set +x
   67202 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc /dev/null"
   67203 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:605"
   67204 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   67205 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67206 at_status=$? at_failed=false
   67207 $at_check_filter
   67208 echo stderr:; tee stderr <"$at_stderr"
   67209 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67210 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605"
   67211 $at_failed && at_fn_log_failure
   67212 $at_traceon; }
   67213 
   67214 { set +x
   67215 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67216 at_fn_check_prepare_trace "calc.at:605"
   67217 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67218 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67219 at_status=$? at_failed=false
   67220 $at_check_filter
   67221 echo stderr:; tee stderr <"$at_stderr"
   67222 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67223 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67224 $at_failed && at_fn_log_failure
   67225 $at_traceon; }
   67226 
   67227 
   67228 
   67229 # Normalize the observed and expected error messages, depending upon the
   67230 # options.
   67231 # 1. Remove the traces from observed.
   67232 sed '/^Starting/d
   67233 /^Entering/d
   67234 /^Stack/d
   67235 /^Reading/d
   67236 /^Reducing/d
   67237 /^Return/d
   67238 /^Shifting/d
   67239 /^state/d
   67240 /^Cleanup:/d
   67241 /^Error:/d
   67242 /^Next/d
   67243 /^Now/d
   67244 /^Discarding/d
   67245 / \$[0-9$]* = /d
   67246 /^yydestructor:/d' stderr >at-stderr
   67247 mv at-stderr stderr
   67248 # 2. Create the reference error message.
   67249 cat >expout <<'_ATEOF'
   67250 1.1: syntax error, unexpected end of input
   67251 _ATEOF
   67252 
   67253 # 3. If locations are not used, remove them.
   67254 sed 's/^[-0-9.]*: //' expout >at-expout
   67255 mv at-expout expout
   67256 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67257 
   67258 # 5. Check
   67259 { set +x
   67260 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67261 at_fn_check_prepare_trace "calc.at:605"
   67262 ( $at_check_trace; cat stderr
   67263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67264 at_status=$? at_failed=false
   67265 $at_check_filter
   67266 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67267 $at_diff expout "$at_stdout" || at_failed=:
   67268 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67269 $at_failed && at_fn_log_failure
   67270 $at_traceon; }
   67271 
   67272 
   67273 
   67274 # Exercise the error token: without it, we die at the first error,
   67275 # hence be sure to
   67276 #
   67277 # - have several errors which exercise different shift/discardings
   67278 #   - (): nothing to pop, nothing to discard
   67279 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   67280 #   - (* * *): nothing to pop, a lot to discard
   67281 #   - (1 + 2 * *): some to pop and discard
   67282 #
   67283 # - test the action associated to `error'
   67284 #
   67285 # - check the lookahead that triggers an error is not discarded
   67286 #   when we enter error recovery.  Below, the lookahead causing the
   67287 #   first error is ")", which is needed to recover from the error and
   67288 #   produce the "0" that triggers the "0 != 1" error.
   67289 #
   67290 cat >input <<'_ATEOF'
   67291 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   67292 _ATEOF
   67293 
   67294 { set +x
   67295 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   67296 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   67297 ( $at_check_trace;  $PREPARSER ./calc input
   67298 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67299 at_status=$? at_failed=false
   67300 $at_check_filter
   67301 echo stderr:; tee stderr <"$at_stderr"
   67302 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67303 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67304 $at_failed && at_fn_log_failure
   67305 $at_traceon; }
   67306 
   67307 { set +x
   67308 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67309 at_fn_check_prepare_trace "calc.at:605"
   67310 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67312 at_status=$? at_failed=false
   67313 $at_check_filter
   67314 echo stderr:; tee stderr <"$at_stderr"
   67315 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67316 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67317 $at_failed && at_fn_log_failure
   67318 $at_traceon; }
   67319 
   67320 
   67321 
   67322 # Normalize the observed and expected error messages, depending upon the
   67323 # options.
   67324 # 1. Remove the traces from observed.
   67325 sed '/^Starting/d
   67326 /^Entering/d
   67327 /^Stack/d
   67328 /^Reading/d
   67329 /^Reducing/d
   67330 /^Return/d
   67331 /^Shifting/d
   67332 /^state/d
   67333 /^Cleanup:/d
   67334 /^Error:/d
   67335 /^Next/d
   67336 /^Now/d
   67337 /^Discarding/d
   67338 / \$[0-9$]* = /d
   67339 /^yydestructor:/d' stderr >at-stderr
   67340 mv at-stderr stderr
   67341 # 2. Create the reference error message.
   67342 cat >expout <<'_ATEOF'
   67343 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   67344 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   67345 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   67346 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   67347 calc: error: 4444 != 1
   67348 _ATEOF
   67349 
   67350 # 3. If locations are not used, remove them.
   67351 sed 's/^[-0-9.]*: //' expout >at-expout
   67352 mv at-expout expout
   67353 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67354 
   67355 # 5. Check
   67356 { set +x
   67357 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67358 at_fn_check_prepare_trace "calc.at:605"
   67359 ( $at_check_trace; cat stderr
   67360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67361 at_status=$? at_failed=false
   67362 $at_check_filter
   67363 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67364 $at_diff expout "$at_stdout" || at_failed=:
   67365 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67366 $at_failed && at_fn_log_failure
   67367 $at_traceon; }
   67368 
   67369 
   67370 
   67371 # The same, but this time exercising explicitly triggered syntax errors.
   67372 # POSIX says the lookahead causing the error should not be discarded.
   67373 cat >input <<'_ATEOF'
   67374 (!) + (1 2) = 1
   67375 _ATEOF
   67376 
   67377 { set +x
   67378 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   67379 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   67380 ( $at_check_trace;  $PREPARSER ./calc input
   67381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67382 at_status=$? at_failed=false
   67383 $at_check_filter
   67384 echo stderr:; tee stderr <"$at_stderr"
   67385 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67386 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67387 $at_failed && at_fn_log_failure
   67388 $at_traceon; }
   67389 
   67390 { set +x
   67391 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67392 at_fn_check_prepare_trace "calc.at:605"
   67393 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67395 at_status=$? at_failed=false
   67396 $at_check_filter
   67397 echo stderr:; tee stderr <"$at_stderr"
   67398 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67399 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67400 $at_failed && at_fn_log_failure
   67401 $at_traceon; }
   67402 
   67403 
   67404 
   67405 # Normalize the observed and expected error messages, depending upon the
   67406 # options.
   67407 # 1. Remove the traces from observed.
   67408 sed '/^Starting/d
   67409 /^Entering/d
   67410 /^Stack/d
   67411 /^Reading/d
   67412 /^Reducing/d
   67413 /^Return/d
   67414 /^Shifting/d
   67415 /^state/d
   67416 /^Cleanup:/d
   67417 /^Error:/d
   67418 /^Next/d
   67419 /^Now/d
   67420 /^Discarding/d
   67421 / \$[0-9$]* = /d
   67422 /^yydestructor:/d' stderr >at-stderr
   67423 mv at-stderr stderr
   67424 # 2. Create the reference error message.
   67425 cat >expout <<'_ATEOF'
   67426 1.10: syntax error, unexpected number
   67427 calc: error: 2222 != 1
   67428 _ATEOF
   67429 
   67430 # 3. If locations are not used, remove them.
   67431 sed 's/^[-0-9.]*: //' expout >at-expout
   67432 mv at-expout expout
   67433 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67434 
   67435 # 5. Check
   67436 { set +x
   67437 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67438 at_fn_check_prepare_trace "calc.at:605"
   67439 ( $at_check_trace; cat stderr
   67440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67441 at_status=$? at_failed=false
   67442 $at_check_filter
   67443 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67444 $at_diff expout "$at_stdout" || at_failed=:
   67445 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67446 $at_failed && at_fn_log_failure
   67447 $at_traceon; }
   67448 
   67449 
   67450 cat >input <<'_ATEOF'
   67451 (- *) + (1 2) = 1
   67452 _ATEOF
   67453 
   67454 { set +x
   67455 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   67456 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   67457 ( $at_check_trace;  $PREPARSER ./calc input
   67458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67459 at_status=$? at_failed=false
   67460 $at_check_filter
   67461 echo stderr:; tee stderr <"$at_stderr"
   67462 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67463 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67464 $at_failed && at_fn_log_failure
   67465 $at_traceon; }
   67466 
   67467 { set +x
   67468 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67469 at_fn_check_prepare_trace "calc.at:605"
   67470 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67472 at_status=$? at_failed=false
   67473 $at_check_filter
   67474 echo stderr:; tee stderr <"$at_stderr"
   67475 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67476 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67477 $at_failed && at_fn_log_failure
   67478 $at_traceon; }
   67479 
   67480 
   67481 
   67482 # Normalize the observed and expected error messages, depending upon the
   67483 # options.
   67484 # 1. Remove the traces from observed.
   67485 sed '/^Starting/d
   67486 /^Entering/d
   67487 /^Stack/d
   67488 /^Reading/d
   67489 /^Reducing/d
   67490 /^Return/d
   67491 /^Shifting/d
   67492 /^state/d
   67493 /^Cleanup:/d
   67494 /^Error:/d
   67495 /^Next/d
   67496 /^Now/d
   67497 /^Discarding/d
   67498 / \$[0-9$]* = /d
   67499 /^yydestructor:/d' stderr >at-stderr
   67500 mv at-stderr stderr
   67501 # 2. Create the reference error message.
   67502 cat >expout <<'_ATEOF'
   67503 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   67504 1.12: syntax error, unexpected number
   67505 calc: error: 2222 != 1
   67506 _ATEOF
   67507 
   67508 # 3. If locations are not used, remove them.
   67509 sed 's/^[-0-9.]*: //' expout >at-expout
   67510 mv at-expout expout
   67511 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67512 
   67513 # 5. Check
   67514 { set +x
   67515 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67516 at_fn_check_prepare_trace "calc.at:605"
   67517 ( $at_check_trace; cat stderr
   67518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67519 at_status=$? at_failed=false
   67520 $at_check_filter
   67521 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67522 $at_diff expout "$at_stdout" || at_failed=:
   67523 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67524 $at_failed && at_fn_log_failure
   67525 $at_traceon; }
   67526 
   67527 
   67528 
   67529 # Check that yyerrok works properly: second error is not reported,
   67530 # third and fourth are.  Parse status is succesfull.
   67531 cat >input <<'_ATEOF'
   67532 (* *) + (*) + (*)
   67533 _ATEOF
   67534 
   67535 { set +x
   67536 $as_echo "$at_srcdir/calc.at:605:  \$PREPARSER ./calc input"
   67537 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605"
   67538 ( $at_check_trace;  $PREPARSER ./calc input
   67539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67540 at_status=$? at_failed=false
   67541 $at_check_filter
   67542 echo stderr:; tee stderr <"$at_stderr"
   67543 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67544 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67545 $at_failed && at_fn_log_failure
   67546 $at_traceon; }
   67547 
   67548 { set +x
   67549 $as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   67550 at_fn_check_prepare_trace "calc.at:605"
   67551 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   67552 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67553 at_status=$? at_failed=false
   67554 $at_check_filter
   67555 echo stderr:; tee stderr <"$at_stderr"
   67556 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67557 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67558 $at_failed && at_fn_log_failure
   67559 $at_traceon; }
   67560 
   67561 
   67562 
   67563 # Normalize the observed and expected error messages, depending upon the
   67564 # options.
   67565 # 1. Remove the traces from observed.
   67566 sed '/^Starting/d
   67567 /^Entering/d
   67568 /^Stack/d
   67569 /^Reading/d
   67570 /^Reducing/d
   67571 /^Return/d
   67572 /^Shifting/d
   67573 /^state/d
   67574 /^Cleanup:/d
   67575 /^Error:/d
   67576 /^Next/d
   67577 /^Now/d
   67578 /^Discarding/d
   67579 / \$[0-9$]* = /d
   67580 /^yydestructor:/d' stderr >at-stderr
   67581 mv at-stderr stderr
   67582 # 2. Create the reference error message.
   67583 cat >expout <<'_ATEOF'
   67584 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   67585 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   67586 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   67587 _ATEOF
   67588 
   67589 # 3. If locations are not used, remove them.
   67590 sed 's/^[-0-9.]*: //' expout >at-expout
   67591 mv at-expout expout
   67592 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   67593 
   67594 # 5. Check
   67595 { set +x
   67596 $as_echo "$at_srcdir/calc.at:605: cat stderr"
   67597 at_fn_check_prepare_trace "calc.at:605"
   67598 ( $at_check_trace; cat stderr
   67599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67600 at_status=$? at_failed=false
   67601 $at_check_filter
   67602 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67603 $at_diff expout "$at_stdout" || at_failed=:
   67604 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605"
   67605 $at_failed && at_fn_log_failure
   67606 $at_traceon; }
   67607 
   67608 
   67609 
   67610 
   67611 
   67612   set +x
   67613   $at_times_p && times >"$at_times_file"
   67614 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   67615 read at_status <"$at_status_file"
   67616 #AT_STOP_206
   67617 #AT_START_207
   67618 at_fn_group_banner 207 'calc.at:607' \
   67619   "Calculator %define api.pure full %locations" "    " 11
   67620 at_xfail=no
   67621 (
   67622   $as_echo "207. $at_setup_line: testing $at_desc ..."
   67623   $at_traceon
   67624 
   67625 
   67626 
   67627 
   67628 
   67629 
   67630 
   67631 
   67632 
   67633 
   67634 cat >calc.y <<'_ATEOF'
   67635 %code top {
   67636 #include <config.h>
   67637 /* We don't need perfect functions for these tests. */
   67638 #undef malloc
   67639 #undef memcmp
   67640 #undef realloc
   67641 }
   67642 
   67643 /* Infix notation calculator--calc */
   67644 %define api.pure full %locations
   67645 
   67646 %code requires
   67647 {
   67648 
   67649   /* Exercise pre-prologue dependency to %union.  */
   67650   typedef int semantic_value;
   67651 }
   67652 
   67653 /* Exercise %union. */
   67654 %union
   67655 {
   67656   semantic_value ival;
   67657 };
   67658 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   67659 
   67660 %code provides
   67661 {
   67662   #include <stdio.h>
   67663   /* The input.  */
   67664   extern FILE *input;
   67665   extern semantic_value global_result;
   67666   extern int global_count;
   67667 }
   67668 
   67669 %code
   67670 {
   67671 #include <assert.h>
   67672 #include <string.h>
   67673 #define USE(Var)
   67674 
   67675 FILE *input;
   67676 static int power (int base, int exponent);
   67677 
   67678 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   67679 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   67680 }
   67681 
   67682 
   67683 
   67684 /* Bison Declarations */
   67685 %token CALC_EOF 0 "end of input"
   67686 %token <ival> NUM "number"
   67687 %type  <ival> exp
   67688 
   67689 %nonassoc '=' /* comparison            */
   67690 %left '-' '+'
   67691 %left '*' '/'
   67692 %left NEG     /* negation--unary minus */
   67693 %right '^'    /* exponentiation        */
   67694 
   67695 /* Grammar follows */
   67696 %%
   67697 input:
   67698   line
   67699 | input line         {  }
   67700 ;
   67701 
   67702 line:
   67703   '\n'
   67704 | exp '\n'           { USE ($1); }
   67705 ;
   67706 
   67707 exp:
   67708   NUM                { $$ = $1;             }
   67709 | exp '=' exp
   67710   {
   67711     if ($1 != $3)
   67712       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   67713     $$ = $1;
   67714   }
   67715 | exp '+' exp        { $$ = $1 + $3;        }
   67716 | exp '-' exp        { $$ = $1 - $3;        }
   67717 | exp '*' exp        { $$ = $1 * $3;        }
   67718 | exp '/' exp        { $$ = $1 / $3;        }
   67719 | '-' exp  %prec NEG { $$ = -$2;            }
   67720 | exp '^' exp        { $$ = power ($1, $3); }
   67721 | '(' exp ')'        { $$ = $2;             }
   67722 | '(' error ')'      { $$ = 1111; yyerrok;  }
   67723 | '!'                { $$ = 0; YYERROR;     }
   67724 | '-' error          { $$ = 0; YYERROR;     }
   67725 ;
   67726 %%
   67727 
   67728 static int
   67729 power (int base, int exponent)
   67730 {
   67731   int res = 1;
   67732   assert (0 <= exponent);
   67733   for (/* Niente */; exponent; --exponent)
   67734     res *= base;
   67735   return res;
   67736 }
   67737 
   67738 
   67739 #include <stdio.h>
   67740 /* A C error reporting function.  */
   67741 static
   67742 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   67743 {
   67744   YY_LOCATION_PRINT (stderr, (*llocp));
   67745   fprintf (stderr, ": ");
   67746   fprintf (stderr, "%s\n", msg);
   67747 }
   67748 #include <ctype.h>
   67749 
   67750 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   67751 static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
   67752 static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
   67753 
   67754 
   67755 static YYLTYPE last_yylloc;
   67756 
   67757 static int
   67758 get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
   67759 {
   67760   int res = getc (input);
   67761   (void) lvalp;(void) llocp;
   67762 
   67763   last_yylloc = (*llocp);
   67764   if (res == '\n')
   67765     {
   67766       (*llocp).last_line++;
   67767       (*llocp).last_column = 1;
   67768     }
   67769   else
   67770     (*llocp).last_column++;
   67771 
   67772   return res;
   67773 }
   67774 
   67775 static void
   67776 unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
   67777 {
   67778   (void) lvalp;(void) llocp;
   67779 
   67780   /* Wrong when C == `\n'. */
   67781   (*llocp) = last_yylloc;
   67782 
   67783   ungetc (c, input);
   67784 }
   67785 
   67786 static int
   67787 read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
   67788 {
   67789   int c = get_char (lvalp, llocp);
   67790   int sign = 1;
   67791   int n = 0;
   67792 
   67793   (void) lvalp;(void) llocp;
   67794   if (c == '-')
   67795     {
   67796       c = get_char (lvalp, llocp);
   67797       sign = -1;
   67798     }
   67799 
   67800   while (isdigit (c))
   67801     {
   67802       n = 10 * n + (c - '0');
   67803       c = get_char (lvalp, llocp);
   67804     }
   67805 
   67806   unget_char (lvalp, llocp,  c);
   67807 
   67808   return sign * n;
   67809 }
   67810 
   67811 
   67812 /*---------------------------------------------------------------.
   67813 | Lexical analyzer returns an integer on the stack and the token |
   67814 | NUM, or the ASCII character read if not a number.  Skips all   |
   67815 | blanks and tabs, returns 0 for EOF.                            |
   67816 `---------------------------------------------------------------*/
   67817 
   67818 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   67819 {
   67820   int c;
   67821   /* Skip current token, then white spaces.  */
   67822   do
   67823     {
   67824      (*llocp).first_column = (*llocp).last_column;
   67825       (*llocp).first_line   = (*llocp).last_line;
   67826 
   67827     }
   67828   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   67829 
   67830   /* process numbers   */
   67831   if (c == '.' || isdigit (c))
   67832     {
   67833       unget_char (lvalp, llocp,  c);
   67834       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   67835       return NUM;
   67836     }
   67837 
   67838   /* Return end-of-file.  */
   67839   if (c == EOF)
   67840     return CALC_EOF;
   67841 
   67842   /* Return single chars. */
   67843   return c;
   67844 }
   67845 
   67846 #include <assert.h>
   67847 #if HAVE_UNISTD_H
   67848 # include <unistd.h>
   67849 #else
   67850 # undef alarm
   67851 # define alarm(seconds) /* empty */
   67852 #endif
   67853 
   67854 
   67855 
   67856 semantic_value global_result = 0;
   67857 int global_count = 0;
   67858 
   67859 /* A C main function.  */
   67860 int
   67861 main (int argc, const char **argv)
   67862 {
   67863   semantic_value result = 0;
   67864   int count = 0;
   67865   int status;
   67866 
   67867   /* This used to be alarm (10), but that isn't enough time for
   67868      a July 1995 vintage DEC Alphastation 200 4/100 system,
   67869      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   67870   alarm (100);
   67871 
   67872   if (argc == 2)
   67873     input = fopen (argv[1], "r");
   67874   else
   67875     input = stdin;
   67876 
   67877   if (!input)
   67878     {
   67879       perror (argv[1]);
   67880       return 3;
   67881     }
   67882 
   67883 
   67884   status = yyparse ();
   67885   if (fclose (input))
   67886     perror ("fclose");
   67887   assert (global_result == result);
   67888   assert (global_count == count);
   67889   return status;
   67890 }
   67891 _ATEOF
   67892 
   67893 
   67894 
   67895 
   67896 
   67897 
   67898 
   67899 
   67900 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   67901   at_save_special_files
   67902   mkdir xml-tests
   67903     # Don't combine these Bison invocations since we want to be sure that
   67904   # --report=all isn't required to get the full XML file.
   67905   { set +x
   67906 $as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   67907                   --graph=xml-tests/test.dot -o calc.c calc.y"
   67908 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607"
   67909 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   67910                   --graph=xml-tests/test.dot -o calc.c calc.y
   67911 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67912 at_status=$? at_failed=false
   67913 $at_check_filter
   67914 echo stderr:; cat "$at_stderr"
   67915 echo stdout:; cat "$at_stdout"
   67916 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   67917 $at_failed && at_fn_log_failure
   67918 $at_traceon; }
   67919 
   67920   { set +x
   67921 $as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   67922 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:607"
   67923 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   67924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67925 at_status=$? at_failed=false
   67926 $at_check_filter
   67927 echo stderr:; cat "$at_stderr"
   67928 echo stdout:; cat "$at_stdout"
   67929 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   67930 $at_failed && at_fn_log_failure
   67931 $at_traceon; }
   67932 
   67933     cp xml-tests/test.output expout
   67934   { set +x
   67935 $as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\
   67936              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   67937              xml-tests/test.xml"
   67938 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607"
   67939 ( $at_check_trace; $XSLTPROC \
   67940              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   67941              xml-tests/test.xml
   67942 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67943 at_status=$? at_failed=false
   67944 $at_check_filter
   67945 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67946 $at_diff expout "$at_stdout" || at_failed=:
   67947 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   67948 $at_failed && at_fn_log_failure
   67949 $at_traceon; }
   67950 
   67951   sort xml-tests/test.dot > expout
   67952   { set +x
   67953 $as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\
   67954              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   67955              xml-tests/test.xml | sort"
   67956 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607"
   67957 ( $at_check_trace; $XSLTPROC \
   67958              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   67959              xml-tests/test.xml | sort
   67960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67961 at_status=$? at_failed=false
   67962 $at_check_filter
   67963 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67964 $at_diff expout "$at_stdout" || at_failed=:
   67965 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   67966 $at_failed && at_fn_log_failure
   67967 $at_traceon; }
   67968 
   67969   rm -rf xml-tests expout
   67970   at_restore_special_files
   67971 fi
   67972 { set +x
   67973 $as_echo "$at_srcdir/calc.at:607: bison -o calc.c calc.y"
   67974 at_fn_check_prepare_trace "calc.at:607"
   67975 ( $at_check_trace; bison -o calc.c calc.y
   67976 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67977 at_status=$? at_failed=false
   67978 $at_check_filter
   67979 at_fn_diff_devnull "$at_stderr" || at_failed=:
   67980 at_fn_diff_devnull "$at_stdout" || at_failed=:
   67981 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   67982 $at_failed && at_fn_log_failure
   67983 $at_traceon; }
   67984 
   67985 
   67986    { set +x
   67987 $as_echo "$at_srcdir/calc.at:607: \$BISON_C_WORKS"
   67988 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:607"
   67989 ( $at_check_trace; $BISON_C_WORKS
   67990 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   67991 at_status=$? at_failed=false
   67992 $at_check_filter
   67993 echo stderr:; cat "$at_stderr"
   67994 echo stdout:; cat "$at_stdout"
   67995 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   67996 $at_failed && at_fn_log_failure
   67997 $at_traceon; }
   67998 
   67999 { set +x
   68000 $as_echo "$at_srcdir/calc.at:607: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   68001 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:607"
   68002 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   68003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68004 at_status=$? at_failed=false
   68005 $at_check_filter
   68006 echo stderr:; cat "$at_stderr"
   68007 echo stdout:; cat "$at_stdout"
   68008 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68009 $at_failed && at_fn_log_failure
   68010 $at_traceon; }
   68011 
   68012 
   68013 { set +x
   68014 $as_echo "$at_srcdir/calc.at:607: \$PERL -ne '
   68015   chomp;
   68016   print \"\$.: {\$_}\\n\"
   68017     if (# No starting/ending empty lines.
   68018         (eof || \$. == 1) && /^\\s*\$/
   68019         # No trailing space.  FIXME: not ready for \"maint\".
   68020         # || /\\s\$/
   68021         )' calc.c
   68022 "
   68023 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607"
   68024 ( $at_check_trace; $PERL -ne '
   68025   chomp;
   68026   print "$.: {$_}\n"
   68027     if (# No starting/ending empty lines.
   68028         (eof || $. == 1) && /^\s*$/
   68029         # No trailing space.  FIXME: not ready for "maint".
   68030         # || /\s$/
   68031         )' calc.c
   68032 
   68033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68034 at_status=$? at_failed=false
   68035 $at_check_filter
   68036 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68037 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68038 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68039 $at_failed && at_fn_log_failure
   68040 $at_traceon; }
   68041 
   68042 
   68043 
   68044 # Test the priorities.
   68045 cat >input <<'_ATEOF'
   68046 1 + 2 * 3 = 7
   68047 1 + 2 * -3 = -5
   68048 
   68049 -1^2 = -1
   68050 (-1)^2 = 1
   68051 
   68052 ---1 = -1
   68053 
   68054 1 - 2 - 3 = -4
   68055 1 - (2 - 3) = 2
   68056 
   68057 2^2^3 = 256
   68058 (2^2)^3 = 64
   68059 _ATEOF
   68060 
   68061 { set +x
   68062 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68063 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68064 ( $at_check_trace;  $PREPARSER ./calc input
   68065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68066 at_status=$? at_failed=false
   68067 $at_check_filter
   68068 echo stderr:; tee stderr <"$at_stderr"
   68069 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68070 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68071 $at_failed && at_fn_log_failure
   68072 $at_traceon; }
   68073 
   68074 { set +x
   68075 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68076 at_fn_check_prepare_trace "calc.at:607"
   68077 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68079 at_status=$? at_failed=false
   68080 $at_check_filter
   68081 echo stderr:; tee stderr <"$at_stderr"
   68082 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68083 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68084 $at_failed && at_fn_log_failure
   68085 $at_traceon; }
   68086 
   68087 
   68088 
   68089 
   68090 # Some syntax errors.
   68091 cat >input <<'_ATEOF'
   68092 1 2
   68093 _ATEOF
   68094 
   68095 { set +x
   68096 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68097 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68098 ( $at_check_trace;  $PREPARSER ./calc input
   68099 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68100 at_status=$? at_failed=false
   68101 $at_check_filter
   68102 echo stderr:; tee stderr <"$at_stderr"
   68103 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68104 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
   68105 $at_failed && at_fn_log_failure
   68106 $at_traceon; }
   68107 
   68108 { set +x
   68109 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68110 at_fn_check_prepare_trace "calc.at:607"
   68111 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68113 at_status=$? at_failed=false
   68114 $at_check_filter
   68115 echo stderr:; tee stderr <"$at_stderr"
   68116 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68117 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68118 $at_failed && at_fn_log_failure
   68119 $at_traceon; }
   68120 
   68121 
   68122 
   68123 # Normalize the observed and expected error messages, depending upon the
   68124 # options.
   68125 # 1. Remove the traces from observed.
   68126 sed '/^Starting/d
   68127 /^Entering/d
   68128 /^Stack/d
   68129 /^Reading/d
   68130 /^Reducing/d
   68131 /^Return/d
   68132 /^Shifting/d
   68133 /^state/d
   68134 /^Cleanup:/d
   68135 /^Error:/d
   68136 /^Next/d
   68137 /^Now/d
   68138 /^Discarding/d
   68139 / \$[0-9$]* = /d
   68140 /^yydestructor:/d' stderr >at-stderr
   68141 mv at-stderr stderr
   68142 # 2. Create the reference error message.
   68143 cat >expout <<'_ATEOF'
   68144 1.3: syntax error, unexpected number
   68145 _ATEOF
   68146 
   68147 # 3. If locations are not used, remove them.
   68148 
   68149 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68150 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68151 mv at-expout expout
   68152 # 5. Check
   68153 { set +x
   68154 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68155 at_fn_check_prepare_trace "calc.at:607"
   68156 ( $at_check_trace; cat stderr
   68157 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68158 at_status=$? at_failed=false
   68159 $at_check_filter
   68160 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68161 $at_diff expout "$at_stdout" || at_failed=:
   68162 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68163 $at_failed && at_fn_log_failure
   68164 $at_traceon; }
   68165 
   68166 
   68167 cat >input <<'_ATEOF'
   68168 1//2
   68169 _ATEOF
   68170 
   68171 { set +x
   68172 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68173 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68174 ( $at_check_trace;  $PREPARSER ./calc input
   68175 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68176 at_status=$? at_failed=false
   68177 $at_check_filter
   68178 echo stderr:; tee stderr <"$at_stderr"
   68179 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68180 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
   68181 $at_failed && at_fn_log_failure
   68182 $at_traceon; }
   68183 
   68184 { set +x
   68185 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68186 at_fn_check_prepare_trace "calc.at:607"
   68187 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68188 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68189 at_status=$? at_failed=false
   68190 $at_check_filter
   68191 echo stderr:; tee stderr <"$at_stderr"
   68192 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68193 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68194 $at_failed && at_fn_log_failure
   68195 $at_traceon; }
   68196 
   68197 
   68198 
   68199 # Normalize the observed and expected error messages, depending upon the
   68200 # options.
   68201 # 1. Remove the traces from observed.
   68202 sed '/^Starting/d
   68203 /^Entering/d
   68204 /^Stack/d
   68205 /^Reading/d
   68206 /^Reducing/d
   68207 /^Return/d
   68208 /^Shifting/d
   68209 /^state/d
   68210 /^Cleanup:/d
   68211 /^Error:/d
   68212 /^Next/d
   68213 /^Now/d
   68214 /^Discarding/d
   68215 / \$[0-9$]* = /d
   68216 /^yydestructor:/d' stderr >at-stderr
   68217 mv at-stderr stderr
   68218 # 2. Create the reference error message.
   68219 cat >expout <<'_ATEOF'
   68220 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   68221 _ATEOF
   68222 
   68223 # 3. If locations are not used, remove them.
   68224 
   68225 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68226 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68227 mv at-expout expout
   68228 # 5. Check
   68229 { set +x
   68230 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68231 at_fn_check_prepare_trace "calc.at:607"
   68232 ( $at_check_trace; cat stderr
   68233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68234 at_status=$? at_failed=false
   68235 $at_check_filter
   68236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68237 $at_diff expout "$at_stdout" || at_failed=:
   68238 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68239 $at_failed && at_fn_log_failure
   68240 $at_traceon; }
   68241 
   68242 
   68243 cat >input <<'_ATEOF'
   68244 error
   68245 _ATEOF
   68246 
   68247 { set +x
   68248 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68249 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68250 ( $at_check_trace;  $PREPARSER ./calc input
   68251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68252 at_status=$? at_failed=false
   68253 $at_check_filter
   68254 echo stderr:; tee stderr <"$at_stderr"
   68255 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68256 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
   68257 $at_failed && at_fn_log_failure
   68258 $at_traceon; }
   68259 
   68260 { set +x
   68261 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68262 at_fn_check_prepare_trace "calc.at:607"
   68263 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68265 at_status=$? at_failed=false
   68266 $at_check_filter
   68267 echo stderr:; tee stderr <"$at_stderr"
   68268 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68269 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68270 $at_failed && at_fn_log_failure
   68271 $at_traceon; }
   68272 
   68273 
   68274 
   68275 # Normalize the observed and expected error messages, depending upon the
   68276 # options.
   68277 # 1. Remove the traces from observed.
   68278 sed '/^Starting/d
   68279 /^Entering/d
   68280 /^Stack/d
   68281 /^Reading/d
   68282 /^Reducing/d
   68283 /^Return/d
   68284 /^Shifting/d
   68285 /^state/d
   68286 /^Cleanup:/d
   68287 /^Error:/d
   68288 /^Next/d
   68289 /^Now/d
   68290 /^Discarding/d
   68291 / \$[0-9$]* = /d
   68292 /^yydestructor:/d' stderr >at-stderr
   68293 mv at-stderr stderr
   68294 # 2. Create the reference error message.
   68295 cat >expout <<'_ATEOF'
   68296 1.1: syntax error, unexpected $undefined
   68297 _ATEOF
   68298 
   68299 # 3. If locations are not used, remove them.
   68300 
   68301 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68302 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68303 mv at-expout expout
   68304 # 5. Check
   68305 { set +x
   68306 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68307 at_fn_check_prepare_trace "calc.at:607"
   68308 ( $at_check_trace; cat stderr
   68309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68310 at_status=$? at_failed=false
   68311 $at_check_filter
   68312 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68313 $at_diff expout "$at_stdout" || at_failed=:
   68314 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68315 $at_failed && at_fn_log_failure
   68316 $at_traceon; }
   68317 
   68318 
   68319 cat >input <<'_ATEOF'
   68320 1 = 2 = 3
   68321 _ATEOF
   68322 
   68323 { set +x
   68324 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68325 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68326 ( $at_check_trace;  $PREPARSER ./calc input
   68327 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68328 at_status=$? at_failed=false
   68329 $at_check_filter
   68330 echo stderr:; tee stderr <"$at_stderr"
   68331 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68332 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
   68333 $at_failed && at_fn_log_failure
   68334 $at_traceon; }
   68335 
   68336 { set +x
   68337 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68338 at_fn_check_prepare_trace "calc.at:607"
   68339 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68341 at_status=$? at_failed=false
   68342 $at_check_filter
   68343 echo stderr:; tee stderr <"$at_stderr"
   68344 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68345 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68346 $at_failed && at_fn_log_failure
   68347 $at_traceon; }
   68348 
   68349 
   68350 
   68351 # Normalize the observed and expected error messages, depending upon the
   68352 # options.
   68353 # 1. Remove the traces from observed.
   68354 sed '/^Starting/d
   68355 /^Entering/d
   68356 /^Stack/d
   68357 /^Reading/d
   68358 /^Reducing/d
   68359 /^Return/d
   68360 /^Shifting/d
   68361 /^state/d
   68362 /^Cleanup:/d
   68363 /^Error:/d
   68364 /^Next/d
   68365 /^Now/d
   68366 /^Discarding/d
   68367 / \$[0-9$]* = /d
   68368 /^yydestructor:/d' stderr >at-stderr
   68369 mv at-stderr stderr
   68370 # 2. Create the reference error message.
   68371 cat >expout <<'_ATEOF'
   68372 1.7: syntax error, unexpected '='
   68373 _ATEOF
   68374 
   68375 # 3. If locations are not used, remove them.
   68376 
   68377 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68378 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68379 mv at-expout expout
   68380 # 5. Check
   68381 { set +x
   68382 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68383 at_fn_check_prepare_trace "calc.at:607"
   68384 ( $at_check_trace; cat stderr
   68385 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68386 at_status=$? at_failed=false
   68387 $at_check_filter
   68388 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68389 $at_diff expout "$at_stdout" || at_failed=:
   68390 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68391 $at_failed && at_fn_log_failure
   68392 $at_traceon; }
   68393 
   68394 
   68395 cat >input <<'_ATEOF'
   68396 
   68397 +1
   68398 _ATEOF
   68399 
   68400 { set +x
   68401 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68402 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68403 ( $at_check_trace;  $PREPARSER ./calc input
   68404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68405 at_status=$? at_failed=false
   68406 $at_check_filter
   68407 echo stderr:; tee stderr <"$at_stderr"
   68408 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68409 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
   68410 $at_failed && at_fn_log_failure
   68411 $at_traceon; }
   68412 
   68413 { set +x
   68414 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68415 at_fn_check_prepare_trace "calc.at:607"
   68416 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68418 at_status=$? at_failed=false
   68419 $at_check_filter
   68420 echo stderr:; tee stderr <"$at_stderr"
   68421 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68422 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68423 $at_failed && at_fn_log_failure
   68424 $at_traceon; }
   68425 
   68426 
   68427 
   68428 # Normalize the observed and expected error messages, depending upon the
   68429 # options.
   68430 # 1. Remove the traces from observed.
   68431 sed '/^Starting/d
   68432 /^Entering/d
   68433 /^Stack/d
   68434 /^Reading/d
   68435 /^Reducing/d
   68436 /^Return/d
   68437 /^Shifting/d
   68438 /^state/d
   68439 /^Cleanup:/d
   68440 /^Error:/d
   68441 /^Next/d
   68442 /^Now/d
   68443 /^Discarding/d
   68444 / \$[0-9$]* = /d
   68445 /^yydestructor:/d' stderr >at-stderr
   68446 mv at-stderr stderr
   68447 # 2. Create the reference error message.
   68448 cat >expout <<'_ATEOF'
   68449 2.1: syntax error, unexpected '+'
   68450 _ATEOF
   68451 
   68452 # 3. If locations are not used, remove them.
   68453 
   68454 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68455 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68456 mv at-expout expout
   68457 # 5. Check
   68458 { set +x
   68459 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68460 at_fn_check_prepare_trace "calc.at:607"
   68461 ( $at_check_trace; cat stderr
   68462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68463 at_status=$? at_failed=false
   68464 $at_check_filter
   68465 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68466 $at_diff expout "$at_stdout" || at_failed=:
   68467 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68468 $at_failed && at_fn_log_failure
   68469 $at_traceon; }
   68470 
   68471 
   68472 # Exercise error messages with EOF: work on an empty file.
   68473 { set +x
   68474 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc /dev/null"
   68475 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:607"
   68476 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   68477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68478 at_status=$? at_failed=false
   68479 $at_check_filter
   68480 echo stderr:; tee stderr <"$at_stderr"
   68481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68482 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
   68483 $at_failed && at_fn_log_failure
   68484 $at_traceon; }
   68485 
   68486 { set +x
   68487 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68488 at_fn_check_prepare_trace "calc.at:607"
   68489 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68491 at_status=$? at_failed=false
   68492 $at_check_filter
   68493 echo stderr:; tee stderr <"$at_stderr"
   68494 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68495 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68496 $at_failed && at_fn_log_failure
   68497 $at_traceon; }
   68498 
   68499 
   68500 
   68501 # Normalize the observed and expected error messages, depending upon the
   68502 # options.
   68503 # 1. Remove the traces from observed.
   68504 sed '/^Starting/d
   68505 /^Entering/d
   68506 /^Stack/d
   68507 /^Reading/d
   68508 /^Reducing/d
   68509 /^Return/d
   68510 /^Shifting/d
   68511 /^state/d
   68512 /^Cleanup:/d
   68513 /^Error:/d
   68514 /^Next/d
   68515 /^Now/d
   68516 /^Discarding/d
   68517 / \$[0-9$]* = /d
   68518 /^yydestructor:/d' stderr >at-stderr
   68519 mv at-stderr stderr
   68520 # 2. Create the reference error message.
   68521 cat >expout <<'_ATEOF'
   68522 1.1: syntax error, unexpected end of input
   68523 _ATEOF
   68524 
   68525 # 3. If locations are not used, remove them.
   68526 
   68527 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68528 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68529 mv at-expout expout
   68530 # 5. Check
   68531 { set +x
   68532 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68533 at_fn_check_prepare_trace "calc.at:607"
   68534 ( $at_check_trace; cat stderr
   68535 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68536 at_status=$? at_failed=false
   68537 $at_check_filter
   68538 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68539 $at_diff expout "$at_stdout" || at_failed=:
   68540 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68541 $at_failed && at_fn_log_failure
   68542 $at_traceon; }
   68543 
   68544 
   68545 
   68546 # Exercise the error token: without it, we die at the first error,
   68547 # hence be sure to
   68548 #
   68549 # - have several errors which exercise different shift/discardings
   68550 #   - (): nothing to pop, nothing to discard
   68551 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   68552 #   - (* * *): nothing to pop, a lot to discard
   68553 #   - (1 + 2 * *): some to pop and discard
   68554 #
   68555 # - test the action associated to `error'
   68556 #
   68557 # - check the lookahead that triggers an error is not discarded
   68558 #   when we enter error recovery.  Below, the lookahead causing the
   68559 #   first error is ")", which is needed to recover from the error and
   68560 #   produce the "0" that triggers the "0 != 1" error.
   68561 #
   68562 cat >input <<'_ATEOF'
   68563 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   68564 _ATEOF
   68565 
   68566 { set +x
   68567 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68568 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68569 ( $at_check_trace;  $PREPARSER ./calc input
   68570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68571 at_status=$? at_failed=false
   68572 $at_check_filter
   68573 echo stderr:; tee stderr <"$at_stderr"
   68574 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68575 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68576 $at_failed && at_fn_log_failure
   68577 $at_traceon; }
   68578 
   68579 { set +x
   68580 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68581 at_fn_check_prepare_trace "calc.at:607"
   68582 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68584 at_status=$? at_failed=false
   68585 $at_check_filter
   68586 echo stderr:; tee stderr <"$at_stderr"
   68587 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68588 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68589 $at_failed && at_fn_log_failure
   68590 $at_traceon; }
   68591 
   68592 
   68593 
   68594 # Normalize the observed and expected error messages, depending upon the
   68595 # options.
   68596 # 1. Remove the traces from observed.
   68597 sed '/^Starting/d
   68598 /^Entering/d
   68599 /^Stack/d
   68600 /^Reading/d
   68601 /^Reducing/d
   68602 /^Return/d
   68603 /^Shifting/d
   68604 /^state/d
   68605 /^Cleanup:/d
   68606 /^Error:/d
   68607 /^Next/d
   68608 /^Now/d
   68609 /^Discarding/d
   68610 / \$[0-9$]* = /d
   68611 /^yydestructor:/d' stderr >at-stderr
   68612 mv at-stderr stderr
   68613 # 2. Create the reference error message.
   68614 cat >expout <<'_ATEOF'
   68615 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   68616 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   68617 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   68618 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   68619 calc: error: 4444 != 1
   68620 _ATEOF
   68621 
   68622 # 3. If locations are not used, remove them.
   68623 
   68624 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68625 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68626 mv at-expout expout
   68627 # 5. Check
   68628 { set +x
   68629 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68630 at_fn_check_prepare_trace "calc.at:607"
   68631 ( $at_check_trace; cat stderr
   68632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68633 at_status=$? at_failed=false
   68634 $at_check_filter
   68635 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68636 $at_diff expout "$at_stdout" || at_failed=:
   68637 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68638 $at_failed && at_fn_log_failure
   68639 $at_traceon; }
   68640 
   68641 
   68642 
   68643 # The same, but this time exercising explicitly triggered syntax errors.
   68644 # POSIX says the lookahead causing the error should not be discarded.
   68645 cat >input <<'_ATEOF'
   68646 (!) + (1 2) = 1
   68647 _ATEOF
   68648 
   68649 { set +x
   68650 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68651 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68652 ( $at_check_trace;  $PREPARSER ./calc input
   68653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68654 at_status=$? at_failed=false
   68655 $at_check_filter
   68656 echo stderr:; tee stderr <"$at_stderr"
   68657 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68658 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68659 $at_failed && at_fn_log_failure
   68660 $at_traceon; }
   68661 
   68662 { set +x
   68663 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68664 at_fn_check_prepare_trace "calc.at:607"
   68665 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68666 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68667 at_status=$? at_failed=false
   68668 $at_check_filter
   68669 echo stderr:; tee stderr <"$at_stderr"
   68670 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68671 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68672 $at_failed && at_fn_log_failure
   68673 $at_traceon; }
   68674 
   68675 
   68676 
   68677 # Normalize the observed and expected error messages, depending upon the
   68678 # options.
   68679 # 1. Remove the traces from observed.
   68680 sed '/^Starting/d
   68681 /^Entering/d
   68682 /^Stack/d
   68683 /^Reading/d
   68684 /^Reducing/d
   68685 /^Return/d
   68686 /^Shifting/d
   68687 /^state/d
   68688 /^Cleanup:/d
   68689 /^Error:/d
   68690 /^Next/d
   68691 /^Now/d
   68692 /^Discarding/d
   68693 / \$[0-9$]* = /d
   68694 /^yydestructor:/d' stderr >at-stderr
   68695 mv at-stderr stderr
   68696 # 2. Create the reference error message.
   68697 cat >expout <<'_ATEOF'
   68698 1.10: syntax error, unexpected number
   68699 calc: error: 2222 != 1
   68700 _ATEOF
   68701 
   68702 # 3. If locations are not used, remove them.
   68703 
   68704 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68705 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68706 mv at-expout expout
   68707 # 5. Check
   68708 { set +x
   68709 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68710 at_fn_check_prepare_trace "calc.at:607"
   68711 ( $at_check_trace; cat stderr
   68712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68713 at_status=$? at_failed=false
   68714 $at_check_filter
   68715 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68716 $at_diff expout "$at_stdout" || at_failed=:
   68717 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68718 $at_failed && at_fn_log_failure
   68719 $at_traceon; }
   68720 
   68721 
   68722 cat >input <<'_ATEOF'
   68723 (- *) + (1 2) = 1
   68724 _ATEOF
   68725 
   68726 { set +x
   68727 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68728 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68729 ( $at_check_trace;  $PREPARSER ./calc input
   68730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68731 at_status=$? at_failed=false
   68732 $at_check_filter
   68733 echo stderr:; tee stderr <"$at_stderr"
   68734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68735 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68736 $at_failed && at_fn_log_failure
   68737 $at_traceon; }
   68738 
   68739 { set +x
   68740 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68741 at_fn_check_prepare_trace "calc.at:607"
   68742 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68744 at_status=$? at_failed=false
   68745 $at_check_filter
   68746 echo stderr:; tee stderr <"$at_stderr"
   68747 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68748 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68749 $at_failed && at_fn_log_failure
   68750 $at_traceon; }
   68751 
   68752 
   68753 
   68754 # Normalize the observed and expected error messages, depending upon the
   68755 # options.
   68756 # 1. Remove the traces from observed.
   68757 sed '/^Starting/d
   68758 /^Entering/d
   68759 /^Stack/d
   68760 /^Reading/d
   68761 /^Reducing/d
   68762 /^Return/d
   68763 /^Shifting/d
   68764 /^state/d
   68765 /^Cleanup:/d
   68766 /^Error:/d
   68767 /^Next/d
   68768 /^Now/d
   68769 /^Discarding/d
   68770 / \$[0-9$]* = /d
   68771 /^yydestructor:/d' stderr >at-stderr
   68772 mv at-stderr stderr
   68773 # 2. Create the reference error message.
   68774 cat >expout <<'_ATEOF'
   68775 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   68776 1.12: syntax error, unexpected number
   68777 calc: error: 2222 != 1
   68778 _ATEOF
   68779 
   68780 # 3. If locations are not used, remove them.
   68781 
   68782 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68783 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68784 mv at-expout expout
   68785 # 5. Check
   68786 { set +x
   68787 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68788 at_fn_check_prepare_trace "calc.at:607"
   68789 ( $at_check_trace; cat stderr
   68790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68791 at_status=$? at_failed=false
   68792 $at_check_filter
   68793 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68794 $at_diff expout "$at_stdout" || at_failed=:
   68795 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68796 $at_failed && at_fn_log_failure
   68797 $at_traceon; }
   68798 
   68799 
   68800 
   68801 # Check that yyerrok works properly: second error is not reported,
   68802 # third and fourth are.  Parse status is succesfull.
   68803 cat >input <<'_ATEOF'
   68804 (* *) + (*) + (*)
   68805 _ATEOF
   68806 
   68807 { set +x
   68808 $as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
   68809 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
   68810 ( $at_check_trace;  $PREPARSER ./calc input
   68811 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68812 at_status=$? at_failed=false
   68813 $at_check_filter
   68814 echo stderr:; tee stderr <"$at_stderr"
   68815 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68816 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68817 $at_failed && at_fn_log_failure
   68818 $at_traceon; }
   68819 
   68820 { set +x
   68821 $as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   68822 at_fn_check_prepare_trace "calc.at:607"
   68823 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   68824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68825 at_status=$? at_failed=false
   68826 $at_check_filter
   68827 echo stderr:; tee stderr <"$at_stderr"
   68828 at_fn_diff_devnull "$at_stdout" || at_failed=:
   68829 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68830 $at_failed && at_fn_log_failure
   68831 $at_traceon; }
   68832 
   68833 
   68834 
   68835 # Normalize the observed and expected error messages, depending upon the
   68836 # options.
   68837 # 1. Remove the traces from observed.
   68838 sed '/^Starting/d
   68839 /^Entering/d
   68840 /^Stack/d
   68841 /^Reading/d
   68842 /^Reducing/d
   68843 /^Return/d
   68844 /^Shifting/d
   68845 /^state/d
   68846 /^Cleanup:/d
   68847 /^Error:/d
   68848 /^Next/d
   68849 /^Now/d
   68850 /^Discarding/d
   68851 / \$[0-9$]* = /d
   68852 /^yydestructor:/d' stderr >at-stderr
   68853 mv at-stderr stderr
   68854 # 2. Create the reference error message.
   68855 cat >expout <<'_ATEOF'
   68856 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   68857 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   68858 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   68859 _ATEOF
   68860 
   68861 # 3. If locations are not used, remove them.
   68862 
   68863 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   68864 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   68865 mv at-expout expout
   68866 # 5. Check
   68867 { set +x
   68868 $as_echo "$at_srcdir/calc.at:607: cat stderr"
   68869 at_fn_check_prepare_trace "calc.at:607"
   68870 ( $at_check_trace; cat stderr
   68871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   68872 at_status=$? at_failed=false
   68873 $at_check_filter
   68874 at_fn_diff_devnull "$at_stderr" || at_failed=:
   68875 $at_diff expout "$at_stdout" || at_failed=:
   68876 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
   68877 $at_failed && at_fn_log_failure
   68878 $at_traceon; }
   68879 
   68880 
   68881 
   68882 
   68883 
   68884   set +x
   68885   $at_times_p && times >"$at_times_file"
   68886 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   68887 read at_status <"$at_status_file"
   68888 #AT_STOP_207
   68889 #AT_START_208
   68890 at_fn_group_banner 208 'calc.at:608' \
   68891   "Calculator %define api.push-pull both %define api.pure full %locations" "" 11
   68892 at_xfail=no
   68893 (
   68894   $as_echo "208. $at_setup_line: testing $at_desc ..."
   68895   $at_traceon
   68896 
   68897 
   68898 
   68899 
   68900 
   68901 
   68902 
   68903 
   68904 
   68905 
   68906 cat >calc.y <<'_ATEOF'
   68907 %code top {
   68908 #include <config.h>
   68909 /* We don't need perfect functions for these tests. */
   68910 #undef malloc
   68911 #undef memcmp
   68912 #undef realloc
   68913 }
   68914 
   68915 /* Infix notation calculator--calc */
   68916 %define api.push-pull both %define api.pure full %locations
   68917 
   68918 %code requires
   68919 {
   68920 
   68921   /* Exercise pre-prologue dependency to %union.  */
   68922   typedef int semantic_value;
   68923 }
   68924 
   68925 /* Exercise %union. */
   68926 %union
   68927 {
   68928   semantic_value ival;
   68929 };
   68930 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   68931 
   68932 %code provides
   68933 {
   68934   #include <stdio.h>
   68935   /* The input.  */
   68936   extern FILE *input;
   68937   extern semantic_value global_result;
   68938   extern int global_count;
   68939 }
   68940 
   68941 %code
   68942 {
   68943 #include <assert.h>
   68944 #include <string.h>
   68945 #define USE(Var)
   68946 
   68947 FILE *input;
   68948 static int power (int base, int exponent);
   68949 
   68950 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   68951 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   68952 }
   68953 
   68954 
   68955 
   68956 /* Bison Declarations */
   68957 %token CALC_EOF 0 "end of input"
   68958 %token <ival> NUM "number"
   68959 %type  <ival> exp
   68960 
   68961 %nonassoc '=' /* comparison            */
   68962 %left '-' '+'
   68963 %left '*' '/'
   68964 %left NEG     /* negation--unary minus */
   68965 %right '^'    /* exponentiation        */
   68966 
   68967 /* Grammar follows */
   68968 %%
   68969 input:
   68970   line
   68971 | input line         {  }
   68972 ;
   68973 
   68974 line:
   68975   '\n'
   68976 | exp '\n'           { USE ($1); }
   68977 ;
   68978 
   68979 exp:
   68980   NUM                { $$ = $1;             }
   68981 | exp '=' exp
   68982   {
   68983     if ($1 != $3)
   68984       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   68985     $$ = $1;
   68986   }
   68987 | exp '+' exp        { $$ = $1 + $3;        }
   68988 | exp '-' exp        { $$ = $1 - $3;        }
   68989 | exp '*' exp        { $$ = $1 * $3;        }
   68990 | exp '/' exp        { $$ = $1 / $3;        }
   68991 | '-' exp  %prec NEG { $$ = -$2;            }
   68992 | exp '^' exp        { $$ = power ($1, $3); }
   68993 | '(' exp ')'        { $$ = $2;             }
   68994 | '(' error ')'      { $$ = 1111; yyerrok;  }
   68995 | '!'                { $$ = 0; YYERROR;     }
   68996 | '-' error          { $$ = 0; YYERROR;     }
   68997 ;
   68998 %%
   68999 
   69000 static int
   69001 power (int base, int exponent)
   69002 {
   69003   int res = 1;
   69004   assert (0 <= exponent);
   69005   for (/* Niente */; exponent; --exponent)
   69006     res *= base;
   69007   return res;
   69008 }
   69009 
   69010 
   69011 #include <stdio.h>
   69012 /* A C error reporting function.  */
   69013 static
   69014 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   69015 {
   69016   YY_LOCATION_PRINT (stderr, (*llocp));
   69017   fprintf (stderr, ": ");
   69018   fprintf (stderr, "%s\n", msg);
   69019 }
   69020 #include <ctype.h>
   69021 
   69022 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   69023 static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
   69024 static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
   69025 
   69026 
   69027 static YYLTYPE last_yylloc;
   69028 
   69029 static int
   69030 get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
   69031 {
   69032   int res = getc (input);
   69033   (void) lvalp;(void) llocp;
   69034 
   69035   last_yylloc = (*llocp);
   69036   if (res == '\n')
   69037     {
   69038       (*llocp).last_line++;
   69039       (*llocp).last_column = 1;
   69040     }
   69041   else
   69042     (*llocp).last_column++;
   69043 
   69044   return res;
   69045 }
   69046 
   69047 static void
   69048 unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
   69049 {
   69050   (void) lvalp;(void) llocp;
   69051 
   69052   /* Wrong when C == `\n'. */
   69053   (*llocp) = last_yylloc;
   69054 
   69055   ungetc (c, input);
   69056 }
   69057 
   69058 static int
   69059 read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
   69060 {
   69061   int c = get_char (lvalp, llocp);
   69062   int sign = 1;
   69063   int n = 0;
   69064 
   69065   (void) lvalp;(void) llocp;
   69066   if (c == '-')
   69067     {
   69068       c = get_char (lvalp, llocp);
   69069       sign = -1;
   69070     }
   69071 
   69072   while (isdigit (c))
   69073     {
   69074       n = 10 * n + (c - '0');
   69075       c = get_char (lvalp, llocp);
   69076     }
   69077 
   69078   unget_char (lvalp, llocp,  c);
   69079 
   69080   return sign * n;
   69081 }
   69082 
   69083 
   69084 /*---------------------------------------------------------------.
   69085 | Lexical analyzer returns an integer on the stack and the token |
   69086 | NUM, or the ASCII character read if not a number.  Skips all   |
   69087 | blanks and tabs, returns 0 for EOF.                            |
   69088 `---------------------------------------------------------------*/
   69089 
   69090 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   69091 {
   69092   int c;
   69093   /* Skip current token, then white spaces.  */
   69094   do
   69095     {
   69096      (*llocp).first_column = (*llocp).last_column;
   69097       (*llocp).first_line   = (*llocp).last_line;
   69098 
   69099     }
   69100   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   69101 
   69102   /* process numbers   */
   69103   if (c == '.' || isdigit (c))
   69104     {
   69105       unget_char (lvalp, llocp,  c);
   69106       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   69107       return NUM;
   69108     }
   69109 
   69110   /* Return end-of-file.  */
   69111   if (c == EOF)
   69112     return CALC_EOF;
   69113 
   69114   /* Return single chars. */
   69115   return c;
   69116 }
   69117 
   69118 #include <assert.h>
   69119 #if HAVE_UNISTD_H
   69120 # include <unistd.h>
   69121 #else
   69122 # undef alarm
   69123 # define alarm(seconds) /* empty */
   69124 #endif
   69125 
   69126 
   69127 
   69128 semantic_value global_result = 0;
   69129 int global_count = 0;
   69130 
   69131 /* A C main function.  */
   69132 int
   69133 main (int argc, const char **argv)
   69134 {
   69135   semantic_value result = 0;
   69136   int count = 0;
   69137   int status;
   69138 
   69139   /* This used to be alarm (10), but that isn't enough time for
   69140      a July 1995 vintage DEC Alphastation 200 4/100 system,
   69141      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   69142   alarm (100);
   69143 
   69144   if (argc == 2)
   69145     input = fopen (argv[1], "r");
   69146   else
   69147     input = stdin;
   69148 
   69149   if (!input)
   69150     {
   69151       perror (argv[1]);
   69152       return 3;
   69153     }
   69154 
   69155 
   69156   status = yyparse ();
   69157   if (fclose (input))
   69158     perror ("fclose");
   69159   assert (global_result == result);
   69160   assert (global_count == count);
   69161   return status;
   69162 }
   69163 _ATEOF
   69164 
   69165 
   69166 
   69167 
   69168 
   69169 
   69170 
   69171 
   69172 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   69173   at_save_special_files
   69174   mkdir xml-tests
   69175     # Don't combine these Bison invocations since we want to be sure that
   69176   # --report=all isn't required to get the full XML file.
   69177   { set +x
   69178 $as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   69179                   --graph=xml-tests/test.dot -o calc.c calc.y"
   69180 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608"
   69181 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   69182                   --graph=xml-tests/test.dot -o calc.c calc.y
   69183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69184 at_status=$? at_failed=false
   69185 $at_check_filter
   69186 echo stderr:; cat "$at_stderr"
   69187 echo stdout:; cat "$at_stdout"
   69188 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69189 $at_failed && at_fn_log_failure
   69190 $at_traceon; }
   69191 
   69192   { set +x
   69193 $as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   69194 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:608"
   69195 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   69196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69197 at_status=$? at_failed=false
   69198 $at_check_filter
   69199 echo stderr:; cat "$at_stderr"
   69200 echo stdout:; cat "$at_stdout"
   69201 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69202 $at_failed && at_fn_log_failure
   69203 $at_traceon; }
   69204 
   69205     cp xml-tests/test.output expout
   69206   { set +x
   69207 $as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\
   69208              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   69209              xml-tests/test.xml"
   69210 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608"
   69211 ( $at_check_trace; $XSLTPROC \
   69212              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   69213              xml-tests/test.xml
   69214 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69215 at_status=$? at_failed=false
   69216 $at_check_filter
   69217 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69218 $at_diff expout "$at_stdout" || at_failed=:
   69219 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69220 $at_failed && at_fn_log_failure
   69221 $at_traceon; }
   69222 
   69223   sort xml-tests/test.dot > expout
   69224   { set +x
   69225 $as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\
   69226              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   69227              xml-tests/test.xml | sort"
   69228 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608"
   69229 ( $at_check_trace; $XSLTPROC \
   69230              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   69231              xml-tests/test.xml | sort
   69232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69233 at_status=$? at_failed=false
   69234 $at_check_filter
   69235 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69236 $at_diff expout "$at_stdout" || at_failed=:
   69237 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69238 $at_failed && at_fn_log_failure
   69239 $at_traceon; }
   69240 
   69241   rm -rf xml-tests expout
   69242   at_restore_special_files
   69243 fi
   69244 { set +x
   69245 $as_echo "$at_srcdir/calc.at:608: bison -o calc.c calc.y"
   69246 at_fn_check_prepare_trace "calc.at:608"
   69247 ( $at_check_trace; bison -o calc.c calc.y
   69248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69249 at_status=$? at_failed=false
   69250 $at_check_filter
   69251 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69252 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69253 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69254 $at_failed && at_fn_log_failure
   69255 $at_traceon; }
   69256 
   69257 
   69258    { set +x
   69259 $as_echo "$at_srcdir/calc.at:608: \$BISON_C_WORKS"
   69260 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:608"
   69261 ( $at_check_trace; $BISON_C_WORKS
   69262 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69263 at_status=$? at_failed=false
   69264 $at_check_filter
   69265 echo stderr:; cat "$at_stderr"
   69266 echo stdout:; cat "$at_stdout"
   69267 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69268 $at_failed && at_fn_log_failure
   69269 $at_traceon; }
   69270 
   69271 { set +x
   69272 $as_echo "$at_srcdir/calc.at:608: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   69273 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:608"
   69274 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   69275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69276 at_status=$? at_failed=false
   69277 $at_check_filter
   69278 echo stderr:; cat "$at_stderr"
   69279 echo stdout:; cat "$at_stdout"
   69280 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69281 $at_failed && at_fn_log_failure
   69282 $at_traceon; }
   69283 
   69284 
   69285 { set +x
   69286 $as_echo "$at_srcdir/calc.at:608: \$PERL -ne '
   69287   chomp;
   69288   print \"\$.: {\$_}\\n\"
   69289     if (# No starting/ending empty lines.
   69290         (eof || \$. == 1) && /^\\s*\$/
   69291         # No trailing space.  FIXME: not ready for \"maint\".
   69292         # || /\\s\$/
   69293         )' calc.c
   69294 "
   69295 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608"
   69296 ( $at_check_trace; $PERL -ne '
   69297   chomp;
   69298   print "$.: {$_}\n"
   69299     if (# No starting/ending empty lines.
   69300         (eof || $. == 1) && /^\s*$/
   69301         # No trailing space.  FIXME: not ready for "maint".
   69302         # || /\s$/
   69303         )' calc.c
   69304 
   69305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69306 at_status=$? at_failed=false
   69307 $at_check_filter
   69308 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69309 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69310 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69311 $at_failed && at_fn_log_failure
   69312 $at_traceon; }
   69313 
   69314 
   69315 
   69316 # Test the priorities.
   69317 cat >input <<'_ATEOF'
   69318 1 + 2 * 3 = 7
   69319 1 + 2 * -3 = -5
   69320 
   69321 -1^2 = -1
   69322 (-1)^2 = 1
   69323 
   69324 ---1 = -1
   69325 
   69326 1 - 2 - 3 = -4
   69327 1 - (2 - 3) = 2
   69328 
   69329 2^2^3 = 256
   69330 (2^2)^3 = 64
   69331 _ATEOF
   69332 
   69333 { set +x
   69334 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69335 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69336 ( $at_check_trace;  $PREPARSER ./calc input
   69337 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69338 at_status=$? at_failed=false
   69339 $at_check_filter
   69340 echo stderr:; tee stderr <"$at_stderr"
   69341 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69342 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69343 $at_failed && at_fn_log_failure
   69344 $at_traceon; }
   69345 
   69346 { set +x
   69347 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69348 at_fn_check_prepare_trace "calc.at:608"
   69349 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69351 at_status=$? at_failed=false
   69352 $at_check_filter
   69353 echo stderr:; tee stderr <"$at_stderr"
   69354 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69355 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69356 $at_failed && at_fn_log_failure
   69357 $at_traceon; }
   69358 
   69359 
   69360 
   69361 
   69362 # Some syntax errors.
   69363 cat >input <<'_ATEOF'
   69364 1 2
   69365 _ATEOF
   69366 
   69367 { set +x
   69368 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69369 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69370 ( $at_check_trace;  $PREPARSER ./calc input
   69371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69372 at_status=$? at_failed=false
   69373 $at_check_filter
   69374 echo stderr:; tee stderr <"$at_stderr"
   69375 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69376 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
   69377 $at_failed && at_fn_log_failure
   69378 $at_traceon; }
   69379 
   69380 { set +x
   69381 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69382 at_fn_check_prepare_trace "calc.at:608"
   69383 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69385 at_status=$? at_failed=false
   69386 $at_check_filter
   69387 echo stderr:; tee stderr <"$at_stderr"
   69388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69389 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69390 $at_failed && at_fn_log_failure
   69391 $at_traceon; }
   69392 
   69393 
   69394 
   69395 # Normalize the observed and expected error messages, depending upon the
   69396 # options.
   69397 # 1. Remove the traces from observed.
   69398 sed '/^Starting/d
   69399 /^Entering/d
   69400 /^Stack/d
   69401 /^Reading/d
   69402 /^Reducing/d
   69403 /^Return/d
   69404 /^Shifting/d
   69405 /^state/d
   69406 /^Cleanup:/d
   69407 /^Error:/d
   69408 /^Next/d
   69409 /^Now/d
   69410 /^Discarding/d
   69411 / \$[0-9$]* = /d
   69412 /^yydestructor:/d' stderr >at-stderr
   69413 mv at-stderr stderr
   69414 # 2. Create the reference error message.
   69415 cat >expout <<'_ATEOF'
   69416 1.3: syntax error, unexpected number
   69417 _ATEOF
   69418 
   69419 # 3. If locations are not used, remove them.
   69420 
   69421 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69422 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69423 mv at-expout expout
   69424 # 5. Check
   69425 { set +x
   69426 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69427 at_fn_check_prepare_trace "calc.at:608"
   69428 ( $at_check_trace; cat stderr
   69429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69430 at_status=$? at_failed=false
   69431 $at_check_filter
   69432 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69433 $at_diff expout "$at_stdout" || at_failed=:
   69434 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69435 $at_failed && at_fn_log_failure
   69436 $at_traceon; }
   69437 
   69438 
   69439 cat >input <<'_ATEOF'
   69440 1//2
   69441 _ATEOF
   69442 
   69443 { set +x
   69444 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69445 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69446 ( $at_check_trace;  $PREPARSER ./calc input
   69447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69448 at_status=$? at_failed=false
   69449 $at_check_filter
   69450 echo stderr:; tee stderr <"$at_stderr"
   69451 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69452 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
   69453 $at_failed && at_fn_log_failure
   69454 $at_traceon; }
   69455 
   69456 { set +x
   69457 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69458 at_fn_check_prepare_trace "calc.at:608"
   69459 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69461 at_status=$? at_failed=false
   69462 $at_check_filter
   69463 echo stderr:; tee stderr <"$at_stderr"
   69464 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69465 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69466 $at_failed && at_fn_log_failure
   69467 $at_traceon; }
   69468 
   69469 
   69470 
   69471 # Normalize the observed and expected error messages, depending upon the
   69472 # options.
   69473 # 1. Remove the traces from observed.
   69474 sed '/^Starting/d
   69475 /^Entering/d
   69476 /^Stack/d
   69477 /^Reading/d
   69478 /^Reducing/d
   69479 /^Return/d
   69480 /^Shifting/d
   69481 /^state/d
   69482 /^Cleanup:/d
   69483 /^Error:/d
   69484 /^Next/d
   69485 /^Now/d
   69486 /^Discarding/d
   69487 / \$[0-9$]* = /d
   69488 /^yydestructor:/d' stderr >at-stderr
   69489 mv at-stderr stderr
   69490 # 2. Create the reference error message.
   69491 cat >expout <<'_ATEOF'
   69492 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   69493 _ATEOF
   69494 
   69495 # 3. If locations are not used, remove them.
   69496 
   69497 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69498 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69499 mv at-expout expout
   69500 # 5. Check
   69501 { set +x
   69502 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69503 at_fn_check_prepare_trace "calc.at:608"
   69504 ( $at_check_trace; cat stderr
   69505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69506 at_status=$? at_failed=false
   69507 $at_check_filter
   69508 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69509 $at_diff expout "$at_stdout" || at_failed=:
   69510 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69511 $at_failed && at_fn_log_failure
   69512 $at_traceon; }
   69513 
   69514 
   69515 cat >input <<'_ATEOF'
   69516 error
   69517 _ATEOF
   69518 
   69519 { set +x
   69520 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69521 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69522 ( $at_check_trace;  $PREPARSER ./calc input
   69523 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69524 at_status=$? at_failed=false
   69525 $at_check_filter
   69526 echo stderr:; tee stderr <"$at_stderr"
   69527 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69528 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
   69529 $at_failed && at_fn_log_failure
   69530 $at_traceon; }
   69531 
   69532 { set +x
   69533 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69534 at_fn_check_prepare_trace "calc.at:608"
   69535 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69537 at_status=$? at_failed=false
   69538 $at_check_filter
   69539 echo stderr:; tee stderr <"$at_stderr"
   69540 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69541 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69542 $at_failed && at_fn_log_failure
   69543 $at_traceon; }
   69544 
   69545 
   69546 
   69547 # Normalize the observed and expected error messages, depending upon the
   69548 # options.
   69549 # 1. Remove the traces from observed.
   69550 sed '/^Starting/d
   69551 /^Entering/d
   69552 /^Stack/d
   69553 /^Reading/d
   69554 /^Reducing/d
   69555 /^Return/d
   69556 /^Shifting/d
   69557 /^state/d
   69558 /^Cleanup:/d
   69559 /^Error:/d
   69560 /^Next/d
   69561 /^Now/d
   69562 /^Discarding/d
   69563 / \$[0-9$]* = /d
   69564 /^yydestructor:/d' stderr >at-stderr
   69565 mv at-stderr stderr
   69566 # 2. Create the reference error message.
   69567 cat >expout <<'_ATEOF'
   69568 1.1: syntax error, unexpected $undefined
   69569 _ATEOF
   69570 
   69571 # 3. If locations are not used, remove them.
   69572 
   69573 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69574 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69575 mv at-expout expout
   69576 # 5. Check
   69577 { set +x
   69578 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69579 at_fn_check_prepare_trace "calc.at:608"
   69580 ( $at_check_trace; cat stderr
   69581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69582 at_status=$? at_failed=false
   69583 $at_check_filter
   69584 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69585 $at_diff expout "$at_stdout" || at_failed=:
   69586 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69587 $at_failed && at_fn_log_failure
   69588 $at_traceon; }
   69589 
   69590 
   69591 cat >input <<'_ATEOF'
   69592 1 = 2 = 3
   69593 _ATEOF
   69594 
   69595 { set +x
   69596 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69597 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69598 ( $at_check_trace;  $PREPARSER ./calc input
   69599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69600 at_status=$? at_failed=false
   69601 $at_check_filter
   69602 echo stderr:; tee stderr <"$at_stderr"
   69603 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69604 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
   69605 $at_failed && at_fn_log_failure
   69606 $at_traceon; }
   69607 
   69608 { set +x
   69609 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69610 at_fn_check_prepare_trace "calc.at:608"
   69611 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69613 at_status=$? at_failed=false
   69614 $at_check_filter
   69615 echo stderr:; tee stderr <"$at_stderr"
   69616 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69617 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69618 $at_failed && at_fn_log_failure
   69619 $at_traceon; }
   69620 
   69621 
   69622 
   69623 # Normalize the observed and expected error messages, depending upon the
   69624 # options.
   69625 # 1. Remove the traces from observed.
   69626 sed '/^Starting/d
   69627 /^Entering/d
   69628 /^Stack/d
   69629 /^Reading/d
   69630 /^Reducing/d
   69631 /^Return/d
   69632 /^Shifting/d
   69633 /^state/d
   69634 /^Cleanup:/d
   69635 /^Error:/d
   69636 /^Next/d
   69637 /^Now/d
   69638 /^Discarding/d
   69639 / \$[0-9$]* = /d
   69640 /^yydestructor:/d' stderr >at-stderr
   69641 mv at-stderr stderr
   69642 # 2. Create the reference error message.
   69643 cat >expout <<'_ATEOF'
   69644 1.7: syntax error, unexpected '='
   69645 _ATEOF
   69646 
   69647 # 3. If locations are not used, remove them.
   69648 
   69649 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69650 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69651 mv at-expout expout
   69652 # 5. Check
   69653 { set +x
   69654 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69655 at_fn_check_prepare_trace "calc.at:608"
   69656 ( $at_check_trace; cat stderr
   69657 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69658 at_status=$? at_failed=false
   69659 $at_check_filter
   69660 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69661 $at_diff expout "$at_stdout" || at_failed=:
   69662 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69663 $at_failed && at_fn_log_failure
   69664 $at_traceon; }
   69665 
   69666 
   69667 cat >input <<'_ATEOF'
   69668 
   69669 +1
   69670 _ATEOF
   69671 
   69672 { set +x
   69673 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69674 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69675 ( $at_check_trace;  $PREPARSER ./calc input
   69676 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69677 at_status=$? at_failed=false
   69678 $at_check_filter
   69679 echo stderr:; tee stderr <"$at_stderr"
   69680 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69681 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
   69682 $at_failed && at_fn_log_failure
   69683 $at_traceon; }
   69684 
   69685 { set +x
   69686 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69687 at_fn_check_prepare_trace "calc.at:608"
   69688 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69689 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69690 at_status=$? at_failed=false
   69691 $at_check_filter
   69692 echo stderr:; tee stderr <"$at_stderr"
   69693 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69694 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69695 $at_failed && at_fn_log_failure
   69696 $at_traceon; }
   69697 
   69698 
   69699 
   69700 # Normalize the observed and expected error messages, depending upon the
   69701 # options.
   69702 # 1. Remove the traces from observed.
   69703 sed '/^Starting/d
   69704 /^Entering/d
   69705 /^Stack/d
   69706 /^Reading/d
   69707 /^Reducing/d
   69708 /^Return/d
   69709 /^Shifting/d
   69710 /^state/d
   69711 /^Cleanup:/d
   69712 /^Error:/d
   69713 /^Next/d
   69714 /^Now/d
   69715 /^Discarding/d
   69716 / \$[0-9$]* = /d
   69717 /^yydestructor:/d' stderr >at-stderr
   69718 mv at-stderr stderr
   69719 # 2. Create the reference error message.
   69720 cat >expout <<'_ATEOF'
   69721 2.1: syntax error, unexpected '+'
   69722 _ATEOF
   69723 
   69724 # 3. If locations are not used, remove them.
   69725 
   69726 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69727 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69728 mv at-expout expout
   69729 # 5. Check
   69730 { set +x
   69731 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69732 at_fn_check_prepare_trace "calc.at:608"
   69733 ( $at_check_trace; cat stderr
   69734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69735 at_status=$? at_failed=false
   69736 $at_check_filter
   69737 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69738 $at_diff expout "$at_stdout" || at_failed=:
   69739 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69740 $at_failed && at_fn_log_failure
   69741 $at_traceon; }
   69742 
   69743 
   69744 # Exercise error messages with EOF: work on an empty file.
   69745 { set +x
   69746 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc /dev/null"
   69747 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:608"
   69748 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   69749 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69750 at_status=$? at_failed=false
   69751 $at_check_filter
   69752 echo stderr:; tee stderr <"$at_stderr"
   69753 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69754 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
   69755 $at_failed && at_fn_log_failure
   69756 $at_traceon; }
   69757 
   69758 { set +x
   69759 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69760 at_fn_check_prepare_trace "calc.at:608"
   69761 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69762 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69763 at_status=$? at_failed=false
   69764 $at_check_filter
   69765 echo stderr:; tee stderr <"$at_stderr"
   69766 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69767 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69768 $at_failed && at_fn_log_failure
   69769 $at_traceon; }
   69770 
   69771 
   69772 
   69773 # Normalize the observed and expected error messages, depending upon the
   69774 # options.
   69775 # 1. Remove the traces from observed.
   69776 sed '/^Starting/d
   69777 /^Entering/d
   69778 /^Stack/d
   69779 /^Reading/d
   69780 /^Reducing/d
   69781 /^Return/d
   69782 /^Shifting/d
   69783 /^state/d
   69784 /^Cleanup:/d
   69785 /^Error:/d
   69786 /^Next/d
   69787 /^Now/d
   69788 /^Discarding/d
   69789 / \$[0-9$]* = /d
   69790 /^yydestructor:/d' stderr >at-stderr
   69791 mv at-stderr stderr
   69792 # 2. Create the reference error message.
   69793 cat >expout <<'_ATEOF'
   69794 1.1: syntax error, unexpected end of input
   69795 _ATEOF
   69796 
   69797 # 3. If locations are not used, remove them.
   69798 
   69799 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69800 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69801 mv at-expout expout
   69802 # 5. Check
   69803 { set +x
   69804 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69805 at_fn_check_prepare_trace "calc.at:608"
   69806 ( $at_check_trace; cat stderr
   69807 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69808 at_status=$? at_failed=false
   69809 $at_check_filter
   69810 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69811 $at_diff expout "$at_stdout" || at_failed=:
   69812 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69813 $at_failed && at_fn_log_failure
   69814 $at_traceon; }
   69815 
   69816 
   69817 
   69818 # Exercise the error token: without it, we die at the first error,
   69819 # hence be sure to
   69820 #
   69821 # - have several errors which exercise different shift/discardings
   69822 #   - (): nothing to pop, nothing to discard
   69823 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   69824 #   - (* * *): nothing to pop, a lot to discard
   69825 #   - (1 + 2 * *): some to pop and discard
   69826 #
   69827 # - test the action associated to `error'
   69828 #
   69829 # - check the lookahead that triggers an error is not discarded
   69830 #   when we enter error recovery.  Below, the lookahead causing the
   69831 #   first error is ")", which is needed to recover from the error and
   69832 #   produce the "0" that triggers the "0 != 1" error.
   69833 #
   69834 cat >input <<'_ATEOF'
   69835 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   69836 _ATEOF
   69837 
   69838 { set +x
   69839 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69840 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69841 ( $at_check_trace;  $PREPARSER ./calc input
   69842 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69843 at_status=$? at_failed=false
   69844 $at_check_filter
   69845 echo stderr:; tee stderr <"$at_stderr"
   69846 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69847 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69848 $at_failed && at_fn_log_failure
   69849 $at_traceon; }
   69850 
   69851 { set +x
   69852 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69853 at_fn_check_prepare_trace "calc.at:608"
   69854 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69855 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69856 at_status=$? at_failed=false
   69857 $at_check_filter
   69858 echo stderr:; tee stderr <"$at_stderr"
   69859 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69860 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69861 $at_failed && at_fn_log_failure
   69862 $at_traceon; }
   69863 
   69864 
   69865 
   69866 # Normalize the observed and expected error messages, depending upon the
   69867 # options.
   69868 # 1. Remove the traces from observed.
   69869 sed '/^Starting/d
   69870 /^Entering/d
   69871 /^Stack/d
   69872 /^Reading/d
   69873 /^Reducing/d
   69874 /^Return/d
   69875 /^Shifting/d
   69876 /^state/d
   69877 /^Cleanup:/d
   69878 /^Error:/d
   69879 /^Next/d
   69880 /^Now/d
   69881 /^Discarding/d
   69882 / \$[0-9$]* = /d
   69883 /^yydestructor:/d' stderr >at-stderr
   69884 mv at-stderr stderr
   69885 # 2. Create the reference error message.
   69886 cat >expout <<'_ATEOF'
   69887 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   69888 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   69889 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   69890 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   69891 calc: error: 4444 != 1
   69892 _ATEOF
   69893 
   69894 # 3. If locations are not used, remove them.
   69895 
   69896 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69897 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69898 mv at-expout expout
   69899 # 5. Check
   69900 { set +x
   69901 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69902 at_fn_check_prepare_trace "calc.at:608"
   69903 ( $at_check_trace; cat stderr
   69904 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69905 at_status=$? at_failed=false
   69906 $at_check_filter
   69907 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69908 $at_diff expout "$at_stdout" || at_failed=:
   69909 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69910 $at_failed && at_fn_log_failure
   69911 $at_traceon; }
   69912 
   69913 
   69914 
   69915 # The same, but this time exercising explicitly triggered syntax errors.
   69916 # POSIX says the lookahead causing the error should not be discarded.
   69917 cat >input <<'_ATEOF'
   69918 (!) + (1 2) = 1
   69919 _ATEOF
   69920 
   69921 { set +x
   69922 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   69923 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   69924 ( $at_check_trace;  $PREPARSER ./calc input
   69925 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69926 at_status=$? at_failed=false
   69927 $at_check_filter
   69928 echo stderr:; tee stderr <"$at_stderr"
   69929 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69930 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69931 $at_failed && at_fn_log_failure
   69932 $at_traceon; }
   69933 
   69934 { set +x
   69935 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   69936 at_fn_check_prepare_trace "calc.at:608"
   69937 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   69938 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69939 at_status=$? at_failed=false
   69940 $at_check_filter
   69941 echo stderr:; tee stderr <"$at_stderr"
   69942 at_fn_diff_devnull "$at_stdout" || at_failed=:
   69943 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69944 $at_failed && at_fn_log_failure
   69945 $at_traceon; }
   69946 
   69947 
   69948 
   69949 # Normalize the observed and expected error messages, depending upon the
   69950 # options.
   69951 # 1. Remove the traces from observed.
   69952 sed '/^Starting/d
   69953 /^Entering/d
   69954 /^Stack/d
   69955 /^Reading/d
   69956 /^Reducing/d
   69957 /^Return/d
   69958 /^Shifting/d
   69959 /^state/d
   69960 /^Cleanup:/d
   69961 /^Error:/d
   69962 /^Next/d
   69963 /^Now/d
   69964 /^Discarding/d
   69965 / \$[0-9$]* = /d
   69966 /^yydestructor:/d' stderr >at-stderr
   69967 mv at-stderr stderr
   69968 # 2. Create the reference error message.
   69969 cat >expout <<'_ATEOF'
   69970 1.10: syntax error, unexpected number
   69971 calc: error: 2222 != 1
   69972 _ATEOF
   69973 
   69974 # 3. If locations are not used, remove them.
   69975 
   69976 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   69977 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   69978 mv at-expout expout
   69979 # 5. Check
   69980 { set +x
   69981 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   69982 at_fn_check_prepare_trace "calc.at:608"
   69983 ( $at_check_trace; cat stderr
   69984 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   69985 at_status=$? at_failed=false
   69986 $at_check_filter
   69987 at_fn_diff_devnull "$at_stderr" || at_failed=:
   69988 $at_diff expout "$at_stdout" || at_failed=:
   69989 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   69990 $at_failed && at_fn_log_failure
   69991 $at_traceon; }
   69992 
   69993 
   69994 cat >input <<'_ATEOF'
   69995 (- *) + (1 2) = 1
   69996 _ATEOF
   69997 
   69998 { set +x
   69999 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   70000 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   70001 ( $at_check_trace;  $PREPARSER ./calc input
   70002 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70003 at_status=$? at_failed=false
   70004 $at_check_filter
   70005 echo stderr:; tee stderr <"$at_stderr"
   70006 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70007 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   70008 $at_failed && at_fn_log_failure
   70009 $at_traceon; }
   70010 
   70011 { set +x
   70012 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70013 at_fn_check_prepare_trace "calc.at:608"
   70014 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70015 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70016 at_status=$? at_failed=false
   70017 $at_check_filter
   70018 echo stderr:; tee stderr <"$at_stderr"
   70019 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70020 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   70021 $at_failed && at_fn_log_failure
   70022 $at_traceon; }
   70023 
   70024 
   70025 
   70026 # Normalize the observed and expected error messages, depending upon the
   70027 # options.
   70028 # 1. Remove the traces from observed.
   70029 sed '/^Starting/d
   70030 /^Entering/d
   70031 /^Stack/d
   70032 /^Reading/d
   70033 /^Reducing/d
   70034 /^Return/d
   70035 /^Shifting/d
   70036 /^state/d
   70037 /^Cleanup:/d
   70038 /^Error:/d
   70039 /^Next/d
   70040 /^Now/d
   70041 /^Discarding/d
   70042 / \$[0-9$]* = /d
   70043 /^yydestructor:/d' stderr >at-stderr
   70044 mv at-stderr stderr
   70045 # 2. Create the reference error message.
   70046 cat >expout <<'_ATEOF'
   70047 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   70048 1.12: syntax error, unexpected number
   70049 calc: error: 2222 != 1
   70050 _ATEOF
   70051 
   70052 # 3. If locations are not used, remove them.
   70053 
   70054 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70055 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   70056 mv at-expout expout
   70057 # 5. Check
   70058 { set +x
   70059 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   70060 at_fn_check_prepare_trace "calc.at:608"
   70061 ( $at_check_trace; cat stderr
   70062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70063 at_status=$? at_failed=false
   70064 $at_check_filter
   70065 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70066 $at_diff expout "$at_stdout" || at_failed=:
   70067 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   70068 $at_failed && at_fn_log_failure
   70069 $at_traceon; }
   70070 
   70071 
   70072 
   70073 # Check that yyerrok works properly: second error is not reported,
   70074 # third and fourth are.  Parse status is succesfull.
   70075 cat >input <<'_ATEOF'
   70076 (* *) + (*) + (*)
   70077 _ATEOF
   70078 
   70079 { set +x
   70080 $as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
   70081 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
   70082 ( $at_check_trace;  $PREPARSER ./calc input
   70083 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70084 at_status=$? at_failed=false
   70085 $at_check_filter
   70086 echo stderr:; tee stderr <"$at_stderr"
   70087 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70088 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   70089 $at_failed && at_fn_log_failure
   70090 $at_traceon; }
   70091 
   70092 { set +x
   70093 $as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70094 at_fn_check_prepare_trace "calc.at:608"
   70095 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70097 at_status=$? at_failed=false
   70098 $at_check_filter
   70099 echo stderr:; tee stderr <"$at_stderr"
   70100 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70101 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   70102 $at_failed && at_fn_log_failure
   70103 $at_traceon; }
   70104 
   70105 
   70106 
   70107 # Normalize the observed and expected error messages, depending upon the
   70108 # options.
   70109 # 1. Remove the traces from observed.
   70110 sed '/^Starting/d
   70111 /^Entering/d
   70112 /^Stack/d
   70113 /^Reading/d
   70114 /^Reducing/d
   70115 /^Return/d
   70116 /^Shifting/d
   70117 /^state/d
   70118 /^Cleanup:/d
   70119 /^Error:/d
   70120 /^Next/d
   70121 /^Now/d
   70122 /^Discarding/d
   70123 / \$[0-9$]* = /d
   70124 /^yydestructor:/d' stderr >at-stderr
   70125 mv at-stderr stderr
   70126 # 2. Create the reference error message.
   70127 cat >expout <<'_ATEOF'
   70128 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   70129 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   70130 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   70131 _ATEOF
   70132 
   70133 # 3. If locations are not used, remove them.
   70134 
   70135 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70136 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   70137 mv at-expout expout
   70138 # 5. Check
   70139 { set +x
   70140 $as_echo "$at_srcdir/calc.at:608: cat stderr"
   70141 at_fn_check_prepare_trace "calc.at:608"
   70142 ( $at_check_trace; cat stderr
   70143 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70144 at_status=$? at_failed=false
   70145 $at_check_filter
   70146 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70147 $at_diff expout "$at_stdout" || at_failed=:
   70148 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
   70149 $at_failed && at_fn_log_failure
   70150 $at_traceon; }
   70151 
   70152 
   70153 
   70154 
   70155 
   70156   set +x
   70157   $at_times_p && times >"$at_times_file"
   70158 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   70159 read at_status <"$at_status_file"
   70160 #AT_STOP_208
   70161 #AT_START_209
   70162 at_fn_group_banner 209 'calc.at:609' \
   70163   "Calculator %error-verbose %locations" "           " 11
   70164 at_xfail=no
   70165 (
   70166   $as_echo "209. $at_setup_line: testing $at_desc ..."
   70167   $at_traceon
   70168 
   70169 
   70170 
   70171 
   70172 
   70173 
   70174 
   70175 
   70176 
   70177 
   70178 cat >calc.y <<'_ATEOF'
   70179 %code top {
   70180 #include <config.h>
   70181 /* We don't need perfect functions for these tests. */
   70182 #undef malloc
   70183 #undef memcmp
   70184 #undef realloc
   70185 }
   70186 
   70187 /* Infix notation calculator--calc */
   70188 %error-verbose %locations
   70189 
   70190 %code requires
   70191 {
   70192 
   70193   /* Exercise pre-prologue dependency to %union.  */
   70194   typedef int semantic_value;
   70195 }
   70196 
   70197 /* Exercise %union. */
   70198 %union
   70199 {
   70200   semantic_value ival;
   70201 };
   70202 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   70203 
   70204 %code provides
   70205 {
   70206   #include <stdio.h>
   70207   /* The input.  */
   70208   extern FILE *input;
   70209   extern semantic_value global_result;
   70210   extern int global_count;
   70211 }
   70212 
   70213 %code
   70214 {
   70215 #include <assert.h>
   70216 #include <string.h>
   70217 #define USE(Var)
   70218 
   70219 FILE *input;
   70220 static int power (int base, int exponent);
   70221 
   70222 static void yyerror ( const char *msg);
   70223 int yylex (void);
   70224 }
   70225 
   70226 
   70227 
   70228 /* Bison Declarations */
   70229 %token CALC_EOF 0 "end of input"
   70230 %token <ival> NUM "number"
   70231 %type  <ival> exp
   70232 
   70233 %nonassoc '=' /* comparison            */
   70234 %left '-' '+'
   70235 %left '*' '/'
   70236 %left NEG     /* negation--unary minus */
   70237 %right '^'    /* exponentiation        */
   70238 
   70239 /* Grammar follows */
   70240 %%
   70241 input:
   70242   line
   70243 | input line         {  }
   70244 ;
   70245 
   70246 line:
   70247   '\n'
   70248 | exp '\n'           { USE ($1); }
   70249 ;
   70250 
   70251 exp:
   70252   NUM                { $$ = $1;             }
   70253 | exp '=' exp
   70254   {
   70255     if ($1 != $3)
   70256       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   70257     $$ = $1;
   70258   }
   70259 | exp '+' exp        { $$ = $1 + $3;        }
   70260 | exp '-' exp        { $$ = $1 - $3;        }
   70261 | exp '*' exp        { $$ = $1 * $3;        }
   70262 | exp '/' exp        { $$ = $1 / $3;        }
   70263 | '-' exp  %prec NEG { $$ = -$2;            }
   70264 | exp '^' exp        { $$ = power ($1, $3); }
   70265 | '(' exp ')'        { $$ = $2;             }
   70266 | '(' error ')'      { $$ = 1111; yyerrok;  }
   70267 | '!'                { $$ = 0; YYERROR;     }
   70268 | '-' error          { $$ = 0; YYERROR;     }
   70269 ;
   70270 %%
   70271 
   70272 static int
   70273 power (int base, int exponent)
   70274 {
   70275   int res = 1;
   70276   assert (0 <= exponent);
   70277   for (/* Niente */; exponent; --exponent)
   70278     res *= base;
   70279   return res;
   70280 }
   70281 
   70282 
   70283 #include <stdio.h>
   70284 /* A C error reporting function.  */
   70285 static
   70286 void yyerror ( const char *msg)
   70287 {
   70288   YY_LOCATION_PRINT (stderr, (yylloc));
   70289   fprintf (stderr, ": ");
   70290   fprintf (stderr, "%s\n", msg);
   70291 }
   70292 #include <ctype.h>
   70293 
   70294 int yylex (void);
   70295 static int get_char (void);
   70296 static void unget_char ( int c);
   70297 
   70298 
   70299 static YYLTYPE last_yylloc;
   70300 
   70301 static int
   70302 get_char (void)
   70303 {
   70304   int res = getc (input);
   70305   ;
   70306 
   70307   last_yylloc = (yylloc);
   70308   if (res == '\n')
   70309     {
   70310       (yylloc).last_line++;
   70311       (yylloc).last_column = 1;
   70312     }
   70313   else
   70314     (yylloc).last_column++;
   70315 
   70316   return res;
   70317 }
   70318 
   70319 static void
   70320 unget_char ( int c)
   70321 {
   70322   ;
   70323 
   70324   /* Wrong when C == `\n'. */
   70325   (yylloc) = last_yylloc;
   70326 
   70327   ungetc (c, input);
   70328 }
   70329 
   70330 static int
   70331 read_signed_integer (void)
   70332 {
   70333   int c = get_char ();
   70334   int sign = 1;
   70335   int n = 0;
   70336 
   70337   ;
   70338   if (c == '-')
   70339     {
   70340       c = get_char ();
   70341       sign = -1;
   70342     }
   70343 
   70344   while (isdigit (c))
   70345     {
   70346       n = 10 * n + (c - '0');
   70347       c = get_char ();
   70348     }
   70349 
   70350   unget_char ( c);
   70351 
   70352   return sign * n;
   70353 }
   70354 
   70355 
   70356 /*---------------------------------------------------------------.
   70357 | Lexical analyzer returns an integer on the stack and the token |
   70358 | NUM, or the ASCII character read if not a number.  Skips all   |
   70359 | blanks and tabs, returns 0 for EOF.                            |
   70360 `---------------------------------------------------------------*/
   70361 
   70362 int yylex (void)
   70363 {
   70364   int c;
   70365   /* Skip current token, then white spaces.  */
   70366   do
   70367     {
   70368      (yylloc).first_column = (yylloc).last_column;
   70369       (yylloc).first_line   = (yylloc).last_line;
   70370 
   70371     }
   70372   while ((c = get_char ()) == ' ' || c == '\t');
   70373 
   70374   /* process numbers   */
   70375   if (c == '.' || isdigit (c))
   70376     {
   70377       unget_char ( c);
   70378       (yylval).ival = read_signed_integer ();
   70379       return NUM;
   70380     }
   70381 
   70382   /* Return end-of-file.  */
   70383   if (c == EOF)
   70384     return CALC_EOF;
   70385 
   70386   /* Return single chars. */
   70387   return c;
   70388 }
   70389 
   70390 #include <assert.h>
   70391 #if HAVE_UNISTD_H
   70392 # include <unistd.h>
   70393 #else
   70394 # undef alarm
   70395 # define alarm(seconds) /* empty */
   70396 #endif
   70397 
   70398 
   70399 
   70400 semantic_value global_result = 0;
   70401 int global_count = 0;
   70402 
   70403 /* A C main function.  */
   70404 int
   70405 main (int argc, const char **argv)
   70406 {
   70407   semantic_value result = 0;
   70408   int count = 0;
   70409   int status;
   70410 
   70411   /* This used to be alarm (10), but that isn't enough time for
   70412      a July 1995 vintage DEC Alphastation 200 4/100 system,
   70413      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   70414   alarm (100);
   70415 
   70416   if (argc == 2)
   70417     input = fopen (argv[1], "r");
   70418   else
   70419     input = stdin;
   70420 
   70421   if (!input)
   70422     {
   70423       perror (argv[1]);
   70424       return 3;
   70425     }
   70426 
   70427 
   70428   status = yyparse ();
   70429   if (fclose (input))
   70430     perror ("fclose");
   70431   assert (global_result == result);
   70432   assert (global_count == count);
   70433   return status;
   70434 }
   70435 _ATEOF
   70436 
   70437 
   70438 
   70439 
   70440 
   70441 
   70442 
   70443 
   70444 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   70445   at_save_special_files
   70446   mkdir xml-tests
   70447     # Don't combine these Bison invocations since we want to be sure that
   70448   # --report=all isn't required to get the full XML file.
   70449   { set +x
   70450 $as_echo "$at_srcdir/calc.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   70451                   --graph=xml-tests/test.dot -o calc.c calc.y"
   70452 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:609"
   70453 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   70454                   --graph=xml-tests/test.dot -o calc.c calc.y
   70455 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70456 at_status=$? at_failed=false
   70457 $at_check_filter
   70458 echo stderr:; cat "$at_stderr"
   70459 echo stdout:; cat "$at_stdout"
   70460 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70461 $at_failed && at_fn_log_failure
   70462 $at_traceon; }
   70463 
   70464   { set +x
   70465 $as_echo "$at_srcdir/calc.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   70466 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:609"
   70467 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   70468 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70469 at_status=$? at_failed=false
   70470 $at_check_filter
   70471 echo stderr:; cat "$at_stderr"
   70472 echo stdout:; cat "$at_stdout"
   70473 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70474 $at_failed && at_fn_log_failure
   70475 $at_traceon; }
   70476 
   70477     cp xml-tests/test.output expout
   70478   { set +x
   70479 $as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\
   70480              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   70481              xml-tests/test.xml"
   70482 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609"
   70483 ( $at_check_trace; $XSLTPROC \
   70484              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   70485              xml-tests/test.xml
   70486 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70487 at_status=$? at_failed=false
   70488 $at_check_filter
   70489 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70490 $at_diff expout "$at_stdout" || at_failed=:
   70491 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70492 $at_failed && at_fn_log_failure
   70493 $at_traceon; }
   70494 
   70495   sort xml-tests/test.dot > expout
   70496   { set +x
   70497 $as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\
   70498              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   70499              xml-tests/test.xml | sort"
   70500 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609"
   70501 ( $at_check_trace; $XSLTPROC \
   70502              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   70503              xml-tests/test.xml | sort
   70504 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70505 at_status=$? at_failed=false
   70506 $at_check_filter
   70507 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70508 $at_diff expout "$at_stdout" || at_failed=:
   70509 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70510 $at_failed && at_fn_log_failure
   70511 $at_traceon; }
   70512 
   70513   rm -rf xml-tests expout
   70514   at_restore_special_files
   70515 fi
   70516 { set +x
   70517 $as_echo "$at_srcdir/calc.at:609: bison -o calc.c calc.y"
   70518 at_fn_check_prepare_trace "calc.at:609"
   70519 ( $at_check_trace; bison -o calc.c calc.y
   70520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70521 at_status=$? at_failed=false
   70522 $at_check_filter
   70523 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70524 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70525 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70526 $at_failed && at_fn_log_failure
   70527 $at_traceon; }
   70528 
   70529 
   70530    { set +x
   70531 $as_echo "$at_srcdir/calc.at:609: \$BISON_C_WORKS"
   70532 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:609"
   70533 ( $at_check_trace; $BISON_C_WORKS
   70534 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70535 at_status=$? at_failed=false
   70536 $at_check_filter
   70537 echo stderr:; cat "$at_stderr"
   70538 echo stdout:; cat "$at_stdout"
   70539 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70540 $at_failed && at_fn_log_failure
   70541 $at_traceon; }
   70542 
   70543 { set +x
   70544 $as_echo "$at_srcdir/calc.at:609: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   70545 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:609"
   70546 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   70547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70548 at_status=$? at_failed=false
   70549 $at_check_filter
   70550 echo stderr:; cat "$at_stderr"
   70551 echo stdout:; cat "$at_stdout"
   70552 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70553 $at_failed && at_fn_log_failure
   70554 $at_traceon; }
   70555 
   70556 
   70557 { set +x
   70558 $as_echo "$at_srcdir/calc.at:609: \$PERL -ne '
   70559   chomp;
   70560   print \"\$.: {\$_}\\n\"
   70561     if (# No starting/ending empty lines.
   70562         (eof || \$. == 1) && /^\\s*\$/
   70563         # No trailing space.  FIXME: not ready for \"maint\".
   70564         # || /\\s\$/
   70565         )' calc.c
   70566 "
   70567 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:609"
   70568 ( $at_check_trace; $PERL -ne '
   70569   chomp;
   70570   print "$.: {$_}\n"
   70571     if (# No starting/ending empty lines.
   70572         (eof || $. == 1) && /^\s*$/
   70573         # No trailing space.  FIXME: not ready for "maint".
   70574         # || /\s$/
   70575         )' calc.c
   70576 
   70577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70578 at_status=$? at_failed=false
   70579 $at_check_filter
   70580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70581 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70582 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70583 $at_failed && at_fn_log_failure
   70584 $at_traceon; }
   70585 
   70586 
   70587 
   70588 # Test the priorities.
   70589 cat >input <<'_ATEOF'
   70590 1 + 2 * 3 = 7
   70591 1 + 2 * -3 = -5
   70592 
   70593 -1^2 = -1
   70594 (-1)^2 = 1
   70595 
   70596 ---1 = -1
   70597 
   70598 1 - 2 - 3 = -4
   70599 1 - (2 - 3) = 2
   70600 
   70601 2^2^3 = 256
   70602 (2^2)^3 = 64
   70603 _ATEOF
   70604 
   70605 { set +x
   70606 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   70607 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   70608 ( $at_check_trace;  $PREPARSER ./calc input
   70609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70610 at_status=$? at_failed=false
   70611 $at_check_filter
   70612 echo stderr:; tee stderr <"$at_stderr"
   70613 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70614 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70615 $at_failed && at_fn_log_failure
   70616 $at_traceon; }
   70617 
   70618 { set +x
   70619 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70620 at_fn_check_prepare_trace "calc.at:609"
   70621 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70623 at_status=$? at_failed=false
   70624 $at_check_filter
   70625 echo stderr:; tee stderr <"$at_stderr"
   70626 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70627 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70628 $at_failed && at_fn_log_failure
   70629 $at_traceon; }
   70630 
   70631 
   70632 
   70633 
   70634 # Some syntax errors.
   70635 cat >input <<'_ATEOF'
   70636 1 2
   70637 _ATEOF
   70638 
   70639 { set +x
   70640 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   70641 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   70642 ( $at_check_trace;  $PREPARSER ./calc input
   70643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70644 at_status=$? at_failed=false
   70645 $at_check_filter
   70646 echo stderr:; tee stderr <"$at_stderr"
   70647 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70648 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
   70649 $at_failed && at_fn_log_failure
   70650 $at_traceon; }
   70651 
   70652 { set +x
   70653 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70654 at_fn_check_prepare_trace "calc.at:609"
   70655 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70657 at_status=$? at_failed=false
   70658 $at_check_filter
   70659 echo stderr:; tee stderr <"$at_stderr"
   70660 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70661 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70662 $at_failed && at_fn_log_failure
   70663 $at_traceon; }
   70664 
   70665 
   70666 
   70667 # Normalize the observed and expected error messages, depending upon the
   70668 # options.
   70669 # 1. Remove the traces from observed.
   70670 sed '/^Starting/d
   70671 /^Entering/d
   70672 /^Stack/d
   70673 /^Reading/d
   70674 /^Reducing/d
   70675 /^Return/d
   70676 /^Shifting/d
   70677 /^state/d
   70678 /^Cleanup:/d
   70679 /^Error:/d
   70680 /^Next/d
   70681 /^Now/d
   70682 /^Discarding/d
   70683 / \$[0-9$]* = /d
   70684 /^yydestructor:/d' stderr >at-stderr
   70685 mv at-stderr stderr
   70686 # 2. Create the reference error message.
   70687 cat >expout <<'_ATEOF'
   70688 1.3: syntax error, unexpected number
   70689 _ATEOF
   70690 
   70691 # 3. If locations are not used, remove them.
   70692 
   70693 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70694 
   70695 # 5. Check
   70696 { set +x
   70697 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   70698 at_fn_check_prepare_trace "calc.at:609"
   70699 ( $at_check_trace; cat stderr
   70700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70701 at_status=$? at_failed=false
   70702 $at_check_filter
   70703 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70704 $at_diff expout "$at_stdout" || at_failed=:
   70705 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70706 $at_failed && at_fn_log_failure
   70707 $at_traceon; }
   70708 
   70709 
   70710 cat >input <<'_ATEOF'
   70711 1//2
   70712 _ATEOF
   70713 
   70714 { set +x
   70715 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   70716 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   70717 ( $at_check_trace;  $PREPARSER ./calc input
   70718 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70719 at_status=$? at_failed=false
   70720 $at_check_filter
   70721 echo stderr:; tee stderr <"$at_stderr"
   70722 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70723 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
   70724 $at_failed && at_fn_log_failure
   70725 $at_traceon; }
   70726 
   70727 { set +x
   70728 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70729 at_fn_check_prepare_trace "calc.at:609"
   70730 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70731 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70732 at_status=$? at_failed=false
   70733 $at_check_filter
   70734 echo stderr:; tee stderr <"$at_stderr"
   70735 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70736 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70737 $at_failed && at_fn_log_failure
   70738 $at_traceon; }
   70739 
   70740 
   70741 
   70742 # Normalize the observed and expected error messages, depending upon the
   70743 # options.
   70744 # 1. Remove the traces from observed.
   70745 sed '/^Starting/d
   70746 /^Entering/d
   70747 /^Stack/d
   70748 /^Reading/d
   70749 /^Reducing/d
   70750 /^Return/d
   70751 /^Shifting/d
   70752 /^state/d
   70753 /^Cleanup:/d
   70754 /^Error:/d
   70755 /^Next/d
   70756 /^Now/d
   70757 /^Discarding/d
   70758 / \$[0-9$]* = /d
   70759 /^yydestructor:/d' stderr >at-stderr
   70760 mv at-stderr stderr
   70761 # 2. Create the reference error message.
   70762 cat >expout <<'_ATEOF'
   70763 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   70764 _ATEOF
   70765 
   70766 # 3. If locations are not used, remove them.
   70767 
   70768 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70769 
   70770 # 5. Check
   70771 { set +x
   70772 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   70773 at_fn_check_prepare_trace "calc.at:609"
   70774 ( $at_check_trace; cat stderr
   70775 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70776 at_status=$? at_failed=false
   70777 $at_check_filter
   70778 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70779 $at_diff expout "$at_stdout" || at_failed=:
   70780 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70781 $at_failed && at_fn_log_failure
   70782 $at_traceon; }
   70783 
   70784 
   70785 cat >input <<'_ATEOF'
   70786 error
   70787 _ATEOF
   70788 
   70789 { set +x
   70790 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   70791 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   70792 ( $at_check_trace;  $PREPARSER ./calc input
   70793 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70794 at_status=$? at_failed=false
   70795 $at_check_filter
   70796 echo stderr:; tee stderr <"$at_stderr"
   70797 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70798 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
   70799 $at_failed && at_fn_log_failure
   70800 $at_traceon; }
   70801 
   70802 { set +x
   70803 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70804 at_fn_check_prepare_trace "calc.at:609"
   70805 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70807 at_status=$? at_failed=false
   70808 $at_check_filter
   70809 echo stderr:; tee stderr <"$at_stderr"
   70810 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70811 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70812 $at_failed && at_fn_log_failure
   70813 $at_traceon; }
   70814 
   70815 
   70816 
   70817 # Normalize the observed and expected error messages, depending upon the
   70818 # options.
   70819 # 1. Remove the traces from observed.
   70820 sed '/^Starting/d
   70821 /^Entering/d
   70822 /^Stack/d
   70823 /^Reading/d
   70824 /^Reducing/d
   70825 /^Return/d
   70826 /^Shifting/d
   70827 /^state/d
   70828 /^Cleanup:/d
   70829 /^Error:/d
   70830 /^Next/d
   70831 /^Now/d
   70832 /^Discarding/d
   70833 / \$[0-9$]* = /d
   70834 /^yydestructor:/d' stderr >at-stderr
   70835 mv at-stderr stderr
   70836 # 2. Create the reference error message.
   70837 cat >expout <<'_ATEOF'
   70838 1.1: syntax error, unexpected $undefined
   70839 _ATEOF
   70840 
   70841 # 3. If locations are not used, remove them.
   70842 
   70843 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70844 
   70845 # 5. Check
   70846 { set +x
   70847 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   70848 at_fn_check_prepare_trace "calc.at:609"
   70849 ( $at_check_trace; cat stderr
   70850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70851 at_status=$? at_failed=false
   70852 $at_check_filter
   70853 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70854 $at_diff expout "$at_stdout" || at_failed=:
   70855 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70856 $at_failed && at_fn_log_failure
   70857 $at_traceon; }
   70858 
   70859 
   70860 cat >input <<'_ATEOF'
   70861 1 = 2 = 3
   70862 _ATEOF
   70863 
   70864 { set +x
   70865 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   70866 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   70867 ( $at_check_trace;  $PREPARSER ./calc input
   70868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70869 at_status=$? at_failed=false
   70870 $at_check_filter
   70871 echo stderr:; tee stderr <"$at_stderr"
   70872 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70873 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
   70874 $at_failed && at_fn_log_failure
   70875 $at_traceon; }
   70876 
   70877 { set +x
   70878 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70879 at_fn_check_prepare_trace "calc.at:609"
   70880 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70881 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70882 at_status=$? at_failed=false
   70883 $at_check_filter
   70884 echo stderr:; tee stderr <"$at_stderr"
   70885 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70886 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70887 $at_failed && at_fn_log_failure
   70888 $at_traceon; }
   70889 
   70890 
   70891 
   70892 # Normalize the observed and expected error messages, depending upon the
   70893 # options.
   70894 # 1. Remove the traces from observed.
   70895 sed '/^Starting/d
   70896 /^Entering/d
   70897 /^Stack/d
   70898 /^Reading/d
   70899 /^Reducing/d
   70900 /^Return/d
   70901 /^Shifting/d
   70902 /^state/d
   70903 /^Cleanup:/d
   70904 /^Error:/d
   70905 /^Next/d
   70906 /^Now/d
   70907 /^Discarding/d
   70908 / \$[0-9$]* = /d
   70909 /^yydestructor:/d' stderr >at-stderr
   70910 mv at-stderr stderr
   70911 # 2. Create the reference error message.
   70912 cat >expout <<'_ATEOF'
   70913 1.7: syntax error, unexpected '='
   70914 _ATEOF
   70915 
   70916 # 3. If locations are not used, remove them.
   70917 
   70918 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70919 
   70920 # 5. Check
   70921 { set +x
   70922 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   70923 at_fn_check_prepare_trace "calc.at:609"
   70924 ( $at_check_trace; cat stderr
   70925 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70926 at_status=$? at_failed=false
   70927 $at_check_filter
   70928 at_fn_diff_devnull "$at_stderr" || at_failed=:
   70929 $at_diff expout "$at_stdout" || at_failed=:
   70930 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70931 $at_failed && at_fn_log_failure
   70932 $at_traceon; }
   70933 
   70934 
   70935 cat >input <<'_ATEOF'
   70936 
   70937 +1
   70938 _ATEOF
   70939 
   70940 { set +x
   70941 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   70942 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   70943 ( $at_check_trace;  $PREPARSER ./calc input
   70944 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70945 at_status=$? at_failed=false
   70946 $at_check_filter
   70947 echo stderr:; tee stderr <"$at_stderr"
   70948 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70949 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
   70950 $at_failed && at_fn_log_failure
   70951 $at_traceon; }
   70952 
   70953 { set +x
   70954 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   70955 at_fn_check_prepare_trace "calc.at:609"
   70956 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   70957 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   70958 at_status=$? at_failed=false
   70959 $at_check_filter
   70960 echo stderr:; tee stderr <"$at_stderr"
   70961 at_fn_diff_devnull "$at_stdout" || at_failed=:
   70962 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   70963 $at_failed && at_fn_log_failure
   70964 $at_traceon; }
   70965 
   70966 
   70967 
   70968 # Normalize the observed and expected error messages, depending upon the
   70969 # options.
   70970 # 1. Remove the traces from observed.
   70971 sed '/^Starting/d
   70972 /^Entering/d
   70973 /^Stack/d
   70974 /^Reading/d
   70975 /^Reducing/d
   70976 /^Return/d
   70977 /^Shifting/d
   70978 /^state/d
   70979 /^Cleanup:/d
   70980 /^Error:/d
   70981 /^Next/d
   70982 /^Now/d
   70983 /^Discarding/d
   70984 / \$[0-9$]* = /d
   70985 /^yydestructor:/d' stderr >at-stderr
   70986 mv at-stderr stderr
   70987 # 2. Create the reference error message.
   70988 cat >expout <<'_ATEOF'
   70989 2.1: syntax error, unexpected '+'
   70990 _ATEOF
   70991 
   70992 # 3. If locations are not used, remove them.
   70993 
   70994 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   70995 
   70996 # 5. Check
   70997 { set +x
   70998 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   70999 at_fn_check_prepare_trace "calc.at:609"
   71000 ( $at_check_trace; cat stderr
   71001 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71002 at_status=$? at_failed=false
   71003 $at_check_filter
   71004 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71005 $at_diff expout "$at_stdout" || at_failed=:
   71006 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71007 $at_failed && at_fn_log_failure
   71008 $at_traceon; }
   71009 
   71010 
   71011 # Exercise error messages with EOF: work on an empty file.
   71012 { set +x
   71013 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc /dev/null"
   71014 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:609"
   71015 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   71016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71017 at_status=$? at_failed=false
   71018 $at_check_filter
   71019 echo stderr:; tee stderr <"$at_stderr"
   71020 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71021 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
   71022 $at_failed && at_fn_log_failure
   71023 $at_traceon; }
   71024 
   71025 { set +x
   71026 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71027 at_fn_check_prepare_trace "calc.at:609"
   71028 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71030 at_status=$? at_failed=false
   71031 $at_check_filter
   71032 echo stderr:; tee stderr <"$at_stderr"
   71033 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71034 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71035 $at_failed && at_fn_log_failure
   71036 $at_traceon; }
   71037 
   71038 
   71039 
   71040 # Normalize the observed and expected error messages, depending upon the
   71041 # options.
   71042 # 1. Remove the traces from observed.
   71043 sed '/^Starting/d
   71044 /^Entering/d
   71045 /^Stack/d
   71046 /^Reading/d
   71047 /^Reducing/d
   71048 /^Return/d
   71049 /^Shifting/d
   71050 /^state/d
   71051 /^Cleanup:/d
   71052 /^Error:/d
   71053 /^Next/d
   71054 /^Now/d
   71055 /^Discarding/d
   71056 / \$[0-9$]* = /d
   71057 /^yydestructor:/d' stderr >at-stderr
   71058 mv at-stderr stderr
   71059 # 2. Create the reference error message.
   71060 cat >expout <<'_ATEOF'
   71061 1.1: syntax error, unexpected end of input
   71062 _ATEOF
   71063 
   71064 # 3. If locations are not used, remove them.
   71065 
   71066 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   71067 
   71068 # 5. Check
   71069 { set +x
   71070 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   71071 at_fn_check_prepare_trace "calc.at:609"
   71072 ( $at_check_trace; cat stderr
   71073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71074 at_status=$? at_failed=false
   71075 $at_check_filter
   71076 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71077 $at_diff expout "$at_stdout" || at_failed=:
   71078 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71079 $at_failed && at_fn_log_failure
   71080 $at_traceon; }
   71081 
   71082 
   71083 
   71084 # Exercise the error token: without it, we die at the first error,
   71085 # hence be sure to
   71086 #
   71087 # - have several errors which exercise different shift/discardings
   71088 #   - (): nothing to pop, nothing to discard
   71089 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   71090 #   - (* * *): nothing to pop, a lot to discard
   71091 #   - (1 + 2 * *): some to pop and discard
   71092 #
   71093 # - test the action associated to `error'
   71094 #
   71095 # - check the lookahead that triggers an error is not discarded
   71096 #   when we enter error recovery.  Below, the lookahead causing the
   71097 #   first error is ")", which is needed to recover from the error and
   71098 #   produce the "0" that triggers the "0 != 1" error.
   71099 #
   71100 cat >input <<'_ATEOF'
   71101 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   71102 _ATEOF
   71103 
   71104 { set +x
   71105 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   71106 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   71107 ( $at_check_trace;  $PREPARSER ./calc input
   71108 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71109 at_status=$? at_failed=false
   71110 $at_check_filter
   71111 echo stderr:; tee stderr <"$at_stderr"
   71112 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71113 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71114 $at_failed && at_fn_log_failure
   71115 $at_traceon; }
   71116 
   71117 { set +x
   71118 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71119 at_fn_check_prepare_trace "calc.at:609"
   71120 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71122 at_status=$? at_failed=false
   71123 $at_check_filter
   71124 echo stderr:; tee stderr <"$at_stderr"
   71125 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71126 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71127 $at_failed && at_fn_log_failure
   71128 $at_traceon; }
   71129 
   71130 
   71131 
   71132 # Normalize the observed and expected error messages, depending upon the
   71133 # options.
   71134 # 1. Remove the traces from observed.
   71135 sed '/^Starting/d
   71136 /^Entering/d
   71137 /^Stack/d
   71138 /^Reading/d
   71139 /^Reducing/d
   71140 /^Return/d
   71141 /^Shifting/d
   71142 /^state/d
   71143 /^Cleanup:/d
   71144 /^Error:/d
   71145 /^Next/d
   71146 /^Now/d
   71147 /^Discarding/d
   71148 / \$[0-9$]* = /d
   71149 /^yydestructor:/d' stderr >at-stderr
   71150 mv at-stderr stderr
   71151 # 2. Create the reference error message.
   71152 cat >expout <<'_ATEOF'
   71153 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   71154 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   71155 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   71156 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   71157 calc: error: 4444 != 1
   71158 _ATEOF
   71159 
   71160 # 3. If locations are not used, remove them.
   71161 
   71162 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   71163 
   71164 # 5. Check
   71165 { set +x
   71166 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   71167 at_fn_check_prepare_trace "calc.at:609"
   71168 ( $at_check_trace; cat stderr
   71169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71170 at_status=$? at_failed=false
   71171 $at_check_filter
   71172 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71173 $at_diff expout "$at_stdout" || at_failed=:
   71174 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71175 $at_failed && at_fn_log_failure
   71176 $at_traceon; }
   71177 
   71178 
   71179 
   71180 # The same, but this time exercising explicitly triggered syntax errors.
   71181 # POSIX says the lookahead causing the error should not be discarded.
   71182 cat >input <<'_ATEOF'
   71183 (!) + (1 2) = 1
   71184 _ATEOF
   71185 
   71186 { set +x
   71187 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   71188 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   71189 ( $at_check_trace;  $PREPARSER ./calc input
   71190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71191 at_status=$? at_failed=false
   71192 $at_check_filter
   71193 echo stderr:; tee stderr <"$at_stderr"
   71194 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71195 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71196 $at_failed && at_fn_log_failure
   71197 $at_traceon; }
   71198 
   71199 { set +x
   71200 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71201 at_fn_check_prepare_trace "calc.at:609"
   71202 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71204 at_status=$? at_failed=false
   71205 $at_check_filter
   71206 echo stderr:; tee stderr <"$at_stderr"
   71207 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71208 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71209 $at_failed && at_fn_log_failure
   71210 $at_traceon; }
   71211 
   71212 
   71213 
   71214 # Normalize the observed and expected error messages, depending upon the
   71215 # options.
   71216 # 1. Remove the traces from observed.
   71217 sed '/^Starting/d
   71218 /^Entering/d
   71219 /^Stack/d
   71220 /^Reading/d
   71221 /^Reducing/d
   71222 /^Return/d
   71223 /^Shifting/d
   71224 /^state/d
   71225 /^Cleanup:/d
   71226 /^Error:/d
   71227 /^Next/d
   71228 /^Now/d
   71229 /^Discarding/d
   71230 / \$[0-9$]* = /d
   71231 /^yydestructor:/d' stderr >at-stderr
   71232 mv at-stderr stderr
   71233 # 2. Create the reference error message.
   71234 cat >expout <<'_ATEOF'
   71235 1.10: syntax error, unexpected number
   71236 calc: error: 2222 != 1
   71237 _ATEOF
   71238 
   71239 # 3. If locations are not used, remove them.
   71240 
   71241 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   71242 
   71243 # 5. Check
   71244 { set +x
   71245 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   71246 at_fn_check_prepare_trace "calc.at:609"
   71247 ( $at_check_trace; cat stderr
   71248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71249 at_status=$? at_failed=false
   71250 $at_check_filter
   71251 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71252 $at_diff expout "$at_stdout" || at_failed=:
   71253 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71254 $at_failed && at_fn_log_failure
   71255 $at_traceon; }
   71256 
   71257 
   71258 cat >input <<'_ATEOF'
   71259 (- *) + (1 2) = 1
   71260 _ATEOF
   71261 
   71262 { set +x
   71263 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   71264 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   71265 ( $at_check_trace;  $PREPARSER ./calc input
   71266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71267 at_status=$? at_failed=false
   71268 $at_check_filter
   71269 echo stderr:; tee stderr <"$at_stderr"
   71270 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71271 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71272 $at_failed && at_fn_log_failure
   71273 $at_traceon; }
   71274 
   71275 { set +x
   71276 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71277 at_fn_check_prepare_trace "calc.at:609"
   71278 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71280 at_status=$? at_failed=false
   71281 $at_check_filter
   71282 echo stderr:; tee stderr <"$at_stderr"
   71283 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71284 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71285 $at_failed && at_fn_log_failure
   71286 $at_traceon; }
   71287 
   71288 
   71289 
   71290 # Normalize the observed and expected error messages, depending upon the
   71291 # options.
   71292 # 1. Remove the traces from observed.
   71293 sed '/^Starting/d
   71294 /^Entering/d
   71295 /^Stack/d
   71296 /^Reading/d
   71297 /^Reducing/d
   71298 /^Return/d
   71299 /^Shifting/d
   71300 /^state/d
   71301 /^Cleanup:/d
   71302 /^Error:/d
   71303 /^Next/d
   71304 /^Now/d
   71305 /^Discarding/d
   71306 / \$[0-9$]* = /d
   71307 /^yydestructor:/d' stderr >at-stderr
   71308 mv at-stderr stderr
   71309 # 2. Create the reference error message.
   71310 cat >expout <<'_ATEOF'
   71311 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   71312 1.12: syntax error, unexpected number
   71313 calc: error: 2222 != 1
   71314 _ATEOF
   71315 
   71316 # 3. If locations are not used, remove them.
   71317 
   71318 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   71319 
   71320 # 5. Check
   71321 { set +x
   71322 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   71323 at_fn_check_prepare_trace "calc.at:609"
   71324 ( $at_check_trace; cat stderr
   71325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71326 at_status=$? at_failed=false
   71327 $at_check_filter
   71328 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71329 $at_diff expout "$at_stdout" || at_failed=:
   71330 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71331 $at_failed && at_fn_log_failure
   71332 $at_traceon; }
   71333 
   71334 
   71335 
   71336 # Check that yyerrok works properly: second error is not reported,
   71337 # third and fourth are.  Parse status is succesfull.
   71338 cat >input <<'_ATEOF'
   71339 (* *) + (*) + (*)
   71340 _ATEOF
   71341 
   71342 { set +x
   71343 $as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
   71344 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
   71345 ( $at_check_trace;  $PREPARSER ./calc input
   71346 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71347 at_status=$? at_failed=false
   71348 $at_check_filter
   71349 echo stderr:; tee stderr <"$at_stderr"
   71350 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71351 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71352 $at_failed && at_fn_log_failure
   71353 $at_traceon; }
   71354 
   71355 { set +x
   71356 $as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71357 at_fn_check_prepare_trace "calc.at:609"
   71358 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71359 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71360 at_status=$? at_failed=false
   71361 $at_check_filter
   71362 echo stderr:; tee stderr <"$at_stderr"
   71363 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71364 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71365 $at_failed && at_fn_log_failure
   71366 $at_traceon; }
   71367 
   71368 
   71369 
   71370 # Normalize the observed and expected error messages, depending upon the
   71371 # options.
   71372 # 1. Remove the traces from observed.
   71373 sed '/^Starting/d
   71374 /^Entering/d
   71375 /^Stack/d
   71376 /^Reading/d
   71377 /^Reducing/d
   71378 /^Return/d
   71379 /^Shifting/d
   71380 /^state/d
   71381 /^Cleanup:/d
   71382 /^Error:/d
   71383 /^Next/d
   71384 /^Now/d
   71385 /^Discarding/d
   71386 / \$[0-9$]* = /d
   71387 /^yydestructor:/d' stderr >at-stderr
   71388 mv at-stderr stderr
   71389 # 2. Create the reference error message.
   71390 cat >expout <<'_ATEOF'
   71391 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   71392 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   71393 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   71394 _ATEOF
   71395 
   71396 # 3. If locations are not used, remove them.
   71397 
   71398 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   71399 
   71400 # 5. Check
   71401 { set +x
   71402 $as_echo "$at_srcdir/calc.at:609: cat stderr"
   71403 at_fn_check_prepare_trace "calc.at:609"
   71404 ( $at_check_trace; cat stderr
   71405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71406 at_status=$? at_failed=false
   71407 $at_check_filter
   71408 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71409 $at_diff expout "$at_stdout" || at_failed=:
   71410 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
   71411 $at_failed && at_fn_log_failure
   71412 $at_traceon; }
   71413 
   71414 
   71415 
   71416 
   71417 
   71418   set +x
   71419   $at_times_p && times >"$at_times_file"
   71420 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   71421 read at_status <"$at_status_file"
   71422 #AT_STOP_209
   71423 #AT_START_210
   71424 at_fn_group_banner 210 'calc.at:611' \
   71425   "Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11
   71426 at_xfail=no
   71427 (
   71428   $as_echo "210. $at_setup_line: testing $at_desc ..."
   71429   $at_traceon
   71430 
   71431 
   71432 
   71433 
   71434 
   71435 
   71436 
   71437 
   71438 
   71439 
   71440 cat >calc.y <<'_ATEOF'
   71441 %code top {
   71442 #include <config.h>
   71443 /* We don't need perfect functions for these tests. */
   71444 #undef malloc
   71445 #undef memcmp
   71446 #undef realloc
   71447 }
   71448 
   71449 /* Infix notation calculator--calc */
   71450 %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc
   71451 
   71452 %code requires
   71453 {
   71454 
   71455   /* Exercise pre-prologue dependency to %union.  */
   71456   typedef int semantic_value;
   71457 }
   71458 
   71459 /* Exercise %union. */
   71460 %union
   71461 {
   71462   semantic_value ival;
   71463 };
   71464 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   71465 
   71466 %code provides
   71467 {
   71468   #include <stdio.h>
   71469   /* The input.  */
   71470   extern FILE *input;
   71471   extern semantic_value global_result;
   71472   extern int global_count;
   71473 }
   71474 
   71475 %code
   71476 {
   71477 #include <assert.h>
   71478 #include <string.h>
   71479 #define USE(Var)
   71480 
   71481 FILE *input;
   71482 static int power (int base, int exponent);
   71483 
   71484 static void calcerror ( const char *msg);
   71485 int calclex (void);
   71486 }
   71487 
   71488 
   71489 
   71490 /* Bison Declarations */
   71491 %token CALC_EOF 0 "end of input"
   71492 %token <ival> NUM "number"
   71493 %type  <ival> exp
   71494 
   71495 %nonassoc '=' /* comparison            */
   71496 %left '-' '+'
   71497 %left '*' '/'
   71498 %left NEG     /* negation--unary minus */
   71499 %right '^'    /* exponentiation        */
   71500 
   71501 /* Grammar follows */
   71502 %%
   71503 input:
   71504   line
   71505 | input line         {  }
   71506 ;
   71507 
   71508 line:
   71509   '\n'
   71510 | exp '\n'           { USE ($1); }
   71511 ;
   71512 
   71513 exp:
   71514   NUM                { $$ = $1;             }
   71515 | exp '=' exp
   71516   {
   71517     if ($1 != $3)
   71518       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   71519     $$ = $1;
   71520   }
   71521 | exp '+' exp        { $$ = $1 + $3;        }
   71522 | exp '-' exp        { $$ = $1 - $3;        }
   71523 | exp '*' exp        { $$ = $1 * $3;        }
   71524 | exp '/' exp        { $$ = $1 / $3;        }
   71525 | '-' exp  %prec NEG { $$ = -$2;            }
   71526 | exp '^' exp        { $$ = power ($1, $3); }
   71527 | '(' exp ')'        { $$ = $2;             }
   71528 | '(' error ')'      { $$ = 1111; yyerrok;  }
   71529 | '!'                { $$ = 0; YYERROR;     }
   71530 | '-' error          { $$ = 0; YYERROR;     }
   71531 ;
   71532 %%
   71533 
   71534 static int
   71535 power (int base, int exponent)
   71536 {
   71537   int res = 1;
   71538   assert (0 <= exponent);
   71539   for (/* Niente */; exponent; --exponent)
   71540     res *= base;
   71541   return res;
   71542 }
   71543 
   71544 
   71545 #include <stdio.h>
   71546 /* A C error reporting function.  */
   71547 static
   71548 void calcerror ( const char *msg)
   71549 {
   71550   YY_LOCATION_PRINT (stderr, (calclloc));
   71551   fprintf (stderr, ": ");
   71552   fprintf (stderr, "%s\n", msg);
   71553 }
   71554 _ATEOF
   71555 
   71556 
   71557 
   71558 cat >calc-lex.c <<'_ATEOF'
   71559 #include <config.h>
   71560 /* We don't need perfect functions for these tests. */
   71561 #undef malloc
   71562 #undef memcmp
   71563 #undef realloc
   71564 
   71565 #include "calc.h"
   71566 
   71567 #include <ctype.h>
   71568 
   71569 int calclex (void);
   71570 static int get_char (void);
   71571 static void unget_char ( int c);
   71572 
   71573 
   71574 static YYLTYPE last_yylloc;
   71575 
   71576 static int
   71577 get_char (void)
   71578 {
   71579   int res = getc (input);
   71580   ;
   71581 
   71582   last_yylloc = (calclloc);
   71583   if (res == '\n')
   71584     {
   71585       (calclloc).last_line++;
   71586       (calclloc).last_column = 1;
   71587     }
   71588   else
   71589     (calclloc).last_column++;
   71590 
   71591   return res;
   71592 }
   71593 
   71594 static void
   71595 unget_char ( int c)
   71596 {
   71597   ;
   71598 
   71599   /* Wrong when C == `\n'. */
   71600   (calclloc) = last_yylloc;
   71601 
   71602   ungetc (c, input);
   71603 }
   71604 
   71605 static int
   71606 read_signed_integer (void)
   71607 {
   71608   int c = get_char ();
   71609   int sign = 1;
   71610   int n = 0;
   71611 
   71612   ;
   71613   if (c == '-')
   71614     {
   71615       c = get_char ();
   71616       sign = -1;
   71617     }
   71618 
   71619   while (isdigit (c))
   71620     {
   71621       n = 10 * n + (c - '0');
   71622       c = get_char ();
   71623     }
   71624 
   71625   unget_char ( c);
   71626 
   71627   return sign * n;
   71628 }
   71629 
   71630 
   71631 /*---------------------------------------------------------------.
   71632 | Lexical analyzer returns an integer on the stack and the token |
   71633 | NUM, or the ASCII character read if not a number.  Skips all   |
   71634 | blanks and tabs, returns 0 for EOF.                            |
   71635 `---------------------------------------------------------------*/
   71636 
   71637 int calclex (void)
   71638 {
   71639   int c;
   71640   /* Skip current token, then white spaces.  */
   71641   do
   71642     {
   71643      (calclloc).first_column = (calclloc).last_column;
   71644       (calclloc).first_line   = (calclloc).last_line;
   71645 
   71646     }
   71647   while ((c = get_char ()) == ' ' || c == '\t');
   71648 
   71649   /* process numbers   */
   71650   if (c == '.' || isdigit (c))
   71651     {
   71652       unget_char ( c);
   71653       (calclval).ival = read_signed_integer ();
   71654       return NUM;
   71655     }
   71656 
   71657   /* Return end-of-file.  */
   71658   if (c == EOF)
   71659     return CALC_EOF;
   71660 
   71661   /* Return single chars. */
   71662   return c;
   71663 }
   71664 _ATEOF
   71665 
   71666 
   71667 cat >calc-main.c <<'_ATEOF'
   71668 #include <config.h>
   71669 /* We don't need perfect functions for these tests. */
   71670 #undef malloc
   71671 #undef memcmp
   71672 #undef realloc
   71673 
   71674 #include "calc.h"
   71675 
   71676 #include <assert.h>
   71677 #if HAVE_UNISTD_H
   71678 # include <unistd.h>
   71679 #else
   71680 # undef alarm
   71681 # define alarm(seconds) /* empty */
   71682 #endif
   71683 
   71684 
   71685 
   71686 semantic_value global_result = 0;
   71687 int global_count = 0;
   71688 
   71689 /* A C main function.  */
   71690 int
   71691 main (int argc, const char **argv)
   71692 {
   71693   semantic_value result = 0;
   71694   int count = 0;
   71695   int status;
   71696 
   71697   /* This used to be alarm (10), but that isn't enough time for
   71698      a July 1995 vintage DEC Alphastation 200 4/100 system,
   71699      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   71700   alarm (100);
   71701 
   71702   if (argc == 2)
   71703     input = fopen (argv[1], "r");
   71704   else
   71705     input = stdin;
   71706 
   71707   if (!input)
   71708     {
   71709       perror (argv[1]);
   71710       return 3;
   71711     }
   71712 
   71713 
   71714   status = calcparse ();
   71715   if (fclose (input))
   71716     perror ("fclose");
   71717   assert (global_result == result);
   71718   assert (global_count == count);
   71719   return status;
   71720 }
   71721 _ATEOF
   71722 
   71723 
   71724 
   71725 
   71726 
   71727 
   71728 
   71729 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   71730   at_save_special_files
   71731   mkdir xml-tests
   71732     # Don't combine these Bison invocations since we want to be sure that
   71733   # --report=all isn't required to get the full XML file.
   71734   { set +x
   71735 $as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   71736                   --graph=xml-tests/test.dot -o calc.c calc.y"
   71737 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611"
   71738 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   71739                   --graph=xml-tests/test.dot -o calc.c calc.y
   71740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71741 at_status=$? at_failed=false
   71742 $at_check_filter
   71743 echo stderr:; cat "$at_stderr"
   71744 echo stdout:; cat "$at_stdout"
   71745 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71746 $at_failed && at_fn_log_failure
   71747 $at_traceon; }
   71748 
   71749   { set +x
   71750 $as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   71751 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:611"
   71752 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   71753 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71754 at_status=$? at_failed=false
   71755 $at_check_filter
   71756 echo stderr:; cat "$at_stderr"
   71757 echo stdout:; cat "$at_stdout"
   71758 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71759 $at_failed && at_fn_log_failure
   71760 $at_traceon; }
   71761 
   71762     cp xml-tests/test.output expout
   71763   { set +x
   71764 $as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\
   71765              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   71766              xml-tests/test.xml"
   71767 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611"
   71768 ( $at_check_trace; $XSLTPROC \
   71769              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   71770              xml-tests/test.xml
   71771 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71772 at_status=$? at_failed=false
   71773 $at_check_filter
   71774 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71775 $at_diff expout "$at_stdout" || at_failed=:
   71776 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71777 $at_failed && at_fn_log_failure
   71778 $at_traceon; }
   71779 
   71780   sort xml-tests/test.dot > expout
   71781   { set +x
   71782 $as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\
   71783              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   71784              xml-tests/test.xml | sort"
   71785 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611"
   71786 ( $at_check_trace; $XSLTPROC \
   71787              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   71788              xml-tests/test.xml | sort
   71789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71790 at_status=$? at_failed=false
   71791 $at_check_filter
   71792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71793 $at_diff expout "$at_stdout" || at_failed=:
   71794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71795 $at_failed && at_fn_log_failure
   71796 $at_traceon; }
   71797 
   71798   rm -rf xml-tests expout
   71799   at_restore_special_files
   71800 fi
   71801 { set +x
   71802 $as_echo "$at_srcdir/calc.at:611: bison -o calc.c calc.y"
   71803 at_fn_check_prepare_trace "calc.at:611"
   71804 ( $at_check_trace; bison -o calc.c calc.y
   71805 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71806 at_status=$? at_failed=false
   71807 $at_check_filter
   71808 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71809 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71810 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71811 $at_failed && at_fn_log_failure
   71812 $at_traceon; }
   71813 
   71814 
   71815    { set +x
   71816 $as_echo "$at_srcdir/calc.at:611: \$BISON_C_WORKS"
   71817 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:611"
   71818 ( $at_check_trace; $BISON_C_WORKS
   71819 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71820 at_status=$? at_failed=false
   71821 $at_check_filter
   71822 echo stderr:; cat "$at_stderr"
   71823 echo stdout:; cat "$at_stdout"
   71824 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71825 $at_failed && at_fn_log_failure
   71826 $at_traceon; }
   71827 
   71828 { set +x
   71829 $as_echo "$at_srcdir/calc.at:611: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   71830 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:611"
   71831 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   71832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71833 at_status=$? at_failed=false
   71834 $at_check_filter
   71835 echo stderr:; cat "$at_stderr"
   71836 echo stdout:; cat "$at_stdout"
   71837 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71838 $at_failed && at_fn_log_failure
   71839 $at_traceon; }
   71840 
   71841 
   71842 { set +x
   71843 $as_echo "$at_srcdir/calc.at:611: \$PERL -ne '
   71844   chomp;
   71845   print \"\$.: {\$_}\\n\"
   71846     if (# No starting/ending empty lines.
   71847         (eof || \$. == 1) && /^\\s*\$/
   71848         # No trailing space.  FIXME: not ready for \"maint\".
   71849         # || /\\s\$/
   71850         )' calc.c
   71851 "
   71852 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611"
   71853 ( $at_check_trace; $PERL -ne '
   71854   chomp;
   71855   print "$.: {$_}\n"
   71856     if (# No starting/ending empty lines.
   71857         (eof || $. == 1) && /^\s*$/
   71858         # No trailing space.  FIXME: not ready for "maint".
   71859         # || /\s$/
   71860         )' calc.c
   71861 
   71862 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71863 at_status=$? at_failed=false
   71864 $at_check_filter
   71865 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71866 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71867 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71868 $at_failed && at_fn_log_failure
   71869 $at_traceon; }
   71870 
   71871 { set +x
   71872 $as_echo "$at_srcdir/calc.at:611: \$PERL -ne '
   71873   chomp;
   71874   print \"\$.: {\$_}\\n\"
   71875     if (# No starting/ending empty lines.
   71876         (eof || \$. == 1) && /^\\s*\$/
   71877         # No trailing space.  FIXME: not ready for \"maint\".
   71878         # || /\\s\$/
   71879         )' calc.h
   71880 "
   71881 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611"
   71882 ( $at_check_trace; $PERL -ne '
   71883   chomp;
   71884   print "$.: {$_}\n"
   71885     if (# No starting/ending empty lines.
   71886         (eof || $. == 1) && /^\s*$/
   71887         # No trailing space.  FIXME: not ready for "maint".
   71888         # || /\s$/
   71889         )' calc.h
   71890 
   71891 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71892 at_status=$? at_failed=false
   71893 $at_check_filter
   71894 at_fn_diff_devnull "$at_stderr" || at_failed=:
   71895 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71896 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71897 $at_failed && at_fn_log_failure
   71898 $at_traceon; }
   71899 
   71900 
   71901 # Test the priorities.
   71902 cat >input <<'_ATEOF'
   71903 1 + 2 * 3 = 7
   71904 1 + 2 * -3 = -5
   71905 
   71906 -1^2 = -1
   71907 (-1)^2 = 1
   71908 
   71909 ---1 = -1
   71910 
   71911 1 - 2 - 3 = -4
   71912 1 - (2 - 3) = 2
   71913 
   71914 2^2^3 = 256
   71915 (2^2)^3 = 64
   71916 _ATEOF
   71917 
   71918 { set +x
   71919 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   71920 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   71921 ( $at_check_trace;  $PREPARSER ./calc input
   71922 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71923 at_status=$? at_failed=false
   71924 $at_check_filter
   71925 echo stderr:; tee stderr <"$at_stderr"
   71926 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71927 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71928 $at_failed && at_fn_log_failure
   71929 $at_traceon; }
   71930 
   71931 { set +x
   71932 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71933 at_fn_check_prepare_trace "calc.at:611"
   71934 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71935 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71936 at_status=$? at_failed=false
   71937 $at_check_filter
   71938 echo stderr:; tee stderr <"$at_stderr"
   71939 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71940 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71941 $at_failed && at_fn_log_failure
   71942 $at_traceon; }
   71943 
   71944 
   71945 
   71946 
   71947 # Some syntax errors.
   71948 cat >input <<'_ATEOF'
   71949 1 2
   71950 _ATEOF
   71951 
   71952 { set +x
   71953 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   71954 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   71955 ( $at_check_trace;  $PREPARSER ./calc input
   71956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71957 at_status=$? at_failed=false
   71958 $at_check_filter
   71959 echo stderr:; tee stderr <"$at_stderr"
   71960 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71961 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
   71962 $at_failed && at_fn_log_failure
   71963 $at_traceon; }
   71964 
   71965 { set +x
   71966 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   71967 at_fn_check_prepare_trace "calc.at:611"
   71968 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   71969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   71970 at_status=$? at_failed=false
   71971 $at_check_filter
   71972 echo stderr:; tee stderr <"$at_stderr"
   71973 at_fn_diff_devnull "$at_stdout" || at_failed=:
   71974 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   71975 $at_failed && at_fn_log_failure
   71976 $at_traceon; }
   71977 
   71978 
   71979 
   71980 # Normalize the observed and expected error messages, depending upon the
   71981 # options.
   71982 # 1. Remove the traces from observed.
   71983 sed '/^Starting/d
   71984 /^Entering/d
   71985 /^Stack/d
   71986 /^Reading/d
   71987 /^Reducing/d
   71988 /^Return/d
   71989 /^Shifting/d
   71990 /^state/d
   71991 /^Cleanup:/d
   71992 /^Error:/d
   71993 /^Next/d
   71994 /^Now/d
   71995 /^Discarding/d
   71996 / \$[0-9$]* = /d
   71997 /^yydestructor:/d' stderr >at-stderr
   71998 mv at-stderr stderr
   71999 # 2. Create the reference error message.
   72000 cat >expout <<'_ATEOF'
   72001 1.3: syntax error, unexpected number
   72002 _ATEOF
   72003 
   72004 # 3. If locations are not used, remove them.
   72005 
   72006 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72007 
   72008 # 5. Check
   72009 { set +x
   72010 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72011 at_fn_check_prepare_trace "calc.at:611"
   72012 ( $at_check_trace; cat stderr
   72013 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72014 at_status=$? at_failed=false
   72015 $at_check_filter
   72016 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72017 $at_diff expout "$at_stdout" || at_failed=:
   72018 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72019 $at_failed && at_fn_log_failure
   72020 $at_traceon; }
   72021 
   72022 
   72023 cat >input <<'_ATEOF'
   72024 1//2
   72025 _ATEOF
   72026 
   72027 { set +x
   72028 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72029 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72030 ( $at_check_trace;  $PREPARSER ./calc input
   72031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72032 at_status=$? at_failed=false
   72033 $at_check_filter
   72034 echo stderr:; tee stderr <"$at_stderr"
   72035 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72036 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
   72037 $at_failed && at_fn_log_failure
   72038 $at_traceon; }
   72039 
   72040 { set +x
   72041 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72042 at_fn_check_prepare_trace "calc.at:611"
   72043 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72044 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72045 at_status=$? at_failed=false
   72046 $at_check_filter
   72047 echo stderr:; tee stderr <"$at_stderr"
   72048 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72049 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72050 $at_failed && at_fn_log_failure
   72051 $at_traceon; }
   72052 
   72053 
   72054 
   72055 # Normalize the observed and expected error messages, depending upon the
   72056 # options.
   72057 # 1. Remove the traces from observed.
   72058 sed '/^Starting/d
   72059 /^Entering/d
   72060 /^Stack/d
   72061 /^Reading/d
   72062 /^Reducing/d
   72063 /^Return/d
   72064 /^Shifting/d
   72065 /^state/d
   72066 /^Cleanup:/d
   72067 /^Error:/d
   72068 /^Next/d
   72069 /^Now/d
   72070 /^Discarding/d
   72071 / \$[0-9$]* = /d
   72072 /^yydestructor:/d' stderr >at-stderr
   72073 mv at-stderr stderr
   72074 # 2. Create the reference error message.
   72075 cat >expout <<'_ATEOF'
   72076 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   72077 _ATEOF
   72078 
   72079 # 3. If locations are not used, remove them.
   72080 
   72081 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72082 
   72083 # 5. Check
   72084 { set +x
   72085 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72086 at_fn_check_prepare_trace "calc.at:611"
   72087 ( $at_check_trace; cat stderr
   72088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72089 at_status=$? at_failed=false
   72090 $at_check_filter
   72091 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72092 $at_diff expout "$at_stdout" || at_failed=:
   72093 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72094 $at_failed && at_fn_log_failure
   72095 $at_traceon; }
   72096 
   72097 
   72098 cat >input <<'_ATEOF'
   72099 error
   72100 _ATEOF
   72101 
   72102 { set +x
   72103 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72104 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72105 ( $at_check_trace;  $PREPARSER ./calc input
   72106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72107 at_status=$? at_failed=false
   72108 $at_check_filter
   72109 echo stderr:; tee stderr <"$at_stderr"
   72110 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72111 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
   72112 $at_failed && at_fn_log_failure
   72113 $at_traceon; }
   72114 
   72115 { set +x
   72116 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72117 at_fn_check_prepare_trace "calc.at:611"
   72118 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72119 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72120 at_status=$? at_failed=false
   72121 $at_check_filter
   72122 echo stderr:; tee stderr <"$at_stderr"
   72123 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72124 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72125 $at_failed && at_fn_log_failure
   72126 $at_traceon; }
   72127 
   72128 
   72129 
   72130 # Normalize the observed and expected error messages, depending upon the
   72131 # options.
   72132 # 1. Remove the traces from observed.
   72133 sed '/^Starting/d
   72134 /^Entering/d
   72135 /^Stack/d
   72136 /^Reading/d
   72137 /^Reducing/d
   72138 /^Return/d
   72139 /^Shifting/d
   72140 /^state/d
   72141 /^Cleanup:/d
   72142 /^Error:/d
   72143 /^Next/d
   72144 /^Now/d
   72145 /^Discarding/d
   72146 / \$[0-9$]* = /d
   72147 /^yydestructor:/d' stderr >at-stderr
   72148 mv at-stderr stderr
   72149 # 2. Create the reference error message.
   72150 cat >expout <<'_ATEOF'
   72151 1.1: syntax error, unexpected $undefined
   72152 _ATEOF
   72153 
   72154 # 3. If locations are not used, remove them.
   72155 
   72156 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72157 
   72158 # 5. Check
   72159 { set +x
   72160 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72161 at_fn_check_prepare_trace "calc.at:611"
   72162 ( $at_check_trace; cat stderr
   72163 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72164 at_status=$? at_failed=false
   72165 $at_check_filter
   72166 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72167 $at_diff expout "$at_stdout" || at_failed=:
   72168 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72169 $at_failed && at_fn_log_failure
   72170 $at_traceon; }
   72171 
   72172 
   72173 cat >input <<'_ATEOF'
   72174 1 = 2 = 3
   72175 _ATEOF
   72176 
   72177 { set +x
   72178 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72179 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72180 ( $at_check_trace;  $PREPARSER ./calc input
   72181 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72182 at_status=$? at_failed=false
   72183 $at_check_filter
   72184 echo stderr:; tee stderr <"$at_stderr"
   72185 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72186 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
   72187 $at_failed && at_fn_log_failure
   72188 $at_traceon; }
   72189 
   72190 { set +x
   72191 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72192 at_fn_check_prepare_trace "calc.at:611"
   72193 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72194 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72195 at_status=$? at_failed=false
   72196 $at_check_filter
   72197 echo stderr:; tee stderr <"$at_stderr"
   72198 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72199 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72200 $at_failed && at_fn_log_failure
   72201 $at_traceon; }
   72202 
   72203 
   72204 
   72205 # Normalize the observed and expected error messages, depending upon the
   72206 # options.
   72207 # 1. Remove the traces from observed.
   72208 sed '/^Starting/d
   72209 /^Entering/d
   72210 /^Stack/d
   72211 /^Reading/d
   72212 /^Reducing/d
   72213 /^Return/d
   72214 /^Shifting/d
   72215 /^state/d
   72216 /^Cleanup:/d
   72217 /^Error:/d
   72218 /^Next/d
   72219 /^Now/d
   72220 /^Discarding/d
   72221 / \$[0-9$]* = /d
   72222 /^yydestructor:/d' stderr >at-stderr
   72223 mv at-stderr stderr
   72224 # 2. Create the reference error message.
   72225 cat >expout <<'_ATEOF'
   72226 1.7: syntax error, unexpected '='
   72227 _ATEOF
   72228 
   72229 # 3. If locations are not used, remove them.
   72230 
   72231 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72232 
   72233 # 5. Check
   72234 { set +x
   72235 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72236 at_fn_check_prepare_trace "calc.at:611"
   72237 ( $at_check_trace; cat stderr
   72238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72239 at_status=$? at_failed=false
   72240 $at_check_filter
   72241 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72242 $at_diff expout "$at_stdout" || at_failed=:
   72243 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72244 $at_failed && at_fn_log_failure
   72245 $at_traceon; }
   72246 
   72247 
   72248 cat >input <<'_ATEOF'
   72249 
   72250 +1
   72251 _ATEOF
   72252 
   72253 { set +x
   72254 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72255 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72256 ( $at_check_trace;  $PREPARSER ./calc input
   72257 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72258 at_status=$? at_failed=false
   72259 $at_check_filter
   72260 echo stderr:; tee stderr <"$at_stderr"
   72261 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72262 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
   72263 $at_failed && at_fn_log_failure
   72264 $at_traceon; }
   72265 
   72266 { set +x
   72267 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72268 at_fn_check_prepare_trace "calc.at:611"
   72269 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72271 at_status=$? at_failed=false
   72272 $at_check_filter
   72273 echo stderr:; tee stderr <"$at_stderr"
   72274 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72275 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72276 $at_failed && at_fn_log_failure
   72277 $at_traceon; }
   72278 
   72279 
   72280 
   72281 # Normalize the observed and expected error messages, depending upon the
   72282 # options.
   72283 # 1. Remove the traces from observed.
   72284 sed '/^Starting/d
   72285 /^Entering/d
   72286 /^Stack/d
   72287 /^Reading/d
   72288 /^Reducing/d
   72289 /^Return/d
   72290 /^Shifting/d
   72291 /^state/d
   72292 /^Cleanup:/d
   72293 /^Error:/d
   72294 /^Next/d
   72295 /^Now/d
   72296 /^Discarding/d
   72297 / \$[0-9$]* = /d
   72298 /^yydestructor:/d' stderr >at-stderr
   72299 mv at-stderr stderr
   72300 # 2. Create the reference error message.
   72301 cat >expout <<'_ATEOF'
   72302 2.1: syntax error, unexpected '+'
   72303 _ATEOF
   72304 
   72305 # 3. If locations are not used, remove them.
   72306 
   72307 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72308 
   72309 # 5. Check
   72310 { set +x
   72311 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72312 at_fn_check_prepare_trace "calc.at:611"
   72313 ( $at_check_trace; cat stderr
   72314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72315 at_status=$? at_failed=false
   72316 $at_check_filter
   72317 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72318 $at_diff expout "$at_stdout" || at_failed=:
   72319 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72320 $at_failed && at_fn_log_failure
   72321 $at_traceon; }
   72322 
   72323 
   72324 # Exercise error messages with EOF: work on an empty file.
   72325 { set +x
   72326 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc /dev/null"
   72327 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:611"
   72328 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   72329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72330 at_status=$? at_failed=false
   72331 $at_check_filter
   72332 echo stderr:; tee stderr <"$at_stderr"
   72333 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72334 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
   72335 $at_failed && at_fn_log_failure
   72336 $at_traceon; }
   72337 
   72338 { set +x
   72339 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72340 at_fn_check_prepare_trace "calc.at:611"
   72341 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72343 at_status=$? at_failed=false
   72344 $at_check_filter
   72345 echo stderr:; tee stderr <"$at_stderr"
   72346 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72347 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72348 $at_failed && at_fn_log_failure
   72349 $at_traceon; }
   72350 
   72351 
   72352 
   72353 # Normalize the observed and expected error messages, depending upon the
   72354 # options.
   72355 # 1. Remove the traces from observed.
   72356 sed '/^Starting/d
   72357 /^Entering/d
   72358 /^Stack/d
   72359 /^Reading/d
   72360 /^Reducing/d
   72361 /^Return/d
   72362 /^Shifting/d
   72363 /^state/d
   72364 /^Cleanup:/d
   72365 /^Error:/d
   72366 /^Next/d
   72367 /^Now/d
   72368 /^Discarding/d
   72369 / \$[0-9$]* = /d
   72370 /^yydestructor:/d' stderr >at-stderr
   72371 mv at-stderr stderr
   72372 # 2. Create the reference error message.
   72373 cat >expout <<'_ATEOF'
   72374 1.1: syntax error, unexpected end of input
   72375 _ATEOF
   72376 
   72377 # 3. If locations are not used, remove them.
   72378 
   72379 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72380 
   72381 # 5. Check
   72382 { set +x
   72383 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72384 at_fn_check_prepare_trace "calc.at:611"
   72385 ( $at_check_trace; cat stderr
   72386 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72387 at_status=$? at_failed=false
   72388 $at_check_filter
   72389 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72390 $at_diff expout "$at_stdout" || at_failed=:
   72391 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72392 $at_failed && at_fn_log_failure
   72393 $at_traceon; }
   72394 
   72395 
   72396 
   72397 # Exercise the error token: without it, we die at the first error,
   72398 # hence be sure to
   72399 #
   72400 # - have several errors which exercise different shift/discardings
   72401 #   - (): nothing to pop, nothing to discard
   72402 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   72403 #   - (* * *): nothing to pop, a lot to discard
   72404 #   - (1 + 2 * *): some to pop and discard
   72405 #
   72406 # - test the action associated to `error'
   72407 #
   72408 # - check the lookahead that triggers an error is not discarded
   72409 #   when we enter error recovery.  Below, the lookahead causing the
   72410 #   first error is ")", which is needed to recover from the error and
   72411 #   produce the "0" that triggers the "0 != 1" error.
   72412 #
   72413 cat >input <<'_ATEOF'
   72414 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   72415 _ATEOF
   72416 
   72417 { set +x
   72418 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72419 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72420 ( $at_check_trace;  $PREPARSER ./calc input
   72421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72422 at_status=$? at_failed=false
   72423 $at_check_filter
   72424 echo stderr:; tee stderr <"$at_stderr"
   72425 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72426 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72427 $at_failed && at_fn_log_failure
   72428 $at_traceon; }
   72429 
   72430 { set +x
   72431 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72432 at_fn_check_prepare_trace "calc.at:611"
   72433 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72434 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72435 at_status=$? at_failed=false
   72436 $at_check_filter
   72437 echo stderr:; tee stderr <"$at_stderr"
   72438 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72439 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72440 $at_failed && at_fn_log_failure
   72441 $at_traceon; }
   72442 
   72443 
   72444 
   72445 # Normalize the observed and expected error messages, depending upon the
   72446 # options.
   72447 # 1. Remove the traces from observed.
   72448 sed '/^Starting/d
   72449 /^Entering/d
   72450 /^Stack/d
   72451 /^Reading/d
   72452 /^Reducing/d
   72453 /^Return/d
   72454 /^Shifting/d
   72455 /^state/d
   72456 /^Cleanup:/d
   72457 /^Error:/d
   72458 /^Next/d
   72459 /^Now/d
   72460 /^Discarding/d
   72461 / \$[0-9$]* = /d
   72462 /^yydestructor:/d' stderr >at-stderr
   72463 mv at-stderr stderr
   72464 # 2. Create the reference error message.
   72465 cat >expout <<'_ATEOF'
   72466 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   72467 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   72468 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   72469 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   72470 calc: error: 4444 != 1
   72471 _ATEOF
   72472 
   72473 # 3. If locations are not used, remove them.
   72474 
   72475 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72476 
   72477 # 5. Check
   72478 { set +x
   72479 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72480 at_fn_check_prepare_trace "calc.at:611"
   72481 ( $at_check_trace; cat stderr
   72482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72483 at_status=$? at_failed=false
   72484 $at_check_filter
   72485 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72486 $at_diff expout "$at_stdout" || at_failed=:
   72487 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72488 $at_failed && at_fn_log_failure
   72489 $at_traceon; }
   72490 
   72491 
   72492 
   72493 # The same, but this time exercising explicitly triggered syntax errors.
   72494 # POSIX says the lookahead causing the error should not be discarded.
   72495 cat >input <<'_ATEOF'
   72496 (!) + (1 2) = 1
   72497 _ATEOF
   72498 
   72499 { set +x
   72500 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72501 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72502 ( $at_check_trace;  $PREPARSER ./calc input
   72503 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72504 at_status=$? at_failed=false
   72505 $at_check_filter
   72506 echo stderr:; tee stderr <"$at_stderr"
   72507 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72508 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72509 $at_failed && at_fn_log_failure
   72510 $at_traceon; }
   72511 
   72512 { set +x
   72513 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72514 at_fn_check_prepare_trace "calc.at:611"
   72515 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72516 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72517 at_status=$? at_failed=false
   72518 $at_check_filter
   72519 echo stderr:; tee stderr <"$at_stderr"
   72520 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72521 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72522 $at_failed && at_fn_log_failure
   72523 $at_traceon; }
   72524 
   72525 
   72526 
   72527 # Normalize the observed and expected error messages, depending upon the
   72528 # options.
   72529 # 1. Remove the traces from observed.
   72530 sed '/^Starting/d
   72531 /^Entering/d
   72532 /^Stack/d
   72533 /^Reading/d
   72534 /^Reducing/d
   72535 /^Return/d
   72536 /^Shifting/d
   72537 /^state/d
   72538 /^Cleanup:/d
   72539 /^Error:/d
   72540 /^Next/d
   72541 /^Now/d
   72542 /^Discarding/d
   72543 / \$[0-9$]* = /d
   72544 /^yydestructor:/d' stderr >at-stderr
   72545 mv at-stderr stderr
   72546 # 2. Create the reference error message.
   72547 cat >expout <<'_ATEOF'
   72548 1.10: syntax error, unexpected number
   72549 calc: error: 2222 != 1
   72550 _ATEOF
   72551 
   72552 # 3. If locations are not used, remove them.
   72553 
   72554 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72555 
   72556 # 5. Check
   72557 { set +x
   72558 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72559 at_fn_check_prepare_trace "calc.at:611"
   72560 ( $at_check_trace; cat stderr
   72561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72562 at_status=$? at_failed=false
   72563 $at_check_filter
   72564 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72565 $at_diff expout "$at_stdout" || at_failed=:
   72566 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72567 $at_failed && at_fn_log_failure
   72568 $at_traceon; }
   72569 
   72570 
   72571 cat >input <<'_ATEOF'
   72572 (- *) + (1 2) = 1
   72573 _ATEOF
   72574 
   72575 { set +x
   72576 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72577 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72578 ( $at_check_trace;  $PREPARSER ./calc input
   72579 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72580 at_status=$? at_failed=false
   72581 $at_check_filter
   72582 echo stderr:; tee stderr <"$at_stderr"
   72583 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72584 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72585 $at_failed && at_fn_log_failure
   72586 $at_traceon; }
   72587 
   72588 { set +x
   72589 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72590 at_fn_check_prepare_trace "calc.at:611"
   72591 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72593 at_status=$? at_failed=false
   72594 $at_check_filter
   72595 echo stderr:; tee stderr <"$at_stderr"
   72596 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72597 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72598 $at_failed && at_fn_log_failure
   72599 $at_traceon; }
   72600 
   72601 
   72602 
   72603 # Normalize the observed and expected error messages, depending upon the
   72604 # options.
   72605 # 1. Remove the traces from observed.
   72606 sed '/^Starting/d
   72607 /^Entering/d
   72608 /^Stack/d
   72609 /^Reading/d
   72610 /^Reducing/d
   72611 /^Return/d
   72612 /^Shifting/d
   72613 /^state/d
   72614 /^Cleanup:/d
   72615 /^Error:/d
   72616 /^Next/d
   72617 /^Now/d
   72618 /^Discarding/d
   72619 / \$[0-9$]* = /d
   72620 /^yydestructor:/d' stderr >at-stderr
   72621 mv at-stderr stderr
   72622 # 2. Create the reference error message.
   72623 cat >expout <<'_ATEOF'
   72624 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   72625 1.12: syntax error, unexpected number
   72626 calc: error: 2222 != 1
   72627 _ATEOF
   72628 
   72629 # 3. If locations are not used, remove them.
   72630 
   72631 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72632 
   72633 # 5. Check
   72634 { set +x
   72635 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72636 at_fn_check_prepare_trace "calc.at:611"
   72637 ( $at_check_trace; cat stderr
   72638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72639 at_status=$? at_failed=false
   72640 $at_check_filter
   72641 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72642 $at_diff expout "$at_stdout" || at_failed=:
   72643 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72644 $at_failed && at_fn_log_failure
   72645 $at_traceon; }
   72646 
   72647 
   72648 
   72649 # Check that yyerrok works properly: second error is not reported,
   72650 # third and fourth are.  Parse status is succesfull.
   72651 cat >input <<'_ATEOF'
   72652 (* *) + (*) + (*)
   72653 _ATEOF
   72654 
   72655 { set +x
   72656 $as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
   72657 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
   72658 ( $at_check_trace;  $PREPARSER ./calc input
   72659 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72660 at_status=$? at_failed=false
   72661 $at_check_filter
   72662 echo stderr:; tee stderr <"$at_stderr"
   72663 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72664 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72665 $at_failed && at_fn_log_failure
   72666 $at_traceon; }
   72667 
   72668 { set +x
   72669 $as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   72670 at_fn_check_prepare_trace "calc.at:611"
   72671 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   72672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72673 at_status=$? at_failed=false
   72674 $at_check_filter
   72675 echo stderr:; tee stderr <"$at_stderr"
   72676 at_fn_diff_devnull "$at_stdout" || at_failed=:
   72677 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72678 $at_failed && at_fn_log_failure
   72679 $at_traceon; }
   72680 
   72681 
   72682 
   72683 # Normalize the observed and expected error messages, depending upon the
   72684 # options.
   72685 # 1. Remove the traces from observed.
   72686 sed '/^Starting/d
   72687 /^Entering/d
   72688 /^Stack/d
   72689 /^Reading/d
   72690 /^Reducing/d
   72691 /^Return/d
   72692 /^Shifting/d
   72693 /^state/d
   72694 /^Cleanup:/d
   72695 /^Error:/d
   72696 /^Next/d
   72697 /^Now/d
   72698 /^Discarding/d
   72699 / \$[0-9$]* = /d
   72700 /^yydestructor:/d' stderr >at-stderr
   72701 mv at-stderr stderr
   72702 # 2. Create the reference error message.
   72703 cat >expout <<'_ATEOF'
   72704 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   72705 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   72706 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   72707 _ATEOF
   72708 
   72709 # 3. If locations are not used, remove them.
   72710 
   72711 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   72712 
   72713 # 5. Check
   72714 { set +x
   72715 $as_echo "$at_srcdir/calc.at:611: cat stderr"
   72716 at_fn_check_prepare_trace "calc.at:611"
   72717 ( $at_check_trace; cat stderr
   72718 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   72719 at_status=$? at_failed=false
   72720 $at_check_filter
   72721 at_fn_diff_devnull "$at_stderr" || at_failed=:
   72722 $at_diff expout "$at_stdout" || at_failed=:
   72723 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
   72724 $at_failed && at_fn_log_failure
   72725 $at_traceon; }
   72726 
   72727 
   72728 
   72729 
   72730 
   72731   set +x
   72732   $at_times_p && times >"$at_times_file"
   72733 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   72734 read at_status <"$at_status_file"
   72735 #AT_STOP_210
   72736 #AT_START_211
   72737 at_fn_group_banner 211 'calc.at:612' \
   72738   "Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11
   72739 at_xfail=no
   72740 (
   72741   $as_echo "211. $at_setup_line: testing $at_desc ..."
   72742   $at_traceon
   72743 
   72744 
   72745 
   72746 
   72747 
   72748 
   72749 
   72750 
   72751 
   72752 
   72753 cat >calc.y <<'_ATEOF'
   72754 %code top {
   72755 #include <config.h>
   72756 /* We don't need perfect functions for these tests. */
   72757 #undef malloc
   72758 #undef memcmp
   72759 #undef realloc
   72760 }
   72761 
   72762 /* Infix notation calculator--calc */
   72763 %error-verbose %locations %defines %define api.prefix "calc" %verbose %yacc
   72764 
   72765 %code requires
   72766 {
   72767 
   72768   /* Exercise pre-prologue dependency to %union.  */
   72769   typedef int semantic_value;
   72770 }
   72771 
   72772 /* Exercise %union. */
   72773 %union
   72774 {
   72775   semantic_value ival;
   72776 };
   72777 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   72778 
   72779 %code provides
   72780 {
   72781   #include <stdio.h>
   72782   /* The input.  */
   72783   extern FILE *input;
   72784   extern semantic_value global_result;
   72785   extern int global_count;
   72786 }
   72787 
   72788 %code
   72789 {
   72790 #include <assert.h>
   72791 #include <string.h>
   72792 #define USE(Var)
   72793 
   72794 FILE *input;
   72795 static int power (int base, int exponent);
   72796 
   72797 static void calcerror ( const char *msg);
   72798 int calclex (void);
   72799 }
   72800 
   72801 
   72802 
   72803 /* Bison Declarations */
   72804 %token CALC_EOF 0 "end of input"
   72805 %token <ival> NUM "number"
   72806 %type  <ival> exp
   72807 
   72808 %nonassoc '=' /* comparison            */
   72809 %left '-' '+'
   72810 %left '*' '/'
   72811 %left NEG     /* negation--unary minus */
   72812 %right '^'    /* exponentiation        */
   72813 
   72814 /* Grammar follows */
   72815 %%
   72816 input:
   72817   line
   72818 | input line         {  }
   72819 ;
   72820 
   72821 line:
   72822   '\n'
   72823 | exp '\n'           { USE ($1); }
   72824 ;
   72825 
   72826 exp:
   72827   NUM                { $$ = $1;             }
   72828 | exp '=' exp
   72829   {
   72830     if ($1 != $3)
   72831       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   72832     $$ = $1;
   72833   }
   72834 | exp '+' exp        { $$ = $1 + $3;        }
   72835 | exp '-' exp        { $$ = $1 - $3;        }
   72836 | exp '*' exp        { $$ = $1 * $3;        }
   72837 | exp '/' exp        { $$ = $1 / $3;        }
   72838 | '-' exp  %prec NEG { $$ = -$2;            }
   72839 | exp '^' exp        { $$ = power ($1, $3); }
   72840 | '(' exp ')'        { $$ = $2;             }
   72841 | '(' error ')'      { $$ = 1111; yyerrok;  }
   72842 | '!'                { $$ = 0; YYERROR;     }
   72843 | '-' error          { $$ = 0; YYERROR;     }
   72844 ;
   72845 %%
   72846 
   72847 static int
   72848 power (int base, int exponent)
   72849 {
   72850   int res = 1;
   72851   assert (0 <= exponent);
   72852   for (/* Niente */; exponent; --exponent)
   72853     res *= base;
   72854   return res;
   72855 }
   72856 
   72857 
   72858 #include <stdio.h>
   72859 /* A C error reporting function.  */
   72860 static
   72861 void calcerror ( const char *msg)
   72862 {
   72863   YY_LOCATION_PRINT (stderr, (calclloc));
   72864   fprintf (stderr, ": ");
   72865   fprintf (stderr, "%s\n", msg);
   72866 }
   72867 _ATEOF
   72868 
   72869 
   72870 
   72871 cat >calc-lex.c <<'_ATEOF'
   72872 #include <config.h>
   72873 /* We don't need perfect functions for these tests. */
   72874 #undef malloc
   72875 #undef memcmp
   72876 #undef realloc
   72877 
   72878 #include "calc.h"
   72879 
   72880 #include <ctype.h>
   72881 
   72882 int calclex (void);
   72883 static int get_char (void);
   72884 static void unget_char ( int c);
   72885 
   72886 
   72887 static CALCLTYPE last_yylloc;
   72888 
   72889 static int
   72890 get_char (void)
   72891 {
   72892   int res = getc (input);
   72893   ;
   72894 
   72895   last_yylloc = (calclloc);
   72896   if (res == '\n')
   72897     {
   72898       (calclloc).last_line++;
   72899       (calclloc).last_column = 1;
   72900     }
   72901   else
   72902     (calclloc).last_column++;
   72903 
   72904   return res;
   72905 }
   72906 
   72907 static void
   72908 unget_char ( int c)
   72909 {
   72910   ;
   72911 
   72912   /* Wrong when C == `\n'. */
   72913   (calclloc) = last_yylloc;
   72914 
   72915   ungetc (c, input);
   72916 }
   72917 
   72918 static int
   72919 read_signed_integer (void)
   72920 {
   72921   int c = get_char ();
   72922   int sign = 1;
   72923   int n = 0;
   72924 
   72925   ;
   72926   if (c == '-')
   72927     {
   72928       c = get_char ();
   72929       sign = -1;
   72930     }
   72931 
   72932   while (isdigit (c))
   72933     {
   72934       n = 10 * n + (c - '0');
   72935       c = get_char ();
   72936     }
   72937 
   72938   unget_char ( c);
   72939 
   72940   return sign * n;
   72941 }
   72942 
   72943 
   72944 /*---------------------------------------------------------------.
   72945 | Lexical analyzer returns an integer on the stack and the token |
   72946 | NUM, or the ASCII character read if not a number.  Skips all   |
   72947 | blanks and tabs, returns 0 for EOF.                            |
   72948 `---------------------------------------------------------------*/
   72949 
   72950 int calclex (void)
   72951 {
   72952   int c;
   72953   /* Skip current token, then white spaces.  */
   72954   do
   72955     {
   72956      (calclloc).first_column = (calclloc).last_column;
   72957       (calclloc).first_line   = (calclloc).last_line;
   72958 
   72959     }
   72960   while ((c = get_char ()) == ' ' || c == '\t');
   72961 
   72962   /* process numbers   */
   72963   if (c == '.' || isdigit (c))
   72964     {
   72965       unget_char ( c);
   72966       (calclval).ival = read_signed_integer ();
   72967       return NUM;
   72968     }
   72969 
   72970   /* Return end-of-file.  */
   72971   if (c == EOF)
   72972     return CALC_EOF;
   72973 
   72974   /* Return single chars. */
   72975   return c;
   72976 }
   72977 _ATEOF
   72978 
   72979 
   72980 cat >calc-main.c <<'_ATEOF'
   72981 #include <config.h>
   72982 /* We don't need perfect functions for these tests. */
   72983 #undef malloc
   72984 #undef memcmp
   72985 #undef realloc
   72986 
   72987 #include "calc.h"
   72988 
   72989 #include <assert.h>
   72990 #if HAVE_UNISTD_H
   72991 # include <unistd.h>
   72992 #else
   72993 # undef alarm
   72994 # define alarm(seconds) /* empty */
   72995 #endif
   72996 
   72997 
   72998 
   72999 semantic_value global_result = 0;
   73000 int global_count = 0;
   73001 
   73002 /* A C main function.  */
   73003 int
   73004 main (int argc, const char **argv)
   73005 {
   73006   semantic_value result = 0;
   73007   int count = 0;
   73008   int status;
   73009 
   73010   /* This used to be alarm (10), but that isn't enough time for
   73011      a July 1995 vintage DEC Alphastation 200 4/100 system,
   73012      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   73013   alarm (100);
   73014 
   73015   if (argc == 2)
   73016     input = fopen (argv[1], "r");
   73017   else
   73018     input = stdin;
   73019 
   73020   if (!input)
   73021     {
   73022       perror (argv[1]);
   73023       return 3;
   73024     }
   73025 
   73026 
   73027   status = calcparse ();
   73028   if (fclose (input))
   73029     perror ("fclose");
   73030   assert (global_result == result);
   73031   assert (global_count == count);
   73032   return status;
   73033 }
   73034 _ATEOF
   73035 
   73036 
   73037 
   73038 
   73039 
   73040 
   73041 
   73042 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   73043   at_save_special_files
   73044   mkdir xml-tests
   73045     # Don't combine these Bison invocations since we want to be sure that
   73046   # --report=all isn't required to get the full XML file.
   73047   { set +x
   73048 $as_echo "$at_srcdir/calc.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   73049                   --graph=xml-tests/test.dot -o calc.c calc.y"
   73050 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612"
   73051 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   73052                   --graph=xml-tests/test.dot -o calc.c calc.y
   73053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73054 at_status=$? at_failed=false
   73055 $at_check_filter
   73056 echo stderr:; cat "$at_stderr"
   73057 echo stdout:; cat "$at_stdout"
   73058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73059 $at_failed && at_fn_log_failure
   73060 $at_traceon; }
   73061 
   73062   { set +x
   73063 $as_echo "$at_srcdir/calc.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   73064 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:612"
   73065 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   73066 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73067 at_status=$? at_failed=false
   73068 $at_check_filter
   73069 echo stderr:; cat "$at_stderr"
   73070 echo stdout:; cat "$at_stdout"
   73071 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73072 $at_failed && at_fn_log_failure
   73073 $at_traceon; }
   73074 
   73075     cp xml-tests/test.output expout
   73076   { set +x
   73077 $as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\
   73078              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   73079              xml-tests/test.xml"
   73080 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612"
   73081 ( $at_check_trace; $XSLTPROC \
   73082              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   73083              xml-tests/test.xml
   73084 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73085 at_status=$? at_failed=false
   73086 $at_check_filter
   73087 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73088 $at_diff expout "$at_stdout" || at_failed=:
   73089 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73090 $at_failed && at_fn_log_failure
   73091 $at_traceon; }
   73092 
   73093   sort xml-tests/test.dot > expout
   73094   { set +x
   73095 $as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\
   73096              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   73097              xml-tests/test.xml | sort"
   73098 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612"
   73099 ( $at_check_trace; $XSLTPROC \
   73100              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   73101              xml-tests/test.xml | sort
   73102 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73103 at_status=$? at_failed=false
   73104 $at_check_filter
   73105 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73106 $at_diff expout "$at_stdout" || at_failed=:
   73107 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73108 $at_failed && at_fn_log_failure
   73109 $at_traceon; }
   73110 
   73111   rm -rf xml-tests expout
   73112   at_restore_special_files
   73113 fi
   73114 { set +x
   73115 $as_echo "$at_srcdir/calc.at:612: bison -o calc.c calc.y"
   73116 at_fn_check_prepare_trace "calc.at:612"
   73117 ( $at_check_trace; bison -o calc.c calc.y
   73118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73119 at_status=$? at_failed=false
   73120 $at_check_filter
   73121 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73122 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73123 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73124 $at_failed && at_fn_log_failure
   73125 $at_traceon; }
   73126 
   73127 
   73128    { set +x
   73129 $as_echo "$at_srcdir/calc.at:612: \$BISON_C_WORKS"
   73130 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:612"
   73131 ( $at_check_trace; $BISON_C_WORKS
   73132 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73133 at_status=$? at_failed=false
   73134 $at_check_filter
   73135 echo stderr:; cat "$at_stderr"
   73136 echo stdout:; cat "$at_stdout"
   73137 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73138 $at_failed && at_fn_log_failure
   73139 $at_traceon; }
   73140 
   73141 { set +x
   73142 $as_echo "$at_srcdir/calc.at:612: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   73143 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:612"
   73144 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   73145 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73146 at_status=$? at_failed=false
   73147 $at_check_filter
   73148 echo stderr:; cat "$at_stderr"
   73149 echo stdout:; cat "$at_stdout"
   73150 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73151 $at_failed && at_fn_log_failure
   73152 $at_traceon; }
   73153 
   73154 
   73155 { set +x
   73156 $as_echo "$at_srcdir/calc.at:612: \$PERL -ne '
   73157   chomp;
   73158   print \"\$.: {\$_}\\n\"
   73159     if (# No starting/ending empty lines.
   73160         (eof || \$. == 1) && /^\\s*\$/
   73161         # No trailing space.  FIXME: not ready for \"maint\".
   73162         # || /\\s\$/
   73163         )' calc.c
   73164 "
   73165 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612"
   73166 ( $at_check_trace; $PERL -ne '
   73167   chomp;
   73168   print "$.: {$_}\n"
   73169     if (# No starting/ending empty lines.
   73170         (eof || $. == 1) && /^\s*$/
   73171         # No trailing space.  FIXME: not ready for "maint".
   73172         # || /\s$/
   73173         )' calc.c
   73174 
   73175 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73176 at_status=$? at_failed=false
   73177 $at_check_filter
   73178 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73179 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73180 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73181 $at_failed && at_fn_log_failure
   73182 $at_traceon; }
   73183 
   73184 { set +x
   73185 $as_echo "$at_srcdir/calc.at:612: \$PERL -ne '
   73186   chomp;
   73187   print \"\$.: {\$_}\\n\"
   73188     if (# No starting/ending empty lines.
   73189         (eof || \$. == 1) && /^\\s*\$/
   73190         # No trailing space.  FIXME: not ready for \"maint\".
   73191         # || /\\s\$/
   73192         )' calc.h
   73193 "
   73194 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612"
   73195 ( $at_check_trace; $PERL -ne '
   73196   chomp;
   73197   print "$.: {$_}\n"
   73198     if (# No starting/ending empty lines.
   73199         (eof || $. == 1) && /^\s*$/
   73200         # No trailing space.  FIXME: not ready for "maint".
   73201         # || /\s$/
   73202         )' calc.h
   73203 
   73204 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73205 at_status=$? at_failed=false
   73206 $at_check_filter
   73207 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73208 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73209 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73210 $at_failed && at_fn_log_failure
   73211 $at_traceon; }
   73212 
   73213 
   73214 # Test the priorities.
   73215 cat >input <<'_ATEOF'
   73216 1 + 2 * 3 = 7
   73217 1 + 2 * -3 = -5
   73218 
   73219 -1^2 = -1
   73220 (-1)^2 = 1
   73221 
   73222 ---1 = -1
   73223 
   73224 1 - 2 - 3 = -4
   73225 1 - (2 - 3) = 2
   73226 
   73227 2^2^3 = 256
   73228 (2^2)^3 = 64
   73229 _ATEOF
   73230 
   73231 { set +x
   73232 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73233 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73234 ( $at_check_trace;  $PREPARSER ./calc input
   73235 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73236 at_status=$? at_failed=false
   73237 $at_check_filter
   73238 echo stderr:; tee stderr <"$at_stderr"
   73239 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73240 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73241 $at_failed && at_fn_log_failure
   73242 $at_traceon; }
   73243 
   73244 { set +x
   73245 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73246 at_fn_check_prepare_trace "calc.at:612"
   73247 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73249 at_status=$? at_failed=false
   73250 $at_check_filter
   73251 echo stderr:; tee stderr <"$at_stderr"
   73252 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73253 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73254 $at_failed && at_fn_log_failure
   73255 $at_traceon; }
   73256 
   73257 
   73258 
   73259 
   73260 # Some syntax errors.
   73261 cat >input <<'_ATEOF'
   73262 1 2
   73263 _ATEOF
   73264 
   73265 { set +x
   73266 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73267 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73268 ( $at_check_trace;  $PREPARSER ./calc input
   73269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73270 at_status=$? at_failed=false
   73271 $at_check_filter
   73272 echo stderr:; tee stderr <"$at_stderr"
   73273 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73274 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
   73275 $at_failed && at_fn_log_failure
   73276 $at_traceon; }
   73277 
   73278 { set +x
   73279 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73280 at_fn_check_prepare_trace "calc.at:612"
   73281 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73283 at_status=$? at_failed=false
   73284 $at_check_filter
   73285 echo stderr:; tee stderr <"$at_stderr"
   73286 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73287 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73288 $at_failed && at_fn_log_failure
   73289 $at_traceon; }
   73290 
   73291 
   73292 
   73293 # Normalize the observed and expected error messages, depending upon the
   73294 # options.
   73295 # 1. Remove the traces from observed.
   73296 sed '/^Starting/d
   73297 /^Entering/d
   73298 /^Stack/d
   73299 /^Reading/d
   73300 /^Reducing/d
   73301 /^Return/d
   73302 /^Shifting/d
   73303 /^state/d
   73304 /^Cleanup:/d
   73305 /^Error:/d
   73306 /^Next/d
   73307 /^Now/d
   73308 /^Discarding/d
   73309 / \$[0-9$]* = /d
   73310 /^yydestructor:/d' stderr >at-stderr
   73311 mv at-stderr stderr
   73312 # 2. Create the reference error message.
   73313 cat >expout <<'_ATEOF'
   73314 1.3: syntax error, unexpected number
   73315 _ATEOF
   73316 
   73317 # 3. If locations are not used, remove them.
   73318 
   73319 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73320 
   73321 # 5. Check
   73322 { set +x
   73323 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73324 at_fn_check_prepare_trace "calc.at:612"
   73325 ( $at_check_trace; cat stderr
   73326 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73327 at_status=$? at_failed=false
   73328 $at_check_filter
   73329 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73330 $at_diff expout "$at_stdout" || at_failed=:
   73331 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73332 $at_failed && at_fn_log_failure
   73333 $at_traceon; }
   73334 
   73335 
   73336 cat >input <<'_ATEOF'
   73337 1//2
   73338 _ATEOF
   73339 
   73340 { set +x
   73341 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73342 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73343 ( $at_check_trace;  $PREPARSER ./calc input
   73344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73345 at_status=$? at_failed=false
   73346 $at_check_filter
   73347 echo stderr:; tee stderr <"$at_stderr"
   73348 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73349 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
   73350 $at_failed && at_fn_log_failure
   73351 $at_traceon; }
   73352 
   73353 { set +x
   73354 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73355 at_fn_check_prepare_trace "calc.at:612"
   73356 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73357 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73358 at_status=$? at_failed=false
   73359 $at_check_filter
   73360 echo stderr:; tee stderr <"$at_stderr"
   73361 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73362 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73363 $at_failed && at_fn_log_failure
   73364 $at_traceon; }
   73365 
   73366 
   73367 
   73368 # Normalize the observed and expected error messages, depending upon the
   73369 # options.
   73370 # 1. Remove the traces from observed.
   73371 sed '/^Starting/d
   73372 /^Entering/d
   73373 /^Stack/d
   73374 /^Reading/d
   73375 /^Reducing/d
   73376 /^Return/d
   73377 /^Shifting/d
   73378 /^state/d
   73379 /^Cleanup:/d
   73380 /^Error:/d
   73381 /^Next/d
   73382 /^Now/d
   73383 /^Discarding/d
   73384 / \$[0-9$]* = /d
   73385 /^yydestructor:/d' stderr >at-stderr
   73386 mv at-stderr stderr
   73387 # 2. Create the reference error message.
   73388 cat >expout <<'_ATEOF'
   73389 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   73390 _ATEOF
   73391 
   73392 # 3. If locations are not used, remove them.
   73393 
   73394 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73395 
   73396 # 5. Check
   73397 { set +x
   73398 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73399 at_fn_check_prepare_trace "calc.at:612"
   73400 ( $at_check_trace; cat stderr
   73401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73402 at_status=$? at_failed=false
   73403 $at_check_filter
   73404 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73405 $at_diff expout "$at_stdout" || at_failed=:
   73406 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73407 $at_failed && at_fn_log_failure
   73408 $at_traceon; }
   73409 
   73410 
   73411 cat >input <<'_ATEOF'
   73412 error
   73413 _ATEOF
   73414 
   73415 { set +x
   73416 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73417 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73418 ( $at_check_trace;  $PREPARSER ./calc input
   73419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73420 at_status=$? at_failed=false
   73421 $at_check_filter
   73422 echo stderr:; tee stderr <"$at_stderr"
   73423 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73424 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
   73425 $at_failed && at_fn_log_failure
   73426 $at_traceon; }
   73427 
   73428 { set +x
   73429 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73430 at_fn_check_prepare_trace "calc.at:612"
   73431 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73433 at_status=$? at_failed=false
   73434 $at_check_filter
   73435 echo stderr:; tee stderr <"$at_stderr"
   73436 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73437 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73438 $at_failed && at_fn_log_failure
   73439 $at_traceon; }
   73440 
   73441 
   73442 
   73443 # Normalize the observed and expected error messages, depending upon the
   73444 # options.
   73445 # 1. Remove the traces from observed.
   73446 sed '/^Starting/d
   73447 /^Entering/d
   73448 /^Stack/d
   73449 /^Reading/d
   73450 /^Reducing/d
   73451 /^Return/d
   73452 /^Shifting/d
   73453 /^state/d
   73454 /^Cleanup:/d
   73455 /^Error:/d
   73456 /^Next/d
   73457 /^Now/d
   73458 /^Discarding/d
   73459 / \$[0-9$]* = /d
   73460 /^yydestructor:/d' stderr >at-stderr
   73461 mv at-stderr stderr
   73462 # 2. Create the reference error message.
   73463 cat >expout <<'_ATEOF'
   73464 1.1: syntax error, unexpected $undefined
   73465 _ATEOF
   73466 
   73467 # 3. If locations are not used, remove them.
   73468 
   73469 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73470 
   73471 # 5. Check
   73472 { set +x
   73473 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73474 at_fn_check_prepare_trace "calc.at:612"
   73475 ( $at_check_trace; cat stderr
   73476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73477 at_status=$? at_failed=false
   73478 $at_check_filter
   73479 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73480 $at_diff expout "$at_stdout" || at_failed=:
   73481 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73482 $at_failed && at_fn_log_failure
   73483 $at_traceon; }
   73484 
   73485 
   73486 cat >input <<'_ATEOF'
   73487 1 = 2 = 3
   73488 _ATEOF
   73489 
   73490 { set +x
   73491 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73492 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73493 ( $at_check_trace;  $PREPARSER ./calc input
   73494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73495 at_status=$? at_failed=false
   73496 $at_check_filter
   73497 echo stderr:; tee stderr <"$at_stderr"
   73498 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73499 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
   73500 $at_failed && at_fn_log_failure
   73501 $at_traceon; }
   73502 
   73503 { set +x
   73504 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73505 at_fn_check_prepare_trace "calc.at:612"
   73506 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73508 at_status=$? at_failed=false
   73509 $at_check_filter
   73510 echo stderr:; tee stderr <"$at_stderr"
   73511 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73512 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73513 $at_failed && at_fn_log_failure
   73514 $at_traceon; }
   73515 
   73516 
   73517 
   73518 # Normalize the observed and expected error messages, depending upon the
   73519 # options.
   73520 # 1. Remove the traces from observed.
   73521 sed '/^Starting/d
   73522 /^Entering/d
   73523 /^Stack/d
   73524 /^Reading/d
   73525 /^Reducing/d
   73526 /^Return/d
   73527 /^Shifting/d
   73528 /^state/d
   73529 /^Cleanup:/d
   73530 /^Error:/d
   73531 /^Next/d
   73532 /^Now/d
   73533 /^Discarding/d
   73534 / \$[0-9$]* = /d
   73535 /^yydestructor:/d' stderr >at-stderr
   73536 mv at-stderr stderr
   73537 # 2. Create the reference error message.
   73538 cat >expout <<'_ATEOF'
   73539 1.7: syntax error, unexpected '='
   73540 _ATEOF
   73541 
   73542 # 3. If locations are not used, remove them.
   73543 
   73544 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73545 
   73546 # 5. Check
   73547 { set +x
   73548 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73549 at_fn_check_prepare_trace "calc.at:612"
   73550 ( $at_check_trace; cat stderr
   73551 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73552 at_status=$? at_failed=false
   73553 $at_check_filter
   73554 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73555 $at_diff expout "$at_stdout" || at_failed=:
   73556 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73557 $at_failed && at_fn_log_failure
   73558 $at_traceon; }
   73559 
   73560 
   73561 cat >input <<'_ATEOF'
   73562 
   73563 +1
   73564 _ATEOF
   73565 
   73566 { set +x
   73567 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73568 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73569 ( $at_check_trace;  $PREPARSER ./calc input
   73570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73571 at_status=$? at_failed=false
   73572 $at_check_filter
   73573 echo stderr:; tee stderr <"$at_stderr"
   73574 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73575 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
   73576 $at_failed && at_fn_log_failure
   73577 $at_traceon; }
   73578 
   73579 { set +x
   73580 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73581 at_fn_check_prepare_trace "calc.at:612"
   73582 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73584 at_status=$? at_failed=false
   73585 $at_check_filter
   73586 echo stderr:; tee stderr <"$at_stderr"
   73587 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73588 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73589 $at_failed && at_fn_log_failure
   73590 $at_traceon; }
   73591 
   73592 
   73593 
   73594 # Normalize the observed and expected error messages, depending upon the
   73595 # options.
   73596 # 1. Remove the traces from observed.
   73597 sed '/^Starting/d
   73598 /^Entering/d
   73599 /^Stack/d
   73600 /^Reading/d
   73601 /^Reducing/d
   73602 /^Return/d
   73603 /^Shifting/d
   73604 /^state/d
   73605 /^Cleanup:/d
   73606 /^Error:/d
   73607 /^Next/d
   73608 /^Now/d
   73609 /^Discarding/d
   73610 / \$[0-9$]* = /d
   73611 /^yydestructor:/d' stderr >at-stderr
   73612 mv at-stderr stderr
   73613 # 2. Create the reference error message.
   73614 cat >expout <<'_ATEOF'
   73615 2.1: syntax error, unexpected '+'
   73616 _ATEOF
   73617 
   73618 # 3. If locations are not used, remove them.
   73619 
   73620 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73621 
   73622 # 5. Check
   73623 { set +x
   73624 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73625 at_fn_check_prepare_trace "calc.at:612"
   73626 ( $at_check_trace; cat stderr
   73627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73628 at_status=$? at_failed=false
   73629 $at_check_filter
   73630 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73631 $at_diff expout "$at_stdout" || at_failed=:
   73632 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73633 $at_failed && at_fn_log_failure
   73634 $at_traceon; }
   73635 
   73636 
   73637 # Exercise error messages with EOF: work on an empty file.
   73638 { set +x
   73639 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc /dev/null"
   73640 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:612"
   73641 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   73642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73643 at_status=$? at_failed=false
   73644 $at_check_filter
   73645 echo stderr:; tee stderr <"$at_stderr"
   73646 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73647 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
   73648 $at_failed && at_fn_log_failure
   73649 $at_traceon; }
   73650 
   73651 { set +x
   73652 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73653 at_fn_check_prepare_trace "calc.at:612"
   73654 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73655 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73656 at_status=$? at_failed=false
   73657 $at_check_filter
   73658 echo stderr:; tee stderr <"$at_stderr"
   73659 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73660 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73661 $at_failed && at_fn_log_failure
   73662 $at_traceon; }
   73663 
   73664 
   73665 
   73666 # Normalize the observed and expected error messages, depending upon the
   73667 # options.
   73668 # 1. Remove the traces from observed.
   73669 sed '/^Starting/d
   73670 /^Entering/d
   73671 /^Stack/d
   73672 /^Reading/d
   73673 /^Reducing/d
   73674 /^Return/d
   73675 /^Shifting/d
   73676 /^state/d
   73677 /^Cleanup:/d
   73678 /^Error:/d
   73679 /^Next/d
   73680 /^Now/d
   73681 /^Discarding/d
   73682 / \$[0-9$]* = /d
   73683 /^yydestructor:/d' stderr >at-stderr
   73684 mv at-stderr stderr
   73685 # 2. Create the reference error message.
   73686 cat >expout <<'_ATEOF'
   73687 1.1: syntax error, unexpected end of input
   73688 _ATEOF
   73689 
   73690 # 3. If locations are not used, remove them.
   73691 
   73692 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73693 
   73694 # 5. Check
   73695 { set +x
   73696 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73697 at_fn_check_prepare_trace "calc.at:612"
   73698 ( $at_check_trace; cat stderr
   73699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73700 at_status=$? at_failed=false
   73701 $at_check_filter
   73702 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73703 $at_diff expout "$at_stdout" || at_failed=:
   73704 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73705 $at_failed && at_fn_log_failure
   73706 $at_traceon; }
   73707 
   73708 
   73709 
   73710 # Exercise the error token: without it, we die at the first error,
   73711 # hence be sure to
   73712 #
   73713 # - have several errors which exercise different shift/discardings
   73714 #   - (): nothing to pop, nothing to discard
   73715 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   73716 #   - (* * *): nothing to pop, a lot to discard
   73717 #   - (1 + 2 * *): some to pop and discard
   73718 #
   73719 # - test the action associated to `error'
   73720 #
   73721 # - check the lookahead that triggers an error is not discarded
   73722 #   when we enter error recovery.  Below, the lookahead causing the
   73723 #   first error is ")", which is needed to recover from the error and
   73724 #   produce the "0" that triggers the "0 != 1" error.
   73725 #
   73726 cat >input <<'_ATEOF'
   73727 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   73728 _ATEOF
   73729 
   73730 { set +x
   73731 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73732 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73733 ( $at_check_trace;  $PREPARSER ./calc input
   73734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73735 at_status=$? at_failed=false
   73736 $at_check_filter
   73737 echo stderr:; tee stderr <"$at_stderr"
   73738 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73739 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73740 $at_failed && at_fn_log_failure
   73741 $at_traceon; }
   73742 
   73743 { set +x
   73744 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73745 at_fn_check_prepare_trace "calc.at:612"
   73746 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73747 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73748 at_status=$? at_failed=false
   73749 $at_check_filter
   73750 echo stderr:; tee stderr <"$at_stderr"
   73751 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73752 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73753 $at_failed && at_fn_log_failure
   73754 $at_traceon; }
   73755 
   73756 
   73757 
   73758 # Normalize the observed and expected error messages, depending upon the
   73759 # options.
   73760 # 1. Remove the traces from observed.
   73761 sed '/^Starting/d
   73762 /^Entering/d
   73763 /^Stack/d
   73764 /^Reading/d
   73765 /^Reducing/d
   73766 /^Return/d
   73767 /^Shifting/d
   73768 /^state/d
   73769 /^Cleanup:/d
   73770 /^Error:/d
   73771 /^Next/d
   73772 /^Now/d
   73773 /^Discarding/d
   73774 / \$[0-9$]* = /d
   73775 /^yydestructor:/d' stderr >at-stderr
   73776 mv at-stderr stderr
   73777 # 2. Create the reference error message.
   73778 cat >expout <<'_ATEOF'
   73779 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   73780 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   73781 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   73782 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   73783 calc: error: 4444 != 1
   73784 _ATEOF
   73785 
   73786 # 3. If locations are not used, remove them.
   73787 
   73788 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73789 
   73790 # 5. Check
   73791 { set +x
   73792 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73793 at_fn_check_prepare_trace "calc.at:612"
   73794 ( $at_check_trace; cat stderr
   73795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73796 at_status=$? at_failed=false
   73797 $at_check_filter
   73798 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73799 $at_diff expout "$at_stdout" || at_failed=:
   73800 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73801 $at_failed && at_fn_log_failure
   73802 $at_traceon; }
   73803 
   73804 
   73805 
   73806 # The same, but this time exercising explicitly triggered syntax errors.
   73807 # POSIX says the lookahead causing the error should not be discarded.
   73808 cat >input <<'_ATEOF'
   73809 (!) + (1 2) = 1
   73810 _ATEOF
   73811 
   73812 { set +x
   73813 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73814 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73815 ( $at_check_trace;  $PREPARSER ./calc input
   73816 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73817 at_status=$? at_failed=false
   73818 $at_check_filter
   73819 echo stderr:; tee stderr <"$at_stderr"
   73820 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73821 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73822 $at_failed && at_fn_log_failure
   73823 $at_traceon; }
   73824 
   73825 { set +x
   73826 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73827 at_fn_check_prepare_trace "calc.at:612"
   73828 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73829 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73830 at_status=$? at_failed=false
   73831 $at_check_filter
   73832 echo stderr:; tee stderr <"$at_stderr"
   73833 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73834 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73835 $at_failed && at_fn_log_failure
   73836 $at_traceon; }
   73837 
   73838 
   73839 
   73840 # Normalize the observed and expected error messages, depending upon the
   73841 # options.
   73842 # 1. Remove the traces from observed.
   73843 sed '/^Starting/d
   73844 /^Entering/d
   73845 /^Stack/d
   73846 /^Reading/d
   73847 /^Reducing/d
   73848 /^Return/d
   73849 /^Shifting/d
   73850 /^state/d
   73851 /^Cleanup:/d
   73852 /^Error:/d
   73853 /^Next/d
   73854 /^Now/d
   73855 /^Discarding/d
   73856 / \$[0-9$]* = /d
   73857 /^yydestructor:/d' stderr >at-stderr
   73858 mv at-stderr stderr
   73859 # 2. Create the reference error message.
   73860 cat >expout <<'_ATEOF'
   73861 1.10: syntax error, unexpected number
   73862 calc: error: 2222 != 1
   73863 _ATEOF
   73864 
   73865 # 3. If locations are not used, remove them.
   73866 
   73867 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73868 
   73869 # 5. Check
   73870 { set +x
   73871 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73872 at_fn_check_prepare_trace "calc.at:612"
   73873 ( $at_check_trace; cat stderr
   73874 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73875 at_status=$? at_failed=false
   73876 $at_check_filter
   73877 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73878 $at_diff expout "$at_stdout" || at_failed=:
   73879 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73880 $at_failed && at_fn_log_failure
   73881 $at_traceon; }
   73882 
   73883 
   73884 cat >input <<'_ATEOF'
   73885 (- *) + (1 2) = 1
   73886 _ATEOF
   73887 
   73888 { set +x
   73889 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73890 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73891 ( $at_check_trace;  $PREPARSER ./calc input
   73892 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73893 at_status=$? at_failed=false
   73894 $at_check_filter
   73895 echo stderr:; tee stderr <"$at_stderr"
   73896 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73897 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73898 $at_failed && at_fn_log_failure
   73899 $at_traceon; }
   73900 
   73901 { set +x
   73902 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73903 at_fn_check_prepare_trace "calc.at:612"
   73904 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73905 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73906 at_status=$? at_failed=false
   73907 $at_check_filter
   73908 echo stderr:; tee stderr <"$at_stderr"
   73909 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73910 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73911 $at_failed && at_fn_log_failure
   73912 $at_traceon; }
   73913 
   73914 
   73915 
   73916 # Normalize the observed and expected error messages, depending upon the
   73917 # options.
   73918 # 1. Remove the traces from observed.
   73919 sed '/^Starting/d
   73920 /^Entering/d
   73921 /^Stack/d
   73922 /^Reading/d
   73923 /^Reducing/d
   73924 /^Return/d
   73925 /^Shifting/d
   73926 /^state/d
   73927 /^Cleanup:/d
   73928 /^Error:/d
   73929 /^Next/d
   73930 /^Now/d
   73931 /^Discarding/d
   73932 / \$[0-9$]* = /d
   73933 /^yydestructor:/d' stderr >at-stderr
   73934 mv at-stderr stderr
   73935 # 2. Create the reference error message.
   73936 cat >expout <<'_ATEOF'
   73937 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   73938 1.12: syntax error, unexpected number
   73939 calc: error: 2222 != 1
   73940 _ATEOF
   73941 
   73942 # 3. If locations are not used, remove them.
   73943 
   73944 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   73945 
   73946 # 5. Check
   73947 { set +x
   73948 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   73949 at_fn_check_prepare_trace "calc.at:612"
   73950 ( $at_check_trace; cat stderr
   73951 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73952 at_status=$? at_failed=false
   73953 $at_check_filter
   73954 at_fn_diff_devnull "$at_stderr" || at_failed=:
   73955 $at_diff expout "$at_stdout" || at_failed=:
   73956 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73957 $at_failed && at_fn_log_failure
   73958 $at_traceon; }
   73959 
   73960 
   73961 
   73962 # Check that yyerrok works properly: second error is not reported,
   73963 # third and fourth are.  Parse status is succesfull.
   73964 cat >input <<'_ATEOF'
   73965 (* *) + (*) + (*)
   73966 _ATEOF
   73967 
   73968 { set +x
   73969 $as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
   73970 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
   73971 ( $at_check_trace;  $PREPARSER ./calc input
   73972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73973 at_status=$? at_failed=false
   73974 $at_check_filter
   73975 echo stderr:; tee stderr <"$at_stderr"
   73976 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73977 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73978 $at_failed && at_fn_log_failure
   73979 $at_traceon; }
   73980 
   73981 { set +x
   73982 $as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   73983 at_fn_check_prepare_trace "calc.at:612"
   73984 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   73985 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   73986 at_status=$? at_failed=false
   73987 $at_check_filter
   73988 echo stderr:; tee stderr <"$at_stderr"
   73989 at_fn_diff_devnull "$at_stdout" || at_failed=:
   73990 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   73991 $at_failed && at_fn_log_failure
   73992 $at_traceon; }
   73993 
   73994 
   73995 
   73996 # Normalize the observed and expected error messages, depending upon the
   73997 # options.
   73998 # 1. Remove the traces from observed.
   73999 sed '/^Starting/d
   74000 /^Entering/d
   74001 /^Stack/d
   74002 /^Reading/d
   74003 /^Reducing/d
   74004 /^Return/d
   74005 /^Shifting/d
   74006 /^state/d
   74007 /^Cleanup:/d
   74008 /^Error:/d
   74009 /^Next/d
   74010 /^Now/d
   74011 /^Discarding/d
   74012 / \$[0-9$]* = /d
   74013 /^yydestructor:/d' stderr >at-stderr
   74014 mv at-stderr stderr
   74015 # 2. Create the reference error message.
   74016 cat >expout <<'_ATEOF'
   74017 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   74018 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   74019 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   74020 _ATEOF
   74021 
   74022 # 3. If locations are not used, remove them.
   74023 
   74024 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74025 
   74026 # 5. Check
   74027 { set +x
   74028 $as_echo "$at_srcdir/calc.at:612: cat stderr"
   74029 at_fn_check_prepare_trace "calc.at:612"
   74030 ( $at_check_trace; cat stderr
   74031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74032 at_status=$? at_failed=false
   74033 $at_check_filter
   74034 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74035 $at_diff expout "$at_stdout" || at_failed=:
   74036 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
   74037 $at_failed && at_fn_log_failure
   74038 $at_traceon; }
   74039 
   74040 
   74041 
   74042 
   74043 
   74044   set +x
   74045   $at_times_p && times >"$at_times_file"
   74046 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   74047 read at_status <"$at_status_file"
   74048 #AT_STOP_211
   74049 #AT_START_212
   74050 at_fn_group_banner 212 'calc.at:614' \
   74051   "Calculator %debug" "                              " 11
   74052 at_xfail=no
   74053 (
   74054   $as_echo "212. $at_setup_line: testing $at_desc ..."
   74055   $at_traceon
   74056 
   74057 
   74058 
   74059 
   74060 
   74061 
   74062 
   74063 
   74064 
   74065 
   74066 cat >calc.y <<'_ATEOF'
   74067 %code top {
   74068 #include <config.h>
   74069 /* We don't need perfect functions for these tests. */
   74070 #undef malloc
   74071 #undef memcmp
   74072 #undef realloc
   74073 }
   74074 
   74075 /* Infix notation calculator--calc */
   74076 %debug
   74077 
   74078 %code requires
   74079 {
   74080 
   74081   /* Exercise pre-prologue dependency to %union.  */
   74082   typedef int semantic_value;
   74083 }
   74084 
   74085 /* Exercise %union. */
   74086 %union
   74087 {
   74088   semantic_value ival;
   74089 };
   74090 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   74091 
   74092 %code provides
   74093 {
   74094   #include <stdio.h>
   74095   /* The input.  */
   74096   extern FILE *input;
   74097   extern semantic_value global_result;
   74098   extern int global_count;
   74099 }
   74100 
   74101 %code
   74102 {
   74103 #include <assert.h>
   74104 #include <string.h>
   74105 #define USE(Var)
   74106 
   74107 FILE *input;
   74108 static int power (int base, int exponent);
   74109 
   74110 static void yyerror ( const char *msg);
   74111 int yylex (void);
   74112 }
   74113 
   74114 
   74115 
   74116 /* Bison Declarations */
   74117 %token CALC_EOF 0 "end of input"
   74118 %token <ival> NUM "number"
   74119 %type  <ival> exp
   74120 
   74121 %nonassoc '=' /* comparison            */
   74122 %left '-' '+'
   74123 %left '*' '/'
   74124 %left NEG     /* negation--unary minus */
   74125 %right '^'    /* exponentiation        */
   74126 
   74127 /* Grammar follows */
   74128 %%
   74129 input:
   74130   line
   74131 | input line         {  }
   74132 ;
   74133 
   74134 line:
   74135   '\n'
   74136 | exp '\n'           { USE ($1); }
   74137 ;
   74138 
   74139 exp:
   74140   NUM                { $$ = $1;             }
   74141 | exp '=' exp
   74142   {
   74143     if ($1 != $3)
   74144       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   74145     $$ = $1;
   74146   }
   74147 | exp '+' exp        { $$ = $1 + $3;        }
   74148 | exp '-' exp        { $$ = $1 - $3;        }
   74149 | exp '*' exp        { $$ = $1 * $3;        }
   74150 | exp '/' exp        { $$ = $1 / $3;        }
   74151 | '-' exp  %prec NEG { $$ = -$2;            }
   74152 | exp '^' exp        { $$ = power ($1, $3); }
   74153 | '(' exp ')'        { $$ = $2;             }
   74154 | '(' error ')'      { $$ = 1111; yyerrok;  }
   74155 | '!'                { $$ = 0; YYERROR;     }
   74156 | '-' error          { $$ = 0; YYERROR;     }
   74157 ;
   74158 %%
   74159 
   74160 static int
   74161 power (int base, int exponent)
   74162 {
   74163   int res = 1;
   74164   assert (0 <= exponent);
   74165   for (/* Niente */; exponent; --exponent)
   74166     res *= base;
   74167   return res;
   74168 }
   74169 
   74170 
   74171 #include <stdio.h>
   74172 /* A C error reporting function.  */
   74173 static
   74174 void yyerror ( const char *msg)
   74175 {
   74176   fprintf (stderr, "%s\n", msg);
   74177 }
   74178 #include <ctype.h>
   74179 
   74180 int yylex (void);
   74181 static int get_char (void);
   74182 static void unget_char ( int c);
   74183 
   74184 
   74185 static int
   74186 get_char (void)
   74187 {
   74188   int res = getc (input);
   74189   ;
   74190 
   74191   return res;
   74192 }
   74193 
   74194 static void
   74195 unget_char ( int c)
   74196 {
   74197   ;
   74198 
   74199   ungetc (c, input);
   74200 }
   74201 
   74202 static int
   74203 read_signed_integer (void)
   74204 {
   74205   int c = get_char ();
   74206   int sign = 1;
   74207   int n = 0;
   74208 
   74209   ;
   74210   if (c == '-')
   74211     {
   74212       c = get_char ();
   74213       sign = -1;
   74214     }
   74215 
   74216   while (isdigit (c))
   74217     {
   74218       n = 10 * n + (c - '0');
   74219       c = get_char ();
   74220     }
   74221 
   74222   unget_char ( c);
   74223 
   74224   return sign * n;
   74225 }
   74226 
   74227 
   74228 /*---------------------------------------------------------------.
   74229 | Lexical analyzer returns an integer on the stack and the token |
   74230 | NUM, or the ASCII character read if not a number.  Skips all   |
   74231 | blanks and tabs, returns 0 for EOF.                            |
   74232 `---------------------------------------------------------------*/
   74233 
   74234 int yylex (void)
   74235 {
   74236   int c;
   74237   /* Skip current token, then white spaces.  */
   74238   do
   74239     {
   74240 
   74241     }
   74242   while ((c = get_char ()) == ' ' || c == '\t');
   74243 
   74244   /* process numbers   */
   74245   if (c == '.' || isdigit (c))
   74246     {
   74247       unget_char ( c);
   74248       (yylval).ival = read_signed_integer ();
   74249       return NUM;
   74250     }
   74251 
   74252   /* Return end-of-file.  */
   74253   if (c == EOF)
   74254     return CALC_EOF;
   74255 
   74256   /* Return single chars. */
   74257   return c;
   74258 }
   74259 
   74260 #include <assert.h>
   74261 #if HAVE_UNISTD_H
   74262 # include <unistd.h>
   74263 #else
   74264 # undef alarm
   74265 # define alarm(seconds) /* empty */
   74266 #endif
   74267 
   74268 
   74269 
   74270 semantic_value global_result = 0;
   74271 int global_count = 0;
   74272 
   74273 /* A C main function.  */
   74274 int
   74275 main (int argc, const char **argv)
   74276 {
   74277   semantic_value result = 0;
   74278   int count = 0;
   74279   int status;
   74280 
   74281   /* This used to be alarm (10), but that isn't enough time for
   74282      a July 1995 vintage DEC Alphastation 200 4/100 system,
   74283      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   74284   alarm (100);
   74285 
   74286   if (argc == 2)
   74287     input = fopen (argv[1], "r");
   74288   else
   74289     input = stdin;
   74290 
   74291   if (!input)
   74292     {
   74293       perror (argv[1]);
   74294       return 3;
   74295     }
   74296 
   74297   yydebug = 1;
   74298   status = yyparse ();
   74299   if (fclose (input))
   74300     perror ("fclose");
   74301   assert (global_result == result);
   74302   assert (global_count == count);
   74303   return status;
   74304 }
   74305 _ATEOF
   74306 
   74307 
   74308 
   74309 
   74310 
   74311 
   74312 
   74313 
   74314 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   74315   at_save_special_files
   74316   mkdir xml-tests
   74317     # Don't combine these Bison invocations since we want to be sure that
   74318   # --report=all isn't required to get the full XML file.
   74319   { set +x
   74320 $as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   74321                   --graph=xml-tests/test.dot -o calc.c calc.y"
   74322 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614"
   74323 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   74324                   --graph=xml-tests/test.dot -o calc.c calc.y
   74325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74326 at_status=$? at_failed=false
   74327 $at_check_filter
   74328 echo stderr:; cat "$at_stderr"
   74329 echo stdout:; cat "$at_stdout"
   74330 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74331 $at_failed && at_fn_log_failure
   74332 $at_traceon; }
   74333 
   74334   { set +x
   74335 $as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   74336 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:614"
   74337 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   74338 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74339 at_status=$? at_failed=false
   74340 $at_check_filter
   74341 echo stderr:; cat "$at_stderr"
   74342 echo stdout:; cat "$at_stdout"
   74343 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74344 $at_failed && at_fn_log_failure
   74345 $at_traceon; }
   74346 
   74347     cp xml-tests/test.output expout
   74348   { set +x
   74349 $as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\
   74350              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   74351              xml-tests/test.xml"
   74352 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614"
   74353 ( $at_check_trace; $XSLTPROC \
   74354              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   74355              xml-tests/test.xml
   74356 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74357 at_status=$? at_failed=false
   74358 $at_check_filter
   74359 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74360 $at_diff expout "$at_stdout" || at_failed=:
   74361 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74362 $at_failed && at_fn_log_failure
   74363 $at_traceon; }
   74364 
   74365   sort xml-tests/test.dot > expout
   74366   { set +x
   74367 $as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\
   74368              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   74369              xml-tests/test.xml | sort"
   74370 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614"
   74371 ( $at_check_trace; $XSLTPROC \
   74372              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   74373              xml-tests/test.xml | sort
   74374 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74375 at_status=$? at_failed=false
   74376 $at_check_filter
   74377 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74378 $at_diff expout "$at_stdout" || at_failed=:
   74379 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74380 $at_failed && at_fn_log_failure
   74381 $at_traceon; }
   74382 
   74383   rm -rf xml-tests expout
   74384   at_restore_special_files
   74385 fi
   74386 { set +x
   74387 $as_echo "$at_srcdir/calc.at:614: bison -o calc.c calc.y"
   74388 at_fn_check_prepare_trace "calc.at:614"
   74389 ( $at_check_trace; bison -o calc.c calc.y
   74390 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74391 at_status=$? at_failed=false
   74392 $at_check_filter
   74393 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74394 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74395 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74396 $at_failed && at_fn_log_failure
   74397 $at_traceon; }
   74398 
   74399 
   74400    { set +x
   74401 $as_echo "$at_srcdir/calc.at:614: \$BISON_C_WORKS"
   74402 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:614"
   74403 ( $at_check_trace; $BISON_C_WORKS
   74404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74405 at_status=$? at_failed=false
   74406 $at_check_filter
   74407 echo stderr:; cat "$at_stderr"
   74408 echo stdout:; cat "$at_stdout"
   74409 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74410 $at_failed && at_fn_log_failure
   74411 $at_traceon; }
   74412 
   74413 { set +x
   74414 $as_echo "$at_srcdir/calc.at:614: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   74415 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:614"
   74416 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   74417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74418 at_status=$? at_failed=false
   74419 $at_check_filter
   74420 echo stderr:; cat "$at_stderr"
   74421 echo stdout:; cat "$at_stdout"
   74422 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74423 $at_failed && at_fn_log_failure
   74424 $at_traceon; }
   74425 
   74426 
   74427 { set +x
   74428 $as_echo "$at_srcdir/calc.at:614: \$PERL -ne '
   74429   chomp;
   74430   print \"\$.: {\$_}\\n\"
   74431     if (# No starting/ending empty lines.
   74432         (eof || \$. == 1) && /^\\s*\$/
   74433         # No trailing space.  FIXME: not ready for \"maint\".
   74434         # || /\\s\$/
   74435         )' calc.c
   74436 "
   74437 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614"
   74438 ( $at_check_trace; $PERL -ne '
   74439   chomp;
   74440   print "$.: {$_}\n"
   74441     if (# No starting/ending empty lines.
   74442         (eof || $. == 1) && /^\s*$/
   74443         # No trailing space.  FIXME: not ready for "maint".
   74444         # || /\s$/
   74445         )' calc.c
   74446 
   74447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74448 at_status=$? at_failed=false
   74449 $at_check_filter
   74450 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74451 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74452 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74453 $at_failed && at_fn_log_failure
   74454 $at_traceon; }
   74455 
   74456 
   74457 
   74458 # Test the priorities.
   74459 cat >input <<'_ATEOF'
   74460 1 + 2 * 3 = 7
   74461 1 + 2 * -3 = -5
   74462 
   74463 -1^2 = -1
   74464 (-1)^2 = 1
   74465 
   74466 ---1 = -1
   74467 
   74468 1 - 2 - 3 = -4
   74469 1 - (2 - 3) = 2
   74470 
   74471 2^2^3 = 256
   74472 (2^2)^3 = 64
   74473 _ATEOF
   74474 
   74475 { set +x
   74476 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74477 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74478 ( $at_check_trace;  $PREPARSER ./calc input
   74479 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74480 at_status=$? at_failed=false
   74481 $at_check_filter
   74482 echo stderr:; tee stderr <"$at_stderr"
   74483 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74484 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74485 $at_failed && at_fn_log_failure
   74486 $at_traceon; }
   74487 
   74488 { set +x
   74489 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74490 at_fn_check_prepare_trace "calc.at:614"
   74491 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74493 at_status=$? at_failed=false
   74494 $at_check_filter
   74495 echo stderr:; tee stderr <"$at_stderr"
   74496 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74497 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74498 $at_failed && at_fn_log_failure
   74499 $at_traceon; }
   74500 
   74501 
   74502 
   74503 
   74504 # Some syntax errors.
   74505 cat >input <<'_ATEOF'
   74506 1 2
   74507 _ATEOF
   74508 
   74509 { set +x
   74510 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74511 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74512 ( $at_check_trace;  $PREPARSER ./calc input
   74513 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74514 at_status=$? at_failed=false
   74515 $at_check_filter
   74516 echo stderr:; tee stderr <"$at_stderr"
   74517 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74518 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
   74519 $at_failed && at_fn_log_failure
   74520 $at_traceon; }
   74521 
   74522 { set +x
   74523 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74524 at_fn_check_prepare_trace "calc.at:614"
   74525 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74527 at_status=$? at_failed=false
   74528 $at_check_filter
   74529 echo stderr:; tee stderr <"$at_stderr"
   74530 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74531 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74532 $at_failed && at_fn_log_failure
   74533 $at_traceon; }
   74534 
   74535 
   74536 
   74537 # Normalize the observed and expected error messages, depending upon the
   74538 # options.
   74539 # 1. Remove the traces from observed.
   74540 sed '/^Starting/d
   74541 /^Entering/d
   74542 /^Stack/d
   74543 /^Reading/d
   74544 /^Reducing/d
   74545 /^Return/d
   74546 /^Shifting/d
   74547 /^state/d
   74548 /^Cleanup:/d
   74549 /^Error:/d
   74550 /^Next/d
   74551 /^Now/d
   74552 /^Discarding/d
   74553 / \$[0-9$]* = /d
   74554 /^yydestructor:/d' stderr >at-stderr
   74555 mv at-stderr stderr
   74556 # 2. Create the reference error message.
   74557 cat >expout <<'_ATEOF'
   74558 1.3: syntax error, unexpected number
   74559 _ATEOF
   74560 
   74561 # 3. If locations are not used, remove them.
   74562 sed 's/^[-0-9.]*: //' expout >at-expout
   74563 mv at-expout expout
   74564 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74565 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   74566 mv at-expout expout
   74567 # 5. Check
   74568 { set +x
   74569 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   74570 at_fn_check_prepare_trace "calc.at:614"
   74571 ( $at_check_trace; cat stderr
   74572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74573 at_status=$? at_failed=false
   74574 $at_check_filter
   74575 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74576 $at_diff expout "$at_stdout" || at_failed=:
   74577 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74578 $at_failed && at_fn_log_failure
   74579 $at_traceon; }
   74580 
   74581 
   74582 cat >input <<'_ATEOF'
   74583 1//2
   74584 _ATEOF
   74585 
   74586 { set +x
   74587 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74588 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74589 ( $at_check_trace;  $PREPARSER ./calc input
   74590 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74591 at_status=$? at_failed=false
   74592 $at_check_filter
   74593 echo stderr:; tee stderr <"$at_stderr"
   74594 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74595 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
   74596 $at_failed && at_fn_log_failure
   74597 $at_traceon; }
   74598 
   74599 { set +x
   74600 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74601 at_fn_check_prepare_trace "calc.at:614"
   74602 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74604 at_status=$? at_failed=false
   74605 $at_check_filter
   74606 echo stderr:; tee stderr <"$at_stderr"
   74607 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74608 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74609 $at_failed && at_fn_log_failure
   74610 $at_traceon; }
   74611 
   74612 
   74613 
   74614 # Normalize the observed and expected error messages, depending upon the
   74615 # options.
   74616 # 1. Remove the traces from observed.
   74617 sed '/^Starting/d
   74618 /^Entering/d
   74619 /^Stack/d
   74620 /^Reading/d
   74621 /^Reducing/d
   74622 /^Return/d
   74623 /^Shifting/d
   74624 /^state/d
   74625 /^Cleanup:/d
   74626 /^Error:/d
   74627 /^Next/d
   74628 /^Now/d
   74629 /^Discarding/d
   74630 / \$[0-9$]* = /d
   74631 /^yydestructor:/d' stderr >at-stderr
   74632 mv at-stderr stderr
   74633 # 2. Create the reference error message.
   74634 cat >expout <<'_ATEOF'
   74635 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   74636 _ATEOF
   74637 
   74638 # 3. If locations are not used, remove them.
   74639 sed 's/^[-0-9.]*: //' expout >at-expout
   74640 mv at-expout expout
   74641 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74642 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   74643 mv at-expout expout
   74644 # 5. Check
   74645 { set +x
   74646 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   74647 at_fn_check_prepare_trace "calc.at:614"
   74648 ( $at_check_trace; cat stderr
   74649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74650 at_status=$? at_failed=false
   74651 $at_check_filter
   74652 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74653 $at_diff expout "$at_stdout" || at_failed=:
   74654 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74655 $at_failed && at_fn_log_failure
   74656 $at_traceon; }
   74657 
   74658 
   74659 cat >input <<'_ATEOF'
   74660 error
   74661 _ATEOF
   74662 
   74663 { set +x
   74664 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74665 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74666 ( $at_check_trace;  $PREPARSER ./calc input
   74667 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74668 at_status=$? at_failed=false
   74669 $at_check_filter
   74670 echo stderr:; tee stderr <"$at_stderr"
   74671 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74672 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
   74673 $at_failed && at_fn_log_failure
   74674 $at_traceon; }
   74675 
   74676 { set +x
   74677 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74678 at_fn_check_prepare_trace "calc.at:614"
   74679 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74680 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74681 at_status=$? at_failed=false
   74682 $at_check_filter
   74683 echo stderr:; tee stderr <"$at_stderr"
   74684 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74685 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74686 $at_failed && at_fn_log_failure
   74687 $at_traceon; }
   74688 
   74689 
   74690 
   74691 # Normalize the observed and expected error messages, depending upon the
   74692 # options.
   74693 # 1. Remove the traces from observed.
   74694 sed '/^Starting/d
   74695 /^Entering/d
   74696 /^Stack/d
   74697 /^Reading/d
   74698 /^Reducing/d
   74699 /^Return/d
   74700 /^Shifting/d
   74701 /^state/d
   74702 /^Cleanup:/d
   74703 /^Error:/d
   74704 /^Next/d
   74705 /^Now/d
   74706 /^Discarding/d
   74707 / \$[0-9$]* = /d
   74708 /^yydestructor:/d' stderr >at-stderr
   74709 mv at-stderr stderr
   74710 # 2. Create the reference error message.
   74711 cat >expout <<'_ATEOF'
   74712 1.1: syntax error, unexpected $undefined
   74713 _ATEOF
   74714 
   74715 # 3. If locations are not used, remove them.
   74716 sed 's/^[-0-9.]*: //' expout >at-expout
   74717 mv at-expout expout
   74718 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74719 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   74720 mv at-expout expout
   74721 # 5. Check
   74722 { set +x
   74723 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   74724 at_fn_check_prepare_trace "calc.at:614"
   74725 ( $at_check_trace; cat stderr
   74726 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74727 at_status=$? at_failed=false
   74728 $at_check_filter
   74729 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74730 $at_diff expout "$at_stdout" || at_failed=:
   74731 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74732 $at_failed && at_fn_log_failure
   74733 $at_traceon; }
   74734 
   74735 
   74736 cat >input <<'_ATEOF'
   74737 1 = 2 = 3
   74738 _ATEOF
   74739 
   74740 { set +x
   74741 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74742 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74743 ( $at_check_trace;  $PREPARSER ./calc input
   74744 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74745 at_status=$? at_failed=false
   74746 $at_check_filter
   74747 echo stderr:; tee stderr <"$at_stderr"
   74748 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74749 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
   74750 $at_failed && at_fn_log_failure
   74751 $at_traceon; }
   74752 
   74753 { set +x
   74754 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74755 at_fn_check_prepare_trace "calc.at:614"
   74756 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74757 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74758 at_status=$? at_failed=false
   74759 $at_check_filter
   74760 echo stderr:; tee stderr <"$at_stderr"
   74761 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74762 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74763 $at_failed && at_fn_log_failure
   74764 $at_traceon; }
   74765 
   74766 
   74767 
   74768 # Normalize the observed and expected error messages, depending upon the
   74769 # options.
   74770 # 1. Remove the traces from observed.
   74771 sed '/^Starting/d
   74772 /^Entering/d
   74773 /^Stack/d
   74774 /^Reading/d
   74775 /^Reducing/d
   74776 /^Return/d
   74777 /^Shifting/d
   74778 /^state/d
   74779 /^Cleanup:/d
   74780 /^Error:/d
   74781 /^Next/d
   74782 /^Now/d
   74783 /^Discarding/d
   74784 / \$[0-9$]* = /d
   74785 /^yydestructor:/d' stderr >at-stderr
   74786 mv at-stderr stderr
   74787 # 2. Create the reference error message.
   74788 cat >expout <<'_ATEOF'
   74789 1.7: syntax error, unexpected '='
   74790 _ATEOF
   74791 
   74792 # 3. If locations are not used, remove them.
   74793 sed 's/^[-0-9.]*: //' expout >at-expout
   74794 mv at-expout expout
   74795 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74796 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   74797 mv at-expout expout
   74798 # 5. Check
   74799 { set +x
   74800 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   74801 at_fn_check_prepare_trace "calc.at:614"
   74802 ( $at_check_trace; cat stderr
   74803 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74804 at_status=$? at_failed=false
   74805 $at_check_filter
   74806 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74807 $at_diff expout "$at_stdout" || at_failed=:
   74808 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74809 $at_failed && at_fn_log_failure
   74810 $at_traceon; }
   74811 
   74812 
   74813 cat >input <<'_ATEOF'
   74814 
   74815 +1
   74816 _ATEOF
   74817 
   74818 { set +x
   74819 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74820 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74821 ( $at_check_trace;  $PREPARSER ./calc input
   74822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74823 at_status=$? at_failed=false
   74824 $at_check_filter
   74825 echo stderr:; tee stderr <"$at_stderr"
   74826 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74827 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
   74828 $at_failed && at_fn_log_failure
   74829 $at_traceon; }
   74830 
   74831 { set +x
   74832 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74833 at_fn_check_prepare_trace "calc.at:614"
   74834 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74836 at_status=$? at_failed=false
   74837 $at_check_filter
   74838 echo stderr:; tee stderr <"$at_stderr"
   74839 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74840 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74841 $at_failed && at_fn_log_failure
   74842 $at_traceon; }
   74843 
   74844 
   74845 
   74846 # Normalize the observed and expected error messages, depending upon the
   74847 # options.
   74848 # 1. Remove the traces from observed.
   74849 sed '/^Starting/d
   74850 /^Entering/d
   74851 /^Stack/d
   74852 /^Reading/d
   74853 /^Reducing/d
   74854 /^Return/d
   74855 /^Shifting/d
   74856 /^state/d
   74857 /^Cleanup:/d
   74858 /^Error:/d
   74859 /^Next/d
   74860 /^Now/d
   74861 /^Discarding/d
   74862 / \$[0-9$]* = /d
   74863 /^yydestructor:/d' stderr >at-stderr
   74864 mv at-stderr stderr
   74865 # 2. Create the reference error message.
   74866 cat >expout <<'_ATEOF'
   74867 2.1: syntax error, unexpected '+'
   74868 _ATEOF
   74869 
   74870 # 3. If locations are not used, remove them.
   74871 sed 's/^[-0-9.]*: //' expout >at-expout
   74872 mv at-expout expout
   74873 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74874 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   74875 mv at-expout expout
   74876 # 5. Check
   74877 { set +x
   74878 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   74879 at_fn_check_prepare_trace "calc.at:614"
   74880 ( $at_check_trace; cat stderr
   74881 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74882 at_status=$? at_failed=false
   74883 $at_check_filter
   74884 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74885 $at_diff expout "$at_stdout" || at_failed=:
   74886 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74887 $at_failed && at_fn_log_failure
   74888 $at_traceon; }
   74889 
   74890 
   74891 # Exercise error messages with EOF: work on an empty file.
   74892 { set +x
   74893 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc /dev/null"
   74894 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:614"
   74895 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   74896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74897 at_status=$? at_failed=false
   74898 $at_check_filter
   74899 echo stderr:; tee stderr <"$at_stderr"
   74900 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74901 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
   74902 $at_failed && at_fn_log_failure
   74903 $at_traceon; }
   74904 
   74905 { set +x
   74906 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   74907 at_fn_check_prepare_trace "calc.at:614"
   74908 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   74909 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74910 at_status=$? at_failed=false
   74911 $at_check_filter
   74912 echo stderr:; tee stderr <"$at_stderr"
   74913 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74914 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74915 $at_failed && at_fn_log_failure
   74916 $at_traceon; }
   74917 
   74918 
   74919 
   74920 # Normalize the observed and expected error messages, depending upon the
   74921 # options.
   74922 # 1. Remove the traces from observed.
   74923 sed '/^Starting/d
   74924 /^Entering/d
   74925 /^Stack/d
   74926 /^Reading/d
   74927 /^Reducing/d
   74928 /^Return/d
   74929 /^Shifting/d
   74930 /^state/d
   74931 /^Cleanup:/d
   74932 /^Error:/d
   74933 /^Next/d
   74934 /^Now/d
   74935 /^Discarding/d
   74936 / \$[0-9$]* = /d
   74937 /^yydestructor:/d' stderr >at-stderr
   74938 mv at-stderr stderr
   74939 # 2. Create the reference error message.
   74940 cat >expout <<'_ATEOF'
   74941 1.1: syntax error, unexpected end of input
   74942 _ATEOF
   74943 
   74944 # 3. If locations are not used, remove them.
   74945 sed 's/^[-0-9.]*: //' expout >at-expout
   74946 mv at-expout expout
   74947 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   74948 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   74949 mv at-expout expout
   74950 # 5. Check
   74951 { set +x
   74952 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   74953 at_fn_check_prepare_trace "calc.at:614"
   74954 ( $at_check_trace; cat stderr
   74955 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74956 at_status=$? at_failed=false
   74957 $at_check_filter
   74958 at_fn_diff_devnull "$at_stderr" || at_failed=:
   74959 $at_diff expout "$at_stdout" || at_failed=:
   74960 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74961 $at_failed && at_fn_log_failure
   74962 $at_traceon; }
   74963 
   74964 
   74965 
   74966 # Exercise the error token: without it, we die at the first error,
   74967 # hence be sure to
   74968 #
   74969 # - have several errors which exercise different shift/discardings
   74970 #   - (): nothing to pop, nothing to discard
   74971 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   74972 #   - (* * *): nothing to pop, a lot to discard
   74973 #   - (1 + 2 * *): some to pop and discard
   74974 #
   74975 # - test the action associated to `error'
   74976 #
   74977 # - check the lookahead that triggers an error is not discarded
   74978 #   when we enter error recovery.  Below, the lookahead causing the
   74979 #   first error is ")", which is needed to recover from the error and
   74980 #   produce the "0" that triggers the "0 != 1" error.
   74981 #
   74982 cat >input <<'_ATEOF'
   74983 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   74984 _ATEOF
   74985 
   74986 { set +x
   74987 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   74988 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   74989 ( $at_check_trace;  $PREPARSER ./calc input
   74990 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   74991 at_status=$? at_failed=false
   74992 $at_check_filter
   74993 echo stderr:; tee stderr <"$at_stderr"
   74994 at_fn_diff_devnull "$at_stdout" || at_failed=:
   74995 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   74996 $at_failed && at_fn_log_failure
   74997 $at_traceon; }
   74998 
   74999 { set +x
   75000 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75001 at_fn_check_prepare_trace "calc.at:614"
   75002 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75004 at_status=$? at_failed=false
   75005 $at_check_filter
   75006 echo stderr:; tee stderr <"$at_stderr"
   75007 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75008 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75009 $at_failed && at_fn_log_failure
   75010 $at_traceon; }
   75011 
   75012 
   75013 
   75014 # Normalize the observed and expected error messages, depending upon the
   75015 # options.
   75016 # 1. Remove the traces from observed.
   75017 sed '/^Starting/d
   75018 /^Entering/d
   75019 /^Stack/d
   75020 /^Reading/d
   75021 /^Reducing/d
   75022 /^Return/d
   75023 /^Shifting/d
   75024 /^state/d
   75025 /^Cleanup:/d
   75026 /^Error:/d
   75027 /^Next/d
   75028 /^Now/d
   75029 /^Discarding/d
   75030 / \$[0-9$]* = /d
   75031 /^yydestructor:/d' stderr >at-stderr
   75032 mv at-stderr stderr
   75033 # 2. Create the reference error message.
   75034 cat >expout <<'_ATEOF'
   75035 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   75036 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   75037 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   75038 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   75039 calc: error: 4444 != 1
   75040 _ATEOF
   75041 
   75042 # 3. If locations are not used, remove them.
   75043 sed 's/^[-0-9.]*: //' expout >at-expout
   75044 mv at-expout expout
   75045 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   75046 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   75047 mv at-expout expout
   75048 # 5. Check
   75049 { set +x
   75050 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   75051 at_fn_check_prepare_trace "calc.at:614"
   75052 ( $at_check_trace; cat stderr
   75053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75054 at_status=$? at_failed=false
   75055 $at_check_filter
   75056 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75057 $at_diff expout "$at_stdout" || at_failed=:
   75058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75059 $at_failed && at_fn_log_failure
   75060 $at_traceon; }
   75061 
   75062 
   75063 
   75064 # The same, but this time exercising explicitly triggered syntax errors.
   75065 # POSIX says the lookahead causing the error should not be discarded.
   75066 cat >input <<'_ATEOF'
   75067 (!) + (1 2) = 1
   75068 _ATEOF
   75069 
   75070 { set +x
   75071 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   75072 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   75073 ( $at_check_trace;  $PREPARSER ./calc input
   75074 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75075 at_status=$? at_failed=false
   75076 $at_check_filter
   75077 echo stderr:; tee stderr <"$at_stderr"
   75078 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75079 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75080 $at_failed && at_fn_log_failure
   75081 $at_traceon; }
   75082 
   75083 { set +x
   75084 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75085 at_fn_check_prepare_trace "calc.at:614"
   75086 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75087 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75088 at_status=$? at_failed=false
   75089 $at_check_filter
   75090 echo stderr:; tee stderr <"$at_stderr"
   75091 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75092 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75093 $at_failed && at_fn_log_failure
   75094 $at_traceon; }
   75095 
   75096 
   75097 
   75098 # Normalize the observed and expected error messages, depending upon the
   75099 # options.
   75100 # 1. Remove the traces from observed.
   75101 sed '/^Starting/d
   75102 /^Entering/d
   75103 /^Stack/d
   75104 /^Reading/d
   75105 /^Reducing/d
   75106 /^Return/d
   75107 /^Shifting/d
   75108 /^state/d
   75109 /^Cleanup:/d
   75110 /^Error:/d
   75111 /^Next/d
   75112 /^Now/d
   75113 /^Discarding/d
   75114 / \$[0-9$]* = /d
   75115 /^yydestructor:/d' stderr >at-stderr
   75116 mv at-stderr stderr
   75117 # 2. Create the reference error message.
   75118 cat >expout <<'_ATEOF'
   75119 1.10: syntax error, unexpected number
   75120 calc: error: 2222 != 1
   75121 _ATEOF
   75122 
   75123 # 3. If locations are not used, remove them.
   75124 sed 's/^[-0-9.]*: //' expout >at-expout
   75125 mv at-expout expout
   75126 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   75127 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   75128 mv at-expout expout
   75129 # 5. Check
   75130 { set +x
   75131 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   75132 at_fn_check_prepare_trace "calc.at:614"
   75133 ( $at_check_trace; cat stderr
   75134 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75135 at_status=$? at_failed=false
   75136 $at_check_filter
   75137 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75138 $at_diff expout "$at_stdout" || at_failed=:
   75139 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75140 $at_failed && at_fn_log_failure
   75141 $at_traceon; }
   75142 
   75143 
   75144 cat >input <<'_ATEOF'
   75145 (- *) + (1 2) = 1
   75146 _ATEOF
   75147 
   75148 { set +x
   75149 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   75150 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   75151 ( $at_check_trace;  $PREPARSER ./calc input
   75152 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75153 at_status=$? at_failed=false
   75154 $at_check_filter
   75155 echo stderr:; tee stderr <"$at_stderr"
   75156 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75157 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75158 $at_failed && at_fn_log_failure
   75159 $at_traceon; }
   75160 
   75161 { set +x
   75162 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75163 at_fn_check_prepare_trace "calc.at:614"
   75164 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75165 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75166 at_status=$? at_failed=false
   75167 $at_check_filter
   75168 echo stderr:; tee stderr <"$at_stderr"
   75169 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75170 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75171 $at_failed && at_fn_log_failure
   75172 $at_traceon; }
   75173 
   75174 
   75175 
   75176 # Normalize the observed and expected error messages, depending upon the
   75177 # options.
   75178 # 1. Remove the traces from observed.
   75179 sed '/^Starting/d
   75180 /^Entering/d
   75181 /^Stack/d
   75182 /^Reading/d
   75183 /^Reducing/d
   75184 /^Return/d
   75185 /^Shifting/d
   75186 /^state/d
   75187 /^Cleanup:/d
   75188 /^Error:/d
   75189 /^Next/d
   75190 /^Now/d
   75191 /^Discarding/d
   75192 / \$[0-9$]* = /d
   75193 /^yydestructor:/d' stderr >at-stderr
   75194 mv at-stderr stderr
   75195 # 2. Create the reference error message.
   75196 cat >expout <<'_ATEOF'
   75197 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   75198 1.12: syntax error, unexpected number
   75199 calc: error: 2222 != 1
   75200 _ATEOF
   75201 
   75202 # 3. If locations are not used, remove them.
   75203 sed 's/^[-0-9.]*: //' expout >at-expout
   75204 mv at-expout expout
   75205 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   75206 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   75207 mv at-expout expout
   75208 # 5. Check
   75209 { set +x
   75210 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   75211 at_fn_check_prepare_trace "calc.at:614"
   75212 ( $at_check_trace; cat stderr
   75213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75214 at_status=$? at_failed=false
   75215 $at_check_filter
   75216 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75217 $at_diff expout "$at_stdout" || at_failed=:
   75218 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75219 $at_failed && at_fn_log_failure
   75220 $at_traceon; }
   75221 
   75222 
   75223 
   75224 # Check that yyerrok works properly: second error is not reported,
   75225 # third and fourth are.  Parse status is succesfull.
   75226 cat >input <<'_ATEOF'
   75227 (* *) + (*) + (*)
   75228 _ATEOF
   75229 
   75230 { set +x
   75231 $as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
   75232 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
   75233 ( $at_check_trace;  $PREPARSER ./calc input
   75234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75235 at_status=$? at_failed=false
   75236 $at_check_filter
   75237 echo stderr:; tee stderr <"$at_stderr"
   75238 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75239 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75240 $at_failed && at_fn_log_failure
   75241 $at_traceon; }
   75242 
   75243 { set +x
   75244 $as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75245 at_fn_check_prepare_trace "calc.at:614"
   75246 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75247 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75248 at_status=$? at_failed=false
   75249 $at_check_filter
   75250 echo stderr:; tee stderr <"$at_stderr"
   75251 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75252 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75253 $at_failed && at_fn_log_failure
   75254 $at_traceon; }
   75255 
   75256 
   75257 
   75258 # Normalize the observed and expected error messages, depending upon the
   75259 # options.
   75260 # 1. Remove the traces from observed.
   75261 sed '/^Starting/d
   75262 /^Entering/d
   75263 /^Stack/d
   75264 /^Reading/d
   75265 /^Reducing/d
   75266 /^Return/d
   75267 /^Shifting/d
   75268 /^state/d
   75269 /^Cleanup:/d
   75270 /^Error:/d
   75271 /^Next/d
   75272 /^Now/d
   75273 /^Discarding/d
   75274 / \$[0-9$]* = /d
   75275 /^yydestructor:/d' stderr >at-stderr
   75276 mv at-stderr stderr
   75277 # 2. Create the reference error message.
   75278 cat >expout <<'_ATEOF'
   75279 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   75280 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   75281 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   75282 _ATEOF
   75283 
   75284 # 3. If locations are not used, remove them.
   75285 sed 's/^[-0-9.]*: //' expout >at-expout
   75286 mv at-expout expout
   75287 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   75288 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   75289 mv at-expout expout
   75290 # 5. Check
   75291 { set +x
   75292 $as_echo "$at_srcdir/calc.at:614: cat stderr"
   75293 at_fn_check_prepare_trace "calc.at:614"
   75294 ( $at_check_trace; cat stderr
   75295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75296 at_status=$? at_failed=false
   75297 $at_check_filter
   75298 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75299 $at_diff expout "$at_stdout" || at_failed=:
   75300 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
   75301 $at_failed && at_fn_log_failure
   75302 $at_traceon; }
   75303 
   75304 
   75305 
   75306 
   75307 
   75308   set +x
   75309   $at_times_p && times >"$at_times_file"
   75310 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   75311 read at_status <"$at_status_file"
   75312 #AT_STOP_212
   75313 #AT_START_213
   75314 at_fn_group_banner 213 'calc.at:615' \
   75315   "Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11
   75316 at_xfail=no
   75317 (
   75318   $as_echo "213. $at_setup_line: testing $at_desc ..."
   75319   $at_traceon
   75320 
   75321 
   75322 
   75323 
   75324 
   75325 
   75326 
   75327 
   75328 
   75329 
   75330 cat >calc.y <<'_ATEOF'
   75331 %code top {
   75332 #include <config.h>
   75333 /* We don't need perfect functions for these tests. */
   75334 #undef malloc
   75335 #undef memcmp
   75336 #undef realloc
   75337 }
   75338 
   75339 /* Infix notation calculator--calc */
   75340 %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
   75341 
   75342 %code requires
   75343 {
   75344 
   75345   /* Exercise pre-prologue dependency to %union.  */
   75346   typedef int semantic_value;
   75347 }
   75348 
   75349 /* Exercise %union. */
   75350 %union
   75351 {
   75352   semantic_value ival;
   75353 };
   75354 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   75355 
   75356 %code provides
   75357 {
   75358   #include <stdio.h>
   75359   /* The input.  */
   75360   extern FILE *input;
   75361   extern semantic_value global_result;
   75362   extern int global_count;
   75363 }
   75364 
   75365 %code
   75366 {
   75367 #include <assert.h>
   75368 #include <string.h>
   75369 #define USE(Var)
   75370 
   75371 FILE *input;
   75372 static int power (int base, int exponent);
   75373 
   75374 static void calcerror ( const char *msg);
   75375 int calclex (void);
   75376 }
   75377 
   75378 
   75379 
   75380 /* Bison Declarations */
   75381 %token CALC_EOF 0 "end of input"
   75382 %token <ival> NUM "number"
   75383 %type  <ival> exp
   75384 
   75385 %nonassoc '=' /* comparison            */
   75386 %left '-' '+'
   75387 %left '*' '/'
   75388 %left NEG     /* negation--unary minus */
   75389 %right '^'    /* exponentiation        */
   75390 
   75391 /* Grammar follows */
   75392 %%
   75393 input:
   75394   line
   75395 | input line         {  }
   75396 ;
   75397 
   75398 line:
   75399   '\n'
   75400 | exp '\n'           { USE ($1); }
   75401 ;
   75402 
   75403 exp:
   75404   NUM                { $$ = $1;             }
   75405 | exp '=' exp
   75406   {
   75407     if ($1 != $3)
   75408       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   75409     $$ = $1;
   75410   }
   75411 | exp '+' exp        { $$ = $1 + $3;        }
   75412 | exp '-' exp        { $$ = $1 - $3;        }
   75413 | exp '*' exp        { $$ = $1 * $3;        }
   75414 | exp '/' exp        { $$ = $1 / $3;        }
   75415 | '-' exp  %prec NEG { $$ = -$2;            }
   75416 | exp '^' exp        { $$ = power ($1, $3); }
   75417 | '(' exp ')'        { $$ = $2;             }
   75418 | '(' error ')'      { $$ = 1111; yyerrok;  }
   75419 | '!'                { $$ = 0; YYERROR;     }
   75420 | '-' error          { $$ = 0; YYERROR;     }
   75421 ;
   75422 %%
   75423 
   75424 static int
   75425 power (int base, int exponent)
   75426 {
   75427   int res = 1;
   75428   assert (0 <= exponent);
   75429   for (/* Niente */; exponent; --exponent)
   75430     res *= base;
   75431   return res;
   75432 }
   75433 
   75434 
   75435 #include <stdio.h>
   75436 /* A C error reporting function.  */
   75437 static
   75438 void calcerror ( const char *msg)
   75439 {
   75440   YY_LOCATION_PRINT (stderr, (calclloc));
   75441   fprintf (stderr, ": ");
   75442   fprintf (stderr, "%s\n", msg);
   75443 }
   75444 _ATEOF
   75445 
   75446 
   75447 
   75448 cat >calc-lex.c <<'_ATEOF'
   75449 #include <config.h>
   75450 /* We don't need perfect functions for these tests. */
   75451 #undef malloc
   75452 #undef memcmp
   75453 #undef realloc
   75454 
   75455 #include "calc.h"
   75456 
   75457 #include <ctype.h>
   75458 
   75459 int calclex (void);
   75460 static int get_char (void);
   75461 static void unget_char ( int c);
   75462 
   75463 
   75464 static YYLTYPE last_yylloc;
   75465 
   75466 static int
   75467 get_char (void)
   75468 {
   75469   int res = getc (input);
   75470   ;
   75471 
   75472   last_yylloc = (calclloc);
   75473   if (res == '\n')
   75474     {
   75475       (calclloc).last_line++;
   75476       (calclloc).last_column = 1;
   75477     }
   75478   else
   75479     (calclloc).last_column++;
   75480 
   75481   return res;
   75482 }
   75483 
   75484 static void
   75485 unget_char ( int c)
   75486 {
   75487   ;
   75488 
   75489   /* Wrong when C == `\n'. */
   75490   (calclloc) = last_yylloc;
   75491 
   75492   ungetc (c, input);
   75493 }
   75494 
   75495 static int
   75496 read_signed_integer (void)
   75497 {
   75498   int c = get_char ();
   75499   int sign = 1;
   75500   int n = 0;
   75501 
   75502   ;
   75503   if (c == '-')
   75504     {
   75505       c = get_char ();
   75506       sign = -1;
   75507     }
   75508 
   75509   while (isdigit (c))
   75510     {
   75511       n = 10 * n + (c - '0');
   75512       c = get_char ();
   75513     }
   75514 
   75515   unget_char ( c);
   75516 
   75517   return sign * n;
   75518 }
   75519 
   75520 
   75521 /*---------------------------------------------------------------.
   75522 | Lexical analyzer returns an integer on the stack and the token |
   75523 | NUM, or the ASCII character read if not a number.  Skips all   |
   75524 | blanks and tabs, returns 0 for EOF.                            |
   75525 `---------------------------------------------------------------*/
   75526 
   75527 int calclex (void)
   75528 {
   75529   int c;
   75530   /* Skip current token, then white spaces.  */
   75531   do
   75532     {
   75533      (calclloc).first_column = (calclloc).last_column;
   75534       (calclloc).first_line   = (calclloc).last_line;
   75535 
   75536     }
   75537   while ((c = get_char ()) == ' ' || c == '\t');
   75538 
   75539   /* process numbers   */
   75540   if (c == '.' || isdigit (c))
   75541     {
   75542       unget_char ( c);
   75543       (calclval).ival = read_signed_integer ();
   75544       return NUM;
   75545     }
   75546 
   75547   /* Return end-of-file.  */
   75548   if (c == EOF)
   75549     return CALC_EOF;
   75550 
   75551   /* Return single chars. */
   75552   return c;
   75553 }
   75554 _ATEOF
   75555 
   75556 
   75557 cat >calc-main.c <<'_ATEOF'
   75558 #include <config.h>
   75559 /* We don't need perfect functions for these tests. */
   75560 #undef malloc
   75561 #undef memcmp
   75562 #undef realloc
   75563 
   75564 #include "calc.h"
   75565 
   75566 #include <assert.h>
   75567 #if HAVE_UNISTD_H
   75568 # include <unistd.h>
   75569 #else
   75570 # undef alarm
   75571 # define alarm(seconds) /* empty */
   75572 #endif
   75573 
   75574 
   75575 
   75576 semantic_value global_result = 0;
   75577 int global_count = 0;
   75578 
   75579 /* A C main function.  */
   75580 int
   75581 main (int argc, const char **argv)
   75582 {
   75583   semantic_value result = 0;
   75584   int count = 0;
   75585   int status;
   75586 
   75587   /* This used to be alarm (10), but that isn't enough time for
   75588      a July 1995 vintage DEC Alphastation 200 4/100 system,
   75589      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   75590   alarm (100);
   75591 
   75592   if (argc == 2)
   75593     input = fopen (argv[1], "r");
   75594   else
   75595     input = stdin;
   75596 
   75597   if (!input)
   75598     {
   75599       perror (argv[1]);
   75600       return 3;
   75601     }
   75602 
   75603   calcdebug = 1;
   75604   status = calcparse ();
   75605   if (fclose (input))
   75606     perror ("fclose");
   75607   assert (global_result == result);
   75608   assert (global_count == count);
   75609   return status;
   75610 }
   75611 _ATEOF
   75612 
   75613 
   75614 
   75615 
   75616 
   75617 
   75618 
   75619 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   75620   at_save_special_files
   75621   mkdir xml-tests
   75622     # Don't combine these Bison invocations since we want to be sure that
   75623   # --report=all isn't required to get the full XML file.
   75624   { set +x
   75625 $as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   75626                   --graph=xml-tests/test.dot -o calc.c calc.y"
   75627 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615"
   75628 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   75629                   --graph=xml-tests/test.dot -o calc.c calc.y
   75630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75631 at_status=$? at_failed=false
   75632 $at_check_filter
   75633 echo stderr:; cat "$at_stderr"
   75634 echo stdout:; cat "$at_stdout"
   75635 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75636 $at_failed && at_fn_log_failure
   75637 $at_traceon; }
   75638 
   75639   { set +x
   75640 $as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   75641 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:615"
   75642 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   75643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75644 at_status=$? at_failed=false
   75645 $at_check_filter
   75646 echo stderr:; cat "$at_stderr"
   75647 echo stdout:; cat "$at_stdout"
   75648 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75649 $at_failed && at_fn_log_failure
   75650 $at_traceon; }
   75651 
   75652     cp xml-tests/test.output expout
   75653   { set +x
   75654 $as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\
   75655              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   75656              xml-tests/test.xml"
   75657 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615"
   75658 ( $at_check_trace; $XSLTPROC \
   75659              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   75660              xml-tests/test.xml
   75661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75662 at_status=$? at_failed=false
   75663 $at_check_filter
   75664 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75665 $at_diff expout "$at_stdout" || at_failed=:
   75666 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75667 $at_failed && at_fn_log_failure
   75668 $at_traceon; }
   75669 
   75670   sort xml-tests/test.dot > expout
   75671   { set +x
   75672 $as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\
   75673              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   75674              xml-tests/test.xml | sort"
   75675 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615"
   75676 ( $at_check_trace; $XSLTPROC \
   75677              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   75678              xml-tests/test.xml | sort
   75679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75680 at_status=$? at_failed=false
   75681 $at_check_filter
   75682 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75683 $at_diff expout "$at_stdout" || at_failed=:
   75684 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75685 $at_failed && at_fn_log_failure
   75686 $at_traceon; }
   75687 
   75688   rm -rf xml-tests expout
   75689   at_restore_special_files
   75690 fi
   75691 { set +x
   75692 $as_echo "$at_srcdir/calc.at:615: bison -o calc.c calc.y"
   75693 at_fn_check_prepare_trace "calc.at:615"
   75694 ( $at_check_trace; bison -o calc.c calc.y
   75695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75696 at_status=$? at_failed=false
   75697 $at_check_filter
   75698 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75699 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75700 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75701 $at_failed && at_fn_log_failure
   75702 $at_traceon; }
   75703 
   75704 
   75705    { set +x
   75706 $as_echo "$at_srcdir/calc.at:615: \$BISON_C_WORKS"
   75707 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:615"
   75708 ( $at_check_trace; $BISON_C_WORKS
   75709 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75710 at_status=$? at_failed=false
   75711 $at_check_filter
   75712 echo stderr:; cat "$at_stderr"
   75713 echo stdout:; cat "$at_stdout"
   75714 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75715 $at_failed && at_fn_log_failure
   75716 $at_traceon; }
   75717 
   75718 { set +x
   75719 $as_echo "$at_srcdir/calc.at:615: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   75720 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:615"
   75721 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   75722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75723 at_status=$? at_failed=false
   75724 $at_check_filter
   75725 echo stderr:; cat "$at_stderr"
   75726 echo stdout:; cat "$at_stdout"
   75727 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75728 $at_failed && at_fn_log_failure
   75729 $at_traceon; }
   75730 
   75731 
   75732 { set +x
   75733 $as_echo "$at_srcdir/calc.at:615: \$PERL -ne '
   75734   chomp;
   75735   print \"\$.: {\$_}\\n\"
   75736     if (# No starting/ending empty lines.
   75737         (eof || \$. == 1) && /^\\s*\$/
   75738         # No trailing space.  FIXME: not ready for \"maint\".
   75739         # || /\\s\$/
   75740         )' calc.c
   75741 "
   75742 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615"
   75743 ( $at_check_trace; $PERL -ne '
   75744   chomp;
   75745   print "$.: {$_}\n"
   75746     if (# No starting/ending empty lines.
   75747         (eof || $. == 1) && /^\s*$/
   75748         # No trailing space.  FIXME: not ready for "maint".
   75749         # || /\s$/
   75750         )' calc.c
   75751 
   75752 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75753 at_status=$? at_failed=false
   75754 $at_check_filter
   75755 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75756 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75757 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75758 $at_failed && at_fn_log_failure
   75759 $at_traceon; }
   75760 
   75761 { set +x
   75762 $as_echo "$at_srcdir/calc.at:615: \$PERL -ne '
   75763   chomp;
   75764   print \"\$.: {\$_}\\n\"
   75765     if (# No starting/ending empty lines.
   75766         (eof || \$. == 1) && /^\\s*\$/
   75767         # No trailing space.  FIXME: not ready for \"maint\".
   75768         # || /\\s\$/
   75769         )' calc.h
   75770 "
   75771 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615"
   75772 ( $at_check_trace; $PERL -ne '
   75773   chomp;
   75774   print "$.: {$_}\n"
   75775     if (# No starting/ending empty lines.
   75776         (eof || $. == 1) && /^\s*$/
   75777         # No trailing space.  FIXME: not ready for "maint".
   75778         # || /\s$/
   75779         )' calc.h
   75780 
   75781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75782 at_status=$? at_failed=false
   75783 $at_check_filter
   75784 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75785 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75786 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75787 $at_failed && at_fn_log_failure
   75788 $at_traceon; }
   75789 
   75790 
   75791 # Test the priorities.
   75792 cat >input <<'_ATEOF'
   75793 1 + 2 * 3 = 7
   75794 1 + 2 * -3 = -5
   75795 
   75796 -1^2 = -1
   75797 (-1)^2 = 1
   75798 
   75799 ---1 = -1
   75800 
   75801 1 - 2 - 3 = -4
   75802 1 - (2 - 3) = 2
   75803 
   75804 2^2^3 = 256
   75805 (2^2)^3 = 64
   75806 _ATEOF
   75807 
   75808 { set +x
   75809 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   75810 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   75811 ( $at_check_trace;  $PREPARSER ./calc input
   75812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75813 at_status=$? at_failed=false
   75814 $at_check_filter
   75815 echo stderr:; tee stderr <"$at_stderr"
   75816 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75817 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75818 $at_failed && at_fn_log_failure
   75819 $at_traceon; }
   75820 
   75821 { set +x
   75822 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75823 at_fn_check_prepare_trace "calc.at:615"
   75824 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75826 at_status=$? at_failed=false
   75827 $at_check_filter
   75828 echo stderr:; tee stderr <"$at_stderr"
   75829 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75830 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75831 $at_failed && at_fn_log_failure
   75832 $at_traceon; }
   75833 
   75834 
   75835 
   75836 
   75837 # Some syntax errors.
   75838 cat >input <<'_ATEOF'
   75839 1 2
   75840 _ATEOF
   75841 
   75842 { set +x
   75843 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   75844 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   75845 ( $at_check_trace;  $PREPARSER ./calc input
   75846 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75847 at_status=$? at_failed=false
   75848 $at_check_filter
   75849 echo stderr:; tee stderr <"$at_stderr"
   75850 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75851 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
   75852 $at_failed && at_fn_log_failure
   75853 $at_traceon; }
   75854 
   75855 { set +x
   75856 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75857 at_fn_check_prepare_trace "calc.at:615"
   75858 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75860 at_status=$? at_failed=false
   75861 $at_check_filter
   75862 echo stderr:; tee stderr <"$at_stderr"
   75863 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75864 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75865 $at_failed && at_fn_log_failure
   75866 $at_traceon; }
   75867 
   75868 
   75869 
   75870 # Normalize the observed and expected error messages, depending upon the
   75871 # options.
   75872 # 1. Remove the traces from observed.
   75873 sed '/^Starting/d
   75874 /^Entering/d
   75875 /^Stack/d
   75876 /^Reading/d
   75877 /^Reducing/d
   75878 /^Return/d
   75879 /^Shifting/d
   75880 /^state/d
   75881 /^Cleanup:/d
   75882 /^Error:/d
   75883 /^Next/d
   75884 /^Now/d
   75885 /^Discarding/d
   75886 / \$[0-9$]* = /d
   75887 /^yydestructor:/d' stderr >at-stderr
   75888 mv at-stderr stderr
   75889 # 2. Create the reference error message.
   75890 cat >expout <<'_ATEOF'
   75891 1.3: syntax error, unexpected number
   75892 _ATEOF
   75893 
   75894 # 3. If locations are not used, remove them.
   75895 
   75896 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   75897 
   75898 # 5. Check
   75899 { set +x
   75900 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   75901 at_fn_check_prepare_trace "calc.at:615"
   75902 ( $at_check_trace; cat stderr
   75903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75904 at_status=$? at_failed=false
   75905 $at_check_filter
   75906 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75907 $at_diff expout "$at_stdout" || at_failed=:
   75908 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75909 $at_failed && at_fn_log_failure
   75910 $at_traceon; }
   75911 
   75912 
   75913 cat >input <<'_ATEOF'
   75914 1//2
   75915 _ATEOF
   75916 
   75917 { set +x
   75918 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   75919 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   75920 ( $at_check_trace;  $PREPARSER ./calc input
   75921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75922 at_status=$? at_failed=false
   75923 $at_check_filter
   75924 echo stderr:; tee stderr <"$at_stderr"
   75925 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75926 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
   75927 $at_failed && at_fn_log_failure
   75928 $at_traceon; }
   75929 
   75930 { set +x
   75931 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   75932 at_fn_check_prepare_trace "calc.at:615"
   75933 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   75934 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75935 at_status=$? at_failed=false
   75936 $at_check_filter
   75937 echo stderr:; tee stderr <"$at_stderr"
   75938 at_fn_diff_devnull "$at_stdout" || at_failed=:
   75939 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75940 $at_failed && at_fn_log_failure
   75941 $at_traceon; }
   75942 
   75943 
   75944 
   75945 # Normalize the observed and expected error messages, depending upon the
   75946 # options.
   75947 # 1. Remove the traces from observed.
   75948 sed '/^Starting/d
   75949 /^Entering/d
   75950 /^Stack/d
   75951 /^Reading/d
   75952 /^Reducing/d
   75953 /^Return/d
   75954 /^Shifting/d
   75955 /^state/d
   75956 /^Cleanup:/d
   75957 /^Error:/d
   75958 /^Next/d
   75959 /^Now/d
   75960 /^Discarding/d
   75961 / \$[0-9$]* = /d
   75962 /^yydestructor:/d' stderr >at-stderr
   75963 mv at-stderr stderr
   75964 # 2. Create the reference error message.
   75965 cat >expout <<'_ATEOF'
   75966 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   75967 _ATEOF
   75968 
   75969 # 3. If locations are not used, remove them.
   75970 
   75971 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   75972 
   75973 # 5. Check
   75974 { set +x
   75975 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   75976 at_fn_check_prepare_trace "calc.at:615"
   75977 ( $at_check_trace; cat stderr
   75978 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75979 at_status=$? at_failed=false
   75980 $at_check_filter
   75981 at_fn_diff_devnull "$at_stderr" || at_failed=:
   75982 $at_diff expout "$at_stdout" || at_failed=:
   75983 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   75984 $at_failed && at_fn_log_failure
   75985 $at_traceon; }
   75986 
   75987 
   75988 cat >input <<'_ATEOF'
   75989 error
   75990 _ATEOF
   75991 
   75992 { set +x
   75993 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   75994 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   75995 ( $at_check_trace;  $PREPARSER ./calc input
   75996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   75997 at_status=$? at_failed=false
   75998 $at_check_filter
   75999 echo stderr:; tee stderr <"$at_stderr"
   76000 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76001 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
   76002 $at_failed && at_fn_log_failure
   76003 $at_traceon; }
   76004 
   76005 { set +x
   76006 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76007 at_fn_check_prepare_trace "calc.at:615"
   76008 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76010 at_status=$? at_failed=false
   76011 $at_check_filter
   76012 echo stderr:; tee stderr <"$at_stderr"
   76013 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76014 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76015 $at_failed && at_fn_log_failure
   76016 $at_traceon; }
   76017 
   76018 
   76019 
   76020 # Normalize the observed and expected error messages, depending upon the
   76021 # options.
   76022 # 1. Remove the traces from observed.
   76023 sed '/^Starting/d
   76024 /^Entering/d
   76025 /^Stack/d
   76026 /^Reading/d
   76027 /^Reducing/d
   76028 /^Return/d
   76029 /^Shifting/d
   76030 /^state/d
   76031 /^Cleanup:/d
   76032 /^Error:/d
   76033 /^Next/d
   76034 /^Now/d
   76035 /^Discarding/d
   76036 / \$[0-9$]* = /d
   76037 /^yydestructor:/d' stderr >at-stderr
   76038 mv at-stderr stderr
   76039 # 2. Create the reference error message.
   76040 cat >expout <<'_ATEOF'
   76041 1.1: syntax error, unexpected $undefined
   76042 _ATEOF
   76043 
   76044 # 3. If locations are not used, remove them.
   76045 
   76046 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76047 
   76048 # 5. Check
   76049 { set +x
   76050 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76051 at_fn_check_prepare_trace "calc.at:615"
   76052 ( $at_check_trace; cat stderr
   76053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76054 at_status=$? at_failed=false
   76055 $at_check_filter
   76056 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76057 $at_diff expout "$at_stdout" || at_failed=:
   76058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76059 $at_failed && at_fn_log_failure
   76060 $at_traceon; }
   76061 
   76062 
   76063 cat >input <<'_ATEOF'
   76064 1 = 2 = 3
   76065 _ATEOF
   76066 
   76067 { set +x
   76068 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   76069 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   76070 ( $at_check_trace;  $PREPARSER ./calc input
   76071 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76072 at_status=$? at_failed=false
   76073 $at_check_filter
   76074 echo stderr:; tee stderr <"$at_stderr"
   76075 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76076 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
   76077 $at_failed && at_fn_log_failure
   76078 $at_traceon; }
   76079 
   76080 { set +x
   76081 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76082 at_fn_check_prepare_trace "calc.at:615"
   76083 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76084 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76085 at_status=$? at_failed=false
   76086 $at_check_filter
   76087 echo stderr:; tee stderr <"$at_stderr"
   76088 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76089 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76090 $at_failed && at_fn_log_failure
   76091 $at_traceon; }
   76092 
   76093 
   76094 
   76095 # Normalize the observed and expected error messages, depending upon the
   76096 # options.
   76097 # 1. Remove the traces from observed.
   76098 sed '/^Starting/d
   76099 /^Entering/d
   76100 /^Stack/d
   76101 /^Reading/d
   76102 /^Reducing/d
   76103 /^Return/d
   76104 /^Shifting/d
   76105 /^state/d
   76106 /^Cleanup:/d
   76107 /^Error:/d
   76108 /^Next/d
   76109 /^Now/d
   76110 /^Discarding/d
   76111 / \$[0-9$]* = /d
   76112 /^yydestructor:/d' stderr >at-stderr
   76113 mv at-stderr stderr
   76114 # 2. Create the reference error message.
   76115 cat >expout <<'_ATEOF'
   76116 1.7: syntax error, unexpected '='
   76117 _ATEOF
   76118 
   76119 # 3. If locations are not used, remove them.
   76120 
   76121 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76122 
   76123 # 5. Check
   76124 { set +x
   76125 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76126 at_fn_check_prepare_trace "calc.at:615"
   76127 ( $at_check_trace; cat stderr
   76128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76129 at_status=$? at_failed=false
   76130 $at_check_filter
   76131 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76132 $at_diff expout "$at_stdout" || at_failed=:
   76133 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76134 $at_failed && at_fn_log_failure
   76135 $at_traceon; }
   76136 
   76137 
   76138 cat >input <<'_ATEOF'
   76139 
   76140 +1
   76141 _ATEOF
   76142 
   76143 { set +x
   76144 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   76145 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   76146 ( $at_check_trace;  $PREPARSER ./calc input
   76147 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76148 at_status=$? at_failed=false
   76149 $at_check_filter
   76150 echo stderr:; tee stderr <"$at_stderr"
   76151 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76152 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
   76153 $at_failed && at_fn_log_failure
   76154 $at_traceon; }
   76155 
   76156 { set +x
   76157 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76158 at_fn_check_prepare_trace "calc.at:615"
   76159 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76161 at_status=$? at_failed=false
   76162 $at_check_filter
   76163 echo stderr:; tee stderr <"$at_stderr"
   76164 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76165 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76166 $at_failed && at_fn_log_failure
   76167 $at_traceon; }
   76168 
   76169 
   76170 
   76171 # Normalize the observed and expected error messages, depending upon the
   76172 # options.
   76173 # 1. Remove the traces from observed.
   76174 sed '/^Starting/d
   76175 /^Entering/d
   76176 /^Stack/d
   76177 /^Reading/d
   76178 /^Reducing/d
   76179 /^Return/d
   76180 /^Shifting/d
   76181 /^state/d
   76182 /^Cleanup:/d
   76183 /^Error:/d
   76184 /^Next/d
   76185 /^Now/d
   76186 /^Discarding/d
   76187 / \$[0-9$]* = /d
   76188 /^yydestructor:/d' stderr >at-stderr
   76189 mv at-stderr stderr
   76190 # 2. Create the reference error message.
   76191 cat >expout <<'_ATEOF'
   76192 2.1: syntax error, unexpected '+'
   76193 _ATEOF
   76194 
   76195 # 3. If locations are not used, remove them.
   76196 
   76197 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76198 
   76199 # 5. Check
   76200 { set +x
   76201 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76202 at_fn_check_prepare_trace "calc.at:615"
   76203 ( $at_check_trace; cat stderr
   76204 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76205 at_status=$? at_failed=false
   76206 $at_check_filter
   76207 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76208 $at_diff expout "$at_stdout" || at_failed=:
   76209 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76210 $at_failed && at_fn_log_failure
   76211 $at_traceon; }
   76212 
   76213 
   76214 # Exercise error messages with EOF: work on an empty file.
   76215 { set +x
   76216 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc /dev/null"
   76217 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:615"
   76218 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   76219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76220 at_status=$? at_failed=false
   76221 $at_check_filter
   76222 echo stderr:; tee stderr <"$at_stderr"
   76223 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76224 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
   76225 $at_failed && at_fn_log_failure
   76226 $at_traceon; }
   76227 
   76228 { set +x
   76229 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76230 at_fn_check_prepare_trace "calc.at:615"
   76231 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76233 at_status=$? at_failed=false
   76234 $at_check_filter
   76235 echo stderr:; tee stderr <"$at_stderr"
   76236 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76237 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76238 $at_failed && at_fn_log_failure
   76239 $at_traceon; }
   76240 
   76241 
   76242 
   76243 # Normalize the observed and expected error messages, depending upon the
   76244 # options.
   76245 # 1. Remove the traces from observed.
   76246 sed '/^Starting/d
   76247 /^Entering/d
   76248 /^Stack/d
   76249 /^Reading/d
   76250 /^Reducing/d
   76251 /^Return/d
   76252 /^Shifting/d
   76253 /^state/d
   76254 /^Cleanup:/d
   76255 /^Error:/d
   76256 /^Next/d
   76257 /^Now/d
   76258 /^Discarding/d
   76259 / \$[0-9$]* = /d
   76260 /^yydestructor:/d' stderr >at-stderr
   76261 mv at-stderr stderr
   76262 # 2. Create the reference error message.
   76263 cat >expout <<'_ATEOF'
   76264 1.1: syntax error, unexpected end of input
   76265 _ATEOF
   76266 
   76267 # 3. If locations are not used, remove them.
   76268 
   76269 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76270 
   76271 # 5. Check
   76272 { set +x
   76273 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76274 at_fn_check_prepare_trace "calc.at:615"
   76275 ( $at_check_trace; cat stderr
   76276 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76277 at_status=$? at_failed=false
   76278 $at_check_filter
   76279 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76280 $at_diff expout "$at_stdout" || at_failed=:
   76281 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76282 $at_failed && at_fn_log_failure
   76283 $at_traceon; }
   76284 
   76285 
   76286 
   76287 # Exercise the error token: without it, we die at the first error,
   76288 # hence be sure to
   76289 #
   76290 # - have several errors which exercise different shift/discardings
   76291 #   - (): nothing to pop, nothing to discard
   76292 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   76293 #   - (* * *): nothing to pop, a lot to discard
   76294 #   - (1 + 2 * *): some to pop and discard
   76295 #
   76296 # - test the action associated to `error'
   76297 #
   76298 # - check the lookahead that triggers an error is not discarded
   76299 #   when we enter error recovery.  Below, the lookahead causing the
   76300 #   first error is ")", which is needed to recover from the error and
   76301 #   produce the "0" that triggers the "0 != 1" error.
   76302 #
   76303 cat >input <<'_ATEOF'
   76304 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   76305 _ATEOF
   76306 
   76307 { set +x
   76308 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   76309 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   76310 ( $at_check_trace;  $PREPARSER ./calc input
   76311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76312 at_status=$? at_failed=false
   76313 $at_check_filter
   76314 echo stderr:; tee stderr <"$at_stderr"
   76315 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76316 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76317 $at_failed && at_fn_log_failure
   76318 $at_traceon; }
   76319 
   76320 { set +x
   76321 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76322 at_fn_check_prepare_trace "calc.at:615"
   76323 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76325 at_status=$? at_failed=false
   76326 $at_check_filter
   76327 echo stderr:; tee stderr <"$at_stderr"
   76328 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76329 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76330 $at_failed && at_fn_log_failure
   76331 $at_traceon; }
   76332 
   76333 
   76334 
   76335 # Normalize the observed and expected error messages, depending upon the
   76336 # options.
   76337 # 1. Remove the traces from observed.
   76338 sed '/^Starting/d
   76339 /^Entering/d
   76340 /^Stack/d
   76341 /^Reading/d
   76342 /^Reducing/d
   76343 /^Return/d
   76344 /^Shifting/d
   76345 /^state/d
   76346 /^Cleanup:/d
   76347 /^Error:/d
   76348 /^Next/d
   76349 /^Now/d
   76350 /^Discarding/d
   76351 / \$[0-9$]* = /d
   76352 /^yydestructor:/d' stderr >at-stderr
   76353 mv at-stderr stderr
   76354 # 2. Create the reference error message.
   76355 cat >expout <<'_ATEOF'
   76356 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   76357 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   76358 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   76359 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   76360 calc: error: 4444 != 1
   76361 _ATEOF
   76362 
   76363 # 3. If locations are not used, remove them.
   76364 
   76365 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76366 
   76367 # 5. Check
   76368 { set +x
   76369 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76370 at_fn_check_prepare_trace "calc.at:615"
   76371 ( $at_check_trace; cat stderr
   76372 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76373 at_status=$? at_failed=false
   76374 $at_check_filter
   76375 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76376 $at_diff expout "$at_stdout" || at_failed=:
   76377 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76378 $at_failed && at_fn_log_failure
   76379 $at_traceon; }
   76380 
   76381 
   76382 
   76383 # The same, but this time exercising explicitly triggered syntax errors.
   76384 # POSIX says the lookahead causing the error should not be discarded.
   76385 cat >input <<'_ATEOF'
   76386 (!) + (1 2) = 1
   76387 _ATEOF
   76388 
   76389 { set +x
   76390 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   76391 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   76392 ( $at_check_trace;  $PREPARSER ./calc input
   76393 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76394 at_status=$? at_failed=false
   76395 $at_check_filter
   76396 echo stderr:; tee stderr <"$at_stderr"
   76397 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76398 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76399 $at_failed && at_fn_log_failure
   76400 $at_traceon; }
   76401 
   76402 { set +x
   76403 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76404 at_fn_check_prepare_trace "calc.at:615"
   76405 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76407 at_status=$? at_failed=false
   76408 $at_check_filter
   76409 echo stderr:; tee stderr <"$at_stderr"
   76410 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76411 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76412 $at_failed && at_fn_log_failure
   76413 $at_traceon; }
   76414 
   76415 
   76416 
   76417 # Normalize the observed and expected error messages, depending upon the
   76418 # options.
   76419 # 1. Remove the traces from observed.
   76420 sed '/^Starting/d
   76421 /^Entering/d
   76422 /^Stack/d
   76423 /^Reading/d
   76424 /^Reducing/d
   76425 /^Return/d
   76426 /^Shifting/d
   76427 /^state/d
   76428 /^Cleanup:/d
   76429 /^Error:/d
   76430 /^Next/d
   76431 /^Now/d
   76432 /^Discarding/d
   76433 / \$[0-9$]* = /d
   76434 /^yydestructor:/d' stderr >at-stderr
   76435 mv at-stderr stderr
   76436 # 2. Create the reference error message.
   76437 cat >expout <<'_ATEOF'
   76438 1.10: syntax error, unexpected number
   76439 calc: error: 2222 != 1
   76440 _ATEOF
   76441 
   76442 # 3. If locations are not used, remove them.
   76443 
   76444 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76445 
   76446 # 5. Check
   76447 { set +x
   76448 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76449 at_fn_check_prepare_trace "calc.at:615"
   76450 ( $at_check_trace; cat stderr
   76451 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76452 at_status=$? at_failed=false
   76453 $at_check_filter
   76454 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76455 $at_diff expout "$at_stdout" || at_failed=:
   76456 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76457 $at_failed && at_fn_log_failure
   76458 $at_traceon; }
   76459 
   76460 
   76461 cat >input <<'_ATEOF'
   76462 (- *) + (1 2) = 1
   76463 _ATEOF
   76464 
   76465 { set +x
   76466 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   76467 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   76468 ( $at_check_trace;  $PREPARSER ./calc input
   76469 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76470 at_status=$? at_failed=false
   76471 $at_check_filter
   76472 echo stderr:; tee stderr <"$at_stderr"
   76473 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76474 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76475 $at_failed && at_fn_log_failure
   76476 $at_traceon; }
   76477 
   76478 { set +x
   76479 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76480 at_fn_check_prepare_trace "calc.at:615"
   76481 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76483 at_status=$? at_failed=false
   76484 $at_check_filter
   76485 echo stderr:; tee stderr <"$at_stderr"
   76486 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76487 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76488 $at_failed && at_fn_log_failure
   76489 $at_traceon; }
   76490 
   76491 
   76492 
   76493 # Normalize the observed and expected error messages, depending upon the
   76494 # options.
   76495 # 1. Remove the traces from observed.
   76496 sed '/^Starting/d
   76497 /^Entering/d
   76498 /^Stack/d
   76499 /^Reading/d
   76500 /^Reducing/d
   76501 /^Return/d
   76502 /^Shifting/d
   76503 /^state/d
   76504 /^Cleanup:/d
   76505 /^Error:/d
   76506 /^Next/d
   76507 /^Now/d
   76508 /^Discarding/d
   76509 / \$[0-9$]* = /d
   76510 /^yydestructor:/d' stderr >at-stderr
   76511 mv at-stderr stderr
   76512 # 2. Create the reference error message.
   76513 cat >expout <<'_ATEOF'
   76514 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   76515 1.12: syntax error, unexpected number
   76516 calc: error: 2222 != 1
   76517 _ATEOF
   76518 
   76519 # 3. If locations are not used, remove them.
   76520 
   76521 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76522 
   76523 # 5. Check
   76524 { set +x
   76525 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76526 at_fn_check_prepare_trace "calc.at:615"
   76527 ( $at_check_trace; cat stderr
   76528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76529 at_status=$? at_failed=false
   76530 $at_check_filter
   76531 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76532 $at_diff expout "$at_stdout" || at_failed=:
   76533 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76534 $at_failed && at_fn_log_failure
   76535 $at_traceon; }
   76536 
   76537 
   76538 
   76539 # Check that yyerrok works properly: second error is not reported,
   76540 # third and fourth are.  Parse status is succesfull.
   76541 cat >input <<'_ATEOF'
   76542 (* *) + (*) + (*)
   76543 _ATEOF
   76544 
   76545 { set +x
   76546 $as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
   76547 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
   76548 ( $at_check_trace;  $PREPARSER ./calc input
   76549 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76550 at_status=$? at_failed=false
   76551 $at_check_filter
   76552 echo stderr:; tee stderr <"$at_stderr"
   76553 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76554 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76555 $at_failed && at_fn_log_failure
   76556 $at_traceon; }
   76557 
   76558 { set +x
   76559 $as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   76560 at_fn_check_prepare_trace "calc.at:615"
   76561 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   76562 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76563 at_status=$? at_failed=false
   76564 $at_check_filter
   76565 echo stderr:; tee stderr <"$at_stderr"
   76566 at_fn_diff_devnull "$at_stdout" || at_failed=:
   76567 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76568 $at_failed && at_fn_log_failure
   76569 $at_traceon; }
   76570 
   76571 
   76572 
   76573 # Normalize the observed and expected error messages, depending upon the
   76574 # options.
   76575 # 1. Remove the traces from observed.
   76576 sed '/^Starting/d
   76577 /^Entering/d
   76578 /^Stack/d
   76579 /^Reading/d
   76580 /^Reducing/d
   76581 /^Return/d
   76582 /^Shifting/d
   76583 /^state/d
   76584 /^Cleanup:/d
   76585 /^Error:/d
   76586 /^Next/d
   76587 /^Now/d
   76588 /^Discarding/d
   76589 / \$[0-9$]* = /d
   76590 /^yydestructor:/d' stderr >at-stderr
   76591 mv at-stderr stderr
   76592 # 2. Create the reference error message.
   76593 cat >expout <<'_ATEOF'
   76594 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   76595 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   76596 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   76597 _ATEOF
   76598 
   76599 # 3. If locations are not used, remove them.
   76600 
   76601 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   76602 
   76603 # 5. Check
   76604 { set +x
   76605 $as_echo "$at_srcdir/calc.at:615: cat stderr"
   76606 at_fn_check_prepare_trace "calc.at:615"
   76607 ( $at_check_trace; cat stderr
   76608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76609 at_status=$? at_failed=false
   76610 $at_check_filter
   76611 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76612 $at_diff expout "$at_stdout" || at_failed=:
   76613 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
   76614 $at_failed && at_fn_log_failure
   76615 $at_traceon; }
   76616 
   76617 
   76618 
   76619 
   76620 
   76621   set +x
   76622   $at_times_p && times >"$at_times_file"
   76623 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   76624 read at_status <"$at_status_file"
   76625 #AT_STOP_213
   76626 #AT_START_214
   76627 at_fn_group_banner 214 'calc.at:616' \
   76628   "Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11
   76629 at_xfail=no
   76630 (
   76631   $as_echo "214. $at_setup_line: testing $at_desc ..."
   76632   $at_traceon
   76633 
   76634 
   76635 
   76636 
   76637 
   76638 
   76639 
   76640 
   76641 
   76642 
   76643 cat >calc.y <<'_ATEOF'
   76644 %code top {
   76645 #include <config.h>
   76646 /* We don't need perfect functions for these tests. */
   76647 #undef malloc
   76648 #undef memcmp
   76649 #undef realloc
   76650 }
   76651 
   76652 /* Infix notation calculator--calc */
   76653 %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc
   76654 
   76655 %code requires
   76656 {
   76657 
   76658   /* Exercise pre-prologue dependency to %union.  */
   76659   typedef int semantic_value;
   76660 }
   76661 
   76662 /* Exercise %union. */
   76663 %union
   76664 {
   76665   semantic_value ival;
   76666 };
   76667 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   76668 
   76669 %code provides
   76670 {
   76671   #include <stdio.h>
   76672   /* The input.  */
   76673   extern FILE *input;
   76674   extern semantic_value global_result;
   76675   extern int global_count;
   76676 }
   76677 
   76678 %code
   76679 {
   76680 #include <assert.h>
   76681 #include <string.h>
   76682 #define USE(Var)
   76683 
   76684 FILE *input;
   76685 static int power (int base, int exponent);
   76686 
   76687 static void calcerror ( const char *msg);
   76688 int calclex (void);
   76689 }
   76690 
   76691 
   76692 
   76693 /* Bison Declarations */
   76694 %token CALC_EOF 0 "end of input"
   76695 %token <ival> NUM "number"
   76696 %type  <ival> exp
   76697 
   76698 %nonassoc '=' /* comparison            */
   76699 %left '-' '+'
   76700 %left '*' '/'
   76701 %left NEG     /* negation--unary minus */
   76702 %right '^'    /* exponentiation        */
   76703 
   76704 /* Grammar follows */
   76705 %%
   76706 input:
   76707   line
   76708 | input line         {  }
   76709 ;
   76710 
   76711 line:
   76712   '\n'
   76713 | exp '\n'           { USE ($1); }
   76714 ;
   76715 
   76716 exp:
   76717   NUM                { $$ = $1;             }
   76718 | exp '=' exp
   76719   {
   76720     if ($1 != $3)
   76721       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   76722     $$ = $1;
   76723   }
   76724 | exp '+' exp        { $$ = $1 + $3;        }
   76725 | exp '-' exp        { $$ = $1 - $3;        }
   76726 | exp '*' exp        { $$ = $1 * $3;        }
   76727 | exp '/' exp        { $$ = $1 / $3;        }
   76728 | '-' exp  %prec NEG { $$ = -$2;            }
   76729 | exp '^' exp        { $$ = power ($1, $3); }
   76730 | '(' exp ')'        { $$ = $2;             }
   76731 | '(' error ')'      { $$ = 1111; yyerrok;  }
   76732 | '!'                { $$ = 0; YYERROR;     }
   76733 | '-' error          { $$ = 0; YYERROR;     }
   76734 ;
   76735 %%
   76736 
   76737 static int
   76738 power (int base, int exponent)
   76739 {
   76740   int res = 1;
   76741   assert (0 <= exponent);
   76742   for (/* Niente */; exponent; --exponent)
   76743     res *= base;
   76744   return res;
   76745 }
   76746 
   76747 
   76748 #include <stdio.h>
   76749 /* A C error reporting function.  */
   76750 static
   76751 void calcerror ( const char *msg)
   76752 {
   76753   YY_LOCATION_PRINT (stderr, (calclloc));
   76754   fprintf (stderr, ": ");
   76755   fprintf (stderr, "%s\n", msg);
   76756 }
   76757 _ATEOF
   76758 
   76759 
   76760 
   76761 cat >calc-lex.c <<'_ATEOF'
   76762 #include <config.h>
   76763 /* We don't need perfect functions for these tests. */
   76764 #undef malloc
   76765 #undef memcmp
   76766 #undef realloc
   76767 
   76768 #include "calc.h"
   76769 
   76770 #include <ctype.h>
   76771 
   76772 int calclex (void);
   76773 static int get_char (void);
   76774 static void unget_char ( int c);
   76775 
   76776 
   76777 static CALCLTYPE last_yylloc;
   76778 
   76779 static int
   76780 get_char (void)
   76781 {
   76782   int res = getc (input);
   76783   ;
   76784 
   76785   last_yylloc = (calclloc);
   76786   if (res == '\n')
   76787     {
   76788       (calclloc).last_line++;
   76789       (calclloc).last_column = 1;
   76790     }
   76791   else
   76792     (calclloc).last_column++;
   76793 
   76794   return res;
   76795 }
   76796 
   76797 static void
   76798 unget_char ( int c)
   76799 {
   76800   ;
   76801 
   76802   /* Wrong when C == `\n'. */
   76803   (calclloc) = last_yylloc;
   76804 
   76805   ungetc (c, input);
   76806 }
   76807 
   76808 static int
   76809 read_signed_integer (void)
   76810 {
   76811   int c = get_char ();
   76812   int sign = 1;
   76813   int n = 0;
   76814 
   76815   ;
   76816   if (c == '-')
   76817     {
   76818       c = get_char ();
   76819       sign = -1;
   76820     }
   76821 
   76822   while (isdigit (c))
   76823     {
   76824       n = 10 * n + (c - '0');
   76825       c = get_char ();
   76826     }
   76827 
   76828   unget_char ( c);
   76829 
   76830   return sign * n;
   76831 }
   76832 
   76833 
   76834 /*---------------------------------------------------------------.
   76835 | Lexical analyzer returns an integer on the stack and the token |
   76836 | NUM, or the ASCII character read if not a number.  Skips all   |
   76837 | blanks and tabs, returns 0 for EOF.                            |
   76838 `---------------------------------------------------------------*/
   76839 
   76840 int calclex (void)
   76841 {
   76842   int c;
   76843   /* Skip current token, then white spaces.  */
   76844   do
   76845     {
   76846      (calclloc).first_column = (calclloc).last_column;
   76847       (calclloc).first_line   = (calclloc).last_line;
   76848 
   76849     }
   76850   while ((c = get_char ()) == ' ' || c == '\t');
   76851 
   76852   /* process numbers   */
   76853   if (c == '.' || isdigit (c))
   76854     {
   76855       unget_char ( c);
   76856       (calclval).ival = read_signed_integer ();
   76857       return NUM;
   76858     }
   76859 
   76860   /* Return end-of-file.  */
   76861   if (c == EOF)
   76862     return CALC_EOF;
   76863 
   76864   /* Return single chars. */
   76865   return c;
   76866 }
   76867 _ATEOF
   76868 
   76869 
   76870 cat >calc-main.c <<'_ATEOF'
   76871 #include <config.h>
   76872 /* We don't need perfect functions for these tests. */
   76873 #undef malloc
   76874 #undef memcmp
   76875 #undef realloc
   76876 
   76877 #include "calc.h"
   76878 
   76879 #include <assert.h>
   76880 #if HAVE_UNISTD_H
   76881 # include <unistd.h>
   76882 #else
   76883 # undef alarm
   76884 # define alarm(seconds) /* empty */
   76885 #endif
   76886 
   76887 
   76888 
   76889 semantic_value global_result = 0;
   76890 int global_count = 0;
   76891 
   76892 /* A C main function.  */
   76893 int
   76894 main (int argc, const char **argv)
   76895 {
   76896   semantic_value result = 0;
   76897   int count = 0;
   76898   int status;
   76899 
   76900   /* This used to be alarm (10), but that isn't enough time for
   76901      a July 1995 vintage DEC Alphastation 200 4/100 system,
   76902      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   76903   alarm (100);
   76904 
   76905   if (argc == 2)
   76906     input = fopen (argv[1], "r");
   76907   else
   76908     input = stdin;
   76909 
   76910   if (!input)
   76911     {
   76912       perror (argv[1]);
   76913       return 3;
   76914     }
   76915 
   76916   calcdebug = 1;
   76917   status = calcparse ();
   76918   if (fclose (input))
   76919     perror ("fclose");
   76920   assert (global_result == result);
   76921   assert (global_count == count);
   76922   return status;
   76923 }
   76924 _ATEOF
   76925 
   76926 
   76927 
   76928 
   76929 
   76930 
   76931 
   76932 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   76933   at_save_special_files
   76934   mkdir xml-tests
   76935     # Don't combine these Bison invocations since we want to be sure that
   76936   # --report=all isn't required to get the full XML file.
   76937   { set +x
   76938 $as_echo "$at_srcdir/calc.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   76939                   --graph=xml-tests/test.dot -o calc.c calc.y"
   76940 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616"
   76941 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   76942                   --graph=xml-tests/test.dot -o calc.c calc.y
   76943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76944 at_status=$? at_failed=false
   76945 $at_check_filter
   76946 echo stderr:; cat "$at_stderr"
   76947 echo stdout:; cat "$at_stdout"
   76948 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   76949 $at_failed && at_fn_log_failure
   76950 $at_traceon; }
   76951 
   76952   { set +x
   76953 $as_echo "$at_srcdir/calc.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   76954 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:616"
   76955 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   76956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76957 at_status=$? at_failed=false
   76958 $at_check_filter
   76959 echo stderr:; cat "$at_stderr"
   76960 echo stdout:; cat "$at_stdout"
   76961 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   76962 $at_failed && at_fn_log_failure
   76963 $at_traceon; }
   76964 
   76965     cp xml-tests/test.output expout
   76966   { set +x
   76967 $as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\
   76968              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   76969              xml-tests/test.xml"
   76970 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616"
   76971 ( $at_check_trace; $XSLTPROC \
   76972              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   76973              xml-tests/test.xml
   76974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76975 at_status=$? at_failed=false
   76976 $at_check_filter
   76977 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76978 $at_diff expout "$at_stdout" || at_failed=:
   76979 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   76980 $at_failed && at_fn_log_failure
   76981 $at_traceon; }
   76982 
   76983   sort xml-tests/test.dot > expout
   76984   { set +x
   76985 $as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\
   76986              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   76987              xml-tests/test.xml | sort"
   76988 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616"
   76989 ( $at_check_trace; $XSLTPROC \
   76990              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   76991              xml-tests/test.xml | sort
   76992 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   76993 at_status=$? at_failed=false
   76994 $at_check_filter
   76995 at_fn_diff_devnull "$at_stderr" || at_failed=:
   76996 $at_diff expout "$at_stdout" || at_failed=:
   76997 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   76998 $at_failed && at_fn_log_failure
   76999 $at_traceon; }
   77000 
   77001   rm -rf xml-tests expout
   77002   at_restore_special_files
   77003 fi
   77004 { set +x
   77005 $as_echo "$at_srcdir/calc.at:616: bison -o calc.c calc.y"
   77006 at_fn_check_prepare_trace "calc.at:616"
   77007 ( $at_check_trace; bison -o calc.c calc.y
   77008 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77009 at_status=$? at_failed=false
   77010 $at_check_filter
   77011 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77012 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77013 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77014 $at_failed && at_fn_log_failure
   77015 $at_traceon; }
   77016 
   77017 
   77018    { set +x
   77019 $as_echo "$at_srcdir/calc.at:616: \$BISON_C_WORKS"
   77020 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:616"
   77021 ( $at_check_trace; $BISON_C_WORKS
   77022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77023 at_status=$? at_failed=false
   77024 $at_check_filter
   77025 echo stderr:; cat "$at_stderr"
   77026 echo stdout:; cat "$at_stdout"
   77027 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77028 $at_failed && at_fn_log_failure
   77029 $at_traceon; }
   77030 
   77031 { set +x
   77032 $as_echo "$at_srcdir/calc.at:616: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   77033 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:616"
   77034 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   77035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77036 at_status=$? at_failed=false
   77037 $at_check_filter
   77038 echo stderr:; cat "$at_stderr"
   77039 echo stdout:; cat "$at_stdout"
   77040 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77041 $at_failed && at_fn_log_failure
   77042 $at_traceon; }
   77043 
   77044 
   77045 { set +x
   77046 $as_echo "$at_srcdir/calc.at:616: \$PERL -ne '
   77047   chomp;
   77048   print \"\$.: {\$_}\\n\"
   77049     if (# No starting/ending empty lines.
   77050         (eof || \$. == 1) && /^\\s*\$/
   77051         # No trailing space.  FIXME: not ready for \"maint\".
   77052         # || /\\s\$/
   77053         )' calc.c
   77054 "
   77055 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616"
   77056 ( $at_check_trace; $PERL -ne '
   77057   chomp;
   77058   print "$.: {$_}\n"
   77059     if (# No starting/ending empty lines.
   77060         (eof || $. == 1) && /^\s*$/
   77061         # No trailing space.  FIXME: not ready for "maint".
   77062         # || /\s$/
   77063         )' calc.c
   77064 
   77065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77066 at_status=$? at_failed=false
   77067 $at_check_filter
   77068 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77069 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77070 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77071 $at_failed && at_fn_log_failure
   77072 $at_traceon; }
   77073 
   77074 { set +x
   77075 $as_echo "$at_srcdir/calc.at:616: \$PERL -ne '
   77076   chomp;
   77077   print \"\$.: {\$_}\\n\"
   77078     if (# No starting/ending empty lines.
   77079         (eof || \$. == 1) && /^\\s*\$/
   77080         # No trailing space.  FIXME: not ready for \"maint\".
   77081         # || /\\s\$/
   77082         )' calc.h
   77083 "
   77084 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616"
   77085 ( $at_check_trace; $PERL -ne '
   77086   chomp;
   77087   print "$.: {$_}\n"
   77088     if (# No starting/ending empty lines.
   77089         (eof || $. == 1) && /^\s*$/
   77090         # No trailing space.  FIXME: not ready for "maint".
   77091         # || /\s$/
   77092         )' calc.h
   77093 
   77094 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77095 at_status=$? at_failed=false
   77096 $at_check_filter
   77097 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77098 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77099 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77100 $at_failed && at_fn_log_failure
   77101 $at_traceon; }
   77102 
   77103 
   77104 # Test the priorities.
   77105 cat >input <<'_ATEOF'
   77106 1 + 2 * 3 = 7
   77107 1 + 2 * -3 = -5
   77108 
   77109 -1^2 = -1
   77110 (-1)^2 = 1
   77111 
   77112 ---1 = -1
   77113 
   77114 1 - 2 - 3 = -4
   77115 1 - (2 - 3) = 2
   77116 
   77117 2^2^3 = 256
   77118 (2^2)^3 = 64
   77119 _ATEOF
   77120 
   77121 { set +x
   77122 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77123 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77124 ( $at_check_trace;  $PREPARSER ./calc input
   77125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77126 at_status=$? at_failed=false
   77127 $at_check_filter
   77128 echo stderr:; tee stderr <"$at_stderr"
   77129 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77130 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77131 $at_failed && at_fn_log_failure
   77132 $at_traceon; }
   77133 
   77134 { set +x
   77135 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77136 at_fn_check_prepare_trace "calc.at:616"
   77137 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77139 at_status=$? at_failed=false
   77140 $at_check_filter
   77141 echo stderr:; tee stderr <"$at_stderr"
   77142 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77143 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77144 $at_failed && at_fn_log_failure
   77145 $at_traceon; }
   77146 
   77147 
   77148 
   77149 
   77150 # Some syntax errors.
   77151 cat >input <<'_ATEOF'
   77152 1 2
   77153 _ATEOF
   77154 
   77155 { set +x
   77156 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77157 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77158 ( $at_check_trace;  $PREPARSER ./calc input
   77159 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77160 at_status=$? at_failed=false
   77161 $at_check_filter
   77162 echo stderr:; tee stderr <"$at_stderr"
   77163 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77164 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
   77165 $at_failed && at_fn_log_failure
   77166 $at_traceon; }
   77167 
   77168 { set +x
   77169 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77170 at_fn_check_prepare_trace "calc.at:616"
   77171 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77173 at_status=$? at_failed=false
   77174 $at_check_filter
   77175 echo stderr:; tee stderr <"$at_stderr"
   77176 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77177 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77178 $at_failed && at_fn_log_failure
   77179 $at_traceon; }
   77180 
   77181 
   77182 
   77183 # Normalize the observed and expected error messages, depending upon the
   77184 # options.
   77185 # 1. Remove the traces from observed.
   77186 sed '/^Starting/d
   77187 /^Entering/d
   77188 /^Stack/d
   77189 /^Reading/d
   77190 /^Reducing/d
   77191 /^Return/d
   77192 /^Shifting/d
   77193 /^state/d
   77194 /^Cleanup:/d
   77195 /^Error:/d
   77196 /^Next/d
   77197 /^Now/d
   77198 /^Discarding/d
   77199 / \$[0-9$]* = /d
   77200 /^yydestructor:/d' stderr >at-stderr
   77201 mv at-stderr stderr
   77202 # 2. Create the reference error message.
   77203 cat >expout <<'_ATEOF'
   77204 1.3: syntax error, unexpected number
   77205 _ATEOF
   77206 
   77207 # 3. If locations are not used, remove them.
   77208 
   77209 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77210 
   77211 # 5. Check
   77212 { set +x
   77213 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77214 at_fn_check_prepare_trace "calc.at:616"
   77215 ( $at_check_trace; cat stderr
   77216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77217 at_status=$? at_failed=false
   77218 $at_check_filter
   77219 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77220 $at_diff expout "$at_stdout" || at_failed=:
   77221 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77222 $at_failed && at_fn_log_failure
   77223 $at_traceon; }
   77224 
   77225 
   77226 cat >input <<'_ATEOF'
   77227 1//2
   77228 _ATEOF
   77229 
   77230 { set +x
   77231 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77232 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77233 ( $at_check_trace;  $PREPARSER ./calc input
   77234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77235 at_status=$? at_failed=false
   77236 $at_check_filter
   77237 echo stderr:; tee stderr <"$at_stderr"
   77238 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77239 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
   77240 $at_failed && at_fn_log_failure
   77241 $at_traceon; }
   77242 
   77243 { set +x
   77244 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77245 at_fn_check_prepare_trace "calc.at:616"
   77246 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77247 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77248 at_status=$? at_failed=false
   77249 $at_check_filter
   77250 echo stderr:; tee stderr <"$at_stderr"
   77251 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77252 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77253 $at_failed && at_fn_log_failure
   77254 $at_traceon; }
   77255 
   77256 
   77257 
   77258 # Normalize the observed and expected error messages, depending upon the
   77259 # options.
   77260 # 1. Remove the traces from observed.
   77261 sed '/^Starting/d
   77262 /^Entering/d
   77263 /^Stack/d
   77264 /^Reading/d
   77265 /^Reducing/d
   77266 /^Return/d
   77267 /^Shifting/d
   77268 /^state/d
   77269 /^Cleanup:/d
   77270 /^Error:/d
   77271 /^Next/d
   77272 /^Now/d
   77273 /^Discarding/d
   77274 / \$[0-9$]* = /d
   77275 /^yydestructor:/d' stderr >at-stderr
   77276 mv at-stderr stderr
   77277 # 2. Create the reference error message.
   77278 cat >expout <<'_ATEOF'
   77279 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   77280 _ATEOF
   77281 
   77282 # 3. If locations are not used, remove them.
   77283 
   77284 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77285 
   77286 # 5. Check
   77287 { set +x
   77288 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77289 at_fn_check_prepare_trace "calc.at:616"
   77290 ( $at_check_trace; cat stderr
   77291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77292 at_status=$? at_failed=false
   77293 $at_check_filter
   77294 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77295 $at_diff expout "$at_stdout" || at_failed=:
   77296 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77297 $at_failed && at_fn_log_failure
   77298 $at_traceon; }
   77299 
   77300 
   77301 cat >input <<'_ATEOF'
   77302 error
   77303 _ATEOF
   77304 
   77305 { set +x
   77306 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77307 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77308 ( $at_check_trace;  $PREPARSER ./calc input
   77309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77310 at_status=$? at_failed=false
   77311 $at_check_filter
   77312 echo stderr:; tee stderr <"$at_stderr"
   77313 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77314 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
   77315 $at_failed && at_fn_log_failure
   77316 $at_traceon; }
   77317 
   77318 { set +x
   77319 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77320 at_fn_check_prepare_trace "calc.at:616"
   77321 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77323 at_status=$? at_failed=false
   77324 $at_check_filter
   77325 echo stderr:; tee stderr <"$at_stderr"
   77326 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77327 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77328 $at_failed && at_fn_log_failure
   77329 $at_traceon; }
   77330 
   77331 
   77332 
   77333 # Normalize the observed and expected error messages, depending upon the
   77334 # options.
   77335 # 1. Remove the traces from observed.
   77336 sed '/^Starting/d
   77337 /^Entering/d
   77338 /^Stack/d
   77339 /^Reading/d
   77340 /^Reducing/d
   77341 /^Return/d
   77342 /^Shifting/d
   77343 /^state/d
   77344 /^Cleanup:/d
   77345 /^Error:/d
   77346 /^Next/d
   77347 /^Now/d
   77348 /^Discarding/d
   77349 / \$[0-9$]* = /d
   77350 /^yydestructor:/d' stderr >at-stderr
   77351 mv at-stderr stderr
   77352 # 2. Create the reference error message.
   77353 cat >expout <<'_ATEOF'
   77354 1.1: syntax error, unexpected $undefined
   77355 _ATEOF
   77356 
   77357 # 3. If locations are not used, remove them.
   77358 
   77359 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77360 
   77361 # 5. Check
   77362 { set +x
   77363 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77364 at_fn_check_prepare_trace "calc.at:616"
   77365 ( $at_check_trace; cat stderr
   77366 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77367 at_status=$? at_failed=false
   77368 $at_check_filter
   77369 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77370 $at_diff expout "$at_stdout" || at_failed=:
   77371 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77372 $at_failed && at_fn_log_failure
   77373 $at_traceon; }
   77374 
   77375 
   77376 cat >input <<'_ATEOF'
   77377 1 = 2 = 3
   77378 _ATEOF
   77379 
   77380 { set +x
   77381 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77382 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77383 ( $at_check_trace;  $PREPARSER ./calc input
   77384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77385 at_status=$? at_failed=false
   77386 $at_check_filter
   77387 echo stderr:; tee stderr <"$at_stderr"
   77388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77389 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
   77390 $at_failed && at_fn_log_failure
   77391 $at_traceon; }
   77392 
   77393 { set +x
   77394 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77395 at_fn_check_prepare_trace "calc.at:616"
   77396 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77398 at_status=$? at_failed=false
   77399 $at_check_filter
   77400 echo stderr:; tee stderr <"$at_stderr"
   77401 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77402 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77403 $at_failed && at_fn_log_failure
   77404 $at_traceon; }
   77405 
   77406 
   77407 
   77408 # Normalize the observed and expected error messages, depending upon the
   77409 # options.
   77410 # 1. Remove the traces from observed.
   77411 sed '/^Starting/d
   77412 /^Entering/d
   77413 /^Stack/d
   77414 /^Reading/d
   77415 /^Reducing/d
   77416 /^Return/d
   77417 /^Shifting/d
   77418 /^state/d
   77419 /^Cleanup:/d
   77420 /^Error:/d
   77421 /^Next/d
   77422 /^Now/d
   77423 /^Discarding/d
   77424 / \$[0-9$]* = /d
   77425 /^yydestructor:/d' stderr >at-stderr
   77426 mv at-stderr stderr
   77427 # 2. Create the reference error message.
   77428 cat >expout <<'_ATEOF'
   77429 1.7: syntax error, unexpected '='
   77430 _ATEOF
   77431 
   77432 # 3. If locations are not used, remove them.
   77433 
   77434 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77435 
   77436 # 5. Check
   77437 { set +x
   77438 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77439 at_fn_check_prepare_trace "calc.at:616"
   77440 ( $at_check_trace; cat stderr
   77441 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77442 at_status=$? at_failed=false
   77443 $at_check_filter
   77444 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77445 $at_diff expout "$at_stdout" || at_failed=:
   77446 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77447 $at_failed && at_fn_log_failure
   77448 $at_traceon; }
   77449 
   77450 
   77451 cat >input <<'_ATEOF'
   77452 
   77453 +1
   77454 _ATEOF
   77455 
   77456 { set +x
   77457 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77458 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77459 ( $at_check_trace;  $PREPARSER ./calc input
   77460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77461 at_status=$? at_failed=false
   77462 $at_check_filter
   77463 echo stderr:; tee stderr <"$at_stderr"
   77464 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77465 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
   77466 $at_failed && at_fn_log_failure
   77467 $at_traceon; }
   77468 
   77469 { set +x
   77470 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77471 at_fn_check_prepare_trace "calc.at:616"
   77472 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77473 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77474 at_status=$? at_failed=false
   77475 $at_check_filter
   77476 echo stderr:; tee stderr <"$at_stderr"
   77477 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77478 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77479 $at_failed && at_fn_log_failure
   77480 $at_traceon; }
   77481 
   77482 
   77483 
   77484 # Normalize the observed and expected error messages, depending upon the
   77485 # options.
   77486 # 1. Remove the traces from observed.
   77487 sed '/^Starting/d
   77488 /^Entering/d
   77489 /^Stack/d
   77490 /^Reading/d
   77491 /^Reducing/d
   77492 /^Return/d
   77493 /^Shifting/d
   77494 /^state/d
   77495 /^Cleanup:/d
   77496 /^Error:/d
   77497 /^Next/d
   77498 /^Now/d
   77499 /^Discarding/d
   77500 / \$[0-9$]* = /d
   77501 /^yydestructor:/d' stderr >at-stderr
   77502 mv at-stderr stderr
   77503 # 2. Create the reference error message.
   77504 cat >expout <<'_ATEOF'
   77505 2.1: syntax error, unexpected '+'
   77506 _ATEOF
   77507 
   77508 # 3. If locations are not used, remove them.
   77509 
   77510 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77511 
   77512 # 5. Check
   77513 { set +x
   77514 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77515 at_fn_check_prepare_trace "calc.at:616"
   77516 ( $at_check_trace; cat stderr
   77517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77518 at_status=$? at_failed=false
   77519 $at_check_filter
   77520 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77521 $at_diff expout "$at_stdout" || at_failed=:
   77522 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77523 $at_failed && at_fn_log_failure
   77524 $at_traceon; }
   77525 
   77526 
   77527 # Exercise error messages with EOF: work on an empty file.
   77528 { set +x
   77529 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc /dev/null"
   77530 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:616"
   77531 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   77532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77533 at_status=$? at_failed=false
   77534 $at_check_filter
   77535 echo stderr:; tee stderr <"$at_stderr"
   77536 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77537 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
   77538 $at_failed && at_fn_log_failure
   77539 $at_traceon; }
   77540 
   77541 { set +x
   77542 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77543 at_fn_check_prepare_trace "calc.at:616"
   77544 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77545 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77546 at_status=$? at_failed=false
   77547 $at_check_filter
   77548 echo stderr:; tee stderr <"$at_stderr"
   77549 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77550 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77551 $at_failed && at_fn_log_failure
   77552 $at_traceon; }
   77553 
   77554 
   77555 
   77556 # Normalize the observed and expected error messages, depending upon the
   77557 # options.
   77558 # 1. Remove the traces from observed.
   77559 sed '/^Starting/d
   77560 /^Entering/d
   77561 /^Stack/d
   77562 /^Reading/d
   77563 /^Reducing/d
   77564 /^Return/d
   77565 /^Shifting/d
   77566 /^state/d
   77567 /^Cleanup:/d
   77568 /^Error:/d
   77569 /^Next/d
   77570 /^Now/d
   77571 /^Discarding/d
   77572 / \$[0-9$]* = /d
   77573 /^yydestructor:/d' stderr >at-stderr
   77574 mv at-stderr stderr
   77575 # 2. Create the reference error message.
   77576 cat >expout <<'_ATEOF'
   77577 1.1: syntax error, unexpected end of input
   77578 _ATEOF
   77579 
   77580 # 3. If locations are not used, remove them.
   77581 
   77582 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77583 
   77584 # 5. Check
   77585 { set +x
   77586 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77587 at_fn_check_prepare_trace "calc.at:616"
   77588 ( $at_check_trace; cat stderr
   77589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77590 at_status=$? at_failed=false
   77591 $at_check_filter
   77592 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77593 $at_diff expout "$at_stdout" || at_failed=:
   77594 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77595 $at_failed && at_fn_log_failure
   77596 $at_traceon; }
   77597 
   77598 
   77599 
   77600 # Exercise the error token: without it, we die at the first error,
   77601 # hence be sure to
   77602 #
   77603 # - have several errors which exercise different shift/discardings
   77604 #   - (): nothing to pop, nothing to discard
   77605 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   77606 #   - (* * *): nothing to pop, a lot to discard
   77607 #   - (1 + 2 * *): some to pop and discard
   77608 #
   77609 # - test the action associated to `error'
   77610 #
   77611 # - check the lookahead that triggers an error is not discarded
   77612 #   when we enter error recovery.  Below, the lookahead causing the
   77613 #   first error is ")", which is needed to recover from the error and
   77614 #   produce the "0" that triggers the "0 != 1" error.
   77615 #
   77616 cat >input <<'_ATEOF'
   77617 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   77618 _ATEOF
   77619 
   77620 { set +x
   77621 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77622 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77623 ( $at_check_trace;  $PREPARSER ./calc input
   77624 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77625 at_status=$? at_failed=false
   77626 $at_check_filter
   77627 echo stderr:; tee stderr <"$at_stderr"
   77628 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77629 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77630 $at_failed && at_fn_log_failure
   77631 $at_traceon; }
   77632 
   77633 { set +x
   77634 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77635 at_fn_check_prepare_trace "calc.at:616"
   77636 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77638 at_status=$? at_failed=false
   77639 $at_check_filter
   77640 echo stderr:; tee stderr <"$at_stderr"
   77641 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77642 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77643 $at_failed && at_fn_log_failure
   77644 $at_traceon; }
   77645 
   77646 
   77647 
   77648 # Normalize the observed and expected error messages, depending upon the
   77649 # options.
   77650 # 1. Remove the traces from observed.
   77651 sed '/^Starting/d
   77652 /^Entering/d
   77653 /^Stack/d
   77654 /^Reading/d
   77655 /^Reducing/d
   77656 /^Return/d
   77657 /^Shifting/d
   77658 /^state/d
   77659 /^Cleanup:/d
   77660 /^Error:/d
   77661 /^Next/d
   77662 /^Now/d
   77663 /^Discarding/d
   77664 / \$[0-9$]* = /d
   77665 /^yydestructor:/d' stderr >at-stderr
   77666 mv at-stderr stderr
   77667 # 2. Create the reference error message.
   77668 cat >expout <<'_ATEOF'
   77669 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   77670 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   77671 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   77672 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   77673 calc: error: 4444 != 1
   77674 _ATEOF
   77675 
   77676 # 3. If locations are not used, remove them.
   77677 
   77678 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77679 
   77680 # 5. Check
   77681 { set +x
   77682 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77683 at_fn_check_prepare_trace "calc.at:616"
   77684 ( $at_check_trace; cat stderr
   77685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77686 at_status=$? at_failed=false
   77687 $at_check_filter
   77688 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77689 $at_diff expout "$at_stdout" || at_failed=:
   77690 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77691 $at_failed && at_fn_log_failure
   77692 $at_traceon; }
   77693 
   77694 
   77695 
   77696 # The same, but this time exercising explicitly triggered syntax errors.
   77697 # POSIX says the lookahead causing the error should not be discarded.
   77698 cat >input <<'_ATEOF'
   77699 (!) + (1 2) = 1
   77700 _ATEOF
   77701 
   77702 { set +x
   77703 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77704 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77705 ( $at_check_trace;  $PREPARSER ./calc input
   77706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77707 at_status=$? at_failed=false
   77708 $at_check_filter
   77709 echo stderr:; tee stderr <"$at_stderr"
   77710 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77711 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77712 $at_failed && at_fn_log_failure
   77713 $at_traceon; }
   77714 
   77715 { set +x
   77716 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77717 at_fn_check_prepare_trace "calc.at:616"
   77718 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77719 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77720 at_status=$? at_failed=false
   77721 $at_check_filter
   77722 echo stderr:; tee stderr <"$at_stderr"
   77723 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77724 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77725 $at_failed && at_fn_log_failure
   77726 $at_traceon; }
   77727 
   77728 
   77729 
   77730 # Normalize the observed and expected error messages, depending upon the
   77731 # options.
   77732 # 1. Remove the traces from observed.
   77733 sed '/^Starting/d
   77734 /^Entering/d
   77735 /^Stack/d
   77736 /^Reading/d
   77737 /^Reducing/d
   77738 /^Return/d
   77739 /^Shifting/d
   77740 /^state/d
   77741 /^Cleanup:/d
   77742 /^Error:/d
   77743 /^Next/d
   77744 /^Now/d
   77745 /^Discarding/d
   77746 / \$[0-9$]* = /d
   77747 /^yydestructor:/d' stderr >at-stderr
   77748 mv at-stderr stderr
   77749 # 2. Create the reference error message.
   77750 cat >expout <<'_ATEOF'
   77751 1.10: syntax error, unexpected number
   77752 calc: error: 2222 != 1
   77753 _ATEOF
   77754 
   77755 # 3. If locations are not used, remove them.
   77756 
   77757 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77758 
   77759 # 5. Check
   77760 { set +x
   77761 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77762 at_fn_check_prepare_trace "calc.at:616"
   77763 ( $at_check_trace; cat stderr
   77764 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77765 at_status=$? at_failed=false
   77766 $at_check_filter
   77767 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77768 $at_diff expout "$at_stdout" || at_failed=:
   77769 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77770 $at_failed && at_fn_log_failure
   77771 $at_traceon; }
   77772 
   77773 
   77774 cat >input <<'_ATEOF'
   77775 (- *) + (1 2) = 1
   77776 _ATEOF
   77777 
   77778 { set +x
   77779 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77780 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77781 ( $at_check_trace;  $PREPARSER ./calc input
   77782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77783 at_status=$? at_failed=false
   77784 $at_check_filter
   77785 echo stderr:; tee stderr <"$at_stderr"
   77786 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77787 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77788 $at_failed && at_fn_log_failure
   77789 $at_traceon; }
   77790 
   77791 { set +x
   77792 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77793 at_fn_check_prepare_trace "calc.at:616"
   77794 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77796 at_status=$? at_failed=false
   77797 $at_check_filter
   77798 echo stderr:; tee stderr <"$at_stderr"
   77799 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77800 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77801 $at_failed && at_fn_log_failure
   77802 $at_traceon; }
   77803 
   77804 
   77805 
   77806 # Normalize the observed and expected error messages, depending upon the
   77807 # options.
   77808 # 1. Remove the traces from observed.
   77809 sed '/^Starting/d
   77810 /^Entering/d
   77811 /^Stack/d
   77812 /^Reading/d
   77813 /^Reducing/d
   77814 /^Return/d
   77815 /^Shifting/d
   77816 /^state/d
   77817 /^Cleanup:/d
   77818 /^Error:/d
   77819 /^Next/d
   77820 /^Now/d
   77821 /^Discarding/d
   77822 / \$[0-9$]* = /d
   77823 /^yydestructor:/d' stderr >at-stderr
   77824 mv at-stderr stderr
   77825 # 2. Create the reference error message.
   77826 cat >expout <<'_ATEOF'
   77827 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   77828 1.12: syntax error, unexpected number
   77829 calc: error: 2222 != 1
   77830 _ATEOF
   77831 
   77832 # 3. If locations are not used, remove them.
   77833 
   77834 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77835 
   77836 # 5. Check
   77837 { set +x
   77838 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77839 at_fn_check_prepare_trace "calc.at:616"
   77840 ( $at_check_trace; cat stderr
   77841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77842 at_status=$? at_failed=false
   77843 $at_check_filter
   77844 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77845 $at_diff expout "$at_stdout" || at_failed=:
   77846 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77847 $at_failed && at_fn_log_failure
   77848 $at_traceon; }
   77849 
   77850 
   77851 
   77852 # Check that yyerrok works properly: second error is not reported,
   77853 # third and fourth are.  Parse status is succesfull.
   77854 cat >input <<'_ATEOF'
   77855 (* *) + (*) + (*)
   77856 _ATEOF
   77857 
   77858 { set +x
   77859 $as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
   77860 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
   77861 ( $at_check_trace;  $PREPARSER ./calc input
   77862 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77863 at_status=$? at_failed=false
   77864 $at_check_filter
   77865 echo stderr:; tee stderr <"$at_stderr"
   77866 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77867 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77868 $at_failed && at_fn_log_failure
   77869 $at_traceon; }
   77870 
   77871 { set +x
   77872 $as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   77873 at_fn_check_prepare_trace "calc.at:616"
   77874 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   77875 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77876 at_status=$? at_failed=false
   77877 $at_check_filter
   77878 echo stderr:; tee stderr <"$at_stderr"
   77879 at_fn_diff_devnull "$at_stdout" || at_failed=:
   77880 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77881 $at_failed && at_fn_log_failure
   77882 $at_traceon; }
   77883 
   77884 
   77885 
   77886 # Normalize the observed and expected error messages, depending upon the
   77887 # options.
   77888 # 1. Remove the traces from observed.
   77889 sed '/^Starting/d
   77890 /^Entering/d
   77891 /^Stack/d
   77892 /^Reading/d
   77893 /^Reducing/d
   77894 /^Return/d
   77895 /^Shifting/d
   77896 /^state/d
   77897 /^Cleanup:/d
   77898 /^Error:/d
   77899 /^Next/d
   77900 /^Now/d
   77901 /^Discarding/d
   77902 / \$[0-9$]* = /d
   77903 /^yydestructor:/d' stderr >at-stderr
   77904 mv at-stderr stderr
   77905 # 2. Create the reference error message.
   77906 cat >expout <<'_ATEOF'
   77907 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   77908 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   77909 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   77910 _ATEOF
   77911 
   77912 # 3. If locations are not used, remove them.
   77913 
   77914 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   77915 
   77916 # 5. Check
   77917 { set +x
   77918 $as_echo "$at_srcdir/calc.at:616: cat stderr"
   77919 at_fn_check_prepare_trace "calc.at:616"
   77920 ( $at_check_trace; cat stderr
   77921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   77922 at_status=$? at_failed=false
   77923 $at_check_filter
   77924 at_fn_diff_devnull "$at_stderr" || at_failed=:
   77925 $at_diff expout "$at_stdout" || at_failed=:
   77926 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
   77927 $at_failed && at_fn_log_failure
   77928 $at_traceon; }
   77929 
   77930 
   77931 
   77932 
   77933 
   77934   set +x
   77935   $at_times_p && times >"$at_times_file"
   77936 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   77937 read at_status <"$at_status_file"
   77938 #AT_STOP_214
   77939 #AT_START_215
   77940 at_fn_group_banner 215 'calc.at:618' \
   77941   "Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11
   77942 at_xfail=no
   77943 (
   77944   $as_echo "215. $at_setup_line: testing $at_desc ..."
   77945   $at_traceon
   77946 
   77947 
   77948 
   77949 
   77950 
   77951 
   77952 
   77953 
   77954 
   77955 
   77956 cat >calc.y <<'_ATEOF'
   77957 %code top {
   77958 #include <config.h>
   77959 /* We don't need perfect functions for these tests. */
   77960 #undef malloc
   77961 #undef memcmp
   77962 #undef realloc
   77963 }
   77964 
   77965 /* Infix notation calculator--calc */
   77966 %define api.pure full %verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
   77967 
   77968 %code requires
   77969 {
   77970 
   77971   /* Exercise pre-prologue dependency to %union.  */
   77972   typedef int semantic_value;
   77973 }
   77974 
   77975 /* Exercise %union. */
   77976 %union
   77977 {
   77978   semantic_value ival;
   77979 };
   77980 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   77981 
   77982 %code provides
   77983 {
   77984   #include <stdio.h>
   77985   /* The input.  */
   77986   extern FILE *input;
   77987   extern semantic_value global_result;
   77988   extern int global_count;
   77989 }
   77990 
   77991 %code
   77992 {
   77993 #include <assert.h>
   77994 #include <string.h>
   77995 #define USE(Var)
   77996 
   77997 FILE *input;
   77998 static int power (int base, int exponent);
   77999 
   78000 static void calcerror (YYLTYPE const * const llocp,  const char *msg);
   78001 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
   78002 }
   78003 
   78004 
   78005 
   78006 /* Bison Declarations */
   78007 %token CALC_EOF 0 "end of input"
   78008 %token <ival> NUM "number"
   78009 %type  <ival> exp
   78010 
   78011 %nonassoc '=' /* comparison            */
   78012 %left '-' '+'
   78013 %left '*' '/'
   78014 %left NEG     /* negation--unary minus */
   78015 %right '^'    /* exponentiation        */
   78016 
   78017 /* Grammar follows */
   78018 %%
   78019 input:
   78020   line
   78021 | input line         {  }
   78022 ;
   78023 
   78024 line:
   78025   '\n'
   78026 | exp '\n'           { USE ($1); }
   78027 ;
   78028 
   78029 exp:
   78030   NUM                { $$ = $1;             }
   78031 | exp '=' exp
   78032   {
   78033     if ($1 != $3)
   78034       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   78035     $$ = $1;
   78036   }
   78037 | exp '+' exp        { $$ = $1 + $3;        }
   78038 | exp '-' exp        { $$ = $1 - $3;        }
   78039 | exp '*' exp        { $$ = $1 * $3;        }
   78040 | exp '/' exp        { $$ = $1 / $3;        }
   78041 | '-' exp  %prec NEG { $$ = -$2;            }
   78042 | exp '^' exp        { $$ = power ($1, $3); }
   78043 | '(' exp ')'        { $$ = $2;             }
   78044 | '(' error ')'      { $$ = 1111; yyerrok;  }
   78045 | '!'                { $$ = 0; YYERROR;     }
   78046 | '-' error          { $$ = 0; YYERROR;     }
   78047 ;
   78048 %%
   78049 
   78050 static int
   78051 power (int base, int exponent)
   78052 {
   78053   int res = 1;
   78054   assert (0 <= exponent);
   78055   for (/* Niente */; exponent; --exponent)
   78056     res *= base;
   78057   return res;
   78058 }
   78059 
   78060 
   78061 #include <stdio.h>
   78062 /* A C error reporting function.  */
   78063 static
   78064 void calcerror (YYLTYPE const * const llocp,  const char *msg)
   78065 {
   78066   YY_LOCATION_PRINT (stderr, (*llocp));
   78067   fprintf (stderr, ": ");
   78068   fprintf (stderr, "%s\n", msg);
   78069 }
   78070 _ATEOF
   78071 
   78072 
   78073 
   78074 cat >calc-lex.c <<'_ATEOF'
   78075 #include <config.h>
   78076 /* We don't need perfect functions for these tests. */
   78077 #undef malloc
   78078 #undef memcmp
   78079 #undef realloc
   78080 
   78081 #include "calc.h"
   78082 
   78083 #include <ctype.h>
   78084 
   78085 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
   78086 static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
   78087 static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
   78088 
   78089 
   78090 static YYLTYPE last_yylloc;
   78091 
   78092 static int
   78093 get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
   78094 {
   78095   int res = getc (input);
   78096   (void) lvalp;(void) llocp;
   78097 
   78098   last_yylloc = (*llocp);
   78099   if (res == '\n')
   78100     {
   78101       (*llocp).last_line++;
   78102       (*llocp).last_column = 1;
   78103     }
   78104   else
   78105     (*llocp).last_column++;
   78106 
   78107   return res;
   78108 }
   78109 
   78110 static void
   78111 unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
   78112 {
   78113   (void) lvalp;(void) llocp;
   78114 
   78115   /* Wrong when C == `\n'. */
   78116   (*llocp) = last_yylloc;
   78117 
   78118   ungetc (c, input);
   78119 }
   78120 
   78121 static int
   78122 read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
   78123 {
   78124   int c = get_char (lvalp, llocp);
   78125   int sign = 1;
   78126   int n = 0;
   78127 
   78128   (void) lvalp;(void) llocp;
   78129   if (c == '-')
   78130     {
   78131       c = get_char (lvalp, llocp);
   78132       sign = -1;
   78133     }
   78134 
   78135   while (isdigit (c))
   78136     {
   78137       n = 10 * n + (c - '0');
   78138       c = get_char (lvalp, llocp);
   78139     }
   78140 
   78141   unget_char (lvalp, llocp,  c);
   78142 
   78143   return sign * n;
   78144 }
   78145 
   78146 
   78147 /*---------------------------------------------------------------.
   78148 | Lexical analyzer returns an integer on the stack and the token |
   78149 | NUM, or the ASCII character read if not a number.  Skips all   |
   78150 | blanks and tabs, returns 0 for EOF.                            |
   78151 `---------------------------------------------------------------*/
   78152 
   78153 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
   78154 {
   78155   int c;
   78156   /* Skip current token, then white spaces.  */
   78157   do
   78158     {
   78159      (*llocp).first_column = (*llocp).last_column;
   78160       (*llocp).first_line   = (*llocp).last_line;
   78161 
   78162     }
   78163   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   78164 
   78165   /* process numbers   */
   78166   if (c == '.' || isdigit (c))
   78167     {
   78168       unget_char (lvalp, llocp,  c);
   78169       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   78170       return NUM;
   78171     }
   78172 
   78173   /* Return end-of-file.  */
   78174   if (c == EOF)
   78175     return CALC_EOF;
   78176 
   78177   /* Return single chars. */
   78178   return c;
   78179 }
   78180 _ATEOF
   78181 
   78182 
   78183 cat >calc-main.c <<'_ATEOF'
   78184 #include <config.h>
   78185 /* We don't need perfect functions for these tests. */
   78186 #undef malloc
   78187 #undef memcmp
   78188 #undef realloc
   78189 
   78190 #include "calc.h"
   78191 
   78192 #include <assert.h>
   78193 #if HAVE_UNISTD_H
   78194 # include <unistd.h>
   78195 #else
   78196 # undef alarm
   78197 # define alarm(seconds) /* empty */
   78198 #endif
   78199 
   78200 
   78201 
   78202 semantic_value global_result = 0;
   78203 int global_count = 0;
   78204 
   78205 /* A C main function.  */
   78206 int
   78207 main (int argc, const char **argv)
   78208 {
   78209   semantic_value result = 0;
   78210   int count = 0;
   78211   int status;
   78212 
   78213   /* This used to be alarm (10), but that isn't enough time for
   78214      a July 1995 vintage DEC Alphastation 200 4/100 system,
   78215      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   78216   alarm (100);
   78217 
   78218   if (argc == 2)
   78219     input = fopen (argv[1], "r");
   78220   else
   78221     input = stdin;
   78222 
   78223   if (!input)
   78224     {
   78225       perror (argv[1]);
   78226       return 3;
   78227     }
   78228 
   78229   calcdebug = 1;
   78230   status = calcparse ();
   78231   if (fclose (input))
   78232     perror ("fclose");
   78233   assert (global_result == result);
   78234   assert (global_count == count);
   78235   return status;
   78236 }
   78237 _ATEOF
   78238 
   78239 
   78240 
   78241 
   78242 
   78243 
   78244 
   78245 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   78246   at_save_special_files
   78247   mkdir xml-tests
   78248     # Don't combine these Bison invocations since we want to be sure that
   78249   # --report=all isn't required to get the full XML file.
   78250   { set +x
   78251 $as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   78252                   --graph=xml-tests/test.dot -o calc.c calc.y"
   78253 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618"
   78254 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   78255                   --graph=xml-tests/test.dot -o calc.c calc.y
   78256 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78257 at_status=$? at_failed=false
   78258 $at_check_filter
   78259 echo stderr:; cat "$at_stderr"
   78260 echo stdout:; cat "$at_stdout"
   78261 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78262 $at_failed && at_fn_log_failure
   78263 $at_traceon; }
   78264 
   78265   { set +x
   78266 $as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   78267 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:618"
   78268 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   78269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78270 at_status=$? at_failed=false
   78271 $at_check_filter
   78272 echo stderr:; cat "$at_stderr"
   78273 echo stdout:; cat "$at_stdout"
   78274 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78275 $at_failed && at_fn_log_failure
   78276 $at_traceon; }
   78277 
   78278     cp xml-tests/test.output expout
   78279   { set +x
   78280 $as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\
   78281              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   78282              xml-tests/test.xml"
   78283 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618"
   78284 ( $at_check_trace; $XSLTPROC \
   78285              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   78286              xml-tests/test.xml
   78287 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78288 at_status=$? at_failed=false
   78289 $at_check_filter
   78290 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78291 $at_diff expout "$at_stdout" || at_failed=:
   78292 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78293 $at_failed && at_fn_log_failure
   78294 $at_traceon; }
   78295 
   78296   sort xml-tests/test.dot > expout
   78297   { set +x
   78298 $as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\
   78299              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   78300              xml-tests/test.xml | sort"
   78301 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618"
   78302 ( $at_check_trace; $XSLTPROC \
   78303              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   78304              xml-tests/test.xml | sort
   78305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78306 at_status=$? at_failed=false
   78307 $at_check_filter
   78308 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78309 $at_diff expout "$at_stdout" || at_failed=:
   78310 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78311 $at_failed && at_fn_log_failure
   78312 $at_traceon; }
   78313 
   78314   rm -rf xml-tests expout
   78315   at_restore_special_files
   78316 fi
   78317 { set +x
   78318 $as_echo "$at_srcdir/calc.at:618: bison -o calc.c calc.y"
   78319 at_fn_check_prepare_trace "calc.at:618"
   78320 ( $at_check_trace; bison -o calc.c calc.y
   78321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78322 at_status=$? at_failed=false
   78323 $at_check_filter
   78324 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78325 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78326 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78327 $at_failed && at_fn_log_failure
   78328 $at_traceon; }
   78329 
   78330 
   78331    { set +x
   78332 $as_echo "$at_srcdir/calc.at:618: \$BISON_C_WORKS"
   78333 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:618"
   78334 ( $at_check_trace; $BISON_C_WORKS
   78335 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78336 at_status=$? at_failed=false
   78337 $at_check_filter
   78338 echo stderr:; cat "$at_stderr"
   78339 echo stdout:; cat "$at_stdout"
   78340 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78341 $at_failed && at_fn_log_failure
   78342 $at_traceon; }
   78343 
   78344 { set +x
   78345 $as_echo "$at_srcdir/calc.at:618: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   78346 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:618"
   78347 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   78348 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78349 at_status=$? at_failed=false
   78350 $at_check_filter
   78351 echo stderr:; cat "$at_stderr"
   78352 echo stdout:; cat "$at_stdout"
   78353 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78354 $at_failed && at_fn_log_failure
   78355 $at_traceon; }
   78356 
   78357 
   78358 { set +x
   78359 $as_echo "$at_srcdir/calc.at:618: \$PERL -ne '
   78360   chomp;
   78361   print \"\$.: {\$_}\\n\"
   78362     if (# No starting/ending empty lines.
   78363         (eof || \$. == 1) && /^\\s*\$/
   78364         # No trailing space.  FIXME: not ready for \"maint\".
   78365         # || /\\s\$/
   78366         )' calc.c
   78367 "
   78368 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618"
   78369 ( $at_check_trace; $PERL -ne '
   78370   chomp;
   78371   print "$.: {$_}\n"
   78372     if (# No starting/ending empty lines.
   78373         (eof || $. == 1) && /^\s*$/
   78374         # No trailing space.  FIXME: not ready for "maint".
   78375         # || /\s$/
   78376         )' calc.c
   78377 
   78378 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78379 at_status=$? at_failed=false
   78380 $at_check_filter
   78381 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78382 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78383 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78384 $at_failed && at_fn_log_failure
   78385 $at_traceon; }
   78386 
   78387 { set +x
   78388 $as_echo "$at_srcdir/calc.at:618: \$PERL -ne '
   78389   chomp;
   78390   print \"\$.: {\$_}\\n\"
   78391     if (# No starting/ending empty lines.
   78392         (eof || \$. == 1) && /^\\s*\$/
   78393         # No trailing space.  FIXME: not ready for \"maint\".
   78394         # || /\\s\$/
   78395         )' calc.h
   78396 "
   78397 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618"
   78398 ( $at_check_trace; $PERL -ne '
   78399   chomp;
   78400   print "$.: {$_}\n"
   78401     if (# No starting/ending empty lines.
   78402         (eof || $. == 1) && /^\s*$/
   78403         # No trailing space.  FIXME: not ready for "maint".
   78404         # || /\s$/
   78405         )' calc.h
   78406 
   78407 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78408 at_status=$? at_failed=false
   78409 $at_check_filter
   78410 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78411 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78412 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78413 $at_failed && at_fn_log_failure
   78414 $at_traceon; }
   78415 
   78416 
   78417 # Test the priorities.
   78418 cat >input <<'_ATEOF'
   78419 1 + 2 * 3 = 7
   78420 1 + 2 * -3 = -5
   78421 
   78422 -1^2 = -1
   78423 (-1)^2 = 1
   78424 
   78425 ---1 = -1
   78426 
   78427 1 - 2 - 3 = -4
   78428 1 - (2 - 3) = 2
   78429 
   78430 2^2^3 = 256
   78431 (2^2)^3 = 64
   78432 _ATEOF
   78433 
   78434 { set +x
   78435 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78436 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78437 ( $at_check_trace;  $PREPARSER ./calc input
   78438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78439 at_status=$? at_failed=false
   78440 $at_check_filter
   78441 echo stderr:; tee stderr <"$at_stderr"
   78442 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78443 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78444 $at_failed && at_fn_log_failure
   78445 $at_traceon; }
   78446 
   78447 { set +x
   78448 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78449 at_fn_check_prepare_trace "calc.at:618"
   78450 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78451 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78452 at_status=$? at_failed=false
   78453 $at_check_filter
   78454 echo stderr:; tee stderr <"$at_stderr"
   78455 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78456 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78457 $at_failed && at_fn_log_failure
   78458 $at_traceon; }
   78459 
   78460 
   78461 
   78462 
   78463 # Some syntax errors.
   78464 cat >input <<'_ATEOF'
   78465 1 2
   78466 _ATEOF
   78467 
   78468 { set +x
   78469 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78470 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78471 ( $at_check_trace;  $PREPARSER ./calc input
   78472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78473 at_status=$? at_failed=false
   78474 $at_check_filter
   78475 echo stderr:; tee stderr <"$at_stderr"
   78476 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78477 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
   78478 $at_failed && at_fn_log_failure
   78479 $at_traceon; }
   78480 
   78481 { set +x
   78482 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78483 at_fn_check_prepare_trace "calc.at:618"
   78484 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78486 at_status=$? at_failed=false
   78487 $at_check_filter
   78488 echo stderr:; tee stderr <"$at_stderr"
   78489 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78490 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78491 $at_failed && at_fn_log_failure
   78492 $at_traceon; }
   78493 
   78494 
   78495 
   78496 # Normalize the observed and expected error messages, depending upon the
   78497 # options.
   78498 # 1. Remove the traces from observed.
   78499 sed '/^Starting/d
   78500 /^Entering/d
   78501 /^Stack/d
   78502 /^Reading/d
   78503 /^Reducing/d
   78504 /^Return/d
   78505 /^Shifting/d
   78506 /^state/d
   78507 /^Cleanup:/d
   78508 /^Error:/d
   78509 /^Next/d
   78510 /^Now/d
   78511 /^Discarding/d
   78512 / \$[0-9$]* = /d
   78513 /^yydestructor:/d' stderr >at-stderr
   78514 mv at-stderr stderr
   78515 # 2. Create the reference error message.
   78516 cat >expout <<'_ATEOF'
   78517 1.3: syntax error, unexpected number
   78518 _ATEOF
   78519 
   78520 # 3. If locations are not used, remove them.
   78521 
   78522 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78523 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78524 mv at-expout expout
   78525 # 5. Check
   78526 { set +x
   78527 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   78528 at_fn_check_prepare_trace "calc.at:618"
   78529 ( $at_check_trace; cat stderr
   78530 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78531 at_status=$? at_failed=false
   78532 $at_check_filter
   78533 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78534 $at_diff expout "$at_stdout" || at_failed=:
   78535 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78536 $at_failed && at_fn_log_failure
   78537 $at_traceon; }
   78538 
   78539 
   78540 cat >input <<'_ATEOF'
   78541 1//2
   78542 _ATEOF
   78543 
   78544 { set +x
   78545 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78546 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78547 ( $at_check_trace;  $PREPARSER ./calc input
   78548 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78549 at_status=$? at_failed=false
   78550 $at_check_filter
   78551 echo stderr:; tee stderr <"$at_stderr"
   78552 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78553 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
   78554 $at_failed && at_fn_log_failure
   78555 $at_traceon; }
   78556 
   78557 { set +x
   78558 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78559 at_fn_check_prepare_trace "calc.at:618"
   78560 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78562 at_status=$? at_failed=false
   78563 $at_check_filter
   78564 echo stderr:; tee stderr <"$at_stderr"
   78565 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78566 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78567 $at_failed && at_fn_log_failure
   78568 $at_traceon; }
   78569 
   78570 
   78571 
   78572 # Normalize the observed and expected error messages, depending upon the
   78573 # options.
   78574 # 1. Remove the traces from observed.
   78575 sed '/^Starting/d
   78576 /^Entering/d
   78577 /^Stack/d
   78578 /^Reading/d
   78579 /^Reducing/d
   78580 /^Return/d
   78581 /^Shifting/d
   78582 /^state/d
   78583 /^Cleanup:/d
   78584 /^Error:/d
   78585 /^Next/d
   78586 /^Now/d
   78587 /^Discarding/d
   78588 / \$[0-9$]* = /d
   78589 /^yydestructor:/d' stderr >at-stderr
   78590 mv at-stderr stderr
   78591 # 2. Create the reference error message.
   78592 cat >expout <<'_ATEOF'
   78593 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   78594 _ATEOF
   78595 
   78596 # 3. If locations are not used, remove them.
   78597 
   78598 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78599 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78600 mv at-expout expout
   78601 # 5. Check
   78602 { set +x
   78603 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   78604 at_fn_check_prepare_trace "calc.at:618"
   78605 ( $at_check_trace; cat stderr
   78606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78607 at_status=$? at_failed=false
   78608 $at_check_filter
   78609 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78610 $at_diff expout "$at_stdout" || at_failed=:
   78611 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78612 $at_failed && at_fn_log_failure
   78613 $at_traceon; }
   78614 
   78615 
   78616 cat >input <<'_ATEOF'
   78617 error
   78618 _ATEOF
   78619 
   78620 { set +x
   78621 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78622 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78623 ( $at_check_trace;  $PREPARSER ./calc input
   78624 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78625 at_status=$? at_failed=false
   78626 $at_check_filter
   78627 echo stderr:; tee stderr <"$at_stderr"
   78628 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78629 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
   78630 $at_failed && at_fn_log_failure
   78631 $at_traceon; }
   78632 
   78633 { set +x
   78634 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78635 at_fn_check_prepare_trace "calc.at:618"
   78636 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78638 at_status=$? at_failed=false
   78639 $at_check_filter
   78640 echo stderr:; tee stderr <"$at_stderr"
   78641 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78642 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78643 $at_failed && at_fn_log_failure
   78644 $at_traceon; }
   78645 
   78646 
   78647 
   78648 # Normalize the observed and expected error messages, depending upon the
   78649 # options.
   78650 # 1. Remove the traces from observed.
   78651 sed '/^Starting/d
   78652 /^Entering/d
   78653 /^Stack/d
   78654 /^Reading/d
   78655 /^Reducing/d
   78656 /^Return/d
   78657 /^Shifting/d
   78658 /^state/d
   78659 /^Cleanup:/d
   78660 /^Error:/d
   78661 /^Next/d
   78662 /^Now/d
   78663 /^Discarding/d
   78664 / \$[0-9$]* = /d
   78665 /^yydestructor:/d' stderr >at-stderr
   78666 mv at-stderr stderr
   78667 # 2. Create the reference error message.
   78668 cat >expout <<'_ATEOF'
   78669 1.1: syntax error, unexpected $undefined
   78670 _ATEOF
   78671 
   78672 # 3. If locations are not used, remove them.
   78673 
   78674 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78675 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78676 mv at-expout expout
   78677 # 5. Check
   78678 { set +x
   78679 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   78680 at_fn_check_prepare_trace "calc.at:618"
   78681 ( $at_check_trace; cat stderr
   78682 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78683 at_status=$? at_failed=false
   78684 $at_check_filter
   78685 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78686 $at_diff expout "$at_stdout" || at_failed=:
   78687 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78688 $at_failed && at_fn_log_failure
   78689 $at_traceon; }
   78690 
   78691 
   78692 cat >input <<'_ATEOF'
   78693 1 = 2 = 3
   78694 _ATEOF
   78695 
   78696 { set +x
   78697 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78698 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78699 ( $at_check_trace;  $PREPARSER ./calc input
   78700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78701 at_status=$? at_failed=false
   78702 $at_check_filter
   78703 echo stderr:; tee stderr <"$at_stderr"
   78704 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78705 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
   78706 $at_failed && at_fn_log_failure
   78707 $at_traceon; }
   78708 
   78709 { set +x
   78710 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78711 at_fn_check_prepare_trace "calc.at:618"
   78712 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78713 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78714 at_status=$? at_failed=false
   78715 $at_check_filter
   78716 echo stderr:; tee stderr <"$at_stderr"
   78717 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78718 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78719 $at_failed && at_fn_log_failure
   78720 $at_traceon; }
   78721 
   78722 
   78723 
   78724 # Normalize the observed and expected error messages, depending upon the
   78725 # options.
   78726 # 1. Remove the traces from observed.
   78727 sed '/^Starting/d
   78728 /^Entering/d
   78729 /^Stack/d
   78730 /^Reading/d
   78731 /^Reducing/d
   78732 /^Return/d
   78733 /^Shifting/d
   78734 /^state/d
   78735 /^Cleanup:/d
   78736 /^Error:/d
   78737 /^Next/d
   78738 /^Now/d
   78739 /^Discarding/d
   78740 / \$[0-9$]* = /d
   78741 /^yydestructor:/d' stderr >at-stderr
   78742 mv at-stderr stderr
   78743 # 2. Create the reference error message.
   78744 cat >expout <<'_ATEOF'
   78745 1.7: syntax error, unexpected '='
   78746 _ATEOF
   78747 
   78748 # 3. If locations are not used, remove them.
   78749 
   78750 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78751 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78752 mv at-expout expout
   78753 # 5. Check
   78754 { set +x
   78755 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   78756 at_fn_check_prepare_trace "calc.at:618"
   78757 ( $at_check_trace; cat stderr
   78758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78759 at_status=$? at_failed=false
   78760 $at_check_filter
   78761 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78762 $at_diff expout "$at_stdout" || at_failed=:
   78763 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78764 $at_failed && at_fn_log_failure
   78765 $at_traceon; }
   78766 
   78767 
   78768 cat >input <<'_ATEOF'
   78769 
   78770 +1
   78771 _ATEOF
   78772 
   78773 { set +x
   78774 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78775 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78776 ( $at_check_trace;  $PREPARSER ./calc input
   78777 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78778 at_status=$? at_failed=false
   78779 $at_check_filter
   78780 echo stderr:; tee stderr <"$at_stderr"
   78781 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78782 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
   78783 $at_failed && at_fn_log_failure
   78784 $at_traceon; }
   78785 
   78786 { set +x
   78787 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78788 at_fn_check_prepare_trace "calc.at:618"
   78789 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78791 at_status=$? at_failed=false
   78792 $at_check_filter
   78793 echo stderr:; tee stderr <"$at_stderr"
   78794 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78795 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78796 $at_failed && at_fn_log_failure
   78797 $at_traceon; }
   78798 
   78799 
   78800 
   78801 # Normalize the observed and expected error messages, depending upon the
   78802 # options.
   78803 # 1. Remove the traces from observed.
   78804 sed '/^Starting/d
   78805 /^Entering/d
   78806 /^Stack/d
   78807 /^Reading/d
   78808 /^Reducing/d
   78809 /^Return/d
   78810 /^Shifting/d
   78811 /^state/d
   78812 /^Cleanup:/d
   78813 /^Error:/d
   78814 /^Next/d
   78815 /^Now/d
   78816 /^Discarding/d
   78817 / \$[0-9$]* = /d
   78818 /^yydestructor:/d' stderr >at-stderr
   78819 mv at-stderr stderr
   78820 # 2. Create the reference error message.
   78821 cat >expout <<'_ATEOF'
   78822 2.1: syntax error, unexpected '+'
   78823 _ATEOF
   78824 
   78825 # 3. If locations are not used, remove them.
   78826 
   78827 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78828 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78829 mv at-expout expout
   78830 # 5. Check
   78831 { set +x
   78832 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   78833 at_fn_check_prepare_trace "calc.at:618"
   78834 ( $at_check_trace; cat stderr
   78835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78836 at_status=$? at_failed=false
   78837 $at_check_filter
   78838 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78839 $at_diff expout "$at_stdout" || at_failed=:
   78840 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78841 $at_failed && at_fn_log_failure
   78842 $at_traceon; }
   78843 
   78844 
   78845 # Exercise error messages with EOF: work on an empty file.
   78846 { set +x
   78847 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc /dev/null"
   78848 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:618"
   78849 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   78850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78851 at_status=$? at_failed=false
   78852 $at_check_filter
   78853 echo stderr:; tee stderr <"$at_stderr"
   78854 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78855 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
   78856 $at_failed && at_fn_log_failure
   78857 $at_traceon; }
   78858 
   78859 { set +x
   78860 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78861 at_fn_check_prepare_trace "calc.at:618"
   78862 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78864 at_status=$? at_failed=false
   78865 $at_check_filter
   78866 echo stderr:; tee stderr <"$at_stderr"
   78867 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78868 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78869 $at_failed && at_fn_log_failure
   78870 $at_traceon; }
   78871 
   78872 
   78873 
   78874 # Normalize the observed and expected error messages, depending upon the
   78875 # options.
   78876 # 1. Remove the traces from observed.
   78877 sed '/^Starting/d
   78878 /^Entering/d
   78879 /^Stack/d
   78880 /^Reading/d
   78881 /^Reducing/d
   78882 /^Return/d
   78883 /^Shifting/d
   78884 /^state/d
   78885 /^Cleanup:/d
   78886 /^Error:/d
   78887 /^Next/d
   78888 /^Now/d
   78889 /^Discarding/d
   78890 / \$[0-9$]* = /d
   78891 /^yydestructor:/d' stderr >at-stderr
   78892 mv at-stderr stderr
   78893 # 2. Create the reference error message.
   78894 cat >expout <<'_ATEOF'
   78895 1.1: syntax error, unexpected end of input
   78896 _ATEOF
   78897 
   78898 # 3. If locations are not used, remove them.
   78899 
   78900 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78901 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78902 mv at-expout expout
   78903 # 5. Check
   78904 { set +x
   78905 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   78906 at_fn_check_prepare_trace "calc.at:618"
   78907 ( $at_check_trace; cat stderr
   78908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78909 at_status=$? at_failed=false
   78910 $at_check_filter
   78911 at_fn_diff_devnull "$at_stderr" || at_failed=:
   78912 $at_diff expout "$at_stdout" || at_failed=:
   78913 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78914 $at_failed && at_fn_log_failure
   78915 $at_traceon; }
   78916 
   78917 
   78918 
   78919 # Exercise the error token: without it, we die at the first error,
   78920 # hence be sure to
   78921 #
   78922 # - have several errors which exercise different shift/discardings
   78923 #   - (): nothing to pop, nothing to discard
   78924 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   78925 #   - (* * *): nothing to pop, a lot to discard
   78926 #   - (1 + 2 * *): some to pop and discard
   78927 #
   78928 # - test the action associated to `error'
   78929 #
   78930 # - check the lookahead that triggers an error is not discarded
   78931 #   when we enter error recovery.  Below, the lookahead causing the
   78932 #   first error is ")", which is needed to recover from the error and
   78933 #   produce the "0" that triggers the "0 != 1" error.
   78934 #
   78935 cat >input <<'_ATEOF'
   78936 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   78937 _ATEOF
   78938 
   78939 { set +x
   78940 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   78941 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   78942 ( $at_check_trace;  $PREPARSER ./calc input
   78943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78944 at_status=$? at_failed=false
   78945 $at_check_filter
   78946 echo stderr:; tee stderr <"$at_stderr"
   78947 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78948 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78949 $at_failed && at_fn_log_failure
   78950 $at_traceon; }
   78951 
   78952 { set +x
   78953 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   78954 at_fn_check_prepare_trace "calc.at:618"
   78955 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   78956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   78957 at_status=$? at_failed=false
   78958 $at_check_filter
   78959 echo stderr:; tee stderr <"$at_stderr"
   78960 at_fn_diff_devnull "$at_stdout" || at_failed=:
   78961 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   78962 $at_failed && at_fn_log_failure
   78963 $at_traceon; }
   78964 
   78965 
   78966 
   78967 # Normalize the observed and expected error messages, depending upon the
   78968 # options.
   78969 # 1. Remove the traces from observed.
   78970 sed '/^Starting/d
   78971 /^Entering/d
   78972 /^Stack/d
   78973 /^Reading/d
   78974 /^Reducing/d
   78975 /^Return/d
   78976 /^Shifting/d
   78977 /^state/d
   78978 /^Cleanup:/d
   78979 /^Error:/d
   78980 /^Next/d
   78981 /^Now/d
   78982 /^Discarding/d
   78983 / \$[0-9$]* = /d
   78984 /^yydestructor:/d' stderr >at-stderr
   78985 mv at-stderr stderr
   78986 # 2. Create the reference error message.
   78987 cat >expout <<'_ATEOF'
   78988 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   78989 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   78990 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   78991 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   78992 calc: error: 4444 != 1
   78993 _ATEOF
   78994 
   78995 # 3. If locations are not used, remove them.
   78996 
   78997 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   78998 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   78999 mv at-expout expout
   79000 # 5. Check
   79001 { set +x
   79002 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   79003 at_fn_check_prepare_trace "calc.at:618"
   79004 ( $at_check_trace; cat stderr
   79005 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79006 at_status=$? at_failed=false
   79007 $at_check_filter
   79008 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79009 $at_diff expout "$at_stdout" || at_failed=:
   79010 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79011 $at_failed && at_fn_log_failure
   79012 $at_traceon; }
   79013 
   79014 
   79015 
   79016 # The same, but this time exercising explicitly triggered syntax errors.
   79017 # POSIX says the lookahead causing the error should not be discarded.
   79018 cat >input <<'_ATEOF'
   79019 (!) + (1 2) = 1
   79020 _ATEOF
   79021 
   79022 { set +x
   79023 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   79024 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   79025 ( $at_check_trace;  $PREPARSER ./calc input
   79026 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79027 at_status=$? at_failed=false
   79028 $at_check_filter
   79029 echo stderr:; tee stderr <"$at_stderr"
   79030 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79031 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79032 $at_failed && at_fn_log_failure
   79033 $at_traceon; }
   79034 
   79035 { set +x
   79036 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79037 at_fn_check_prepare_trace "calc.at:618"
   79038 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79039 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79040 at_status=$? at_failed=false
   79041 $at_check_filter
   79042 echo stderr:; tee stderr <"$at_stderr"
   79043 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79044 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79045 $at_failed && at_fn_log_failure
   79046 $at_traceon; }
   79047 
   79048 
   79049 
   79050 # Normalize the observed and expected error messages, depending upon the
   79051 # options.
   79052 # 1. Remove the traces from observed.
   79053 sed '/^Starting/d
   79054 /^Entering/d
   79055 /^Stack/d
   79056 /^Reading/d
   79057 /^Reducing/d
   79058 /^Return/d
   79059 /^Shifting/d
   79060 /^state/d
   79061 /^Cleanup:/d
   79062 /^Error:/d
   79063 /^Next/d
   79064 /^Now/d
   79065 /^Discarding/d
   79066 / \$[0-9$]* = /d
   79067 /^yydestructor:/d' stderr >at-stderr
   79068 mv at-stderr stderr
   79069 # 2. Create the reference error message.
   79070 cat >expout <<'_ATEOF'
   79071 1.10: syntax error, unexpected number
   79072 calc: error: 2222 != 1
   79073 _ATEOF
   79074 
   79075 # 3. If locations are not used, remove them.
   79076 
   79077 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   79078 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   79079 mv at-expout expout
   79080 # 5. Check
   79081 { set +x
   79082 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   79083 at_fn_check_prepare_trace "calc.at:618"
   79084 ( $at_check_trace; cat stderr
   79085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79086 at_status=$? at_failed=false
   79087 $at_check_filter
   79088 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79089 $at_diff expout "$at_stdout" || at_failed=:
   79090 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79091 $at_failed && at_fn_log_failure
   79092 $at_traceon; }
   79093 
   79094 
   79095 cat >input <<'_ATEOF'
   79096 (- *) + (1 2) = 1
   79097 _ATEOF
   79098 
   79099 { set +x
   79100 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   79101 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   79102 ( $at_check_trace;  $PREPARSER ./calc input
   79103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79104 at_status=$? at_failed=false
   79105 $at_check_filter
   79106 echo stderr:; tee stderr <"$at_stderr"
   79107 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79108 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79109 $at_failed && at_fn_log_failure
   79110 $at_traceon; }
   79111 
   79112 { set +x
   79113 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79114 at_fn_check_prepare_trace "calc.at:618"
   79115 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79117 at_status=$? at_failed=false
   79118 $at_check_filter
   79119 echo stderr:; tee stderr <"$at_stderr"
   79120 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79121 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79122 $at_failed && at_fn_log_failure
   79123 $at_traceon; }
   79124 
   79125 
   79126 
   79127 # Normalize the observed and expected error messages, depending upon the
   79128 # options.
   79129 # 1. Remove the traces from observed.
   79130 sed '/^Starting/d
   79131 /^Entering/d
   79132 /^Stack/d
   79133 /^Reading/d
   79134 /^Reducing/d
   79135 /^Return/d
   79136 /^Shifting/d
   79137 /^state/d
   79138 /^Cleanup:/d
   79139 /^Error:/d
   79140 /^Next/d
   79141 /^Now/d
   79142 /^Discarding/d
   79143 / \$[0-9$]* = /d
   79144 /^yydestructor:/d' stderr >at-stderr
   79145 mv at-stderr stderr
   79146 # 2. Create the reference error message.
   79147 cat >expout <<'_ATEOF'
   79148 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   79149 1.12: syntax error, unexpected number
   79150 calc: error: 2222 != 1
   79151 _ATEOF
   79152 
   79153 # 3. If locations are not used, remove them.
   79154 
   79155 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   79156 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   79157 mv at-expout expout
   79158 # 5. Check
   79159 { set +x
   79160 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   79161 at_fn_check_prepare_trace "calc.at:618"
   79162 ( $at_check_trace; cat stderr
   79163 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79164 at_status=$? at_failed=false
   79165 $at_check_filter
   79166 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79167 $at_diff expout "$at_stdout" || at_failed=:
   79168 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79169 $at_failed && at_fn_log_failure
   79170 $at_traceon; }
   79171 
   79172 
   79173 
   79174 # Check that yyerrok works properly: second error is not reported,
   79175 # third and fourth are.  Parse status is succesfull.
   79176 cat >input <<'_ATEOF'
   79177 (* *) + (*) + (*)
   79178 _ATEOF
   79179 
   79180 { set +x
   79181 $as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
   79182 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
   79183 ( $at_check_trace;  $PREPARSER ./calc input
   79184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79185 at_status=$? at_failed=false
   79186 $at_check_filter
   79187 echo stderr:; tee stderr <"$at_stderr"
   79188 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79189 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79190 $at_failed && at_fn_log_failure
   79191 $at_traceon; }
   79192 
   79193 { set +x
   79194 $as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79195 at_fn_check_prepare_trace "calc.at:618"
   79196 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79198 at_status=$? at_failed=false
   79199 $at_check_filter
   79200 echo stderr:; tee stderr <"$at_stderr"
   79201 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79202 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79203 $at_failed && at_fn_log_failure
   79204 $at_traceon; }
   79205 
   79206 
   79207 
   79208 # Normalize the observed and expected error messages, depending upon the
   79209 # options.
   79210 # 1. Remove the traces from observed.
   79211 sed '/^Starting/d
   79212 /^Entering/d
   79213 /^Stack/d
   79214 /^Reading/d
   79215 /^Reducing/d
   79216 /^Return/d
   79217 /^Shifting/d
   79218 /^state/d
   79219 /^Cleanup:/d
   79220 /^Error:/d
   79221 /^Next/d
   79222 /^Now/d
   79223 /^Discarding/d
   79224 / \$[0-9$]* = /d
   79225 /^yydestructor:/d' stderr >at-stderr
   79226 mv at-stderr stderr
   79227 # 2. Create the reference error message.
   79228 cat >expout <<'_ATEOF'
   79229 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   79230 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   79231 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   79232 _ATEOF
   79233 
   79234 # 3. If locations are not used, remove them.
   79235 
   79236 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   79237 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   79238 mv at-expout expout
   79239 # 5. Check
   79240 { set +x
   79241 $as_echo "$at_srcdir/calc.at:618: cat stderr"
   79242 at_fn_check_prepare_trace "calc.at:618"
   79243 ( $at_check_trace; cat stderr
   79244 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79245 at_status=$? at_failed=false
   79246 $at_check_filter
   79247 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79248 $at_diff expout "$at_stdout" || at_failed=:
   79249 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
   79250 $at_failed && at_fn_log_failure
   79251 $at_traceon; }
   79252 
   79253 
   79254 
   79255 
   79256 
   79257   set +x
   79258   $at_times_p && times >"$at_times_file"
   79259 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   79260 read at_status <"$at_status_file"
   79261 #AT_STOP_215
   79262 #AT_START_216
   79263 at_fn_group_banner 216 'calc.at:619' \
   79264   "Calculator %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11
   79265 at_xfail=no
   79266 (
   79267   $as_echo "216. $at_setup_line: testing $at_desc ..."
   79268   $at_traceon
   79269 
   79270 
   79271 
   79272 
   79273 
   79274 
   79275 
   79276 
   79277 
   79278 
   79279 cat >calc.y <<'_ATEOF'
   79280 %code top {
   79281 #include <config.h>
   79282 /* We don't need perfect functions for these tests. */
   79283 #undef malloc
   79284 #undef memcmp
   79285 #undef realloc
   79286 }
   79287 
   79288 /* Infix notation calculator--calc */
   79289 %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc
   79290 
   79291 %code requires
   79292 {
   79293 
   79294   /* Exercise pre-prologue dependency to %union.  */
   79295   typedef int semantic_value;
   79296 }
   79297 
   79298 /* Exercise %union. */
   79299 %union
   79300 {
   79301   semantic_value ival;
   79302 };
   79303 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   79304 
   79305 %code provides
   79306 {
   79307   #include <stdio.h>
   79308   /* The input.  */
   79309   extern FILE *input;
   79310   extern semantic_value global_result;
   79311   extern int global_count;
   79312 }
   79313 
   79314 %code
   79315 {
   79316 #include <assert.h>
   79317 #include <string.h>
   79318 #define USE(Var)
   79319 
   79320 FILE *input;
   79321 static int power (int base, int exponent);
   79322 
   79323 static void calcerror (CALCLTYPE const * const llocp,  const char *msg);
   79324 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   79325 }
   79326 
   79327 
   79328 
   79329 /* Bison Declarations */
   79330 %token CALC_EOF 0 "end of input"
   79331 %token <ival> NUM "number"
   79332 %type  <ival> exp
   79333 
   79334 %nonassoc '=' /* comparison            */
   79335 %left '-' '+'
   79336 %left '*' '/'
   79337 %left NEG     /* negation--unary minus */
   79338 %right '^'    /* exponentiation        */
   79339 
   79340 /* Grammar follows */
   79341 %%
   79342 input:
   79343   line
   79344 | input line         {  }
   79345 ;
   79346 
   79347 line:
   79348   '\n'
   79349 | exp '\n'           { USE ($1); }
   79350 ;
   79351 
   79352 exp:
   79353   NUM                { $$ = $1;             }
   79354 | exp '=' exp
   79355   {
   79356     if ($1 != $3)
   79357       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   79358     $$ = $1;
   79359   }
   79360 | exp '+' exp        { $$ = $1 + $3;        }
   79361 | exp '-' exp        { $$ = $1 - $3;        }
   79362 | exp '*' exp        { $$ = $1 * $3;        }
   79363 | exp '/' exp        { $$ = $1 / $3;        }
   79364 | '-' exp  %prec NEG { $$ = -$2;            }
   79365 | exp '^' exp        { $$ = power ($1, $3); }
   79366 | '(' exp ')'        { $$ = $2;             }
   79367 | '(' error ')'      { $$ = 1111; yyerrok;  }
   79368 | '!'                { $$ = 0; YYERROR;     }
   79369 | '-' error          { $$ = 0; YYERROR;     }
   79370 ;
   79371 %%
   79372 
   79373 static int
   79374 power (int base, int exponent)
   79375 {
   79376   int res = 1;
   79377   assert (0 <= exponent);
   79378   for (/* Niente */; exponent; --exponent)
   79379     res *= base;
   79380   return res;
   79381 }
   79382 
   79383 
   79384 #include <stdio.h>
   79385 /* A C error reporting function.  */
   79386 static
   79387 void calcerror (CALCLTYPE const * const llocp,  const char *msg)
   79388 {
   79389   YY_LOCATION_PRINT (stderr, (*llocp));
   79390   fprintf (stderr, ": ");
   79391   fprintf (stderr, "%s\n", msg);
   79392 }
   79393 _ATEOF
   79394 
   79395 
   79396 
   79397 cat >calc-lex.c <<'_ATEOF'
   79398 #include <config.h>
   79399 /* We don't need perfect functions for these tests. */
   79400 #undef malloc
   79401 #undef memcmp
   79402 #undef realloc
   79403 
   79404 #include "calc.h"
   79405 
   79406 #include <ctype.h>
   79407 
   79408 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   79409 static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   79410 static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);
   79411 
   79412 
   79413 static CALCLTYPE last_yylloc;
   79414 
   79415 static int
   79416 get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   79417 {
   79418   int res = getc (input);
   79419   (void) lvalp;(void) llocp;
   79420 
   79421   last_yylloc = (*llocp);
   79422   if (res == '\n')
   79423     {
   79424       (*llocp).last_line++;
   79425       (*llocp).last_column = 1;
   79426     }
   79427   else
   79428     (*llocp).last_column++;
   79429 
   79430   return res;
   79431 }
   79432 
   79433 static void
   79434 unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c)
   79435 {
   79436   (void) lvalp;(void) llocp;
   79437 
   79438   /* Wrong when C == `\n'. */
   79439   (*llocp) = last_yylloc;
   79440 
   79441   ungetc (c, input);
   79442 }
   79443 
   79444 static int
   79445 read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   79446 {
   79447   int c = get_char (lvalp, llocp);
   79448   int sign = 1;
   79449   int n = 0;
   79450 
   79451   (void) lvalp;(void) llocp;
   79452   if (c == '-')
   79453     {
   79454       c = get_char (lvalp, llocp);
   79455       sign = -1;
   79456     }
   79457 
   79458   while (isdigit (c))
   79459     {
   79460       n = 10 * n + (c - '0');
   79461       c = get_char (lvalp, llocp);
   79462     }
   79463 
   79464   unget_char (lvalp, llocp,  c);
   79465 
   79466   return sign * n;
   79467 }
   79468 
   79469 
   79470 /*---------------------------------------------------------------.
   79471 | Lexical analyzer returns an integer on the stack and the token |
   79472 | NUM, or the ASCII character read if not a number.  Skips all   |
   79473 | blanks and tabs, returns 0 for EOF.                            |
   79474 `---------------------------------------------------------------*/
   79475 
   79476 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   79477 {
   79478   int c;
   79479   /* Skip current token, then white spaces.  */
   79480   do
   79481     {
   79482      (*llocp).first_column = (*llocp).last_column;
   79483       (*llocp).first_line   = (*llocp).last_line;
   79484 
   79485     }
   79486   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   79487 
   79488   /* process numbers   */
   79489   if (c == '.' || isdigit (c))
   79490     {
   79491       unget_char (lvalp, llocp,  c);
   79492       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   79493       return NUM;
   79494     }
   79495 
   79496   /* Return end-of-file.  */
   79497   if (c == EOF)
   79498     return CALC_EOF;
   79499 
   79500   /* Return single chars. */
   79501   return c;
   79502 }
   79503 _ATEOF
   79504 
   79505 
   79506 cat >calc-main.c <<'_ATEOF'
   79507 #include <config.h>
   79508 /* We don't need perfect functions for these tests. */
   79509 #undef malloc
   79510 #undef memcmp
   79511 #undef realloc
   79512 
   79513 #include "calc.h"
   79514 
   79515 #include <assert.h>
   79516 #if HAVE_UNISTD_H
   79517 # include <unistd.h>
   79518 #else
   79519 # undef alarm
   79520 # define alarm(seconds) /* empty */
   79521 #endif
   79522 
   79523 
   79524 
   79525 semantic_value global_result = 0;
   79526 int global_count = 0;
   79527 
   79528 /* A C main function.  */
   79529 int
   79530 main (int argc, const char **argv)
   79531 {
   79532   semantic_value result = 0;
   79533   int count = 0;
   79534   int status;
   79535 
   79536   /* This used to be alarm (10), but that isn't enough time for
   79537      a July 1995 vintage DEC Alphastation 200 4/100 system,
   79538      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   79539   alarm (100);
   79540 
   79541   if (argc == 2)
   79542     input = fopen (argv[1], "r");
   79543   else
   79544     input = stdin;
   79545 
   79546   if (!input)
   79547     {
   79548       perror (argv[1]);
   79549       return 3;
   79550     }
   79551 
   79552   calcdebug = 1;
   79553   status = calcparse ();
   79554   if (fclose (input))
   79555     perror ("fclose");
   79556   assert (global_result == result);
   79557   assert (global_count == count);
   79558   return status;
   79559 }
   79560 _ATEOF
   79561 
   79562 
   79563 
   79564 
   79565 
   79566 
   79567 
   79568 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   79569   at_save_special_files
   79570   mkdir xml-tests
   79571     # Don't combine these Bison invocations since we want to be sure that
   79572   # --report=all isn't required to get the full XML file.
   79573   { set +x
   79574 $as_echo "$at_srcdir/calc.at:619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   79575                   --graph=xml-tests/test.dot -o calc.c calc.y"
   79576 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619"
   79577 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   79578                   --graph=xml-tests/test.dot -o calc.c calc.y
   79579 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79580 at_status=$? at_failed=false
   79581 $at_check_filter
   79582 echo stderr:; cat "$at_stderr"
   79583 echo stdout:; cat "$at_stdout"
   79584 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79585 $at_failed && at_fn_log_failure
   79586 $at_traceon; }
   79587 
   79588   { set +x
   79589 $as_echo "$at_srcdir/calc.at:619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   79590 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:619"
   79591 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   79592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79593 at_status=$? at_failed=false
   79594 $at_check_filter
   79595 echo stderr:; cat "$at_stderr"
   79596 echo stdout:; cat "$at_stdout"
   79597 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79598 $at_failed && at_fn_log_failure
   79599 $at_traceon; }
   79600 
   79601     cp xml-tests/test.output expout
   79602   { set +x
   79603 $as_echo "$at_srcdir/calc.at:619: \$XSLTPROC \\
   79604              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   79605              xml-tests/test.xml"
   79606 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:619"
   79607 ( $at_check_trace; $XSLTPROC \
   79608              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   79609              xml-tests/test.xml
   79610 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79611 at_status=$? at_failed=false
   79612 $at_check_filter
   79613 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79614 $at_diff expout "$at_stdout" || at_failed=:
   79615 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79616 $at_failed && at_fn_log_failure
   79617 $at_traceon; }
   79618 
   79619   sort xml-tests/test.dot > expout
   79620   { set +x
   79621 $as_echo "$at_srcdir/calc.at:619: \$XSLTPROC \\
   79622              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   79623              xml-tests/test.xml | sort"
   79624 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:619"
   79625 ( $at_check_trace; $XSLTPROC \
   79626              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   79627              xml-tests/test.xml | sort
   79628 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79629 at_status=$? at_failed=false
   79630 $at_check_filter
   79631 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79632 $at_diff expout "$at_stdout" || at_failed=:
   79633 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79634 $at_failed && at_fn_log_failure
   79635 $at_traceon; }
   79636 
   79637   rm -rf xml-tests expout
   79638   at_restore_special_files
   79639 fi
   79640 { set +x
   79641 $as_echo "$at_srcdir/calc.at:619: bison -o calc.c calc.y"
   79642 at_fn_check_prepare_trace "calc.at:619"
   79643 ( $at_check_trace; bison -o calc.c calc.y
   79644 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79645 at_status=$? at_failed=false
   79646 $at_check_filter
   79647 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79648 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79649 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79650 $at_failed && at_fn_log_failure
   79651 $at_traceon; }
   79652 
   79653 
   79654    { set +x
   79655 $as_echo "$at_srcdir/calc.at:619: \$BISON_C_WORKS"
   79656 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:619"
   79657 ( $at_check_trace; $BISON_C_WORKS
   79658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79659 at_status=$? at_failed=false
   79660 $at_check_filter
   79661 echo stderr:; cat "$at_stderr"
   79662 echo stdout:; cat "$at_stdout"
   79663 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79664 $at_failed && at_fn_log_failure
   79665 $at_traceon; }
   79666 
   79667 { set +x
   79668 $as_echo "$at_srcdir/calc.at:619: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   79669 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:619"
   79670 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   79671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79672 at_status=$? at_failed=false
   79673 $at_check_filter
   79674 echo stderr:; cat "$at_stderr"
   79675 echo stdout:; cat "$at_stdout"
   79676 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79677 $at_failed && at_fn_log_failure
   79678 $at_traceon; }
   79679 
   79680 
   79681 { set +x
   79682 $as_echo "$at_srcdir/calc.at:619: \$PERL -ne '
   79683   chomp;
   79684   print \"\$.: {\$_}\\n\"
   79685     if (# No starting/ending empty lines.
   79686         (eof || \$. == 1) && /^\\s*\$/
   79687         # No trailing space.  FIXME: not ready for \"maint\".
   79688         # || /\\s\$/
   79689         )' calc.c
   79690 "
   79691 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619"
   79692 ( $at_check_trace; $PERL -ne '
   79693   chomp;
   79694   print "$.: {$_}\n"
   79695     if (# No starting/ending empty lines.
   79696         (eof || $. == 1) && /^\s*$/
   79697         # No trailing space.  FIXME: not ready for "maint".
   79698         # || /\s$/
   79699         )' calc.c
   79700 
   79701 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79702 at_status=$? at_failed=false
   79703 $at_check_filter
   79704 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79705 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79706 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79707 $at_failed && at_fn_log_failure
   79708 $at_traceon; }
   79709 
   79710 { set +x
   79711 $as_echo "$at_srcdir/calc.at:619: \$PERL -ne '
   79712   chomp;
   79713   print \"\$.: {\$_}\\n\"
   79714     if (# No starting/ending empty lines.
   79715         (eof || \$. == 1) && /^\\s*\$/
   79716         # No trailing space.  FIXME: not ready for \"maint\".
   79717         # || /\\s\$/
   79718         )' calc.h
   79719 "
   79720 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619"
   79721 ( $at_check_trace; $PERL -ne '
   79722   chomp;
   79723   print "$.: {$_}\n"
   79724     if (# No starting/ending empty lines.
   79725         (eof || $. == 1) && /^\s*$/
   79726         # No trailing space.  FIXME: not ready for "maint".
   79727         # || /\s$/
   79728         )' calc.h
   79729 
   79730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79731 at_status=$? at_failed=false
   79732 $at_check_filter
   79733 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79734 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79735 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79736 $at_failed && at_fn_log_failure
   79737 $at_traceon; }
   79738 
   79739 
   79740 # Test the priorities.
   79741 cat >input <<'_ATEOF'
   79742 1 + 2 * 3 = 7
   79743 1 + 2 * -3 = -5
   79744 
   79745 -1^2 = -1
   79746 (-1)^2 = 1
   79747 
   79748 ---1 = -1
   79749 
   79750 1 - 2 - 3 = -4
   79751 1 - (2 - 3) = 2
   79752 
   79753 2^2^3 = 256
   79754 (2^2)^3 = 64
   79755 _ATEOF
   79756 
   79757 { set +x
   79758 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   79759 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   79760 ( $at_check_trace;  $PREPARSER ./calc input
   79761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79762 at_status=$? at_failed=false
   79763 $at_check_filter
   79764 echo stderr:; tee stderr <"$at_stderr"
   79765 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79766 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79767 $at_failed && at_fn_log_failure
   79768 $at_traceon; }
   79769 
   79770 { set +x
   79771 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79772 at_fn_check_prepare_trace "calc.at:619"
   79773 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79774 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79775 at_status=$? at_failed=false
   79776 $at_check_filter
   79777 echo stderr:; tee stderr <"$at_stderr"
   79778 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79779 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79780 $at_failed && at_fn_log_failure
   79781 $at_traceon; }
   79782 
   79783 
   79784 
   79785 
   79786 # Some syntax errors.
   79787 cat >input <<'_ATEOF'
   79788 1 2
   79789 _ATEOF
   79790 
   79791 { set +x
   79792 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   79793 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   79794 ( $at_check_trace;  $PREPARSER ./calc input
   79795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79796 at_status=$? at_failed=false
   79797 $at_check_filter
   79798 echo stderr:; tee stderr <"$at_stderr"
   79799 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79800 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619"
   79801 $at_failed && at_fn_log_failure
   79802 $at_traceon; }
   79803 
   79804 { set +x
   79805 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79806 at_fn_check_prepare_trace "calc.at:619"
   79807 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79808 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79809 at_status=$? at_failed=false
   79810 $at_check_filter
   79811 echo stderr:; tee stderr <"$at_stderr"
   79812 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79813 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79814 $at_failed && at_fn_log_failure
   79815 $at_traceon; }
   79816 
   79817 
   79818 
   79819 # Normalize the observed and expected error messages, depending upon the
   79820 # options.
   79821 # 1. Remove the traces from observed.
   79822 sed '/^Starting/d
   79823 /^Entering/d
   79824 /^Stack/d
   79825 /^Reading/d
   79826 /^Reducing/d
   79827 /^Return/d
   79828 /^Shifting/d
   79829 /^state/d
   79830 /^Cleanup:/d
   79831 /^Error:/d
   79832 /^Next/d
   79833 /^Now/d
   79834 /^Discarding/d
   79835 / \$[0-9$]* = /d
   79836 /^yydestructor:/d' stderr >at-stderr
   79837 mv at-stderr stderr
   79838 # 2. Create the reference error message.
   79839 cat >expout <<'_ATEOF'
   79840 1.3: syntax error, unexpected number
   79841 _ATEOF
   79842 
   79843 # 3. If locations are not used, remove them.
   79844 
   79845 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   79846 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   79847 mv at-expout expout
   79848 # 5. Check
   79849 { set +x
   79850 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   79851 at_fn_check_prepare_trace "calc.at:619"
   79852 ( $at_check_trace; cat stderr
   79853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79854 at_status=$? at_failed=false
   79855 $at_check_filter
   79856 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79857 $at_diff expout "$at_stdout" || at_failed=:
   79858 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79859 $at_failed && at_fn_log_failure
   79860 $at_traceon; }
   79861 
   79862 
   79863 cat >input <<'_ATEOF'
   79864 1//2
   79865 _ATEOF
   79866 
   79867 { set +x
   79868 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   79869 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   79870 ( $at_check_trace;  $PREPARSER ./calc input
   79871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79872 at_status=$? at_failed=false
   79873 $at_check_filter
   79874 echo stderr:; tee stderr <"$at_stderr"
   79875 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79876 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619"
   79877 $at_failed && at_fn_log_failure
   79878 $at_traceon; }
   79879 
   79880 { set +x
   79881 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79882 at_fn_check_prepare_trace "calc.at:619"
   79883 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79885 at_status=$? at_failed=false
   79886 $at_check_filter
   79887 echo stderr:; tee stderr <"$at_stderr"
   79888 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79889 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79890 $at_failed && at_fn_log_failure
   79891 $at_traceon; }
   79892 
   79893 
   79894 
   79895 # Normalize the observed and expected error messages, depending upon the
   79896 # options.
   79897 # 1. Remove the traces from observed.
   79898 sed '/^Starting/d
   79899 /^Entering/d
   79900 /^Stack/d
   79901 /^Reading/d
   79902 /^Reducing/d
   79903 /^Return/d
   79904 /^Shifting/d
   79905 /^state/d
   79906 /^Cleanup:/d
   79907 /^Error:/d
   79908 /^Next/d
   79909 /^Now/d
   79910 /^Discarding/d
   79911 / \$[0-9$]* = /d
   79912 /^yydestructor:/d' stderr >at-stderr
   79913 mv at-stderr stderr
   79914 # 2. Create the reference error message.
   79915 cat >expout <<'_ATEOF'
   79916 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   79917 _ATEOF
   79918 
   79919 # 3. If locations are not used, remove them.
   79920 
   79921 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   79922 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   79923 mv at-expout expout
   79924 # 5. Check
   79925 { set +x
   79926 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   79927 at_fn_check_prepare_trace "calc.at:619"
   79928 ( $at_check_trace; cat stderr
   79929 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79930 at_status=$? at_failed=false
   79931 $at_check_filter
   79932 at_fn_diff_devnull "$at_stderr" || at_failed=:
   79933 $at_diff expout "$at_stdout" || at_failed=:
   79934 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79935 $at_failed && at_fn_log_failure
   79936 $at_traceon; }
   79937 
   79938 
   79939 cat >input <<'_ATEOF'
   79940 error
   79941 _ATEOF
   79942 
   79943 { set +x
   79944 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   79945 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   79946 ( $at_check_trace;  $PREPARSER ./calc input
   79947 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79948 at_status=$? at_failed=false
   79949 $at_check_filter
   79950 echo stderr:; tee stderr <"$at_stderr"
   79951 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79952 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619"
   79953 $at_failed && at_fn_log_failure
   79954 $at_traceon; }
   79955 
   79956 { set +x
   79957 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   79958 at_fn_check_prepare_trace "calc.at:619"
   79959 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   79960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   79961 at_status=$? at_failed=false
   79962 $at_check_filter
   79963 echo stderr:; tee stderr <"$at_stderr"
   79964 at_fn_diff_devnull "$at_stdout" || at_failed=:
   79965 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   79966 $at_failed && at_fn_log_failure
   79967 $at_traceon; }
   79968 
   79969 
   79970 
   79971 # Normalize the observed and expected error messages, depending upon the
   79972 # options.
   79973 # 1. Remove the traces from observed.
   79974 sed '/^Starting/d
   79975 /^Entering/d
   79976 /^Stack/d
   79977 /^Reading/d
   79978 /^Reducing/d
   79979 /^Return/d
   79980 /^Shifting/d
   79981 /^state/d
   79982 /^Cleanup:/d
   79983 /^Error:/d
   79984 /^Next/d
   79985 /^Now/d
   79986 /^Discarding/d
   79987 / \$[0-9$]* = /d
   79988 /^yydestructor:/d' stderr >at-stderr
   79989 mv at-stderr stderr
   79990 # 2. Create the reference error message.
   79991 cat >expout <<'_ATEOF'
   79992 1.1: syntax error, unexpected $undefined
   79993 _ATEOF
   79994 
   79995 # 3. If locations are not used, remove them.
   79996 
   79997 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   79998 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   79999 mv at-expout expout
   80000 # 5. Check
   80001 { set +x
   80002 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80003 at_fn_check_prepare_trace "calc.at:619"
   80004 ( $at_check_trace; cat stderr
   80005 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80006 at_status=$? at_failed=false
   80007 $at_check_filter
   80008 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80009 $at_diff expout "$at_stdout" || at_failed=:
   80010 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80011 $at_failed && at_fn_log_failure
   80012 $at_traceon; }
   80013 
   80014 
   80015 cat >input <<'_ATEOF'
   80016 1 = 2 = 3
   80017 _ATEOF
   80018 
   80019 { set +x
   80020 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   80021 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   80022 ( $at_check_trace;  $PREPARSER ./calc input
   80023 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80024 at_status=$? at_failed=false
   80025 $at_check_filter
   80026 echo stderr:; tee stderr <"$at_stderr"
   80027 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80028 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619"
   80029 $at_failed && at_fn_log_failure
   80030 $at_traceon; }
   80031 
   80032 { set +x
   80033 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80034 at_fn_check_prepare_trace "calc.at:619"
   80035 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80036 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80037 at_status=$? at_failed=false
   80038 $at_check_filter
   80039 echo stderr:; tee stderr <"$at_stderr"
   80040 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80041 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80042 $at_failed && at_fn_log_failure
   80043 $at_traceon; }
   80044 
   80045 
   80046 
   80047 # Normalize the observed and expected error messages, depending upon the
   80048 # options.
   80049 # 1. Remove the traces from observed.
   80050 sed '/^Starting/d
   80051 /^Entering/d
   80052 /^Stack/d
   80053 /^Reading/d
   80054 /^Reducing/d
   80055 /^Return/d
   80056 /^Shifting/d
   80057 /^state/d
   80058 /^Cleanup:/d
   80059 /^Error:/d
   80060 /^Next/d
   80061 /^Now/d
   80062 /^Discarding/d
   80063 / \$[0-9$]* = /d
   80064 /^yydestructor:/d' stderr >at-stderr
   80065 mv at-stderr stderr
   80066 # 2. Create the reference error message.
   80067 cat >expout <<'_ATEOF'
   80068 1.7: syntax error, unexpected '='
   80069 _ATEOF
   80070 
   80071 # 3. If locations are not used, remove them.
   80072 
   80073 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80074 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80075 mv at-expout expout
   80076 # 5. Check
   80077 { set +x
   80078 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80079 at_fn_check_prepare_trace "calc.at:619"
   80080 ( $at_check_trace; cat stderr
   80081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80082 at_status=$? at_failed=false
   80083 $at_check_filter
   80084 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80085 $at_diff expout "$at_stdout" || at_failed=:
   80086 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80087 $at_failed && at_fn_log_failure
   80088 $at_traceon; }
   80089 
   80090 
   80091 cat >input <<'_ATEOF'
   80092 
   80093 +1
   80094 _ATEOF
   80095 
   80096 { set +x
   80097 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   80098 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   80099 ( $at_check_trace;  $PREPARSER ./calc input
   80100 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80101 at_status=$? at_failed=false
   80102 $at_check_filter
   80103 echo stderr:; tee stderr <"$at_stderr"
   80104 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80105 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619"
   80106 $at_failed && at_fn_log_failure
   80107 $at_traceon; }
   80108 
   80109 { set +x
   80110 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80111 at_fn_check_prepare_trace "calc.at:619"
   80112 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80113 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80114 at_status=$? at_failed=false
   80115 $at_check_filter
   80116 echo stderr:; tee stderr <"$at_stderr"
   80117 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80118 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80119 $at_failed && at_fn_log_failure
   80120 $at_traceon; }
   80121 
   80122 
   80123 
   80124 # Normalize the observed and expected error messages, depending upon the
   80125 # options.
   80126 # 1. Remove the traces from observed.
   80127 sed '/^Starting/d
   80128 /^Entering/d
   80129 /^Stack/d
   80130 /^Reading/d
   80131 /^Reducing/d
   80132 /^Return/d
   80133 /^Shifting/d
   80134 /^state/d
   80135 /^Cleanup:/d
   80136 /^Error:/d
   80137 /^Next/d
   80138 /^Now/d
   80139 /^Discarding/d
   80140 / \$[0-9$]* = /d
   80141 /^yydestructor:/d' stderr >at-stderr
   80142 mv at-stderr stderr
   80143 # 2. Create the reference error message.
   80144 cat >expout <<'_ATEOF'
   80145 2.1: syntax error, unexpected '+'
   80146 _ATEOF
   80147 
   80148 # 3. If locations are not used, remove them.
   80149 
   80150 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80151 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80152 mv at-expout expout
   80153 # 5. Check
   80154 { set +x
   80155 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80156 at_fn_check_prepare_trace "calc.at:619"
   80157 ( $at_check_trace; cat stderr
   80158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80159 at_status=$? at_failed=false
   80160 $at_check_filter
   80161 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80162 $at_diff expout "$at_stdout" || at_failed=:
   80163 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80164 $at_failed && at_fn_log_failure
   80165 $at_traceon; }
   80166 
   80167 
   80168 # Exercise error messages with EOF: work on an empty file.
   80169 { set +x
   80170 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc /dev/null"
   80171 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:619"
   80172 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   80173 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80174 at_status=$? at_failed=false
   80175 $at_check_filter
   80176 echo stderr:; tee stderr <"$at_stderr"
   80177 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80178 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619"
   80179 $at_failed && at_fn_log_failure
   80180 $at_traceon; }
   80181 
   80182 { set +x
   80183 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80184 at_fn_check_prepare_trace "calc.at:619"
   80185 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80186 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80187 at_status=$? at_failed=false
   80188 $at_check_filter
   80189 echo stderr:; tee stderr <"$at_stderr"
   80190 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80191 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80192 $at_failed && at_fn_log_failure
   80193 $at_traceon; }
   80194 
   80195 
   80196 
   80197 # Normalize the observed and expected error messages, depending upon the
   80198 # options.
   80199 # 1. Remove the traces from observed.
   80200 sed '/^Starting/d
   80201 /^Entering/d
   80202 /^Stack/d
   80203 /^Reading/d
   80204 /^Reducing/d
   80205 /^Return/d
   80206 /^Shifting/d
   80207 /^state/d
   80208 /^Cleanup:/d
   80209 /^Error:/d
   80210 /^Next/d
   80211 /^Now/d
   80212 /^Discarding/d
   80213 / \$[0-9$]* = /d
   80214 /^yydestructor:/d' stderr >at-stderr
   80215 mv at-stderr stderr
   80216 # 2. Create the reference error message.
   80217 cat >expout <<'_ATEOF'
   80218 1.1: syntax error, unexpected end of input
   80219 _ATEOF
   80220 
   80221 # 3. If locations are not used, remove them.
   80222 
   80223 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80224 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80225 mv at-expout expout
   80226 # 5. Check
   80227 { set +x
   80228 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80229 at_fn_check_prepare_trace "calc.at:619"
   80230 ( $at_check_trace; cat stderr
   80231 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80232 at_status=$? at_failed=false
   80233 $at_check_filter
   80234 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80235 $at_diff expout "$at_stdout" || at_failed=:
   80236 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80237 $at_failed && at_fn_log_failure
   80238 $at_traceon; }
   80239 
   80240 
   80241 
   80242 # Exercise the error token: without it, we die at the first error,
   80243 # hence be sure to
   80244 #
   80245 # - have several errors which exercise different shift/discardings
   80246 #   - (): nothing to pop, nothing to discard
   80247 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   80248 #   - (* * *): nothing to pop, a lot to discard
   80249 #   - (1 + 2 * *): some to pop and discard
   80250 #
   80251 # - test the action associated to `error'
   80252 #
   80253 # - check the lookahead that triggers an error is not discarded
   80254 #   when we enter error recovery.  Below, the lookahead causing the
   80255 #   first error is ")", which is needed to recover from the error and
   80256 #   produce the "0" that triggers the "0 != 1" error.
   80257 #
   80258 cat >input <<'_ATEOF'
   80259 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   80260 _ATEOF
   80261 
   80262 { set +x
   80263 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   80264 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   80265 ( $at_check_trace;  $PREPARSER ./calc input
   80266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80267 at_status=$? at_failed=false
   80268 $at_check_filter
   80269 echo stderr:; tee stderr <"$at_stderr"
   80270 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80271 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80272 $at_failed && at_fn_log_failure
   80273 $at_traceon; }
   80274 
   80275 { set +x
   80276 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80277 at_fn_check_prepare_trace "calc.at:619"
   80278 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80280 at_status=$? at_failed=false
   80281 $at_check_filter
   80282 echo stderr:; tee stderr <"$at_stderr"
   80283 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80284 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80285 $at_failed && at_fn_log_failure
   80286 $at_traceon; }
   80287 
   80288 
   80289 
   80290 # Normalize the observed and expected error messages, depending upon the
   80291 # options.
   80292 # 1. Remove the traces from observed.
   80293 sed '/^Starting/d
   80294 /^Entering/d
   80295 /^Stack/d
   80296 /^Reading/d
   80297 /^Reducing/d
   80298 /^Return/d
   80299 /^Shifting/d
   80300 /^state/d
   80301 /^Cleanup:/d
   80302 /^Error:/d
   80303 /^Next/d
   80304 /^Now/d
   80305 /^Discarding/d
   80306 / \$[0-9$]* = /d
   80307 /^yydestructor:/d' stderr >at-stderr
   80308 mv at-stderr stderr
   80309 # 2. Create the reference error message.
   80310 cat >expout <<'_ATEOF'
   80311 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   80312 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   80313 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   80314 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   80315 calc: error: 4444 != 1
   80316 _ATEOF
   80317 
   80318 # 3. If locations are not used, remove them.
   80319 
   80320 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80321 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80322 mv at-expout expout
   80323 # 5. Check
   80324 { set +x
   80325 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80326 at_fn_check_prepare_trace "calc.at:619"
   80327 ( $at_check_trace; cat stderr
   80328 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80329 at_status=$? at_failed=false
   80330 $at_check_filter
   80331 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80332 $at_diff expout "$at_stdout" || at_failed=:
   80333 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80334 $at_failed && at_fn_log_failure
   80335 $at_traceon; }
   80336 
   80337 
   80338 
   80339 # The same, but this time exercising explicitly triggered syntax errors.
   80340 # POSIX says the lookahead causing the error should not be discarded.
   80341 cat >input <<'_ATEOF'
   80342 (!) + (1 2) = 1
   80343 _ATEOF
   80344 
   80345 { set +x
   80346 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   80347 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   80348 ( $at_check_trace;  $PREPARSER ./calc input
   80349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80350 at_status=$? at_failed=false
   80351 $at_check_filter
   80352 echo stderr:; tee stderr <"$at_stderr"
   80353 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80354 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80355 $at_failed && at_fn_log_failure
   80356 $at_traceon; }
   80357 
   80358 { set +x
   80359 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80360 at_fn_check_prepare_trace "calc.at:619"
   80361 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80363 at_status=$? at_failed=false
   80364 $at_check_filter
   80365 echo stderr:; tee stderr <"$at_stderr"
   80366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80367 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80368 $at_failed && at_fn_log_failure
   80369 $at_traceon; }
   80370 
   80371 
   80372 
   80373 # Normalize the observed and expected error messages, depending upon the
   80374 # options.
   80375 # 1. Remove the traces from observed.
   80376 sed '/^Starting/d
   80377 /^Entering/d
   80378 /^Stack/d
   80379 /^Reading/d
   80380 /^Reducing/d
   80381 /^Return/d
   80382 /^Shifting/d
   80383 /^state/d
   80384 /^Cleanup:/d
   80385 /^Error:/d
   80386 /^Next/d
   80387 /^Now/d
   80388 /^Discarding/d
   80389 / \$[0-9$]* = /d
   80390 /^yydestructor:/d' stderr >at-stderr
   80391 mv at-stderr stderr
   80392 # 2. Create the reference error message.
   80393 cat >expout <<'_ATEOF'
   80394 1.10: syntax error, unexpected number
   80395 calc: error: 2222 != 1
   80396 _ATEOF
   80397 
   80398 # 3. If locations are not used, remove them.
   80399 
   80400 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80401 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80402 mv at-expout expout
   80403 # 5. Check
   80404 { set +x
   80405 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80406 at_fn_check_prepare_trace "calc.at:619"
   80407 ( $at_check_trace; cat stderr
   80408 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80409 at_status=$? at_failed=false
   80410 $at_check_filter
   80411 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80412 $at_diff expout "$at_stdout" || at_failed=:
   80413 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80414 $at_failed && at_fn_log_failure
   80415 $at_traceon; }
   80416 
   80417 
   80418 cat >input <<'_ATEOF'
   80419 (- *) + (1 2) = 1
   80420 _ATEOF
   80421 
   80422 { set +x
   80423 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   80424 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   80425 ( $at_check_trace;  $PREPARSER ./calc input
   80426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80427 at_status=$? at_failed=false
   80428 $at_check_filter
   80429 echo stderr:; tee stderr <"$at_stderr"
   80430 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80431 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80432 $at_failed && at_fn_log_failure
   80433 $at_traceon; }
   80434 
   80435 { set +x
   80436 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80437 at_fn_check_prepare_trace "calc.at:619"
   80438 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80439 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80440 at_status=$? at_failed=false
   80441 $at_check_filter
   80442 echo stderr:; tee stderr <"$at_stderr"
   80443 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80444 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80445 $at_failed && at_fn_log_failure
   80446 $at_traceon; }
   80447 
   80448 
   80449 
   80450 # Normalize the observed and expected error messages, depending upon the
   80451 # options.
   80452 # 1. Remove the traces from observed.
   80453 sed '/^Starting/d
   80454 /^Entering/d
   80455 /^Stack/d
   80456 /^Reading/d
   80457 /^Reducing/d
   80458 /^Return/d
   80459 /^Shifting/d
   80460 /^state/d
   80461 /^Cleanup:/d
   80462 /^Error:/d
   80463 /^Next/d
   80464 /^Now/d
   80465 /^Discarding/d
   80466 / \$[0-9$]* = /d
   80467 /^yydestructor:/d' stderr >at-stderr
   80468 mv at-stderr stderr
   80469 # 2. Create the reference error message.
   80470 cat >expout <<'_ATEOF'
   80471 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   80472 1.12: syntax error, unexpected number
   80473 calc: error: 2222 != 1
   80474 _ATEOF
   80475 
   80476 # 3. If locations are not used, remove them.
   80477 
   80478 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80479 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80480 mv at-expout expout
   80481 # 5. Check
   80482 { set +x
   80483 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80484 at_fn_check_prepare_trace "calc.at:619"
   80485 ( $at_check_trace; cat stderr
   80486 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80487 at_status=$? at_failed=false
   80488 $at_check_filter
   80489 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80490 $at_diff expout "$at_stdout" || at_failed=:
   80491 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80492 $at_failed && at_fn_log_failure
   80493 $at_traceon; }
   80494 
   80495 
   80496 
   80497 # Check that yyerrok works properly: second error is not reported,
   80498 # third and fourth are.  Parse status is succesfull.
   80499 cat >input <<'_ATEOF'
   80500 (* *) + (*) + (*)
   80501 _ATEOF
   80502 
   80503 { set +x
   80504 $as_echo "$at_srcdir/calc.at:619:  \$PREPARSER ./calc input"
   80505 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619"
   80506 ( $at_check_trace;  $PREPARSER ./calc input
   80507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80508 at_status=$? at_failed=false
   80509 $at_check_filter
   80510 echo stderr:; tee stderr <"$at_stderr"
   80511 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80512 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80513 $at_failed && at_fn_log_failure
   80514 $at_traceon; }
   80515 
   80516 { set +x
   80517 $as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   80518 at_fn_check_prepare_trace "calc.at:619"
   80519 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   80520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80521 at_status=$? at_failed=false
   80522 $at_check_filter
   80523 echo stderr:; tee stderr <"$at_stderr"
   80524 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80525 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80526 $at_failed && at_fn_log_failure
   80527 $at_traceon; }
   80528 
   80529 
   80530 
   80531 # Normalize the observed and expected error messages, depending upon the
   80532 # options.
   80533 # 1. Remove the traces from observed.
   80534 sed '/^Starting/d
   80535 /^Entering/d
   80536 /^Stack/d
   80537 /^Reading/d
   80538 /^Reducing/d
   80539 /^Return/d
   80540 /^Shifting/d
   80541 /^state/d
   80542 /^Cleanup:/d
   80543 /^Error:/d
   80544 /^Next/d
   80545 /^Now/d
   80546 /^Discarding/d
   80547 / \$[0-9$]* = /d
   80548 /^yydestructor:/d' stderr >at-stderr
   80549 mv at-stderr stderr
   80550 # 2. Create the reference error message.
   80551 cat >expout <<'_ATEOF'
   80552 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   80553 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   80554 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   80555 _ATEOF
   80556 
   80557 # 3. If locations are not used, remove them.
   80558 
   80559 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   80560 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   80561 mv at-expout expout
   80562 # 5. Check
   80563 { set +x
   80564 $as_echo "$at_srcdir/calc.at:619: cat stderr"
   80565 at_fn_check_prepare_trace "calc.at:619"
   80566 ( $at_check_trace; cat stderr
   80567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80568 at_status=$? at_failed=false
   80569 $at_check_filter
   80570 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80571 $at_diff expout "$at_stdout" || at_failed=:
   80572 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619"
   80573 $at_failed && at_fn_log_failure
   80574 $at_traceon; }
   80575 
   80576 
   80577 
   80578 
   80579 
   80580   set +x
   80581   $at_times_p && times >"$at_times_file"
   80582 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   80583 read at_status <"$at_status_file"
   80584 #AT_STOP_216
   80585 #AT_START_217
   80586 at_fn_group_banner 217 'calc.at:621' \
   80587   "Calculator %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 11
   80588 at_xfail=no
   80589 (
   80590   $as_echo "217. $at_setup_line: testing $at_desc ..."
   80591   $at_traceon
   80592 
   80593 
   80594 
   80595 
   80596 
   80597 
   80598 
   80599 
   80600 
   80601 
   80602 cat >calc.y <<'_ATEOF'
   80603 %code top {
   80604 #include <config.h>
   80605 /* We don't need perfect functions for these tests. */
   80606 #undef malloc
   80607 #undef memcmp
   80608 #undef realloc
   80609 }
   80610 
   80611 /* Infix notation calculator--calc */
   80612 %define api.pure %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   80613 
   80614 %code requires
   80615 {
   80616 
   80617   /* Exercise pre-prologue dependency to %union.  */
   80618   typedef int semantic_value;
   80619 }
   80620 
   80621 /* Exercise %union. */
   80622 %union
   80623 {
   80624   semantic_value ival;
   80625 };
   80626 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   80627 
   80628 %code provides
   80629 {
   80630   #include <stdio.h>
   80631   /* The input.  */
   80632   extern FILE *input;
   80633   extern semantic_value global_result;
   80634   extern int global_count;
   80635 }
   80636 
   80637 %code
   80638 {
   80639 #include <assert.h>
   80640 #include <string.h>
   80641 #define USE(Var)
   80642 
   80643 FILE *input;
   80644 static int power (int base, int exponent);
   80645 
   80646 static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg);
   80647 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   80648 }
   80649 
   80650 
   80651 
   80652 /* Bison Declarations */
   80653 %token CALC_EOF 0 "end of input"
   80654 %token <ival> NUM "number"
   80655 %type  <ival> exp
   80656 
   80657 %nonassoc '=' /* comparison            */
   80658 %left '-' '+'
   80659 %left '*' '/'
   80660 %left NEG     /* negation--unary minus */
   80661 %right '^'    /* exponentiation        */
   80662 
   80663 /* Grammar follows */
   80664 %%
   80665 input:
   80666   line
   80667 | input line         { ++*count; ++global_count; }
   80668 ;
   80669 
   80670 line:
   80671   '\n'
   80672 | exp '\n'           { *result = global_result = $1; }
   80673 ;
   80674 
   80675 exp:
   80676   NUM                { $$ = $1;             }
   80677 | exp '=' exp
   80678   {
   80679     if ($1 != $3)
   80680       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   80681     $$ = $1;
   80682   }
   80683 | exp '+' exp        { $$ = $1 + $3;        }
   80684 | exp '-' exp        { $$ = $1 - $3;        }
   80685 | exp '*' exp        { $$ = $1 * $3;        }
   80686 | exp '/' exp        { $$ = $1 / $3;        }
   80687 | '-' exp  %prec NEG { $$ = -$2;            }
   80688 | exp '^' exp        { $$ = power ($1, $3); }
   80689 | '(' exp ')'        { $$ = $2;             }
   80690 | '(' error ')'      { $$ = 1111; yyerrok;  }
   80691 | '!'                { $$ = 0; YYERROR;     }
   80692 | '-' error          { $$ = 0; YYERROR;     }
   80693 ;
   80694 %%
   80695 
   80696 static int
   80697 power (int base, int exponent)
   80698 {
   80699   int res = 1;
   80700   assert (0 <= exponent);
   80701   for (/* Niente */; exponent; --exponent)
   80702     res *= base;
   80703   return res;
   80704 }
   80705 
   80706 
   80707 #include <stdio.h>
   80708 /* A C error reporting function.  */
   80709 static
   80710 void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg)
   80711 {
   80712   YYUSE(result);
   80713   YYUSE(count);
   80714   YY_LOCATION_PRINT (stderr, (*llocp));
   80715   fprintf (stderr, ": ");
   80716   fprintf (stderr, "%s\n", msg);
   80717 }
   80718 _ATEOF
   80719 
   80720 
   80721 
   80722 cat >calc-lex.c <<'_ATEOF'
   80723 #include <config.h>
   80724 /* We don't need perfect functions for these tests. */
   80725 #undef malloc
   80726 #undef memcmp
   80727 #undef realloc
   80728 
   80729 #include "calc.h"
   80730 
   80731 #include <ctype.h>
   80732 
   80733 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   80734 static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   80735 static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);
   80736 
   80737 
   80738 static CALCLTYPE last_yylloc;
   80739 
   80740 static int
   80741 get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   80742 {
   80743   int res = getc (input);
   80744   (void) lvalp;(void) llocp;
   80745 
   80746   last_yylloc = (*llocp);
   80747   if (res == '\n')
   80748     {
   80749       (*llocp).last_line++;
   80750       (*llocp).last_column = 1;
   80751     }
   80752   else
   80753     (*llocp).last_column++;
   80754 
   80755   return res;
   80756 }
   80757 
   80758 static void
   80759 unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c)
   80760 {
   80761   (void) lvalp;(void) llocp;
   80762 
   80763   /* Wrong when C == `\n'. */
   80764   (*llocp) = last_yylloc;
   80765 
   80766   ungetc (c, input);
   80767 }
   80768 
   80769 static int
   80770 read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   80771 {
   80772   int c = get_char (lvalp, llocp);
   80773   int sign = 1;
   80774   int n = 0;
   80775 
   80776   (void) lvalp;(void) llocp;
   80777   if (c == '-')
   80778     {
   80779       c = get_char (lvalp, llocp);
   80780       sign = -1;
   80781     }
   80782 
   80783   while (isdigit (c))
   80784     {
   80785       n = 10 * n + (c - '0');
   80786       c = get_char (lvalp, llocp);
   80787     }
   80788 
   80789   unget_char (lvalp, llocp,  c);
   80790 
   80791   return sign * n;
   80792 }
   80793 
   80794 
   80795 /*---------------------------------------------------------------.
   80796 | Lexical analyzer returns an integer on the stack and the token |
   80797 | NUM, or the ASCII character read if not a number.  Skips all   |
   80798 | blanks and tabs, returns 0 for EOF.                            |
   80799 `---------------------------------------------------------------*/
   80800 
   80801 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   80802 {
   80803   int c;
   80804   /* Skip current token, then white spaces.  */
   80805   do
   80806     {
   80807      (*llocp).first_column = (*llocp).last_column;
   80808       (*llocp).first_line   = (*llocp).last_line;
   80809 
   80810     }
   80811   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   80812 
   80813   /* process numbers   */
   80814   if (c == '.' || isdigit (c))
   80815     {
   80816       unget_char (lvalp, llocp,  c);
   80817       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   80818       return NUM;
   80819     }
   80820 
   80821   /* Return end-of-file.  */
   80822   if (c == EOF)
   80823     return CALC_EOF;
   80824 
   80825   /* Return single chars. */
   80826   return c;
   80827 }
   80828 _ATEOF
   80829 
   80830 
   80831 cat >calc-main.c <<'_ATEOF'
   80832 #include <config.h>
   80833 /* We don't need perfect functions for these tests. */
   80834 #undef malloc
   80835 #undef memcmp
   80836 #undef realloc
   80837 
   80838 #include "calc.h"
   80839 
   80840 #include <assert.h>
   80841 #if HAVE_UNISTD_H
   80842 # include <unistd.h>
   80843 #else
   80844 # undef alarm
   80845 # define alarm(seconds) /* empty */
   80846 #endif
   80847 
   80848 
   80849 
   80850 semantic_value global_result = 0;
   80851 int global_count = 0;
   80852 
   80853 /* A C main function.  */
   80854 int
   80855 main (int argc, const char **argv)
   80856 {
   80857   semantic_value result = 0;
   80858   int count = 0;
   80859   int status;
   80860 
   80861   /* This used to be alarm (10), but that isn't enough time for
   80862      a July 1995 vintage DEC Alphastation 200 4/100 system,
   80863      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   80864   alarm (100);
   80865 
   80866   if (argc == 2)
   80867     input = fopen (argv[1], "r");
   80868   else
   80869     input = stdin;
   80870 
   80871   if (!input)
   80872     {
   80873       perror (argv[1]);
   80874       return 3;
   80875     }
   80876 
   80877   calcdebug = 1;
   80878   status = calcparse (&result, &count);
   80879   if (fclose (input))
   80880     perror ("fclose");
   80881   assert (global_result == result);
   80882   assert (global_count == count);
   80883   return status;
   80884 }
   80885 _ATEOF
   80886 
   80887 
   80888 
   80889 
   80890 
   80891 
   80892 
   80893 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   80894   at_save_special_files
   80895   mkdir xml-tests
   80896     # Don't combine these Bison invocations since we want to be sure that
   80897   # --report=all isn't required to get the full XML file.
   80898   { set +x
   80899 $as_echo "$at_srcdir/calc.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   80900                   --graph=xml-tests/test.dot -o calc.c calc.y"
   80901 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621"
   80902 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   80903                   --graph=xml-tests/test.dot -o calc.c calc.y
   80904 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80905 at_status=$? at_failed=false
   80906 $at_check_filter
   80907 echo stderr:; cat "$at_stderr"
   80908 echo stdout:; cat "$at_stdout"
   80909 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   80910 $at_failed && at_fn_log_failure
   80911 $at_traceon; }
   80912 
   80913   { set +x
   80914 $as_echo "$at_srcdir/calc.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   80915 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:621"
   80916 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   80917 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80918 at_status=$? at_failed=false
   80919 $at_check_filter
   80920 echo stderr:; cat "$at_stderr"
   80921 echo stdout:; cat "$at_stdout"
   80922 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   80923 $at_failed && at_fn_log_failure
   80924 $at_traceon; }
   80925 
   80926     cp xml-tests/test.output expout
   80927   { set +x
   80928 $as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\
   80929              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   80930              xml-tests/test.xml"
   80931 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621"
   80932 ( $at_check_trace; $XSLTPROC \
   80933              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   80934              xml-tests/test.xml
   80935 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80936 at_status=$? at_failed=false
   80937 $at_check_filter
   80938 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80939 $at_diff expout "$at_stdout" || at_failed=:
   80940 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   80941 $at_failed && at_fn_log_failure
   80942 $at_traceon; }
   80943 
   80944   sort xml-tests/test.dot > expout
   80945   { set +x
   80946 $as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\
   80947              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   80948              xml-tests/test.xml | sort"
   80949 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621"
   80950 ( $at_check_trace; $XSLTPROC \
   80951              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   80952              xml-tests/test.xml | sort
   80953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80954 at_status=$? at_failed=false
   80955 $at_check_filter
   80956 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80957 $at_diff expout "$at_stdout" || at_failed=:
   80958 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   80959 $at_failed && at_fn_log_failure
   80960 $at_traceon; }
   80961 
   80962   rm -rf xml-tests expout
   80963   at_restore_special_files
   80964 fi
   80965 { set +x
   80966 $as_echo "$at_srcdir/calc.at:621: bison -o calc.c calc.y"
   80967 at_fn_check_prepare_trace "calc.at:621"
   80968 ( $at_check_trace; bison -o calc.c calc.y
   80969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80970 at_status=$? at_failed=false
   80971 $at_check_filter
   80972 at_fn_diff_devnull "$at_stderr" || at_failed=:
   80973 at_fn_diff_devnull "$at_stdout" || at_failed=:
   80974 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   80975 $at_failed && at_fn_log_failure
   80976 $at_traceon; }
   80977 
   80978 
   80979    { set +x
   80980 $as_echo "$at_srcdir/calc.at:621: \$BISON_C_WORKS"
   80981 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:621"
   80982 ( $at_check_trace; $BISON_C_WORKS
   80983 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80984 at_status=$? at_failed=false
   80985 $at_check_filter
   80986 echo stderr:; cat "$at_stderr"
   80987 echo stdout:; cat "$at_stdout"
   80988 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   80989 $at_failed && at_fn_log_failure
   80990 $at_traceon; }
   80991 
   80992 { set +x
   80993 $as_echo "$at_srcdir/calc.at:621: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   80994 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:621"
   80995 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   80996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   80997 at_status=$? at_failed=false
   80998 $at_check_filter
   80999 echo stderr:; cat "$at_stderr"
   81000 echo stdout:; cat "$at_stdout"
   81001 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81002 $at_failed && at_fn_log_failure
   81003 $at_traceon; }
   81004 
   81005 
   81006 { set +x
   81007 $as_echo "$at_srcdir/calc.at:621: \$PERL -ne '
   81008   chomp;
   81009   print \"\$.: {\$_}\\n\"
   81010     if (# No starting/ending empty lines.
   81011         (eof || \$. == 1) && /^\\s*\$/
   81012         # No trailing space.  FIXME: not ready for \"maint\".
   81013         # || /\\s\$/
   81014         )' calc.c
   81015 "
   81016 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621"
   81017 ( $at_check_trace; $PERL -ne '
   81018   chomp;
   81019   print "$.: {$_}\n"
   81020     if (# No starting/ending empty lines.
   81021         (eof || $. == 1) && /^\s*$/
   81022         # No trailing space.  FIXME: not ready for "maint".
   81023         # || /\s$/
   81024         )' calc.c
   81025 
   81026 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81027 at_status=$? at_failed=false
   81028 $at_check_filter
   81029 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81030 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81031 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81032 $at_failed && at_fn_log_failure
   81033 $at_traceon; }
   81034 
   81035 { set +x
   81036 $as_echo "$at_srcdir/calc.at:621: \$PERL -ne '
   81037   chomp;
   81038   print \"\$.: {\$_}\\n\"
   81039     if (# No starting/ending empty lines.
   81040         (eof || \$. == 1) && /^\\s*\$/
   81041         # No trailing space.  FIXME: not ready for \"maint\".
   81042         # || /\\s\$/
   81043         )' calc.h
   81044 "
   81045 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621"
   81046 ( $at_check_trace; $PERL -ne '
   81047   chomp;
   81048   print "$.: {$_}\n"
   81049     if (# No starting/ending empty lines.
   81050         (eof || $. == 1) && /^\s*$/
   81051         # No trailing space.  FIXME: not ready for "maint".
   81052         # || /\s$/
   81053         )' calc.h
   81054 
   81055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81056 at_status=$? at_failed=false
   81057 $at_check_filter
   81058 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81059 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81060 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81061 $at_failed && at_fn_log_failure
   81062 $at_traceon; }
   81063 
   81064 
   81065 # Test the priorities.
   81066 cat >input <<'_ATEOF'
   81067 1 + 2 * 3 = 7
   81068 1 + 2 * -3 = -5
   81069 
   81070 -1^2 = -1
   81071 (-1)^2 = 1
   81072 
   81073 ---1 = -1
   81074 
   81075 1 - 2 - 3 = -4
   81076 1 - (2 - 3) = 2
   81077 
   81078 2^2^3 = 256
   81079 (2^2)^3 = 64
   81080 _ATEOF
   81081 
   81082 { set +x
   81083 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81084 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81085 ( $at_check_trace;  $PREPARSER ./calc input
   81086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81087 at_status=$? at_failed=false
   81088 $at_check_filter
   81089 echo stderr:; tee stderr <"$at_stderr"
   81090 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81091 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81092 $at_failed && at_fn_log_failure
   81093 $at_traceon; }
   81094 
   81095 { set +x
   81096 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81097 at_fn_check_prepare_trace "calc.at:621"
   81098 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81099 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81100 at_status=$? at_failed=false
   81101 $at_check_filter
   81102 echo stderr:; tee stderr <"$at_stderr"
   81103 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81104 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81105 $at_failed && at_fn_log_failure
   81106 $at_traceon; }
   81107 
   81108 
   81109 
   81110 
   81111 # Some syntax errors.
   81112 cat >input <<'_ATEOF'
   81113 1 2
   81114 _ATEOF
   81115 
   81116 { set +x
   81117 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81118 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81119 ( $at_check_trace;  $PREPARSER ./calc input
   81120 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81121 at_status=$? at_failed=false
   81122 $at_check_filter
   81123 echo stderr:; tee stderr <"$at_stderr"
   81124 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81125 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
   81126 $at_failed && at_fn_log_failure
   81127 $at_traceon; }
   81128 
   81129 { set +x
   81130 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81131 at_fn_check_prepare_trace "calc.at:621"
   81132 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81133 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81134 at_status=$? at_failed=false
   81135 $at_check_filter
   81136 echo stderr:; tee stderr <"$at_stderr"
   81137 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81138 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81139 $at_failed && at_fn_log_failure
   81140 $at_traceon; }
   81141 
   81142 
   81143 
   81144 # Normalize the observed and expected error messages, depending upon the
   81145 # options.
   81146 # 1. Remove the traces from observed.
   81147 sed '/^Starting/d
   81148 /^Entering/d
   81149 /^Stack/d
   81150 /^Reading/d
   81151 /^Reducing/d
   81152 /^Return/d
   81153 /^Shifting/d
   81154 /^state/d
   81155 /^Cleanup:/d
   81156 /^Error:/d
   81157 /^Next/d
   81158 /^Now/d
   81159 /^Discarding/d
   81160 / \$[0-9$]* = /d
   81161 /^yydestructor:/d' stderr >at-stderr
   81162 mv at-stderr stderr
   81163 # 2. Create the reference error message.
   81164 cat >expout <<'_ATEOF'
   81165 1.3: syntax error, unexpected number
   81166 _ATEOF
   81167 
   81168 # 3. If locations are not used, remove them.
   81169 
   81170 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81171 
   81172 # 5. Check
   81173 { set +x
   81174 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81175 at_fn_check_prepare_trace "calc.at:621"
   81176 ( $at_check_trace; cat stderr
   81177 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81178 at_status=$? at_failed=false
   81179 $at_check_filter
   81180 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81181 $at_diff expout "$at_stdout" || at_failed=:
   81182 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81183 $at_failed && at_fn_log_failure
   81184 $at_traceon; }
   81185 
   81186 
   81187 cat >input <<'_ATEOF'
   81188 1//2
   81189 _ATEOF
   81190 
   81191 { set +x
   81192 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81193 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81194 ( $at_check_trace;  $PREPARSER ./calc input
   81195 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81196 at_status=$? at_failed=false
   81197 $at_check_filter
   81198 echo stderr:; tee stderr <"$at_stderr"
   81199 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81200 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
   81201 $at_failed && at_fn_log_failure
   81202 $at_traceon; }
   81203 
   81204 { set +x
   81205 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81206 at_fn_check_prepare_trace "calc.at:621"
   81207 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81208 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81209 at_status=$? at_failed=false
   81210 $at_check_filter
   81211 echo stderr:; tee stderr <"$at_stderr"
   81212 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81213 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81214 $at_failed && at_fn_log_failure
   81215 $at_traceon; }
   81216 
   81217 
   81218 
   81219 # Normalize the observed and expected error messages, depending upon the
   81220 # options.
   81221 # 1. Remove the traces from observed.
   81222 sed '/^Starting/d
   81223 /^Entering/d
   81224 /^Stack/d
   81225 /^Reading/d
   81226 /^Reducing/d
   81227 /^Return/d
   81228 /^Shifting/d
   81229 /^state/d
   81230 /^Cleanup:/d
   81231 /^Error:/d
   81232 /^Next/d
   81233 /^Now/d
   81234 /^Discarding/d
   81235 / \$[0-9$]* = /d
   81236 /^yydestructor:/d' stderr >at-stderr
   81237 mv at-stderr stderr
   81238 # 2. Create the reference error message.
   81239 cat >expout <<'_ATEOF'
   81240 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   81241 _ATEOF
   81242 
   81243 # 3. If locations are not used, remove them.
   81244 
   81245 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81246 
   81247 # 5. Check
   81248 { set +x
   81249 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81250 at_fn_check_prepare_trace "calc.at:621"
   81251 ( $at_check_trace; cat stderr
   81252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81253 at_status=$? at_failed=false
   81254 $at_check_filter
   81255 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81256 $at_diff expout "$at_stdout" || at_failed=:
   81257 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81258 $at_failed && at_fn_log_failure
   81259 $at_traceon; }
   81260 
   81261 
   81262 cat >input <<'_ATEOF'
   81263 error
   81264 _ATEOF
   81265 
   81266 { set +x
   81267 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81268 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81269 ( $at_check_trace;  $PREPARSER ./calc input
   81270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81271 at_status=$? at_failed=false
   81272 $at_check_filter
   81273 echo stderr:; tee stderr <"$at_stderr"
   81274 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81275 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
   81276 $at_failed && at_fn_log_failure
   81277 $at_traceon; }
   81278 
   81279 { set +x
   81280 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81281 at_fn_check_prepare_trace "calc.at:621"
   81282 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81283 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81284 at_status=$? at_failed=false
   81285 $at_check_filter
   81286 echo stderr:; tee stderr <"$at_stderr"
   81287 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81288 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81289 $at_failed && at_fn_log_failure
   81290 $at_traceon; }
   81291 
   81292 
   81293 
   81294 # Normalize the observed and expected error messages, depending upon the
   81295 # options.
   81296 # 1. Remove the traces from observed.
   81297 sed '/^Starting/d
   81298 /^Entering/d
   81299 /^Stack/d
   81300 /^Reading/d
   81301 /^Reducing/d
   81302 /^Return/d
   81303 /^Shifting/d
   81304 /^state/d
   81305 /^Cleanup:/d
   81306 /^Error:/d
   81307 /^Next/d
   81308 /^Now/d
   81309 /^Discarding/d
   81310 / \$[0-9$]* = /d
   81311 /^yydestructor:/d' stderr >at-stderr
   81312 mv at-stderr stderr
   81313 # 2. Create the reference error message.
   81314 cat >expout <<'_ATEOF'
   81315 1.1: syntax error, unexpected $undefined
   81316 _ATEOF
   81317 
   81318 # 3. If locations are not used, remove them.
   81319 
   81320 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81321 
   81322 # 5. Check
   81323 { set +x
   81324 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81325 at_fn_check_prepare_trace "calc.at:621"
   81326 ( $at_check_trace; cat stderr
   81327 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81328 at_status=$? at_failed=false
   81329 $at_check_filter
   81330 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81331 $at_diff expout "$at_stdout" || at_failed=:
   81332 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81333 $at_failed && at_fn_log_failure
   81334 $at_traceon; }
   81335 
   81336 
   81337 cat >input <<'_ATEOF'
   81338 1 = 2 = 3
   81339 _ATEOF
   81340 
   81341 { set +x
   81342 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81343 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81344 ( $at_check_trace;  $PREPARSER ./calc input
   81345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81346 at_status=$? at_failed=false
   81347 $at_check_filter
   81348 echo stderr:; tee stderr <"$at_stderr"
   81349 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81350 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
   81351 $at_failed && at_fn_log_failure
   81352 $at_traceon; }
   81353 
   81354 { set +x
   81355 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81356 at_fn_check_prepare_trace "calc.at:621"
   81357 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81358 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81359 at_status=$? at_failed=false
   81360 $at_check_filter
   81361 echo stderr:; tee stderr <"$at_stderr"
   81362 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81363 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81364 $at_failed && at_fn_log_failure
   81365 $at_traceon; }
   81366 
   81367 
   81368 
   81369 # Normalize the observed and expected error messages, depending upon the
   81370 # options.
   81371 # 1. Remove the traces from observed.
   81372 sed '/^Starting/d
   81373 /^Entering/d
   81374 /^Stack/d
   81375 /^Reading/d
   81376 /^Reducing/d
   81377 /^Return/d
   81378 /^Shifting/d
   81379 /^state/d
   81380 /^Cleanup:/d
   81381 /^Error:/d
   81382 /^Next/d
   81383 /^Now/d
   81384 /^Discarding/d
   81385 / \$[0-9$]* = /d
   81386 /^yydestructor:/d' stderr >at-stderr
   81387 mv at-stderr stderr
   81388 # 2. Create the reference error message.
   81389 cat >expout <<'_ATEOF'
   81390 1.7: syntax error, unexpected '='
   81391 _ATEOF
   81392 
   81393 # 3. If locations are not used, remove them.
   81394 
   81395 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81396 
   81397 # 5. Check
   81398 { set +x
   81399 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81400 at_fn_check_prepare_trace "calc.at:621"
   81401 ( $at_check_trace; cat stderr
   81402 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81403 at_status=$? at_failed=false
   81404 $at_check_filter
   81405 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81406 $at_diff expout "$at_stdout" || at_failed=:
   81407 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81408 $at_failed && at_fn_log_failure
   81409 $at_traceon; }
   81410 
   81411 
   81412 cat >input <<'_ATEOF'
   81413 
   81414 +1
   81415 _ATEOF
   81416 
   81417 { set +x
   81418 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81419 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81420 ( $at_check_trace;  $PREPARSER ./calc input
   81421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81422 at_status=$? at_failed=false
   81423 $at_check_filter
   81424 echo stderr:; tee stderr <"$at_stderr"
   81425 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81426 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
   81427 $at_failed && at_fn_log_failure
   81428 $at_traceon; }
   81429 
   81430 { set +x
   81431 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81432 at_fn_check_prepare_trace "calc.at:621"
   81433 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81434 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81435 at_status=$? at_failed=false
   81436 $at_check_filter
   81437 echo stderr:; tee stderr <"$at_stderr"
   81438 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81439 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81440 $at_failed && at_fn_log_failure
   81441 $at_traceon; }
   81442 
   81443 
   81444 
   81445 # Normalize the observed and expected error messages, depending upon the
   81446 # options.
   81447 # 1. Remove the traces from observed.
   81448 sed '/^Starting/d
   81449 /^Entering/d
   81450 /^Stack/d
   81451 /^Reading/d
   81452 /^Reducing/d
   81453 /^Return/d
   81454 /^Shifting/d
   81455 /^state/d
   81456 /^Cleanup:/d
   81457 /^Error:/d
   81458 /^Next/d
   81459 /^Now/d
   81460 /^Discarding/d
   81461 / \$[0-9$]* = /d
   81462 /^yydestructor:/d' stderr >at-stderr
   81463 mv at-stderr stderr
   81464 # 2. Create the reference error message.
   81465 cat >expout <<'_ATEOF'
   81466 2.1: syntax error, unexpected '+'
   81467 _ATEOF
   81468 
   81469 # 3. If locations are not used, remove them.
   81470 
   81471 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81472 
   81473 # 5. Check
   81474 { set +x
   81475 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81476 at_fn_check_prepare_trace "calc.at:621"
   81477 ( $at_check_trace; cat stderr
   81478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81479 at_status=$? at_failed=false
   81480 $at_check_filter
   81481 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81482 $at_diff expout "$at_stdout" || at_failed=:
   81483 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81484 $at_failed && at_fn_log_failure
   81485 $at_traceon; }
   81486 
   81487 
   81488 # Exercise error messages with EOF: work on an empty file.
   81489 { set +x
   81490 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc /dev/null"
   81491 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:621"
   81492 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   81493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81494 at_status=$? at_failed=false
   81495 $at_check_filter
   81496 echo stderr:; tee stderr <"$at_stderr"
   81497 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81498 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
   81499 $at_failed && at_fn_log_failure
   81500 $at_traceon; }
   81501 
   81502 { set +x
   81503 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81504 at_fn_check_prepare_trace "calc.at:621"
   81505 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81507 at_status=$? at_failed=false
   81508 $at_check_filter
   81509 echo stderr:; tee stderr <"$at_stderr"
   81510 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81511 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81512 $at_failed && at_fn_log_failure
   81513 $at_traceon; }
   81514 
   81515 
   81516 
   81517 # Normalize the observed and expected error messages, depending upon the
   81518 # options.
   81519 # 1. Remove the traces from observed.
   81520 sed '/^Starting/d
   81521 /^Entering/d
   81522 /^Stack/d
   81523 /^Reading/d
   81524 /^Reducing/d
   81525 /^Return/d
   81526 /^Shifting/d
   81527 /^state/d
   81528 /^Cleanup:/d
   81529 /^Error:/d
   81530 /^Next/d
   81531 /^Now/d
   81532 /^Discarding/d
   81533 / \$[0-9$]* = /d
   81534 /^yydestructor:/d' stderr >at-stderr
   81535 mv at-stderr stderr
   81536 # 2. Create the reference error message.
   81537 cat >expout <<'_ATEOF'
   81538 1.1: syntax error, unexpected end of input
   81539 _ATEOF
   81540 
   81541 # 3. If locations are not used, remove them.
   81542 
   81543 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81544 
   81545 # 5. Check
   81546 { set +x
   81547 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81548 at_fn_check_prepare_trace "calc.at:621"
   81549 ( $at_check_trace; cat stderr
   81550 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81551 at_status=$? at_failed=false
   81552 $at_check_filter
   81553 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81554 $at_diff expout "$at_stdout" || at_failed=:
   81555 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81556 $at_failed && at_fn_log_failure
   81557 $at_traceon; }
   81558 
   81559 
   81560 
   81561 # Exercise the error token: without it, we die at the first error,
   81562 # hence be sure to
   81563 #
   81564 # - have several errors which exercise different shift/discardings
   81565 #   - (): nothing to pop, nothing to discard
   81566 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   81567 #   - (* * *): nothing to pop, a lot to discard
   81568 #   - (1 + 2 * *): some to pop and discard
   81569 #
   81570 # - test the action associated to `error'
   81571 #
   81572 # - check the lookahead that triggers an error is not discarded
   81573 #   when we enter error recovery.  Below, the lookahead causing the
   81574 #   first error is ")", which is needed to recover from the error and
   81575 #   produce the "0" that triggers the "0 != 1" error.
   81576 #
   81577 cat >input <<'_ATEOF'
   81578 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   81579 _ATEOF
   81580 
   81581 { set +x
   81582 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81583 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81584 ( $at_check_trace;  $PREPARSER ./calc input
   81585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81586 at_status=$? at_failed=false
   81587 $at_check_filter
   81588 echo stderr:; tee stderr <"$at_stderr"
   81589 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81590 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81591 $at_failed && at_fn_log_failure
   81592 $at_traceon; }
   81593 
   81594 { set +x
   81595 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81596 at_fn_check_prepare_trace "calc.at:621"
   81597 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81598 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81599 at_status=$? at_failed=false
   81600 $at_check_filter
   81601 echo stderr:; tee stderr <"$at_stderr"
   81602 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81603 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81604 $at_failed && at_fn_log_failure
   81605 $at_traceon; }
   81606 
   81607 
   81608 
   81609 # Normalize the observed and expected error messages, depending upon the
   81610 # options.
   81611 # 1. Remove the traces from observed.
   81612 sed '/^Starting/d
   81613 /^Entering/d
   81614 /^Stack/d
   81615 /^Reading/d
   81616 /^Reducing/d
   81617 /^Return/d
   81618 /^Shifting/d
   81619 /^state/d
   81620 /^Cleanup:/d
   81621 /^Error:/d
   81622 /^Next/d
   81623 /^Now/d
   81624 /^Discarding/d
   81625 / \$[0-9$]* = /d
   81626 /^yydestructor:/d' stderr >at-stderr
   81627 mv at-stderr stderr
   81628 # 2. Create the reference error message.
   81629 cat >expout <<'_ATEOF'
   81630 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   81631 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   81632 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   81633 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   81634 calc: error: 4444 != 1
   81635 _ATEOF
   81636 
   81637 # 3. If locations are not used, remove them.
   81638 
   81639 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81640 
   81641 # 5. Check
   81642 { set +x
   81643 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81644 at_fn_check_prepare_trace "calc.at:621"
   81645 ( $at_check_trace; cat stderr
   81646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81647 at_status=$? at_failed=false
   81648 $at_check_filter
   81649 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81650 $at_diff expout "$at_stdout" || at_failed=:
   81651 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81652 $at_failed && at_fn_log_failure
   81653 $at_traceon; }
   81654 
   81655 
   81656 
   81657 # The same, but this time exercising explicitly triggered syntax errors.
   81658 # POSIX says the lookahead causing the error should not be discarded.
   81659 cat >input <<'_ATEOF'
   81660 (!) + (1 2) = 1
   81661 _ATEOF
   81662 
   81663 { set +x
   81664 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81665 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81666 ( $at_check_trace;  $PREPARSER ./calc input
   81667 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81668 at_status=$? at_failed=false
   81669 $at_check_filter
   81670 echo stderr:; tee stderr <"$at_stderr"
   81671 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81672 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81673 $at_failed && at_fn_log_failure
   81674 $at_traceon; }
   81675 
   81676 { set +x
   81677 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81678 at_fn_check_prepare_trace "calc.at:621"
   81679 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81680 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81681 at_status=$? at_failed=false
   81682 $at_check_filter
   81683 echo stderr:; tee stderr <"$at_stderr"
   81684 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81685 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81686 $at_failed && at_fn_log_failure
   81687 $at_traceon; }
   81688 
   81689 
   81690 
   81691 # Normalize the observed and expected error messages, depending upon the
   81692 # options.
   81693 # 1. Remove the traces from observed.
   81694 sed '/^Starting/d
   81695 /^Entering/d
   81696 /^Stack/d
   81697 /^Reading/d
   81698 /^Reducing/d
   81699 /^Return/d
   81700 /^Shifting/d
   81701 /^state/d
   81702 /^Cleanup:/d
   81703 /^Error:/d
   81704 /^Next/d
   81705 /^Now/d
   81706 /^Discarding/d
   81707 / \$[0-9$]* = /d
   81708 /^yydestructor:/d' stderr >at-stderr
   81709 mv at-stderr stderr
   81710 # 2. Create the reference error message.
   81711 cat >expout <<'_ATEOF'
   81712 1.10: syntax error, unexpected number
   81713 calc: error: 2222 != 1
   81714 _ATEOF
   81715 
   81716 # 3. If locations are not used, remove them.
   81717 
   81718 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81719 
   81720 # 5. Check
   81721 { set +x
   81722 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81723 at_fn_check_prepare_trace "calc.at:621"
   81724 ( $at_check_trace; cat stderr
   81725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81726 at_status=$? at_failed=false
   81727 $at_check_filter
   81728 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81729 $at_diff expout "$at_stdout" || at_failed=:
   81730 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81731 $at_failed && at_fn_log_failure
   81732 $at_traceon; }
   81733 
   81734 
   81735 cat >input <<'_ATEOF'
   81736 (- *) + (1 2) = 1
   81737 _ATEOF
   81738 
   81739 { set +x
   81740 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81741 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81742 ( $at_check_trace;  $PREPARSER ./calc input
   81743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81744 at_status=$? at_failed=false
   81745 $at_check_filter
   81746 echo stderr:; tee stderr <"$at_stderr"
   81747 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81748 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81749 $at_failed && at_fn_log_failure
   81750 $at_traceon; }
   81751 
   81752 { set +x
   81753 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81754 at_fn_check_prepare_trace "calc.at:621"
   81755 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81757 at_status=$? at_failed=false
   81758 $at_check_filter
   81759 echo stderr:; tee stderr <"$at_stderr"
   81760 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81761 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81762 $at_failed && at_fn_log_failure
   81763 $at_traceon; }
   81764 
   81765 
   81766 
   81767 # Normalize the observed and expected error messages, depending upon the
   81768 # options.
   81769 # 1. Remove the traces from observed.
   81770 sed '/^Starting/d
   81771 /^Entering/d
   81772 /^Stack/d
   81773 /^Reading/d
   81774 /^Reducing/d
   81775 /^Return/d
   81776 /^Shifting/d
   81777 /^state/d
   81778 /^Cleanup:/d
   81779 /^Error:/d
   81780 /^Next/d
   81781 /^Now/d
   81782 /^Discarding/d
   81783 / \$[0-9$]* = /d
   81784 /^yydestructor:/d' stderr >at-stderr
   81785 mv at-stderr stderr
   81786 # 2. Create the reference error message.
   81787 cat >expout <<'_ATEOF'
   81788 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   81789 1.12: syntax error, unexpected number
   81790 calc: error: 2222 != 1
   81791 _ATEOF
   81792 
   81793 # 3. If locations are not used, remove them.
   81794 
   81795 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81796 
   81797 # 5. Check
   81798 { set +x
   81799 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81800 at_fn_check_prepare_trace "calc.at:621"
   81801 ( $at_check_trace; cat stderr
   81802 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81803 at_status=$? at_failed=false
   81804 $at_check_filter
   81805 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81806 $at_diff expout "$at_stdout" || at_failed=:
   81807 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81808 $at_failed && at_fn_log_failure
   81809 $at_traceon; }
   81810 
   81811 
   81812 
   81813 # Check that yyerrok works properly: second error is not reported,
   81814 # third and fourth are.  Parse status is succesfull.
   81815 cat >input <<'_ATEOF'
   81816 (* *) + (*) + (*)
   81817 _ATEOF
   81818 
   81819 { set +x
   81820 $as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
   81821 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
   81822 ( $at_check_trace;  $PREPARSER ./calc input
   81823 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81824 at_status=$? at_failed=false
   81825 $at_check_filter
   81826 echo stderr:; tee stderr <"$at_stderr"
   81827 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81828 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81829 $at_failed && at_fn_log_failure
   81830 $at_traceon; }
   81831 
   81832 { set +x
   81833 $as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   81834 at_fn_check_prepare_trace "calc.at:621"
   81835 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   81836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81837 at_status=$? at_failed=false
   81838 $at_check_filter
   81839 echo stderr:; tee stderr <"$at_stderr"
   81840 at_fn_diff_devnull "$at_stdout" || at_failed=:
   81841 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81842 $at_failed && at_fn_log_failure
   81843 $at_traceon; }
   81844 
   81845 
   81846 
   81847 # Normalize the observed and expected error messages, depending upon the
   81848 # options.
   81849 # 1. Remove the traces from observed.
   81850 sed '/^Starting/d
   81851 /^Entering/d
   81852 /^Stack/d
   81853 /^Reading/d
   81854 /^Reducing/d
   81855 /^Return/d
   81856 /^Shifting/d
   81857 /^state/d
   81858 /^Cleanup:/d
   81859 /^Error:/d
   81860 /^Next/d
   81861 /^Now/d
   81862 /^Discarding/d
   81863 / \$[0-9$]* = /d
   81864 /^yydestructor:/d' stderr >at-stderr
   81865 mv at-stderr stderr
   81866 # 2. Create the reference error message.
   81867 cat >expout <<'_ATEOF'
   81868 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   81869 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   81870 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   81871 _ATEOF
   81872 
   81873 # 3. If locations are not used, remove them.
   81874 
   81875 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   81876 
   81877 # 5. Check
   81878 { set +x
   81879 $as_echo "$at_srcdir/calc.at:621: cat stderr"
   81880 at_fn_check_prepare_trace "calc.at:621"
   81881 ( $at_check_trace; cat stderr
   81882 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   81883 at_status=$? at_failed=false
   81884 $at_check_filter
   81885 at_fn_diff_devnull "$at_stderr" || at_failed=:
   81886 $at_diff expout "$at_stdout" || at_failed=:
   81887 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
   81888 $at_failed && at_fn_log_failure
   81889 $at_traceon; }
   81890 
   81891 
   81892 
   81893 
   81894 
   81895   set +x
   81896   $at_times_p && times >"$at_times_file"
   81897 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   81898 read at_status <"$at_status_file"
   81899 #AT_STOP_217
   81900 #AT_START_218
   81901 at_fn_group_banner 218 'calc.at:638' \
   81902   "Calculator %glr-parser " "                        " 12
   81903 at_xfail=no
   81904 (
   81905   $as_echo "218. $at_setup_line: testing $at_desc ..."
   81906   $at_traceon
   81907 
   81908 
   81909 
   81910 
   81911 
   81912 
   81913 
   81914 
   81915 
   81916 
   81917 cat >calc.y <<'_ATEOF'
   81918 %code top {
   81919 #include <config.h>
   81920 /* We don't need perfect functions for these tests. */
   81921 #undef malloc
   81922 #undef memcmp
   81923 #undef realloc
   81924 }
   81925 
   81926 /* Infix notation calculator--calc */
   81927 %glr-parser
   81928 
   81929 %code requires
   81930 {
   81931 
   81932   /* Exercise pre-prologue dependency to %union.  */
   81933   typedef int semantic_value;
   81934 }
   81935 
   81936 /* Exercise %union. */
   81937 %union
   81938 {
   81939   semantic_value ival;
   81940 };
   81941 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   81942 
   81943 %code provides
   81944 {
   81945   #include <stdio.h>
   81946   /* The input.  */
   81947   extern FILE *input;
   81948   extern semantic_value global_result;
   81949   extern int global_count;
   81950 }
   81951 
   81952 %code
   81953 {
   81954 #include <assert.h>
   81955 #include <string.h>
   81956 #define USE(Var)
   81957 
   81958 FILE *input;
   81959 static int power (int base, int exponent);
   81960 
   81961 static void yyerror ( const char *msg);
   81962 int yylex (void);
   81963 }
   81964 
   81965 
   81966 
   81967 /* Bison Declarations */
   81968 %token CALC_EOF 0 "end of input"
   81969 %token <ival> NUM "number"
   81970 %type  <ival> exp
   81971 
   81972 %nonassoc '=' /* comparison            */
   81973 %left '-' '+'
   81974 %left '*' '/'
   81975 %left NEG     /* negation--unary minus */
   81976 %right '^'    /* exponentiation        */
   81977 
   81978 /* Grammar follows */
   81979 %%
   81980 input:
   81981   line
   81982 | input line         {  }
   81983 ;
   81984 
   81985 line:
   81986   '\n'
   81987 | exp '\n'           { USE ($1); }
   81988 ;
   81989 
   81990 exp:
   81991   NUM                { $$ = $1;             }
   81992 | exp '=' exp
   81993   {
   81994     if ($1 != $3)
   81995       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   81996     $$ = $1;
   81997   }
   81998 | exp '+' exp        { $$ = $1 + $3;        }
   81999 | exp '-' exp        { $$ = $1 - $3;        }
   82000 | exp '*' exp        { $$ = $1 * $3;        }
   82001 | exp '/' exp        { $$ = $1 / $3;        }
   82002 | '-' exp  %prec NEG { $$ = -$2;            }
   82003 | exp '^' exp        { $$ = power ($1, $3); }
   82004 | '(' exp ')'        { $$ = $2;             }
   82005 | '(' error ')'      { $$ = 1111; yyerrok;  }
   82006 | '!'                { $$ = 0; YYERROR;     }
   82007 | '-' error          { $$ = 0; YYERROR;     }
   82008 ;
   82009 %%
   82010 
   82011 static int
   82012 power (int base, int exponent)
   82013 {
   82014   int res = 1;
   82015   assert (0 <= exponent);
   82016   for (/* Niente */; exponent; --exponent)
   82017     res *= base;
   82018   return res;
   82019 }
   82020 
   82021 
   82022 #include <stdio.h>
   82023 /* A C error reporting function.  */
   82024 static
   82025 void yyerror ( const char *msg)
   82026 {
   82027   fprintf (stderr, "%s\n", msg);
   82028 }
   82029 #include <ctype.h>
   82030 
   82031 int yylex (void);
   82032 static int get_char (void);
   82033 static void unget_char ( int c);
   82034 
   82035 
   82036 static int
   82037 get_char (void)
   82038 {
   82039   int res = getc (input);
   82040   ;
   82041 
   82042   return res;
   82043 }
   82044 
   82045 static void
   82046 unget_char ( int c)
   82047 {
   82048   ;
   82049 
   82050   ungetc (c, input);
   82051 }
   82052 
   82053 static int
   82054 read_signed_integer (void)
   82055 {
   82056   int c = get_char ();
   82057   int sign = 1;
   82058   int n = 0;
   82059 
   82060   ;
   82061   if (c == '-')
   82062     {
   82063       c = get_char ();
   82064       sign = -1;
   82065     }
   82066 
   82067   while (isdigit (c))
   82068     {
   82069       n = 10 * n + (c - '0');
   82070       c = get_char ();
   82071     }
   82072 
   82073   unget_char ( c);
   82074 
   82075   return sign * n;
   82076 }
   82077 
   82078 
   82079 /*---------------------------------------------------------------.
   82080 | Lexical analyzer returns an integer on the stack and the token |
   82081 | NUM, or the ASCII character read if not a number.  Skips all   |
   82082 | blanks and tabs, returns 0 for EOF.                            |
   82083 `---------------------------------------------------------------*/
   82084 
   82085 int yylex (void)
   82086 {
   82087   int c;
   82088   /* Skip current token, then white spaces.  */
   82089   do
   82090     {
   82091 
   82092     }
   82093   while ((c = get_char ()) == ' ' || c == '\t');
   82094 
   82095   /* process numbers   */
   82096   if (c == '.' || isdigit (c))
   82097     {
   82098       unget_char ( c);
   82099       (yylval).ival = read_signed_integer ();
   82100       return NUM;
   82101     }
   82102 
   82103   /* Return end-of-file.  */
   82104   if (c == EOF)
   82105     return CALC_EOF;
   82106 
   82107   /* Return single chars. */
   82108   return c;
   82109 }
   82110 
   82111 #include <assert.h>
   82112 #if HAVE_UNISTD_H
   82113 # include <unistd.h>
   82114 #else
   82115 # undef alarm
   82116 # define alarm(seconds) /* empty */
   82117 #endif
   82118 
   82119 
   82120 
   82121 semantic_value global_result = 0;
   82122 int global_count = 0;
   82123 
   82124 /* A C main function.  */
   82125 int
   82126 main (int argc, const char **argv)
   82127 {
   82128   semantic_value result = 0;
   82129   int count = 0;
   82130   int status;
   82131 
   82132   /* This used to be alarm (10), but that isn't enough time for
   82133      a July 1995 vintage DEC Alphastation 200 4/100 system,
   82134      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   82135   alarm (100);
   82136 
   82137   if (argc == 2)
   82138     input = fopen (argv[1], "r");
   82139   else
   82140     input = stdin;
   82141 
   82142   if (!input)
   82143     {
   82144       perror (argv[1]);
   82145       return 3;
   82146     }
   82147 
   82148 
   82149   status = yyparse ();
   82150   if (fclose (input))
   82151     perror ("fclose");
   82152   assert (global_result == result);
   82153   assert (global_count == count);
   82154   return status;
   82155 }
   82156 _ATEOF
   82157 
   82158 
   82159 
   82160 
   82161 
   82162 
   82163 
   82164 
   82165 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   82166   at_save_special_files
   82167   mkdir xml-tests
   82168     # Don't combine these Bison invocations since we want to be sure that
   82169   # --report=all isn't required to get the full XML file.
   82170   { set +x
   82171 $as_echo "$at_srcdir/calc.at:638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   82172                   --graph=xml-tests/test.dot -o calc.c calc.y"
   82173 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:638"
   82174 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   82175                   --graph=xml-tests/test.dot -o calc.c calc.y
   82176 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82177 at_status=$? at_failed=false
   82178 $at_check_filter
   82179 echo stderr:; cat "$at_stderr"
   82180 echo stdout:; cat "$at_stdout"
   82181 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82182 $at_failed && at_fn_log_failure
   82183 $at_traceon; }
   82184 
   82185   { set +x
   82186 $as_echo "$at_srcdir/calc.at:638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   82187 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:638"
   82188 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   82189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82190 at_status=$? at_failed=false
   82191 $at_check_filter
   82192 echo stderr:; cat "$at_stderr"
   82193 echo stdout:; cat "$at_stdout"
   82194 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82195 $at_failed && at_fn_log_failure
   82196 $at_traceon; }
   82197 
   82198     cp xml-tests/test.output expout
   82199   { set +x
   82200 $as_echo "$at_srcdir/calc.at:638: \$XSLTPROC \\
   82201              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   82202              xml-tests/test.xml"
   82203 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:638"
   82204 ( $at_check_trace; $XSLTPROC \
   82205              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   82206              xml-tests/test.xml
   82207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82208 at_status=$? at_failed=false
   82209 $at_check_filter
   82210 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82211 $at_diff expout "$at_stdout" || at_failed=:
   82212 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82213 $at_failed && at_fn_log_failure
   82214 $at_traceon; }
   82215 
   82216   sort xml-tests/test.dot > expout
   82217   { set +x
   82218 $as_echo "$at_srcdir/calc.at:638: \$XSLTPROC \\
   82219              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   82220              xml-tests/test.xml | sort"
   82221 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:638"
   82222 ( $at_check_trace; $XSLTPROC \
   82223              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   82224              xml-tests/test.xml | sort
   82225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82226 at_status=$? at_failed=false
   82227 $at_check_filter
   82228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82229 $at_diff expout "$at_stdout" || at_failed=:
   82230 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82231 $at_failed && at_fn_log_failure
   82232 $at_traceon; }
   82233 
   82234   rm -rf xml-tests expout
   82235   at_restore_special_files
   82236 fi
   82237 { set +x
   82238 $as_echo "$at_srcdir/calc.at:638: bison -o calc.c calc.y"
   82239 at_fn_check_prepare_trace "calc.at:638"
   82240 ( $at_check_trace; bison -o calc.c calc.y
   82241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82242 at_status=$? at_failed=false
   82243 $at_check_filter
   82244 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82245 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82246 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82247 $at_failed && at_fn_log_failure
   82248 $at_traceon; }
   82249 
   82250 
   82251    { set +x
   82252 $as_echo "$at_srcdir/calc.at:638: \$BISON_C_WORKS"
   82253 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:638"
   82254 ( $at_check_trace; $BISON_C_WORKS
   82255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82256 at_status=$? at_failed=false
   82257 $at_check_filter
   82258 echo stderr:; cat "$at_stderr"
   82259 echo stdout:; cat "$at_stdout"
   82260 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82261 $at_failed && at_fn_log_failure
   82262 $at_traceon; }
   82263 
   82264 { set +x
   82265 $as_echo "$at_srcdir/calc.at:638: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   82266 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:638"
   82267 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   82268 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82269 at_status=$? at_failed=false
   82270 $at_check_filter
   82271 echo stderr:; cat "$at_stderr"
   82272 echo stdout:; cat "$at_stdout"
   82273 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82274 $at_failed && at_fn_log_failure
   82275 $at_traceon; }
   82276 
   82277 
   82278 { set +x
   82279 $as_echo "$at_srcdir/calc.at:638: \$PERL -ne '
   82280   chomp;
   82281   print \"\$.: {\$_}\\n\"
   82282     if (# No starting/ending empty lines.
   82283         (eof || \$. == 1) && /^\\s*\$/
   82284         # No trailing space.  FIXME: not ready for \"maint\".
   82285         # || /\\s\$/
   82286         )' calc.c
   82287 "
   82288 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:638"
   82289 ( $at_check_trace; $PERL -ne '
   82290   chomp;
   82291   print "$.: {$_}\n"
   82292     if (# No starting/ending empty lines.
   82293         (eof || $. == 1) && /^\s*$/
   82294         # No trailing space.  FIXME: not ready for "maint".
   82295         # || /\s$/
   82296         )' calc.c
   82297 
   82298 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82299 at_status=$? at_failed=false
   82300 $at_check_filter
   82301 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82302 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82303 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82304 $at_failed && at_fn_log_failure
   82305 $at_traceon; }
   82306 
   82307 
   82308 
   82309 # Test the priorities.
   82310 cat >input <<'_ATEOF'
   82311 1 + 2 * 3 = 7
   82312 1 + 2 * -3 = -5
   82313 
   82314 -1^2 = -1
   82315 (-1)^2 = 1
   82316 
   82317 ---1 = -1
   82318 
   82319 1 - 2 - 3 = -4
   82320 1 - (2 - 3) = 2
   82321 
   82322 2^2^3 = 256
   82323 (2^2)^3 = 64
   82324 _ATEOF
   82325 
   82326 { set +x
   82327 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82328 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82329 ( $at_check_trace;  $PREPARSER ./calc input
   82330 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82331 at_status=$? at_failed=false
   82332 $at_check_filter
   82333 echo stderr:; tee stderr <"$at_stderr"
   82334 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82335 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82336 $at_failed && at_fn_log_failure
   82337 $at_traceon; }
   82338 
   82339 { set +x
   82340 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82341 at_fn_check_prepare_trace "calc.at:638"
   82342 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82343 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82344 at_status=$? at_failed=false
   82345 $at_check_filter
   82346 echo stderr:; tee stderr <"$at_stderr"
   82347 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82348 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82349 $at_failed && at_fn_log_failure
   82350 $at_traceon; }
   82351 
   82352 
   82353 
   82354 
   82355 # Some syntax errors.
   82356 cat >input <<'_ATEOF'
   82357 1 2
   82358 _ATEOF
   82359 
   82360 { set +x
   82361 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82362 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82363 ( $at_check_trace;  $PREPARSER ./calc input
   82364 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82365 at_status=$? at_failed=false
   82366 $at_check_filter
   82367 echo stderr:; tee stderr <"$at_stderr"
   82368 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82369 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638"
   82370 $at_failed && at_fn_log_failure
   82371 $at_traceon; }
   82372 
   82373 { set +x
   82374 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82375 at_fn_check_prepare_trace "calc.at:638"
   82376 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82377 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82378 at_status=$? at_failed=false
   82379 $at_check_filter
   82380 echo stderr:; tee stderr <"$at_stderr"
   82381 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82382 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82383 $at_failed && at_fn_log_failure
   82384 $at_traceon; }
   82385 
   82386 
   82387 
   82388 # Normalize the observed and expected error messages, depending upon the
   82389 # options.
   82390 # 1. Remove the traces from observed.
   82391 sed '/^Starting/d
   82392 /^Entering/d
   82393 /^Stack/d
   82394 /^Reading/d
   82395 /^Reducing/d
   82396 /^Return/d
   82397 /^Shifting/d
   82398 /^state/d
   82399 /^Cleanup:/d
   82400 /^Error:/d
   82401 /^Next/d
   82402 /^Now/d
   82403 /^Discarding/d
   82404 / \$[0-9$]* = /d
   82405 /^yydestructor:/d' stderr >at-stderr
   82406 mv at-stderr stderr
   82407 # 2. Create the reference error message.
   82408 cat >expout <<'_ATEOF'
   82409 1.3: syntax error, unexpected number
   82410 _ATEOF
   82411 
   82412 # 3. If locations are not used, remove them.
   82413 sed 's/^[-0-9.]*: //' expout >at-expout
   82414 mv at-expout expout
   82415 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82416 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82417 mv at-expout expout
   82418 # 5. Check
   82419 { set +x
   82420 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82421 at_fn_check_prepare_trace "calc.at:638"
   82422 ( $at_check_trace; cat stderr
   82423 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82424 at_status=$? at_failed=false
   82425 $at_check_filter
   82426 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82427 $at_diff expout "$at_stdout" || at_failed=:
   82428 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82429 $at_failed && at_fn_log_failure
   82430 $at_traceon; }
   82431 
   82432 
   82433 cat >input <<'_ATEOF'
   82434 1//2
   82435 _ATEOF
   82436 
   82437 { set +x
   82438 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82439 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82440 ( $at_check_trace;  $PREPARSER ./calc input
   82441 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82442 at_status=$? at_failed=false
   82443 $at_check_filter
   82444 echo stderr:; tee stderr <"$at_stderr"
   82445 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82446 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638"
   82447 $at_failed && at_fn_log_failure
   82448 $at_traceon; }
   82449 
   82450 { set +x
   82451 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82452 at_fn_check_prepare_trace "calc.at:638"
   82453 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82455 at_status=$? at_failed=false
   82456 $at_check_filter
   82457 echo stderr:; tee stderr <"$at_stderr"
   82458 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82459 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82460 $at_failed && at_fn_log_failure
   82461 $at_traceon; }
   82462 
   82463 
   82464 
   82465 # Normalize the observed and expected error messages, depending upon the
   82466 # options.
   82467 # 1. Remove the traces from observed.
   82468 sed '/^Starting/d
   82469 /^Entering/d
   82470 /^Stack/d
   82471 /^Reading/d
   82472 /^Reducing/d
   82473 /^Return/d
   82474 /^Shifting/d
   82475 /^state/d
   82476 /^Cleanup:/d
   82477 /^Error:/d
   82478 /^Next/d
   82479 /^Now/d
   82480 /^Discarding/d
   82481 / \$[0-9$]* = /d
   82482 /^yydestructor:/d' stderr >at-stderr
   82483 mv at-stderr stderr
   82484 # 2. Create the reference error message.
   82485 cat >expout <<'_ATEOF'
   82486 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   82487 _ATEOF
   82488 
   82489 # 3. If locations are not used, remove them.
   82490 sed 's/^[-0-9.]*: //' expout >at-expout
   82491 mv at-expout expout
   82492 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82493 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82494 mv at-expout expout
   82495 # 5. Check
   82496 { set +x
   82497 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82498 at_fn_check_prepare_trace "calc.at:638"
   82499 ( $at_check_trace; cat stderr
   82500 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82501 at_status=$? at_failed=false
   82502 $at_check_filter
   82503 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82504 $at_diff expout "$at_stdout" || at_failed=:
   82505 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82506 $at_failed && at_fn_log_failure
   82507 $at_traceon; }
   82508 
   82509 
   82510 cat >input <<'_ATEOF'
   82511 error
   82512 _ATEOF
   82513 
   82514 { set +x
   82515 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82516 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82517 ( $at_check_trace;  $PREPARSER ./calc input
   82518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82519 at_status=$? at_failed=false
   82520 $at_check_filter
   82521 echo stderr:; tee stderr <"$at_stderr"
   82522 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82523 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638"
   82524 $at_failed && at_fn_log_failure
   82525 $at_traceon; }
   82526 
   82527 { set +x
   82528 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82529 at_fn_check_prepare_trace "calc.at:638"
   82530 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82531 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82532 at_status=$? at_failed=false
   82533 $at_check_filter
   82534 echo stderr:; tee stderr <"$at_stderr"
   82535 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82536 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82537 $at_failed && at_fn_log_failure
   82538 $at_traceon; }
   82539 
   82540 
   82541 
   82542 # Normalize the observed and expected error messages, depending upon the
   82543 # options.
   82544 # 1. Remove the traces from observed.
   82545 sed '/^Starting/d
   82546 /^Entering/d
   82547 /^Stack/d
   82548 /^Reading/d
   82549 /^Reducing/d
   82550 /^Return/d
   82551 /^Shifting/d
   82552 /^state/d
   82553 /^Cleanup:/d
   82554 /^Error:/d
   82555 /^Next/d
   82556 /^Now/d
   82557 /^Discarding/d
   82558 / \$[0-9$]* = /d
   82559 /^yydestructor:/d' stderr >at-stderr
   82560 mv at-stderr stderr
   82561 # 2. Create the reference error message.
   82562 cat >expout <<'_ATEOF'
   82563 1.1: syntax error, unexpected $undefined
   82564 _ATEOF
   82565 
   82566 # 3. If locations are not used, remove them.
   82567 sed 's/^[-0-9.]*: //' expout >at-expout
   82568 mv at-expout expout
   82569 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82570 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82571 mv at-expout expout
   82572 # 5. Check
   82573 { set +x
   82574 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82575 at_fn_check_prepare_trace "calc.at:638"
   82576 ( $at_check_trace; cat stderr
   82577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82578 at_status=$? at_failed=false
   82579 $at_check_filter
   82580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82581 $at_diff expout "$at_stdout" || at_failed=:
   82582 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82583 $at_failed && at_fn_log_failure
   82584 $at_traceon; }
   82585 
   82586 
   82587 cat >input <<'_ATEOF'
   82588 1 = 2 = 3
   82589 _ATEOF
   82590 
   82591 { set +x
   82592 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82593 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82594 ( $at_check_trace;  $PREPARSER ./calc input
   82595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82596 at_status=$? at_failed=false
   82597 $at_check_filter
   82598 echo stderr:; tee stderr <"$at_stderr"
   82599 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82600 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638"
   82601 $at_failed && at_fn_log_failure
   82602 $at_traceon; }
   82603 
   82604 { set +x
   82605 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82606 at_fn_check_prepare_trace "calc.at:638"
   82607 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82609 at_status=$? at_failed=false
   82610 $at_check_filter
   82611 echo stderr:; tee stderr <"$at_stderr"
   82612 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82613 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82614 $at_failed && at_fn_log_failure
   82615 $at_traceon; }
   82616 
   82617 
   82618 
   82619 # Normalize the observed and expected error messages, depending upon the
   82620 # options.
   82621 # 1. Remove the traces from observed.
   82622 sed '/^Starting/d
   82623 /^Entering/d
   82624 /^Stack/d
   82625 /^Reading/d
   82626 /^Reducing/d
   82627 /^Return/d
   82628 /^Shifting/d
   82629 /^state/d
   82630 /^Cleanup:/d
   82631 /^Error:/d
   82632 /^Next/d
   82633 /^Now/d
   82634 /^Discarding/d
   82635 / \$[0-9$]* = /d
   82636 /^yydestructor:/d' stderr >at-stderr
   82637 mv at-stderr stderr
   82638 # 2. Create the reference error message.
   82639 cat >expout <<'_ATEOF'
   82640 1.7: syntax error, unexpected '='
   82641 _ATEOF
   82642 
   82643 # 3. If locations are not used, remove them.
   82644 sed 's/^[-0-9.]*: //' expout >at-expout
   82645 mv at-expout expout
   82646 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82647 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82648 mv at-expout expout
   82649 # 5. Check
   82650 { set +x
   82651 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82652 at_fn_check_prepare_trace "calc.at:638"
   82653 ( $at_check_trace; cat stderr
   82654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82655 at_status=$? at_failed=false
   82656 $at_check_filter
   82657 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82658 $at_diff expout "$at_stdout" || at_failed=:
   82659 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82660 $at_failed && at_fn_log_failure
   82661 $at_traceon; }
   82662 
   82663 
   82664 cat >input <<'_ATEOF'
   82665 
   82666 +1
   82667 _ATEOF
   82668 
   82669 { set +x
   82670 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82671 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82672 ( $at_check_trace;  $PREPARSER ./calc input
   82673 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82674 at_status=$? at_failed=false
   82675 $at_check_filter
   82676 echo stderr:; tee stderr <"$at_stderr"
   82677 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82678 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638"
   82679 $at_failed && at_fn_log_failure
   82680 $at_traceon; }
   82681 
   82682 { set +x
   82683 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82684 at_fn_check_prepare_trace "calc.at:638"
   82685 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82687 at_status=$? at_failed=false
   82688 $at_check_filter
   82689 echo stderr:; tee stderr <"$at_stderr"
   82690 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82691 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82692 $at_failed && at_fn_log_failure
   82693 $at_traceon; }
   82694 
   82695 
   82696 
   82697 # Normalize the observed and expected error messages, depending upon the
   82698 # options.
   82699 # 1. Remove the traces from observed.
   82700 sed '/^Starting/d
   82701 /^Entering/d
   82702 /^Stack/d
   82703 /^Reading/d
   82704 /^Reducing/d
   82705 /^Return/d
   82706 /^Shifting/d
   82707 /^state/d
   82708 /^Cleanup:/d
   82709 /^Error:/d
   82710 /^Next/d
   82711 /^Now/d
   82712 /^Discarding/d
   82713 / \$[0-9$]* = /d
   82714 /^yydestructor:/d' stderr >at-stderr
   82715 mv at-stderr stderr
   82716 # 2. Create the reference error message.
   82717 cat >expout <<'_ATEOF'
   82718 2.1: syntax error, unexpected '+'
   82719 _ATEOF
   82720 
   82721 # 3. If locations are not used, remove them.
   82722 sed 's/^[-0-9.]*: //' expout >at-expout
   82723 mv at-expout expout
   82724 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82725 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82726 mv at-expout expout
   82727 # 5. Check
   82728 { set +x
   82729 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82730 at_fn_check_prepare_trace "calc.at:638"
   82731 ( $at_check_trace; cat stderr
   82732 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82733 at_status=$? at_failed=false
   82734 $at_check_filter
   82735 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82736 $at_diff expout "$at_stdout" || at_failed=:
   82737 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82738 $at_failed && at_fn_log_failure
   82739 $at_traceon; }
   82740 
   82741 
   82742 # Exercise error messages with EOF: work on an empty file.
   82743 { set +x
   82744 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc /dev/null"
   82745 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:638"
   82746 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   82747 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82748 at_status=$? at_failed=false
   82749 $at_check_filter
   82750 echo stderr:; tee stderr <"$at_stderr"
   82751 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82752 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638"
   82753 $at_failed && at_fn_log_failure
   82754 $at_traceon; }
   82755 
   82756 { set +x
   82757 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82758 at_fn_check_prepare_trace "calc.at:638"
   82759 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82761 at_status=$? at_failed=false
   82762 $at_check_filter
   82763 echo stderr:; tee stderr <"$at_stderr"
   82764 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82765 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82766 $at_failed && at_fn_log_failure
   82767 $at_traceon; }
   82768 
   82769 
   82770 
   82771 # Normalize the observed and expected error messages, depending upon the
   82772 # options.
   82773 # 1. Remove the traces from observed.
   82774 sed '/^Starting/d
   82775 /^Entering/d
   82776 /^Stack/d
   82777 /^Reading/d
   82778 /^Reducing/d
   82779 /^Return/d
   82780 /^Shifting/d
   82781 /^state/d
   82782 /^Cleanup:/d
   82783 /^Error:/d
   82784 /^Next/d
   82785 /^Now/d
   82786 /^Discarding/d
   82787 / \$[0-9$]* = /d
   82788 /^yydestructor:/d' stderr >at-stderr
   82789 mv at-stderr stderr
   82790 # 2. Create the reference error message.
   82791 cat >expout <<'_ATEOF'
   82792 1.1: syntax error, unexpected end of input
   82793 _ATEOF
   82794 
   82795 # 3. If locations are not used, remove them.
   82796 sed 's/^[-0-9.]*: //' expout >at-expout
   82797 mv at-expout expout
   82798 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82799 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82800 mv at-expout expout
   82801 # 5. Check
   82802 { set +x
   82803 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82804 at_fn_check_prepare_trace "calc.at:638"
   82805 ( $at_check_trace; cat stderr
   82806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82807 at_status=$? at_failed=false
   82808 $at_check_filter
   82809 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82810 $at_diff expout "$at_stdout" || at_failed=:
   82811 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82812 $at_failed && at_fn_log_failure
   82813 $at_traceon; }
   82814 
   82815 
   82816 
   82817 # Exercise the error token: without it, we die at the first error,
   82818 # hence be sure to
   82819 #
   82820 # - have several errors which exercise different shift/discardings
   82821 #   - (): nothing to pop, nothing to discard
   82822 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   82823 #   - (* * *): nothing to pop, a lot to discard
   82824 #   - (1 + 2 * *): some to pop and discard
   82825 #
   82826 # - test the action associated to `error'
   82827 #
   82828 # - check the lookahead that triggers an error is not discarded
   82829 #   when we enter error recovery.  Below, the lookahead causing the
   82830 #   first error is ")", which is needed to recover from the error and
   82831 #   produce the "0" that triggers the "0 != 1" error.
   82832 #
   82833 cat >input <<'_ATEOF'
   82834 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   82835 _ATEOF
   82836 
   82837 { set +x
   82838 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82839 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82840 ( $at_check_trace;  $PREPARSER ./calc input
   82841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82842 at_status=$? at_failed=false
   82843 $at_check_filter
   82844 echo stderr:; tee stderr <"$at_stderr"
   82845 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82846 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82847 $at_failed && at_fn_log_failure
   82848 $at_traceon; }
   82849 
   82850 { set +x
   82851 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82852 at_fn_check_prepare_trace "calc.at:638"
   82853 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82855 at_status=$? at_failed=false
   82856 $at_check_filter
   82857 echo stderr:; tee stderr <"$at_stderr"
   82858 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82859 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82860 $at_failed && at_fn_log_failure
   82861 $at_traceon; }
   82862 
   82863 
   82864 
   82865 # Normalize the observed and expected error messages, depending upon the
   82866 # options.
   82867 # 1. Remove the traces from observed.
   82868 sed '/^Starting/d
   82869 /^Entering/d
   82870 /^Stack/d
   82871 /^Reading/d
   82872 /^Reducing/d
   82873 /^Return/d
   82874 /^Shifting/d
   82875 /^state/d
   82876 /^Cleanup:/d
   82877 /^Error:/d
   82878 /^Next/d
   82879 /^Now/d
   82880 /^Discarding/d
   82881 / \$[0-9$]* = /d
   82882 /^yydestructor:/d' stderr >at-stderr
   82883 mv at-stderr stderr
   82884 # 2. Create the reference error message.
   82885 cat >expout <<'_ATEOF'
   82886 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   82887 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   82888 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   82889 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   82890 calc: error: 4444 != 1
   82891 _ATEOF
   82892 
   82893 # 3. If locations are not used, remove them.
   82894 sed 's/^[-0-9.]*: //' expout >at-expout
   82895 mv at-expout expout
   82896 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82897 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82898 mv at-expout expout
   82899 # 5. Check
   82900 { set +x
   82901 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82902 at_fn_check_prepare_trace "calc.at:638"
   82903 ( $at_check_trace; cat stderr
   82904 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82905 at_status=$? at_failed=false
   82906 $at_check_filter
   82907 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82908 $at_diff expout "$at_stdout" || at_failed=:
   82909 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82910 $at_failed && at_fn_log_failure
   82911 $at_traceon; }
   82912 
   82913 
   82914 
   82915 # The same, but this time exercising explicitly triggered syntax errors.
   82916 # POSIX says the lookahead causing the error should not be discarded.
   82917 cat >input <<'_ATEOF'
   82918 (!) + (1 2) = 1
   82919 _ATEOF
   82920 
   82921 { set +x
   82922 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   82923 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   82924 ( $at_check_trace;  $PREPARSER ./calc input
   82925 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82926 at_status=$? at_failed=false
   82927 $at_check_filter
   82928 echo stderr:; tee stderr <"$at_stderr"
   82929 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82930 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82931 $at_failed && at_fn_log_failure
   82932 $at_traceon; }
   82933 
   82934 { set +x
   82935 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   82936 at_fn_check_prepare_trace "calc.at:638"
   82937 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   82938 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82939 at_status=$? at_failed=false
   82940 $at_check_filter
   82941 echo stderr:; tee stderr <"$at_stderr"
   82942 at_fn_diff_devnull "$at_stdout" || at_failed=:
   82943 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82944 $at_failed && at_fn_log_failure
   82945 $at_traceon; }
   82946 
   82947 
   82948 
   82949 # Normalize the observed and expected error messages, depending upon the
   82950 # options.
   82951 # 1. Remove the traces from observed.
   82952 sed '/^Starting/d
   82953 /^Entering/d
   82954 /^Stack/d
   82955 /^Reading/d
   82956 /^Reducing/d
   82957 /^Return/d
   82958 /^Shifting/d
   82959 /^state/d
   82960 /^Cleanup:/d
   82961 /^Error:/d
   82962 /^Next/d
   82963 /^Now/d
   82964 /^Discarding/d
   82965 / \$[0-9$]* = /d
   82966 /^yydestructor:/d' stderr >at-stderr
   82967 mv at-stderr stderr
   82968 # 2. Create the reference error message.
   82969 cat >expout <<'_ATEOF'
   82970 1.10: syntax error, unexpected number
   82971 calc: error: 2222 != 1
   82972 _ATEOF
   82973 
   82974 # 3. If locations are not used, remove them.
   82975 sed 's/^[-0-9.]*: //' expout >at-expout
   82976 mv at-expout expout
   82977 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   82978 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   82979 mv at-expout expout
   82980 # 5. Check
   82981 { set +x
   82982 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   82983 at_fn_check_prepare_trace "calc.at:638"
   82984 ( $at_check_trace; cat stderr
   82985 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   82986 at_status=$? at_failed=false
   82987 $at_check_filter
   82988 at_fn_diff_devnull "$at_stderr" || at_failed=:
   82989 $at_diff expout "$at_stdout" || at_failed=:
   82990 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   82991 $at_failed && at_fn_log_failure
   82992 $at_traceon; }
   82993 
   82994 
   82995 cat >input <<'_ATEOF'
   82996 (- *) + (1 2) = 1
   82997 _ATEOF
   82998 
   82999 { set +x
   83000 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   83001 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   83002 ( $at_check_trace;  $PREPARSER ./calc input
   83003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83004 at_status=$? at_failed=false
   83005 $at_check_filter
   83006 echo stderr:; tee stderr <"$at_stderr"
   83007 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83008 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   83009 $at_failed && at_fn_log_failure
   83010 $at_traceon; }
   83011 
   83012 { set +x
   83013 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83014 at_fn_check_prepare_trace "calc.at:638"
   83015 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83017 at_status=$? at_failed=false
   83018 $at_check_filter
   83019 echo stderr:; tee stderr <"$at_stderr"
   83020 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83021 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   83022 $at_failed && at_fn_log_failure
   83023 $at_traceon; }
   83024 
   83025 
   83026 
   83027 # Normalize the observed and expected error messages, depending upon the
   83028 # options.
   83029 # 1. Remove the traces from observed.
   83030 sed '/^Starting/d
   83031 /^Entering/d
   83032 /^Stack/d
   83033 /^Reading/d
   83034 /^Reducing/d
   83035 /^Return/d
   83036 /^Shifting/d
   83037 /^state/d
   83038 /^Cleanup:/d
   83039 /^Error:/d
   83040 /^Next/d
   83041 /^Now/d
   83042 /^Discarding/d
   83043 / \$[0-9$]* = /d
   83044 /^yydestructor:/d' stderr >at-stderr
   83045 mv at-stderr stderr
   83046 # 2. Create the reference error message.
   83047 cat >expout <<'_ATEOF'
   83048 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   83049 1.12: syntax error, unexpected number
   83050 calc: error: 2222 != 1
   83051 _ATEOF
   83052 
   83053 # 3. If locations are not used, remove them.
   83054 sed 's/^[-0-9.]*: //' expout >at-expout
   83055 mv at-expout expout
   83056 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   83057 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   83058 mv at-expout expout
   83059 # 5. Check
   83060 { set +x
   83061 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   83062 at_fn_check_prepare_trace "calc.at:638"
   83063 ( $at_check_trace; cat stderr
   83064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83065 at_status=$? at_failed=false
   83066 $at_check_filter
   83067 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83068 $at_diff expout "$at_stdout" || at_failed=:
   83069 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   83070 $at_failed && at_fn_log_failure
   83071 $at_traceon; }
   83072 
   83073 
   83074 
   83075 # Check that yyerrok works properly: second error is not reported,
   83076 # third and fourth are.  Parse status is succesfull.
   83077 cat >input <<'_ATEOF'
   83078 (* *) + (*) + (*)
   83079 _ATEOF
   83080 
   83081 { set +x
   83082 $as_echo "$at_srcdir/calc.at:638:  \$PREPARSER ./calc input"
   83083 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638"
   83084 ( $at_check_trace;  $PREPARSER ./calc input
   83085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83086 at_status=$? at_failed=false
   83087 $at_check_filter
   83088 echo stderr:; tee stderr <"$at_stderr"
   83089 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83090 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   83091 $at_failed && at_fn_log_failure
   83092 $at_traceon; }
   83093 
   83094 { set +x
   83095 $as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83096 at_fn_check_prepare_trace "calc.at:638"
   83097 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83099 at_status=$? at_failed=false
   83100 $at_check_filter
   83101 echo stderr:; tee stderr <"$at_stderr"
   83102 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83103 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   83104 $at_failed && at_fn_log_failure
   83105 $at_traceon; }
   83106 
   83107 
   83108 
   83109 # Normalize the observed and expected error messages, depending upon the
   83110 # options.
   83111 # 1. Remove the traces from observed.
   83112 sed '/^Starting/d
   83113 /^Entering/d
   83114 /^Stack/d
   83115 /^Reading/d
   83116 /^Reducing/d
   83117 /^Return/d
   83118 /^Shifting/d
   83119 /^state/d
   83120 /^Cleanup:/d
   83121 /^Error:/d
   83122 /^Next/d
   83123 /^Now/d
   83124 /^Discarding/d
   83125 / \$[0-9$]* = /d
   83126 /^yydestructor:/d' stderr >at-stderr
   83127 mv at-stderr stderr
   83128 # 2. Create the reference error message.
   83129 cat >expout <<'_ATEOF'
   83130 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   83131 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   83132 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   83133 _ATEOF
   83134 
   83135 # 3. If locations are not used, remove them.
   83136 sed 's/^[-0-9.]*: //' expout >at-expout
   83137 mv at-expout expout
   83138 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   83139 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   83140 mv at-expout expout
   83141 # 5. Check
   83142 { set +x
   83143 $as_echo "$at_srcdir/calc.at:638: cat stderr"
   83144 at_fn_check_prepare_trace "calc.at:638"
   83145 ( $at_check_trace; cat stderr
   83146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83147 at_status=$? at_failed=false
   83148 $at_check_filter
   83149 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83150 $at_diff expout "$at_stdout" || at_failed=:
   83151 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638"
   83152 $at_failed && at_fn_log_failure
   83153 $at_traceon; }
   83154 
   83155 
   83156 
   83157 
   83158 
   83159   set +x
   83160   $at_times_p && times >"$at_times_file"
   83161 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   83162 read at_status <"$at_status_file"
   83163 #AT_STOP_218
   83164 #AT_START_219
   83165 at_fn_group_banner 219 'calc.at:640' \
   83166   "Calculator %glr-parser %defines" "                " 12
   83167 at_xfail=no
   83168 (
   83169   $as_echo "219. $at_setup_line: testing $at_desc ..."
   83170   $at_traceon
   83171 
   83172 
   83173 
   83174 
   83175 
   83176 
   83177 
   83178 
   83179 
   83180 
   83181 cat >calc.y <<'_ATEOF'
   83182 %code top {
   83183 #include <config.h>
   83184 /* We don't need perfect functions for these tests. */
   83185 #undef malloc
   83186 #undef memcmp
   83187 #undef realloc
   83188 }
   83189 
   83190 /* Infix notation calculator--calc */
   83191 %glr-parser %defines
   83192 
   83193 %code requires
   83194 {
   83195 
   83196   /* Exercise pre-prologue dependency to %union.  */
   83197   typedef int semantic_value;
   83198 }
   83199 
   83200 /* Exercise %union. */
   83201 %union
   83202 {
   83203   semantic_value ival;
   83204 };
   83205 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   83206 
   83207 %code provides
   83208 {
   83209   #include <stdio.h>
   83210   /* The input.  */
   83211   extern FILE *input;
   83212   extern semantic_value global_result;
   83213   extern int global_count;
   83214 }
   83215 
   83216 %code
   83217 {
   83218 #include <assert.h>
   83219 #include <string.h>
   83220 #define USE(Var)
   83221 
   83222 FILE *input;
   83223 static int power (int base, int exponent);
   83224 
   83225 static void yyerror ( const char *msg);
   83226 int yylex (void);
   83227 }
   83228 
   83229 
   83230 
   83231 /* Bison Declarations */
   83232 %token CALC_EOF 0 "end of input"
   83233 %token <ival> NUM "number"
   83234 %type  <ival> exp
   83235 
   83236 %nonassoc '=' /* comparison            */
   83237 %left '-' '+'
   83238 %left '*' '/'
   83239 %left NEG     /* negation--unary minus */
   83240 %right '^'    /* exponentiation        */
   83241 
   83242 /* Grammar follows */
   83243 %%
   83244 input:
   83245   line
   83246 | input line         {  }
   83247 ;
   83248 
   83249 line:
   83250   '\n'
   83251 | exp '\n'           { USE ($1); }
   83252 ;
   83253 
   83254 exp:
   83255   NUM                { $$ = $1;             }
   83256 | exp '=' exp
   83257   {
   83258     if ($1 != $3)
   83259       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   83260     $$ = $1;
   83261   }
   83262 | exp '+' exp        { $$ = $1 + $3;        }
   83263 | exp '-' exp        { $$ = $1 - $3;        }
   83264 | exp '*' exp        { $$ = $1 * $3;        }
   83265 | exp '/' exp        { $$ = $1 / $3;        }
   83266 | '-' exp  %prec NEG { $$ = -$2;            }
   83267 | exp '^' exp        { $$ = power ($1, $3); }
   83268 | '(' exp ')'        { $$ = $2;             }
   83269 | '(' error ')'      { $$ = 1111; yyerrok;  }
   83270 | '!'                { $$ = 0; YYERROR;     }
   83271 | '-' error          { $$ = 0; YYERROR;     }
   83272 ;
   83273 %%
   83274 
   83275 static int
   83276 power (int base, int exponent)
   83277 {
   83278   int res = 1;
   83279   assert (0 <= exponent);
   83280   for (/* Niente */; exponent; --exponent)
   83281     res *= base;
   83282   return res;
   83283 }
   83284 
   83285 
   83286 #include <stdio.h>
   83287 /* A C error reporting function.  */
   83288 static
   83289 void yyerror ( const char *msg)
   83290 {
   83291   fprintf (stderr, "%s\n", msg);
   83292 }
   83293 _ATEOF
   83294 
   83295 
   83296 
   83297 cat >calc-lex.c <<'_ATEOF'
   83298 #include <config.h>
   83299 /* We don't need perfect functions for these tests. */
   83300 #undef malloc
   83301 #undef memcmp
   83302 #undef realloc
   83303 
   83304 #include "calc.h"
   83305 
   83306 #include <ctype.h>
   83307 
   83308 int yylex (void);
   83309 static int get_char (void);
   83310 static void unget_char ( int c);
   83311 
   83312 
   83313 static int
   83314 get_char (void)
   83315 {
   83316   int res = getc (input);
   83317   ;
   83318 
   83319   return res;
   83320 }
   83321 
   83322 static void
   83323 unget_char ( int c)
   83324 {
   83325   ;
   83326 
   83327   ungetc (c, input);
   83328 }
   83329 
   83330 static int
   83331 read_signed_integer (void)
   83332 {
   83333   int c = get_char ();
   83334   int sign = 1;
   83335   int n = 0;
   83336 
   83337   ;
   83338   if (c == '-')
   83339     {
   83340       c = get_char ();
   83341       sign = -1;
   83342     }
   83343 
   83344   while (isdigit (c))
   83345     {
   83346       n = 10 * n + (c - '0');
   83347       c = get_char ();
   83348     }
   83349 
   83350   unget_char ( c);
   83351 
   83352   return sign * n;
   83353 }
   83354 
   83355 
   83356 /*---------------------------------------------------------------.
   83357 | Lexical analyzer returns an integer on the stack and the token |
   83358 | NUM, or the ASCII character read if not a number.  Skips all   |
   83359 | blanks and tabs, returns 0 for EOF.                            |
   83360 `---------------------------------------------------------------*/
   83361 
   83362 int yylex (void)
   83363 {
   83364   int c;
   83365   /* Skip current token, then white spaces.  */
   83366   do
   83367     {
   83368 
   83369     }
   83370   while ((c = get_char ()) == ' ' || c == '\t');
   83371 
   83372   /* process numbers   */
   83373   if (c == '.' || isdigit (c))
   83374     {
   83375       unget_char ( c);
   83376       (yylval).ival = read_signed_integer ();
   83377       return NUM;
   83378     }
   83379 
   83380   /* Return end-of-file.  */
   83381   if (c == EOF)
   83382     return CALC_EOF;
   83383 
   83384   /* Return single chars. */
   83385   return c;
   83386 }
   83387 _ATEOF
   83388 
   83389 
   83390 cat >calc-main.c <<'_ATEOF'
   83391 #include <config.h>
   83392 /* We don't need perfect functions for these tests. */
   83393 #undef malloc
   83394 #undef memcmp
   83395 #undef realloc
   83396 
   83397 #include "calc.h"
   83398 
   83399 #include <assert.h>
   83400 #if HAVE_UNISTD_H
   83401 # include <unistd.h>
   83402 #else
   83403 # undef alarm
   83404 # define alarm(seconds) /* empty */
   83405 #endif
   83406 
   83407 
   83408 
   83409 semantic_value global_result = 0;
   83410 int global_count = 0;
   83411 
   83412 /* A C main function.  */
   83413 int
   83414 main (int argc, const char **argv)
   83415 {
   83416   semantic_value result = 0;
   83417   int count = 0;
   83418   int status;
   83419 
   83420   /* This used to be alarm (10), but that isn't enough time for
   83421      a July 1995 vintage DEC Alphastation 200 4/100 system,
   83422      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   83423   alarm (100);
   83424 
   83425   if (argc == 2)
   83426     input = fopen (argv[1], "r");
   83427   else
   83428     input = stdin;
   83429 
   83430   if (!input)
   83431     {
   83432       perror (argv[1]);
   83433       return 3;
   83434     }
   83435 
   83436 
   83437   status = yyparse ();
   83438   if (fclose (input))
   83439     perror ("fclose");
   83440   assert (global_result == result);
   83441   assert (global_count == count);
   83442   return status;
   83443 }
   83444 _ATEOF
   83445 
   83446 
   83447 
   83448 
   83449 
   83450 
   83451 
   83452 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   83453   at_save_special_files
   83454   mkdir xml-tests
   83455     # Don't combine these Bison invocations since we want to be sure that
   83456   # --report=all isn't required to get the full XML file.
   83457   { set +x
   83458 $as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   83459                   --graph=xml-tests/test.dot -o calc.c calc.y"
   83460 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640"
   83461 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   83462                   --graph=xml-tests/test.dot -o calc.c calc.y
   83463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83464 at_status=$? at_failed=false
   83465 $at_check_filter
   83466 echo stderr:; cat "$at_stderr"
   83467 echo stdout:; cat "$at_stdout"
   83468 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83469 $at_failed && at_fn_log_failure
   83470 $at_traceon; }
   83471 
   83472   { set +x
   83473 $as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   83474 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:640"
   83475 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   83476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83477 at_status=$? at_failed=false
   83478 $at_check_filter
   83479 echo stderr:; cat "$at_stderr"
   83480 echo stdout:; cat "$at_stdout"
   83481 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83482 $at_failed && at_fn_log_failure
   83483 $at_traceon; }
   83484 
   83485     cp xml-tests/test.output expout
   83486   { set +x
   83487 $as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\
   83488              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   83489              xml-tests/test.xml"
   83490 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640"
   83491 ( $at_check_trace; $XSLTPROC \
   83492              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   83493              xml-tests/test.xml
   83494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83495 at_status=$? at_failed=false
   83496 $at_check_filter
   83497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83498 $at_diff expout "$at_stdout" || at_failed=:
   83499 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83500 $at_failed && at_fn_log_failure
   83501 $at_traceon; }
   83502 
   83503   sort xml-tests/test.dot > expout
   83504   { set +x
   83505 $as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\
   83506              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   83507              xml-tests/test.xml | sort"
   83508 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640"
   83509 ( $at_check_trace; $XSLTPROC \
   83510              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   83511              xml-tests/test.xml | sort
   83512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83513 at_status=$? at_failed=false
   83514 $at_check_filter
   83515 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83516 $at_diff expout "$at_stdout" || at_failed=:
   83517 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83518 $at_failed && at_fn_log_failure
   83519 $at_traceon; }
   83520 
   83521   rm -rf xml-tests expout
   83522   at_restore_special_files
   83523 fi
   83524 { set +x
   83525 $as_echo "$at_srcdir/calc.at:640: bison -o calc.c calc.y"
   83526 at_fn_check_prepare_trace "calc.at:640"
   83527 ( $at_check_trace; bison -o calc.c calc.y
   83528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83529 at_status=$? at_failed=false
   83530 $at_check_filter
   83531 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83532 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83533 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83534 $at_failed && at_fn_log_failure
   83535 $at_traceon; }
   83536 
   83537 
   83538    { set +x
   83539 $as_echo "$at_srcdir/calc.at:640: \$BISON_C_WORKS"
   83540 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:640"
   83541 ( $at_check_trace; $BISON_C_WORKS
   83542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83543 at_status=$? at_failed=false
   83544 $at_check_filter
   83545 echo stderr:; cat "$at_stderr"
   83546 echo stdout:; cat "$at_stdout"
   83547 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83548 $at_failed && at_fn_log_failure
   83549 $at_traceon; }
   83550 
   83551 { set +x
   83552 $as_echo "$at_srcdir/calc.at:640: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   83553 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:640"
   83554 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   83555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83556 at_status=$? at_failed=false
   83557 $at_check_filter
   83558 echo stderr:; cat "$at_stderr"
   83559 echo stdout:; cat "$at_stdout"
   83560 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83561 $at_failed && at_fn_log_failure
   83562 $at_traceon; }
   83563 
   83564 
   83565 { set +x
   83566 $as_echo "$at_srcdir/calc.at:640: \$PERL -ne '
   83567   chomp;
   83568   print \"\$.: {\$_}\\n\"
   83569     if (# No starting/ending empty lines.
   83570         (eof || \$. == 1) && /^\\s*\$/
   83571         # No trailing space.  FIXME: not ready for \"maint\".
   83572         # || /\\s\$/
   83573         )' calc.c
   83574 "
   83575 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640"
   83576 ( $at_check_trace; $PERL -ne '
   83577   chomp;
   83578   print "$.: {$_}\n"
   83579     if (# No starting/ending empty lines.
   83580         (eof || $. == 1) && /^\s*$/
   83581         # No trailing space.  FIXME: not ready for "maint".
   83582         # || /\s$/
   83583         )' calc.c
   83584 
   83585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83586 at_status=$? at_failed=false
   83587 $at_check_filter
   83588 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83589 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83590 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83591 $at_failed && at_fn_log_failure
   83592 $at_traceon; }
   83593 
   83594 { set +x
   83595 $as_echo "$at_srcdir/calc.at:640: \$PERL -ne '
   83596   chomp;
   83597   print \"\$.: {\$_}\\n\"
   83598     if (# No starting/ending empty lines.
   83599         (eof || \$. == 1) && /^\\s*\$/
   83600         # No trailing space.  FIXME: not ready for \"maint\".
   83601         # || /\\s\$/
   83602         )' calc.h
   83603 "
   83604 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640"
   83605 ( $at_check_trace; $PERL -ne '
   83606   chomp;
   83607   print "$.: {$_}\n"
   83608     if (# No starting/ending empty lines.
   83609         (eof || $. == 1) && /^\s*$/
   83610         # No trailing space.  FIXME: not ready for "maint".
   83611         # || /\s$/
   83612         )' calc.h
   83613 
   83614 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83615 at_status=$? at_failed=false
   83616 $at_check_filter
   83617 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83618 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83619 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83620 $at_failed && at_fn_log_failure
   83621 $at_traceon; }
   83622 
   83623 
   83624 # Test the priorities.
   83625 cat >input <<'_ATEOF'
   83626 1 + 2 * 3 = 7
   83627 1 + 2 * -3 = -5
   83628 
   83629 -1^2 = -1
   83630 (-1)^2 = 1
   83631 
   83632 ---1 = -1
   83633 
   83634 1 - 2 - 3 = -4
   83635 1 - (2 - 3) = 2
   83636 
   83637 2^2^3 = 256
   83638 (2^2)^3 = 64
   83639 _ATEOF
   83640 
   83641 { set +x
   83642 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   83643 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   83644 ( $at_check_trace;  $PREPARSER ./calc input
   83645 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83646 at_status=$? at_failed=false
   83647 $at_check_filter
   83648 echo stderr:; tee stderr <"$at_stderr"
   83649 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83650 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83651 $at_failed && at_fn_log_failure
   83652 $at_traceon; }
   83653 
   83654 { set +x
   83655 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83656 at_fn_check_prepare_trace "calc.at:640"
   83657 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83659 at_status=$? at_failed=false
   83660 $at_check_filter
   83661 echo stderr:; tee stderr <"$at_stderr"
   83662 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83663 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83664 $at_failed && at_fn_log_failure
   83665 $at_traceon; }
   83666 
   83667 
   83668 
   83669 
   83670 # Some syntax errors.
   83671 cat >input <<'_ATEOF'
   83672 1 2
   83673 _ATEOF
   83674 
   83675 { set +x
   83676 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   83677 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   83678 ( $at_check_trace;  $PREPARSER ./calc input
   83679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83680 at_status=$? at_failed=false
   83681 $at_check_filter
   83682 echo stderr:; tee stderr <"$at_stderr"
   83683 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83684 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
   83685 $at_failed && at_fn_log_failure
   83686 $at_traceon; }
   83687 
   83688 { set +x
   83689 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83690 at_fn_check_prepare_trace "calc.at:640"
   83691 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83693 at_status=$? at_failed=false
   83694 $at_check_filter
   83695 echo stderr:; tee stderr <"$at_stderr"
   83696 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83697 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83698 $at_failed && at_fn_log_failure
   83699 $at_traceon; }
   83700 
   83701 
   83702 
   83703 # Normalize the observed and expected error messages, depending upon the
   83704 # options.
   83705 # 1. Remove the traces from observed.
   83706 sed '/^Starting/d
   83707 /^Entering/d
   83708 /^Stack/d
   83709 /^Reading/d
   83710 /^Reducing/d
   83711 /^Return/d
   83712 /^Shifting/d
   83713 /^state/d
   83714 /^Cleanup:/d
   83715 /^Error:/d
   83716 /^Next/d
   83717 /^Now/d
   83718 /^Discarding/d
   83719 / \$[0-9$]* = /d
   83720 /^yydestructor:/d' stderr >at-stderr
   83721 mv at-stderr stderr
   83722 # 2. Create the reference error message.
   83723 cat >expout <<'_ATEOF'
   83724 1.3: syntax error, unexpected number
   83725 _ATEOF
   83726 
   83727 # 3. If locations are not used, remove them.
   83728 sed 's/^[-0-9.]*: //' expout >at-expout
   83729 mv at-expout expout
   83730 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   83731 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   83732 mv at-expout expout
   83733 # 5. Check
   83734 { set +x
   83735 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   83736 at_fn_check_prepare_trace "calc.at:640"
   83737 ( $at_check_trace; cat stderr
   83738 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83739 at_status=$? at_failed=false
   83740 $at_check_filter
   83741 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83742 $at_diff expout "$at_stdout" || at_failed=:
   83743 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83744 $at_failed && at_fn_log_failure
   83745 $at_traceon; }
   83746 
   83747 
   83748 cat >input <<'_ATEOF'
   83749 1//2
   83750 _ATEOF
   83751 
   83752 { set +x
   83753 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   83754 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   83755 ( $at_check_trace;  $PREPARSER ./calc input
   83756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83757 at_status=$? at_failed=false
   83758 $at_check_filter
   83759 echo stderr:; tee stderr <"$at_stderr"
   83760 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83761 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
   83762 $at_failed && at_fn_log_failure
   83763 $at_traceon; }
   83764 
   83765 { set +x
   83766 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83767 at_fn_check_prepare_trace "calc.at:640"
   83768 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83770 at_status=$? at_failed=false
   83771 $at_check_filter
   83772 echo stderr:; tee stderr <"$at_stderr"
   83773 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83774 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83775 $at_failed && at_fn_log_failure
   83776 $at_traceon; }
   83777 
   83778 
   83779 
   83780 # Normalize the observed and expected error messages, depending upon the
   83781 # options.
   83782 # 1. Remove the traces from observed.
   83783 sed '/^Starting/d
   83784 /^Entering/d
   83785 /^Stack/d
   83786 /^Reading/d
   83787 /^Reducing/d
   83788 /^Return/d
   83789 /^Shifting/d
   83790 /^state/d
   83791 /^Cleanup:/d
   83792 /^Error:/d
   83793 /^Next/d
   83794 /^Now/d
   83795 /^Discarding/d
   83796 / \$[0-9$]* = /d
   83797 /^yydestructor:/d' stderr >at-stderr
   83798 mv at-stderr stderr
   83799 # 2. Create the reference error message.
   83800 cat >expout <<'_ATEOF'
   83801 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   83802 _ATEOF
   83803 
   83804 # 3. If locations are not used, remove them.
   83805 sed 's/^[-0-9.]*: //' expout >at-expout
   83806 mv at-expout expout
   83807 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   83808 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   83809 mv at-expout expout
   83810 # 5. Check
   83811 { set +x
   83812 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   83813 at_fn_check_prepare_trace "calc.at:640"
   83814 ( $at_check_trace; cat stderr
   83815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83816 at_status=$? at_failed=false
   83817 $at_check_filter
   83818 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83819 $at_diff expout "$at_stdout" || at_failed=:
   83820 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83821 $at_failed && at_fn_log_failure
   83822 $at_traceon; }
   83823 
   83824 
   83825 cat >input <<'_ATEOF'
   83826 error
   83827 _ATEOF
   83828 
   83829 { set +x
   83830 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   83831 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   83832 ( $at_check_trace;  $PREPARSER ./calc input
   83833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83834 at_status=$? at_failed=false
   83835 $at_check_filter
   83836 echo stderr:; tee stderr <"$at_stderr"
   83837 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83838 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
   83839 $at_failed && at_fn_log_failure
   83840 $at_traceon; }
   83841 
   83842 { set +x
   83843 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83844 at_fn_check_prepare_trace "calc.at:640"
   83845 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83846 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83847 at_status=$? at_failed=false
   83848 $at_check_filter
   83849 echo stderr:; tee stderr <"$at_stderr"
   83850 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83851 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83852 $at_failed && at_fn_log_failure
   83853 $at_traceon; }
   83854 
   83855 
   83856 
   83857 # Normalize the observed and expected error messages, depending upon the
   83858 # options.
   83859 # 1. Remove the traces from observed.
   83860 sed '/^Starting/d
   83861 /^Entering/d
   83862 /^Stack/d
   83863 /^Reading/d
   83864 /^Reducing/d
   83865 /^Return/d
   83866 /^Shifting/d
   83867 /^state/d
   83868 /^Cleanup:/d
   83869 /^Error:/d
   83870 /^Next/d
   83871 /^Now/d
   83872 /^Discarding/d
   83873 / \$[0-9$]* = /d
   83874 /^yydestructor:/d' stderr >at-stderr
   83875 mv at-stderr stderr
   83876 # 2. Create the reference error message.
   83877 cat >expout <<'_ATEOF'
   83878 1.1: syntax error, unexpected $undefined
   83879 _ATEOF
   83880 
   83881 # 3. If locations are not used, remove them.
   83882 sed 's/^[-0-9.]*: //' expout >at-expout
   83883 mv at-expout expout
   83884 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   83885 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   83886 mv at-expout expout
   83887 # 5. Check
   83888 { set +x
   83889 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   83890 at_fn_check_prepare_trace "calc.at:640"
   83891 ( $at_check_trace; cat stderr
   83892 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83893 at_status=$? at_failed=false
   83894 $at_check_filter
   83895 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83896 $at_diff expout "$at_stdout" || at_failed=:
   83897 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83898 $at_failed && at_fn_log_failure
   83899 $at_traceon; }
   83900 
   83901 
   83902 cat >input <<'_ATEOF'
   83903 1 = 2 = 3
   83904 _ATEOF
   83905 
   83906 { set +x
   83907 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   83908 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   83909 ( $at_check_trace;  $PREPARSER ./calc input
   83910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83911 at_status=$? at_failed=false
   83912 $at_check_filter
   83913 echo stderr:; tee stderr <"$at_stderr"
   83914 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83915 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
   83916 $at_failed && at_fn_log_failure
   83917 $at_traceon; }
   83918 
   83919 { set +x
   83920 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83921 at_fn_check_prepare_trace "calc.at:640"
   83922 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   83923 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83924 at_status=$? at_failed=false
   83925 $at_check_filter
   83926 echo stderr:; tee stderr <"$at_stderr"
   83927 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83928 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83929 $at_failed && at_fn_log_failure
   83930 $at_traceon; }
   83931 
   83932 
   83933 
   83934 # Normalize the observed and expected error messages, depending upon the
   83935 # options.
   83936 # 1. Remove the traces from observed.
   83937 sed '/^Starting/d
   83938 /^Entering/d
   83939 /^Stack/d
   83940 /^Reading/d
   83941 /^Reducing/d
   83942 /^Return/d
   83943 /^Shifting/d
   83944 /^state/d
   83945 /^Cleanup:/d
   83946 /^Error:/d
   83947 /^Next/d
   83948 /^Now/d
   83949 /^Discarding/d
   83950 / \$[0-9$]* = /d
   83951 /^yydestructor:/d' stderr >at-stderr
   83952 mv at-stderr stderr
   83953 # 2. Create the reference error message.
   83954 cat >expout <<'_ATEOF'
   83955 1.7: syntax error, unexpected '='
   83956 _ATEOF
   83957 
   83958 # 3. If locations are not used, remove them.
   83959 sed 's/^[-0-9.]*: //' expout >at-expout
   83960 mv at-expout expout
   83961 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   83962 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   83963 mv at-expout expout
   83964 # 5. Check
   83965 { set +x
   83966 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   83967 at_fn_check_prepare_trace "calc.at:640"
   83968 ( $at_check_trace; cat stderr
   83969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83970 at_status=$? at_failed=false
   83971 $at_check_filter
   83972 at_fn_diff_devnull "$at_stderr" || at_failed=:
   83973 $at_diff expout "$at_stdout" || at_failed=:
   83974 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   83975 $at_failed && at_fn_log_failure
   83976 $at_traceon; }
   83977 
   83978 
   83979 cat >input <<'_ATEOF'
   83980 
   83981 +1
   83982 _ATEOF
   83983 
   83984 { set +x
   83985 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   83986 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   83987 ( $at_check_trace;  $PREPARSER ./calc input
   83988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   83989 at_status=$? at_failed=false
   83990 $at_check_filter
   83991 echo stderr:; tee stderr <"$at_stderr"
   83992 at_fn_diff_devnull "$at_stdout" || at_failed=:
   83993 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
   83994 $at_failed && at_fn_log_failure
   83995 $at_traceon; }
   83996 
   83997 { set +x
   83998 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   83999 at_fn_check_prepare_trace "calc.at:640"
   84000 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84001 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84002 at_status=$? at_failed=false
   84003 $at_check_filter
   84004 echo stderr:; tee stderr <"$at_stderr"
   84005 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84006 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84007 $at_failed && at_fn_log_failure
   84008 $at_traceon; }
   84009 
   84010 
   84011 
   84012 # Normalize the observed and expected error messages, depending upon the
   84013 # options.
   84014 # 1. Remove the traces from observed.
   84015 sed '/^Starting/d
   84016 /^Entering/d
   84017 /^Stack/d
   84018 /^Reading/d
   84019 /^Reducing/d
   84020 /^Return/d
   84021 /^Shifting/d
   84022 /^state/d
   84023 /^Cleanup:/d
   84024 /^Error:/d
   84025 /^Next/d
   84026 /^Now/d
   84027 /^Discarding/d
   84028 / \$[0-9$]* = /d
   84029 /^yydestructor:/d' stderr >at-stderr
   84030 mv at-stderr stderr
   84031 # 2. Create the reference error message.
   84032 cat >expout <<'_ATEOF'
   84033 2.1: syntax error, unexpected '+'
   84034 _ATEOF
   84035 
   84036 # 3. If locations are not used, remove them.
   84037 sed 's/^[-0-9.]*: //' expout >at-expout
   84038 mv at-expout expout
   84039 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   84040 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   84041 mv at-expout expout
   84042 # 5. Check
   84043 { set +x
   84044 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   84045 at_fn_check_prepare_trace "calc.at:640"
   84046 ( $at_check_trace; cat stderr
   84047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84048 at_status=$? at_failed=false
   84049 $at_check_filter
   84050 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84051 $at_diff expout "$at_stdout" || at_failed=:
   84052 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84053 $at_failed && at_fn_log_failure
   84054 $at_traceon; }
   84055 
   84056 
   84057 # Exercise error messages with EOF: work on an empty file.
   84058 { set +x
   84059 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc /dev/null"
   84060 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:640"
   84061 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   84062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84063 at_status=$? at_failed=false
   84064 $at_check_filter
   84065 echo stderr:; tee stderr <"$at_stderr"
   84066 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84067 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
   84068 $at_failed && at_fn_log_failure
   84069 $at_traceon; }
   84070 
   84071 { set +x
   84072 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84073 at_fn_check_prepare_trace "calc.at:640"
   84074 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84075 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84076 at_status=$? at_failed=false
   84077 $at_check_filter
   84078 echo stderr:; tee stderr <"$at_stderr"
   84079 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84080 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84081 $at_failed && at_fn_log_failure
   84082 $at_traceon; }
   84083 
   84084 
   84085 
   84086 # Normalize the observed and expected error messages, depending upon the
   84087 # options.
   84088 # 1. Remove the traces from observed.
   84089 sed '/^Starting/d
   84090 /^Entering/d
   84091 /^Stack/d
   84092 /^Reading/d
   84093 /^Reducing/d
   84094 /^Return/d
   84095 /^Shifting/d
   84096 /^state/d
   84097 /^Cleanup:/d
   84098 /^Error:/d
   84099 /^Next/d
   84100 /^Now/d
   84101 /^Discarding/d
   84102 / \$[0-9$]* = /d
   84103 /^yydestructor:/d' stderr >at-stderr
   84104 mv at-stderr stderr
   84105 # 2. Create the reference error message.
   84106 cat >expout <<'_ATEOF'
   84107 1.1: syntax error, unexpected end of input
   84108 _ATEOF
   84109 
   84110 # 3. If locations are not used, remove them.
   84111 sed 's/^[-0-9.]*: //' expout >at-expout
   84112 mv at-expout expout
   84113 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   84114 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   84115 mv at-expout expout
   84116 # 5. Check
   84117 { set +x
   84118 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   84119 at_fn_check_prepare_trace "calc.at:640"
   84120 ( $at_check_trace; cat stderr
   84121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84122 at_status=$? at_failed=false
   84123 $at_check_filter
   84124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84125 $at_diff expout "$at_stdout" || at_failed=:
   84126 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84127 $at_failed && at_fn_log_failure
   84128 $at_traceon; }
   84129 
   84130 
   84131 
   84132 # Exercise the error token: without it, we die at the first error,
   84133 # hence be sure to
   84134 #
   84135 # - have several errors which exercise different shift/discardings
   84136 #   - (): nothing to pop, nothing to discard
   84137 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   84138 #   - (* * *): nothing to pop, a lot to discard
   84139 #   - (1 + 2 * *): some to pop and discard
   84140 #
   84141 # - test the action associated to `error'
   84142 #
   84143 # - check the lookahead that triggers an error is not discarded
   84144 #   when we enter error recovery.  Below, the lookahead causing the
   84145 #   first error is ")", which is needed to recover from the error and
   84146 #   produce the "0" that triggers the "0 != 1" error.
   84147 #
   84148 cat >input <<'_ATEOF'
   84149 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   84150 _ATEOF
   84151 
   84152 { set +x
   84153 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   84154 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   84155 ( $at_check_trace;  $PREPARSER ./calc input
   84156 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84157 at_status=$? at_failed=false
   84158 $at_check_filter
   84159 echo stderr:; tee stderr <"$at_stderr"
   84160 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84161 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84162 $at_failed && at_fn_log_failure
   84163 $at_traceon; }
   84164 
   84165 { set +x
   84166 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84167 at_fn_check_prepare_trace "calc.at:640"
   84168 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84170 at_status=$? at_failed=false
   84171 $at_check_filter
   84172 echo stderr:; tee stderr <"$at_stderr"
   84173 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84174 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84175 $at_failed && at_fn_log_failure
   84176 $at_traceon; }
   84177 
   84178 
   84179 
   84180 # Normalize the observed and expected error messages, depending upon the
   84181 # options.
   84182 # 1. Remove the traces from observed.
   84183 sed '/^Starting/d
   84184 /^Entering/d
   84185 /^Stack/d
   84186 /^Reading/d
   84187 /^Reducing/d
   84188 /^Return/d
   84189 /^Shifting/d
   84190 /^state/d
   84191 /^Cleanup:/d
   84192 /^Error:/d
   84193 /^Next/d
   84194 /^Now/d
   84195 /^Discarding/d
   84196 / \$[0-9$]* = /d
   84197 /^yydestructor:/d' stderr >at-stderr
   84198 mv at-stderr stderr
   84199 # 2. Create the reference error message.
   84200 cat >expout <<'_ATEOF'
   84201 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   84202 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   84203 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   84204 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   84205 calc: error: 4444 != 1
   84206 _ATEOF
   84207 
   84208 # 3. If locations are not used, remove them.
   84209 sed 's/^[-0-9.]*: //' expout >at-expout
   84210 mv at-expout expout
   84211 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   84212 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   84213 mv at-expout expout
   84214 # 5. Check
   84215 { set +x
   84216 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   84217 at_fn_check_prepare_trace "calc.at:640"
   84218 ( $at_check_trace; cat stderr
   84219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84220 at_status=$? at_failed=false
   84221 $at_check_filter
   84222 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84223 $at_diff expout "$at_stdout" || at_failed=:
   84224 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84225 $at_failed && at_fn_log_failure
   84226 $at_traceon; }
   84227 
   84228 
   84229 
   84230 # The same, but this time exercising explicitly triggered syntax errors.
   84231 # POSIX says the lookahead causing the error should not be discarded.
   84232 cat >input <<'_ATEOF'
   84233 (!) + (1 2) = 1
   84234 _ATEOF
   84235 
   84236 { set +x
   84237 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   84238 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   84239 ( $at_check_trace;  $PREPARSER ./calc input
   84240 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84241 at_status=$? at_failed=false
   84242 $at_check_filter
   84243 echo stderr:; tee stderr <"$at_stderr"
   84244 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84245 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84246 $at_failed && at_fn_log_failure
   84247 $at_traceon; }
   84248 
   84249 { set +x
   84250 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84251 at_fn_check_prepare_trace "calc.at:640"
   84252 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84253 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84254 at_status=$? at_failed=false
   84255 $at_check_filter
   84256 echo stderr:; tee stderr <"$at_stderr"
   84257 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84258 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84259 $at_failed && at_fn_log_failure
   84260 $at_traceon; }
   84261 
   84262 
   84263 
   84264 # Normalize the observed and expected error messages, depending upon the
   84265 # options.
   84266 # 1. Remove the traces from observed.
   84267 sed '/^Starting/d
   84268 /^Entering/d
   84269 /^Stack/d
   84270 /^Reading/d
   84271 /^Reducing/d
   84272 /^Return/d
   84273 /^Shifting/d
   84274 /^state/d
   84275 /^Cleanup:/d
   84276 /^Error:/d
   84277 /^Next/d
   84278 /^Now/d
   84279 /^Discarding/d
   84280 / \$[0-9$]* = /d
   84281 /^yydestructor:/d' stderr >at-stderr
   84282 mv at-stderr stderr
   84283 # 2. Create the reference error message.
   84284 cat >expout <<'_ATEOF'
   84285 1.10: syntax error, unexpected number
   84286 calc: error: 2222 != 1
   84287 _ATEOF
   84288 
   84289 # 3. If locations are not used, remove them.
   84290 sed 's/^[-0-9.]*: //' expout >at-expout
   84291 mv at-expout expout
   84292 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   84293 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   84294 mv at-expout expout
   84295 # 5. Check
   84296 { set +x
   84297 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   84298 at_fn_check_prepare_trace "calc.at:640"
   84299 ( $at_check_trace; cat stderr
   84300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84301 at_status=$? at_failed=false
   84302 $at_check_filter
   84303 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84304 $at_diff expout "$at_stdout" || at_failed=:
   84305 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84306 $at_failed && at_fn_log_failure
   84307 $at_traceon; }
   84308 
   84309 
   84310 cat >input <<'_ATEOF'
   84311 (- *) + (1 2) = 1
   84312 _ATEOF
   84313 
   84314 { set +x
   84315 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   84316 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   84317 ( $at_check_trace;  $PREPARSER ./calc input
   84318 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84319 at_status=$? at_failed=false
   84320 $at_check_filter
   84321 echo stderr:; tee stderr <"$at_stderr"
   84322 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84323 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84324 $at_failed && at_fn_log_failure
   84325 $at_traceon; }
   84326 
   84327 { set +x
   84328 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84329 at_fn_check_prepare_trace "calc.at:640"
   84330 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84332 at_status=$? at_failed=false
   84333 $at_check_filter
   84334 echo stderr:; tee stderr <"$at_stderr"
   84335 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84336 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84337 $at_failed && at_fn_log_failure
   84338 $at_traceon; }
   84339 
   84340 
   84341 
   84342 # Normalize the observed and expected error messages, depending upon the
   84343 # options.
   84344 # 1. Remove the traces from observed.
   84345 sed '/^Starting/d
   84346 /^Entering/d
   84347 /^Stack/d
   84348 /^Reading/d
   84349 /^Reducing/d
   84350 /^Return/d
   84351 /^Shifting/d
   84352 /^state/d
   84353 /^Cleanup:/d
   84354 /^Error:/d
   84355 /^Next/d
   84356 /^Now/d
   84357 /^Discarding/d
   84358 / \$[0-9$]* = /d
   84359 /^yydestructor:/d' stderr >at-stderr
   84360 mv at-stderr stderr
   84361 # 2. Create the reference error message.
   84362 cat >expout <<'_ATEOF'
   84363 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   84364 1.12: syntax error, unexpected number
   84365 calc: error: 2222 != 1
   84366 _ATEOF
   84367 
   84368 # 3. If locations are not used, remove them.
   84369 sed 's/^[-0-9.]*: //' expout >at-expout
   84370 mv at-expout expout
   84371 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   84372 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   84373 mv at-expout expout
   84374 # 5. Check
   84375 { set +x
   84376 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   84377 at_fn_check_prepare_trace "calc.at:640"
   84378 ( $at_check_trace; cat stderr
   84379 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84380 at_status=$? at_failed=false
   84381 $at_check_filter
   84382 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84383 $at_diff expout "$at_stdout" || at_failed=:
   84384 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84385 $at_failed && at_fn_log_failure
   84386 $at_traceon; }
   84387 
   84388 
   84389 
   84390 # Check that yyerrok works properly: second error is not reported,
   84391 # third and fourth are.  Parse status is succesfull.
   84392 cat >input <<'_ATEOF'
   84393 (* *) + (*) + (*)
   84394 _ATEOF
   84395 
   84396 { set +x
   84397 $as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
   84398 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
   84399 ( $at_check_trace;  $PREPARSER ./calc input
   84400 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84401 at_status=$? at_failed=false
   84402 $at_check_filter
   84403 echo stderr:; tee stderr <"$at_stderr"
   84404 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84405 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84406 $at_failed && at_fn_log_failure
   84407 $at_traceon; }
   84408 
   84409 { set +x
   84410 $as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84411 at_fn_check_prepare_trace "calc.at:640"
   84412 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84413 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84414 at_status=$? at_failed=false
   84415 $at_check_filter
   84416 echo stderr:; tee stderr <"$at_stderr"
   84417 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84418 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84419 $at_failed && at_fn_log_failure
   84420 $at_traceon; }
   84421 
   84422 
   84423 
   84424 # Normalize the observed and expected error messages, depending upon the
   84425 # options.
   84426 # 1. Remove the traces from observed.
   84427 sed '/^Starting/d
   84428 /^Entering/d
   84429 /^Stack/d
   84430 /^Reading/d
   84431 /^Reducing/d
   84432 /^Return/d
   84433 /^Shifting/d
   84434 /^state/d
   84435 /^Cleanup:/d
   84436 /^Error:/d
   84437 /^Next/d
   84438 /^Now/d
   84439 /^Discarding/d
   84440 / \$[0-9$]* = /d
   84441 /^yydestructor:/d' stderr >at-stderr
   84442 mv at-stderr stderr
   84443 # 2. Create the reference error message.
   84444 cat >expout <<'_ATEOF'
   84445 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   84446 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   84447 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   84448 _ATEOF
   84449 
   84450 # 3. If locations are not used, remove them.
   84451 sed 's/^[-0-9.]*: //' expout >at-expout
   84452 mv at-expout expout
   84453 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   84454 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   84455 mv at-expout expout
   84456 # 5. Check
   84457 { set +x
   84458 $as_echo "$at_srcdir/calc.at:640: cat stderr"
   84459 at_fn_check_prepare_trace "calc.at:640"
   84460 ( $at_check_trace; cat stderr
   84461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84462 at_status=$? at_failed=false
   84463 $at_check_filter
   84464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84465 $at_diff expout "$at_stdout" || at_failed=:
   84466 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
   84467 $at_failed && at_fn_log_failure
   84468 $at_traceon; }
   84469 
   84470 
   84471 
   84472 
   84473 
   84474   set +x
   84475   $at_times_p && times >"$at_times_file"
   84476 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   84477 read at_status <"$at_status_file"
   84478 #AT_STOP_219
   84479 #AT_START_220
   84480 at_fn_group_banner 220 'calc.at:641' \
   84481   "Calculator %glr-parser %locations" "              " 12
   84482 at_xfail=no
   84483 (
   84484   $as_echo "220. $at_setup_line: testing $at_desc ..."
   84485   $at_traceon
   84486 
   84487 
   84488 
   84489 
   84490 
   84491 
   84492 
   84493 
   84494 
   84495 
   84496 cat >calc.y <<'_ATEOF'
   84497 %code top {
   84498 #include <config.h>
   84499 /* We don't need perfect functions for these tests. */
   84500 #undef malloc
   84501 #undef memcmp
   84502 #undef realloc
   84503 }
   84504 
   84505 /* Infix notation calculator--calc */
   84506 %glr-parser %locations
   84507 
   84508 %code requires
   84509 {
   84510 
   84511   /* Exercise pre-prologue dependency to %union.  */
   84512   typedef int semantic_value;
   84513 }
   84514 
   84515 /* Exercise %union. */
   84516 %union
   84517 {
   84518   semantic_value ival;
   84519 };
   84520 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   84521 
   84522 %code provides
   84523 {
   84524   #include <stdio.h>
   84525   /* The input.  */
   84526   extern FILE *input;
   84527   extern semantic_value global_result;
   84528   extern int global_count;
   84529 }
   84530 
   84531 %code
   84532 {
   84533 #include <assert.h>
   84534 #include <string.h>
   84535 #define USE(Var)
   84536 
   84537 FILE *input;
   84538 static int power (int base, int exponent);
   84539 
   84540 static void yyerror ( const char *msg);
   84541 int yylex (void);
   84542 }
   84543 
   84544 
   84545 
   84546 /* Bison Declarations */
   84547 %token CALC_EOF 0 "end of input"
   84548 %token <ival> NUM "number"
   84549 %type  <ival> exp
   84550 
   84551 %nonassoc '=' /* comparison            */
   84552 %left '-' '+'
   84553 %left '*' '/'
   84554 %left NEG     /* negation--unary minus */
   84555 %right '^'    /* exponentiation        */
   84556 
   84557 /* Grammar follows */
   84558 %%
   84559 input:
   84560   line
   84561 | input line         {  }
   84562 ;
   84563 
   84564 line:
   84565   '\n'
   84566 | exp '\n'           { USE ($1); }
   84567 ;
   84568 
   84569 exp:
   84570   NUM                { $$ = $1;             }
   84571 | exp '=' exp
   84572   {
   84573     if ($1 != $3)
   84574       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   84575     $$ = $1;
   84576   }
   84577 | exp '+' exp        { $$ = $1 + $3;        }
   84578 | exp '-' exp        { $$ = $1 - $3;        }
   84579 | exp '*' exp        { $$ = $1 * $3;        }
   84580 | exp '/' exp        { $$ = $1 / $3;        }
   84581 | '-' exp  %prec NEG { $$ = -$2;            }
   84582 | exp '^' exp        { $$ = power ($1, $3); }
   84583 | '(' exp ')'        { $$ = $2;             }
   84584 | '(' error ')'      { $$ = 1111; yyerrok;  }
   84585 | '!'                { $$ = 0; YYERROR;     }
   84586 | '-' error          { $$ = 0; YYERROR;     }
   84587 ;
   84588 %%
   84589 
   84590 static int
   84591 power (int base, int exponent)
   84592 {
   84593   int res = 1;
   84594   assert (0 <= exponent);
   84595   for (/* Niente */; exponent; --exponent)
   84596     res *= base;
   84597   return res;
   84598 }
   84599 
   84600 
   84601 #include <stdio.h>
   84602 /* A C error reporting function.  */
   84603 static
   84604 void yyerror ( const char *msg)
   84605 {
   84606   YY_LOCATION_PRINT (stderr, (yylloc));
   84607   fprintf (stderr, ": ");
   84608   fprintf (stderr, "%s\n", msg);
   84609 }
   84610 #include <ctype.h>
   84611 
   84612 int yylex (void);
   84613 static int get_char (void);
   84614 static void unget_char ( int c);
   84615 
   84616 
   84617 static YYLTYPE last_yylloc;
   84618 
   84619 static int
   84620 get_char (void)
   84621 {
   84622   int res = getc (input);
   84623   ;
   84624 
   84625   last_yylloc = (yylloc);
   84626   if (res == '\n')
   84627     {
   84628       (yylloc).last_line++;
   84629       (yylloc).last_column = 1;
   84630     }
   84631   else
   84632     (yylloc).last_column++;
   84633 
   84634   return res;
   84635 }
   84636 
   84637 static void
   84638 unget_char ( int c)
   84639 {
   84640   ;
   84641 
   84642   /* Wrong when C == `\n'. */
   84643   (yylloc) = last_yylloc;
   84644 
   84645   ungetc (c, input);
   84646 }
   84647 
   84648 static int
   84649 read_signed_integer (void)
   84650 {
   84651   int c = get_char ();
   84652   int sign = 1;
   84653   int n = 0;
   84654 
   84655   ;
   84656   if (c == '-')
   84657     {
   84658       c = get_char ();
   84659       sign = -1;
   84660     }
   84661 
   84662   while (isdigit (c))
   84663     {
   84664       n = 10 * n + (c - '0');
   84665       c = get_char ();
   84666     }
   84667 
   84668   unget_char ( c);
   84669 
   84670   return sign * n;
   84671 }
   84672 
   84673 
   84674 /*---------------------------------------------------------------.
   84675 | Lexical analyzer returns an integer on the stack and the token |
   84676 | NUM, or the ASCII character read if not a number.  Skips all   |
   84677 | blanks and tabs, returns 0 for EOF.                            |
   84678 `---------------------------------------------------------------*/
   84679 
   84680 int yylex (void)
   84681 {
   84682   int c;
   84683   /* Skip current token, then white spaces.  */
   84684   do
   84685     {
   84686      (yylloc).first_column = (yylloc).last_column;
   84687       (yylloc).first_line   = (yylloc).last_line;
   84688 
   84689     }
   84690   while ((c = get_char ()) == ' ' || c == '\t');
   84691 
   84692   /* process numbers   */
   84693   if (c == '.' || isdigit (c))
   84694     {
   84695       unget_char ( c);
   84696       (yylval).ival = read_signed_integer ();
   84697       return NUM;
   84698     }
   84699 
   84700   /* Return end-of-file.  */
   84701   if (c == EOF)
   84702     return CALC_EOF;
   84703 
   84704   /* Return single chars. */
   84705   return c;
   84706 }
   84707 
   84708 #include <assert.h>
   84709 #if HAVE_UNISTD_H
   84710 # include <unistd.h>
   84711 #else
   84712 # undef alarm
   84713 # define alarm(seconds) /* empty */
   84714 #endif
   84715 
   84716 
   84717 
   84718 semantic_value global_result = 0;
   84719 int global_count = 0;
   84720 
   84721 /* A C main function.  */
   84722 int
   84723 main (int argc, const char **argv)
   84724 {
   84725   semantic_value result = 0;
   84726   int count = 0;
   84727   int status;
   84728 
   84729   /* This used to be alarm (10), but that isn't enough time for
   84730      a July 1995 vintage DEC Alphastation 200 4/100 system,
   84731      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   84732   alarm (100);
   84733 
   84734   if (argc == 2)
   84735     input = fopen (argv[1], "r");
   84736   else
   84737     input = stdin;
   84738 
   84739   if (!input)
   84740     {
   84741       perror (argv[1]);
   84742       return 3;
   84743     }
   84744 
   84745 
   84746   status = yyparse ();
   84747   if (fclose (input))
   84748     perror ("fclose");
   84749   assert (global_result == result);
   84750   assert (global_count == count);
   84751   return status;
   84752 }
   84753 _ATEOF
   84754 
   84755 
   84756 
   84757 
   84758 
   84759 
   84760 
   84761 
   84762 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   84763   at_save_special_files
   84764   mkdir xml-tests
   84765     # Don't combine these Bison invocations since we want to be sure that
   84766   # --report=all isn't required to get the full XML file.
   84767   { set +x
   84768 $as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   84769                   --graph=xml-tests/test.dot -o calc.c calc.y"
   84770 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641"
   84771 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   84772                   --graph=xml-tests/test.dot -o calc.c calc.y
   84773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84774 at_status=$? at_failed=false
   84775 $at_check_filter
   84776 echo stderr:; cat "$at_stderr"
   84777 echo stdout:; cat "$at_stdout"
   84778 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84779 $at_failed && at_fn_log_failure
   84780 $at_traceon; }
   84781 
   84782   { set +x
   84783 $as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   84784 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:641"
   84785 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   84786 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84787 at_status=$? at_failed=false
   84788 $at_check_filter
   84789 echo stderr:; cat "$at_stderr"
   84790 echo stdout:; cat "$at_stdout"
   84791 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84792 $at_failed && at_fn_log_failure
   84793 $at_traceon; }
   84794 
   84795     cp xml-tests/test.output expout
   84796   { set +x
   84797 $as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\
   84798              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   84799              xml-tests/test.xml"
   84800 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641"
   84801 ( $at_check_trace; $XSLTPROC \
   84802              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   84803              xml-tests/test.xml
   84804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84805 at_status=$? at_failed=false
   84806 $at_check_filter
   84807 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84808 $at_diff expout "$at_stdout" || at_failed=:
   84809 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84810 $at_failed && at_fn_log_failure
   84811 $at_traceon; }
   84812 
   84813   sort xml-tests/test.dot > expout
   84814   { set +x
   84815 $as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\
   84816              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   84817              xml-tests/test.xml | sort"
   84818 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641"
   84819 ( $at_check_trace; $XSLTPROC \
   84820              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   84821              xml-tests/test.xml | sort
   84822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84823 at_status=$? at_failed=false
   84824 $at_check_filter
   84825 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84826 $at_diff expout "$at_stdout" || at_failed=:
   84827 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84828 $at_failed && at_fn_log_failure
   84829 $at_traceon; }
   84830 
   84831   rm -rf xml-tests expout
   84832   at_restore_special_files
   84833 fi
   84834 { set +x
   84835 $as_echo "$at_srcdir/calc.at:641: bison -o calc.c calc.y"
   84836 at_fn_check_prepare_trace "calc.at:641"
   84837 ( $at_check_trace; bison -o calc.c calc.y
   84838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84839 at_status=$? at_failed=false
   84840 $at_check_filter
   84841 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84842 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84843 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84844 $at_failed && at_fn_log_failure
   84845 $at_traceon; }
   84846 
   84847 
   84848    { set +x
   84849 $as_echo "$at_srcdir/calc.at:641: \$BISON_C_WORKS"
   84850 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:641"
   84851 ( $at_check_trace; $BISON_C_WORKS
   84852 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84853 at_status=$? at_failed=false
   84854 $at_check_filter
   84855 echo stderr:; cat "$at_stderr"
   84856 echo stdout:; cat "$at_stdout"
   84857 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84858 $at_failed && at_fn_log_failure
   84859 $at_traceon; }
   84860 
   84861 { set +x
   84862 $as_echo "$at_srcdir/calc.at:641: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   84863 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:641"
   84864 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   84865 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84866 at_status=$? at_failed=false
   84867 $at_check_filter
   84868 echo stderr:; cat "$at_stderr"
   84869 echo stdout:; cat "$at_stdout"
   84870 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84871 $at_failed && at_fn_log_failure
   84872 $at_traceon; }
   84873 
   84874 
   84875 { set +x
   84876 $as_echo "$at_srcdir/calc.at:641: \$PERL -ne '
   84877   chomp;
   84878   print \"\$.: {\$_}\\n\"
   84879     if (# No starting/ending empty lines.
   84880         (eof || \$. == 1) && /^\\s*\$/
   84881         # No trailing space.  FIXME: not ready for \"maint\".
   84882         # || /\\s\$/
   84883         )' calc.c
   84884 "
   84885 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641"
   84886 ( $at_check_trace; $PERL -ne '
   84887   chomp;
   84888   print "$.: {$_}\n"
   84889     if (# No starting/ending empty lines.
   84890         (eof || $. == 1) && /^\s*$/
   84891         # No trailing space.  FIXME: not ready for "maint".
   84892         # || /\s$/
   84893         )' calc.c
   84894 
   84895 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84896 at_status=$? at_failed=false
   84897 $at_check_filter
   84898 at_fn_diff_devnull "$at_stderr" || at_failed=:
   84899 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84900 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84901 $at_failed && at_fn_log_failure
   84902 $at_traceon; }
   84903 
   84904 
   84905 
   84906 # Test the priorities.
   84907 cat >input <<'_ATEOF'
   84908 1 + 2 * 3 = 7
   84909 1 + 2 * -3 = -5
   84910 
   84911 -1^2 = -1
   84912 (-1)^2 = 1
   84913 
   84914 ---1 = -1
   84915 
   84916 1 - 2 - 3 = -4
   84917 1 - (2 - 3) = 2
   84918 
   84919 2^2^3 = 256
   84920 (2^2)^3 = 64
   84921 _ATEOF
   84922 
   84923 { set +x
   84924 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   84925 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   84926 ( $at_check_trace;  $PREPARSER ./calc input
   84927 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84928 at_status=$? at_failed=false
   84929 $at_check_filter
   84930 echo stderr:; tee stderr <"$at_stderr"
   84931 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84932 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84933 $at_failed && at_fn_log_failure
   84934 $at_traceon; }
   84935 
   84936 { set +x
   84937 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84938 at_fn_check_prepare_trace "calc.at:641"
   84939 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84941 at_status=$? at_failed=false
   84942 $at_check_filter
   84943 echo stderr:; tee stderr <"$at_stderr"
   84944 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84945 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84946 $at_failed && at_fn_log_failure
   84947 $at_traceon; }
   84948 
   84949 
   84950 
   84951 
   84952 # Some syntax errors.
   84953 cat >input <<'_ATEOF'
   84954 1 2
   84955 _ATEOF
   84956 
   84957 { set +x
   84958 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   84959 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   84960 ( $at_check_trace;  $PREPARSER ./calc input
   84961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84962 at_status=$? at_failed=false
   84963 $at_check_filter
   84964 echo stderr:; tee stderr <"$at_stderr"
   84965 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84966 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
   84967 $at_failed && at_fn_log_failure
   84968 $at_traceon; }
   84969 
   84970 { set +x
   84971 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   84972 at_fn_check_prepare_trace "calc.at:641"
   84973 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   84974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   84975 at_status=$? at_failed=false
   84976 $at_check_filter
   84977 echo stderr:; tee stderr <"$at_stderr"
   84978 at_fn_diff_devnull "$at_stdout" || at_failed=:
   84979 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   84980 $at_failed && at_fn_log_failure
   84981 $at_traceon; }
   84982 
   84983 
   84984 
   84985 # Normalize the observed and expected error messages, depending upon the
   84986 # options.
   84987 # 1. Remove the traces from observed.
   84988 sed '/^Starting/d
   84989 /^Entering/d
   84990 /^Stack/d
   84991 /^Reading/d
   84992 /^Reducing/d
   84993 /^Return/d
   84994 /^Shifting/d
   84995 /^state/d
   84996 /^Cleanup:/d
   84997 /^Error:/d
   84998 /^Next/d
   84999 /^Now/d
   85000 /^Discarding/d
   85001 / \$[0-9$]* = /d
   85002 /^yydestructor:/d' stderr >at-stderr
   85003 mv at-stderr stderr
   85004 # 2. Create the reference error message.
   85005 cat >expout <<'_ATEOF'
   85006 1.3: syntax error, unexpected number
   85007 _ATEOF
   85008 
   85009 # 3. If locations are not used, remove them.
   85010 
   85011 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85012 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85013 mv at-expout expout
   85014 # 5. Check
   85015 { set +x
   85016 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85017 at_fn_check_prepare_trace "calc.at:641"
   85018 ( $at_check_trace; cat stderr
   85019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85020 at_status=$? at_failed=false
   85021 $at_check_filter
   85022 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85023 $at_diff expout "$at_stdout" || at_failed=:
   85024 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85025 $at_failed && at_fn_log_failure
   85026 $at_traceon; }
   85027 
   85028 
   85029 cat >input <<'_ATEOF'
   85030 1//2
   85031 _ATEOF
   85032 
   85033 { set +x
   85034 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85035 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85036 ( $at_check_trace;  $PREPARSER ./calc input
   85037 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85038 at_status=$? at_failed=false
   85039 $at_check_filter
   85040 echo stderr:; tee stderr <"$at_stderr"
   85041 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85042 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
   85043 $at_failed && at_fn_log_failure
   85044 $at_traceon; }
   85045 
   85046 { set +x
   85047 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85048 at_fn_check_prepare_trace "calc.at:641"
   85049 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85050 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85051 at_status=$? at_failed=false
   85052 $at_check_filter
   85053 echo stderr:; tee stderr <"$at_stderr"
   85054 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85055 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85056 $at_failed && at_fn_log_failure
   85057 $at_traceon; }
   85058 
   85059 
   85060 
   85061 # Normalize the observed and expected error messages, depending upon the
   85062 # options.
   85063 # 1. Remove the traces from observed.
   85064 sed '/^Starting/d
   85065 /^Entering/d
   85066 /^Stack/d
   85067 /^Reading/d
   85068 /^Reducing/d
   85069 /^Return/d
   85070 /^Shifting/d
   85071 /^state/d
   85072 /^Cleanup:/d
   85073 /^Error:/d
   85074 /^Next/d
   85075 /^Now/d
   85076 /^Discarding/d
   85077 / \$[0-9$]* = /d
   85078 /^yydestructor:/d' stderr >at-stderr
   85079 mv at-stderr stderr
   85080 # 2. Create the reference error message.
   85081 cat >expout <<'_ATEOF'
   85082 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   85083 _ATEOF
   85084 
   85085 # 3. If locations are not used, remove them.
   85086 
   85087 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85088 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85089 mv at-expout expout
   85090 # 5. Check
   85091 { set +x
   85092 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85093 at_fn_check_prepare_trace "calc.at:641"
   85094 ( $at_check_trace; cat stderr
   85095 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85096 at_status=$? at_failed=false
   85097 $at_check_filter
   85098 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85099 $at_diff expout "$at_stdout" || at_failed=:
   85100 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85101 $at_failed && at_fn_log_failure
   85102 $at_traceon; }
   85103 
   85104 
   85105 cat >input <<'_ATEOF'
   85106 error
   85107 _ATEOF
   85108 
   85109 { set +x
   85110 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85111 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85112 ( $at_check_trace;  $PREPARSER ./calc input
   85113 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85114 at_status=$? at_failed=false
   85115 $at_check_filter
   85116 echo stderr:; tee stderr <"$at_stderr"
   85117 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85118 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
   85119 $at_failed && at_fn_log_failure
   85120 $at_traceon; }
   85121 
   85122 { set +x
   85123 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85124 at_fn_check_prepare_trace "calc.at:641"
   85125 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85127 at_status=$? at_failed=false
   85128 $at_check_filter
   85129 echo stderr:; tee stderr <"$at_stderr"
   85130 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85131 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85132 $at_failed && at_fn_log_failure
   85133 $at_traceon; }
   85134 
   85135 
   85136 
   85137 # Normalize the observed and expected error messages, depending upon the
   85138 # options.
   85139 # 1. Remove the traces from observed.
   85140 sed '/^Starting/d
   85141 /^Entering/d
   85142 /^Stack/d
   85143 /^Reading/d
   85144 /^Reducing/d
   85145 /^Return/d
   85146 /^Shifting/d
   85147 /^state/d
   85148 /^Cleanup:/d
   85149 /^Error:/d
   85150 /^Next/d
   85151 /^Now/d
   85152 /^Discarding/d
   85153 / \$[0-9$]* = /d
   85154 /^yydestructor:/d' stderr >at-stderr
   85155 mv at-stderr stderr
   85156 # 2. Create the reference error message.
   85157 cat >expout <<'_ATEOF'
   85158 1.1: syntax error, unexpected $undefined
   85159 _ATEOF
   85160 
   85161 # 3. If locations are not used, remove them.
   85162 
   85163 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85164 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85165 mv at-expout expout
   85166 # 5. Check
   85167 { set +x
   85168 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85169 at_fn_check_prepare_trace "calc.at:641"
   85170 ( $at_check_trace; cat stderr
   85171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85172 at_status=$? at_failed=false
   85173 $at_check_filter
   85174 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85175 $at_diff expout "$at_stdout" || at_failed=:
   85176 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85177 $at_failed && at_fn_log_failure
   85178 $at_traceon; }
   85179 
   85180 
   85181 cat >input <<'_ATEOF'
   85182 1 = 2 = 3
   85183 _ATEOF
   85184 
   85185 { set +x
   85186 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85187 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85188 ( $at_check_trace;  $PREPARSER ./calc input
   85189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85190 at_status=$? at_failed=false
   85191 $at_check_filter
   85192 echo stderr:; tee stderr <"$at_stderr"
   85193 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85194 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
   85195 $at_failed && at_fn_log_failure
   85196 $at_traceon; }
   85197 
   85198 { set +x
   85199 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85200 at_fn_check_prepare_trace "calc.at:641"
   85201 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85203 at_status=$? at_failed=false
   85204 $at_check_filter
   85205 echo stderr:; tee stderr <"$at_stderr"
   85206 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85207 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85208 $at_failed && at_fn_log_failure
   85209 $at_traceon; }
   85210 
   85211 
   85212 
   85213 # Normalize the observed and expected error messages, depending upon the
   85214 # options.
   85215 # 1. Remove the traces from observed.
   85216 sed '/^Starting/d
   85217 /^Entering/d
   85218 /^Stack/d
   85219 /^Reading/d
   85220 /^Reducing/d
   85221 /^Return/d
   85222 /^Shifting/d
   85223 /^state/d
   85224 /^Cleanup:/d
   85225 /^Error:/d
   85226 /^Next/d
   85227 /^Now/d
   85228 /^Discarding/d
   85229 / \$[0-9$]* = /d
   85230 /^yydestructor:/d' stderr >at-stderr
   85231 mv at-stderr stderr
   85232 # 2. Create the reference error message.
   85233 cat >expout <<'_ATEOF'
   85234 1.7: syntax error, unexpected '='
   85235 _ATEOF
   85236 
   85237 # 3. If locations are not used, remove them.
   85238 
   85239 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85240 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85241 mv at-expout expout
   85242 # 5. Check
   85243 { set +x
   85244 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85245 at_fn_check_prepare_trace "calc.at:641"
   85246 ( $at_check_trace; cat stderr
   85247 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85248 at_status=$? at_failed=false
   85249 $at_check_filter
   85250 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85251 $at_diff expout "$at_stdout" || at_failed=:
   85252 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85253 $at_failed && at_fn_log_failure
   85254 $at_traceon; }
   85255 
   85256 
   85257 cat >input <<'_ATEOF'
   85258 
   85259 +1
   85260 _ATEOF
   85261 
   85262 { set +x
   85263 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85264 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85265 ( $at_check_trace;  $PREPARSER ./calc input
   85266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85267 at_status=$? at_failed=false
   85268 $at_check_filter
   85269 echo stderr:; tee stderr <"$at_stderr"
   85270 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85271 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
   85272 $at_failed && at_fn_log_failure
   85273 $at_traceon; }
   85274 
   85275 { set +x
   85276 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85277 at_fn_check_prepare_trace "calc.at:641"
   85278 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85280 at_status=$? at_failed=false
   85281 $at_check_filter
   85282 echo stderr:; tee stderr <"$at_stderr"
   85283 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85284 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85285 $at_failed && at_fn_log_failure
   85286 $at_traceon; }
   85287 
   85288 
   85289 
   85290 # Normalize the observed and expected error messages, depending upon the
   85291 # options.
   85292 # 1. Remove the traces from observed.
   85293 sed '/^Starting/d
   85294 /^Entering/d
   85295 /^Stack/d
   85296 /^Reading/d
   85297 /^Reducing/d
   85298 /^Return/d
   85299 /^Shifting/d
   85300 /^state/d
   85301 /^Cleanup:/d
   85302 /^Error:/d
   85303 /^Next/d
   85304 /^Now/d
   85305 /^Discarding/d
   85306 / \$[0-9$]* = /d
   85307 /^yydestructor:/d' stderr >at-stderr
   85308 mv at-stderr stderr
   85309 # 2. Create the reference error message.
   85310 cat >expout <<'_ATEOF'
   85311 2.1: syntax error, unexpected '+'
   85312 _ATEOF
   85313 
   85314 # 3. If locations are not used, remove them.
   85315 
   85316 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85317 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85318 mv at-expout expout
   85319 # 5. Check
   85320 { set +x
   85321 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85322 at_fn_check_prepare_trace "calc.at:641"
   85323 ( $at_check_trace; cat stderr
   85324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85325 at_status=$? at_failed=false
   85326 $at_check_filter
   85327 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85328 $at_diff expout "$at_stdout" || at_failed=:
   85329 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85330 $at_failed && at_fn_log_failure
   85331 $at_traceon; }
   85332 
   85333 
   85334 # Exercise error messages with EOF: work on an empty file.
   85335 { set +x
   85336 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc /dev/null"
   85337 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:641"
   85338 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   85339 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85340 at_status=$? at_failed=false
   85341 $at_check_filter
   85342 echo stderr:; tee stderr <"$at_stderr"
   85343 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85344 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
   85345 $at_failed && at_fn_log_failure
   85346 $at_traceon; }
   85347 
   85348 { set +x
   85349 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85350 at_fn_check_prepare_trace "calc.at:641"
   85351 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85352 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85353 at_status=$? at_failed=false
   85354 $at_check_filter
   85355 echo stderr:; tee stderr <"$at_stderr"
   85356 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85357 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85358 $at_failed && at_fn_log_failure
   85359 $at_traceon; }
   85360 
   85361 
   85362 
   85363 # Normalize the observed and expected error messages, depending upon the
   85364 # options.
   85365 # 1. Remove the traces from observed.
   85366 sed '/^Starting/d
   85367 /^Entering/d
   85368 /^Stack/d
   85369 /^Reading/d
   85370 /^Reducing/d
   85371 /^Return/d
   85372 /^Shifting/d
   85373 /^state/d
   85374 /^Cleanup:/d
   85375 /^Error:/d
   85376 /^Next/d
   85377 /^Now/d
   85378 /^Discarding/d
   85379 / \$[0-9$]* = /d
   85380 /^yydestructor:/d' stderr >at-stderr
   85381 mv at-stderr stderr
   85382 # 2. Create the reference error message.
   85383 cat >expout <<'_ATEOF'
   85384 1.1: syntax error, unexpected end of input
   85385 _ATEOF
   85386 
   85387 # 3. If locations are not used, remove them.
   85388 
   85389 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85390 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85391 mv at-expout expout
   85392 # 5. Check
   85393 { set +x
   85394 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85395 at_fn_check_prepare_trace "calc.at:641"
   85396 ( $at_check_trace; cat stderr
   85397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85398 at_status=$? at_failed=false
   85399 $at_check_filter
   85400 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85401 $at_diff expout "$at_stdout" || at_failed=:
   85402 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85403 $at_failed && at_fn_log_failure
   85404 $at_traceon; }
   85405 
   85406 
   85407 
   85408 # Exercise the error token: without it, we die at the first error,
   85409 # hence be sure to
   85410 #
   85411 # - have several errors which exercise different shift/discardings
   85412 #   - (): nothing to pop, nothing to discard
   85413 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   85414 #   - (* * *): nothing to pop, a lot to discard
   85415 #   - (1 + 2 * *): some to pop and discard
   85416 #
   85417 # - test the action associated to `error'
   85418 #
   85419 # - check the lookahead that triggers an error is not discarded
   85420 #   when we enter error recovery.  Below, the lookahead causing the
   85421 #   first error is ")", which is needed to recover from the error and
   85422 #   produce the "0" that triggers the "0 != 1" error.
   85423 #
   85424 cat >input <<'_ATEOF'
   85425 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   85426 _ATEOF
   85427 
   85428 { set +x
   85429 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85430 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85431 ( $at_check_trace;  $PREPARSER ./calc input
   85432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85433 at_status=$? at_failed=false
   85434 $at_check_filter
   85435 echo stderr:; tee stderr <"$at_stderr"
   85436 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85437 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85438 $at_failed && at_fn_log_failure
   85439 $at_traceon; }
   85440 
   85441 { set +x
   85442 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85443 at_fn_check_prepare_trace "calc.at:641"
   85444 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85446 at_status=$? at_failed=false
   85447 $at_check_filter
   85448 echo stderr:; tee stderr <"$at_stderr"
   85449 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85450 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85451 $at_failed && at_fn_log_failure
   85452 $at_traceon; }
   85453 
   85454 
   85455 
   85456 # Normalize the observed and expected error messages, depending upon the
   85457 # options.
   85458 # 1. Remove the traces from observed.
   85459 sed '/^Starting/d
   85460 /^Entering/d
   85461 /^Stack/d
   85462 /^Reading/d
   85463 /^Reducing/d
   85464 /^Return/d
   85465 /^Shifting/d
   85466 /^state/d
   85467 /^Cleanup:/d
   85468 /^Error:/d
   85469 /^Next/d
   85470 /^Now/d
   85471 /^Discarding/d
   85472 / \$[0-9$]* = /d
   85473 /^yydestructor:/d' stderr >at-stderr
   85474 mv at-stderr stderr
   85475 # 2. Create the reference error message.
   85476 cat >expout <<'_ATEOF'
   85477 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   85478 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   85479 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   85480 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   85481 calc: error: 4444 != 1
   85482 _ATEOF
   85483 
   85484 # 3. If locations are not used, remove them.
   85485 
   85486 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85487 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85488 mv at-expout expout
   85489 # 5. Check
   85490 { set +x
   85491 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85492 at_fn_check_prepare_trace "calc.at:641"
   85493 ( $at_check_trace; cat stderr
   85494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85495 at_status=$? at_failed=false
   85496 $at_check_filter
   85497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85498 $at_diff expout "$at_stdout" || at_failed=:
   85499 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85500 $at_failed && at_fn_log_failure
   85501 $at_traceon; }
   85502 
   85503 
   85504 
   85505 # The same, but this time exercising explicitly triggered syntax errors.
   85506 # POSIX says the lookahead causing the error should not be discarded.
   85507 cat >input <<'_ATEOF'
   85508 (!) + (1 2) = 1
   85509 _ATEOF
   85510 
   85511 { set +x
   85512 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85513 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85514 ( $at_check_trace;  $PREPARSER ./calc input
   85515 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85516 at_status=$? at_failed=false
   85517 $at_check_filter
   85518 echo stderr:; tee stderr <"$at_stderr"
   85519 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85520 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85521 $at_failed && at_fn_log_failure
   85522 $at_traceon; }
   85523 
   85524 { set +x
   85525 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85526 at_fn_check_prepare_trace "calc.at:641"
   85527 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85529 at_status=$? at_failed=false
   85530 $at_check_filter
   85531 echo stderr:; tee stderr <"$at_stderr"
   85532 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85533 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85534 $at_failed && at_fn_log_failure
   85535 $at_traceon; }
   85536 
   85537 
   85538 
   85539 # Normalize the observed and expected error messages, depending upon the
   85540 # options.
   85541 # 1. Remove the traces from observed.
   85542 sed '/^Starting/d
   85543 /^Entering/d
   85544 /^Stack/d
   85545 /^Reading/d
   85546 /^Reducing/d
   85547 /^Return/d
   85548 /^Shifting/d
   85549 /^state/d
   85550 /^Cleanup:/d
   85551 /^Error:/d
   85552 /^Next/d
   85553 /^Now/d
   85554 /^Discarding/d
   85555 / \$[0-9$]* = /d
   85556 /^yydestructor:/d' stderr >at-stderr
   85557 mv at-stderr stderr
   85558 # 2. Create the reference error message.
   85559 cat >expout <<'_ATEOF'
   85560 1.10: syntax error, unexpected number
   85561 calc: error: 2222 != 1
   85562 _ATEOF
   85563 
   85564 # 3. If locations are not used, remove them.
   85565 
   85566 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85567 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85568 mv at-expout expout
   85569 # 5. Check
   85570 { set +x
   85571 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85572 at_fn_check_prepare_trace "calc.at:641"
   85573 ( $at_check_trace; cat stderr
   85574 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85575 at_status=$? at_failed=false
   85576 $at_check_filter
   85577 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85578 $at_diff expout "$at_stdout" || at_failed=:
   85579 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85580 $at_failed && at_fn_log_failure
   85581 $at_traceon; }
   85582 
   85583 
   85584 cat >input <<'_ATEOF'
   85585 (- *) + (1 2) = 1
   85586 _ATEOF
   85587 
   85588 { set +x
   85589 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85590 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85591 ( $at_check_trace;  $PREPARSER ./calc input
   85592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85593 at_status=$? at_failed=false
   85594 $at_check_filter
   85595 echo stderr:; tee stderr <"$at_stderr"
   85596 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85597 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85598 $at_failed && at_fn_log_failure
   85599 $at_traceon; }
   85600 
   85601 { set +x
   85602 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85603 at_fn_check_prepare_trace "calc.at:641"
   85604 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85605 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85606 at_status=$? at_failed=false
   85607 $at_check_filter
   85608 echo stderr:; tee stderr <"$at_stderr"
   85609 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85610 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85611 $at_failed && at_fn_log_failure
   85612 $at_traceon; }
   85613 
   85614 
   85615 
   85616 # Normalize the observed and expected error messages, depending upon the
   85617 # options.
   85618 # 1. Remove the traces from observed.
   85619 sed '/^Starting/d
   85620 /^Entering/d
   85621 /^Stack/d
   85622 /^Reading/d
   85623 /^Reducing/d
   85624 /^Return/d
   85625 /^Shifting/d
   85626 /^state/d
   85627 /^Cleanup:/d
   85628 /^Error:/d
   85629 /^Next/d
   85630 /^Now/d
   85631 /^Discarding/d
   85632 / \$[0-9$]* = /d
   85633 /^yydestructor:/d' stderr >at-stderr
   85634 mv at-stderr stderr
   85635 # 2. Create the reference error message.
   85636 cat >expout <<'_ATEOF'
   85637 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   85638 1.12: syntax error, unexpected number
   85639 calc: error: 2222 != 1
   85640 _ATEOF
   85641 
   85642 # 3. If locations are not used, remove them.
   85643 
   85644 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85645 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85646 mv at-expout expout
   85647 # 5. Check
   85648 { set +x
   85649 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85650 at_fn_check_prepare_trace "calc.at:641"
   85651 ( $at_check_trace; cat stderr
   85652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85653 at_status=$? at_failed=false
   85654 $at_check_filter
   85655 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85656 $at_diff expout "$at_stdout" || at_failed=:
   85657 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85658 $at_failed && at_fn_log_failure
   85659 $at_traceon; }
   85660 
   85661 
   85662 
   85663 # Check that yyerrok works properly: second error is not reported,
   85664 # third and fourth are.  Parse status is succesfull.
   85665 cat >input <<'_ATEOF'
   85666 (* *) + (*) + (*)
   85667 _ATEOF
   85668 
   85669 { set +x
   85670 $as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
   85671 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
   85672 ( $at_check_trace;  $PREPARSER ./calc input
   85673 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85674 at_status=$? at_failed=false
   85675 $at_check_filter
   85676 echo stderr:; tee stderr <"$at_stderr"
   85677 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85678 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85679 $at_failed && at_fn_log_failure
   85680 $at_traceon; }
   85681 
   85682 { set +x
   85683 $as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   85684 at_fn_check_prepare_trace "calc.at:641"
   85685 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   85686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85687 at_status=$? at_failed=false
   85688 $at_check_filter
   85689 echo stderr:; tee stderr <"$at_stderr"
   85690 at_fn_diff_devnull "$at_stdout" || at_failed=:
   85691 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85692 $at_failed && at_fn_log_failure
   85693 $at_traceon; }
   85694 
   85695 
   85696 
   85697 # Normalize the observed and expected error messages, depending upon the
   85698 # options.
   85699 # 1. Remove the traces from observed.
   85700 sed '/^Starting/d
   85701 /^Entering/d
   85702 /^Stack/d
   85703 /^Reading/d
   85704 /^Reducing/d
   85705 /^Return/d
   85706 /^Shifting/d
   85707 /^state/d
   85708 /^Cleanup:/d
   85709 /^Error:/d
   85710 /^Next/d
   85711 /^Now/d
   85712 /^Discarding/d
   85713 / \$[0-9$]* = /d
   85714 /^yydestructor:/d' stderr >at-stderr
   85715 mv at-stderr stderr
   85716 # 2. Create the reference error message.
   85717 cat >expout <<'_ATEOF'
   85718 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   85719 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   85720 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   85721 _ATEOF
   85722 
   85723 # 3. If locations are not used, remove them.
   85724 
   85725 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   85726 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   85727 mv at-expout expout
   85728 # 5. Check
   85729 { set +x
   85730 $as_echo "$at_srcdir/calc.at:641: cat stderr"
   85731 at_fn_check_prepare_trace "calc.at:641"
   85732 ( $at_check_trace; cat stderr
   85733 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   85734 at_status=$? at_failed=false
   85735 $at_check_filter
   85736 at_fn_diff_devnull "$at_stderr" || at_failed=:
   85737 $at_diff expout "$at_stdout" || at_failed=:
   85738 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
   85739 $at_failed && at_fn_log_failure
   85740 $at_traceon; }
   85741 
   85742 
   85743 
   85744 
   85745 
   85746   set +x
   85747   $at_times_p && times >"$at_times_file"
   85748 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   85749 read at_status <"$at_status_file"
   85750 #AT_STOP_220
   85751 #AT_START_221
   85752 at_fn_group_banner 221 'calc.at:642' \
   85753   "Calculator %glr-parser %name-prefix \"calc\"" "     " 12
   85754 at_xfail=no
   85755 (
   85756   $as_echo "221. $at_setup_line: testing $at_desc ..."
   85757   $at_traceon
   85758 
   85759 
   85760 
   85761 
   85762 
   85763 
   85764 
   85765 
   85766 
   85767 
   85768 cat >calc.y <<'_ATEOF'
   85769 %code top {
   85770 #include <config.h>
   85771 /* We don't need perfect functions for these tests. */
   85772 #undef malloc
   85773 #undef memcmp
   85774 #undef realloc
   85775 }
   85776 
   85777 /* Infix notation calculator--calc */
   85778 %glr-parser %name-prefix "calc"
   85779 
   85780 %code requires
   85781 {
   85782 
   85783   /* Exercise pre-prologue dependency to %union.  */
   85784   typedef int semantic_value;
   85785 }
   85786 
   85787 /* Exercise %union. */
   85788 %union
   85789 {
   85790   semantic_value ival;
   85791 };
   85792 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   85793 
   85794 %code provides
   85795 {
   85796   #include <stdio.h>
   85797   /* The input.  */
   85798   extern FILE *input;
   85799   extern semantic_value global_result;
   85800   extern int global_count;
   85801 }
   85802 
   85803 %code
   85804 {
   85805 #include <assert.h>
   85806 #include <string.h>
   85807 #define USE(Var)
   85808 
   85809 FILE *input;
   85810 static int power (int base, int exponent);
   85811 
   85812 static void calcerror ( const char *msg);
   85813 int calclex (void);
   85814 }
   85815 
   85816 
   85817 
   85818 /* Bison Declarations */
   85819 %token CALC_EOF 0 "end of input"
   85820 %token <ival> NUM "number"
   85821 %type  <ival> exp
   85822 
   85823 %nonassoc '=' /* comparison            */
   85824 %left '-' '+'
   85825 %left '*' '/'
   85826 %left NEG     /* negation--unary minus */
   85827 %right '^'    /* exponentiation        */
   85828 
   85829 /* Grammar follows */
   85830 %%
   85831 input:
   85832   line
   85833 | input line         {  }
   85834 ;
   85835 
   85836 line:
   85837   '\n'
   85838 | exp '\n'           { USE ($1); }
   85839 ;
   85840 
   85841 exp:
   85842   NUM                { $$ = $1;             }
   85843 | exp '=' exp
   85844   {
   85845     if ($1 != $3)
   85846       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   85847     $$ = $1;
   85848   }
   85849 | exp '+' exp        { $$ = $1 + $3;        }
   85850 | exp '-' exp        { $$ = $1 - $3;        }
   85851 | exp '*' exp        { $$ = $1 * $3;        }
   85852 | exp '/' exp        { $$ = $1 / $3;        }
   85853 | '-' exp  %prec NEG { $$ = -$2;            }
   85854 | exp '^' exp        { $$ = power ($1, $3); }
   85855 | '(' exp ')'        { $$ = $2;             }
   85856 | '(' error ')'      { $$ = 1111; yyerrok;  }
   85857 | '!'                { $$ = 0; YYERROR;     }
   85858 | '-' error          { $$ = 0; YYERROR;     }
   85859 ;
   85860 %%
   85861 
   85862 static int
   85863 power (int base, int exponent)
   85864 {
   85865   int res = 1;
   85866   assert (0 <= exponent);
   85867   for (/* Niente */; exponent; --exponent)
   85868     res *= base;
   85869   return res;
   85870 }
   85871 
   85872 
   85873 #include <stdio.h>
   85874 /* A C error reporting function.  */
   85875 static
   85876 void calcerror ( const char *msg)
   85877 {
   85878   fprintf (stderr, "%s\n", msg);
   85879 }
   85880 #include <ctype.h>
   85881 
   85882 int calclex (void);
   85883 static int get_char (void);
   85884 static void unget_char ( int c);
   85885 
   85886 
   85887 static int
   85888 get_char (void)
   85889 {
   85890   int res = getc (input);
   85891   ;
   85892 
   85893   return res;
   85894 }
   85895 
   85896 static void
   85897 unget_char ( int c)
   85898 {
   85899   ;
   85900 
   85901   ungetc (c, input);
   85902 }
   85903 
   85904 static int
   85905 read_signed_integer (void)
   85906 {
   85907   int c = get_char ();
   85908   int sign = 1;
   85909   int n = 0;
   85910 
   85911   ;
   85912   if (c == '-')
   85913     {
   85914       c = get_char ();
   85915       sign = -1;
   85916     }
   85917 
   85918   while (isdigit (c))
   85919     {
   85920       n = 10 * n + (c - '0');
   85921       c = get_char ();
   85922     }
   85923 
   85924   unget_char ( c);
   85925 
   85926   return sign * n;
   85927 }
   85928 
   85929 
   85930 /*---------------------------------------------------------------.
   85931 | Lexical analyzer returns an integer on the stack and the token |
   85932 | NUM, or the ASCII character read if not a number.  Skips all   |
   85933 | blanks and tabs, returns 0 for EOF.                            |
   85934 `---------------------------------------------------------------*/
   85935 
   85936 int calclex (void)
   85937 {
   85938   int c;
   85939   /* Skip current token, then white spaces.  */
   85940   do
   85941     {
   85942 
   85943     }
   85944   while ((c = get_char ()) == ' ' || c == '\t');
   85945 
   85946   /* process numbers   */
   85947   if (c == '.' || isdigit (c))
   85948     {
   85949       unget_char ( c);
   85950       (calclval).ival = read_signed_integer ();
   85951       return NUM;
   85952     }
   85953 
   85954   /* Return end-of-file.  */
   85955   if (c == EOF)
   85956     return CALC_EOF;
   85957 
   85958   /* Return single chars. */
   85959   return c;
   85960 }
   85961 
   85962 #include <assert.h>
   85963 #if HAVE_UNISTD_H
   85964 # include <unistd.h>
   85965 #else
   85966 # undef alarm
   85967 # define alarm(seconds) /* empty */
   85968 #endif
   85969 
   85970 
   85971 
   85972 semantic_value global_result = 0;
   85973 int global_count = 0;
   85974 
   85975 /* A C main function.  */
   85976 int
   85977 main (int argc, const char **argv)
   85978 {
   85979   semantic_value result = 0;
   85980   int count = 0;
   85981   int status;
   85982 
   85983   /* This used to be alarm (10), but that isn't enough time for
   85984      a July 1995 vintage DEC Alphastation 200 4/100 system,
   85985      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   85986   alarm (100);
   85987 
   85988   if (argc == 2)
   85989     input = fopen (argv[1], "r");
   85990   else
   85991     input = stdin;
   85992 
   85993   if (!input)
   85994     {
   85995       perror (argv[1]);
   85996       return 3;
   85997     }
   85998 
   85999 
   86000   status = calcparse ();
   86001   if (fclose (input))
   86002     perror ("fclose");
   86003   assert (global_result == result);
   86004   assert (global_count == count);
   86005   return status;
   86006 }
   86007 _ATEOF
   86008 
   86009 
   86010 
   86011 
   86012 
   86013 
   86014 
   86015 
   86016 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   86017   at_save_special_files
   86018   mkdir xml-tests
   86019     # Don't combine these Bison invocations since we want to be sure that
   86020   # --report=all isn't required to get the full XML file.
   86021   { set +x
   86022 $as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   86023                   --graph=xml-tests/test.dot -o calc.c calc.y"
   86024 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642"
   86025 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   86026                   --graph=xml-tests/test.dot -o calc.c calc.y
   86027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86028 at_status=$? at_failed=false
   86029 $at_check_filter
   86030 echo stderr:; cat "$at_stderr"
   86031 echo stdout:; cat "$at_stdout"
   86032 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86033 $at_failed && at_fn_log_failure
   86034 $at_traceon; }
   86035 
   86036   { set +x
   86037 $as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   86038 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:642"
   86039 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   86040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86041 at_status=$? at_failed=false
   86042 $at_check_filter
   86043 echo stderr:; cat "$at_stderr"
   86044 echo stdout:; cat "$at_stdout"
   86045 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86046 $at_failed && at_fn_log_failure
   86047 $at_traceon; }
   86048 
   86049     cp xml-tests/test.output expout
   86050   { set +x
   86051 $as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\
   86052              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   86053              xml-tests/test.xml"
   86054 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642"
   86055 ( $at_check_trace; $XSLTPROC \
   86056              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   86057              xml-tests/test.xml
   86058 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86059 at_status=$? at_failed=false
   86060 $at_check_filter
   86061 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86062 $at_diff expout "$at_stdout" || at_failed=:
   86063 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86064 $at_failed && at_fn_log_failure
   86065 $at_traceon; }
   86066 
   86067   sort xml-tests/test.dot > expout
   86068   { set +x
   86069 $as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\
   86070              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   86071              xml-tests/test.xml | sort"
   86072 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642"
   86073 ( $at_check_trace; $XSLTPROC \
   86074              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   86075              xml-tests/test.xml | sort
   86076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86077 at_status=$? at_failed=false
   86078 $at_check_filter
   86079 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86080 $at_diff expout "$at_stdout" || at_failed=:
   86081 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86082 $at_failed && at_fn_log_failure
   86083 $at_traceon; }
   86084 
   86085   rm -rf xml-tests expout
   86086   at_restore_special_files
   86087 fi
   86088 { set +x
   86089 $as_echo "$at_srcdir/calc.at:642: bison -o calc.c calc.y"
   86090 at_fn_check_prepare_trace "calc.at:642"
   86091 ( $at_check_trace; bison -o calc.c calc.y
   86092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86093 at_status=$? at_failed=false
   86094 $at_check_filter
   86095 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86096 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86097 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86098 $at_failed && at_fn_log_failure
   86099 $at_traceon; }
   86100 
   86101 
   86102    { set +x
   86103 $as_echo "$at_srcdir/calc.at:642: \$BISON_C_WORKS"
   86104 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:642"
   86105 ( $at_check_trace; $BISON_C_WORKS
   86106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86107 at_status=$? at_failed=false
   86108 $at_check_filter
   86109 echo stderr:; cat "$at_stderr"
   86110 echo stdout:; cat "$at_stdout"
   86111 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86112 $at_failed && at_fn_log_failure
   86113 $at_traceon; }
   86114 
   86115 { set +x
   86116 $as_echo "$at_srcdir/calc.at:642: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   86117 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:642"
   86118 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   86119 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86120 at_status=$? at_failed=false
   86121 $at_check_filter
   86122 echo stderr:; cat "$at_stderr"
   86123 echo stdout:; cat "$at_stdout"
   86124 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86125 $at_failed && at_fn_log_failure
   86126 $at_traceon; }
   86127 
   86128 
   86129 { set +x
   86130 $as_echo "$at_srcdir/calc.at:642: \$PERL -ne '
   86131   chomp;
   86132   print \"\$.: {\$_}\\n\"
   86133     if (# No starting/ending empty lines.
   86134         (eof || \$. == 1) && /^\\s*\$/
   86135         # No trailing space.  FIXME: not ready for \"maint\".
   86136         # || /\\s\$/
   86137         )' calc.c
   86138 "
   86139 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642"
   86140 ( $at_check_trace; $PERL -ne '
   86141   chomp;
   86142   print "$.: {$_}\n"
   86143     if (# No starting/ending empty lines.
   86144         (eof || $. == 1) && /^\s*$/
   86145         # No trailing space.  FIXME: not ready for "maint".
   86146         # || /\s$/
   86147         )' calc.c
   86148 
   86149 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86150 at_status=$? at_failed=false
   86151 $at_check_filter
   86152 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86153 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86154 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86155 $at_failed && at_fn_log_failure
   86156 $at_traceon; }
   86157 
   86158 
   86159 
   86160 # Test the priorities.
   86161 cat >input <<'_ATEOF'
   86162 1 + 2 * 3 = 7
   86163 1 + 2 * -3 = -5
   86164 
   86165 -1^2 = -1
   86166 (-1)^2 = 1
   86167 
   86168 ---1 = -1
   86169 
   86170 1 - 2 - 3 = -4
   86171 1 - (2 - 3) = 2
   86172 
   86173 2^2^3 = 256
   86174 (2^2)^3 = 64
   86175 _ATEOF
   86176 
   86177 { set +x
   86178 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86179 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86180 ( $at_check_trace;  $PREPARSER ./calc input
   86181 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86182 at_status=$? at_failed=false
   86183 $at_check_filter
   86184 echo stderr:; tee stderr <"$at_stderr"
   86185 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86186 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86187 $at_failed && at_fn_log_failure
   86188 $at_traceon; }
   86189 
   86190 { set +x
   86191 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86192 at_fn_check_prepare_trace "calc.at:642"
   86193 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86194 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86195 at_status=$? at_failed=false
   86196 $at_check_filter
   86197 echo stderr:; tee stderr <"$at_stderr"
   86198 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86199 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86200 $at_failed && at_fn_log_failure
   86201 $at_traceon; }
   86202 
   86203 
   86204 
   86205 
   86206 # Some syntax errors.
   86207 cat >input <<'_ATEOF'
   86208 1 2
   86209 _ATEOF
   86210 
   86211 { set +x
   86212 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86213 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86214 ( $at_check_trace;  $PREPARSER ./calc input
   86215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86216 at_status=$? at_failed=false
   86217 $at_check_filter
   86218 echo stderr:; tee stderr <"$at_stderr"
   86219 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86220 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
   86221 $at_failed && at_fn_log_failure
   86222 $at_traceon; }
   86223 
   86224 { set +x
   86225 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86226 at_fn_check_prepare_trace "calc.at:642"
   86227 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86228 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86229 at_status=$? at_failed=false
   86230 $at_check_filter
   86231 echo stderr:; tee stderr <"$at_stderr"
   86232 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86233 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86234 $at_failed && at_fn_log_failure
   86235 $at_traceon; }
   86236 
   86237 
   86238 
   86239 # Normalize the observed and expected error messages, depending upon the
   86240 # options.
   86241 # 1. Remove the traces from observed.
   86242 sed '/^Starting/d
   86243 /^Entering/d
   86244 /^Stack/d
   86245 /^Reading/d
   86246 /^Reducing/d
   86247 /^Return/d
   86248 /^Shifting/d
   86249 /^state/d
   86250 /^Cleanup:/d
   86251 /^Error:/d
   86252 /^Next/d
   86253 /^Now/d
   86254 /^Discarding/d
   86255 / \$[0-9$]* = /d
   86256 /^yydestructor:/d' stderr >at-stderr
   86257 mv at-stderr stderr
   86258 # 2. Create the reference error message.
   86259 cat >expout <<'_ATEOF'
   86260 1.3: syntax error, unexpected number
   86261 _ATEOF
   86262 
   86263 # 3. If locations are not used, remove them.
   86264 sed 's/^[-0-9.]*: //' expout >at-expout
   86265 mv at-expout expout
   86266 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86267 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86268 mv at-expout expout
   86269 # 5. Check
   86270 { set +x
   86271 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86272 at_fn_check_prepare_trace "calc.at:642"
   86273 ( $at_check_trace; cat stderr
   86274 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86275 at_status=$? at_failed=false
   86276 $at_check_filter
   86277 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86278 $at_diff expout "$at_stdout" || at_failed=:
   86279 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86280 $at_failed && at_fn_log_failure
   86281 $at_traceon; }
   86282 
   86283 
   86284 cat >input <<'_ATEOF'
   86285 1//2
   86286 _ATEOF
   86287 
   86288 { set +x
   86289 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86290 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86291 ( $at_check_trace;  $PREPARSER ./calc input
   86292 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86293 at_status=$? at_failed=false
   86294 $at_check_filter
   86295 echo stderr:; tee stderr <"$at_stderr"
   86296 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86297 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
   86298 $at_failed && at_fn_log_failure
   86299 $at_traceon; }
   86300 
   86301 { set +x
   86302 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86303 at_fn_check_prepare_trace "calc.at:642"
   86304 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86306 at_status=$? at_failed=false
   86307 $at_check_filter
   86308 echo stderr:; tee stderr <"$at_stderr"
   86309 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86310 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86311 $at_failed && at_fn_log_failure
   86312 $at_traceon; }
   86313 
   86314 
   86315 
   86316 # Normalize the observed and expected error messages, depending upon the
   86317 # options.
   86318 # 1. Remove the traces from observed.
   86319 sed '/^Starting/d
   86320 /^Entering/d
   86321 /^Stack/d
   86322 /^Reading/d
   86323 /^Reducing/d
   86324 /^Return/d
   86325 /^Shifting/d
   86326 /^state/d
   86327 /^Cleanup:/d
   86328 /^Error:/d
   86329 /^Next/d
   86330 /^Now/d
   86331 /^Discarding/d
   86332 / \$[0-9$]* = /d
   86333 /^yydestructor:/d' stderr >at-stderr
   86334 mv at-stderr stderr
   86335 # 2. Create the reference error message.
   86336 cat >expout <<'_ATEOF'
   86337 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   86338 _ATEOF
   86339 
   86340 # 3. If locations are not used, remove them.
   86341 sed 's/^[-0-9.]*: //' expout >at-expout
   86342 mv at-expout expout
   86343 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86344 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86345 mv at-expout expout
   86346 # 5. Check
   86347 { set +x
   86348 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86349 at_fn_check_prepare_trace "calc.at:642"
   86350 ( $at_check_trace; cat stderr
   86351 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86352 at_status=$? at_failed=false
   86353 $at_check_filter
   86354 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86355 $at_diff expout "$at_stdout" || at_failed=:
   86356 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86357 $at_failed && at_fn_log_failure
   86358 $at_traceon; }
   86359 
   86360 
   86361 cat >input <<'_ATEOF'
   86362 error
   86363 _ATEOF
   86364 
   86365 { set +x
   86366 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86367 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86368 ( $at_check_trace;  $PREPARSER ./calc input
   86369 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86370 at_status=$? at_failed=false
   86371 $at_check_filter
   86372 echo stderr:; tee stderr <"$at_stderr"
   86373 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86374 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
   86375 $at_failed && at_fn_log_failure
   86376 $at_traceon; }
   86377 
   86378 { set +x
   86379 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86380 at_fn_check_prepare_trace "calc.at:642"
   86381 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86382 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86383 at_status=$? at_failed=false
   86384 $at_check_filter
   86385 echo stderr:; tee stderr <"$at_stderr"
   86386 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86387 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86388 $at_failed && at_fn_log_failure
   86389 $at_traceon; }
   86390 
   86391 
   86392 
   86393 # Normalize the observed and expected error messages, depending upon the
   86394 # options.
   86395 # 1. Remove the traces from observed.
   86396 sed '/^Starting/d
   86397 /^Entering/d
   86398 /^Stack/d
   86399 /^Reading/d
   86400 /^Reducing/d
   86401 /^Return/d
   86402 /^Shifting/d
   86403 /^state/d
   86404 /^Cleanup:/d
   86405 /^Error:/d
   86406 /^Next/d
   86407 /^Now/d
   86408 /^Discarding/d
   86409 / \$[0-9$]* = /d
   86410 /^yydestructor:/d' stderr >at-stderr
   86411 mv at-stderr stderr
   86412 # 2. Create the reference error message.
   86413 cat >expout <<'_ATEOF'
   86414 1.1: syntax error, unexpected $undefined
   86415 _ATEOF
   86416 
   86417 # 3. If locations are not used, remove them.
   86418 sed 's/^[-0-9.]*: //' expout >at-expout
   86419 mv at-expout expout
   86420 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86421 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86422 mv at-expout expout
   86423 # 5. Check
   86424 { set +x
   86425 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86426 at_fn_check_prepare_trace "calc.at:642"
   86427 ( $at_check_trace; cat stderr
   86428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86429 at_status=$? at_failed=false
   86430 $at_check_filter
   86431 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86432 $at_diff expout "$at_stdout" || at_failed=:
   86433 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86434 $at_failed && at_fn_log_failure
   86435 $at_traceon; }
   86436 
   86437 
   86438 cat >input <<'_ATEOF'
   86439 1 = 2 = 3
   86440 _ATEOF
   86441 
   86442 { set +x
   86443 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86444 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86445 ( $at_check_trace;  $PREPARSER ./calc input
   86446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86447 at_status=$? at_failed=false
   86448 $at_check_filter
   86449 echo stderr:; tee stderr <"$at_stderr"
   86450 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86451 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
   86452 $at_failed && at_fn_log_failure
   86453 $at_traceon; }
   86454 
   86455 { set +x
   86456 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86457 at_fn_check_prepare_trace "calc.at:642"
   86458 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86459 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86460 at_status=$? at_failed=false
   86461 $at_check_filter
   86462 echo stderr:; tee stderr <"$at_stderr"
   86463 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86464 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86465 $at_failed && at_fn_log_failure
   86466 $at_traceon; }
   86467 
   86468 
   86469 
   86470 # Normalize the observed and expected error messages, depending upon the
   86471 # options.
   86472 # 1. Remove the traces from observed.
   86473 sed '/^Starting/d
   86474 /^Entering/d
   86475 /^Stack/d
   86476 /^Reading/d
   86477 /^Reducing/d
   86478 /^Return/d
   86479 /^Shifting/d
   86480 /^state/d
   86481 /^Cleanup:/d
   86482 /^Error:/d
   86483 /^Next/d
   86484 /^Now/d
   86485 /^Discarding/d
   86486 / \$[0-9$]* = /d
   86487 /^yydestructor:/d' stderr >at-stderr
   86488 mv at-stderr stderr
   86489 # 2. Create the reference error message.
   86490 cat >expout <<'_ATEOF'
   86491 1.7: syntax error, unexpected '='
   86492 _ATEOF
   86493 
   86494 # 3. If locations are not used, remove them.
   86495 sed 's/^[-0-9.]*: //' expout >at-expout
   86496 mv at-expout expout
   86497 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86498 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86499 mv at-expout expout
   86500 # 5. Check
   86501 { set +x
   86502 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86503 at_fn_check_prepare_trace "calc.at:642"
   86504 ( $at_check_trace; cat stderr
   86505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86506 at_status=$? at_failed=false
   86507 $at_check_filter
   86508 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86509 $at_diff expout "$at_stdout" || at_failed=:
   86510 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86511 $at_failed && at_fn_log_failure
   86512 $at_traceon; }
   86513 
   86514 
   86515 cat >input <<'_ATEOF'
   86516 
   86517 +1
   86518 _ATEOF
   86519 
   86520 { set +x
   86521 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86522 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86523 ( $at_check_trace;  $PREPARSER ./calc input
   86524 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86525 at_status=$? at_failed=false
   86526 $at_check_filter
   86527 echo stderr:; tee stderr <"$at_stderr"
   86528 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86529 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
   86530 $at_failed && at_fn_log_failure
   86531 $at_traceon; }
   86532 
   86533 { set +x
   86534 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86535 at_fn_check_prepare_trace "calc.at:642"
   86536 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86537 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86538 at_status=$? at_failed=false
   86539 $at_check_filter
   86540 echo stderr:; tee stderr <"$at_stderr"
   86541 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86542 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86543 $at_failed && at_fn_log_failure
   86544 $at_traceon; }
   86545 
   86546 
   86547 
   86548 # Normalize the observed and expected error messages, depending upon the
   86549 # options.
   86550 # 1. Remove the traces from observed.
   86551 sed '/^Starting/d
   86552 /^Entering/d
   86553 /^Stack/d
   86554 /^Reading/d
   86555 /^Reducing/d
   86556 /^Return/d
   86557 /^Shifting/d
   86558 /^state/d
   86559 /^Cleanup:/d
   86560 /^Error:/d
   86561 /^Next/d
   86562 /^Now/d
   86563 /^Discarding/d
   86564 / \$[0-9$]* = /d
   86565 /^yydestructor:/d' stderr >at-stderr
   86566 mv at-stderr stderr
   86567 # 2. Create the reference error message.
   86568 cat >expout <<'_ATEOF'
   86569 2.1: syntax error, unexpected '+'
   86570 _ATEOF
   86571 
   86572 # 3. If locations are not used, remove them.
   86573 sed 's/^[-0-9.]*: //' expout >at-expout
   86574 mv at-expout expout
   86575 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86576 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86577 mv at-expout expout
   86578 # 5. Check
   86579 { set +x
   86580 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86581 at_fn_check_prepare_trace "calc.at:642"
   86582 ( $at_check_trace; cat stderr
   86583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86584 at_status=$? at_failed=false
   86585 $at_check_filter
   86586 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86587 $at_diff expout "$at_stdout" || at_failed=:
   86588 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86589 $at_failed && at_fn_log_failure
   86590 $at_traceon; }
   86591 
   86592 
   86593 # Exercise error messages with EOF: work on an empty file.
   86594 { set +x
   86595 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc /dev/null"
   86596 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:642"
   86597 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   86598 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86599 at_status=$? at_failed=false
   86600 $at_check_filter
   86601 echo stderr:; tee stderr <"$at_stderr"
   86602 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86603 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
   86604 $at_failed && at_fn_log_failure
   86605 $at_traceon; }
   86606 
   86607 { set +x
   86608 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86609 at_fn_check_prepare_trace "calc.at:642"
   86610 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86611 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86612 at_status=$? at_failed=false
   86613 $at_check_filter
   86614 echo stderr:; tee stderr <"$at_stderr"
   86615 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86616 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86617 $at_failed && at_fn_log_failure
   86618 $at_traceon; }
   86619 
   86620 
   86621 
   86622 # Normalize the observed and expected error messages, depending upon the
   86623 # options.
   86624 # 1. Remove the traces from observed.
   86625 sed '/^Starting/d
   86626 /^Entering/d
   86627 /^Stack/d
   86628 /^Reading/d
   86629 /^Reducing/d
   86630 /^Return/d
   86631 /^Shifting/d
   86632 /^state/d
   86633 /^Cleanup:/d
   86634 /^Error:/d
   86635 /^Next/d
   86636 /^Now/d
   86637 /^Discarding/d
   86638 / \$[0-9$]* = /d
   86639 /^yydestructor:/d' stderr >at-stderr
   86640 mv at-stderr stderr
   86641 # 2. Create the reference error message.
   86642 cat >expout <<'_ATEOF'
   86643 1.1: syntax error, unexpected end of input
   86644 _ATEOF
   86645 
   86646 # 3. If locations are not used, remove them.
   86647 sed 's/^[-0-9.]*: //' expout >at-expout
   86648 mv at-expout expout
   86649 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86650 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86651 mv at-expout expout
   86652 # 5. Check
   86653 { set +x
   86654 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86655 at_fn_check_prepare_trace "calc.at:642"
   86656 ( $at_check_trace; cat stderr
   86657 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86658 at_status=$? at_failed=false
   86659 $at_check_filter
   86660 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86661 $at_diff expout "$at_stdout" || at_failed=:
   86662 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86663 $at_failed && at_fn_log_failure
   86664 $at_traceon; }
   86665 
   86666 
   86667 
   86668 # Exercise the error token: without it, we die at the first error,
   86669 # hence be sure to
   86670 #
   86671 # - have several errors which exercise different shift/discardings
   86672 #   - (): nothing to pop, nothing to discard
   86673 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   86674 #   - (* * *): nothing to pop, a lot to discard
   86675 #   - (1 + 2 * *): some to pop and discard
   86676 #
   86677 # - test the action associated to `error'
   86678 #
   86679 # - check the lookahead that triggers an error is not discarded
   86680 #   when we enter error recovery.  Below, the lookahead causing the
   86681 #   first error is ")", which is needed to recover from the error and
   86682 #   produce the "0" that triggers the "0 != 1" error.
   86683 #
   86684 cat >input <<'_ATEOF'
   86685 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   86686 _ATEOF
   86687 
   86688 { set +x
   86689 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86690 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86691 ( $at_check_trace;  $PREPARSER ./calc input
   86692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86693 at_status=$? at_failed=false
   86694 $at_check_filter
   86695 echo stderr:; tee stderr <"$at_stderr"
   86696 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86697 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86698 $at_failed && at_fn_log_failure
   86699 $at_traceon; }
   86700 
   86701 { set +x
   86702 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86703 at_fn_check_prepare_trace "calc.at:642"
   86704 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86705 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86706 at_status=$? at_failed=false
   86707 $at_check_filter
   86708 echo stderr:; tee stderr <"$at_stderr"
   86709 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86710 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86711 $at_failed && at_fn_log_failure
   86712 $at_traceon; }
   86713 
   86714 
   86715 
   86716 # Normalize the observed and expected error messages, depending upon the
   86717 # options.
   86718 # 1. Remove the traces from observed.
   86719 sed '/^Starting/d
   86720 /^Entering/d
   86721 /^Stack/d
   86722 /^Reading/d
   86723 /^Reducing/d
   86724 /^Return/d
   86725 /^Shifting/d
   86726 /^state/d
   86727 /^Cleanup:/d
   86728 /^Error:/d
   86729 /^Next/d
   86730 /^Now/d
   86731 /^Discarding/d
   86732 / \$[0-9$]* = /d
   86733 /^yydestructor:/d' stderr >at-stderr
   86734 mv at-stderr stderr
   86735 # 2. Create the reference error message.
   86736 cat >expout <<'_ATEOF'
   86737 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   86738 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   86739 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   86740 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   86741 calc: error: 4444 != 1
   86742 _ATEOF
   86743 
   86744 # 3. If locations are not used, remove them.
   86745 sed 's/^[-0-9.]*: //' expout >at-expout
   86746 mv at-expout expout
   86747 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86748 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86749 mv at-expout expout
   86750 # 5. Check
   86751 { set +x
   86752 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86753 at_fn_check_prepare_trace "calc.at:642"
   86754 ( $at_check_trace; cat stderr
   86755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86756 at_status=$? at_failed=false
   86757 $at_check_filter
   86758 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86759 $at_diff expout "$at_stdout" || at_failed=:
   86760 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86761 $at_failed && at_fn_log_failure
   86762 $at_traceon; }
   86763 
   86764 
   86765 
   86766 # The same, but this time exercising explicitly triggered syntax errors.
   86767 # POSIX says the lookahead causing the error should not be discarded.
   86768 cat >input <<'_ATEOF'
   86769 (!) + (1 2) = 1
   86770 _ATEOF
   86771 
   86772 { set +x
   86773 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86774 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86775 ( $at_check_trace;  $PREPARSER ./calc input
   86776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86777 at_status=$? at_failed=false
   86778 $at_check_filter
   86779 echo stderr:; tee stderr <"$at_stderr"
   86780 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86781 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86782 $at_failed && at_fn_log_failure
   86783 $at_traceon; }
   86784 
   86785 { set +x
   86786 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86787 at_fn_check_prepare_trace "calc.at:642"
   86788 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86790 at_status=$? at_failed=false
   86791 $at_check_filter
   86792 echo stderr:; tee stderr <"$at_stderr"
   86793 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86795 $at_failed && at_fn_log_failure
   86796 $at_traceon; }
   86797 
   86798 
   86799 
   86800 # Normalize the observed and expected error messages, depending upon the
   86801 # options.
   86802 # 1. Remove the traces from observed.
   86803 sed '/^Starting/d
   86804 /^Entering/d
   86805 /^Stack/d
   86806 /^Reading/d
   86807 /^Reducing/d
   86808 /^Return/d
   86809 /^Shifting/d
   86810 /^state/d
   86811 /^Cleanup:/d
   86812 /^Error:/d
   86813 /^Next/d
   86814 /^Now/d
   86815 /^Discarding/d
   86816 / \$[0-9$]* = /d
   86817 /^yydestructor:/d' stderr >at-stderr
   86818 mv at-stderr stderr
   86819 # 2. Create the reference error message.
   86820 cat >expout <<'_ATEOF'
   86821 1.10: syntax error, unexpected number
   86822 calc: error: 2222 != 1
   86823 _ATEOF
   86824 
   86825 # 3. If locations are not used, remove them.
   86826 sed 's/^[-0-9.]*: //' expout >at-expout
   86827 mv at-expout expout
   86828 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86829 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86830 mv at-expout expout
   86831 # 5. Check
   86832 { set +x
   86833 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86834 at_fn_check_prepare_trace "calc.at:642"
   86835 ( $at_check_trace; cat stderr
   86836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86837 at_status=$? at_failed=false
   86838 $at_check_filter
   86839 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86840 $at_diff expout "$at_stdout" || at_failed=:
   86841 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86842 $at_failed && at_fn_log_failure
   86843 $at_traceon; }
   86844 
   86845 
   86846 cat >input <<'_ATEOF'
   86847 (- *) + (1 2) = 1
   86848 _ATEOF
   86849 
   86850 { set +x
   86851 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86852 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86853 ( $at_check_trace;  $PREPARSER ./calc input
   86854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86855 at_status=$? at_failed=false
   86856 $at_check_filter
   86857 echo stderr:; tee stderr <"$at_stderr"
   86858 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86859 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86860 $at_failed && at_fn_log_failure
   86861 $at_traceon; }
   86862 
   86863 { set +x
   86864 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86865 at_fn_check_prepare_trace "calc.at:642"
   86866 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86868 at_status=$? at_failed=false
   86869 $at_check_filter
   86870 echo stderr:; tee stderr <"$at_stderr"
   86871 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86872 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86873 $at_failed && at_fn_log_failure
   86874 $at_traceon; }
   86875 
   86876 
   86877 
   86878 # Normalize the observed and expected error messages, depending upon the
   86879 # options.
   86880 # 1. Remove the traces from observed.
   86881 sed '/^Starting/d
   86882 /^Entering/d
   86883 /^Stack/d
   86884 /^Reading/d
   86885 /^Reducing/d
   86886 /^Return/d
   86887 /^Shifting/d
   86888 /^state/d
   86889 /^Cleanup:/d
   86890 /^Error:/d
   86891 /^Next/d
   86892 /^Now/d
   86893 /^Discarding/d
   86894 / \$[0-9$]* = /d
   86895 /^yydestructor:/d' stderr >at-stderr
   86896 mv at-stderr stderr
   86897 # 2. Create the reference error message.
   86898 cat >expout <<'_ATEOF'
   86899 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   86900 1.12: syntax error, unexpected number
   86901 calc: error: 2222 != 1
   86902 _ATEOF
   86903 
   86904 # 3. If locations are not used, remove them.
   86905 sed 's/^[-0-9.]*: //' expout >at-expout
   86906 mv at-expout expout
   86907 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86908 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86909 mv at-expout expout
   86910 # 5. Check
   86911 { set +x
   86912 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86913 at_fn_check_prepare_trace "calc.at:642"
   86914 ( $at_check_trace; cat stderr
   86915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86916 at_status=$? at_failed=false
   86917 $at_check_filter
   86918 at_fn_diff_devnull "$at_stderr" || at_failed=:
   86919 $at_diff expout "$at_stdout" || at_failed=:
   86920 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86921 $at_failed && at_fn_log_failure
   86922 $at_traceon; }
   86923 
   86924 
   86925 
   86926 # Check that yyerrok works properly: second error is not reported,
   86927 # third and fourth are.  Parse status is succesfull.
   86928 cat >input <<'_ATEOF'
   86929 (* *) + (*) + (*)
   86930 _ATEOF
   86931 
   86932 { set +x
   86933 $as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
   86934 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
   86935 ( $at_check_trace;  $PREPARSER ./calc input
   86936 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86937 at_status=$? at_failed=false
   86938 $at_check_filter
   86939 echo stderr:; tee stderr <"$at_stderr"
   86940 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86941 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86942 $at_failed && at_fn_log_failure
   86943 $at_traceon; }
   86944 
   86945 { set +x
   86946 $as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   86947 at_fn_check_prepare_trace "calc.at:642"
   86948 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   86949 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86950 at_status=$? at_failed=false
   86951 $at_check_filter
   86952 echo stderr:; tee stderr <"$at_stderr"
   86953 at_fn_diff_devnull "$at_stdout" || at_failed=:
   86954 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   86955 $at_failed && at_fn_log_failure
   86956 $at_traceon; }
   86957 
   86958 
   86959 
   86960 # Normalize the observed and expected error messages, depending upon the
   86961 # options.
   86962 # 1. Remove the traces from observed.
   86963 sed '/^Starting/d
   86964 /^Entering/d
   86965 /^Stack/d
   86966 /^Reading/d
   86967 /^Reducing/d
   86968 /^Return/d
   86969 /^Shifting/d
   86970 /^state/d
   86971 /^Cleanup:/d
   86972 /^Error:/d
   86973 /^Next/d
   86974 /^Now/d
   86975 /^Discarding/d
   86976 / \$[0-9$]* = /d
   86977 /^yydestructor:/d' stderr >at-stderr
   86978 mv at-stderr stderr
   86979 # 2. Create the reference error message.
   86980 cat >expout <<'_ATEOF'
   86981 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   86982 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   86983 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   86984 _ATEOF
   86985 
   86986 # 3. If locations are not used, remove them.
   86987 sed 's/^[-0-9.]*: //' expout >at-expout
   86988 mv at-expout expout
   86989 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   86990 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   86991 mv at-expout expout
   86992 # 5. Check
   86993 { set +x
   86994 $as_echo "$at_srcdir/calc.at:642: cat stderr"
   86995 at_fn_check_prepare_trace "calc.at:642"
   86996 ( $at_check_trace; cat stderr
   86997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   86998 at_status=$? at_failed=false
   86999 $at_check_filter
   87000 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87001 $at_diff expout "$at_stdout" || at_failed=:
   87002 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
   87003 $at_failed && at_fn_log_failure
   87004 $at_traceon; }
   87005 
   87006 
   87007 
   87008 
   87009 
   87010   set +x
   87011   $at_times_p && times >"$at_times_file"
   87012 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   87013 read at_status <"$at_status_file"
   87014 #AT_STOP_221
   87015 #AT_START_222
   87016 at_fn_group_banner 222 'calc.at:643' \
   87017   "Calculator %glr-parser %define api.prefix \"calc\"" "" 12
   87018 at_xfail=no
   87019 (
   87020   $as_echo "222. $at_setup_line: testing $at_desc ..."
   87021   $at_traceon
   87022 
   87023 
   87024 
   87025 
   87026 
   87027 
   87028 
   87029 
   87030 
   87031 
   87032 cat >calc.y <<'_ATEOF'
   87033 %code top {
   87034 #include <config.h>
   87035 /* We don't need perfect functions for these tests. */
   87036 #undef malloc
   87037 #undef memcmp
   87038 #undef realloc
   87039 }
   87040 
   87041 /* Infix notation calculator--calc */
   87042 %glr-parser %define api.prefix "calc"
   87043 
   87044 %code requires
   87045 {
   87046 
   87047   /* Exercise pre-prologue dependency to %union.  */
   87048   typedef int semantic_value;
   87049 }
   87050 
   87051 /* Exercise %union. */
   87052 %union
   87053 {
   87054   semantic_value ival;
   87055 };
   87056 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   87057 
   87058 %code provides
   87059 {
   87060   #include <stdio.h>
   87061   /* The input.  */
   87062   extern FILE *input;
   87063   extern semantic_value global_result;
   87064   extern int global_count;
   87065 }
   87066 
   87067 %code
   87068 {
   87069 #include <assert.h>
   87070 #include <string.h>
   87071 #define USE(Var)
   87072 
   87073 FILE *input;
   87074 static int power (int base, int exponent);
   87075 
   87076 static void calcerror ( const char *msg);
   87077 int calclex (void);
   87078 }
   87079 
   87080 
   87081 
   87082 /* Bison Declarations */
   87083 %token CALC_EOF 0 "end of input"
   87084 %token <ival> NUM "number"
   87085 %type  <ival> exp
   87086 
   87087 %nonassoc '=' /* comparison            */
   87088 %left '-' '+'
   87089 %left '*' '/'
   87090 %left NEG     /* negation--unary minus */
   87091 %right '^'    /* exponentiation        */
   87092 
   87093 /* Grammar follows */
   87094 %%
   87095 input:
   87096   line
   87097 | input line         {  }
   87098 ;
   87099 
   87100 line:
   87101   '\n'
   87102 | exp '\n'           { USE ($1); }
   87103 ;
   87104 
   87105 exp:
   87106   NUM                { $$ = $1;             }
   87107 | exp '=' exp
   87108   {
   87109     if ($1 != $3)
   87110       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   87111     $$ = $1;
   87112   }
   87113 | exp '+' exp        { $$ = $1 + $3;        }
   87114 | exp '-' exp        { $$ = $1 - $3;        }
   87115 | exp '*' exp        { $$ = $1 * $3;        }
   87116 | exp '/' exp        { $$ = $1 / $3;        }
   87117 | '-' exp  %prec NEG { $$ = -$2;            }
   87118 | exp '^' exp        { $$ = power ($1, $3); }
   87119 | '(' exp ')'        { $$ = $2;             }
   87120 | '(' error ')'      { $$ = 1111; yyerrok;  }
   87121 | '!'                { $$ = 0; YYERROR;     }
   87122 | '-' error          { $$ = 0; YYERROR;     }
   87123 ;
   87124 %%
   87125 
   87126 static int
   87127 power (int base, int exponent)
   87128 {
   87129   int res = 1;
   87130   assert (0 <= exponent);
   87131   for (/* Niente */; exponent; --exponent)
   87132     res *= base;
   87133   return res;
   87134 }
   87135 
   87136 
   87137 #include <stdio.h>
   87138 /* A C error reporting function.  */
   87139 static
   87140 void calcerror ( const char *msg)
   87141 {
   87142   fprintf (stderr, "%s\n", msg);
   87143 }
   87144 #include <ctype.h>
   87145 
   87146 int calclex (void);
   87147 static int get_char (void);
   87148 static void unget_char ( int c);
   87149 
   87150 
   87151 static int
   87152 get_char (void)
   87153 {
   87154   int res = getc (input);
   87155   ;
   87156 
   87157   return res;
   87158 }
   87159 
   87160 static void
   87161 unget_char ( int c)
   87162 {
   87163   ;
   87164 
   87165   ungetc (c, input);
   87166 }
   87167 
   87168 static int
   87169 read_signed_integer (void)
   87170 {
   87171   int c = get_char ();
   87172   int sign = 1;
   87173   int n = 0;
   87174 
   87175   ;
   87176   if (c == '-')
   87177     {
   87178       c = get_char ();
   87179       sign = -1;
   87180     }
   87181 
   87182   while (isdigit (c))
   87183     {
   87184       n = 10 * n + (c - '0');
   87185       c = get_char ();
   87186     }
   87187 
   87188   unget_char ( c);
   87189 
   87190   return sign * n;
   87191 }
   87192 
   87193 
   87194 /*---------------------------------------------------------------.
   87195 | Lexical analyzer returns an integer on the stack and the token |
   87196 | NUM, or the ASCII character read if not a number.  Skips all   |
   87197 | blanks and tabs, returns 0 for EOF.                            |
   87198 `---------------------------------------------------------------*/
   87199 
   87200 int calclex (void)
   87201 {
   87202   int c;
   87203   /* Skip current token, then white spaces.  */
   87204   do
   87205     {
   87206 
   87207     }
   87208   while ((c = get_char ()) == ' ' || c == '\t');
   87209 
   87210   /* process numbers   */
   87211   if (c == '.' || isdigit (c))
   87212     {
   87213       unget_char ( c);
   87214       (calclval).ival = read_signed_integer ();
   87215       return NUM;
   87216     }
   87217 
   87218   /* Return end-of-file.  */
   87219   if (c == EOF)
   87220     return CALC_EOF;
   87221 
   87222   /* Return single chars. */
   87223   return c;
   87224 }
   87225 
   87226 #include <assert.h>
   87227 #if HAVE_UNISTD_H
   87228 # include <unistd.h>
   87229 #else
   87230 # undef alarm
   87231 # define alarm(seconds) /* empty */
   87232 #endif
   87233 
   87234 
   87235 
   87236 semantic_value global_result = 0;
   87237 int global_count = 0;
   87238 
   87239 /* A C main function.  */
   87240 int
   87241 main (int argc, const char **argv)
   87242 {
   87243   semantic_value result = 0;
   87244   int count = 0;
   87245   int status;
   87246 
   87247   /* This used to be alarm (10), but that isn't enough time for
   87248      a July 1995 vintage DEC Alphastation 200 4/100 system,
   87249      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   87250   alarm (100);
   87251 
   87252   if (argc == 2)
   87253     input = fopen (argv[1], "r");
   87254   else
   87255     input = stdin;
   87256 
   87257   if (!input)
   87258     {
   87259       perror (argv[1]);
   87260       return 3;
   87261     }
   87262 
   87263 
   87264   status = calcparse ();
   87265   if (fclose (input))
   87266     perror ("fclose");
   87267   assert (global_result == result);
   87268   assert (global_count == count);
   87269   return status;
   87270 }
   87271 _ATEOF
   87272 
   87273 
   87274 
   87275 
   87276 
   87277 
   87278 
   87279 
   87280 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   87281   at_save_special_files
   87282   mkdir xml-tests
   87283     # Don't combine these Bison invocations since we want to be sure that
   87284   # --report=all isn't required to get the full XML file.
   87285   { set +x
   87286 $as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   87287                   --graph=xml-tests/test.dot -o calc.c calc.y"
   87288 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643"
   87289 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   87290                   --graph=xml-tests/test.dot -o calc.c calc.y
   87291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87292 at_status=$? at_failed=false
   87293 $at_check_filter
   87294 echo stderr:; cat "$at_stderr"
   87295 echo stdout:; cat "$at_stdout"
   87296 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87297 $at_failed && at_fn_log_failure
   87298 $at_traceon; }
   87299 
   87300   { set +x
   87301 $as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   87302 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:643"
   87303 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   87304 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87305 at_status=$? at_failed=false
   87306 $at_check_filter
   87307 echo stderr:; cat "$at_stderr"
   87308 echo stdout:; cat "$at_stdout"
   87309 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87310 $at_failed && at_fn_log_failure
   87311 $at_traceon; }
   87312 
   87313     cp xml-tests/test.output expout
   87314   { set +x
   87315 $as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\
   87316              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   87317              xml-tests/test.xml"
   87318 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643"
   87319 ( $at_check_trace; $XSLTPROC \
   87320              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   87321              xml-tests/test.xml
   87322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87323 at_status=$? at_failed=false
   87324 $at_check_filter
   87325 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87326 $at_diff expout "$at_stdout" || at_failed=:
   87327 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87328 $at_failed && at_fn_log_failure
   87329 $at_traceon; }
   87330 
   87331   sort xml-tests/test.dot > expout
   87332   { set +x
   87333 $as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\
   87334              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   87335              xml-tests/test.xml | sort"
   87336 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643"
   87337 ( $at_check_trace; $XSLTPROC \
   87338              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   87339              xml-tests/test.xml | sort
   87340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87341 at_status=$? at_failed=false
   87342 $at_check_filter
   87343 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87344 $at_diff expout "$at_stdout" || at_failed=:
   87345 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87346 $at_failed && at_fn_log_failure
   87347 $at_traceon; }
   87348 
   87349   rm -rf xml-tests expout
   87350   at_restore_special_files
   87351 fi
   87352 { set +x
   87353 $as_echo "$at_srcdir/calc.at:643: bison -o calc.c calc.y"
   87354 at_fn_check_prepare_trace "calc.at:643"
   87355 ( $at_check_trace; bison -o calc.c calc.y
   87356 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87357 at_status=$? at_failed=false
   87358 $at_check_filter
   87359 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87360 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87361 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87362 $at_failed && at_fn_log_failure
   87363 $at_traceon; }
   87364 
   87365 
   87366    { set +x
   87367 $as_echo "$at_srcdir/calc.at:643: \$BISON_C_WORKS"
   87368 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:643"
   87369 ( $at_check_trace; $BISON_C_WORKS
   87370 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87371 at_status=$? at_failed=false
   87372 $at_check_filter
   87373 echo stderr:; cat "$at_stderr"
   87374 echo stdout:; cat "$at_stdout"
   87375 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87376 $at_failed && at_fn_log_failure
   87377 $at_traceon; }
   87378 
   87379 { set +x
   87380 $as_echo "$at_srcdir/calc.at:643: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   87381 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:643"
   87382 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   87383 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87384 at_status=$? at_failed=false
   87385 $at_check_filter
   87386 echo stderr:; cat "$at_stderr"
   87387 echo stdout:; cat "$at_stdout"
   87388 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87389 $at_failed && at_fn_log_failure
   87390 $at_traceon; }
   87391 
   87392 
   87393 { set +x
   87394 $as_echo "$at_srcdir/calc.at:643: \$PERL -ne '
   87395   chomp;
   87396   print \"\$.: {\$_}\\n\"
   87397     if (# No starting/ending empty lines.
   87398         (eof || \$. == 1) && /^\\s*\$/
   87399         # No trailing space.  FIXME: not ready for \"maint\".
   87400         # || /\\s\$/
   87401         )' calc.c
   87402 "
   87403 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643"
   87404 ( $at_check_trace; $PERL -ne '
   87405   chomp;
   87406   print "$.: {$_}\n"
   87407     if (# No starting/ending empty lines.
   87408         (eof || $. == 1) && /^\s*$/
   87409         # No trailing space.  FIXME: not ready for "maint".
   87410         # || /\s$/
   87411         )' calc.c
   87412 
   87413 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87414 at_status=$? at_failed=false
   87415 $at_check_filter
   87416 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87417 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87418 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87419 $at_failed && at_fn_log_failure
   87420 $at_traceon; }
   87421 
   87422 
   87423 
   87424 # Test the priorities.
   87425 cat >input <<'_ATEOF'
   87426 1 + 2 * 3 = 7
   87427 1 + 2 * -3 = -5
   87428 
   87429 -1^2 = -1
   87430 (-1)^2 = 1
   87431 
   87432 ---1 = -1
   87433 
   87434 1 - 2 - 3 = -4
   87435 1 - (2 - 3) = 2
   87436 
   87437 2^2^3 = 256
   87438 (2^2)^3 = 64
   87439 _ATEOF
   87440 
   87441 { set +x
   87442 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87443 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87444 ( $at_check_trace;  $PREPARSER ./calc input
   87445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87446 at_status=$? at_failed=false
   87447 $at_check_filter
   87448 echo stderr:; tee stderr <"$at_stderr"
   87449 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87450 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87451 $at_failed && at_fn_log_failure
   87452 $at_traceon; }
   87453 
   87454 { set +x
   87455 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87456 at_fn_check_prepare_trace "calc.at:643"
   87457 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87459 at_status=$? at_failed=false
   87460 $at_check_filter
   87461 echo stderr:; tee stderr <"$at_stderr"
   87462 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87463 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87464 $at_failed && at_fn_log_failure
   87465 $at_traceon; }
   87466 
   87467 
   87468 
   87469 
   87470 # Some syntax errors.
   87471 cat >input <<'_ATEOF'
   87472 1 2
   87473 _ATEOF
   87474 
   87475 { set +x
   87476 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87477 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87478 ( $at_check_trace;  $PREPARSER ./calc input
   87479 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87480 at_status=$? at_failed=false
   87481 $at_check_filter
   87482 echo stderr:; tee stderr <"$at_stderr"
   87483 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87484 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
   87485 $at_failed && at_fn_log_failure
   87486 $at_traceon; }
   87487 
   87488 { set +x
   87489 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87490 at_fn_check_prepare_trace "calc.at:643"
   87491 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87493 at_status=$? at_failed=false
   87494 $at_check_filter
   87495 echo stderr:; tee stderr <"$at_stderr"
   87496 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87497 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87498 $at_failed && at_fn_log_failure
   87499 $at_traceon; }
   87500 
   87501 
   87502 
   87503 # Normalize the observed and expected error messages, depending upon the
   87504 # options.
   87505 # 1. Remove the traces from observed.
   87506 sed '/^Starting/d
   87507 /^Entering/d
   87508 /^Stack/d
   87509 /^Reading/d
   87510 /^Reducing/d
   87511 /^Return/d
   87512 /^Shifting/d
   87513 /^state/d
   87514 /^Cleanup:/d
   87515 /^Error:/d
   87516 /^Next/d
   87517 /^Now/d
   87518 /^Discarding/d
   87519 / \$[0-9$]* = /d
   87520 /^yydestructor:/d' stderr >at-stderr
   87521 mv at-stderr stderr
   87522 # 2. Create the reference error message.
   87523 cat >expout <<'_ATEOF'
   87524 1.3: syntax error, unexpected number
   87525 _ATEOF
   87526 
   87527 # 3. If locations are not used, remove them.
   87528 sed 's/^[-0-9.]*: //' expout >at-expout
   87529 mv at-expout expout
   87530 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   87531 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   87532 mv at-expout expout
   87533 # 5. Check
   87534 { set +x
   87535 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   87536 at_fn_check_prepare_trace "calc.at:643"
   87537 ( $at_check_trace; cat stderr
   87538 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87539 at_status=$? at_failed=false
   87540 $at_check_filter
   87541 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87542 $at_diff expout "$at_stdout" || at_failed=:
   87543 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87544 $at_failed && at_fn_log_failure
   87545 $at_traceon; }
   87546 
   87547 
   87548 cat >input <<'_ATEOF'
   87549 1//2
   87550 _ATEOF
   87551 
   87552 { set +x
   87553 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87554 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87555 ( $at_check_trace;  $PREPARSER ./calc input
   87556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87557 at_status=$? at_failed=false
   87558 $at_check_filter
   87559 echo stderr:; tee stderr <"$at_stderr"
   87560 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87561 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
   87562 $at_failed && at_fn_log_failure
   87563 $at_traceon; }
   87564 
   87565 { set +x
   87566 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87567 at_fn_check_prepare_trace "calc.at:643"
   87568 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87570 at_status=$? at_failed=false
   87571 $at_check_filter
   87572 echo stderr:; tee stderr <"$at_stderr"
   87573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87574 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87575 $at_failed && at_fn_log_failure
   87576 $at_traceon; }
   87577 
   87578 
   87579 
   87580 # Normalize the observed and expected error messages, depending upon the
   87581 # options.
   87582 # 1. Remove the traces from observed.
   87583 sed '/^Starting/d
   87584 /^Entering/d
   87585 /^Stack/d
   87586 /^Reading/d
   87587 /^Reducing/d
   87588 /^Return/d
   87589 /^Shifting/d
   87590 /^state/d
   87591 /^Cleanup:/d
   87592 /^Error:/d
   87593 /^Next/d
   87594 /^Now/d
   87595 /^Discarding/d
   87596 / \$[0-9$]* = /d
   87597 /^yydestructor:/d' stderr >at-stderr
   87598 mv at-stderr stderr
   87599 # 2. Create the reference error message.
   87600 cat >expout <<'_ATEOF'
   87601 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   87602 _ATEOF
   87603 
   87604 # 3. If locations are not used, remove them.
   87605 sed 's/^[-0-9.]*: //' expout >at-expout
   87606 mv at-expout expout
   87607 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   87608 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   87609 mv at-expout expout
   87610 # 5. Check
   87611 { set +x
   87612 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   87613 at_fn_check_prepare_trace "calc.at:643"
   87614 ( $at_check_trace; cat stderr
   87615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87616 at_status=$? at_failed=false
   87617 $at_check_filter
   87618 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87619 $at_diff expout "$at_stdout" || at_failed=:
   87620 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87621 $at_failed && at_fn_log_failure
   87622 $at_traceon; }
   87623 
   87624 
   87625 cat >input <<'_ATEOF'
   87626 error
   87627 _ATEOF
   87628 
   87629 { set +x
   87630 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87631 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87632 ( $at_check_trace;  $PREPARSER ./calc input
   87633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87634 at_status=$? at_failed=false
   87635 $at_check_filter
   87636 echo stderr:; tee stderr <"$at_stderr"
   87637 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87638 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
   87639 $at_failed && at_fn_log_failure
   87640 $at_traceon; }
   87641 
   87642 { set +x
   87643 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87644 at_fn_check_prepare_trace "calc.at:643"
   87645 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87647 at_status=$? at_failed=false
   87648 $at_check_filter
   87649 echo stderr:; tee stderr <"$at_stderr"
   87650 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87651 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87652 $at_failed && at_fn_log_failure
   87653 $at_traceon; }
   87654 
   87655 
   87656 
   87657 # Normalize the observed and expected error messages, depending upon the
   87658 # options.
   87659 # 1. Remove the traces from observed.
   87660 sed '/^Starting/d
   87661 /^Entering/d
   87662 /^Stack/d
   87663 /^Reading/d
   87664 /^Reducing/d
   87665 /^Return/d
   87666 /^Shifting/d
   87667 /^state/d
   87668 /^Cleanup:/d
   87669 /^Error:/d
   87670 /^Next/d
   87671 /^Now/d
   87672 /^Discarding/d
   87673 / \$[0-9$]* = /d
   87674 /^yydestructor:/d' stderr >at-stderr
   87675 mv at-stderr stderr
   87676 # 2. Create the reference error message.
   87677 cat >expout <<'_ATEOF'
   87678 1.1: syntax error, unexpected $undefined
   87679 _ATEOF
   87680 
   87681 # 3. If locations are not used, remove them.
   87682 sed 's/^[-0-9.]*: //' expout >at-expout
   87683 mv at-expout expout
   87684 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   87685 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   87686 mv at-expout expout
   87687 # 5. Check
   87688 { set +x
   87689 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   87690 at_fn_check_prepare_trace "calc.at:643"
   87691 ( $at_check_trace; cat stderr
   87692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87693 at_status=$? at_failed=false
   87694 $at_check_filter
   87695 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87696 $at_diff expout "$at_stdout" || at_failed=:
   87697 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87698 $at_failed && at_fn_log_failure
   87699 $at_traceon; }
   87700 
   87701 
   87702 cat >input <<'_ATEOF'
   87703 1 = 2 = 3
   87704 _ATEOF
   87705 
   87706 { set +x
   87707 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87708 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87709 ( $at_check_trace;  $PREPARSER ./calc input
   87710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87711 at_status=$? at_failed=false
   87712 $at_check_filter
   87713 echo stderr:; tee stderr <"$at_stderr"
   87714 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87715 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
   87716 $at_failed && at_fn_log_failure
   87717 $at_traceon; }
   87718 
   87719 { set +x
   87720 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87721 at_fn_check_prepare_trace "calc.at:643"
   87722 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87724 at_status=$? at_failed=false
   87725 $at_check_filter
   87726 echo stderr:; tee stderr <"$at_stderr"
   87727 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87728 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87729 $at_failed && at_fn_log_failure
   87730 $at_traceon; }
   87731 
   87732 
   87733 
   87734 # Normalize the observed and expected error messages, depending upon the
   87735 # options.
   87736 # 1. Remove the traces from observed.
   87737 sed '/^Starting/d
   87738 /^Entering/d
   87739 /^Stack/d
   87740 /^Reading/d
   87741 /^Reducing/d
   87742 /^Return/d
   87743 /^Shifting/d
   87744 /^state/d
   87745 /^Cleanup:/d
   87746 /^Error:/d
   87747 /^Next/d
   87748 /^Now/d
   87749 /^Discarding/d
   87750 / \$[0-9$]* = /d
   87751 /^yydestructor:/d' stderr >at-stderr
   87752 mv at-stderr stderr
   87753 # 2. Create the reference error message.
   87754 cat >expout <<'_ATEOF'
   87755 1.7: syntax error, unexpected '='
   87756 _ATEOF
   87757 
   87758 # 3. If locations are not used, remove them.
   87759 sed 's/^[-0-9.]*: //' expout >at-expout
   87760 mv at-expout expout
   87761 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   87762 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   87763 mv at-expout expout
   87764 # 5. Check
   87765 { set +x
   87766 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   87767 at_fn_check_prepare_trace "calc.at:643"
   87768 ( $at_check_trace; cat stderr
   87769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87770 at_status=$? at_failed=false
   87771 $at_check_filter
   87772 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87773 $at_diff expout "$at_stdout" || at_failed=:
   87774 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87775 $at_failed && at_fn_log_failure
   87776 $at_traceon; }
   87777 
   87778 
   87779 cat >input <<'_ATEOF'
   87780 
   87781 +1
   87782 _ATEOF
   87783 
   87784 { set +x
   87785 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87786 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87787 ( $at_check_trace;  $PREPARSER ./calc input
   87788 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87789 at_status=$? at_failed=false
   87790 $at_check_filter
   87791 echo stderr:; tee stderr <"$at_stderr"
   87792 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87793 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
   87794 $at_failed && at_fn_log_failure
   87795 $at_traceon; }
   87796 
   87797 { set +x
   87798 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87799 at_fn_check_prepare_trace "calc.at:643"
   87800 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87801 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87802 at_status=$? at_failed=false
   87803 $at_check_filter
   87804 echo stderr:; tee stderr <"$at_stderr"
   87805 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87806 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87807 $at_failed && at_fn_log_failure
   87808 $at_traceon; }
   87809 
   87810 
   87811 
   87812 # Normalize the observed and expected error messages, depending upon the
   87813 # options.
   87814 # 1. Remove the traces from observed.
   87815 sed '/^Starting/d
   87816 /^Entering/d
   87817 /^Stack/d
   87818 /^Reading/d
   87819 /^Reducing/d
   87820 /^Return/d
   87821 /^Shifting/d
   87822 /^state/d
   87823 /^Cleanup:/d
   87824 /^Error:/d
   87825 /^Next/d
   87826 /^Now/d
   87827 /^Discarding/d
   87828 / \$[0-9$]* = /d
   87829 /^yydestructor:/d' stderr >at-stderr
   87830 mv at-stderr stderr
   87831 # 2. Create the reference error message.
   87832 cat >expout <<'_ATEOF'
   87833 2.1: syntax error, unexpected '+'
   87834 _ATEOF
   87835 
   87836 # 3. If locations are not used, remove them.
   87837 sed 's/^[-0-9.]*: //' expout >at-expout
   87838 mv at-expout expout
   87839 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   87840 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   87841 mv at-expout expout
   87842 # 5. Check
   87843 { set +x
   87844 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   87845 at_fn_check_prepare_trace "calc.at:643"
   87846 ( $at_check_trace; cat stderr
   87847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87848 at_status=$? at_failed=false
   87849 $at_check_filter
   87850 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87851 $at_diff expout "$at_stdout" || at_failed=:
   87852 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87853 $at_failed && at_fn_log_failure
   87854 $at_traceon; }
   87855 
   87856 
   87857 # Exercise error messages with EOF: work on an empty file.
   87858 { set +x
   87859 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc /dev/null"
   87860 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:643"
   87861 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   87862 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87863 at_status=$? at_failed=false
   87864 $at_check_filter
   87865 echo stderr:; tee stderr <"$at_stderr"
   87866 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87867 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
   87868 $at_failed && at_fn_log_failure
   87869 $at_traceon; }
   87870 
   87871 { set +x
   87872 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87873 at_fn_check_prepare_trace "calc.at:643"
   87874 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87875 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87876 at_status=$? at_failed=false
   87877 $at_check_filter
   87878 echo stderr:; tee stderr <"$at_stderr"
   87879 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87880 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87881 $at_failed && at_fn_log_failure
   87882 $at_traceon; }
   87883 
   87884 
   87885 
   87886 # Normalize the observed and expected error messages, depending upon the
   87887 # options.
   87888 # 1. Remove the traces from observed.
   87889 sed '/^Starting/d
   87890 /^Entering/d
   87891 /^Stack/d
   87892 /^Reading/d
   87893 /^Reducing/d
   87894 /^Return/d
   87895 /^Shifting/d
   87896 /^state/d
   87897 /^Cleanup:/d
   87898 /^Error:/d
   87899 /^Next/d
   87900 /^Now/d
   87901 /^Discarding/d
   87902 / \$[0-9$]* = /d
   87903 /^yydestructor:/d' stderr >at-stderr
   87904 mv at-stderr stderr
   87905 # 2. Create the reference error message.
   87906 cat >expout <<'_ATEOF'
   87907 1.1: syntax error, unexpected end of input
   87908 _ATEOF
   87909 
   87910 # 3. If locations are not used, remove them.
   87911 sed 's/^[-0-9.]*: //' expout >at-expout
   87912 mv at-expout expout
   87913 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   87914 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   87915 mv at-expout expout
   87916 # 5. Check
   87917 { set +x
   87918 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   87919 at_fn_check_prepare_trace "calc.at:643"
   87920 ( $at_check_trace; cat stderr
   87921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87922 at_status=$? at_failed=false
   87923 $at_check_filter
   87924 at_fn_diff_devnull "$at_stderr" || at_failed=:
   87925 $at_diff expout "$at_stdout" || at_failed=:
   87926 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87927 $at_failed && at_fn_log_failure
   87928 $at_traceon; }
   87929 
   87930 
   87931 
   87932 # Exercise the error token: without it, we die at the first error,
   87933 # hence be sure to
   87934 #
   87935 # - have several errors which exercise different shift/discardings
   87936 #   - (): nothing to pop, nothing to discard
   87937 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   87938 #   - (* * *): nothing to pop, a lot to discard
   87939 #   - (1 + 2 * *): some to pop and discard
   87940 #
   87941 # - test the action associated to `error'
   87942 #
   87943 # - check the lookahead that triggers an error is not discarded
   87944 #   when we enter error recovery.  Below, the lookahead causing the
   87945 #   first error is ")", which is needed to recover from the error and
   87946 #   produce the "0" that triggers the "0 != 1" error.
   87947 #
   87948 cat >input <<'_ATEOF'
   87949 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   87950 _ATEOF
   87951 
   87952 { set +x
   87953 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   87954 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   87955 ( $at_check_trace;  $PREPARSER ./calc input
   87956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87957 at_status=$? at_failed=false
   87958 $at_check_filter
   87959 echo stderr:; tee stderr <"$at_stderr"
   87960 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87961 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87962 $at_failed && at_fn_log_failure
   87963 $at_traceon; }
   87964 
   87965 { set +x
   87966 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   87967 at_fn_check_prepare_trace "calc.at:643"
   87968 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   87969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   87970 at_status=$? at_failed=false
   87971 $at_check_filter
   87972 echo stderr:; tee stderr <"$at_stderr"
   87973 at_fn_diff_devnull "$at_stdout" || at_failed=:
   87974 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   87975 $at_failed && at_fn_log_failure
   87976 $at_traceon; }
   87977 
   87978 
   87979 
   87980 # Normalize the observed and expected error messages, depending upon the
   87981 # options.
   87982 # 1. Remove the traces from observed.
   87983 sed '/^Starting/d
   87984 /^Entering/d
   87985 /^Stack/d
   87986 /^Reading/d
   87987 /^Reducing/d
   87988 /^Return/d
   87989 /^Shifting/d
   87990 /^state/d
   87991 /^Cleanup:/d
   87992 /^Error:/d
   87993 /^Next/d
   87994 /^Now/d
   87995 /^Discarding/d
   87996 / \$[0-9$]* = /d
   87997 /^yydestructor:/d' stderr >at-stderr
   87998 mv at-stderr stderr
   87999 # 2. Create the reference error message.
   88000 cat >expout <<'_ATEOF'
   88001 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   88002 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   88003 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   88004 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   88005 calc: error: 4444 != 1
   88006 _ATEOF
   88007 
   88008 # 3. If locations are not used, remove them.
   88009 sed 's/^[-0-9.]*: //' expout >at-expout
   88010 mv at-expout expout
   88011 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88012 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88013 mv at-expout expout
   88014 # 5. Check
   88015 { set +x
   88016 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   88017 at_fn_check_prepare_trace "calc.at:643"
   88018 ( $at_check_trace; cat stderr
   88019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88020 at_status=$? at_failed=false
   88021 $at_check_filter
   88022 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88023 $at_diff expout "$at_stdout" || at_failed=:
   88024 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88025 $at_failed && at_fn_log_failure
   88026 $at_traceon; }
   88027 
   88028 
   88029 
   88030 # The same, but this time exercising explicitly triggered syntax errors.
   88031 # POSIX says the lookahead causing the error should not be discarded.
   88032 cat >input <<'_ATEOF'
   88033 (!) + (1 2) = 1
   88034 _ATEOF
   88035 
   88036 { set +x
   88037 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   88038 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   88039 ( $at_check_trace;  $PREPARSER ./calc input
   88040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88041 at_status=$? at_failed=false
   88042 $at_check_filter
   88043 echo stderr:; tee stderr <"$at_stderr"
   88044 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88045 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88046 $at_failed && at_fn_log_failure
   88047 $at_traceon; }
   88048 
   88049 { set +x
   88050 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88051 at_fn_check_prepare_trace "calc.at:643"
   88052 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88054 at_status=$? at_failed=false
   88055 $at_check_filter
   88056 echo stderr:; tee stderr <"$at_stderr"
   88057 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88059 $at_failed && at_fn_log_failure
   88060 $at_traceon; }
   88061 
   88062 
   88063 
   88064 # Normalize the observed and expected error messages, depending upon the
   88065 # options.
   88066 # 1. Remove the traces from observed.
   88067 sed '/^Starting/d
   88068 /^Entering/d
   88069 /^Stack/d
   88070 /^Reading/d
   88071 /^Reducing/d
   88072 /^Return/d
   88073 /^Shifting/d
   88074 /^state/d
   88075 /^Cleanup:/d
   88076 /^Error:/d
   88077 /^Next/d
   88078 /^Now/d
   88079 /^Discarding/d
   88080 / \$[0-9$]* = /d
   88081 /^yydestructor:/d' stderr >at-stderr
   88082 mv at-stderr stderr
   88083 # 2. Create the reference error message.
   88084 cat >expout <<'_ATEOF'
   88085 1.10: syntax error, unexpected number
   88086 calc: error: 2222 != 1
   88087 _ATEOF
   88088 
   88089 # 3. If locations are not used, remove them.
   88090 sed 's/^[-0-9.]*: //' expout >at-expout
   88091 mv at-expout expout
   88092 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88093 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88094 mv at-expout expout
   88095 # 5. Check
   88096 { set +x
   88097 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   88098 at_fn_check_prepare_trace "calc.at:643"
   88099 ( $at_check_trace; cat stderr
   88100 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88101 at_status=$? at_failed=false
   88102 $at_check_filter
   88103 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88104 $at_diff expout "$at_stdout" || at_failed=:
   88105 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88106 $at_failed && at_fn_log_failure
   88107 $at_traceon; }
   88108 
   88109 
   88110 cat >input <<'_ATEOF'
   88111 (- *) + (1 2) = 1
   88112 _ATEOF
   88113 
   88114 { set +x
   88115 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   88116 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   88117 ( $at_check_trace;  $PREPARSER ./calc input
   88118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88119 at_status=$? at_failed=false
   88120 $at_check_filter
   88121 echo stderr:; tee stderr <"$at_stderr"
   88122 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88123 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88124 $at_failed && at_fn_log_failure
   88125 $at_traceon; }
   88126 
   88127 { set +x
   88128 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88129 at_fn_check_prepare_trace "calc.at:643"
   88130 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88131 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88132 at_status=$? at_failed=false
   88133 $at_check_filter
   88134 echo stderr:; tee stderr <"$at_stderr"
   88135 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88136 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88137 $at_failed && at_fn_log_failure
   88138 $at_traceon; }
   88139 
   88140 
   88141 
   88142 # Normalize the observed and expected error messages, depending upon the
   88143 # options.
   88144 # 1. Remove the traces from observed.
   88145 sed '/^Starting/d
   88146 /^Entering/d
   88147 /^Stack/d
   88148 /^Reading/d
   88149 /^Reducing/d
   88150 /^Return/d
   88151 /^Shifting/d
   88152 /^state/d
   88153 /^Cleanup:/d
   88154 /^Error:/d
   88155 /^Next/d
   88156 /^Now/d
   88157 /^Discarding/d
   88158 / \$[0-9$]* = /d
   88159 /^yydestructor:/d' stderr >at-stderr
   88160 mv at-stderr stderr
   88161 # 2. Create the reference error message.
   88162 cat >expout <<'_ATEOF'
   88163 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   88164 1.12: syntax error, unexpected number
   88165 calc: error: 2222 != 1
   88166 _ATEOF
   88167 
   88168 # 3. If locations are not used, remove them.
   88169 sed 's/^[-0-9.]*: //' expout >at-expout
   88170 mv at-expout expout
   88171 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88172 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88173 mv at-expout expout
   88174 # 5. Check
   88175 { set +x
   88176 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   88177 at_fn_check_prepare_trace "calc.at:643"
   88178 ( $at_check_trace; cat stderr
   88179 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88180 at_status=$? at_failed=false
   88181 $at_check_filter
   88182 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88183 $at_diff expout "$at_stdout" || at_failed=:
   88184 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88185 $at_failed && at_fn_log_failure
   88186 $at_traceon; }
   88187 
   88188 
   88189 
   88190 # Check that yyerrok works properly: second error is not reported,
   88191 # third and fourth are.  Parse status is succesfull.
   88192 cat >input <<'_ATEOF'
   88193 (* *) + (*) + (*)
   88194 _ATEOF
   88195 
   88196 { set +x
   88197 $as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
   88198 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
   88199 ( $at_check_trace;  $PREPARSER ./calc input
   88200 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88201 at_status=$? at_failed=false
   88202 $at_check_filter
   88203 echo stderr:; tee stderr <"$at_stderr"
   88204 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88205 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88206 $at_failed && at_fn_log_failure
   88207 $at_traceon; }
   88208 
   88209 { set +x
   88210 $as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88211 at_fn_check_prepare_trace "calc.at:643"
   88212 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88214 at_status=$? at_failed=false
   88215 $at_check_filter
   88216 echo stderr:; tee stderr <"$at_stderr"
   88217 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88218 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88219 $at_failed && at_fn_log_failure
   88220 $at_traceon; }
   88221 
   88222 
   88223 
   88224 # Normalize the observed and expected error messages, depending upon the
   88225 # options.
   88226 # 1. Remove the traces from observed.
   88227 sed '/^Starting/d
   88228 /^Entering/d
   88229 /^Stack/d
   88230 /^Reading/d
   88231 /^Reducing/d
   88232 /^Return/d
   88233 /^Shifting/d
   88234 /^state/d
   88235 /^Cleanup:/d
   88236 /^Error:/d
   88237 /^Next/d
   88238 /^Now/d
   88239 /^Discarding/d
   88240 / \$[0-9$]* = /d
   88241 /^yydestructor:/d' stderr >at-stderr
   88242 mv at-stderr stderr
   88243 # 2. Create the reference error message.
   88244 cat >expout <<'_ATEOF'
   88245 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   88246 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   88247 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   88248 _ATEOF
   88249 
   88250 # 3. If locations are not used, remove them.
   88251 sed 's/^[-0-9.]*: //' expout >at-expout
   88252 mv at-expout expout
   88253 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88254 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88255 mv at-expout expout
   88256 # 5. Check
   88257 { set +x
   88258 $as_echo "$at_srcdir/calc.at:643: cat stderr"
   88259 at_fn_check_prepare_trace "calc.at:643"
   88260 ( $at_check_trace; cat stderr
   88261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88262 at_status=$? at_failed=false
   88263 $at_check_filter
   88264 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88265 $at_diff expout "$at_stdout" || at_failed=:
   88266 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
   88267 $at_failed && at_fn_log_failure
   88268 $at_traceon; }
   88269 
   88270 
   88271 
   88272 
   88273 
   88274   set +x
   88275   $at_times_p && times >"$at_times_file"
   88276 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   88277 read at_status <"$at_status_file"
   88278 #AT_STOP_222
   88279 #AT_START_223
   88280 at_fn_group_banner 223 'calc.at:644' \
   88281   "Calculator %glr-parser %verbose" "                " 12
   88282 at_xfail=no
   88283 (
   88284   $as_echo "223. $at_setup_line: testing $at_desc ..."
   88285   $at_traceon
   88286 
   88287 
   88288 
   88289 
   88290 
   88291 
   88292 
   88293 
   88294 
   88295 
   88296 cat >calc.y <<'_ATEOF'
   88297 %code top {
   88298 #include <config.h>
   88299 /* We don't need perfect functions for these tests. */
   88300 #undef malloc
   88301 #undef memcmp
   88302 #undef realloc
   88303 }
   88304 
   88305 /* Infix notation calculator--calc */
   88306 %glr-parser %verbose
   88307 
   88308 %code requires
   88309 {
   88310 
   88311   /* Exercise pre-prologue dependency to %union.  */
   88312   typedef int semantic_value;
   88313 }
   88314 
   88315 /* Exercise %union. */
   88316 %union
   88317 {
   88318   semantic_value ival;
   88319 };
   88320 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   88321 
   88322 %code provides
   88323 {
   88324   #include <stdio.h>
   88325   /* The input.  */
   88326   extern FILE *input;
   88327   extern semantic_value global_result;
   88328   extern int global_count;
   88329 }
   88330 
   88331 %code
   88332 {
   88333 #include <assert.h>
   88334 #include <string.h>
   88335 #define USE(Var)
   88336 
   88337 FILE *input;
   88338 static int power (int base, int exponent);
   88339 
   88340 static void yyerror ( const char *msg);
   88341 int yylex (void);
   88342 }
   88343 
   88344 
   88345 
   88346 /* Bison Declarations */
   88347 %token CALC_EOF 0 "end of input"
   88348 %token <ival> NUM "number"
   88349 %type  <ival> exp
   88350 
   88351 %nonassoc '=' /* comparison            */
   88352 %left '-' '+'
   88353 %left '*' '/'
   88354 %left NEG     /* negation--unary minus */
   88355 %right '^'    /* exponentiation        */
   88356 
   88357 /* Grammar follows */
   88358 %%
   88359 input:
   88360   line
   88361 | input line         {  }
   88362 ;
   88363 
   88364 line:
   88365   '\n'
   88366 | exp '\n'           { USE ($1); }
   88367 ;
   88368 
   88369 exp:
   88370   NUM                { $$ = $1;             }
   88371 | exp '=' exp
   88372   {
   88373     if ($1 != $3)
   88374       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   88375     $$ = $1;
   88376   }
   88377 | exp '+' exp        { $$ = $1 + $3;        }
   88378 | exp '-' exp        { $$ = $1 - $3;        }
   88379 | exp '*' exp        { $$ = $1 * $3;        }
   88380 | exp '/' exp        { $$ = $1 / $3;        }
   88381 | '-' exp  %prec NEG { $$ = -$2;            }
   88382 | exp '^' exp        { $$ = power ($1, $3); }
   88383 | '(' exp ')'        { $$ = $2;             }
   88384 | '(' error ')'      { $$ = 1111; yyerrok;  }
   88385 | '!'                { $$ = 0; YYERROR;     }
   88386 | '-' error          { $$ = 0; YYERROR;     }
   88387 ;
   88388 %%
   88389 
   88390 static int
   88391 power (int base, int exponent)
   88392 {
   88393   int res = 1;
   88394   assert (0 <= exponent);
   88395   for (/* Niente */; exponent; --exponent)
   88396     res *= base;
   88397   return res;
   88398 }
   88399 
   88400 
   88401 #include <stdio.h>
   88402 /* A C error reporting function.  */
   88403 static
   88404 void yyerror ( const char *msg)
   88405 {
   88406   fprintf (stderr, "%s\n", msg);
   88407 }
   88408 #include <ctype.h>
   88409 
   88410 int yylex (void);
   88411 static int get_char (void);
   88412 static void unget_char ( int c);
   88413 
   88414 
   88415 static int
   88416 get_char (void)
   88417 {
   88418   int res = getc (input);
   88419   ;
   88420 
   88421   return res;
   88422 }
   88423 
   88424 static void
   88425 unget_char ( int c)
   88426 {
   88427   ;
   88428 
   88429   ungetc (c, input);
   88430 }
   88431 
   88432 static int
   88433 read_signed_integer (void)
   88434 {
   88435   int c = get_char ();
   88436   int sign = 1;
   88437   int n = 0;
   88438 
   88439   ;
   88440   if (c == '-')
   88441     {
   88442       c = get_char ();
   88443       sign = -1;
   88444     }
   88445 
   88446   while (isdigit (c))
   88447     {
   88448       n = 10 * n + (c - '0');
   88449       c = get_char ();
   88450     }
   88451 
   88452   unget_char ( c);
   88453 
   88454   return sign * n;
   88455 }
   88456 
   88457 
   88458 /*---------------------------------------------------------------.
   88459 | Lexical analyzer returns an integer on the stack and the token |
   88460 | NUM, or the ASCII character read if not a number.  Skips all   |
   88461 | blanks and tabs, returns 0 for EOF.                            |
   88462 `---------------------------------------------------------------*/
   88463 
   88464 int yylex (void)
   88465 {
   88466   int c;
   88467   /* Skip current token, then white spaces.  */
   88468   do
   88469     {
   88470 
   88471     }
   88472   while ((c = get_char ()) == ' ' || c == '\t');
   88473 
   88474   /* process numbers   */
   88475   if (c == '.' || isdigit (c))
   88476     {
   88477       unget_char ( c);
   88478       (yylval).ival = read_signed_integer ();
   88479       return NUM;
   88480     }
   88481 
   88482   /* Return end-of-file.  */
   88483   if (c == EOF)
   88484     return CALC_EOF;
   88485 
   88486   /* Return single chars. */
   88487   return c;
   88488 }
   88489 
   88490 #include <assert.h>
   88491 #if HAVE_UNISTD_H
   88492 # include <unistd.h>
   88493 #else
   88494 # undef alarm
   88495 # define alarm(seconds) /* empty */
   88496 #endif
   88497 
   88498 
   88499 
   88500 semantic_value global_result = 0;
   88501 int global_count = 0;
   88502 
   88503 /* A C main function.  */
   88504 int
   88505 main (int argc, const char **argv)
   88506 {
   88507   semantic_value result = 0;
   88508   int count = 0;
   88509   int status;
   88510 
   88511   /* This used to be alarm (10), but that isn't enough time for
   88512      a July 1995 vintage DEC Alphastation 200 4/100 system,
   88513      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   88514   alarm (100);
   88515 
   88516   if (argc == 2)
   88517     input = fopen (argv[1], "r");
   88518   else
   88519     input = stdin;
   88520 
   88521   if (!input)
   88522     {
   88523       perror (argv[1]);
   88524       return 3;
   88525     }
   88526 
   88527 
   88528   status = yyparse ();
   88529   if (fclose (input))
   88530     perror ("fclose");
   88531   assert (global_result == result);
   88532   assert (global_count == count);
   88533   return status;
   88534 }
   88535 _ATEOF
   88536 
   88537 
   88538 
   88539 
   88540 
   88541 
   88542 
   88543 
   88544 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   88545   at_save_special_files
   88546   mkdir xml-tests
   88547     # Don't combine these Bison invocations since we want to be sure that
   88548   # --report=all isn't required to get the full XML file.
   88549   { set +x
   88550 $as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   88551                   --graph=xml-tests/test.dot -o calc.c calc.y"
   88552 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644"
   88553 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   88554                   --graph=xml-tests/test.dot -o calc.c calc.y
   88555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88556 at_status=$? at_failed=false
   88557 $at_check_filter
   88558 echo stderr:; cat "$at_stderr"
   88559 echo stdout:; cat "$at_stdout"
   88560 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88561 $at_failed && at_fn_log_failure
   88562 $at_traceon; }
   88563 
   88564   { set +x
   88565 $as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   88566 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:644"
   88567 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   88568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88569 at_status=$? at_failed=false
   88570 $at_check_filter
   88571 echo stderr:; cat "$at_stderr"
   88572 echo stdout:; cat "$at_stdout"
   88573 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88574 $at_failed && at_fn_log_failure
   88575 $at_traceon; }
   88576 
   88577     cp xml-tests/test.output expout
   88578   { set +x
   88579 $as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\
   88580              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   88581              xml-tests/test.xml"
   88582 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644"
   88583 ( $at_check_trace; $XSLTPROC \
   88584              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   88585              xml-tests/test.xml
   88586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88587 at_status=$? at_failed=false
   88588 $at_check_filter
   88589 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88590 $at_diff expout "$at_stdout" || at_failed=:
   88591 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88592 $at_failed && at_fn_log_failure
   88593 $at_traceon; }
   88594 
   88595   sort xml-tests/test.dot > expout
   88596   { set +x
   88597 $as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\
   88598              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   88599              xml-tests/test.xml | sort"
   88600 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644"
   88601 ( $at_check_trace; $XSLTPROC \
   88602              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   88603              xml-tests/test.xml | sort
   88604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88605 at_status=$? at_failed=false
   88606 $at_check_filter
   88607 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88608 $at_diff expout "$at_stdout" || at_failed=:
   88609 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88610 $at_failed && at_fn_log_failure
   88611 $at_traceon; }
   88612 
   88613   rm -rf xml-tests expout
   88614   at_restore_special_files
   88615 fi
   88616 { set +x
   88617 $as_echo "$at_srcdir/calc.at:644: bison -o calc.c calc.y"
   88618 at_fn_check_prepare_trace "calc.at:644"
   88619 ( $at_check_trace; bison -o calc.c calc.y
   88620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88621 at_status=$? at_failed=false
   88622 $at_check_filter
   88623 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88624 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88625 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88626 $at_failed && at_fn_log_failure
   88627 $at_traceon; }
   88628 
   88629 
   88630    { set +x
   88631 $as_echo "$at_srcdir/calc.at:644: \$BISON_C_WORKS"
   88632 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:644"
   88633 ( $at_check_trace; $BISON_C_WORKS
   88634 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88635 at_status=$? at_failed=false
   88636 $at_check_filter
   88637 echo stderr:; cat "$at_stderr"
   88638 echo stdout:; cat "$at_stdout"
   88639 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88640 $at_failed && at_fn_log_failure
   88641 $at_traceon; }
   88642 
   88643 { set +x
   88644 $as_echo "$at_srcdir/calc.at:644: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   88645 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:644"
   88646 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   88647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88648 at_status=$? at_failed=false
   88649 $at_check_filter
   88650 echo stderr:; cat "$at_stderr"
   88651 echo stdout:; cat "$at_stdout"
   88652 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88653 $at_failed && at_fn_log_failure
   88654 $at_traceon; }
   88655 
   88656 
   88657 { set +x
   88658 $as_echo "$at_srcdir/calc.at:644: \$PERL -ne '
   88659   chomp;
   88660   print \"\$.: {\$_}\\n\"
   88661     if (# No starting/ending empty lines.
   88662         (eof || \$. == 1) && /^\\s*\$/
   88663         # No trailing space.  FIXME: not ready for \"maint\".
   88664         # || /\\s\$/
   88665         )' calc.c
   88666 "
   88667 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644"
   88668 ( $at_check_trace; $PERL -ne '
   88669   chomp;
   88670   print "$.: {$_}\n"
   88671     if (# No starting/ending empty lines.
   88672         (eof || $. == 1) && /^\s*$/
   88673         # No trailing space.  FIXME: not ready for "maint".
   88674         # || /\s$/
   88675         )' calc.c
   88676 
   88677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88678 at_status=$? at_failed=false
   88679 $at_check_filter
   88680 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88681 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88682 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88683 $at_failed && at_fn_log_failure
   88684 $at_traceon; }
   88685 
   88686 
   88687 
   88688 # Test the priorities.
   88689 cat >input <<'_ATEOF'
   88690 1 + 2 * 3 = 7
   88691 1 + 2 * -3 = -5
   88692 
   88693 -1^2 = -1
   88694 (-1)^2 = 1
   88695 
   88696 ---1 = -1
   88697 
   88698 1 - 2 - 3 = -4
   88699 1 - (2 - 3) = 2
   88700 
   88701 2^2^3 = 256
   88702 (2^2)^3 = 64
   88703 _ATEOF
   88704 
   88705 { set +x
   88706 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   88707 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   88708 ( $at_check_trace;  $PREPARSER ./calc input
   88709 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88710 at_status=$? at_failed=false
   88711 $at_check_filter
   88712 echo stderr:; tee stderr <"$at_stderr"
   88713 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88714 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88715 $at_failed && at_fn_log_failure
   88716 $at_traceon; }
   88717 
   88718 { set +x
   88719 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88720 at_fn_check_prepare_trace "calc.at:644"
   88721 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88723 at_status=$? at_failed=false
   88724 $at_check_filter
   88725 echo stderr:; tee stderr <"$at_stderr"
   88726 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88727 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88728 $at_failed && at_fn_log_failure
   88729 $at_traceon; }
   88730 
   88731 
   88732 
   88733 
   88734 # Some syntax errors.
   88735 cat >input <<'_ATEOF'
   88736 1 2
   88737 _ATEOF
   88738 
   88739 { set +x
   88740 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   88741 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   88742 ( $at_check_trace;  $PREPARSER ./calc input
   88743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88744 at_status=$? at_failed=false
   88745 $at_check_filter
   88746 echo stderr:; tee stderr <"$at_stderr"
   88747 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88748 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
   88749 $at_failed && at_fn_log_failure
   88750 $at_traceon; }
   88751 
   88752 { set +x
   88753 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88754 at_fn_check_prepare_trace "calc.at:644"
   88755 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88757 at_status=$? at_failed=false
   88758 $at_check_filter
   88759 echo stderr:; tee stderr <"$at_stderr"
   88760 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88761 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88762 $at_failed && at_fn_log_failure
   88763 $at_traceon; }
   88764 
   88765 
   88766 
   88767 # Normalize the observed and expected error messages, depending upon the
   88768 # options.
   88769 # 1. Remove the traces from observed.
   88770 sed '/^Starting/d
   88771 /^Entering/d
   88772 /^Stack/d
   88773 /^Reading/d
   88774 /^Reducing/d
   88775 /^Return/d
   88776 /^Shifting/d
   88777 /^state/d
   88778 /^Cleanup:/d
   88779 /^Error:/d
   88780 /^Next/d
   88781 /^Now/d
   88782 /^Discarding/d
   88783 / \$[0-9$]* = /d
   88784 /^yydestructor:/d' stderr >at-stderr
   88785 mv at-stderr stderr
   88786 # 2. Create the reference error message.
   88787 cat >expout <<'_ATEOF'
   88788 1.3: syntax error, unexpected number
   88789 _ATEOF
   88790 
   88791 # 3. If locations are not used, remove them.
   88792 sed 's/^[-0-9.]*: //' expout >at-expout
   88793 mv at-expout expout
   88794 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88795 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88796 mv at-expout expout
   88797 # 5. Check
   88798 { set +x
   88799 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   88800 at_fn_check_prepare_trace "calc.at:644"
   88801 ( $at_check_trace; cat stderr
   88802 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88803 at_status=$? at_failed=false
   88804 $at_check_filter
   88805 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88806 $at_diff expout "$at_stdout" || at_failed=:
   88807 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88808 $at_failed && at_fn_log_failure
   88809 $at_traceon; }
   88810 
   88811 
   88812 cat >input <<'_ATEOF'
   88813 1//2
   88814 _ATEOF
   88815 
   88816 { set +x
   88817 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   88818 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   88819 ( $at_check_trace;  $PREPARSER ./calc input
   88820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88821 at_status=$? at_failed=false
   88822 $at_check_filter
   88823 echo stderr:; tee stderr <"$at_stderr"
   88824 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88825 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
   88826 $at_failed && at_fn_log_failure
   88827 $at_traceon; }
   88828 
   88829 { set +x
   88830 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88831 at_fn_check_prepare_trace "calc.at:644"
   88832 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88834 at_status=$? at_failed=false
   88835 $at_check_filter
   88836 echo stderr:; tee stderr <"$at_stderr"
   88837 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88838 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88839 $at_failed && at_fn_log_failure
   88840 $at_traceon; }
   88841 
   88842 
   88843 
   88844 # Normalize the observed and expected error messages, depending upon the
   88845 # options.
   88846 # 1. Remove the traces from observed.
   88847 sed '/^Starting/d
   88848 /^Entering/d
   88849 /^Stack/d
   88850 /^Reading/d
   88851 /^Reducing/d
   88852 /^Return/d
   88853 /^Shifting/d
   88854 /^state/d
   88855 /^Cleanup:/d
   88856 /^Error:/d
   88857 /^Next/d
   88858 /^Now/d
   88859 /^Discarding/d
   88860 / \$[0-9$]* = /d
   88861 /^yydestructor:/d' stderr >at-stderr
   88862 mv at-stderr stderr
   88863 # 2. Create the reference error message.
   88864 cat >expout <<'_ATEOF'
   88865 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   88866 _ATEOF
   88867 
   88868 # 3. If locations are not used, remove them.
   88869 sed 's/^[-0-9.]*: //' expout >at-expout
   88870 mv at-expout expout
   88871 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88872 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88873 mv at-expout expout
   88874 # 5. Check
   88875 { set +x
   88876 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   88877 at_fn_check_prepare_trace "calc.at:644"
   88878 ( $at_check_trace; cat stderr
   88879 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88880 at_status=$? at_failed=false
   88881 $at_check_filter
   88882 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88883 $at_diff expout "$at_stdout" || at_failed=:
   88884 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88885 $at_failed && at_fn_log_failure
   88886 $at_traceon; }
   88887 
   88888 
   88889 cat >input <<'_ATEOF'
   88890 error
   88891 _ATEOF
   88892 
   88893 { set +x
   88894 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   88895 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   88896 ( $at_check_trace;  $PREPARSER ./calc input
   88897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88898 at_status=$? at_failed=false
   88899 $at_check_filter
   88900 echo stderr:; tee stderr <"$at_stderr"
   88901 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88902 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
   88903 $at_failed && at_fn_log_failure
   88904 $at_traceon; }
   88905 
   88906 { set +x
   88907 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88908 at_fn_check_prepare_trace "calc.at:644"
   88909 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88911 at_status=$? at_failed=false
   88912 $at_check_filter
   88913 echo stderr:; tee stderr <"$at_stderr"
   88914 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88915 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88916 $at_failed && at_fn_log_failure
   88917 $at_traceon; }
   88918 
   88919 
   88920 
   88921 # Normalize the observed and expected error messages, depending upon the
   88922 # options.
   88923 # 1. Remove the traces from observed.
   88924 sed '/^Starting/d
   88925 /^Entering/d
   88926 /^Stack/d
   88927 /^Reading/d
   88928 /^Reducing/d
   88929 /^Return/d
   88930 /^Shifting/d
   88931 /^state/d
   88932 /^Cleanup:/d
   88933 /^Error:/d
   88934 /^Next/d
   88935 /^Now/d
   88936 /^Discarding/d
   88937 / \$[0-9$]* = /d
   88938 /^yydestructor:/d' stderr >at-stderr
   88939 mv at-stderr stderr
   88940 # 2. Create the reference error message.
   88941 cat >expout <<'_ATEOF'
   88942 1.1: syntax error, unexpected $undefined
   88943 _ATEOF
   88944 
   88945 # 3. If locations are not used, remove them.
   88946 sed 's/^[-0-9.]*: //' expout >at-expout
   88947 mv at-expout expout
   88948 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   88949 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   88950 mv at-expout expout
   88951 # 5. Check
   88952 { set +x
   88953 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   88954 at_fn_check_prepare_trace "calc.at:644"
   88955 ( $at_check_trace; cat stderr
   88956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88957 at_status=$? at_failed=false
   88958 $at_check_filter
   88959 at_fn_diff_devnull "$at_stderr" || at_failed=:
   88960 $at_diff expout "$at_stdout" || at_failed=:
   88961 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88962 $at_failed && at_fn_log_failure
   88963 $at_traceon; }
   88964 
   88965 
   88966 cat >input <<'_ATEOF'
   88967 1 = 2 = 3
   88968 _ATEOF
   88969 
   88970 { set +x
   88971 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   88972 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   88973 ( $at_check_trace;  $PREPARSER ./calc input
   88974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88975 at_status=$? at_failed=false
   88976 $at_check_filter
   88977 echo stderr:; tee stderr <"$at_stderr"
   88978 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88979 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
   88980 $at_failed && at_fn_log_failure
   88981 $at_traceon; }
   88982 
   88983 { set +x
   88984 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   88985 at_fn_check_prepare_trace "calc.at:644"
   88986 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   88987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   88988 at_status=$? at_failed=false
   88989 $at_check_filter
   88990 echo stderr:; tee stderr <"$at_stderr"
   88991 at_fn_diff_devnull "$at_stdout" || at_failed=:
   88992 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   88993 $at_failed && at_fn_log_failure
   88994 $at_traceon; }
   88995 
   88996 
   88997 
   88998 # Normalize the observed and expected error messages, depending upon the
   88999 # options.
   89000 # 1. Remove the traces from observed.
   89001 sed '/^Starting/d
   89002 /^Entering/d
   89003 /^Stack/d
   89004 /^Reading/d
   89005 /^Reducing/d
   89006 /^Return/d
   89007 /^Shifting/d
   89008 /^state/d
   89009 /^Cleanup:/d
   89010 /^Error:/d
   89011 /^Next/d
   89012 /^Now/d
   89013 /^Discarding/d
   89014 / \$[0-9$]* = /d
   89015 /^yydestructor:/d' stderr >at-stderr
   89016 mv at-stderr stderr
   89017 # 2. Create the reference error message.
   89018 cat >expout <<'_ATEOF'
   89019 1.7: syntax error, unexpected '='
   89020 _ATEOF
   89021 
   89022 # 3. If locations are not used, remove them.
   89023 sed 's/^[-0-9.]*: //' expout >at-expout
   89024 mv at-expout expout
   89025 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89026 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89027 mv at-expout expout
   89028 # 5. Check
   89029 { set +x
   89030 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89031 at_fn_check_prepare_trace "calc.at:644"
   89032 ( $at_check_trace; cat stderr
   89033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89034 at_status=$? at_failed=false
   89035 $at_check_filter
   89036 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89037 $at_diff expout "$at_stdout" || at_failed=:
   89038 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89039 $at_failed && at_fn_log_failure
   89040 $at_traceon; }
   89041 
   89042 
   89043 cat >input <<'_ATEOF'
   89044 
   89045 +1
   89046 _ATEOF
   89047 
   89048 { set +x
   89049 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   89050 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   89051 ( $at_check_trace;  $PREPARSER ./calc input
   89052 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89053 at_status=$? at_failed=false
   89054 $at_check_filter
   89055 echo stderr:; tee stderr <"$at_stderr"
   89056 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89057 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
   89058 $at_failed && at_fn_log_failure
   89059 $at_traceon; }
   89060 
   89061 { set +x
   89062 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89063 at_fn_check_prepare_trace "calc.at:644"
   89064 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89066 at_status=$? at_failed=false
   89067 $at_check_filter
   89068 echo stderr:; tee stderr <"$at_stderr"
   89069 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89070 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89071 $at_failed && at_fn_log_failure
   89072 $at_traceon; }
   89073 
   89074 
   89075 
   89076 # Normalize the observed and expected error messages, depending upon the
   89077 # options.
   89078 # 1. Remove the traces from observed.
   89079 sed '/^Starting/d
   89080 /^Entering/d
   89081 /^Stack/d
   89082 /^Reading/d
   89083 /^Reducing/d
   89084 /^Return/d
   89085 /^Shifting/d
   89086 /^state/d
   89087 /^Cleanup:/d
   89088 /^Error:/d
   89089 /^Next/d
   89090 /^Now/d
   89091 /^Discarding/d
   89092 / \$[0-9$]* = /d
   89093 /^yydestructor:/d' stderr >at-stderr
   89094 mv at-stderr stderr
   89095 # 2. Create the reference error message.
   89096 cat >expout <<'_ATEOF'
   89097 2.1: syntax error, unexpected '+'
   89098 _ATEOF
   89099 
   89100 # 3. If locations are not used, remove them.
   89101 sed 's/^[-0-9.]*: //' expout >at-expout
   89102 mv at-expout expout
   89103 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89104 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89105 mv at-expout expout
   89106 # 5. Check
   89107 { set +x
   89108 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89109 at_fn_check_prepare_trace "calc.at:644"
   89110 ( $at_check_trace; cat stderr
   89111 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89112 at_status=$? at_failed=false
   89113 $at_check_filter
   89114 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89115 $at_diff expout "$at_stdout" || at_failed=:
   89116 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89117 $at_failed && at_fn_log_failure
   89118 $at_traceon; }
   89119 
   89120 
   89121 # Exercise error messages with EOF: work on an empty file.
   89122 { set +x
   89123 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc /dev/null"
   89124 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:644"
   89125 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   89126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89127 at_status=$? at_failed=false
   89128 $at_check_filter
   89129 echo stderr:; tee stderr <"$at_stderr"
   89130 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89131 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
   89132 $at_failed && at_fn_log_failure
   89133 $at_traceon; }
   89134 
   89135 { set +x
   89136 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89137 at_fn_check_prepare_trace "calc.at:644"
   89138 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89140 at_status=$? at_failed=false
   89141 $at_check_filter
   89142 echo stderr:; tee stderr <"$at_stderr"
   89143 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89144 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89145 $at_failed && at_fn_log_failure
   89146 $at_traceon; }
   89147 
   89148 
   89149 
   89150 # Normalize the observed and expected error messages, depending upon the
   89151 # options.
   89152 # 1. Remove the traces from observed.
   89153 sed '/^Starting/d
   89154 /^Entering/d
   89155 /^Stack/d
   89156 /^Reading/d
   89157 /^Reducing/d
   89158 /^Return/d
   89159 /^Shifting/d
   89160 /^state/d
   89161 /^Cleanup:/d
   89162 /^Error:/d
   89163 /^Next/d
   89164 /^Now/d
   89165 /^Discarding/d
   89166 / \$[0-9$]* = /d
   89167 /^yydestructor:/d' stderr >at-stderr
   89168 mv at-stderr stderr
   89169 # 2. Create the reference error message.
   89170 cat >expout <<'_ATEOF'
   89171 1.1: syntax error, unexpected end of input
   89172 _ATEOF
   89173 
   89174 # 3. If locations are not used, remove them.
   89175 sed 's/^[-0-9.]*: //' expout >at-expout
   89176 mv at-expout expout
   89177 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89178 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89179 mv at-expout expout
   89180 # 5. Check
   89181 { set +x
   89182 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89183 at_fn_check_prepare_trace "calc.at:644"
   89184 ( $at_check_trace; cat stderr
   89185 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89186 at_status=$? at_failed=false
   89187 $at_check_filter
   89188 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89189 $at_diff expout "$at_stdout" || at_failed=:
   89190 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89191 $at_failed && at_fn_log_failure
   89192 $at_traceon; }
   89193 
   89194 
   89195 
   89196 # Exercise the error token: without it, we die at the first error,
   89197 # hence be sure to
   89198 #
   89199 # - have several errors which exercise different shift/discardings
   89200 #   - (): nothing to pop, nothing to discard
   89201 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   89202 #   - (* * *): nothing to pop, a lot to discard
   89203 #   - (1 + 2 * *): some to pop and discard
   89204 #
   89205 # - test the action associated to `error'
   89206 #
   89207 # - check the lookahead that triggers an error is not discarded
   89208 #   when we enter error recovery.  Below, the lookahead causing the
   89209 #   first error is ")", which is needed to recover from the error and
   89210 #   produce the "0" that triggers the "0 != 1" error.
   89211 #
   89212 cat >input <<'_ATEOF'
   89213 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   89214 _ATEOF
   89215 
   89216 { set +x
   89217 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   89218 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   89219 ( $at_check_trace;  $PREPARSER ./calc input
   89220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89221 at_status=$? at_failed=false
   89222 $at_check_filter
   89223 echo stderr:; tee stderr <"$at_stderr"
   89224 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89225 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89226 $at_failed && at_fn_log_failure
   89227 $at_traceon; }
   89228 
   89229 { set +x
   89230 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89231 at_fn_check_prepare_trace "calc.at:644"
   89232 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89234 at_status=$? at_failed=false
   89235 $at_check_filter
   89236 echo stderr:; tee stderr <"$at_stderr"
   89237 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89238 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89239 $at_failed && at_fn_log_failure
   89240 $at_traceon; }
   89241 
   89242 
   89243 
   89244 # Normalize the observed and expected error messages, depending upon the
   89245 # options.
   89246 # 1. Remove the traces from observed.
   89247 sed '/^Starting/d
   89248 /^Entering/d
   89249 /^Stack/d
   89250 /^Reading/d
   89251 /^Reducing/d
   89252 /^Return/d
   89253 /^Shifting/d
   89254 /^state/d
   89255 /^Cleanup:/d
   89256 /^Error:/d
   89257 /^Next/d
   89258 /^Now/d
   89259 /^Discarding/d
   89260 / \$[0-9$]* = /d
   89261 /^yydestructor:/d' stderr >at-stderr
   89262 mv at-stderr stderr
   89263 # 2. Create the reference error message.
   89264 cat >expout <<'_ATEOF'
   89265 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   89266 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   89267 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   89268 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   89269 calc: error: 4444 != 1
   89270 _ATEOF
   89271 
   89272 # 3. If locations are not used, remove them.
   89273 sed 's/^[-0-9.]*: //' expout >at-expout
   89274 mv at-expout expout
   89275 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89276 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89277 mv at-expout expout
   89278 # 5. Check
   89279 { set +x
   89280 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89281 at_fn_check_prepare_trace "calc.at:644"
   89282 ( $at_check_trace; cat stderr
   89283 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89284 at_status=$? at_failed=false
   89285 $at_check_filter
   89286 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89287 $at_diff expout "$at_stdout" || at_failed=:
   89288 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89289 $at_failed && at_fn_log_failure
   89290 $at_traceon; }
   89291 
   89292 
   89293 
   89294 # The same, but this time exercising explicitly triggered syntax errors.
   89295 # POSIX says the lookahead causing the error should not be discarded.
   89296 cat >input <<'_ATEOF'
   89297 (!) + (1 2) = 1
   89298 _ATEOF
   89299 
   89300 { set +x
   89301 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   89302 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   89303 ( $at_check_trace;  $PREPARSER ./calc input
   89304 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89305 at_status=$? at_failed=false
   89306 $at_check_filter
   89307 echo stderr:; tee stderr <"$at_stderr"
   89308 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89309 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89310 $at_failed && at_fn_log_failure
   89311 $at_traceon; }
   89312 
   89313 { set +x
   89314 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89315 at_fn_check_prepare_trace "calc.at:644"
   89316 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89317 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89318 at_status=$? at_failed=false
   89319 $at_check_filter
   89320 echo stderr:; tee stderr <"$at_stderr"
   89321 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89322 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89323 $at_failed && at_fn_log_failure
   89324 $at_traceon; }
   89325 
   89326 
   89327 
   89328 # Normalize the observed and expected error messages, depending upon the
   89329 # options.
   89330 # 1. Remove the traces from observed.
   89331 sed '/^Starting/d
   89332 /^Entering/d
   89333 /^Stack/d
   89334 /^Reading/d
   89335 /^Reducing/d
   89336 /^Return/d
   89337 /^Shifting/d
   89338 /^state/d
   89339 /^Cleanup:/d
   89340 /^Error:/d
   89341 /^Next/d
   89342 /^Now/d
   89343 /^Discarding/d
   89344 / \$[0-9$]* = /d
   89345 /^yydestructor:/d' stderr >at-stderr
   89346 mv at-stderr stderr
   89347 # 2. Create the reference error message.
   89348 cat >expout <<'_ATEOF'
   89349 1.10: syntax error, unexpected number
   89350 calc: error: 2222 != 1
   89351 _ATEOF
   89352 
   89353 # 3. If locations are not used, remove them.
   89354 sed 's/^[-0-9.]*: //' expout >at-expout
   89355 mv at-expout expout
   89356 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89357 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89358 mv at-expout expout
   89359 # 5. Check
   89360 { set +x
   89361 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89362 at_fn_check_prepare_trace "calc.at:644"
   89363 ( $at_check_trace; cat stderr
   89364 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89365 at_status=$? at_failed=false
   89366 $at_check_filter
   89367 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89368 $at_diff expout "$at_stdout" || at_failed=:
   89369 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89370 $at_failed && at_fn_log_failure
   89371 $at_traceon; }
   89372 
   89373 
   89374 cat >input <<'_ATEOF'
   89375 (- *) + (1 2) = 1
   89376 _ATEOF
   89377 
   89378 { set +x
   89379 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   89380 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   89381 ( $at_check_trace;  $PREPARSER ./calc input
   89382 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89383 at_status=$? at_failed=false
   89384 $at_check_filter
   89385 echo stderr:; tee stderr <"$at_stderr"
   89386 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89387 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89388 $at_failed && at_fn_log_failure
   89389 $at_traceon; }
   89390 
   89391 { set +x
   89392 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89393 at_fn_check_prepare_trace "calc.at:644"
   89394 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89395 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89396 at_status=$? at_failed=false
   89397 $at_check_filter
   89398 echo stderr:; tee stderr <"$at_stderr"
   89399 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89400 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89401 $at_failed && at_fn_log_failure
   89402 $at_traceon; }
   89403 
   89404 
   89405 
   89406 # Normalize the observed and expected error messages, depending upon the
   89407 # options.
   89408 # 1. Remove the traces from observed.
   89409 sed '/^Starting/d
   89410 /^Entering/d
   89411 /^Stack/d
   89412 /^Reading/d
   89413 /^Reducing/d
   89414 /^Return/d
   89415 /^Shifting/d
   89416 /^state/d
   89417 /^Cleanup:/d
   89418 /^Error:/d
   89419 /^Next/d
   89420 /^Now/d
   89421 /^Discarding/d
   89422 / \$[0-9$]* = /d
   89423 /^yydestructor:/d' stderr >at-stderr
   89424 mv at-stderr stderr
   89425 # 2. Create the reference error message.
   89426 cat >expout <<'_ATEOF'
   89427 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   89428 1.12: syntax error, unexpected number
   89429 calc: error: 2222 != 1
   89430 _ATEOF
   89431 
   89432 # 3. If locations are not used, remove them.
   89433 sed 's/^[-0-9.]*: //' expout >at-expout
   89434 mv at-expout expout
   89435 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89436 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89437 mv at-expout expout
   89438 # 5. Check
   89439 { set +x
   89440 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89441 at_fn_check_prepare_trace "calc.at:644"
   89442 ( $at_check_trace; cat stderr
   89443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89444 at_status=$? at_failed=false
   89445 $at_check_filter
   89446 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89447 $at_diff expout "$at_stdout" || at_failed=:
   89448 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89449 $at_failed && at_fn_log_failure
   89450 $at_traceon; }
   89451 
   89452 
   89453 
   89454 # Check that yyerrok works properly: second error is not reported,
   89455 # third and fourth are.  Parse status is succesfull.
   89456 cat >input <<'_ATEOF'
   89457 (* *) + (*) + (*)
   89458 _ATEOF
   89459 
   89460 { set +x
   89461 $as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
   89462 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
   89463 ( $at_check_trace;  $PREPARSER ./calc input
   89464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89465 at_status=$? at_failed=false
   89466 $at_check_filter
   89467 echo stderr:; tee stderr <"$at_stderr"
   89468 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89469 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89470 $at_failed && at_fn_log_failure
   89471 $at_traceon; }
   89472 
   89473 { set +x
   89474 $as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89475 at_fn_check_prepare_trace "calc.at:644"
   89476 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89478 at_status=$? at_failed=false
   89479 $at_check_filter
   89480 echo stderr:; tee stderr <"$at_stderr"
   89481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89482 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89483 $at_failed && at_fn_log_failure
   89484 $at_traceon; }
   89485 
   89486 
   89487 
   89488 # Normalize the observed and expected error messages, depending upon the
   89489 # options.
   89490 # 1. Remove the traces from observed.
   89491 sed '/^Starting/d
   89492 /^Entering/d
   89493 /^Stack/d
   89494 /^Reading/d
   89495 /^Reducing/d
   89496 /^Return/d
   89497 /^Shifting/d
   89498 /^state/d
   89499 /^Cleanup:/d
   89500 /^Error:/d
   89501 /^Next/d
   89502 /^Now/d
   89503 /^Discarding/d
   89504 / \$[0-9$]* = /d
   89505 /^yydestructor:/d' stderr >at-stderr
   89506 mv at-stderr stderr
   89507 # 2. Create the reference error message.
   89508 cat >expout <<'_ATEOF'
   89509 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   89510 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   89511 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   89512 _ATEOF
   89513 
   89514 # 3. If locations are not used, remove them.
   89515 sed 's/^[-0-9.]*: //' expout >at-expout
   89516 mv at-expout expout
   89517 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   89518 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   89519 mv at-expout expout
   89520 # 5. Check
   89521 { set +x
   89522 $as_echo "$at_srcdir/calc.at:644: cat stderr"
   89523 at_fn_check_prepare_trace "calc.at:644"
   89524 ( $at_check_trace; cat stderr
   89525 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89526 at_status=$? at_failed=false
   89527 $at_check_filter
   89528 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89529 $at_diff expout "$at_stdout" || at_failed=:
   89530 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
   89531 $at_failed && at_fn_log_failure
   89532 $at_traceon; }
   89533 
   89534 
   89535 
   89536 
   89537 
   89538   set +x
   89539   $at_times_p && times >"$at_times_file"
   89540 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   89541 read at_status <"$at_status_file"
   89542 #AT_STOP_223
   89543 #AT_START_224
   89544 at_fn_group_banner 224 'calc.at:645' \
   89545   "Calculator %glr-parser %yacc" "                   " 12
   89546 at_xfail=no
   89547 (
   89548   $as_echo "224. $at_setup_line: testing $at_desc ..."
   89549   $at_traceon
   89550 
   89551 
   89552 
   89553 
   89554 
   89555 
   89556 
   89557 
   89558 
   89559 
   89560 cat >calc.y <<'_ATEOF'
   89561 %code top {
   89562 #include <config.h>
   89563 /* We don't need perfect functions for these tests. */
   89564 #undef malloc
   89565 #undef memcmp
   89566 #undef realloc
   89567 }
   89568 
   89569 /* Infix notation calculator--calc */
   89570 %glr-parser %yacc
   89571 
   89572 %code requires
   89573 {
   89574 
   89575   /* Exercise pre-prologue dependency to %union.  */
   89576   typedef int semantic_value;
   89577 }
   89578 
   89579 /* Exercise %union. */
   89580 %union
   89581 {
   89582   semantic_value ival;
   89583 };
   89584 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   89585 
   89586 %code provides
   89587 {
   89588   #include <stdio.h>
   89589   /* The input.  */
   89590   extern FILE *input;
   89591   extern semantic_value global_result;
   89592   extern int global_count;
   89593 }
   89594 
   89595 %code
   89596 {
   89597 #include <assert.h>
   89598 #include <string.h>
   89599 #define USE(Var)
   89600 
   89601 FILE *input;
   89602 static int power (int base, int exponent);
   89603 
   89604 static void yyerror ( const char *msg);
   89605 int yylex (void);
   89606 }
   89607 
   89608 
   89609 
   89610 /* Bison Declarations */
   89611 %token CALC_EOF 0 "end of input"
   89612 %token <ival> NUM "number"
   89613 %type  <ival> exp
   89614 
   89615 %nonassoc '=' /* comparison            */
   89616 %left '-' '+'
   89617 %left '*' '/'
   89618 %left NEG     /* negation--unary minus */
   89619 %right '^'    /* exponentiation        */
   89620 
   89621 /* Grammar follows */
   89622 %%
   89623 input:
   89624   line
   89625 | input line         {  }
   89626 ;
   89627 
   89628 line:
   89629   '\n'
   89630 | exp '\n'           { USE ($1); }
   89631 ;
   89632 
   89633 exp:
   89634   NUM                { $$ = $1;             }
   89635 | exp '=' exp
   89636   {
   89637     if ($1 != $3)
   89638       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   89639     $$ = $1;
   89640   }
   89641 | exp '+' exp        { $$ = $1 + $3;        }
   89642 | exp '-' exp        { $$ = $1 - $3;        }
   89643 | exp '*' exp        { $$ = $1 * $3;        }
   89644 | exp '/' exp        { $$ = $1 / $3;        }
   89645 | '-' exp  %prec NEG { $$ = -$2;            }
   89646 | exp '^' exp        { $$ = power ($1, $3); }
   89647 | '(' exp ')'        { $$ = $2;             }
   89648 | '(' error ')'      { $$ = 1111; yyerrok;  }
   89649 | '!'                { $$ = 0; YYERROR;     }
   89650 | '-' error          { $$ = 0; YYERROR;     }
   89651 ;
   89652 %%
   89653 
   89654 static int
   89655 power (int base, int exponent)
   89656 {
   89657   int res = 1;
   89658   assert (0 <= exponent);
   89659   for (/* Niente */; exponent; --exponent)
   89660     res *= base;
   89661   return res;
   89662 }
   89663 
   89664 
   89665 #include <stdio.h>
   89666 /* A C error reporting function.  */
   89667 static
   89668 void yyerror ( const char *msg)
   89669 {
   89670   fprintf (stderr, "%s\n", msg);
   89671 }
   89672 #include <ctype.h>
   89673 
   89674 int yylex (void);
   89675 static int get_char (void);
   89676 static void unget_char ( int c);
   89677 
   89678 
   89679 static int
   89680 get_char (void)
   89681 {
   89682   int res = getc (input);
   89683   ;
   89684 
   89685   return res;
   89686 }
   89687 
   89688 static void
   89689 unget_char ( int c)
   89690 {
   89691   ;
   89692 
   89693   ungetc (c, input);
   89694 }
   89695 
   89696 static int
   89697 read_signed_integer (void)
   89698 {
   89699   int c = get_char ();
   89700   int sign = 1;
   89701   int n = 0;
   89702 
   89703   ;
   89704   if (c == '-')
   89705     {
   89706       c = get_char ();
   89707       sign = -1;
   89708     }
   89709 
   89710   while (isdigit (c))
   89711     {
   89712       n = 10 * n + (c - '0');
   89713       c = get_char ();
   89714     }
   89715 
   89716   unget_char ( c);
   89717 
   89718   return sign * n;
   89719 }
   89720 
   89721 
   89722 /*---------------------------------------------------------------.
   89723 | Lexical analyzer returns an integer on the stack and the token |
   89724 | NUM, or the ASCII character read if not a number.  Skips all   |
   89725 | blanks and tabs, returns 0 for EOF.                            |
   89726 `---------------------------------------------------------------*/
   89727 
   89728 int yylex (void)
   89729 {
   89730   int c;
   89731   /* Skip current token, then white spaces.  */
   89732   do
   89733     {
   89734 
   89735     }
   89736   while ((c = get_char ()) == ' ' || c == '\t');
   89737 
   89738   /* process numbers   */
   89739   if (c == '.' || isdigit (c))
   89740     {
   89741       unget_char ( c);
   89742       (yylval).ival = read_signed_integer ();
   89743       return NUM;
   89744     }
   89745 
   89746   /* Return end-of-file.  */
   89747   if (c == EOF)
   89748     return CALC_EOF;
   89749 
   89750   /* Return single chars. */
   89751   return c;
   89752 }
   89753 
   89754 #include <assert.h>
   89755 #if HAVE_UNISTD_H
   89756 # include <unistd.h>
   89757 #else
   89758 # undef alarm
   89759 # define alarm(seconds) /* empty */
   89760 #endif
   89761 
   89762 
   89763 
   89764 semantic_value global_result = 0;
   89765 int global_count = 0;
   89766 
   89767 /* A C main function.  */
   89768 int
   89769 main (int argc, const char **argv)
   89770 {
   89771   semantic_value result = 0;
   89772   int count = 0;
   89773   int status;
   89774 
   89775   /* This used to be alarm (10), but that isn't enough time for
   89776      a July 1995 vintage DEC Alphastation 200 4/100 system,
   89777      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   89778   alarm (100);
   89779 
   89780   if (argc == 2)
   89781     input = fopen (argv[1], "r");
   89782   else
   89783     input = stdin;
   89784 
   89785   if (!input)
   89786     {
   89787       perror (argv[1]);
   89788       return 3;
   89789     }
   89790 
   89791 
   89792   status = yyparse ();
   89793   if (fclose (input))
   89794     perror ("fclose");
   89795   assert (global_result == result);
   89796   assert (global_count == count);
   89797   return status;
   89798 }
   89799 _ATEOF
   89800 
   89801 
   89802 
   89803 
   89804 
   89805 
   89806 
   89807 
   89808 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   89809   at_save_special_files
   89810   mkdir xml-tests
   89811     # Don't combine these Bison invocations since we want to be sure that
   89812   # --report=all isn't required to get the full XML file.
   89813   { set +x
   89814 $as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   89815                   --graph=xml-tests/test.dot -o calc.c calc.y"
   89816 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645"
   89817 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   89818                   --graph=xml-tests/test.dot -o calc.c calc.y
   89819 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89820 at_status=$? at_failed=false
   89821 $at_check_filter
   89822 echo stderr:; cat "$at_stderr"
   89823 echo stdout:; cat "$at_stdout"
   89824 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89825 $at_failed && at_fn_log_failure
   89826 $at_traceon; }
   89827 
   89828   { set +x
   89829 $as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   89830 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:645"
   89831 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   89832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89833 at_status=$? at_failed=false
   89834 $at_check_filter
   89835 echo stderr:; cat "$at_stderr"
   89836 echo stdout:; cat "$at_stdout"
   89837 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89838 $at_failed && at_fn_log_failure
   89839 $at_traceon; }
   89840 
   89841     cp xml-tests/test.output expout
   89842   { set +x
   89843 $as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\
   89844              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   89845              xml-tests/test.xml"
   89846 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645"
   89847 ( $at_check_trace; $XSLTPROC \
   89848              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   89849              xml-tests/test.xml
   89850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89851 at_status=$? at_failed=false
   89852 $at_check_filter
   89853 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89854 $at_diff expout "$at_stdout" || at_failed=:
   89855 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89856 $at_failed && at_fn_log_failure
   89857 $at_traceon; }
   89858 
   89859   sort xml-tests/test.dot > expout
   89860   { set +x
   89861 $as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\
   89862              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   89863              xml-tests/test.xml | sort"
   89864 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645"
   89865 ( $at_check_trace; $XSLTPROC \
   89866              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   89867              xml-tests/test.xml | sort
   89868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89869 at_status=$? at_failed=false
   89870 $at_check_filter
   89871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89872 $at_diff expout "$at_stdout" || at_failed=:
   89873 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89874 $at_failed && at_fn_log_failure
   89875 $at_traceon; }
   89876 
   89877   rm -rf xml-tests expout
   89878   at_restore_special_files
   89879 fi
   89880 { set +x
   89881 $as_echo "$at_srcdir/calc.at:645: bison -o calc.c calc.y"
   89882 at_fn_check_prepare_trace "calc.at:645"
   89883 ( $at_check_trace; bison -o calc.c calc.y
   89884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89885 at_status=$? at_failed=false
   89886 $at_check_filter
   89887 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89888 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89889 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89890 $at_failed && at_fn_log_failure
   89891 $at_traceon; }
   89892 
   89893 
   89894    { set +x
   89895 $as_echo "$at_srcdir/calc.at:645: \$BISON_C_WORKS"
   89896 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:645"
   89897 ( $at_check_trace; $BISON_C_WORKS
   89898 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89899 at_status=$? at_failed=false
   89900 $at_check_filter
   89901 echo stderr:; cat "$at_stderr"
   89902 echo stdout:; cat "$at_stdout"
   89903 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89904 $at_failed && at_fn_log_failure
   89905 $at_traceon; }
   89906 
   89907 { set +x
   89908 $as_echo "$at_srcdir/calc.at:645: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   89909 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:645"
   89910 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   89911 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89912 at_status=$? at_failed=false
   89913 $at_check_filter
   89914 echo stderr:; cat "$at_stderr"
   89915 echo stdout:; cat "$at_stdout"
   89916 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89917 $at_failed && at_fn_log_failure
   89918 $at_traceon; }
   89919 
   89920 
   89921 { set +x
   89922 $as_echo "$at_srcdir/calc.at:645: \$PERL -ne '
   89923   chomp;
   89924   print \"\$.: {\$_}\\n\"
   89925     if (# No starting/ending empty lines.
   89926         (eof || \$. == 1) && /^\\s*\$/
   89927         # No trailing space.  FIXME: not ready for \"maint\".
   89928         # || /\\s\$/
   89929         )' calc.c
   89930 "
   89931 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645"
   89932 ( $at_check_trace; $PERL -ne '
   89933   chomp;
   89934   print "$.: {$_}\n"
   89935     if (# No starting/ending empty lines.
   89936         (eof || $. == 1) && /^\s*$/
   89937         # No trailing space.  FIXME: not ready for "maint".
   89938         # || /\s$/
   89939         )' calc.c
   89940 
   89941 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89942 at_status=$? at_failed=false
   89943 $at_check_filter
   89944 at_fn_diff_devnull "$at_stderr" || at_failed=:
   89945 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89946 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89947 $at_failed && at_fn_log_failure
   89948 $at_traceon; }
   89949 
   89950 
   89951 
   89952 # Test the priorities.
   89953 cat >input <<'_ATEOF'
   89954 1 + 2 * 3 = 7
   89955 1 + 2 * -3 = -5
   89956 
   89957 -1^2 = -1
   89958 (-1)^2 = 1
   89959 
   89960 ---1 = -1
   89961 
   89962 1 - 2 - 3 = -4
   89963 1 - (2 - 3) = 2
   89964 
   89965 2^2^3 = 256
   89966 (2^2)^3 = 64
   89967 _ATEOF
   89968 
   89969 { set +x
   89970 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   89971 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   89972 ( $at_check_trace;  $PREPARSER ./calc input
   89973 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89974 at_status=$? at_failed=false
   89975 $at_check_filter
   89976 echo stderr:; tee stderr <"$at_stderr"
   89977 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89978 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89979 $at_failed && at_fn_log_failure
   89980 $at_traceon; }
   89981 
   89982 { set +x
   89983 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   89984 at_fn_check_prepare_trace "calc.at:645"
   89985 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   89986 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   89987 at_status=$? at_failed=false
   89988 $at_check_filter
   89989 echo stderr:; tee stderr <"$at_stderr"
   89990 at_fn_diff_devnull "$at_stdout" || at_failed=:
   89991 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   89992 $at_failed && at_fn_log_failure
   89993 $at_traceon; }
   89994 
   89995 
   89996 
   89997 
   89998 # Some syntax errors.
   89999 cat >input <<'_ATEOF'
   90000 1 2
   90001 _ATEOF
   90002 
   90003 { set +x
   90004 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90005 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90006 ( $at_check_trace;  $PREPARSER ./calc input
   90007 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90008 at_status=$? at_failed=false
   90009 $at_check_filter
   90010 echo stderr:; tee stderr <"$at_stderr"
   90011 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90012 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
   90013 $at_failed && at_fn_log_failure
   90014 $at_traceon; }
   90015 
   90016 { set +x
   90017 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90018 at_fn_check_prepare_trace "calc.at:645"
   90019 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90020 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90021 at_status=$? at_failed=false
   90022 $at_check_filter
   90023 echo stderr:; tee stderr <"$at_stderr"
   90024 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90025 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90026 $at_failed && at_fn_log_failure
   90027 $at_traceon; }
   90028 
   90029 
   90030 
   90031 # Normalize the observed and expected error messages, depending upon the
   90032 # options.
   90033 # 1. Remove the traces from observed.
   90034 sed '/^Starting/d
   90035 /^Entering/d
   90036 /^Stack/d
   90037 /^Reading/d
   90038 /^Reducing/d
   90039 /^Return/d
   90040 /^Shifting/d
   90041 /^state/d
   90042 /^Cleanup:/d
   90043 /^Error:/d
   90044 /^Next/d
   90045 /^Now/d
   90046 /^Discarding/d
   90047 / \$[0-9$]* = /d
   90048 /^yydestructor:/d' stderr >at-stderr
   90049 mv at-stderr stderr
   90050 # 2. Create the reference error message.
   90051 cat >expout <<'_ATEOF'
   90052 1.3: syntax error, unexpected number
   90053 _ATEOF
   90054 
   90055 # 3. If locations are not used, remove them.
   90056 sed 's/^[-0-9.]*: //' expout >at-expout
   90057 mv at-expout expout
   90058 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90059 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90060 mv at-expout expout
   90061 # 5. Check
   90062 { set +x
   90063 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90064 at_fn_check_prepare_trace "calc.at:645"
   90065 ( $at_check_trace; cat stderr
   90066 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90067 at_status=$? at_failed=false
   90068 $at_check_filter
   90069 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90070 $at_diff expout "$at_stdout" || at_failed=:
   90071 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90072 $at_failed && at_fn_log_failure
   90073 $at_traceon; }
   90074 
   90075 
   90076 cat >input <<'_ATEOF'
   90077 1//2
   90078 _ATEOF
   90079 
   90080 { set +x
   90081 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90082 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90083 ( $at_check_trace;  $PREPARSER ./calc input
   90084 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90085 at_status=$? at_failed=false
   90086 $at_check_filter
   90087 echo stderr:; tee stderr <"$at_stderr"
   90088 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90089 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
   90090 $at_failed && at_fn_log_failure
   90091 $at_traceon; }
   90092 
   90093 { set +x
   90094 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90095 at_fn_check_prepare_trace "calc.at:645"
   90096 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90097 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90098 at_status=$? at_failed=false
   90099 $at_check_filter
   90100 echo stderr:; tee stderr <"$at_stderr"
   90101 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90102 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90103 $at_failed && at_fn_log_failure
   90104 $at_traceon; }
   90105 
   90106 
   90107 
   90108 # Normalize the observed and expected error messages, depending upon the
   90109 # options.
   90110 # 1. Remove the traces from observed.
   90111 sed '/^Starting/d
   90112 /^Entering/d
   90113 /^Stack/d
   90114 /^Reading/d
   90115 /^Reducing/d
   90116 /^Return/d
   90117 /^Shifting/d
   90118 /^state/d
   90119 /^Cleanup:/d
   90120 /^Error:/d
   90121 /^Next/d
   90122 /^Now/d
   90123 /^Discarding/d
   90124 / \$[0-9$]* = /d
   90125 /^yydestructor:/d' stderr >at-stderr
   90126 mv at-stderr stderr
   90127 # 2. Create the reference error message.
   90128 cat >expout <<'_ATEOF'
   90129 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   90130 _ATEOF
   90131 
   90132 # 3. If locations are not used, remove them.
   90133 sed 's/^[-0-9.]*: //' expout >at-expout
   90134 mv at-expout expout
   90135 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90136 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90137 mv at-expout expout
   90138 # 5. Check
   90139 { set +x
   90140 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90141 at_fn_check_prepare_trace "calc.at:645"
   90142 ( $at_check_trace; cat stderr
   90143 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90144 at_status=$? at_failed=false
   90145 $at_check_filter
   90146 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90147 $at_diff expout "$at_stdout" || at_failed=:
   90148 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90149 $at_failed && at_fn_log_failure
   90150 $at_traceon; }
   90151 
   90152 
   90153 cat >input <<'_ATEOF'
   90154 error
   90155 _ATEOF
   90156 
   90157 { set +x
   90158 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90159 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90160 ( $at_check_trace;  $PREPARSER ./calc input
   90161 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90162 at_status=$? at_failed=false
   90163 $at_check_filter
   90164 echo stderr:; tee stderr <"$at_stderr"
   90165 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90166 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
   90167 $at_failed && at_fn_log_failure
   90168 $at_traceon; }
   90169 
   90170 { set +x
   90171 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90172 at_fn_check_prepare_trace "calc.at:645"
   90173 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90175 at_status=$? at_failed=false
   90176 $at_check_filter
   90177 echo stderr:; tee stderr <"$at_stderr"
   90178 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90179 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90180 $at_failed && at_fn_log_failure
   90181 $at_traceon; }
   90182 
   90183 
   90184 
   90185 # Normalize the observed and expected error messages, depending upon the
   90186 # options.
   90187 # 1. Remove the traces from observed.
   90188 sed '/^Starting/d
   90189 /^Entering/d
   90190 /^Stack/d
   90191 /^Reading/d
   90192 /^Reducing/d
   90193 /^Return/d
   90194 /^Shifting/d
   90195 /^state/d
   90196 /^Cleanup:/d
   90197 /^Error:/d
   90198 /^Next/d
   90199 /^Now/d
   90200 /^Discarding/d
   90201 / \$[0-9$]* = /d
   90202 /^yydestructor:/d' stderr >at-stderr
   90203 mv at-stderr stderr
   90204 # 2. Create the reference error message.
   90205 cat >expout <<'_ATEOF'
   90206 1.1: syntax error, unexpected $undefined
   90207 _ATEOF
   90208 
   90209 # 3. If locations are not used, remove them.
   90210 sed 's/^[-0-9.]*: //' expout >at-expout
   90211 mv at-expout expout
   90212 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90213 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90214 mv at-expout expout
   90215 # 5. Check
   90216 { set +x
   90217 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90218 at_fn_check_prepare_trace "calc.at:645"
   90219 ( $at_check_trace; cat stderr
   90220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90221 at_status=$? at_failed=false
   90222 $at_check_filter
   90223 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90224 $at_diff expout "$at_stdout" || at_failed=:
   90225 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90226 $at_failed && at_fn_log_failure
   90227 $at_traceon; }
   90228 
   90229 
   90230 cat >input <<'_ATEOF'
   90231 1 = 2 = 3
   90232 _ATEOF
   90233 
   90234 { set +x
   90235 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90236 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90237 ( $at_check_trace;  $PREPARSER ./calc input
   90238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90239 at_status=$? at_failed=false
   90240 $at_check_filter
   90241 echo stderr:; tee stderr <"$at_stderr"
   90242 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90243 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
   90244 $at_failed && at_fn_log_failure
   90245 $at_traceon; }
   90246 
   90247 { set +x
   90248 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90249 at_fn_check_prepare_trace "calc.at:645"
   90250 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90252 at_status=$? at_failed=false
   90253 $at_check_filter
   90254 echo stderr:; tee stderr <"$at_stderr"
   90255 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90256 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90257 $at_failed && at_fn_log_failure
   90258 $at_traceon; }
   90259 
   90260 
   90261 
   90262 # Normalize the observed and expected error messages, depending upon the
   90263 # options.
   90264 # 1. Remove the traces from observed.
   90265 sed '/^Starting/d
   90266 /^Entering/d
   90267 /^Stack/d
   90268 /^Reading/d
   90269 /^Reducing/d
   90270 /^Return/d
   90271 /^Shifting/d
   90272 /^state/d
   90273 /^Cleanup:/d
   90274 /^Error:/d
   90275 /^Next/d
   90276 /^Now/d
   90277 /^Discarding/d
   90278 / \$[0-9$]* = /d
   90279 /^yydestructor:/d' stderr >at-stderr
   90280 mv at-stderr stderr
   90281 # 2. Create the reference error message.
   90282 cat >expout <<'_ATEOF'
   90283 1.7: syntax error, unexpected '='
   90284 _ATEOF
   90285 
   90286 # 3. If locations are not used, remove them.
   90287 sed 's/^[-0-9.]*: //' expout >at-expout
   90288 mv at-expout expout
   90289 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90290 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90291 mv at-expout expout
   90292 # 5. Check
   90293 { set +x
   90294 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90295 at_fn_check_prepare_trace "calc.at:645"
   90296 ( $at_check_trace; cat stderr
   90297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90298 at_status=$? at_failed=false
   90299 $at_check_filter
   90300 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90301 $at_diff expout "$at_stdout" || at_failed=:
   90302 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90303 $at_failed && at_fn_log_failure
   90304 $at_traceon; }
   90305 
   90306 
   90307 cat >input <<'_ATEOF'
   90308 
   90309 +1
   90310 _ATEOF
   90311 
   90312 { set +x
   90313 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90314 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90315 ( $at_check_trace;  $PREPARSER ./calc input
   90316 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90317 at_status=$? at_failed=false
   90318 $at_check_filter
   90319 echo stderr:; tee stderr <"$at_stderr"
   90320 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90321 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
   90322 $at_failed && at_fn_log_failure
   90323 $at_traceon; }
   90324 
   90325 { set +x
   90326 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90327 at_fn_check_prepare_trace "calc.at:645"
   90328 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90330 at_status=$? at_failed=false
   90331 $at_check_filter
   90332 echo stderr:; tee stderr <"$at_stderr"
   90333 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90334 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90335 $at_failed && at_fn_log_failure
   90336 $at_traceon; }
   90337 
   90338 
   90339 
   90340 # Normalize the observed and expected error messages, depending upon the
   90341 # options.
   90342 # 1. Remove the traces from observed.
   90343 sed '/^Starting/d
   90344 /^Entering/d
   90345 /^Stack/d
   90346 /^Reading/d
   90347 /^Reducing/d
   90348 /^Return/d
   90349 /^Shifting/d
   90350 /^state/d
   90351 /^Cleanup:/d
   90352 /^Error:/d
   90353 /^Next/d
   90354 /^Now/d
   90355 /^Discarding/d
   90356 / \$[0-9$]* = /d
   90357 /^yydestructor:/d' stderr >at-stderr
   90358 mv at-stderr stderr
   90359 # 2. Create the reference error message.
   90360 cat >expout <<'_ATEOF'
   90361 2.1: syntax error, unexpected '+'
   90362 _ATEOF
   90363 
   90364 # 3. If locations are not used, remove them.
   90365 sed 's/^[-0-9.]*: //' expout >at-expout
   90366 mv at-expout expout
   90367 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90368 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90369 mv at-expout expout
   90370 # 5. Check
   90371 { set +x
   90372 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90373 at_fn_check_prepare_trace "calc.at:645"
   90374 ( $at_check_trace; cat stderr
   90375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90376 at_status=$? at_failed=false
   90377 $at_check_filter
   90378 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90379 $at_diff expout "$at_stdout" || at_failed=:
   90380 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90381 $at_failed && at_fn_log_failure
   90382 $at_traceon; }
   90383 
   90384 
   90385 # Exercise error messages with EOF: work on an empty file.
   90386 { set +x
   90387 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc /dev/null"
   90388 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:645"
   90389 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   90390 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90391 at_status=$? at_failed=false
   90392 $at_check_filter
   90393 echo stderr:; tee stderr <"$at_stderr"
   90394 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90395 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
   90396 $at_failed && at_fn_log_failure
   90397 $at_traceon; }
   90398 
   90399 { set +x
   90400 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90401 at_fn_check_prepare_trace "calc.at:645"
   90402 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90404 at_status=$? at_failed=false
   90405 $at_check_filter
   90406 echo stderr:; tee stderr <"$at_stderr"
   90407 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90408 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90409 $at_failed && at_fn_log_failure
   90410 $at_traceon; }
   90411 
   90412 
   90413 
   90414 # Normalize the observed and expected error messages, depending upon the
   90415 # options.
   90416 # 1. Remove the traces from observed.
   90417 sed '/^Starting/d
   90418 /^Entering/d
   90419 /^Stack/d
   90420 /^Reading/d
   90421 /^Reducing/d
   90422 /^Return/d
   90423 /^Shifting/d
   90424 /^state/d
   90425 /^Cleanup:/d
   90426 /^Error:/d
   90427 /^Next/d
   90428 /^Now/d
   90429 /^Discarding/d
   90430 / \$[0-9$]* = /d
   90431 /^yydestructor:/d' stderr >at-stderr
   90432 mv at-stderr stderr
   90433 # 2. Create the reference error message.
   90434 cat >expout <<'_ATEOF'
   90435 1.1: syntax error, unexpected end of input
   90436 _ATEOF
   90437 
   90438 # 3. If locations are not used, remove them.
   90439 sed 's/^[-0-9.]*: //' expout >at-expout
   90440 mv at-expout expout
   90441 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90442 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90443 mv at-expout expout
   90444 # 5. Check
   90445 { set +x
   90446 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90447 at_fn_check_prepare_trace "calc.at:645"
   90448 ( $at_check_trace; cat stderr
   90449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90450 at_status=$? at_failed=false
   90451 $at_check_filter
   90452 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90453 $at_diff expout "$at_stdout" || at_failed=:
   90454 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90455 $at_failed && at_fn_log_failure
   90456 $at_traceon; }
   90457 
   90458 
   90459 
   90460 # Exercise the error token: without it, we die at the first error,
   90461 # hence be sure to
   90462 #
   90463 # - have several errors which exercise different shift/discardings
   90464 #   - (): nothing to pop, nothing to discard
   90465 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   90466 #   - (* * *): nothing to pop, a lot to discard
   90467 #   - (1 + 2 * *): some to pop and discard
   90468 #
   90469 # - test the action associated to `error'
   90470 #
   90471 # - check the lookahead that triggers an error is not discarded
   90472 #   when we enter error recovery.  Below, the lookahead causing the
   90473 #   first error is ")", which is needed to recover from the error and
   90474 #   produce the "0" that triggers the "0 != 1" error.
   90475 #
   90476 cat >input <<'_ATEOF'
   90477 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   90478 _ATEOF
   90479 
   90480 { set +x
   90481 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90482 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90483 ( $at_check_trace;  $PREPARSER ./calc input
   90484 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90485 at_status=$? at_failed=false
   90486 $at_check_filter
   90487 echo stderr:; tee stderr <"$at_stderr"
   90488 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90489 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90490 $at_failed && at_fn_log_failure
   90491 $at_traceon; }
   90492 
   90493 { set +x
   90494 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90495 at_fn_check_prepare_trace "calc.at:645"
   90496 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90497 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90498 at_status=$? at_failed=false
   90499 $at_check_filter
   90500 echo stderr:; tee stderr <"$at_stderr"
   90501 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90502 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90503 $at_failed && at_fn_log_failure
   90504 $at_traceon; }
   90505 
   90506 
   90507 
   90508 # Normalize the observed and expected error messages, depending upon the
   90509 # options.
   90510 # 1. Remove the traces from observed.
   90511 sed '/^Starting/d
   90512 /^Entering/d
   90513 /^Stack/d
   90514 /^Reading/d
   90515 /^Reducing/d
   90516 /^Return/d
   90517 /^Shifting/d
   90518 /^state/d
   90519 /^Cleanup:/d
   90520 /^Error:/d
   90521 /^Next/d
   90522 /^Now/d
   90523 /^Discarding/d
   90524 / \$[0-9$]* = /d
   90525 /^yydestructor:/d' stderr >at-stderr
   90526 mv at-stderr stderr
   90527 # 2. Create the reference error message.
   90528 cat >expout <<'_ATEOF'
   90529 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   90530 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   90531 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   90532 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   90533 calc: error: 4444 != 1
   90534 _ATEOF
   90535 
   90536 # 3. If locations are not used, remove them.
   90537 sed 's/^[-0-9.]*: //' expout >at-expout
   90538 mv at-expout expout
   90539 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90540 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90541 mv at-expout expout
   90542 # 5. Check
   90543 { set +x
   90544 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90545 at_fn_check_prepare_trace "calc.at:645"
   90546 ( $at_check_trace; cat stderr
   90547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90548 at_status=$? at_failed=false
   90549 $at_check_filter
   90550 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90551 $at_diff expout "$at_stdout" || at_failed=:
   90552 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90553 $at_failed && at_fn_log_failure
   90554 $at_traceon; }
   90555 
   90556 
   90557 
   90558 # The same, but this time exercising explicitly triggered syntax errors.
   90559 # POSIX says the lookahead causing the error should not be discarded.
   90560 cat >input <<'_ATEOF'
   90561 (!) + (1 2) = 1
   90562 _ATEOF
   90563 
   90564 { set +x
   90565 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90566 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90567 ( $at_check_trace;  $PREPARSER ./calc input
   90568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90569 at_status=$? at_failed=false
   90570 $at_check_filter
   90571 echo stderr:; tee stderr <"$at_stderr"
   90572 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90573 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90574 $at_failed && at_fn_log_failure
   90575 $at_traceon; }
   90576 
   90577 { set +x
   90578 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90579 at_fn_check_prepare_trace "calc.at:645"
   90580 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90582 at_status=$? at_failed=false
   90583 $at_check_filter
   90584 echo stderr:; tee stderr <"$at_stderr"
   90585 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90586 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90587 $at_failed && at_fn_log_failure
   90588 $at_traceon; }
   90589 
   90590 
   90591 
   90592 # Normalize the observed and expected error messages, depending upon the
   90593 # options.
   90594 # 1. Remove the traces from observed.
   90595 sed '/^Starting/d
   90596 /^Entering/d
   90597 /^Stack/d
   90598 /^Reading/d
   90599 /^Reducing/d
   90600 /^Return/d
   90601 /^Shifting/d
   90602 /^state/d
   90603 /^Cleanup:/d
   90604 /^Error:/d
   90605 /^Next/d
   90606 /^Now/d
   90607 /^Discarding/d
   90608 / \$[0-9$]* = /d
   90609 /^yydestructor:/d' stderr >at-stderr
   90610 mv at-stderr stderr
   90611 # 2. Create the reference error message.
   90612 cat >expout <<'_ATEOF'
   90613 1.10: syntax error, unexpected number
   90614 calc: error: 2222 != 1
   90615 _ATEOF
   90616 
   90617 # 3. If locations are not used, remove them.
   90618 sed 's/^[-0-9.]*: //' expout >at-expout
   90619 mv at-expout expout
   90620 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90621 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90622 mv at-expout expout
   90623 # 5. Check
   90624 { set +x
   90625 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90626 at_fn_check_prepare_trace "calc.at:645"
   90627 ( $at_check_trace; cat stderr
   90628 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90629 at_status=$? at_failed=false
   90630 $at_check_filter
   90631 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90632 $at_diff expout "$at_stdout" || at_failed=:
   90633 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90634 $at_failed && at_fn_log_failure
   90635 $at_traceon; }
   90636 
   90637 
   90638 cat >input <<'_ATEOF'
   90639 (- *) + (1 2) = 1
   90640 _ATEOF
   90641 
   90642 { set +x
   90643 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90644 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90645 ( $at_check_trace;  $PREPARSER ./calc input
   90646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90647 at_status=$? at_failed=false
   90648 $at_check_filter
   90649 echo stderr:; tee stderr <"$at_stderr"
   90650 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90651 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90652 $at_failed && at_fn_log_failure
   90653 $at_traceon; }
   90654 
   90655 { set +x
   90656 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90657 at_fn_check_prepare_trace "calc.at:645"
   90658 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90659 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90660 at_status=$? at_failed=false
   90661 $at_check_filter
   90662 echo stderr:; tee stderr <"$at_stderr"
   90663 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90664 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90665 $at_failed && at_fn_log_failure
   90666 $at_traceon; }
   90667 
   90668 
   90669 
   90670 # Normalize the observed and expected error messages, depending upon the
   90671 # options.
   90672 # 1. Remove the traces from observed.
   90673 sed '/^Starting/d
   90674 /^Entering/d
   90675 /^Stack/d
   90676 /^Reading/d
   90677 /^Reducing/d
   90678 /^Return/d
   90679 /^Shifting/d
   90680 /^state/d
   90681 /^Cleanup:/d
   90682 /^Error:/d
   90683 /^Next/d
   90684 /^Now/d
   90685 /^Discarding/d
   90686 / \$[0-9$]* = /d
   90687 /^yydestructor:/d' stderr >at-stderr
   90688 mv at-stderr stderr
   90689 # 2. Create the reference error message.
   90690 cat >expout <<'_ATEOF'
   90691 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   90692 1.12: syntax error, unexpected number
   90693 calc: error: 2222 != 1
   90694 _ATEOF
   90695 
   90696 # 3. If locations are not used, remove them.
   90697 sed 's/^[-0-9.]*: //' expout >at-expout
   90698 mv at-expout expout
   90699 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90700 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90701 mv at-expout expout
   90702 # 5. Check
   90703 { set +x
   90704 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90705 at_fn_check_prepare_trace "calc.at:645"
   90706 ( $at_check_trace; cat stderr
   90707 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90708 at_status=$? at_failed=false
   90709 $at_check_filter
   90710 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90711 $at_diff expout "$at_stdout" || at_failed=:
   90712 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90713 $at_failed && at_fn_log_failure
   90714 $at_traceon; }
   90715 
   90716 
   90717 
   90718 # Check that yyerrok works properly: second error is not reported,
   90719 # third and fourth are.  Parse status is succesfull.
   90720 cat >input <<'_ATEOF'
   90721 (* *) + (*) + (*)
   90722 _ATEOF
   90723 
   90724 { set +x
   90725 $as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
   90726 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
   90727 ( $at_check_trace;  $PREPARSER ./calc input
   90728 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90729 at_status=$? at_failed=false
   90730 $at_check_filter
   90731 echo stderr:; tee stderr <"$at_stderr"
   90732 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90733 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90734 $at_failed && at_fn_log_failure
   90735 $at_traceon; }
   90736 
   90737 { set +x
   90738 $as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   90739 at_fn_check_prepare_trace "calc.at:645"
   90740 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   90741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90742 at_status=$? at_failed=false
   90743 $at_check_filter
   90744 echo stderr:; tee stderr <"$at_stderr"
   90745 at_fn_diff_devnull "$at_stdout" || at_failed=:
   90746 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90747 $at_failed && at_fn_log_failure
   90748 $at_traceon; }
   90749 
   90750 
   90751 
   90752 # Normalize the observed and expected error messages, depending upon the
   90753 # options.
   90754 # 1. Remove the traces from observed.
   90755 sed '/^Starting/d
   90756 /^Entering/d
   90757 /^Stack/d
   90758 /^Reading/d
   90759 /^Reducing/d
   90760 /^Return/d
   90761 /^Shifting/d
   90762 /^state/d
   90763 /^Cleanup:/d
   90764 /^Error:/d
   90765 /^Next/d
   90766 /^Now/d
   90767 /^Discarding/d
   90768 / \$[0-9$]* = /d
   90769 /^yydestructor:/d' stderr >at-stderr
   90770 mv at-stderr stderr
   90771 # 2. Create the reference error message.
   90772 cat >expout <<'_ATEOF'
   90773 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   90774 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   90775 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   90776 _ATEOF
   90777 
   90778 # 3. If locations are not used, remove them.
   90779 sed 's/^[-0-9.]*: //' expout >at-expout
   90780 mv at-expout expout
   90781 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   90782 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   90783 mv at-expout expout
   90784 # 5. Check
   90785 { set +x
   90786 $as_echo "$at_srcdir/calc.at:645: cat stderr"
   90787 at_fn_check_prepare_trace "calc.at:645"
   90788 ( $at_check_trace; cat stderr
   90789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   90790 at_status=$? at_failed=false
   90791 $at_check_filter
   90792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   90793 $at_diff expout "$at_stdout" || at_failed=:
   90794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
   90795 $at_failed && at_fn_log_failure
   90796 $at_traceon; }
   90797 
   90798 
   90799 
   90800 
   90801 
   90802   set +x
   90803   $at_times_p && times >"$at_times_file"
   90804 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   90805 read at_status <"$at_status_file"
   90806 #AT_STOP_224
   90807 #AT_START_225
   90808 at_fn_group_banner 225 'calc.at:646' \
   90809   "Calculator %glr-parser %error-verbose" "          " 12
   90810 at_xfail=no
   90811 (
   90812   $as_echo "225. $at_setup_line: testing $at_desc ..."
   90813   $at_traceon
   90814 
   90815 
   90816 
   90817 
   90818 
   90819 
   90820 
   90821 
   90822 
   90823 
   90824 cat >calc.y <<'_ATEOF'
   90825 %code top {
   90826 #include <config.h>
   90827 /* We don't need perfect functions for these tests. */
   90828 #undef malloc
   90829 #undef memcmp
   90830 #undef realloc
   90831 }
   90832 
   90833 /* Infix notation calculator--calc */
   90834 %glr-parser %error-verbose
   90835 
   90836 %code requires
   90837 {
   90838 
   90839   /* Exercise pre-prologue dependency to %union.  */
   90840   typedef int semantic_value;
   90841 }
   90842 
   90843 /* Exercise %union. */
   90844 %union
   90845 {
   90846   semantic_value ival;
   90847 };
   90848 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   90849 
   90850 %code provides
   90851 {
   90852   #include <stdio.h>
   90853   /* The input.  */
   90854   extern FILE *input;
   90855   extern semantic_value global_result;
   90856   extern int global_count;
   90857 }
   90858 
   90859 %code
   90860 {
   90861 #include <assert.h>
   90862 #include <string.h>
   90863 #define USE(Var)
   90864 
   90865 FILE *input;
   90866 static int power (int base, int exponent);
   90867 
   90868 static void yyerror ( const char *msg);
   90869 int yylex (void);
   90870 }
   90871 
   90872 
   90873 
   90874 /* Bison Declarations */
   90875 %token CALC_EOF 0 "end of input"
   90876 %token <ival> NUM "number"
   90877 %type  <ival> exp
   90878 
   90879 %nonassoc '=' /* comparison            */
   90880 %left '-' '+'
   90881 %left '*' '/'
   90882 %left NEG     /* negation--unary minus */
   90883 %right '^'    /* exponentiation        */
   90884 
   90885 /* Grammar follows */
   90886 %%
   90887 input:
   90888   line
   90889 | input line         {  }
   90890 ;
   90891 
   90892 line:
   90893   '\n'
   90894 | exp '\n'           { USE ($1); }
   90895 ;
   90896 
   90897 exp:
   90898   NUM                { $$ = $1;             }
   90899 | exp '=' exp
   90900   {
   90901     if ($1 != $3)
   90902       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   90903     $$ = $1;
   90904   }
   90905 | exp '+' exp        { $$ = $1 + $3;        }
   90906 | exp '-' exp        { $$ = $1 - $3;        }
   90907 | exp '*' exp        { $$ = $1 * $3;        }
   90908 | exp '/' exp        { $$ = $1 / $3;        }
   90909 | '-' exp  %prec NEG { $$ = -$2;            }
   90910 | exp '^' exp        { $$ = power ($1, $3); }
   90911 | '(' exp ')'        { $$ = $2;             }
   90912 | '(' error ')'      { $$ = 1111; yyerrok;  }
   90913 | '!'                { $$ = 0; YYERROR;     }
   90914 | '-' error          { $$ = 0; YYERROR;     }
   90915 ;
   90916 %%
   90917 
   90918 static int
   90919 power (int base, int exponent)
   90920 {
   90921   int res = 1;
   90922   assert (0 <= exponent);
   90923   for (/* Niente */; exponent; --exponent)
   90924     res *= base;
   90925   return res;
   90926 }
   90927 
   90928 
   90929 #include <stdio.h>
   90930 /* A C error reporting function.  */
   90931 static
   90932 void yyerror ( const char *msg)
   90933 {
   90934   fprintf (stderr, "%s\n", msg);
   90935 }
   90936 #include <ctype.h>
   90937 
   90938 int yylex (void);
   90939 static int get_char (void);
   90940 static void unget_char ( int c);
   90941 
   90942 
   90943 static int
   90944 get_char (void)
   90945 {
   90946   int res = getc (input);
   90947   ;
   90948 
   90949   return res;
   90950 }
   90951 
   90952 static void
   90953 unget_char ( int c)
   90954 {
   90955   ;
   90956 
   90957   ungetc (c, input);
   90958 }
   90959 
   90960 static int
   90961 read_signed_integer (void)
   90962 {
   90963   int c = get_char ();
   90964   int sign = 1;
   90965   int n = 0;
   90966 
   90967   ;
   90968   if (c == '-')
   90969     {
   90970       c = get_char ();
   90971       sign = -1;
   90972     }
   90973 
   90974   while (isdigit (c))
   90975     {
   90976       n = 10 * n + (c - '0');
   90977       c = get_char ();
   90978     }
   90979 
   90980   unget_char ( c);
   90981 
   90982   return sign * n;
   90983 }
   90984 
   90985 
   90986 /*---------------------------------------------------------------.
   90987 | Lexical analyzer returns an integer on the stack and the token |
   90988 | NUM, or the ASCII character read if not a number.  Skips all   |
   90989 | blanks and tabs, returns 0 for EOF.                            |
   90990 `---------------------------------------------------------------*/
   90991 
   90992 int yylex (void)
   90993 {
   90994   int c;
   90995   /* Skip current token, then white spaces.  */
   90996   do
   90997     {
   90998 
   90999     }
   91000   while ((c = get_char ()) == ' ' || c == '\t');
   91001 
   91002   /* process numbers   */
   91003   if (c == '.' || isdigit (c))
   91004     {
   91005       unget_char ( c);
   91006       (yylval).ival = read_signed_integer ();
   91007       return NUM;
   91008     }
   91009 
   91010   /* Return end-of-file.  */
   91011   if (c == EOF)
   91012     return CALC_EOF;
   91013 
   91014   /* Return single chars. */
   91015   return c;
   91016 }
   91017 
   91018 #include <assert.h>
   91019 #if HAVE_UNISTD_H
   91020 # include <unistd.h>
   91021 #else
   91022 # undef alarm
   91023 # define alarm(seconds) /* empty */
   91024 #endif
   91025 
   91026 
   91027 
   91028 semantic_value global_result = 0;
   91029 int global_count = 0;
   91030 
   91031 /* A C main function.  */
   91032 int
   91033 main (int argc, const char **argv)
   91034 {
   91035   semantic_value result = 0;
   91036   int count = 0;
   91037   int status;
   91038 
   91039   /* This used to be alarm (10), but that isn't enough time for
   91040      a July 1995 vintage DEC Alphastation 200 4/100 system,
   91041      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   91042   alarm (100);
   91043 
   91044   if (argc == 2)
   91045     input = fopen (argv[1], "r");
   91046   else
   91047     input = stdin;
   91048 
   91049   if (!input)
   91050     {
   91051       perror (argv[1]);
   91052       return 3;
   91053     }
   91054 
   91055 
   91056   status = yyparse ();
   91057   if (fclose (input))
   91058     perror ("fclose");
   91059   assert (global_result == result);
   91060   assert (global_count == count);
   91061   return status;
   91062 }
   91063 _ATEOF
   91064 
   91065 
   91066 
   91067 
   91068 
   91069 
   91070 
   91071 
   91072 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   91073   at_save_special_files
   91074   mkdir xml-tests
   91075     # Don't combine these Bison invocations since we want to be sure that
   91076   # --report=all isn't required to get the full XML file.
   91077   { set +x
   91078 $as_echo "$at_srcdir/calc.at:646: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   91079                   --graph=xml-tests/test.dot -o calc.c calc.y"
   91080 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:646"
   91081 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   91082                   --graph=xml-tests/test.dot -o calc.c calc.y
   91083 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91084 at_status=$? at_failed=false
   91085 $at_check_filter
   91086 echo stderr:; cat "$at_stderr"
   91087 echo stdout:; cat "$at_stdout"
   91088 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91089 $at_failed && at_fn_log_failure
   91090 $at_traceon; }
   91091 
   91092   { set +x
   91093 $as_echo "$at_srcdir/calc.at:646: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   91094 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:646"
   91095 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   91096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91097 at_status=$? at_failed=false
   91098 $at_check_filter
   91099 echo stderr:; cat "$at_stderr"
   91100 echo stdout:; cat "$at_stdout"
   91101 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91102 $at_failed && at_fn_log_failure
   91103 $at_traceon; }
   91104 
   91105     cp xml-tests/test.output expout
   91106   { set +x
   91107 $as_echo "$at_srcdir/calc.at:646: \$XSLTPROC \\
   91108              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   91109              xml-tests/test.xml"
   91110 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:646"
   91111 ( $at_check_trace; $XSLTPROC \
   91112              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   91113              xml-tests/test.xml
   91114 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91115 at_status=$? at_failed=false
   91116 $at_check_filter
   91117 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91118 $at_diff expout "$at_stdout" || at_failed=:
   91119 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91120 $at_failed && at_fn_log_failure
   91121 $at_traceon; }
   91122 
   91123   sort xml-tests/test.dot > expout
   91124   { set +x
   91125 $as_echo "$at_srcdir/calc.at:646: \$XSLTPROC \\
   91126              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   91127              xml-tests/test.xml | sort"
   91128 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:646"
   91129 ( $at_check_trace; $XSLTPROC \
   91130              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   91131              xml-tests/test.xml | sort
   91132 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91133 at_status=$? at_failed=false
   91134 $at_check_filter
   91135 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91136 $at_diff expout "$at_stdout" || at_failed=:
   91137 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91138 $at_failed && at_fn_log_failure
   91139 $at_traceon; }
   91140 
   91141   rm -rf xml-tests expout
   91142   at_restore_special_files
   91143 fi
   91144 { set +x
   91145 $as_echo "$at_srcdir/calc.at:646: bison -o calc.c calc.y"
   91146 at_fn_check_prepare_trace "calc.at:646"
   91147 ( $at_check_trace; bison -o calc.c calc.y
   91148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91149 at_status=$? at_failed=false
   91150 $at_check_filter
   91151 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91152 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91153 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91154 $at_failed && at_fn_log_failure
   91155 $at_traceon; }
   91156 
   91157 
   91158    { set +x
   91159 $as_echo "$at_srcdir/calc.at:646: \$BISON_C_WORKS"
   91160 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:646"
   91161 ( $at_check_trace; $BISON_C_WORKS
   91162 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91163 at_status=$? at_failed=false
   91164 $at_check_filter
   91165 echo stderr:; cat "$at_stderr"
   91166 echo stdout:; cat "$at_stdout"
   91167 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91168 $at_failed && at_fn_log_failure
   91169 $at_traceon; }
   91170 
   91171 { set +x
   91172 $as_echo "$at_srcdir/calc.at:646: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   91173 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:646"
   91174 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   91175 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91176 at_status=$? at_failed=false
   91177 $at_check_filter
   91178 echo stderr:; cat "$at_stderr"
   91179 echo stdout:; cat "$at_stdout"
   91180 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91181 $at_failed && at_fn_log_failure
   91182 $at_traceon; }
   91183 
   91184 
   91185 { set +x
   91186 $as_echo "$at_srcdir/calc.at:646: \$PERL -ne '
   91187   chomp;
   91188   print \"\$.: {\$_}\\n\"
   91189     if (# No starting/ending empty lines.
   91190         (eof || \$. == 1) && /^\\s*\$/
   91191         # No trailing space.  FIXME: not ready for \"maint\".
   91192         # || /\\s\$/
   91193         )' calc.c
   91194 "
   91195 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:646"
   91196 ( $at_check_trace; $PERL -ne '
   91197   chomp;
   91198   print "$.: {$_}\n"
   91199     if (# No starting/ending empty lines.
   91200         (eof || $. == 1) && /^\s*$/
   91201         # No trailing space.  FIXME: not ready for "maint".
   91202         # || /\s$/
   91203         )' calc.c
   91204 
   91205 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91206 at_status=$? at_failed=false
   91207 $at_check_filter
   91208 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91209 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91210 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91211 $at_failed && at_fn_log_failure
   91212 $at_traceon; }
   91213 
   91214 
   91215 
   91216 # Test the priorities.
   91217 cat >input <<'_ATEOF'
   91218 1 + 2 * 3 = 7
   91219 1 + 2 * -3 = -5
   91220 
   91221 -1^2 = -1
   91222 (-1)^2 = 1
   91223 
   91224 ---1 = -1
   91225 
   91226 1 - 2 - 3 = -4
   91227 1 - (2 - 3) = 2
   91228 
   91229 2^2^3 = 256
   91230 (2^2)^3 = 64
   91231 _ATEOF
   91232 
   91233 { set +x
   91234 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91235 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91236 ( $at_check_trace;  $PREPARSER ./calc input
   91237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91238 at_status=$? at_failed=false
   91239 $at_check_filter
   91240 echo stderr:; tee stderr <"$at_stderr"
   91241 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91242 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91243 $at_failed && at_fn_log_failure
   91244 $at_traceon; }
   91245 
   91246 { set +x
   91247 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91248 at_fn_check_prepare_trace "calc.at:646"
   91249 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91250 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91251 at_status=$? at_failed=false
   91252 $at_check_filter
   91253 echo stderr:; tee stderr <"$at_stderr"
   91254 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91255 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91256 $at_failed && at_fn_log_failure
   91257 $at_traceon; }
   91258 
   91259 
   91260 
   91261 
   91262 # Some syntax errors.
   91263 cat >input <<'_ATEOF'
   91264 1 2
   91265 _ATEOF
   91266 
   91267 { set +x
   91268 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91269 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91270 ( $at_check_trace;  $PREPARSER ./calc input
   91271 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91272 at_status=$? at_failed=false
   91273 $at_check_filter
   91274 echo stderr:; tee stderr <"$at_stderr"
   91275 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91276 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646"
   91277 $at_failed && at_fn_log_failure
   91278 $at_traceon; }
   91279 
   91280 { set +x
   91281 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91282 at_fn_check_prepare_trace "calc.at:646"
   91283 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91285 at_status=$? at_failed=false
   91286 $at_check_filter
   91287 echo stderr:; tee stderr <"$at_stderr"
   91288 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91289 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91290 $at_failed && at_fn_log_failure
   91291 $at_traceon; }
   91292 
   91293 
   91294 
   91295 # Normalize the observed and expected error messages, depending upon the
   91296 # options.
   91297 # 1. Remove the traces from observed.
   91298 sed '/^Starting/d
   91299 /^Entering/d
   91300 /^Stack/d
   91301 /^Reading/d
   91302 /^Reducing/d
   91303 /^Return/d
   91304 /^Shifting/d
   91305 /^state/d
   91306 /^Cleanup:/d
   91307 /^Error:/d
   91308 /^Next/d
   91309 /^Now/d
   91310 /^Discarding/d
   91311 / \$[0-9$]* = /d
   91312 /^yydestructor:/d' stderr >at-stderr
   91313 mv at-stderr stderr
   91314 # 2. Create the reference error message.
   91315 cat >expout <<'_ATEOF'
   91316 1.3: syntax error, unexpected number
   91317 _ATEOF
   91318 
   91319 # 3. If locations are not used, remove them.
   91320 sed 's/^[-0-9.]*: //' expout >at-expout
   91321 mv at-expout expout
   91322 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91323 
   91324 # 5. Check
   91325 { set +x
   91326 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91327 at_fn_check_prepare_trace "calc.at:646"
   91328 ( $at_check_trace; cat stderr
   91329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91330 at_status=$? at_failed=false
   91331 $at_check_filter
   91332 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91333 $at_diff expout "$at_stdout" || at_failed=:
   91334 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91335 $at_failed && at_fn_log_failure
   91336 $at_traceon; }
   91337 
   91338 
   91339 cat >input <<'_ATEOF'
   91340 1//2
   91341 _ATEOF
   91342 
   91343 { set +x
   91344 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91345 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91346 ( $at_check_trace;  $PREPARSER ./calc input
   91347 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91348 at_status=$? at_failed=false
   91349 $at_check_filter
   91350 echo stderr:; tee stderr <"$at_stderr"
   91351 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91352 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646"
   91353 $at_failed && at_fn_log_failure
   91354 $at_traceon; }
   91355 
   91356 { set +x
   91357 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91358 at_fn_check_prepare_trace "calc.at:646"
   91359 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91361 at_status=$? at_failed=false
   91362 $at_check_filter
   91363 echo stderr:; tee stderr <"$at_stderr"
   91364 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91365 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91366 $at_failed && at_fn_log_failure
   91367 $at_traceon; }
   91368 
   91369 
   91370 
   91371 # Normalize the observed and expected error messages, depending upon the
   91372 # options.
   91373 # 1. Remove the traces from observed.
   91374 sed '/^Starting/d
   91375 /^Entering/d
   91376 /^Stack/d
   91377 /^Reading/d
   91378 /^Reducing/d
   91379 /^Return/d
   91380 /^Shifting/d
   91381 /^state/d
   91382 /^Cleanup:/d
   91383 /^Error:/d
   91384 /^Next/d
   91385 /^Now/d
   91386 /^Discarding/d
   91387 / \$[0-9$]* = /d
   91388 /^yydestructor:/d' stderr >at-stderr
   91389 mv at-stderr stderr
   91390 # 2. Create the reference error message.
   91391 cat >expout <<'_ATEOF'
   91392 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   91393 _ATEOF
   91394 
   91395 # 3. If locations are not used, remove them.
   91396 sed 's/^[-0-9.]*: //' expout >at-expout
   91397 mv at-expout expout
   91398 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91399 
   91400 # 5. Check
   91401 { set +x
   91402 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91403 at_fn_check_prepare_trace "calc.at:646"
   91404 ( $at_check_trace; cat stderr
   91405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91406 at_status=$? at_failed=false
   91407 $at_check_filter
   91408 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91409 $at_diff expout "$at_stdout" || at_failed=:
   91410 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91411 $at_failed && at_fn_log_failure
   91412 $at_traceon; }
   91413 
   91414 
   91415 cat >input <<'_ATEOF'
   91416 error
   91417 _ATEOF
   91418 
   91419 { set +x
   91420 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91421 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91422 ( $at_check_trace;  $PREPARSER ./calc input
   91423 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91424 at_status=$? at_failed=false
   91425 $at_check_filter
   91426 echo stderr:; tee stderr <"$at_stderr"
   91427 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91428 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646"
   91429 $at_failed && at_fn_log_failure
   91430 $at_traceon; }
   91431 
   91432 { set +x
   91433 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91434 at_fn_check_prepare_trace "calc.at:646"
   91435 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91436 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91437 at_status=$? at_failed=false
   91438 $at_check_filter
   91439 echo stderr:; tee stderr <"$at_stderr"
   91440 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91441 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91442 $at_failed && at_fn_log_failure
   91443 $at_traceon; }
   91444 
   91445 
   91446 
   91447 # Normalize the observed and expected error messages, depending upon the
   91448 # options.
   91449 # 1. Remove the traces from observed.
   91450 sed '/^Starting/d
   91451 /^Entering/d
   91452 /^Stack/d
   91453 /^Reading/d
   91454 /^Reducing/d
   91455 /^Return/d
   91456 /^Shifting/d
   91457 /^state/d
   91458 /^Cleanup:/d
   91459 /^Error:/d
   91460 /^Next/d
   91461 /^Now/d
   91462 /^Discarding/d
   91463 / \$[0-9$]* = /d
   91464 /^yydestructor:/d' stderr >at-stderr
   91465 mv at-stderr stderr
   91466 # 2. Create the reference error message.
   91467 cat >expout <<'_ATEOF'
   91468 1.1: syntax error, unexpected $undefined
   91469 _ATEOF
   91470 
   91471 # 3. If locations are not used, remove them.
   91472 sed 's/^[-0-9.]*: //' expout >at-expout
   91473 mv at-expout expout
   91474 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91475 
   91476 # 5. Check
   91477 { set +x
   91478 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91479 at_fn_check_prepare_trace "calc.at:646"
   91480 ( $at_check_trace; cat stderr
   91481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91482 at_status=$? at_failed=false
   91483 $at_check_filter
   91484 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91485 $at_diff expout "$at_stdout" || at_failed=:
   91486 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91487 $at_failed && at_fn_log_failure
   91488 $at_traceon; }
   91489 
   91490 
   91491 cat >input <<'_ATEOF'
   91492 1 = 2 = 3
   91493 _ATEOF
   91494 
   91495 { set +x
   91496 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91497 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91498 ( $at_check_trace;  $PREPARSER ./calc input
   91499 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91500 at_status=$? at_failed=false
   91501 $at_check_filter
   91502 echo stderr:; tee stderr <"$at_stderr"
   91503 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91504 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646"
   91505 $at_failed && at_fn_log_failure
   91506 $at_traceon; }
   91507 
   91508 { set +x
   91509 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91510 at_fn_check_prepare_trace "calc.at:646"
   91511 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91513 at_status=$? at_failed=false
   91514 $at_check_filter
   91515 echo stderr:; tee stderr <"$at_stderr"
   91516 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91517 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91518 $at_failed && at_fn_log_failure
   91519 $at_traceon; }
   91520 
   91521 
   91522 
   91523 # Normalize the observed and expected error messages, depending upon the
   91524 # options.
   91525 # 1. Remove the traces from observed.
   91526 sed '/^Starting/d
   91527 /^Entering/d
   91528 /^Stack/d
   91529 /^Reading/d
   91530 /^Reducing/d
   91531 /^Return/d
   91532 /^Shifting/d
   91533 /^state/d
   91534 /^Cleanup:/d
   91535 /^Error:/d
   91536 /^Next/d
   91537 /^Now/d
   91538 /^Discarding/d
   91539 / \$[0-9$]* = /d
   91540 /^yydestructor:/d' stderr >at-stderr
   91541 mv at-stderr stderr
   91542 # 2. Create the reference error message.
   91543 cat >expout <<'_ATEOF'
   91544 1.7: syntax error, unexpected '='
   91545 _ATEOF
   91546 
   91547 # 3. If locations are not used, remove them.
   91548 sed 's/^[-0-9.]*: //' expout >at-expout
   91549 mv at-expout expout
   91550 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91551 
   91552 # 5. Check
   91553 { set +x
   91554 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91555 at_fn_check_prepare_trace "calc.at:646"
   91556 ( $at_check_trace; cat stderr
   91557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91558 at_status=$? at_failed=false
   91559 $at_check_filter
   91560 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91561 $at_diff expout "$at_stdout" || at_failed=:
   91562 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91563 $at_failed && at_fn_log_failure
   91564 $at_traceon; }
   91565 
   91566 
   91567 cat >input <<'_ATEOF'
   91568 
   91569 +1
   91570 _ATEOF
   91571 
   91572 { set +x
   91573 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91574 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91575 ( $at_check_trace;  $PREPARSER ./calc input
   91576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91577 at_status=$? at_failed=false
   91578 $at_check_filter
   91579 echo stderr:; tee stderr <"$at_stderr"
   91580 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91581 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646"
   91582 $at_failed && at_fn_log_failure
   91583 $at_traceon; }
   91584 
   91585 { set +x
   91586 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91587 at_fn_check_prepare_trace "calc.at:646"
   91588 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91590 at_status=$? at_failed=false
   91591 $at_check_filter
   91592 echo stderr:; tee stderr <"$at_stderr"
   91593 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91594 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91595 $at_failed && at_fn_log_failure
   91596 $at_traceon; }
   91597 
   91598 
   91599 
   91600 # Normalize the observed and expected error messages, depending upon the
   91601 # options.
   91602 # 1. Remove the traces from observed.
   91603 sed '/^Starting/d
   91604 /^Entering/d
   91605 /^Stack/d
   91606 /^Reading/d
   91607 /^Reducing/d
   91608 /^Return/d
   91609 /^Shifting/d
   91610 /^state/d
   91611 /^Cleanup:/d
   91612 /^Error:/d
   91613 /^Next/d
   91614 /^Now/d
   91615 /^Discarding/d
   91616 / \$[0-9$]* = /d
   91617 /^yydestructor:/d' stderr >at-stderr
   91618 mv at-stderr stderr
   91619 # 2. Create the reference error message.
   91620 cat >expout <<'_ATEOF'
   91621 2.1: syntax error, unexpected '+'
   91622 _ATEOF
   91623 
   91624 # 3. If locations are not used, remove them.
   91625 sed 's/^[-0-9.]*: //' expout >at-expout
   91626 mv at-expout expout
   91627 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91628 
   91629 # 5. Check
   91630 { set +x
   91631 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91632 at_fn_check_prepare_trace "calc.at:646"
   91633 ( $at_check_trace; cat stderr
   91634 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91635 at_status=$? at_failed=false
   91636 $at_check_filter
   91637 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91638 $at_diff expout "$at_stdout" || at_failed=:
   91639 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91640 $at_failed && at_fn_log_failure
   91641 $at_traceon; }
   91642 
   91643 
   91644 # Exercise error messages with EOF: work on an empty file.
   91645 { set +x
   91646 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc /dev/null"
   91647 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:646"
   91648 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   91649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91650 at_status=$? at_failed=false
   91651 $at_check_filter
   91652 echo stderr:; tee stderr <"$at_stderr"
   91653 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91654 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646"
   91655 $at_failed && at_fn_log_failure
   91656 $at_traceon; }
   91657 
   91658 { set +x
   91659 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91660 at_fn_check_prepare_trace "calc.at:646"
   91661 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91662 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91663 at_status=$? at_failed=false
   91664 $at_check_filter
   91665 echo stderr:; tee stderr <"$at_stderr"
   91666 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91667 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91668 $at_failed && at_fn_log_failure
   91669 $at_traceon; }
   91670 
   91671 
   91672 
   91673 # Normalize the observed and expected error messages, depending upon the
   91674 # options.
   91675 # 1. Remove the traces from observed.
   91676 sed '/^Starting/d
   91677 /^Entering/d
   91678 /^Stack/d
   91679 /^Reading/d
   91680 /^Reducing/d
   91681 /^Return/d
   91682 /^Shifting/d
   91683 /^state/d
   91684 /^Cleanup:/d
   91685 /^Error:/d
   91686 /^Next/d
   91687 /^Now/d
   91688 /^Discarding/d
   91689 / \$[0-9$]* = /d
   91690 /^yydestructor:/d' stderr >at-stderr
   91691 mv at-stderr stderr
   91692 # 2. Create the reference error message.
   91693 cat >expout <<'_ATEOF'
   91694 1.1: syntax error, unexpected end of input
   91695 _ATEOF
   91696 
   91697 # 3. If locations are not used, remove them.
   91698 sed 's/^[-0-9.]*: //' expout >at-expout
   91699 mv at-expout expout
   91700 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91701 
   91702 # 5. Check
   91703 { set +x
   91704 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91705 at_fn_check_prepare_trace "calc.at:646"
   91706 ( $at_check_trace; cat stderr
   91707 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91708 at_status=$? at_failed=false
   91709 $at_check_filter
   91710 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91711 $at_diff expout "$at_stdout" || at_failed=:
   91712 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91713 $at_failed && at_fn_log_failure
   91714 $at_traceon; }
   91715 
   91716 
   91717 
   91718 # Exercise the error token: without it, we die at the first error,
   91719 # hence be sure to
   91720 #
   91721 # - have several errors which exercise different shift/discardings
   91722 #   - (): nothing to pop, nothing to discard
   91723 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   91724 #   - (* * *): nothing to pop, a lot to discard
   91725 #   - (1 + 2 * *): some to pop and discard
   91726 #
   91727 # - test the action associated to `error'
   91728 #
   91729 # - check the lookahead that triggers an error is not discarded
   91730 #   when we enter error recovery.  Below, the lookahead causing the
   91731 #   first error is ")", which is needed to recover from the error and
   91732 #   produce the "0" that triggers the "0 != 1" error.
   91733 #
   91734 cat >input <<'_ATEOF'
   91735 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   91736 _ATEOF
   91737 
   91738 { set +x
   91739 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91740 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91741 ( $at_check_trace;  $PREPARSER ./calc input
   91742 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91743 at_status=$? at_failed=false
   91744 $at_check_filter
   91745 echo stderr:; tee stderr <"$at_stderr"
   91746 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91747 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91748 $at_failed && at_fn_log_failure
   91749 $at_traceon; }
   91750 
   91751 { set +x
   91752 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91753 at_fn_check_prepare_trace "calc.at:646"
   91754 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91756 at_status=$? at_failed=false
   91757 $at_check_filter
   91758 echo stderr:; tee stderr <"$at_stderr"
   91759 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91760 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91761 $at_failed && at_fn_log_failure
   91762 $at_traceon; }
   91763 
   91764 
   91765 
   91766 # Normalize the observed and expected error messages, depending upon the
   91767 # options.
   91768 # 1. Remove the traces from observed.
   91769 sed '/^Starting/d
   91770 /^Entering/d
   91771 /^Stack/d
   91772 /^Reading/d
   91773 /^Reducing/d
   91774 /^Return/d
   91775 /^Shifting/d
   91776 /^state/d
   91777 /^Cleanup:/d
   91778 /^Error:/d
   91779 /^Next/d
   91780 /^Now/d
   91781 /^Discarding/d
   91782 / \$[0-9$]* = /d
   91783 /^yydestructor:/d' stderr >at-stderr
   91784 mv at-stderr stderr
   91785 # 2. Create the reference error message.
   91786 cat >expout <<'_ATEOF'
   91787 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   91788 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   91789 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   91790 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   91791 calc: error: 4444 != 1
   91792 _ATEOF
   91793 
   91794 # 3. If locations are not used, remove them.
   91795 sed 's/^[-0-9.]*: //' expout >at-expout
   91796 mv at-expout expout
   91797 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91798 
   91799 # 5. Check
   91800 { set +x
   91801 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91802 at_fn_check_prepare_trace "calc.at:646"
   91803 ( $at_check_trace; cat stderr
   91804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91805 at_status=$? at_failed=false
   91806 $at_check_filter
   91807 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91808 $at_diff expout "$at_stdout" || at_failed=:
   91809 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91810 $at_failed && at_fn_log_failure
   91811 $at_traceon; }
   91812 
   91813 
   91814 
   91815 # The same, but this time exercising explicitly triggered syntax errors.
   91816 # POSIX says the lookahead causing the error should not be discarded.
   91817 cat >input <<'_ATEOF'
   91818 (!) + (1 2) = 1
   91819 _ATEOF
   91820 
   91821 { set +x
   91822 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91823 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91824 ( $at_check_trace;  $PREPARSER ./calc input
   91825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91826 at_status=$? at_failed=false
   91827 $at_check_filter
   91828 echo stderr:; tee stderr <"$at_stderr"
   91829 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91830 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91831 $at_failed && at_fn_log_failure
   91832 $at_traceon; }
   91833 
   91834 { set +x
   91835 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91836 at_fn_check_prepare_trace "calc.at:646"
   91837 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91839 at_status=$? at_failed=false
   91840 $at_check_filter
   91841 echo stderr:; tee stderr <"$at_stderr"
   91842 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91843 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91844 $at_failed && at_fn_log_failure
   91845 $at_traceon; }
   91846 
   91847 
   91848 
   91849 # Normalize the observed and expected error messages, depending upon the
   91850 # options.
   91851 # 1. Remove the traces from observed.
   91852 sed '/^Starting/d
   91853 /^Entering/d
   91854 /^Stack/d
   91855 /^Reading/d
   91856 /^Reducing/d
   91857 /^Return/d
   91858 /^Shifting/d
   91859 /^state/d
   91860 /^Cleanup:/d
   91861 /^Error:/d
   91862 /^Next/d
   91863 /^Now/d
   91864 /^Discarding/d
   91865 / \$[0-9$]* = /d
   91866 /^yydestructor:/d' stderr >at-stderr
   91867 mv at-stderr stderr
   91868 # 2. Create the reference error message.
   91869 cat >expout <<'_ATEOF'
   91870 1.10: syntax error, unexpected number
   91871 calc: error: 2222 != 1
   91872 _ATEOF
   91873 
   91874 # 3. If locations are not used, remove them.
   91875 sed 's/^[-0-9.]*: //' expout >at-expout
   91876 mv at-expout expout
   91877 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91878 
   91879 # 5. Check
   91880 { set +x
   91881 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91882 at_fn_check_prepare_trace "calc.at:646"
   91883 ( $at_check_trace; cat stderr
   91884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91885 at_status=$? at_failed=false
   91886 $at_check_filter
   91887 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91888 $at_diff expout "$at_stdout" || at_failed=:
   91889 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91890 $at_failed && at_fn_log_failure
   91891 $at_traceon; }
   91892 
   91893 
   91894 cat >input <<'_ATEOF'
   91895 (- *) + (1 2) = 1
   91896 _ATEOF
   91897 
   91898 { set +x
   91899 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91900 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91901 ( $at_check_trace;  $PREPARSER ./calc input
   91902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91903 at_status=$? at_failed=false
   91904 $at_check_filter
   91905 echo stderr:; tee stderr <"$at_stderr"
   91906 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91907 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91908 $at_failed && at_fn_log_failure
   91909 $at_traceon; }
   91910 
   91911 { set +x
   91912 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91913 at_fn_check_prepare_trace "calc.at:646"
   91914 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91916 at_status=$? at_failed=false
   91917 $at_check_filter
   91918 echo stderr:; tee stderr <"$at_stderr"
   91919 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91920 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91921 $at_failed && at_fn_log_failure
   91922 $at_traceon; }
   91923 
   91924 
   91925 
   91926 # Normalize the observed and expected error messages, depending upon the
   91927 # options.
   91928 # 1. Remove the traces from observed.
   91929 sed '/^Starting/d
   91930 /^Entering/d
   91931 /^Stack/d
   91932 /^Reading/d
   91933 /^Reducing/d
   91934 /^Return/d
   91935 /^Shifting/d
   91936 /^state/d
   91937 /^Cleanup:/d
   91938 /^Error:/d
   91939 /^Next/d
   91940 /^Now/d
   91941 /^Discarding/d
   91942 / \$[0-9$]* = /d
   91943 /^yydestructor:/d' stderr >at-stderr
   91944 mv at-stderr stderr
   91945 # 2. Create the reference error message.
   91946 cat >expout <<'_ATEOF'
   91947 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   91948 1.12: syntax error, unexpected number
   91949 calc: error: 2222 != 1
   91950 _ATEOF
   91951 
   91952 # 3. If locations are not used, remove them.
   91953 sed 's/^[-0-9.]*: //' expout >at-expout
   91954 mv at-expout expout
   91955 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   91956 
   91957 # 5. Check
   91958 { set +x
   91959 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   91960 at_fn_check_prepare_trace "calc.at:646"
   91961 ( $at_check_trace; cat stderr
   91962 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91963 at_status=$? at_failed=false
   91964 $at_check_filter
   91965 at_fn_diff_devnull "$at_stderr" || at_failed=:
   91966 $at_diff expout "$at_stdout" || at_failed=:
   91967 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91968 $at_failed && at_fn_log_failure
   91969 $at_traceon; }
   91970 
   91971 
   91972 
   91973 # Check that yyerrok works properly: second error is not reported,
   91974 # third and fourth are.  Parse status is succesfull.
   91975 cat >input <<'_ATEOF'
   91976 (* *) + (*) + (*)
   91977 _ATEOF
   91978 
   91979 { set +x
   91980 $as_echo "$at_srcdir/calc.at:646:  \$PREPARSER ./calc input"
   91981 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646"
   91982 ( $at_check_trace;  $PREPARSER ./calc input
   91983 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91984 at_status=$? at_failed=false
   91985 $at_check_filter
   91986 echo stderr:; tee stderr <"$at_stderr"
   91987 at_fn_diff_devnull "$at_stdout" || at_failed=:
   91988 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   91989 $at_failed && at_fn_log_failure
   91990 $at_traceon; }
   91991 
   91992 { set +x
   91993 $as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   91994 at_fn_check_prepare_trace "calc.at:646"
   91995 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   91996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   91997 at_status=$? at_failed=false
   91998 $at_check_filter
   91999 echo stderr:; tee stderr <"$at_stderr"
   92000 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92001 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   92002 $at_failed && at_fn_log_failure
   92003 $at_traceon; }
   92004 
   92005 
   92006 
   92007 # Normalize the observed and expected error messages, depending upon the
   92008 # options.
   92009 # 1. Remove the traces from observed.
   92010 sed '/^Starting/d
   92011 /^Entering/d
   92012 /^Stack/d
   92013 /^Reading/d
   92014 /^Reducing/d
   92015 /^Return/d
   92016 /^Shifting/d
   92017 /^state/d
   92018 /^Cleanup:/d
   92019 /^Error:/d
   92020 /^Next/d
   92021 /^Now/d
   92022 /^Discarding/d
   92023 / \$[0-9$]* = /d
   92024 /^yydestructor:/d' stderr >at-stderr
   92025 mv at-stderr stderr
   92026 # 2. Create the reference error message.
   92027 cat >expout <<'_ATEOF'
   92028 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   92029 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   92030 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   92031 _ATEOF
   92032 
   92033 # 3. If locations are not used, remove them.
   92034 sed 's/^[-0-9.]*: //' expout >at-expout
   92035 mv at-expout expout
   92036 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92037 
   92038 # 5. Check
   92039 { set +x
   92040 $as_echo "$at_srcdir/calc.at:646: cat stderr"
   92041 at_fn_check_prepare_trace "calc.at:646"
   92042 ( $at_check_trace; cat stderr
   92043 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92044 at_status=$? at_failed=false
   92045 $at_check_filter
   92046 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92047 $at_diff expout "$at_stdout" || at_failed=:
   92048 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646"
   92049 $at_failed && at_fn_log_failure
   92050 $at_traceon; }
   92051 
   92052 
   92053 
   92054 
   92055 
   92056   set +x
   92057   $at_times_p && times >"$at_times_file"
   92058 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   92059 read at_status <"$at_status_file"
   92060 #AT_STOP_225
   92061 #AT_START_226
   92062 at_fn_group_banner 226 'calc.at:648' \
   92063   "Calculator %glr-parser %define api.pure %locations" "" 12
   92064 at_xfail=no
   92065 (
   92066   $as_echo "226. $at_setup_line: testing $at_desc ..."
   92067   $at_traceon
   92068 
   92069 
   92070 
   92071 
   92072 
   92073 
   92074 
   92075 
   92076 
   92077 
   92078 cat >calc.y <<'_ATEOF'
   92079 %code top {
   92080 #include <config.h>
   92081 /* We don't need perfect functions for these tests. */
   92082 #undef malloc
   92083 #undef memcmp
   92084 #undef realloc
   92085 }
   92086 
   92087 /* Infix notation calculator--calc */
   92088 %glr-parser %define api.pure %locations
   92089 
   92090 %code requires
   92091 {
   92092 
   92093   /* Exercise pre-prologue dependency to %union.  */
   92094   typedef int semantic_value;
   92095 }
   92096 
   92097 /* Exercise %union. */
   92098 %union
   92099 {
   92100   semantic_value ival;
   92101 };
   92102 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   92103 
   92104 %code provides
   92105 {
   92106   #include <stdio.h>
   92107   /* The input.  */
   92108   extern FILE *input;
   92109   extern semantic_value global_result;
   92110   extern int global_count;
   92111 }
   92112 
   92113 %code
   92114 {
   92115 #include <assert.h>
   92116 #include <string.h>
   92117 #define USE(Var)
   92118 
   92119 FILE *input;
   92120 static int power (int base, int exponent);
   92121 
   92122 static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   92123 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   92124 }
   92125 
   92126 
   92127 
   92128 /* Bison Declarations */
   92129 %token CALC_EOF 0 "end of input"
   92130 %token <ival> NUM "number"
   92131 %type  <ival> exp
   92132 
   92133 %nonassoc '=' /* comparison            */
   92134 %left '-' '+'
   92135 %left '*' '/'
   92136 %left NEG     /* negation--unary minus */
   92137 %right '^'    /* exponentiation        */
   92138 
   92139 /* Grammar follows */
   92140 %%
   92141 input:
   92142   line
   92143 | input line         {  }
   92144 ;
   92145 
   92146 line:
   92147   '\n'
   92148 | exp '\n'           { USE ($1); }
   92149 ;
   92150 
   92151 exp:
   92152   NUM                { $$ = $1;             }
   92153 | exp '=' exp
   92154   {
   92155     if ($1 != $3)
   92156       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   92157     $$ = $1;
   92158   }
   92159 | exp '+' exp        { $$ = $1 + $3;        }
   92160 | exp '-' exp        { $$ = $1 - $3;        }
   92161 | exp '*' exp        { $$ = $1 * $3;        }
   92162 | exp '/' exp        { $$ = $1 / $3;        }
   92163 | '-' exp  %prec NEG { $$ = -$2;            }
   92164 | exp '^' exp        { $$ = power ($1, $3); }
   92165 | '(' exp ')'        { $$ = $2;             }
   92166 | '(' error ')'      { $$ = 1111; yyerrok;  }
   92167 | '!'                { $$ = 0; YYERROR;     }
   92168 | '-' error          { $$ = 0; YYERROR;     }
   92169 ;
   92170 %%
   92171 
   92172 static int
   92173 power (int base, int exponent)
   92174 {
   92175   int res = 1;
   92176   assert (0 <= exponent);
   92177   for (/* Niente */; exponent; --exponent)
   92178     res *= base;
   92179   return res;
   92180 }
   92181 
   92182 
   92183 #include <stdio.h>
   92184 /* A C error reporting function.  */
   92185 static
   92186 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   92187 {
   92188   YY_LOCATION_PRINT (stderr, (*llocp));
   92189   fprintf (stderr, ": ");
   92190   fprintf (stderr, "%s\n", msg);
   92191 }
   92192 #include <ctype.h>
   92193 
   92194 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   92195 static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
   92196 static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
   92197 
   92198 
   92199 static YYLTYPE last_yylloc;
   92200 
   92201 static int
   92202 get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
   92203 {
   92204   int res = getc (input);
   92205   (void) lvalp;(void) llocp;
   92206 
   92207   last_yylloc = (*llocp);
   92208   if (res == '\n')
   92209     {
   92210       (*llocp).last_line++;
   92211       (*llocp).last_column = 1;
   92212     }
   92213   else
   92214     (*llocp).last_column++;
   92215 
   92216   return res;
   92217 }
   92218 
   92219 static void
   92220 unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
   92221 {
   92222   (void) lvalp;(void) llocp;
   92223 
   92224   /* Wrong when C == `\n'. */
   92225   (*llocp) = last_yylloc;
   92226 
   92227   ungetc (c, input);
   92228 }
   92229 
   92230 static int
   92231 read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
   92232 {
   92233   int c = get_char (lvalp, llocp);
   92234   int sign = 1;
   92235   int n = 0;
   92236 
   92237   (void) lvalp;(void) llocp;
   92238   if (c == '-')
   92239     {
   92240       c = get_char (lvalp, llocp);
   92241       sign = -1;
   92242     }
   92243 
   92244   while (isdigit (c))
   92245     {
   92246       n = 10 * n + (c - '0');
   92247       c = get_char (lvalp, llocp);
   92248     }
   92249 
   92250   unget_char (lvalp, llocp,  c);
   92251 
   92252   return sign * n;
   92253 }
   92254 
   92255 
   92256 /*---------------------------------------------------------------.
   92257 | Lexical analyzer returns an integer on the stack and the token |
   92258 | NUM, or the ASCII character read if not a number.  Skips all   |
   92259 | blanks and tabs, returns 0 for EOF.                            |
   92260 `---------------------------------------------------------------*/
   92261 
   92262 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   92263 {
   92264   int c;
   92265   /* Skip current token, then white spaces.  */
   92266   do
   92267     {
   92268      (*llocp).first_column = (*llocp).last_column;
   92269       (*llocp).first_line   = (*llocp).last_line;
   92270 
   92271     }
   92272   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   92273 
   92274   /* process numbers   */
   92275   if (c == '.' || isdigit (c))
   92276     {
   92277       unget_char (lvalp, llocp,  c);
   92278       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   92279       return NUM;
   92280     }
   92281 
   92282   /* Return end-of-file.  */
   92283   if (c == EOF)
   92284     return CALC_EOF;
   92285 
   92286   /* Return single chars. */
   92287   return c;
   92288 }
   92289 
   92290 #include <assert.h>
   92291 #if HAVE_UNISTD_H
   92292 # include <unistd.h>
   92293 #else
   92294 # undef alarm
   92295 # define alarm(seconds) /* empty */
   92296 #endif
   92297 
   92298 
   92299 
   92300 semantic_value global_result = 0;
   92301 int global_count = 0;
   92302 
   92303 /* A C main function.  */
   92304 int
   92305 main (int argc, const char **argv)
   92306 {
   92307   semantic_value result = 0;
   92308   int count = 0;
   92309   int status;
   92310 
   92311   /* This used to be alarm (10), but that isn't enough time for
   92312      a July 1995 vintage DEC Alphastation 200 4/100 system,
   92313      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   92314   alarm (100);
   92315 
   92316   if (argc == 2)
   92317     input = fopen (argv[1], "r");
   92318   else
   92319     input = stdin;
   92320 
   92321   if (!input)
   92322     {
   92323       perror (argv[1]);
   92324       return 3;
   92325     }
   92326 
   92327 
   92328   status = yyparse ();
   92329   if (fclose (input))
   92330     perror ("fclose");
   92331   assert (global_result == result);
   92332   assert (global_count == count);
   92333   return status;
   92334 }
   92335 _ATEOF
   92336 
   92337 
   92338 
   92339 
   92340 
   92341 
   92342 
   92343 
   92344 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   92345   at_save_special_files
   92346   mkdir xml-tests
   92347     # Don't combine these Bison invocations since we want to be sure that
   92348   # --report=all isn't required to get the full XML file.
   92349   { set +x
   92350 $as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   92351                   --graph=xml-tests/test.dot -o calc.c calc.y"
   92352 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648"
   92353 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   92354                   --graph=xml-tests/test.dot -o calc.c calc.y
   92355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92356 at_status=$? at_failed=false
   92357 $at_check_filter
   92358 echo stderr:; cat "$at_stderr"
   92359 echo stdout:; cat "$at_stdout"
   92360 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92361 $at_failed && at_fn_log_failure
   92362 $at_traceon; }
   92363 
   92364   { set +x
   92365 $as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   92366 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:648"
   92367 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   92368 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92369 at_status=$? at_failed=false
   92370 $at_check_filter
   92371 echo stderr:; cat "$at_stderr"
   92372 echo stdout:; cat "$at_stdout"
   92373 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92374 $at_failed && at_fn_log_failure
   92375 $at_traceon; }
   92376 
   92377     cp xml-tests/test.output expout
   92378   { set +x
   92379 $as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\
   92380              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   92381              xml-tests/test.xml"
   92382 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648"
   92383 ( $at_check_trace; $XSLTPROC \
   92384              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   92385              xml-tests/test.xml
   92386 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92387 at_status=$? at_failed=false
   92388 $at_check_filter
   92389 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92390 $at_diff expout "$at_stdout" || at_failed=:
   92391 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92392 $at_failed && at_fn_log_failure
   92393 $at_traceon; }
   92394 
   92395   sort xml-tests/test.dot > expout
   92396   { set +x
   92397 $as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\
   92398              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   92399              xml-tests/test.xml | sort"
   92400 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648"
   92401 ( $at_check_trace; $XSLTPROC \
   92402              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   92403              xml-tests/test.xml | sort
   92404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92405 at_status=$? at_failed=false
   92406 $at_check_filter
   92407 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92408 $at_diff expout "$at_stdout" || at_failed=:
   92409 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92410 $at_failed && at_fn_log_failure
   92411 $at_traceon; }
   92412 
   92413   rm -rf xml-tests expout
   92414   at_restore_special_files
   92415 fi
   92416 { set +x
   92417 $as_echo "$at_srcdir/calc.at:648: bison -o calc.c calc.y"
   92418 at_fn_check_prepare_trace "calc.at:648"
   92419 ( $at_check_trace; bison -o calc.c calc.y
   92420 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92421 at_status=$? at_failed=false
   92422 $at_check_filter
   92423 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92424 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92425 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92426 $at_failed && at_fn_log_failure
   92427 $at_traceon; }
   92428 
   92429 
   92430    { set +x
   92431 $as_echo "$at_srcdir/calc.at:648: \$BISON_C_WORKS"
   92432 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:648"
   92433 ( $at_check_trace; $BISON_C_WORKS
   92434 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92435 at_status=$? at_failed=false
   92436 $at_check_filter
   92437 echo stderr:; cat "$at_stderr"
   92438 echo stdout:; cat "$at_stdout"
   92439 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92440 $at_failed && at_fn_log_failure
   92441 $at_traceon; }
   92442 
   92443 { set +x
   92444 $as_echo "$at_srcdir/calc.at:648: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   92445 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:648"
   92446 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   92447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92448 at_status=$? at_failed=false
   92449 $at_check_filter
   92450 echo stderr:; cat "$at_stderr"
   92451 echo stdout:; cat "$at_stdout"
   92452 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92453 $at_failed && at_fn_log_failure
   92454 $at_traceon; }
   92455 
   92456 
   92457 { set +x
   92458 $as_echo "$at_srcdir/calc.at:648: \$PERL -ne '
   92459   chomp;
   92460   print \"\$.: {\$_}\\n\"
   92461     if (# No starting/ending empty lines.
   92462         (eof || \$. == 1) && /^\\s*\$/
   92463         # No trailing space.  FIXME: not ready for \"maint\".
   92464         # || /\\s\$/
   92465         )' calc.c
   92466 "
   92467 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648"
   92468 ( $at_check_trace; $PERL -ne '
   92469   chomp;
   92470   print "$.: {$_}\n"
   92471     if (# No starting/ending empty lines.
   92472         (eof || $. == 1) && /^\s*$/
   92473         # No trailing space.  FIXME: not ready for "maint".
   92474         # || /\s$/
   92475         )' calc.c
   92476 
   92477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92478 at_status=$? at_failed=false
   92479 $at_check_filter
   92480 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92482 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92483 $at_failed && at_fn_log_failure
   92484 $at_traceon; }
   92485 
   92486 
   92487 
   92488 # Test the priorities.
   92489 cat >input <<'_ATEOF'
   92490 1 + 2 * 3 = 7
   92491 1 + 2 * -3 = -5
   92492 
   92493 -1^2 = -1
   92494 (-1)^2 = 1
   92495 
   92496 ---1 = -1
   92497 
   92498 1 - 2 - 3 = -4
   92499 1 - (2 - 3) = 2
   92500 
   92501 2^2^3 = 256
   92502 (2^2)^3 = 64
   92503 _ATEOF
   92504 
   92505 { set +x
   92506 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   92507 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   92508 ( $at_check_trace;  $PREPARSER ./calc input
   92509 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92510 at_status=$? at_failed=false
   92511 $at_check_filter
   92512 echo stderr:; tee stderr <"$at_stderr"
   92513 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92514 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92515 $at_failed && at_fn_log_failure
   92516 $at_traceon; }
   92517 
   92518 { set +x
   92519 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92520 at_fn_check_prepare_trace "calc.at:648"
   92521 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92522 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92523 at_status=$? at_failed=false
   92524 $at_check_filter
   92525 echo stderr:; tee stderr <"$at_stderr"
   92526 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92527 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92528 $at_failed && at_fn_log_failure
   92529 $at_traceon; }
   92530 
   92531 
   92532 
   92533 
   92534 # Some syntax errors.
   92535 cat >input <<'_ATEOF'
   92536 1 2
   92537 _ATEOF
   92538 
   92539 { set +x
   92540 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   92541 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   92542 ( $at_check_trace;  $PREPARSER ./calc input
   92543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92544 at_status=$? at_failed=false
   92545 $at_check_filter
   92546 echo stderr:; tee stderr <"$at_stderr"
   92547 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92548 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
   92549 $at_failed && at_fn_log_failure
   92550 $at_traceon; }
   92551 
   92552 { set +x
   92553 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92554 at_fn_check_prepare_trace "calc.at:648"
   92555 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92557 at_status=$? at_failed=false
   92558 $at_check_filter
   92559 echo stderr:; tee stderr <"$at_stderr"
   92560 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92561 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92562 $at_failed && at_fn_log_failure
   92563 $at_traceon; }
   92564 
   92565 
   92566 
   92567 # Normalize the observed and expected error messages, depending upon the
   92568 # options.
   92569 # 1. Remove the traces from observed.
   92570 sed '/^Starting/d
   92571 /^Entering/d
   92572 /^Stack/d
   92573 /^Reading/d
   92574 /^Reducing/d
   92575 /^Return/d
   92576 /^Shifting/d
   92577 /^state/d
   92578 /^Cleanup:/d
   92579 /^Error:/d
   92580 /^Next/d
   92581 /^Now/d
   92582 /^Discarding/d
   92583 / \$[0-9$]* = /d
   92584 /^yydestructor:/d' stderr >at-stderr
   92585 mv at-stderr stderr
   92586 # 2. Create the reference error message.
   92587 cat >expout <<'_ATEOF'
   92588 1.3: syntax error, unexpected number
   92589 _ATEOF
   92590 
   92591 # 3. If locations are not used, remove them.
   92592 
   92593 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92594 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   92595 mv at-expout expout
   92596 # 5. Check
   92597 { set +x
   92598 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   92599 at_fn_check_prepare_trace "calc.at:648"
   92600 ( $at_check_trace; cat stderr
   92601 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92602 at_status=$? at_failed=false
   92603 $at_check_filter
   92604 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92605 $at_diff expout "$at_stdout" || at_failed=:
   92606 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92607 $at_failed && at_fn_log_failure
   92608 $at_traceon; }
   92609 
   92610 
   92611 cat >input <<'_ATEOF'
   92612 1//2
   92613 _ATEOF
   92614 
   92615 { set +x
   92616 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   92617 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   92618 ( $at_check_trace;  $PREPARSER ./calc input
   92619 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92620 at_status=$? at_failed=false
   92621 $at_check_filter
   92622 echo stderr:; tee stderr <"$at_stderr"
   92623 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92624 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
   92625 $at_failed && at_fn_log_failure
   92626 $at_traceon; }
   92627 
   92628 { set +x
   92629 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92630 at_fn_check_prepare_trace "calc.at:648"
   92631 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92633 at_status=$? at_failed=false
   92634 $at_check_filter
   92635 echo stderr:; tee stderr <"$at_stderr"
   92636 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92637 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92638 $at_failed && at_fn_log_failure
   92639 $at_traceon; }
   92640 
   92641 
   92642 
   92643 # Normalize the observed and expected error messages, depending upon the
   92644 # options.
   92645 # 1. Remove the traces from observed.
   92646 sed '/^Starting/d
   92647 /^Entering/d
   92648 /^Stack/d
   92649 /^Reading/d
   92650 /^Reducing/d
   92651 /^Return/d
   92652 /^Shifting/d
   92653 /^state/d
   92654 /^Cleanup:/d
   92655 /^Error:/d
   92656 /^Next/d
   92657 /^Now/d
   92658 /^Discarding/d
   92659 / \$[0-9$]* = /d
   92660 /^yydestructor:/d' stderr >at-stderr
   92661 mv at-stderr stderr
   92662 # 2. Create the reference error message.
   92663 cat >expout <<'_ATEOF'
   92664 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   92665 _ATEOF
   92666 
   92667 # 3. If locations are not used, remove them.
   92668 
   92669 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92670 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   92671 mv at-expout expout
   92672 # 5. Check
   92673 { set +x
   92674 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   92675 at_fn_check_prepare_trace "calc.at:648"
   92676 ( $at_check_trace; cat stderr
   92677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92678 at_status=$? at_failed=false
   92679 $at_check_filter
   92680 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92681 $at_diff expout "$at_stdout" || at_failed=:
   92682 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92683 $at_failed && at_fn_log_failure
   92684 $at_traceon; }
   92685 
   92686 
   92687 cat >input <<'_ATEOF'
   92688 error
   92689 _ATEOF
   92690 
   92691 { set +x
   92692 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   92693 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   92694 ( $at_check_trace;  $PREPARSER ./calc input
   92695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92696 at_status=$? at_failed=false
   92697 $at_check_filter
   92698 echo stderr:; tee stderr <"$at_stderr"
   92699 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92700 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
   92701 $at_failed && at_fn_log_failure
   92702 $at_traceon; }
   92703 
   92704 { set +x
   92705 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92706 at_fn_check_prepare_trace "calc.at:648"
   92707 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92708 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92709 at_status=$? at_failed=false
   92710 $at_check_filter
   92711 echo stderr:; tee stderr <"$at_stderr"
   92712 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92713 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92714 $at_failed && at_fn_log_failure
   92715 $at_traceon; }
   92716 
   92717 
   92718 
   92719 # Normalize the observed and expected error messages, depending upon the
   92720 # options.
   92721 # 1. Remove the traces from observed.
   92722 sed '/^Starting/d
   92723 /^Entering/d
   92724 /^Stack/d
   92725 /^Reading/d
   92726 /^Reducing/d
   92727 /^Return/d
   92728 /^Shifting/d
   92729 /^state/d
   92730 /^Cleanup:/d
   92731 /^Error:/d
   92732 /^Next/d
   92733 /^Now/d
   92734 /^Discarding/d
   92735 / \$[0-9$]* = /d
   92736 /^yydestructor:/d' stderr >at-stderr
   92737 mv at-stderr stderr
   92738 # 2. Create the reference error message.
   92739 cat >expout <<'_ATEOF'
   92740 1.1: syntax error, unexpected $undefined
   92741 _ATEOF
   92742 
   92743 # 3. If locations are not used, remove them.
   92744 
   92745 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92746 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   92747 mv at-expout expout
   92748 # 5. Check
   92749 { set +x
   92750 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   92751 at_fn_check_prepare_trace "calc.at:648"
   92752 ( $at_check_trace; cat stderr
   92753 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92754 at_status=$? at_failed=false
   92755 $at_check_filter
   92756 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92757 $at_diff expout "$at_stdout" || at_failed=:
   92758 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92759 $at_failed && at_fn_log_failure
   92760 $at_traceon; }
   92761 
   92762 
   92763 cat >input <<'_ATEOF'
   92764 1 = 2 = 3
   92765 _ATEOF
   92766 
   92767 { set +x
   92768 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   92769 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   92770 ( $at_check_trace;  $PREPARSER ./calc input
   92771 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92772 at_status=$? at_failed=false
   92773 $at_check_filter
   92774 echo stderr:; tee stderr <"$at_stderr"
   92775 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92776 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
   92777 $at_failed && at_fn_log_failure
   92778 $at_traceon; }
   92779 
   92780 { set +x
   92781 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92782 at_fn_check_prepare_trace "calc.at:648"
   92783 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92785 at_status=$? at_failed=false
   92786 $at_check_filter
   92787 echo stderr:; tee stderr <"$at_stderr"
   92788 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92789 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92790 $at_failed && at_fn_log_failure
   92791 $at_traceon; }
   92792 
   92793 
   92794 
   92795 # Normalize the observed and expected error messages, depending upon the
   92796 # options.
   92797 # 1. Remove the traces from observed.
   92798 sed '/^Starting/d
   92799 /^Entering/d
   92800 /^Stack/d
   92801 /^Reading/d
   92802 /^Reducing/d
   92803 /^Return/d
   92804 /^Shifting/d
   92805 /^state/d
   92806 /^Cleanup:/d
   92807 /^Error:/d
   92808 /^Next/d
   92809 /^Now/d
   92810 /^Discarding/d
   92811 / \$[0-9$]* = /d
   92812 /^yydestructor:/d' stderr >at-stderr
   92813 mv at-stderr stderr
   92814 # 2. Create the reference error message.
   92815 cat >expout <<'_ATEOF'
   92816 1.7: syntax error, unexpected '='
   92817 _ATEOF
   92818 
   92819 # 3. If locations are not used, remove them.
   92820 
   92821 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92822 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   92823 mv at-expout expout
   92824 # 5. Check
   92825 { set +x
   92826 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   92827 at_fn_check_prepare_trace "calc.at:648"
   92828 ( $at_check_trace; cat stderr
   92829 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92830 at_status=$? at_failed=false
   92831 $at_check_filter
   92832 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92833 $at_diff expout "$at_stdout" || at_failed=:
   92834 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92835 $at_failed && at_fn_log_failure
   92836 $at_traceon; }
   92837 
   92838 
   92839 cat >input <<'_ATEOF'
   92840 
   92841 +1
   92842 _ATEOF
   92843 
   92844 { set +x
   92845 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   92846 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   92847 ( $at_check_trace;  $PREPARSER ./calc input
   92848 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92849 at_status=$? at_failed=false
   92850 $at_check_filter
   92851 echo stderr:; tee stderr <"$at_stderr"
   92852 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92853 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
   92854 $at_failed && at_fn_log_failure
   92855 $at_traceon; }
   92856 
   92857 { set +x
   92858 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92859 at_fn_check_prepare_trace "calc.at:648"
   92860 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92862 at_status=$? at_failed=false
   92863 $at_check_filter
   92864 echo stderr:; tee stderr <"$at_stderr"
   92865 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92866 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92867 $at_failed && at_fn_log_failure
   92868 $at_traceon; }
   92869 
   92870 
   92871 
   92872 # Normalize the observed and expected error messages, depending upon the
   92873 # options.
   92874 # 1. Remove the traces from observed.
   92875 sed '/^Starting/d
   92876 /^Entering/d
   92877 /^Stack/d
   92878 /^Reading/d
   92879 /^Reducing/d
   92880 /^Return/d
   92881 /^Shifting/d
   92882 /^state/d
   92883 /^Cleanup:/d
   92884 /^Error:/d
   92885 /^Next/d
   92886 /^Now/d
   92887 /^Discarding/d
   92888 / \$[0-9$]* = /d
   92889 /^yydestructor:/d' stderr >at-stderr
   92890 mv at-stderr stderr
   92891 # 2. Create the reference error message.
   92892 cat >expout <<'_ATEOF'
   92893 2.1: syntax error, unexpected '+'
   92894 _ATEOF
   92895 
   92896 # 3. If locations are not used, remove them.
   92897 
   92898 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92899 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   92900 mv at-expout expout
   92901 # 5. Check
   92902 { set +x
   92903 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   92904 at_fn_check_prepare_trace "calc.at:648"
   92905 ( $at_check_trace; cat stderr
   92906 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92907 at_status=$? at_failed=false
   92908 $at_check_filter
   92909 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92910 $at_diff expout "$at_stdout" || at_failed=:
   92911 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92912 $at_failed && at_fn_log_failure
   92913 $at_traceon; }
   92914 
   92915 
   92916 # Exercise error messages with EOF: work on an empty file.
   92917 { set +x
   92918 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc /dev/null"
   92919 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:648"
   92920 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   92921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92922 at_status=$? at_failed=false
   92923 $at_check_filter
   92924 echo stderr:; tee stderr <"$at_stderr"
   92925 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92926 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
   92927 $at_failed && at_fn_log_failure
   92928 $at_traceon; }
   92929 
   92930 { set +x
   92931 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   92932 at_fn_check_prepare_trace "calc.at:648"
   92933 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   92934 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92935 at_status=$? at_failed=false
   92936 $at_check_filter
   92937 echo stderr:; tee stderr <"$at_stderr"
   92938 at_fn_diff_devnull "$at_stdout" || at_failed=:
   92939 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92940 $at_failed && at_fn_log_failure
   92941 $at_traceon; }
   92942 
   92943 
   92944 
   92945 # Normalize the observed and expected error messages, depending upon the
   92946 # options.
   92947 # 1. Remove the traces from observed.
   92948 sed '/^Starting/d
   92949 /^Entering/d
   92950 /^Stack/d
   92951 /^Reading/d
   92952 /^Reducing/d
   92953 /^Return/d
   92954 /^Shifting/d
   92955 /^state/d
   92956 /^Cleanup:/d
   92957 /^Error:/d
   92958 /^Next/d
   92959 /^Now/d
   92960 /^Discarding/d
   92961 / \$[0-9$]* = /d
   92962 /^yydestructor:/d' stderr >at-stderr
   92963 mv at-stderr stderr
   92964 # 2. Create the reference error message.
   92965 cat >expout <<'_ATEOF'
   92966 1.1: syntax error, unexpected end of input
   92967 _ATEOF
   92968 
   92969 # 3. If locations are not used, remove them.
   92970 
   92971 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   92972 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   92973 mv at-expout expout
   92974 # 5. Check
   92975 { set +x
   92976 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   92977 at_fn_check_prepare_trace "calc.at:648"
   92978 ( $at_check_trace; cat stderr
   92979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   92980 at_status=$? at_failed=false
   92981 $at_check_filter
   92982 at_fn_diff_devnull "$at_stderr" || at_failed=:
   92983 $at_diff expout "$at_stdout" || at_failed=:
   92984 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   92985 $at_failed && at_fn_log_failure
   92986 $at_traceon; }
   92987 
   92988 
   92989 
   92990 # Exercise the error token: without it, we die at the first error,
   92991 # hence be sure to
   92992 #
   92993 # - have several errors which exercise different shift/discardings
   92994 #   - (): nothing to pop, nothing to discard
   92995 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   92996 #   - (* * *): nothing to pop, a lot to discard
   92997 #   - (1 + 2 * *): some to pop and discard
   92998 #
   92999 # - test the action associated to `error'
   93000 #
   93001 # - check the lookahead that triggers an error is not discarded
   93002 #   when we enter error recovery.  Below, the lookahead causing the
   93003 #   first error is ")", which is needed to recover from the error and
   93004 #   produce the "0" that triggers the "0 != 1" error.
   93005 #
   93006 cat >input <<'_ATEOF'
   93007 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   93008 _ATEOF
   93009 
   93010 { set +x
   93011 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   93012 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   93013 ( $at_check_trace;  $PREPARSER ./calc input
   93014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93015 at_status=$? at_failed=false
   93016 $at_check_filter
   93017 echo stderr:; tee stderr <"$at_stderr"
   93018 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93019 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93020 $at_failed && at_fn_log_failure
   93021 $at_traceon; }
   93022 
   93023 { set +x
   93024 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93025 at_fn_check_prepare_trace "calc.at:648"
   93026 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93028 at_status=$? at_failed=false
   93029 $at_check_filter
   93030 echo stderr:; tee stderr <"$at_stderr"
   93031 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93032 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93033 $at_failed && at_fn_log_failure
   93034 $at_traceon; }
   93035 
   93036 
   93037 
   93038 # Normalize the observed and expected error messages, depending upon the
   93039 # options.
   93040 # 1. Remove the traces from observed.
   93041 sed '/^Starting/d
   93042 /^Entering/d
   93043 /^Stack/d
   93044 /^Reading/d
   93045 /^Reducing/d
   93046 /^Return/d
   93047 /^Shifting/d
   93048 /^state/d
   93049 /^Cleanup:/d
   93050 /^Error:/d
   93051 /^Next/d
   93052 /^Now/d
   93053 /^Discarding/d
   93054 / \$[0-9$]* = /d
   93055 /^yydestructor:/d' stderr >at-stderr
   93056 mv at-stderr stderr
   93057 # 2. Create the reference error message.
   93058 cat >expout <<'_ATEOF'
   93059 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   93060 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   93061 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   93062 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   93063 calc: error: 4444 != 1
   93064 _ATEOF
   93065 
   93066 # 3. If locations are not used, remove them.
   93067 
   93068 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   93069 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   93070 mv at-expout expout
   93071 # 5. Check
   93072 { set +x
   93073 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   93074 at_fn_check_prepare_trace "calc.at:648"
   93075 ( $at_check_trace; cat stderr
   93076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93077 at_status=$? at_failed=false
   93078 $at_check_filter
   93079 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93080 $at_diff expout "$at_stdout" || at_failed=:
   93081 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93082 $at_failed && at_fn_log_failure
   93083 $at_traceon; }
   93084 
   93085 
   93086 
   93087 # The same, but this time exercising explicitly triggered syntax errors.
   93088 # POSIX says the lookahead causing the error should not be discarded.
   93089 cat >input <<'_ATEOF'
   93090 (!) + (1 2) = 1
   93091 _ATEOF
   93092 
   93093 { set +x
   93094 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   93095 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   93096 ( $at_check_trace;  $PREPARSER ./calc input
   93097 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93098 at_status=$? at_failed=false
   93099 $at_check_filter
   93100 echo stderr:; tee stderr <"$at_stderr"
   93101 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93102 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93103 $at_failed && at_fn_log_failure
   93104 $at_traceon; }
   93105 
   93106 { set +x
   93107 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93108 at_fn_check_prepare_trace "calc.at:648"
   93109 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93110 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93111 at_status=$? at_failed=false
   93112 $at_check_filter
   93113 echo stderr:; tee stderr <"$at_stderr"
   93114 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93115 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93116 $at_failed && at_fn_log_failure
   93117 $at_traceon; }
   93118 
   93119 
   93120 
   93121 # Normalize the observed and expected error messages, depending upon the
   93122 # options.
   93123 # 1. Remove the traces from observed.
   93124 sed '/^Starting/d
   93125 /^Entering/d
   93126 /^Stack/d
   93127 /^Reading/d
   93128 /^Reducing/d
   93129 /^Return/d
   93130 /^Shifting/d
   93131 /^state/d
   93132 /^Cleanup:/d
   93133 /^Error:/d
   93134 /^Next/d
   93135 /^Now/d
   93136 /^Discarding/d
   93137 / \$[0-9$]* = /d
   93138 /^yydestructor:/d' stderr >at-stderr
   93139 mv at-stderr stderr
   93140 # 2. Create the reference error message.
   93141 cat >expout <<'_ATEOF'
   93142 1.10: syntax error, unexpected number
   93143 calc: error: 2222 != 1
   93144 _ATEOF
   93145 
   93146 # 3. If locations are not used, remove them.
   93147 
   93148 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   93149 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   93150 mv at-expout expout
   93151 # 5. Check
   93152 { set +x
   93153 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   93154 at_fn_check_prepare_trace "calc.at:648"
   93155 ( $at_check_trace; cat stderr
   93156 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93157 at_status=$? at_failed=false
   93158 $at_check_filter
   93159 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93160 $at_diff expout "$at_stdout" || at_failed=:
   93161 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93162 $at_failed && at_fn_log_failure
   93163 $at_traceon; }
   93164 
   93165 
   93166 cat >input <<'_ATEOF'
   93167 (- *) + (1 2) = 1
   93168 _ATEOF
   93169 
   93170 { set +x
   93171 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   93172 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   93173 ( $at_check_trace;  $PREPARSER ./calc input
   93174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93175 at_status=$? at_failed=false
   93176 $at_check_filter
   93177 echo stderr:; tee stderr <"$at_stderr"
   93178 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93179 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93180 $at_failed && at_fn_log_failure
   93181 $at_traceon; }
   93182 
   93183 { set +x
   93184 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93185 at_fn_check_prepare_trace "calc.at:648"
   93186 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93187 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93188 at_status=$? at_failed=false
   93189 $at_check_filter
   93190 echo stderr:; tee stderr <"$at_stderr"
   93191 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93192 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93193 $at_failed && at_fn_log_failure
   93194 $at_traceon; }
   93195 
   93196 
   93197 
   93198 # Normalize the observed and expected error messages, depending upon the
   93199 # options.
   93200 # 1. Remove the traces from observed.
   93201 sed '/^Starting/d
   93202 /^Entering/d
   93203 /^Stack/d
   93204 /^Reading/d
   93205 /^Reducing/d
   93206 /^Return/d
   93207 /^Shifting/d
   93208 /^state/d
   93209 /^Cleanup:/d
   93210 /^Error:/d
   93211 /^Next/d
   93212 /^Now/d
   93213 /^Discarding/d
   93214 / \$[0-9$]* = /d
   93215 /^yydestructor:/d' stderr >at-stderr
   93216 mv at-stderr stderr
   93217 # 2. Create the reference error message.
   93218 cat >expout <<'_ATEOF'
   93219 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   93220 1.12: syntax error, unexpected number
   93221 calc: error: 2222 != 1
   93222 _ATEOF
   93223 
   93224 # 3. If locations are not used, remove them.
   93225 
   93226 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   93227 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   93228 mv at-expout expout
   93229 # 5. Check
   93230 { set +x
   93231 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   93232 at_fn_check_prepare_trace "calc.at:648"
   93233 ( $at_check_trace; cat stderr
   93234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93235 at_status=$? at_failed=false
   93236 $at_check_filter
   93237 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93238 $at_diff expout "$at_stdout" || at_failed=:
   93239 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93240 $at_failed && at_fn_log_failure
   93241 $at_traceon; }
   93242 
   93243 
   93244 
   93245 # Check that yyerrok works properly: second error is not reported,
   93246 # third and fourth are.  Parse status is succesfull.
   93247 cat >input <<'_ATEOF'
   93248 (* *) + (*) + (*)
   93249 _ATEOF
   93250 
   93251 { set +x
   93252 $as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
   93253 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
   93254 ( $at_check_trace;  $PREPARSER ./calc input
   93255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93256 at_status=$? at_failed=false
   93257 $at_check_filter
   93258 echo stderr:; tee stderr <"$at_stderr"
   93259 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93260 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93261 $at_failed && at_fn_log_failure
   93262 $at_traceon; }
   93263 
   93264 { set +x
   93265 $as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93266 at_fn_check_prepare_trace "calc.at:648"
   93267 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93268 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93269 at_status=$? at_failed=false
   93270 $at_check_filter
   93271 echo stderr:; tee stderr <"$at_stderr"
   93272 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93273 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93274 $at_failed && at_fn_log_failure
   93275 $at_traceon; }
   93276 
   93277 
   93278 
   93279 # Normalize the observed and expected error messages, depending upon the
   93280 # options.
   93281 # 1. Remove the traces from observed.
   93282 sed '/^Starting/d
   93283 /^Entering/d
   93284 /^Stack/d
   93285 /^Reading/d
   93286 /^Reducing/d
   93287 /^Return/d
   93288 /^Shifting/d
   93289 /^state/d
   93290 /^Cleanup:/d
   93291 /^Error:/d
   93292 /^Next/d
   93293 /^Now/d
   93294 /^Discarding/d
   93295 / \$[0-9$]* = /d
   93296 /^yydestructor:/d' stderr >at-stderr
   93297 mv at-stderr stderr
   93298 # 2. Create the reference error message.
   93299 cat >expout <<'_ATEOF'
   93300 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   93301 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   93302 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   93303 _ATEOF
   93304 
   93305 # 3. If locations are not used, remove them.
   93306 
   93307 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   93308 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   93309 mv at-expout expout
   93310 # 5. Check
   93311 { set +x
   93312 $as_echo "$at_srcdir/calc.at:648: cat stderr"
   93313 at_fn_check_prepare_trace "calc.at:648"
   93314 ( $at_check_trace; cat stderr
   93315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93316 at_status=$? at_failed=false
   93317 $at_check_filter
   93318 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93319 $at_diff expout "$at_stdout" || at_failed=:
   93320 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
   93321 $at_failed && at_fn_log_failure
   93322 $at_traceon; }
   93323 
   93324 
   93325 
   93326 
   93327 
   93328   set +x
   93329   $at_times_p && times >"$at_times_file"
   93330 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   93331 read at_status <"$at_status_file"
   93332 #AT_STOP_226
   93333 #AT_START_227
   93334 at_fn_group_banner 227 'calc.at:649' \
   93335   "Calculator %glr-parser %error-verbose %locations" "" 12
   93336 at_xfail=no
   93337 (
   93338   $as_echo "227. $at_setup_line: testing $at_desc ..."
   93339   $at_traceon
   93340 
   93341 
   93342 
   93343 
   93344 
   93345 
   93346 
   93347 
   93348 
   93349 
   93350 cat >calc.y <<'_ATEOF'
   93351 %code top {
   93352 #include <config.h>
   93353 /* We don't need perfect functions for these tests. */
   93354 #undef malloc
   93355 #undef memcmp
   93356 #undef realloc
   93357 }
   93358 
   93359 /* Infix notation calculator--calc */
   93360 %glr-parser %error-verbose %locations
   93361 
   93362 %code requires
   93363 {
   93364 
   93365   /* Exercise pre-prologue dependency to %union.  */
   93366   typedef int semantic_value;
   93367 }
   93368 
   93369 /* Exercise %union. */
   93370 %union
   93371 {
   93372   semantic_value ival;
   93373 };
   93374 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   93375 
   93376 %code provides
   93377 {
   93378   #include <stdio.h>
   93379   /* The input.  */
   93380   extern FILE *input;
   93381   extern semantic_value global_result;
   93382   extern int global_count;
   93383 }
   93384 
   93385 %code
   93386 {
   93387 #include <assert.h>
   93388 #include <string.h>
   93389 #define USE(Var)
   93390 
   93391 FILE *input;
   93392 static int power (int base, int exponent);
   93393 
   93394 static void yyerror ( const char *msg);
   93395 int yylex (void);
   93396 }
   93397 
   93398 
   93399 
   93400 /* Bison Declarations */
   93401 %token CALC_EOF 0 "end of input"
   93402 %token <ival> NUM "number"
   93403 %type  <ival> exp
   93404 
   93405 %nonassoc '=' /* comparison            */
   93406 %left '-' '+'
   93407 %left '*' '/'
   93408 %left NEG     /* negation--unary minus */
   93409 %right '^'    /* exponentiation        */
   93410 
   93411 /* Grammar follows */
   93412 %%
   93413 input:
   93414   line
   93415 | input line         {  }
   93416 ;
   93417 
   93418 line:
   93419   '\n'
   93420 | exp '\n'           { USE ($1); }
   93421 ;
   93422 
   93423 exp:
   93424   NUM                { $$ = $1;             }
   93425 | exp '=' exp
   93426   {
   93427     if ($1 != $3)
   93428       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   93429     $$ = $1;
   93430   }
   93431 | exp '+' exp        { $$ = $1 + $3;        }
   93432 | exp '-' exp        { $$ = $1 - $3;        }
   93433 | exp '*' exp        { $$ = $1 * $3;        }
   93434 | exp '/' exp        { $$ = $1 / $3;        }
   93435 | '-' exp  %prec NEG { $$ = -$2;            }
   93436 | exp '^' exp        { $$ = power ($1, $3); }
   93437 | '(' exp ')'        { $$ = $2;             }
   93438 | '(' error ')'      { $$ = 1111; yyerrok;  }
   93439 | '!'                { $$ = 0; YYERROR;     }
   93440 | '-' error          { $$ = 0; YYERROR;     }
   93441 ;
   93442 %%
   93443 
   93444 static int
   93445 power (int base, int exponent)
   93446 {
   93447   int res = 1;
   93448   assert (0 <= exponent);
   93449   for (/* Niente */; exponent; --exponent)
   93450     res *= base;
   93451   return res;
   93452 }
   93453 
   93454 
   93455 #include <stdio.h>
   93456 /* A C error reporting function.  */
   93457 static
   93458 void yyerror ( const char *msg)
   93459 {
   93460   YY_LOCATION_PRINT (stderr, (yylloc));
   93461   fprintf (stderr, ": ");
   93462   fprintf (stderr, "%s\n", msg);
   93463 }
   93464 #include <ctype.h>
   93465 
   93466 int yylex (void);
   93467 static int get_char (void);
   93468 static void unget_char ( int c);
   93469 
   93470 
   93471 static YYLTYPE last_yylloc;
   93472 
   93473 static int
   93474 get_char (void)
   93475 {
   93476   int res = getc (input);
   93477   ;
   93478 
   93479   last_yylloc = (yylloc);
   93480   if (res == '\n')
   93481     {
   93482       (yylloc).last_line++;
   93483       (yylloc).last_column = 1;
   93484     }
   93485   else
   93486     (yylloc).last_column++;
   93487 
   93488   return res;
   93489 }
   93490 
   93491 static void
   93492 unget_char ( int c)
   93493 {
   93494   ;
   93495 
   93496   /* Wrong when C == `\n'. */
   93497   (yylloc) = last_yylloc;
   93498 
   93499   ungetc (c, input);
   93500 }
   93501 
   93502 static int
   93503 read_signed_integer (void)
   93504 {
   93505   int c = get_char ();
   93506   int sign = 1;
   93507   int n = 0;
   93508 
   93509   ;
   93510   if (c == '-')
   93511     {
   93512       c = get_char ();
   93513       sign = -1;
   93514     }
   93515 
   93516   while (isdigit (c))
   93517     {
   93518       n = 10 * n + (c - '0');
   93519       c = get_char ();
   93520     }
   93521 
   93522   unget_char ( c);
   93523 
   93524   return sign * n;
   93525 }
   93526 
   93527 
   93528 /*---------------------------------------------------------------.
   93529 | Lexical analyzer returns an integer on the stack and the token |
   93530 | NUM, or the ASCII character read if not a number.  Skips all   |
   93531 | blanks and tabs, returns 0 for EOF.                            |
   93532 `---------------------------------------------------------------*/
   93533 
   93534 int yylex (void)
   93535 {
   93536   int c;
   93537   /* Skip current token, then white spaces.  */
   93538   do
   93539     {
   93540      (yylloc).first_column = (yylloc).last_column;
   93541       (yylloc).first_line   = (yylloc).last_line;
   93542 
   93543     }
   93544   while ((c = get_char ()) == ' ' || c == '\t');
   93545 
   93546   /* process numbers   */
   93547   if (c == '.' || isdigit (c))
   93548     {
   93549       unget_char ( c);
   93550       (yylval).ival = read_signed_integer ();
   93551       return NUM;
   93552     }
   93553 
   93554   /* Return end-of-file.  */
   93555   if (c == EOF)
   93556     return CALC_EOF;
   93557 
   93558   /* Return single chars. */
   93559   return c;
   93560 }
   93561 
   93562 #include <assert.h>
   93563 #if HAVE_UNISTD_H
   93564 # include <unistd.h>
   93565 #else
   93566 # undef alarm
   93567 # define alarm(seconds) /* empty */
   93568 #endif
   93569 
   93570 
   93571 
   93572 semantic_value global_result = 0;
   93573 int global_count = 0;
   93574 
   93575 /* A C main function.  */
   93576 int
   93577 main (int argc, const char **argv)
   93578 {
   93579   semantic_value result = 0;
   93580   int count = 0;
   93581   int status;
   93582 
   93583   /* This used to be alarm (10), but that isn't enough time for
   93584      a July 1995 vintage DEC Alphastation 200 4/100 system,
   93585      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   93586   alarm (100);
   93587 
   93588   if (argc == 2)
   93589     input = fopen (argv[1], "r");
   93590   else
   93591     input = stdin;
   93592 
   93593   if (!input)
   93594     {
   93595       perror (argv[1]);
   93596       return 3;
   93597     }
   93598 
   93599 
   93600   status = yyparse ();
   93601   if (fclose (input))
   93602     perror ("fclose");
   93603   assert (global_result == result);
   93604   assert (global_count == count);
   93605   return status;
   93606 }
   93607 _ATEOF
   93608 
   93609 
   93610 
   93611 
   93612 
   93613 
   93614 
   93615 
   93616 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   93617   at_save_special_files
   93618   mkdir xml-tests
   93619     # Don't combine these Bison invocations since we want to be sure that
   93620   # --report=all isn't required to get the full XML file.
   93621   { set +x
   93622 $as_echo "$at_srcdir/calc.at:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   93623                   --graph=xml-tests/test.dot -o calc.c calc.y"
   93624 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:649"
   93625 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   93626                   --graph=xml-tests/test.dot -o calc.c calc.y
   93627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93628 at_status=$? at_failed=false
   93629 $at_check_filter
   93630 echo stderr:; cat "$at_stderr"
   93631 echo stdout:; cat "$at_stdout"
   93632 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93633 $at_failed && at_fn_log_failure
   93634 $at_traceon; }
   93635 
   93636   { set +x
   93637 $as_echo "$at_srcdir/calc.at:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   93638 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:649"
   93639 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   93640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93641 at_status=$? at_failed=false
   93642 $at_check_filter
   93643 echo stderr:; cat "$at_stderr"
   93644 echo stdout:; cat "$at_stdout"
   93645 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93646 $at_failed && at_fn_log_failure
   93647 $at_traceon; }
   93648 
   93649     cp xml-tests/test.output expout
   93650   { set +x
   93651 $as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\
   93652              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   93653              xml-tests/test.xml"
   93654 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649"
   93655 ( $at_check_trace; $XSLTPROC \
   93656              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   93657              xml-tests/test.xml
   93658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93659 at_status=$? at_failed=false
   93660 $at_check_filter
   93661 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93662 $at_diff expout "$at_stdout" || at_failed=:
   93663 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93664 $at_failed && at_fn_log_failure
   93665 $at_traceon; }
   93666 
   93667   sort xml-tests/test.dot > expout
   93668   { set +x
   93669 $as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\
   93670              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   93671              xml-tests/test.xml | sort"
   93672 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649"
   93673 ( $at_check_trace; $XSLTPROC \
   93674              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   93675              xml-tests/test.xml | sort
   93676 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93677 at_status=$? at_failed=false
   93678 $at_check_filter
   93679 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93680 $at_diff expout "$at_stdout" || at_failed=:
   93681 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93682 $at_failed && at_fn_log_failure
   93683 $at_traceon; }
   93684 
   93685   rm -rf xml-tests expout
   93686   at_restore_special_files
   93687 fi
   93688 { set +x
   93689 $as_echo "$at_srcdir/calc.at:649: bison -o calc.c calc.y"
   93690 at_fn_check_prepare_trace "calc.at:649"
   93691 ( $at_check_trace; bison -o calc.c calc.y
   93692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93693 at_status=$? at_failed=false
   93694 $at_check_filter
   93695 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93696 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93697 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93698 $at_failed && at_fn_log_failure
   93699 $at_traceon; }
   93700 
   93701 
   93702    { set +x
   93703 $as_echo "$at_srcdir/calc.at:649: \$BISON_C_WORKS"
   93704 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:649"
   93705 ( $at_check_trace; $BISON_C_WORKS
   93706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93707 at_status=$? at_failed=false
   93708 $at_check_filter
   93709 echo stderr:; cat "$at_stderr"
   93710 echo stdout:; cat "$at_stdout"
   93711 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93712 $at_failed && at_fn_log_failure
   93713 $at_traceon; }
   93714 
   93715 { set +x
   93716 $as_echo "$at_srcdir/calc.at:649: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   93717 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:649"
   93718 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   93719 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93720 at_status=$? at_failed=false
   93721 $at_check_filter
   93722 echo stderr:; cat "$at_stderr"
   93723 echo stdout:; cat "$at_stdout"
   93724 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93725 $at_failed && at_fn_log_failure
   93726 $at_traceon; }
   93727 
   93728 
   93729 { set +x
   93730 $as_echo "$at_srcdir/calc.at:649: \$PERL -ne '
   93731   chomp;
   93732   print \"\$.: {\$_}\\n\"
   93733     if (# No starting/ending empty lines.
   93734         (eof || \$. == 1) && /^\\s*\$/
   93735         # No trailing space.  FIXME: not ready for \"maint\".
   93736         # || /\\s\$/
   93737         )' calc.c
   93738 "
   93739 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:649"
   93740 ( $at_check_trace; $PERL -ne '
   93741   chomp;
   93742   print "$.: {$_}\n"
   93743     if (# No starting/ending empty lines.
   93744         (eof || $. == 1) && /^\s*$/
   93745         # No trailing space.  FIXME: not ready for "maint".
   93746         # || /\s$/
   93747         )' calc.c
   93748 
   93749 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93750 at_status=$? at_failed=false
   93751 $at_check_filter
   93752 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93753 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93754 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93755 $at_failed && at_fn_log_failure
   93756 $at_traceon; }
   93757 
   93758 
   93759 
   93760 # Test the priorities.
   93761 cat >input <<'_ATEOF'
   93762 1 + 2 * 3 = 7
   93763 1 + 2 * -3 = -5
   93764 
   93765 -1^2 = -1
   93766 (-1)^2 = 1
   93767 
   93768 ---1 = -1
   93769 
   93770 1 - 2 - 3 = -4
   93771 1 - (2 - 3) = 2
   93772 
   93773 2^2^3 = 256
   93774 (2^2)^3 = 64
   93775 _ATEOF
   93776 
   93777 { set +x
   93778 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   93779 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   93780 ( $at_check_trace;  $PREPARSER ./calc input
   93781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93782 at_status=$? at_failed=false
   93783 $at_check_filter
   93784 echo stderr:; tee stderr <"$at_stderr"
   93785 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93786 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93787 $at_failed && at_fn_log_failure
   93788 $at_traceon; }
   93789 
   93790 { set +x
   93791 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93792 at_fn_check_prepare_trace "calc.at:649"
   93793 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93795 at_status=$? at_failed=false
   93796 $at_check_filter
   93797 echo stderr:; tee stderr <"$at_stderr"
   93798 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93799 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93800 $at_failed && at_fn_log_failure
   93801 $at_traceon; }
   93802 
   93803 
   93804 
   93805 
   93806 # Some syntax errors.
   93807 cat >input <<'_ATEOF'
   93808 1 2
   93809 _ATEOF
   93810 
   93811 { set +x
   93812 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   93813 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   93814 ( $at_check_trace;  $PREPARSER ./calc input
   93815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93816 at_status=$? at_failed=false
   93817 $at_check_filter
   93818 echo stderr:; tee stderr <"$at_stderr"
   93819 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93820 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
   93821 $at_failed && at_fn_log_failure
   93822 $at_traceon; }
   93823 
   93824 { set +x
   93825 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93826 at_fn_check_prepare_trace "calc.at:649"
   93827 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93829 at_status=$? at_failed=false
   93830 $at_check_filter
   93831 echo stderr:; tee stderr <"$at_stderr"
   93832 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93833 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93834 $at_failed && at_fn_log_failure
   93835 $at_traceon; }
   93836 
   93837 
   93838 
   93839 # Normalize the observed and expected error messages, depending upon the
   93840 # options.
   93841 # 1. Remove the traces from observed.
   93842 sed '/^Starting/d
   93843 /^Entering/d
   93844 /^Stack/d
   93845 /^Reading/d
   93846 /^Reducing/d
   93847 /^Return/d
   93848 /^Shifting/d
   93849 /^state/d
   93850 /^Cleanup:/d
   93851 /^Error:/d
   93852 /^Next/d
   93853 /^Now/d
   93854 /^Discarding/d
   93855 / \$[0-9$]* = /d
   93856 /^yydestructor:/d' stderr >at-stderr
   93857 mv at-stderr stderr
   93858 # 2. Create the reference error message.
   93859 cat >expout <<'_ATEOF'
   93860 1.3: syntax error, unexpected number
   93861 _ATEOF
   93862 
   93863 # 3. If locations are not used, remove them.
   93864 
   93865 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   93866 
   93867 # 5. Check
   93868 { set +x
   93869 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   93870 at_fn_check_prepare_trace "calc.at:649"
   93871 ( $at_check_trace; cat stderr
   93872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93873 at_status=$? at_failed=false
   93874 $at_check_filter
   93875 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93876 $at_diff expout "$at_stdout" || at_failed=:
   93877 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93878 $at_failed && at_fn_log_failure
   93879 $at_traceon; }
   93880 
   93881 
   93882 cat >input <<'_ATEOF'
   93883 1//2
   93884 _ATEOF
   93885 
   93886 { set +x
   93887 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   93888 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   93889 ( $at_check_trace;  $PREPARSER ./calc input
   93890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93891 at_status=$? at_failed=false
   93892 $at_check_filter
   93893 echo stderr:; tee stderr <"$at_stderr"
   93894 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93895 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
   93896 $at_failed && at_fn_log_failure
   93897 $at_traceon; }
   93898 
   93899 { set +x
   93900 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93901 at_fn_check_prepare_trace "calc.at:649"
   93902 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93904 at_status=$? at_failed=false
   93905 $at_check_filter
   93906 echo stderr:; tee stderr <"$at_stderr"
   93907 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93908 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93909 $at_failed && at_fn_log_failure
   93910 $at_traceon; }
   93911 
   93912 
   93913 
   93914 # Normalize the observed and expected error messages, depending upon the
   93915 # options.
   93916 # 1. Remove the traces from observed.
   93917 sed '/^Starting/d
   93918 /^Entering/d
   93919 /^Stack/d
   93920 /^Reading/d
   93921 /^Reducing/d
   93922 /^Return/d
   93923 /^Shifting/d
   93924 /^state/d
   93925 /^Cleanup:/d
   93926 /^Error:/d
   93927 /^Next/d
   93928 /^Now/d
   93929 /^Discarding/d
   93930 / \$[0-9$]* = /d
   93931 /^yydestructor:/d' stderr >at-stderr
   93932 mv at-stderr stderr
   93933 # 2. Create the reference error message.
   93934 cat >expout <<'_ATEOF'
   93935 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   93936 _ATEOF
   93937 
   93938 # 3. If locations are not used, remove them.
   93939 
   93940 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   93941 
   93942 # 5. Check
   93943 { set +x
   93944 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   93945 at_fn_check_prepare_trace "calc.at:649"
   93946 ( $at_check_trace; cat stderr
   93947 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93948 at_status=$? at_failed=false
   93949 $at_check_filter
   93950 at_fn_diff_devnull "$at_stderr" || at_failed=:
   93951 $at_diff expout "$at_stdout" || at_failed=:
   93952 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93953 $at_failed && at_fn_log_failure
   93954 $at_traceon; }
   93955 
   93956 
   93957 cat >input <<'_ATEOF'
   93958 error
   93959 _ATEOF
   93960 
   93961 { set +x
   93962 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   93963 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   93964 ( $at_check_trace;  $PREPARSER ./calc input
   93965 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93966 at_status=$? at_failed=false
   93967 $at_check_filter
   93968 echo stderr:; tee stderr <"$at_stderr"
   93969 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93970 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
   93971 $at_failed && at_fn_log_failure
   93972 $at_traceon; }
   93973 
   93974 { set +x
   93975 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   93976 at_fn_check_prepare_trace "calc.at:649"
   93977 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   93978 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   93979 at_status=$? at_failed=false
   93980 $at_check_filter
   93981 echo stderr:; tee stderr <"$at_stderr"
   93982 at_fn_diff_devnull "$at_stdout" || at_failed=:
   93983 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   93984 $at_failed && at_fn_log_failure
   93985 $at_traceon; }
   93986 
   93987 
   93988 
   93989 # Normalize the observed and expected error messages, depending upon the
   93990 # options.
   93991 # 1. Remove the traces from observed.
   93992 sed '/^Starting/d
   93993 /^Entering/d
   93994 /^Stack/d
   93995 /^Reading/d
   93996 /^Reducing/d
   93997 /^Return/d
   93998 /^Shifting/d
   93999 /^state/d
   94000 /^Cleanup:/d
   94001 /^Error:/d
   94002 /^Next/d
   94003 /^Now/d
   94004 /^Discarding/d
   94005 / \$[0-9$]* = /d
   94006 /^yydestructor:/d' stderr >at-stderr
   94007 mv at-stderr stderr
   94008 # 2. Create the reference error message.
   94009 cat >expout <<'_ATEOF'
   94010 1.1: syntax error, unexpected $undefined
   94011 _ATEOF
   94012 
   94013 # 3. If locations are not used, remove them.
   94014 
   94015 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94016 
   94017 # 5. Check
   94018 { set +x
   94019 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94020 at_fn_check_prepare_trace "calc.at:649"
   94021 ( $at_check_trace; cat stderr
   94022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94023 at_status=$? at_failed=false
   94024 $at_check_filter
   94025 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94026 $at_diff expout "$at_stdout" || at_failed=:
   94027 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94028 $at_failed && at_fn_log_failure
   94029 $at_traceon; }
   94030 
   94031 
   94032 cat >input <<'_ATEOF'
   94033 1 = 2 = 3
   94034 _ATEOF
   94035 
   94036 { set +x
   94037 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   94038 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   94039 ( $at_check_trace;  $PREPARSER ./calc input
   94040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94041 at_status=$? at_failed=false
   94042 $at_check_filter
   94043 echo stderr:; tee stderr <"$at_stderr"
   94044 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94045 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
   94046 $at_failed && at_fn_log_failure
   94047 $at_traceon; }
   94048 
   94049 { set +x
   94050 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94051 at_fn_check_prepare_trace "calc.at:649"
   94052 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94054 at_status=$? at_failed=false
   94055 $at_check_filter
   94056 echo stderr:; tee stderr <"$at_stderr"
   94057 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94059 $at_failed && at_fn_log_failure
   94060 $at_traceon; }
   94061 
   94062 
   94063 
   94064 # Normalize the observed and expected error messages, depending upon the
   94065 # options.
   94066 # 1. Remove the traces from observed.
   94067 sed '/^Starting/d
   94068 /^Entering/d
   94069 /^Stack/d
   94070 /^Reading/d
   94071 /^Reducing/d
   94072 /^Return/d
   94073 /^Shifting/d
   94074 /^state/d
   94075 /^Cleanup:/d
   94076 /^Error:/d
   94077 /^Next/d
   94078 /^Now/d
   94079 /^Discarding/d
   94080 / \$[0-9$]* = /d
   94081 /^yydestructor:/d' stderr >at-stderr
   94082 mv at-stderr stderr
   94083 # 2. Create the reference error message.
   94084 cat >expout <<'_ATEOF'
   94085 1.7: syntax error, unexpected '='
   94086 _ATEOF
   94087 
   94088 # 3. If locations are not used, remove them.
   94089 
   94090 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94091 
   94092 # 5. Check
   94093 { set +x
   94094 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94095 at_fn_check_prepare_trace "calc.at:649"
   94096 ( $at_check_trace; cat stderr
   94097 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94098 at_status=$? at_failed=false
   94099 $at_check_filter
   94100 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94101 $at_diff expout "$at_stdout" || at_failed=:
   94102 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94103 $at_failed && at_fn_log_failure
   94104 $at_traceon; }
   94105 
   94106 
   94107 cat >input <<'_ATEOF'
   94108 
   94109 +1
   94110 _ATEOF
   94111 
   94112 { set +x
   94113 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   94114 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   94115 ( $at_check_trace;  $PREPARSER ./calc input
   94116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94117 at_status=$? at_failed=false
   94118 $at_check_filter
   94119 echo stderr:; tee stderr <"$at_stderr"
   94120 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94121 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
   94122 $at_failed && at_fn_log_failure
   94123 $at_traceon; }
   94124 
   94125 { set +x
   94126 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94127 at_fn_check_prepare_trace "calc.at:649"
   94128 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94129 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94130 at_status=$? at_failed=false
   94131 $at_check_filter
   94132 echo stderr:; tee stderr <"$at_stderr"
   94133 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94134 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94135 $at_failed && at_fn_log_failure
   94136 $at_traceon; }
   94137 
   94138 
   94139 
   94140 # Normalize the observed and expected error messages, depending upon the
   94141 # options.
   94142 # 1. Remove the traces from observed.
   94143 sed '/^Starting/d
   94144 /^Entering/d
   94145 /^Stack/d
   94146 /^Reading/d
   94147 /^Reducing/d
   94148 /^Return/d
   94149 /^Shifting/d
   94150 /^state/d
   94151 /^Cleanup:/d
   94152 /^Error:/d
   94153 /^Next/d
   94154 /^Now/d
   94155 /^Discarding/d
   94156 / \$[0-9$]* = /d
   94157 /^yydestructor:/d' stderr >at-stderr
   94158 mv at-stderr stderr
   94159 # 2. Create the reference error message.
   94160 cat >expout <<'_ATEOF'
   94161 2.1: syntax error, unexpected '+'
   94162 _ATEOF
   94163 
   94164 # 3. If locations are not used, remove them.
   94165 
   94166 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94167 
   94168 # 5. Check
   94169 { set +x
   94170 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94171 at_fn_check_prepare_trace "calc.at:649"
   94172 ( $at_check_trace; cat stderr
   94173 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94174 at_status=$? at_failed=false
   94175 $at_check_filter
   94176 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94177 $at_diff expout "$at_stdout" || at_failed=:
   94178 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94179 $at_failed && at_fn_log_failure
   94180 $at_traceon; }
   94181 
   94182 
   94183 # Exercise error messages with EOF: work on an empty file.
   94184 { set +x
   94185 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc /dev/null"
   94186 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:649"
   94187 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   94188 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94189 at_status=$? at_failed=false
   94190 $at_check_filter
   94191 echo stderr:; tee stderr <"$at_stderr"
   94192 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94193 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
   94194 $at_failed && at_fn_log_failure
   94195 $at_traceon; }
   94196 
   94197 { set +x
   94198 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94199 at_fn_check_prepare_trace "calc.at:649"
   94200 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94202 at_status=$? at_failed=false
   94203 $at_check_filter
   94204 echo stderr:; tee stderr <"$at_stderr"
   94205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94206 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94207 $at_failed && at_fn_log_failure
   94208 $at_traceon; }
   94209 
   94210 
   94211 
   94212 # Normalize the observed and expected error messages, depending upon the
   94213 # options.
   94214 # 1. Remove the traces from observed.
   94215 sed '/^Starting/d
   94216 /^Entering/d
   94217 /^Stack/d
   94218 /^Reading/d
   94219 /^Reducing/d
   94220 /^Return/d
   94221 /^Shifting/d
   94222 /^state/d
   94223 /^Cleanup:/d
   94224 /^Error:/d
   94225 /^Next/d
   94226 /^Now/d
   94227 /^Discarding/d
   94228 / \$[0-9$]* = /d
   94229 /^yydestructor:/d' stderr >at-stderr
   94230 mv at-stderr stderr
   94231 # 2. Create the reference error message.
   94232 cat >expout <<'_ATEOF'
   94233 1.1: syntax error, unexpected end of input
   94234 _ATEOF
   94235 
   94236 # 3. If locations are not used, remove them.
   94237 
   94238 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94239 
   94240 # 5. Check
   94241 { set +x
   94242 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94243 at_fn_check_prepare_trace "calc.at:649"
   94244 ( $at_check_trace; cat stderr
   94245 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94246 at_status=$? at_failed=false
   94247 $at_check_filter
   94248 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94249 $at_diff expout "$at_stdout" || at_failed=:
   94250 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94251 $at_failed && at_fn_log_failure
   94252 $at_traceon; }
   94253 
   94254 
   94255 
   94256 # Exercise the error token: without it, we die at the first error,
   94257 # hence be sure to
   94258 #
   94259 # - have several errors which exercise different shift/discardings
   94260 #   - (): nothing to pop, nothing to discard
   94261 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   94262 #   - (* * *): nothing to pop, a lot to discard
   94263 #   - (1 + 2 * *): some to pop and discard
   94264 #
   94265 # - test the action associated to `error'
   94266 #
   94267 # - check the lookahead that triggers an error is not discarded
   94268 #   when we enter error recovery.  Below, the lookahead causing the
   94269 #   first error is ")", which is needed to recover from the error and
   94270 #   produce the "0" that triggers the "0 != 1" error.
   94271 #
   94272 cat >input <<'_ATEOF'
   94273 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   94274 _ATEOF
   94275 
   94276 { set +x
   94277 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   94278 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   94279 ( $at_check_trace;  $PREPARSER ./calc input
   94280 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94281 at_status=$? at_failed=false
   94282 $at_check_filter
   94283 echo stderr:; tee stderr <"$at_stderr"
   94284 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94285 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94286 $at_failed && at_fn_log_failure
   94287 $at_traceon; }
   94288 
   94289 { set +x
   94290 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94291 at_fn_check_prepare_trace "calc.at:649"
   94292 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94294 at_status=$? at_failed=false
   94295 $at_check_filter
   94296 echo stderr:; tee stderr <"$at_stderr"
   94297 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94298 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94299 $at_failed && at_fn_log_failure
   94300 $at_traceon; }
   94301 
   94302 
   94303 
   94304 # Normalize the observed and expected error messages, depending upon the
   94305 # options.
   94306 # 1. Remove the traces from observed.
   94307 sed '/^Starting/d
   94308 /^Entering/d
   94309 /^Stack/d
   94310 /^Reading/d
   94311 /^Reducing/d
   94312 /^Return/d
   94313 /^Shifting/d
   94314 /^state/d
   94315 /^Cleanup:/d
   94316 /^Error:/d
   94317 /^Next/d
   94318 /^Now/d
   94319 /^Discarding/d
   94320 / \$[0-9$]* = /d
   94321 /^yydestructor:/d' stderr >at-stderr
   94322 mv at-stderr stderr
   94323 # 2. Create the reference error message.
   94324 cat >expout <<'_ATEOF'
   94325 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   94326 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   94327 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   94328 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   94329 calc: error: 4444 != 1
   94330 _ATEOF
   94331 
   94332 # 3. If locations are not used, remove them.
   94333 
   94334 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94335 
   94336 # 5. Check
   94337 { set +x
   94338 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94339 at_fn_check_prepare_trace "calc.at:649"
   94340 ( $at_check_trace; cat stderr
   94341 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94342 at_status=$? at_failed=false
   94343 $at_check_filter
   94344 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94345 $at_diff expout "$at_stdout" || at_failed=:
   94346 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94347 $at_failed && at_fn_log_failure
   94348 $at_traceon; }
   94349 
   94350 
   94351 
   94352 # The same, but this time exercising explicitly triggered syntax errors.
   94353 # POSIX says the lookahead causing the error should not be discarded.
   94354 cat >input <<'_ATEOF'
   94355 (!) + (1 2) = 1
   94356 _ATEOF
   94357 
   94358 { set +x
   94359 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   94360 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   94361 ( $at_check_trace;  $PREPARSER ./calc input
   94362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94363 at_status=$? at_failed=false
   94364 $at_check_filter
   94365 echo stderr:; tee stderr <"$at_stderr"
   94366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94367 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94368 $at_failed && at_fn_log_failure
   94369 $at_traceon; }
   94370 
   94371 { set +x
   94372 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94373 at_fn_check_prepare_trace "calc.at:649"
   94374 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94376 at_status=$? at_failed=false
   94377 $at_check_filter
   94378 echo stderr:; tee stderr <"$at_stderr"
   94379 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94380 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94381 $at_failed && at_fn_log_failure
   94382 $at_traceon; }
   94383 
   94384 
   94385 
   94386 # Normalize the observed and expected error messages, depending upon the
   94387 # options.
   94388 # 1. Remove the traces from observed.
   94389 sed '/^Starting/d
   94390 /^Entering/d
   94391 /^Stack/d
   94392 /^Reading/d
   94393 /^Reducing/d
   94394 /^Return/d
   94395 /^Shifting/d
   94396 /^state/d
   94397 /^Cleanup:/d
   94398 /^Error:/d
   94399 /^Next/d
   94400 /^Now/d
   94401 /^Discarding/d
   94402 / \$[0-9$]* = /d
   94403 /^yydestructor:/d' stderr >at-stderr
   94404 mv at-stderr stderr
   94405 # 2. Create the reference error message.
   94406 cat >expout <<'_ATEOF'
   94407 1.10: syntax error, unexpected number
   94408 calc: error: 2222 != 1
   94409 _ATEOF
   94410 
   94411 # 3. If locations are not used, remove them.
   94412 
   94413 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94414 
   94415 # 5. Check
   94416 { set +x
   94417 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94418 at_fn_check_prepare_trace "calc.at:649"
   94419 ( $at_check_trace; cat stderr
   94420 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94421 at_status=$? at_failed=false
   94422 $at_check_filter
   94423 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94424 $at_diff expout "$at_stdout" || at_failed=:
   94425 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94426 $at_failed && at_fn_log_failure
   94427 $at_traceon; }
   94428 
   94429 
   94430 cat >input <<'_ATEOF'
   94431 (- *) + (1 2) = 1
   94432 _ATEOF
   94433 
   94434 { set +x
   94435 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   94436 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   94437 ( $at_check_trace;  $PREPARSER ./calc input
   94438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94439 at_status=$? at_failed=false
   94440 $at_check_filter
   94441 echo stderr:; tee stderr <"$at_stderr"
   94442 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94443 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94444 $at_failed && at_fn_log_failure
   94445 $at_traceon; }
   94446 
   94447 { set +x
   94448 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94449 at_fn_check_prepare_trace "calc.at:649"
   94450 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94451 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94452 at_status=$? at_failed=false
   94453 $at_check_filter
   94454 echo stderr:; tee stderr <"$at_stderr"
   94455 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94456 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94457 $at_failed && at_fn_log_failure
   94458 $at_traceon; }
   94459 
   94460 
   94461 
   94462 # Normalize the observed and expected error messages, depending upon the
   94463 # options.
   94464 # 1. Remove the traces from observed.
   94465 sed '/^Starting/d
   94466 /^Entering/d
   94467 /^Stack/d
   94468 /^Reading/d
   94469 /^Reducing/d
   94470 /^Return/d
   94471 /^Shifting/d
   94472 /^state/d
   94473 /^Cleanup:/d
   94474 /^Error:/d
   94475 /^Next/d
   94476 /^Now/d
   94477 /^Discarding/d
   94478 / \$[0-9$]* = /d
   94479 /^yydestructor:/d' stderr >at-stderr
   94480 mv at-stderr stderr
   94481 # 2. Create the reference error message.
   94482 cat >expout <<'_ATEOF'
   94483 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   94484 1.12: syntax error, unexpected number
   94485 calc: error: 2222 != 1
   94486 _ATEOF
   94487 
   94488 # 3. If locations are not used, remove them.
   94489 
   94490 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94491 
   94492 # 5. Check
   94493 { set +x
   94494 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94495 at_fn_check_prepare_trace "calc.at:649"
   94496 ( $at_check_trace; cat stderr
   94497 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94498 at_status=$? at_failed=false
   94499 $at_check_filter
   94500 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94501 $at_diff expout "$at_stdout" || at_failed=:
   94502 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94503 $at_failed && at_fn_log_failure
   94504 $at_traceon; }
   94505 
   94506 
   94507 
   94508 # Check that yyerrok works properly: second error is not reported,
   94509 # third and fourth are.  Parse status is succesfull.
   94510 cat >input <<'_ATEOF'
   94511 (* *) + (*) + (*)
   94512 _ATEOF
   94513 
   94514 { set +x
   94515 $as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
   94516 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
   94517 ( $at_check_trace;  $PREPARSER ./calc input
   94518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94519 at_status=$? at_failed=false
   94520 $at_check_filter
   94521 echo stderr:; tee stderr <"$at_stderr"
   94522 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94523 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94524 $at_failed && at_fn_log_failure
   94525 $at_traceon; }
   94526 
   94527 { set +x
   94528 $as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   94529 at_fn_check_prepare_trace "calc.at:649"
   94530 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   94531 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94532 at_status=$? at_failed=false
   94533 $at_check_filter
   94534 echo stderr:; tee stderr <"$at_stderr"
   94535 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94536 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94537 $at_failed && at_fn_log_failure
   94538 $at_traceon; }
   94539 
   94540 
   94541 
   94542 # Normalize the observed and expected error messages, depending upon the
   94543 # options.
   94544 # 1. Remove the traces from observed.
   94545 sed '/^Starting/d
   94546 /^Entering/d
   94547 /^Stack/d
   94548 /^Reading/d
   94549 /^Reducing/d
   94550 /^Return/d
   94551 /^Shifting/d
   94552 /^state/d
   94553 /^Cleanup:/d
   94554 /^Error:/d
   94555 /^Next/d
   94556 /^Now/d
   94557 /^Discarding/d
   94558 / \$[0-9$]* = /d
   94559 /^yydestructor:/d' stderr >at-stderr
   94560 mv at-stderr stderr
   94561 # 2. Create the reference error message.
   94562 cat >expout <<'_ATEOF'
   94563 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   94564 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   94565 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   94566 _ATEOF
   94567 
   94568 # 3. If locations are not used, remove them.
   94569 
   94570 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   94571 
   94572 # 5. Check
   94573 { set +x
   94574 $as_echo "$at_srcdir/calc.at:649: cat stderr"
   94575 at_fn_check_prepare_trace "calc.at:649"
   94576 ( $at_check_trace; cat stderr
   94577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94578 at_status=$? at_failed=false
   94579 $at_check_filter
   94580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94581 $at_diff expout "$at_stdout" || at_failed=:
   94582 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
   94583 $at_failed && at_fn_log_failure
   94584 $at_traceon; }
   94585 
   94586 
   94587 
   94588 
   94589 
   94590   set +x
   94591   $at_times_p && times >"$at_times_file"
   94592 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   94593 read at_status <"$at_status_file"
   94594 #AT_STOP_227
   94595 #AT_START_228
   94596 at_fn_group_banner 228 'calc.at:651' \
   94597   "Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
   94598 at_xfail=no
   94599 (
   94600   $as_echo "228. $at_setup_line: testing $at_desc ..."
   94601   $at_traceon
   94602 
   94603 
   94604 
   94605 
   94606 
   94607 
   94608 
   94609 
   94610 
   94611 
   94612 cat >calc.y <<'_ATEOF'
   94613 %code top {
   94614 #include <config.h>
   94615 /* We don't need perfect functions for these tests. */
   94616 #undef malloc
   94617 #undef memcmp
   94618 #undef realloc
   94619 }
   94620 
   94621 /* Infix notation calculator--calc */
   94622 %glr-parser %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc
   94623 
   94624 %code requires
   94625 {
   94626 
   94627   /* Exercise pre-prologue dependency to %union.  */
   94628   typedef int semantic_value;
   94629 }
   94630 
   94631 /* Exercise %union. */
   94632 %union
   94633 {
   94634   semantic_value ival;
   94635 };
   94636 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   94637 
   94638 %code provides
   94639 {
   94640   #include <stdio.h>
   94641   /* The input.  */
   94642   extern FILE *input;
   94643   extern semantic_value global_result;
   94644   extern int global_count;
   94645 }
   94646 
   94647 %code
   94648 {
   94649 #include <assert.h>
   94650 #include <string.h>
   94651 #define USE(Var)
   94652 
   94653 FILE *input;
   94654 static int power (int base, int exponent);
   94655 
   94656 static void calcerror ( const char *msg);
   94657 int calclex (void);
   94658 }
   94659 
   94660 
   94661 
   94662 /* Bison Declarations */
   94663 %token CALC_EOF 0 "end of input"
   94664 %token <ival> NUM "number"
   94665 %type  <ival> exp
   94666 
   94667 %nonassoc '=' /* comparison            */
   94668 %left '-' '+'
   94669 %left '*' '/'
   94670 %left NEG     /* negation--unary minus */
   94671 %right '^'    /* exponentiation        */
   94672 
   94673 /* Grammar follows */
   94674 %%
   94675 input:
   94676   line
   94677 | input line         {  }
   94678 ;
   94679 
   94680 line:
   94681   '\n'
   94682 | exp '\n'           { USE ($1); }
   94683 ;
   94684 
   94685 exp:
   94686   NUM                { $$ = $1;             }
   94687 | exp '=' exp
   94688   {
   94689     if ($1 != $3)
   94690       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   94691     $$ = $1;
   94692   }
   94693 | exp '+' exp        { $$ = $1 + $3;        }
   94694 | exp '-' exp        { $$ = $1 - $3;        }
   94695 | exp '*' exp        { $$ = $1 * $3;        }
   94696 | exp '/' exp        { $$ = $1 / $3;        }
   94697 | '-' exp  %prec NEG { $$ = -$2;            }
   94698 | exp '^' exp        { $$ = power ($1, $3); }
   94699 | '(' exp ')'        { $$ = $2;             }
   94700 | '(' error ')'      { $$ = 1111; yyerrok;  }
   94701 | '!'                { $$ = 0; YYERROR;     }
   94702 | '-' error          { $$ = 0; YYERROR;     }
   94703 ;
   94704 %%
   94705 
   94706 static int
   94707 power (int base, int exponent)
   94708 {
   94709   int res = 1;
   94710   assert (0 <= exponent);
   94711   for (/* Niente */; exponent; --exponent)
   94712     res *= base;
   94713   return res;
   94714 }
   94715 
   94716 
   94717 #include <stdio.h>
   94718 /* A C error reporting function.  */
   94719 static
   94720 void calcerror ( const char *msg)
   94721 {
   94722   YY_LOCATION_PRINT (stderr, (calclloc));
   94723   fprintf (stderr, ": ");
   94724   fprintf (stderr, "%s\n", msg);
   94725 }
   94726 _ATEOF
   94727 
   94728 
   94729 
   94730 cat >calc-lex.c <<'_ATEOF'
   94731 #include <config.h>
   94732 /* We don't need perfect functions for these tests. */
   94733 #undef malloc
   94734 #undef memcmp
   94735 #undef realloc
   94736 
   94737 #include "calc.h"
   94738 
   94739 #include <ctype.h>
   94740 
   94741 int calclex (void);
   94742 static int get_char (void);
   94743 static void unget_char ( int c);
   94744 
   94745 
   94746 static YYLTYPE last_yylloc;
   94747 
   94748 static int
   94749 get_char (void)
   94750 {
   94751   int res = getc (input);
   94752   ;
   94753 
   94754   last_yylloc = (calclloc);
   94755   if (res == '\n')
   94756     {
   94757       (calclloc).last_line++;
   94758       (calclloc).last_column = 1;
   94759     }
   94760   else
   94761     (calclloc).last_column++;
   94762 
   94763   return res;
   94764 }
   94765 
   94766 static void
   94767 unget_char ( int c)
   94768 {
   94769   ;
   94770 
   94771   /* Wrong when C == `\n'. */
   94772   (calclloc) = last_yylloc;
   94773 
   94774   ungetc (c, input);
   94775 }
   94776 
   94777 static int
   94778 read_signed_integer (void)
   94779 {
   94780   int c = get_char ();
   94781   int sign = 1;
   94782   int n = 0;
   94783 
   94784   ;
   94785   if (c == '-')
   94786     {
   94787       c = get_char ();
   94788       sign = -1;
   94789     }
   94790 
   94791   while (isdigit (c))
   94792     {
   94793       n = 10 * n + (c - '0');
   94794       c = get_char ();
   94795     }
   94796 
   94797   unget_char ( c);
   94798 
   94799   return sign * n;
   94800 }
   94801 
   94802 
   94803 /*---------------------------------------------------------------.
   94804 | Lexical analyzer returns an integer on the stack and the token |
   94805 | NUM, or the ASCII character read if not a number.  Skips all   |
   94806 | blanks and tabs, returns 0 for EOF.                            |
   94807 `---------------------------------------------------------------*/
   94808 
   94809 int calclex (void)
   94810 {
   94811   int c;
   94812   /* Skip current token, then white spaces.  */
   94813   do
   94814     {
   94815      (calclloc).first_column = (calclloc).last_column;
   94816       (calclloc).first_line   = (calclloc).last_line;
   94817 
   94818     }
   94819   while ((c = get_char ()) == ' ' || c == '\t');
   94820 
   94821   /* process numbers   */
   94822   if (c == '.' || isdigit (c))
   94823     {
   94824       unget_char ( c);
   94825       (calclval).ival = read_signed_integer ();
   94826       return NUM;
   94827     }
   94828 
   94829   /* Return end-of-file.  */
   94830   if (c == EOF)
   94831     return CALC_EOF;
   94832 
   94833   /* Return single chars. */
   94834   return c;
   94835 }
   94836 _ATEOF
   94837 
   94838 
   94839 cat >calc-main.c <<'_ATEOF'
   94840 #include <config.h>
   94841 /* We don't need perfect functions for these tests. */
   94842 #undef malloc
   94843 #undef memcmp
   94844 #undef realloc
   94845 
   94846 #include "calc.h"
   94847 
   94848 #include <assert.h>
   94849 #if HAVE_UNISTD_H
   94850 # include <unistd.h>
   94851 #else
   94852 # undef alarm
   94853 # define alarm(seconds) /* empty */
   94854 #endif
   94855 
   94856 
   94857 
   94858 semantic_value global_result = 0;
   94859 int global_count = 0;
   94860 
   94861 /* A C main function.  */
   94862 int
   94863 main (int argc, const char **argv)
   94864 {
   94865   semantic_value result = 0;
   94866   int count = 0;
   94867   int status;
   94868 
   94869   /* This used to be alarm (10), but that isn't enough time for
   94870      a July 1995 vintage DEC Alphastation 200 4/100 system,
   94871      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   94872   alarm (100);
   94873 
   94874   if (argc == 2)
   94875     input = fopen (argv[1], "r");
   94876   else
   94877     input = stdin;
   94878 
   94879   if (!input)
   94880     {
   94881       perror (argv[1]);
   94882       return 3;
   94883     }
   94884 
   94885 
   94886   status = calcparse ();
   94887   if (fclose (input))
   94888     perror ("fclose");
   94889   assert (global_result == result);
   94890   assert (global_count == count);
   94891   return status;
   94892 }
   94893 _ATEOF
   94894 
   94895 
   94896 
   94897 
   94898 
   94899 
   94900 
   94901 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   94902   at_save_special_files
   94903   mkdir xml-tests
   94904     # Don't combine these Bison invocations since we want to be sure that
   94905   # --report=all isn't required to get the full XML file.
   94906   { set +x
   94907 $as_echo "$at_srcdir/calc.at:651: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   94908                   --graph=xml-tests/test.dot -o calc.c calc.y"
   94909 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651"
   94910 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   94911                   --graph=xml-tests/test.dot -o calc.c calc.y
   94912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94913 at_status=$? at_failed=false
   94914 $at_check_filter
   94915 echo stderr:; cat "$at_stderr"
   94916 echo stdout:; cat "$at_stdout"
   94917 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   94918 $at_failed && at_fn_log_failure
   94919 $at_traceon; }
   94920 
   94921   { set +x
   94922 $as_echo "$at_srcdir/calc.at:651: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   94923 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:651"
   94924 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   94925 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94926 at_status=$? at_failed=false
   94927 $at_check_filter
   94928 echo stderr:; cat "$at_stderr"
   94929 echo stdout:; cat "$at_stdout"
   94930 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   94931 $at_failed && at_fn_log_failure
   94932 $at_traceon; }
   94933 
   94934     cp xml-tests/test.output expout
   94935   { set +x
   94936 $as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\
   94937              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   94938              xml-tests/test.xml"
   94939 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651"
   94940 ( $at_check_trace; $XSLTPROC \
   94941              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   94942              xml-tests/test.xml
   94943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94944 at_status=$? at_failed=false
   94945 $at_check_filter
   94946 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94947 $at_diff expout "$at_stdout" || at_failed=:
   94948 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   94949 $at_failed && at_fn_log_failure
   94950 $at_traceon; }
   94951 
   94952   sort xml-tests/test.dot > expout
   94953   { set +x
   94954 $as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\
   94955              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   94956              xml-tests/test.xml | sort"
   94957 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651"
   94958 ( $at_check_trace; $XSLTPROC \
   94959              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   94960              xml-tests/test.xml | sort
   94961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94962 at_status=$? at_failed=false
   94963 $at_check_filter
   94964 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94965 $at_diff expout "$at_stdout" || at_failed=:
   94966 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   94967 $at_failed && at_fn_log_failure
   94968 $at_traceon; }
   94969 
   94970   rm -rf xml-tests expout
   94971   at_restore_special_files
   94972 fi
   94973 { set +x
   94974 $as_echo "$at_srcdir/calc.at:651: bison -o calc.c calc.y"
   94975 at_fn_check_prepare_trace "calc.at:651"
   94976 ( $at_check_trace; bison -o calc.c calc.y
   94977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94978 at_status=$? at_failed=false
   94979 $at_check_filter
   94980 at_fn_diff_devnull "$at_stderr" || at_failed=:
   94981 at_fn_diff_devnull "$at_stdout" || at_failed=:
   94982 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   94983 $at_failed && at_fn_log_failure
   94984 $at_traceon; }
   94985 
   94986 
   94987    { set +x
   94988 $as_echo "$at_srcdir/calc.at:651: \$BISON_C_WORKS"
   94989 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:651"
   94990 ( $at_check_trace; $BISON_C_WORKS
   94991 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   94992 at_status=$? at_failed=false
   94993 $at_check_filter
   94994 echo stderr:; cat "$at_stderr"
   94995 echo stdout:; cat "$at_stdout"
   94996 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   94997 $at_failed && at_fn_log_failure
   94998 $at_traceon; }
   94999 
   95000 { set +x
   95001 $as_echo "$at_srcdir/calc.at:651: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   95002 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:651"
   95003 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   95004 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95005 at_status=$? at_failed=false
   95006 $at_check_filter
   95007 echo stderr:; cat "$at_stderr"
   95008 echo stdout:; cat "$at_stdout"
   95009 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95010 $at_failed && at_fn_log_failure
   95011 $at_traceon; }
   95012 
   95013 
   95014 { set +x
   95015 $as_echo "$at_srcdir/calc.at:651: \$PERL -ne '
   95016   chomp;
   95017   print \"\$.: {\$_}\\n\"
   95018     if (# No starting/ending empty lines.
   95019         (eof || \$. == 1) && /^\\s*\$/
   95020         # No trailing space.  FIXME: not ready for \"maint\".
   95021         # || /\\s\$/
   95022         )' calc.c
   95023 "
   95024 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651"
   95025 ( $at_check_trace; $PERL -ne '
   95026   chomp;
   95027   print "$.: {$_}\n"
   95028     if (# No starting/ending empty lines.
   95029         (eof || $. == 1) && /^\s*$/
   95030         # No trailing space.  FIXME: not ready for "maint".
   95031         # || /\s$/
   95032         )' calc.c
   95033 
   95034 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95035 at_status=$? at_failed=false
   95036 $at_check_filter
   95037 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95038 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95039 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95040 $at_failed && at_fn_log_failure
   95041 $at_traceon; }
   95042 
   95043 { set +x
   95044 $as_echo "$at_srcdir/calc.at:651: \$PERL -ne '
   95045   chomp;
   95046   print \"\$.: {\$_}\\n\"
   95047     if (# No starting/ending empty lines.
   95048         (eof || \$. == 1) && /^\\s*\$/
   95049         # No trailing space.  FIXME: not ready for \"maint\".
   95050         # || /\\s\$/
   95051         )' calc.h
   95052 "
   95053 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651"
   95054 ( $at_check_trace; $PERL -ne '
   95055   chomp;
   95056   print "$.: {$_}\n"
   95057     if (# No starting/ending empty lines.
   95058         (eof || $. == 1) && /^\s*$/
   95059         # No trailing space.  FIXME: not ready for "maint".
   95060         # || /\s$/
   95061         )' calc.h
   95062 
   95063 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95064 at_status=$? at_failed=false
   95065 $at_check_filter
   95066 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95067 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95068 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95069 $at_failed && at_fn_log_failure
   95070 $at_traceon; }
   95071 
   95072 
   95073 # Test the priorities.
   95074 cat >input <<'_ATEOF'
   95075 1 + 2 * 3 = 7
   95076 1 + 2 * -3 = -5
   95077 
   95078 -1^2 = -1
   95079 (-1)^2 = 1
   95080 
   95081 ---1 = -1
   95082 
   95083 1 - 2 - 3 = -4
   95084 1 - (2 - 3) = 2
   95085 
   95086 2^2^3 = 256
   95087 (2^2)^3 = 64
   95088 _ATEOF
   95089 
   95090 { set +x
   95091 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95092 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95093 ( $at_check_trace;  $PREPARSER ./calc input
   95094 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95095 at_status=$? at_failed=false
   95096 $at_check_filter
   95097 echo stderr:; tee stderr <"$at_stderr"
   95098 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95099 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95100 $at_failed && at_fn_log_failure
   95101 $at_traceon; }
   95102 
   95103 { set +x
   95104 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95105 at_fn_check_prepare_trace "calc.at:651"
   95106 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95108 at_status=$? at_failed=false
   95109 $at_check_filter
   95110 echo stderr:; tee stderr <"$at_stderr"
   95111 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95112 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95113 $at_failed && at_fn_log_failure
   95114 $at_traceon; }
   95115 
   95116 
   95117 
   95118 
   95119 # Some syntax errors.
   95120 cat >input <<'_ATEOF'
   95121 1 2
   95122 _ATEOF
   95123 
   95124 { set +x
   95125 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95126 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95127 ( $at_check_trace;  $PREPARSER ./calc input
   95128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95129 at_status=$? at_failed=false
   95130 $at_check_filter
   95131 echo stderr:; tee stderr <"$at_stderr"
   95132 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95133 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
   95134 $at_failed && at_fn_log_failure
   95135 $at_traceon; }
   95136 
   95137 { set +x
   95138 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95139 at_fn_check_prepare_trace "calc.at:651"
   95140 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95141 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95142 at_status=$? at_failed=false
   95143 $at_check_filter
   95144 echo stderr:; tee stderr <"$at_stderr"
   95145 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95146 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95147 $at_failed && at_fn_log_failure
   95148 $at_traceon; }
   95149 
   95150 
   95151 
   95152 # Normalize the observed and expected error messages, depending upon the
   95153 # options.
   95154 # 1. Remove the traces from observed.
   95155 sed '/^Starting/d
   95156 /^Entering/d
   95157 /^Stack/d
   95158 /^Reading/d
   95159 /^Reducing/d
   95160 /^Return/d
   95161 /^Shifting/d
   95162 /^state/d
   95163 /^Cleanup:/d
   95164 /^Error:/d
   95165 /^Next/d
   95166 /^Now/d
   95167 /^Discarding/d
   95168 / \$[0-9$]* = /d
   95169 /^yydestructor:/d' stderr >at-stderr
   95170 mv at-stderr stderr
   95171 # 2. Create the reference error message.
   95172 cat >expout <<'_ATEOF'
   95173 1.3: syntax error, unexpected number
   95174 _ATEOF
   95175 
   95176 # 3. If locations are not used, remove them.
   95177 
   95178 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95179 
   95180 # 5. Check
   95181 { set +x
   95182 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95183 at_fn_check_prepare_trace "calc.at:651"
   95184 ( $at_check_trace; cat stderr
   95185 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95186 at_status=$? at_failed=false
   95187 $at_check_filter
   95188 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95189 $at_diff expout "$at_stdout" || at_failed=:
   95190 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95191 $at_failed && at_fn_log_failure
   95192 $at_traceon; }
   95193 
   95194 
   95195 cat >input <<'_ATEOF'
   95196 1//2
   95197 _ATEOF
   95198 
   95199 { set +x
   95200 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95201 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95202 ( $at_check_trace;  $PREPARSER ./calc input
   95203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95204 at_status=$? at_failed=false
   95205 $at_check_filter
   95206 echo stderr:; tee stderr <"$at_stderr"
   95207 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95208 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
   95209 $at_failed && at_fn_log_failure
   95210 $at_traceon; }
   95211 
   95212 { set +x
   95213 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95214 at_fn_check_prepare_trace "calc.at:651"
   95215 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95217 at_status=$? at_failed=false
   95218 $at_check_filter
   95219 echo stderr:; tee stderr <"$at_stderr"
   95220 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95221 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95222 $at_failed && at_fn_log_failure
   95223 $at_traceon; }
   95224 
   95225 
   95226 
   95227 # Normalize the observed and expected error messages, depending upon the
   95228 # options.
   95229 # 1. Remove the traces from observed.
   95230 sed '/^Starting/d
   95231 /^Entering/d
   95232 /^Stack/d
   95233 /^Reading/d
   95234 /^Reducing/d
   95235 /^Return/d
   95236 /^Shifting/d
   95237 /^state/d
   95238 /^Cleanup:/d
   95239 /^Error:/d
   95240 /^Next/d
   95241 /^Now/d
   95242 /^Discarding/d
   95243 / \$[0-9$]* = /d
   95244 /^yydestructor:/d' stderr >at-stderr
   95245 mv at-stderr stderr
   95246 # 2. Create the reference error message.
   95247 cat >expout <<'_ATEOF'
   95248 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   95249 _ATEOF
   95250 
   95251 # 3. If locations are not used, remove them.
   95252 
   95253 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95254 
   95255 # 5. Check
   95256 { set +x
   95257 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95258 at_fn_check_prepare_trace "calc.at:651"
   95259 ( $at_check_trace; cat stderr
   95260 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95261 at_status=$? at_failed=false
   95262 $at_check_filter
   95263 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95264 $at_diff expout "$at_stdout" || at_failed=:
   95265 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95266 $at_failed && at_fn_log_failure
   95267 $at_traceon; }
   95268 
   95269 
   95270 cat >input <<'_ATEOF'
   95271 error
   95272 _ATEOF
   95273 
   95274 { set +x
   95275 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95276 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95277 ( $at_check_trace;  $PREPARSER ./calc input
   95278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95279 at_status=$? at_failed=false
   95280 $at_check_filter
   95281 echo stderr:; tee stderr <"$at_stderr"
   95282 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95283 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
   95284 $at_failed && at_fn_log_failure
   95285 $at_traceon; }
   95286 
   95287 { set +x
   95288 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95289 at_fn_check_prepare_trace "calc.at:651"
   95290 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95292 at_status=$? at_failed=false
   95293 $at_check_filter
   95294 echo stderr:; tee stderr <"$at_stderr"
   95295 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95296 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95297 $at_failed && at_fn_log_failure
   95298 $at_traceon; }
   95299 
   95300 
   95301 
   95302 # Normalize the observed and expected error messages, depending upon the
   95303 # options.
   95304 # 1. Remove the traces from observed.
   95305 sed '/^Starting/d
   95306 /^Entering/d
   95307 /^Stack/d
   95308 /^Reading/d
   95309 /^Reducing/d
   95310 /^Return/d
   95311 /^Shifting/d
   95312 /^state/d
   95313 /^Cleanup:/d
   95314 /^Error:/d
   95315 /^Next/d
   95316 /^Now/d
   95317 /^Discarding/d
   95318 / \$[0-9$]* = /d
   95319 /^yydestructor:/d' stderr >at-stderr
   95320 mv at-stderr stderr
   95321 # 2. Create the reference error message.
   95322 cat >expout <<'_ATEOF'
   95323 1.1: syntax error, unexpected $undefined
   95324 _ATEOF
   95325 
   95326 # 3. If locations are not used, remove them.
   95327 
   95328 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95329 
   95330 # 5. Check
   95331 { set +x
   95332 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95333 at_fn_check_prepare_trace "calc.at:651"
   95334 ( $at_check_trace; cat stderr
   95335 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95336 at_status=$? at_failed=false
   95337 $at_check_filter
   95338 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95339 $at_diff expout "$at_stdout" || at_failed=:
   95340 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95341 $at_failed && at_fn_log_failure
   95342 $at_traceon; }
   95343 
   95344 
   95345 cat >input <<'_ATEOF'
   95346 1 = 2 = 3
   95347 _ATEOF
   95348 
   95349 { set +x
   95350 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95351 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95352 ( $at_check_trace;  $PREPARSER ./calc input
   95353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95354 at_status=$? at_failed=false
   95355 $at_check_filter
   95356 echo stderr:; tee stderr <"$at_stderr"
   95357 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95358 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
   95359 $at_failed && at_fn_log_failure
   95360 $at_traceon; }
   95361 
   95362 { set +x
   95363 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95364 at_fn_check_prepare_trace "calc.at:651"
   95365 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95366 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95367 at_status=$? at_failed=false
   95368 $at_check_filter
   95369 echo stderr:; tee stderr <"$at_stderr"
   95370 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95371 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95372 $at_failed && at_fn_log_failure
   95373 $at_traceon; }
   95374 
   95375 
   95376 
   95377 # Normalize the observed and expected error messages, depending upon the
   95378 # options.
   95379 # 1. Remove the traces from observed.
   95380 sed '/^Starting/d
   95381 /^Entering/d
   95382 /^Stack/d
   95383 /^Reading/d
   95384 /^Reducing/d
   95385 /^Return/d
   95386 /^Shifting/d
   95387 /^state/d
   95388 /^Cleanup:/d
   95389 /^Error:/d
   95390 /^Next/d
   95391 /^Now/d
   95392 /^Discarding/d
   95393 / \$[0-9$]* = /d
   95394 /^yydestructor:/d' stderr >at-stderr
   95395 mv at-stderr stderr
   95396 # 2. Create the reference error message.
   95397 cat >expout <<'_ATEOF'
   95398 1.7: syntax error, unexpected '='
   95399 _ATEOF
   95400 
   95401 # 3. If locations are not used, remove them.
   95402 
   95403 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95404 
   95405 # 5. Check
   95406 { set +x
   95407 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95408 at_fn_check_prepare_trace "calc.at:651"
   95409 ( $at_check_trace; cat stderr
   95410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95411 at_status=$? at_failed=false
   95412 $at_check_filter
   95413 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95414 $at_diff expout "$at_stdout" || at_failed=:
   95415 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95416 $at_failed && at_fn_log_failure
   95417 $at_traceon; }
   95418 
   95419 
   95420 cat >input <<'_ATEOF'
   95421 
   95422 +1
   95423 _ATEOF
   95424 
   95425 { set +x
   95426 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95427 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95428 ( $at_check_trace;  $PREPARSER ./calc input
   95429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95430 at_status=$? at_failed=false
   95431 $at_check_filter
   95432 echo stderr:; tee stderr <"$at_stderr"
   95433 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95434 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
   95435 $at_failed && at_fn_log_failure
   95436 $at_traceon; }
   95437 
   95438 { set +x
   95439 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95440 at_fn_check_prepare_trace "calc.at:651"
   95441 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95443 at_status=$? at_failed=false
   95444 $at_check_filter
   95445 echo stderr:; tee stderr <"$at_stderr"
   95446 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95447 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95448 $at_failed && at_fn_log_failure
   95449 $at_traceon; }
   95450 
   95451 
   95452 
   95453 # Normalize the observed and expected error messages, depending upon the
   95454 # options.
   95455 # 1. Remove the traces from observed.
   95456 sed '/^Starting/d
   95457 /^Entering/d
   95458 /^Stack/d
   95459 /^Reading/d
   95460 /^Reducing/d
   95461 /^Return/d
   95462 /^Shifting/d
   95463 /^state/d
   95464 /^Cleanup:/d
   95465 /^Error:/d
   95466 /^Next/d
   95467 /^Now/d
   95468 /^Discarding/d
   95469 / \$[0-9$]* = /d
   95470 /^yydestructor:/d' stderr >at-stderr
   95471 mv at-stderr stderr
   95472 # 2. Create the reference error message.
   95473 cat >expout <<'_ATEOF'
   95474 2.1: syntax error, unexpected '+'
   95475 _ATEOF
   95476 
   95477 # 3. If locations are not used, remove them.
   95478 
   95479 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95480 
   95481 # 5. Check
   95482 { set +x
   95483 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95484 at_fn_check_prepare_trace "calc.at:651"
   95485 ( $at_check_trace; cat stderr
   95486 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95487 at_status=$? at_failed=false
   95488 $at_check_filter
   95489 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95490 $at_diff expout "$at_stdout" || at_failed=:
   95491 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95492 $at_failed && at_fn_log_failure
   95493 $at_traceon; }
   95494 
   95495 
   95496 # Exercise error messages with EOF: work on an empty file.
   95497 { set +x
   95498 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc /dev/null"
   95499 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:651"
   95500 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   95501 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95502 at_status=$? at_failed=false
   95503 $at_check_filter
   95504 echo stderr:; tee stderr <"$at_stderr"
   95505 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95506 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
   95507 $at_failed && at_fn_log_failure
   95508 $at_traceon; }
   95509 
   95510 { set +x
   95511 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95512 at_fn_check_prepare_trace "calc.at:651"
   95513 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95514 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95515 at_status=$? at_failed=false
   95516 $at_check_filter
   95517 echo stderr:; tee stderr <"$at_stderr"
   95518 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95519 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95520 $at_failed && at_fn_log_failure
   95521 $at_traceon; }
   95522 
   95523 
   95524 
   95525 # Normalize the observed and expected error messages, depending upon the
   95526 # options.
   95527 # 1. Remove the traces from observed.
   95528 sed '/^Starting/d
   95529 /^Entering/d
   95530 /^Stack/d
   95531 /^Reading/d
   95532 /^Reducing/d
   95533 /^Return/d
   95534 /^Shifting/d
   95535 /^state/d
   95536 /^Cleanup:/d
   95537 /^Error:/d
   95538 /^Next/d
   95539 /^Now/d
   95540 /^Discarding/d
   95541 / \$[0-9$]* = /d
   95542 /^yydestructor:/d' stderr >at-stderr
   95543 mv at-stderr stderr
   95544 # 2. Create the reference error message.
   95545 cat >expout <<'_ATEOF'
   95546 1.1: syntax error, unexpected end of input
   95547 _ATEOF
   95548 
   95549 # 3. If locations are not used, remove them.
   95550 
   95551 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95552 
   95553 # 5. Check
   95554 { set +x
   95555 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95556 at_fn_check_prepare_trace "calc.at:651"
   95557 ( $at_check_trace; cat stderr
   95558 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95559 at_status=$? at_failed=false
   95560 $at_check_filter
   95561 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95562 $at_diff expout "$at_stdout" || at_failed=:
   95563 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95564 $at_failed && at_fn_log_failure
   95565 $at_traceon; }
   95566 
   95567 
   95568 
   95569 # Exercise the error token: without it, we die at the first error,
   95570 # hence be sure to
   95571 #
   95572 # - have several errors which exercise different shift/discardings
   95573 #   - (): nothing to pop, nothing to discard
   95574 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   95575 #   - (* * *): nothing to pop, a lot to discard
   95576 #   - (1 + 2 * *): some to pop and discard
   95577 #
   95578 # - test the action associated to `error'
   95579 #
   95580 # - check the lookahead that triggers an error is not discarded
   95581 #   when we enter error recovery.  Below, the lookahead causing the
   95582 #   first error is ")", which is needed to recover from the error and
   95583 #   produce the "0" that triggers the "0 != 1" error.
   95584 #
   95585 cat >input <<'_ATEOF'
   95586 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   95587 _ATEOF
   95588 
   95589 { set +x
   95590 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95591 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95592 ( $at_check_trace;  $PREPARSER ./calc input
   95593 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95594 at_status=$? at_failed=false
   95595 $at_check_filter
   95596 echo stderr:; tee stderr <"$at_stderr"
   95597 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95598 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95599 $at_failed && at_fn_log_failure
   95600 $at_traceon; }
   95601 
   95602 { set +x
   95603 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95604 at_fn_check_prepare_trace "calc.at:651"
   95605 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95607 at_status=$? at_failed=false
   95608 $at_check_filter
   95609 echo stderr:; tee stderr <"$at_stderr"
   95610 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95611 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95612 $at_failed && at_fn_log_failure
   95613 $at_traceon; }
   95614 
   95615 
   95616 
   95617 # Normalize the observed and expected error messages, depending upon the
   95618 # options.
   95619 # 1. Remove the traces from observed.
   95620 sed '/^Starting/d
   95621 /^Entering/d
   95622 /^Stack/d
   95623 /^Reading/d
   95624 /^Reducing/d
   95625 /^Return/d
   95626 /^Shifting/d
   95627 /^state/d
   95628 /^Cleanup:/d
   95629 /^Error:/d
   95630 /^Next/d
   95631 /^Now/d
   95632 /^Discarding/d
   95633 / \$[0-9$]* = /d
   95634 /^yydestructor:/d' stderr >at-stderr
   95635 mv at-stderr stderr
   95636 # 2. Create the reference error message.
   95637 cat >expout <<'_ATEOF'
   95638 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   95639 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   95640 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   95641 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   95642 calc: error: 4444 != 1
   95643 _ATEOF
   95644 
   95645 # 3. If locations are not used, remove them.
   95646 
   95647 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95648 
   95649 # 5. Check
   95650 { set +x
   95651 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95652 at_fn_check_prepare_trace "calc.at:651"
   95653 ( $at_check_trace; cat stderr
   95654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95655 at_status=$? at_failed=false
   95656 $at_check_filter
   95657 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95658 $at_diff expout "$at_stdout" || at_failed=:
   95659 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95660 $at_failed && at_fn_log_failure
   95661 $at_traceon; }
   95662 
   95663 
   95664 
   95665 # The same, but this time exercising explicitly triggered syntax errors.
   95666 # POSIX says the lookahead causing the error should not be discarded.
   95667 cat >input <<'_ATEOF'
   95668 (!) + (1 2) = 1
   95669 _ATEOF
   95670 
   95671 { set +x
   95672 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95673 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95674 ( $at_check_trace;  $PREPARSER ./calc input
   95675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95676 at_status=$? at_failed=false
   95677 $at_check_filter
   95678 echo stderr:; tee stderr <"$at_stderr"
   95679 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95680 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95681 $at_failed && at_fn_log_failure
   95682 $at_traceon; }
   95683 
   95684 { set +x
   95685 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95686 at_fn_check_prepare_trace "calc.at:651"
   95687 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95689 at_status=$? at_failed=false
   95690 $at_check_filter
   95691 echo stderr:; tee stderr <"$at_stderr"
   95692 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95693 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95694 $at_failed && at_fn_log_failure
   95695 $at_traceon; }
   95696 
   95697 
   95698 
   95699 # Normalize the observed and expected error messages, depending upon the
   95700 # options.
   95701 # 1. Remove the traces from observed.
   95702 sed '/^Starting/d
   95703 /^Entering/d
   95704 /^Stack/d
   95705 /^Reading/d
   95706 /^Reducing/d
   95707 /^Return/d
   95708 /^Shifting/d
   95709 /^state/d
   95710 /^Cleanup:/d
   95711 /^Error:/d
   95712 /^Next/d
   95713 /^Now/d
   95714 /^Discarding/d
   95715 / \$[0-9$]* = /d
   95716 /^yydestructor:/d' stderr >at-stderr
   95717 mv at-stderr stderr
   95718 # 2. Create the reference error message.
   95719 cat >expout <<'_ATEOF'
   95720 1.10: syntax error, unexpected number
   95721 calc: error: 2222 != 1
   95722 _ATEOF
   95723 
   95724 # 3. If locations are not used, remove them.
   95725 
   95726 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95727 
   95728 # 5. Check
   95729 { set +x
   95730 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95731 at_fn_check_prepare_trace "calc.at:651"
   95732 ( $at_check_trace; cat stderr
   95733 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95734 at_status=$? at_failed=false
   95735 $at_check_filter
   95736 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95737 $at_diff expout "$at_stdout" || at_failed=:
   95738 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95739 $at_failed && at_fn_log_failure
   95740 $at_traceon; }
   95741 
   95742 
   95743 cat >input <<'_ATEOF'
   95744 (- *) + (1 2) = 1
   95745 _ATEOF
   95746 
   95747 { set +x
   95748 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95749 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95750 ( $at_check_trace;  $PREPARSER ./calc input
   95751 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95752 at_status=$? at_failed=false
   95753 $at_check_filter
   95754 echo stderr:; tee stderr <"$at_stderr"
   95755 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95756 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95757 $at_failed && at_fn_log_failure
   95758 $at_traceon; }
   95759 
   95760 { set +x
   95761 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95762 at_fn_check_prepare_trace "calc.at:651"
   95763 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95764 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95765 at_status=$? at_failed=false
   95766 $at_check_filter
   95767 echo stderr:; tee stderr <"$at_stderr"
   95768 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95769 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95770 $at_failed && at_fn_log_failure
   95771 $at_traceon; }
   95772 
   95773 
   95774 
   95775 # Normalize the observed and expected error messages, depending upon the
   95776 # options.
   95777 # 1. Remove the traces from observed.
   95778 sed '/^Starting/d
   95779 /^Entering/d
   95780 /^Stack/d
   95781 /^Reading/d
   95782 /^Reducing/d
   95783 /^Return/d
   95784 /^Shifting/d
   95785 /^state/d
   95786 /^Cleanup:/d
   95787 /^Error:/d
   95788 /^Next/d
   95789 /^Now/d
   95790 /^Discarding/d
   95791 / \$[0-9$]* = /d
   95792 /^yydestructor:/d' stderr >at-stderr
   95793 mv at-stderr stderr
   95794 # 2. Create the reference error message.
   95795 cat >expout <<'_ATEOF'
   95796 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   95797 1.12: syntax error, unexpected number
   95798 calc: error: 2222 != 1
   95799 _ATEOF
   95800 
   95801 # 3. If locations are not used, remove them.
   95802 
   95803 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95804 
   95805 # 5. Check
   95806 { set +x
   95807 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95808 at_fn_check_prepare_trace "calc.at:651"
   95809 ( $at_check_trace; cat stderr
   95810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95811 at_status=$? at_failed=false
   95812 $at_check_filter
   95813 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95814 $at_diff expout "$at_stdout" || at_failed=:
   95815 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95816 $at_failed && at_fn_log_failure
   95817 $at_traceon; }
   95818 
   95819 
   95820 
   95821 # Check that yyerrok works properly: second error is not reported,
   95822 # third and fourth are.  Parse status is succesfull.
   95823 cat >input <<'_ATEOF'
   95824 (* *) + (*) + (*)
   95825 _ATEOF
   95826 
   95827 { set +x
   95828 $as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
   95829 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
   95830 ( $at_check_trace;  $PREPARSER ./calc input
   95831 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95832 at_status=$? at_failed=false
   95833 $at_check_filter
   95834 echo stderr:; tee stderr <"$at_stderr"
   95835 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95836 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95837 $at_failed && at_fn_log_failure
   95838 $at_traceon; }
   95839 
   95840 { set +x
   95841 $as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   95842 at_fn_check_prepare_trace "calc.at:651"
   95843 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   95844 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95845 at_status=$? at_failed=false
   95846 $at_check_filter
   95847 echo stderr:; tee stderr <"$at_stderr"
   95848 at_fn_diff_devnull "$at_stdout" || at_failed=:
   95849 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95850 $at_failed && at_fn_log_failure
   95851 $at_traceon; }
   95852 
   95853 
   95854 
   95855 # Normalize the observed and expected error messages, depending upon the
   95856 # options.
   95857 # 1. Remove the traces from observed.
   95858 sed '/^Starting/d
   95859 /^Entering/d
   95860 /^Stack/d
   95861 /^Reading/d
   95862 /^Reducing/d
   95863 /^Return/d
   95864 /^Shifting/d
   95865 /^state/d
   95866 /^Cleanup:/d
   95867 /^Error:/d
   95868 /^Next/d
   95869 /^Now/d
   95870 /^Discarding/d
   95871 / \$[0-9$]* = /d
   95872 /^yydestructor:/d' stderr >at-stderr
   95873 mv at-stderr stderr
   95874 # 2. Create the reference error message.
   95875 cat >expout <<'_ATEOF'
   95876 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   95877 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   95878 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   95879 _ATEOF
   95880 
   95881 # 3. If locations are not used, remove them.
   95882 
   95883 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   95884 
   95885 # 5. Check
   95886 { set +x
   95887 $as_echo "$at_srcdir/calc.at:651: cat stderr"
   95888 at_fn_check_prepare_trace "calc.at:651"
   95889 ( $at_check_trace; cat stderr
   95890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   95891 at_status=$? at_failed=false
   95892 $at_check_filter
   95893 at_fn_diff_devnull "$at_stderr" || at_failed=:
   95894 $at_diff expout "$at_stdout" || at_failed=:
   95895 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
   95896 $at_failed && at_fn_log_failure
   95897 $at_traceon; }
   95898 
   95899 
   95900 
   95901 
   95902 
   95903   set +x
   95904   $at_times_p && times >"$at_times_file"
   95905 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   95906 read at_status <"$at_status_file"
   95907 #AT_STOP_228
   95908 #AT_START_229
   95909 at_fn_group_banner 229 'calc.at:653' \
   95910   "Calculator %glr-parser %debug" "                  " 12
   95911 at_xfail=no
   95912 (
   95913   $as_echo "229. $at_setup_line: testing $at_desc ..."
   95914   $at_traceon
   95915 
   95916 
   95917 
   95918 
   95919 
   95920 
   95921 
   95922 
   95923 
   95924 
   95925 cat >calc.y <<'_ATEOF'
   95926 %code top {
   95927 #include <config.h>
   95928 /* We don't need perfect functions for these tests. */
   95929 #undef malloc
   95930 #undef memcmp
   95931 #undef realloc
   95932 }
   95933 
   95934 /* Infix notation calculator--calc */
   95935 %glr-parser %debug
   95936 
   95937 %code requires
   95938 {
   95939 
   95940   /* Exercise pre-prologue dependency to %union.  */
   95941   typedef int semantic_value;
   95942 }
   95943 
   95944 /* Exercise %union. */
   95945 %union
   95946 {
   95947   semantic_value ival;
   95948 };
   95949 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   95950 
   95951 %code provides
   95952 {
   95953   #include <stdio.h>
   95954   /* The input.  */
   95955   extern FILE *input;
   95956   extern semantic_value global_result;
   95957   extern int global_count;
   95958 }
   95959 
   95960 %code
   95961 {
   95962 #include <assert.h>
   95963 #include <string.h>
   95964 #define USE(Var)
   95965 
   95966 FILE *input;
   95967 static int power (int base, int exponent);
   95968 
   95969 static void yyerror ( const char *msg);
   95970 int yylex (void);
   95971 }
   95972 
   95973 
   95974 
   95975 /* Bison Declarations */
   95976 %token CALC_EOF 0 "end of input"
   95977 %token <ival> NUM "number"
   95978 %type  <ival> exp
   95979 
   95980 %nonassoc '=' /* comparison            */
   95981 %left '-' '+'
   95982 %left '*' '/'
   95983 %left NEG     /* negation--unary minus */
   95984 %right '^'    /* exponentiation        */
   95985 
   95986 /* Grammar follows */
   95987 %%
   95988 input:
   95989   line
   95990 | input line         {  }
   95991 ;
   95992 
   95993 line:
   95994   '\n'
   95995 | exp '\n'           { USE ($1); }
   95996 ;
   95997 
   95998 exp:
   95999   NUM                { $$ = $1;             }
   96000 | exp '=' exp
   96001   {
   96002     if ($1 != $3)
   96003       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   96004     $$ = $1;
   96005   }
   96006 | exp '+' exp        { $$ = $1 + $3;        }
   96007 | exp '-' exp        { $$ = $1 - $3;        }
   96008 | exp '*' exp        { $$ = $1 * $3;        }
   96009 | exp '/' exp        { $$ = $1 / $3;        }
   96010 | '-' exp  %prec NEG { $$ = -$2;            }
   96011 | exp '^' exp        { $$ = power ($1, $3); }
   96012 | '(' exp ')'        { $$ = $2;             }
   96013 | '(' error ')'      { $$ = 1111; yyerrok;  }
   96014 | '!'                { $$ = 0; YYERROR;     }
   96015 | '-' error          { $$ = 0; YYERROR;     }
   96016 ;
   96017 %%
   96018 
   96019 static int
   96020 power (int base, int exponent)
   96021 {
   96022   int res = 1;
   96023   assert (0 <= exponent);
   96024   for (/* Niente */; exponent; --exponent)
   96025     res *= base;
   96026   return res;
   96027 }
   96028 
   96029 
   96030 #include <stdio.h>
   96031 /* A C error reporting function.  */
   96032 static
   96033 void yyerror ( const char *msg)
   96034 {
   96035   fprintf (stderr, "%s\n", msg);
   96036 }
   96037 #include <ctype.h>
   96038 
   96039 int yylex (void);
   96040 static int get_char (void);
   96041 static void unget_char ( int c);
   96042 
   96043 
   96044 static int
   96045 get_char (void)
   96046 {
   96047   int res = getc (input);
   96048   ;
   96049 
   96050   return res;
   96051 }
   96052 
   96053 static void
   96054 unget_char ( int c)
   96055 {
   96056   ;
   96057 
   96058   ungetc (c, input);
   96059 }
   96060 
   96061 static int
   96062 read_signed_integer (void)
   96063 {
   96064   int c = get_char ();
   96065   int sign = 1;
   96066   int n = 0;
   96067 
   96068   ;
   96069   if (c == '-')
   96070     {
   96071       c = get_char ();
   96072       sign = -1;
   96073     }
   96074 
   96075   while (isdigit (c))
   96076     {
   96077       n = 10 * n + (c - '0');
   96078       c = get_char ();
   96079     }
   96080 
   96081   unget_char ( c);
   96082 
   96083   return sign * n;
   96084 }
   96085 
   96086 
   96087 /*---------------------------------------------------------------.
   96088 | Lexical analyzer returns an integer on the stack and the token |
   96089 | NUM, or the ASCII character read if not a number.  Skips all   |
   96090 | blanks and tabs, returns 0 for EOF.                            |
   96091 `---------------------------------------------------------------*/
   96092 
   96093 int yylex (void)
   96094 {
   96095   int c;
   96096   /* Skip current token, then white spaces.  */
   96097   do
   96098     {
   96099 
   96100     }
   96101   while ((c = get_char ()) == ' ' || c == '\t');
   96102 
   96103   /* process numbers   */
   96104   if (c == '.' || isdigit (c))
   96105     {
   96106       unget_char ( c);
   96107       (yylval).ival = read_signed_integer ();
   96108       return NUM;
   96109     }
   96110 
   96111   /* Return end-of-file.  */
   96112   if (c == EOF)
   96113     return CALC_EOF;
   96114 
   96115   /* Return single chars. */
   96116   return c;
   96117 }
   96118 
   96119 #include <assert.h>
   96120 #if HAVE_UNISTD_H
   96121 # include <unistd.h>
   96122 #else
   96123 # undef alarm
   96124 # define alarm(seconds) /* empty */
   96125 #endif
   96126 
   96127 
   96128 
   96129 semantic_value global_result = 0;
   96130 int global_count = 0;
   96131 
   96132 /* A C main function.  */
   96133 int
   96134 main (int argc, const char **argv)
   96135 {
   96136   semantic_value result = 0;
   96137   int count = 0;
   96138   int status;
   96139 
   96140   /* This used to be alarm (10), but that isn't enough time for
   96141      a July 1995 vintage DEC Alphastation 200 4/100 system,
   96142      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   96143   alarm (100);
   96144 
   96145   if (argc == 2)
   96146     input = fopen (argv[1], "r");
   96147   else
   96148     input = stdin;
   96149 
   96150   if (!input)
   96151     {
   96152       perror (argv[1]);
   96153       return 3;
   96154     }
   96155 
   96156   yydebug = 1;
   96157   status = yyparse ();
   96158   if (fclose (input))
   96159     perror ("fclose");
   96160   assert (global_result == result);
   96161   assert (global_count == count);
   96162   return status;
   96163 }
   96164 _ATEOF
   96165 
   96166 
   96167 
   96168 
   96169 
   96170 
   96171 
   96172 
   96173 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   96174   at_save_special_files
   96175   mkdir xml-tests
   96176     # Don't combine these Bison invocations since we want to be sure that
   96177   # --report=all isn't required to get the full XML file.
   96178   { set +x
   96179 $as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   96180                   --graph=xml-tests/test.dot -o calc.c calc.y"
   96181 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653"
   96182 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   96183                   --graph=xml-tests/test.dot -o calc.c calc.y
   96184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96185 at_status=$? at_failed=false
   96186 $at_check_filter
   96187 echo stderr:; cat "$at_stderr"
   96188 echo stdout:; cat "$at_stdout"
   96189 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96190 $at_failed && at_fn_log_failure
   96191 $at_traceon; }
   96192 
   96193   { set +x
   96194 $as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   96195 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:653"
   96196 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   96197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96198 at_status=$? at_failed=false
   96199 $at_check_filter
   96200 echo stderr:; cat "$at_stderr"
   96201 echo stdout:; cat "$at_stdout"
   96202 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96203 $at_failed && at_fn_log_failure
   96204 $at_traceon; }
   96205 
   96206     cp xml-tests/test.output expout
   96207   { set +x
   96208 $as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\
   96209              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   96210              xml-tests/test.xml"
   96211 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653"
   96212 ( $at_check_trace; $XSLTPROC \
   96213              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   96214              xml-tests/test.xml
   96215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96216 at_status=$? at_failed=false
   96217 $at_check_filter
   96218 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96219 $at_diff expout "$at_stdout" || at_failed=:
   96220 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96221 $at_failed && at_fn_log_failure
   96222 $at_traceon; }
   96223 
   96224   sort xml-tests/test.dot > expout
   96225   { set +x
   96226 $as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\
   96227              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   96228              xml-tests/test.xml | sort"
   96229 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653"
   96230 ( $at_check_trace; $XSLTPROC \
   96231              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   96232              xml-tests/test.xml | sort
   96233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96234 at_status=$? at_failed=false
   96235 $at_check_filter
   96236 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96237 $at_diff expout "$at_stdout" || at_failed=:
   96238 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96239 $at_failed && at_fn_log_failure
   96240 $at_traceon; }
   96241 
   96242   rm -rf xml-tests expout
   96243   at_restore_special_files
   96244 fi
   96245 { set +x
   96246 $as_echo "$at_srcdir/calc.at:653: bison -o calc.c calc.y"
   96247 at_fn_check_prepare_trace "calc.at:653"
   96248 ( $at_check_trace; bison -o calc.c calc.y
   96249 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96250 at_status=$? at_failed=false
   96251 $at_check_filter
   96252 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96253 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96254 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96255 $at_failed && at_fn_log_failure
   96256 $at_traceon; }
   96257 
   96258 
   96259    { set +x
   96260 $as_echo "$at_srcdir/calc.at:653: \$BISON_C_WORKS"
   96261 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:653"
   96262 ( $at_check_trace; $BISON_C_WORKS
   96263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96264 at_status=$? at_failed=false
   96265 $at_check_filter
   96266 echo stderr:; cat "$at_stderr"
   96267 echo stdout:; cat "$at_stdout"
   96268 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96269 $at_failed && at_fn_log_failure
   96270 $at_traceon; }
   96271 
   96272 { set +x
   96273 $as_echo "$at_srcdir/calc.at:653: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
   96274 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:653"
   96275 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
   96276 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96277 at_status=$? at_failed=false
   96278 $at_check_filter
   96279 echo stderr:; cat "$at_stderr"
   96280 echo stdout:; cat "$at_stdout"
   96281 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96282 $at_failed && at_fn_log_failure
   96283 $at_traceon; }
   96284 
   96285 
   96286 { set +x
   96287 $as_echo "$at_srcdir/calc.at:653: \$PERL -ne '
   96288   chomp;
   96289   print \"\$.: {\$_}\\n\"
   96290     if (# No starting/ending empty lines.
   96291         (eof || \$. == 1) && /^\\s*\$/
   96292         # No trailing space.  FIXME: not ready for \"maint\".
   96293         # || /\\s\$/
   96294         )' calc.c
   96295 "
   96296 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653"
   96297 ( $at_check_trace; $PERL -ne '
   96298   chomp;
   96299   print "$.: {$_}\n"
   96300     if (# No starting/ending empty lines.
   96301         (eof || $. == 1) && /^\s*$/
   96302         # No trailing space.  FIXME: not ready for "maint".
   96303         # || /\s$/
   96304         )' calc.c
   96305 
   96306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96307 at_status=$? at_failed=false
   96308 $at_check_filter
   96309 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96310 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96311 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96312 $at_failed && at_fn_log_failure
   96313 $at_traceon; }
   96314 
   96315 
   96316 
   96317 # Test the priorities.
   96318 cat >input <<'_ATEOF'
   96319 1 + 2 * 3 = 7
   96320 1 + 2 * -3 = -5
   96321 
   96322 -1^2 = -1
   96323 (-1)^2 = 1
   96324 
   96325 ---1 = -1
   96326 
   96327 1 - 2 - 3 = -4
   96328 1 - (2 - 3) = 2
   96329 
   96330 2^2^3 = 256
   96331 (2^2)^3 = 64
   96332 _ATEOF
   96333 
   96334 { set +x
   96335 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96336 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96337 ( $at_check_trace;  $PREPARSER ./calc input
   96338 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96339 at_status=$? at_failed=false
   96340 $at_check_filter
   96341 echo stderr:; tee stderr <"$at_stderr"
   96342 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96343 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96344 $at_failed && at_fn_log_failure
   96345 $at_traceon; }
   96346 
   96347 { set +x
   96348 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96349 at_fn_check_prepare_trace "calc.at:653"
   96350 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96351 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96352 at_status=$? at_failed=false
   96353 $at_check_filter
   96354 echo stderr:; tee stderr <"$at_stderr"
   96355 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96356 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96357 $at_failed && at_fn_log_failure
   96358 $at_traceon; }
   96359 
   96360 
   96361 
   96362 
   96363 # Some syntax errors.
   96364 cat >input <<'_ATEOF'
   96365 1 2
   96366 _ATEOF
   96367 
   96368 { set +x
   96369 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96370 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96371 ( $at_check_trace;  $PREPARSER ./calc input
   96372 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96373 at_status=$? at_failed=false
   96374 $at_check_filter
   96375 echo stderr:; tee stderr <"$at_stderr"
   96376 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96377 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
   96378 $at_failed && at_fn_log_failure
   96379 $at_traceon; }
   96380 
   96381 { set +x
   96382 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96383 at_fn_check_prepare_trace "calc.at:653"
   96384 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96385 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96386 at_status=$? at_failed=false
   96387 $at_check_filter
   96388 echo stderr:; tee stderr <"$at_stderr"
   96389 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96390 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96391 $at_failed && at_fn_log_failure
   96392 $at_traceon; }
   96393 
   96394 
   96395 
   96396 # Normalize the observed and expected error messages, depending upon the
   96397 # options.
   96398 # 1. Remove the traces from observed.
   96399 sed '/^Starting/d
   96400 /^Entering/d
   96401 /^Stack/d
   96402 /^Reading/d
   96403 /^Reducing/d
   96404 /^Return/d
   96405 /^Shifting/d
   96406 /^state/d
   96407 /^Cleanup:/d
   96408 /^Error:/d
   96409 /^Next/d
   96410 /^Now/d
   96411 /^Discarding/d
   96412 / \$[0-9$]* = /d
   96413 /^yydestructor:/d' stderr >at-stderr
   96414 mv at-stderr stderr
   96415 # 2. Create the reference error message.
   96416 cat >expout <<'_ATEOF'
   96417 1.3: syntax error, unexpected number
   96418 _ATEOF
   96419 
   96420 # 3. If locations are not used, remove them.
   96421 sed 's/^[-0-9.]*: //' expout >at-expout
   96422 mv at-expout expout
   96423 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96424 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96425 mv at-expout expout
   96426 # 5. Check
   96427 { set +x
   96428 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96429 at_fn_check_prepare_trace "calc.at:653"
   96430 ( $at_check_trace; cat stderr
   96431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96432 at_status=$? at_failed=false
   96433 $at_check_filter
   96434 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96435 $at_diff expout "$at_stdout" || at_failed=:
   96436 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96437 $at_failed && at_fn_log_failure
   96438 $at_traceon; }
   96439 
   96440 
   96441 cat >input <<'_ATEOF'
   96442 1//2
   96443 _ATEOF
   96444 
   96445 { set +x
   96446 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96447 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96448 ( $at_check_trace;  $PREPARSER ./calc input
   96449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96450 at_status=$? at_failed=false
   96451 $at_check_filter
   96452 echo stderr:; tee stderr <"$at_stderr"
   96453 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96454 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
   96455 $at_failed && at_fn_log_failure
   96456 $at_traceon; }
   96457 
   96458 { set +x
   96459 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96460 at_fn_check_prepare_trace "calc.at:653"
   96461 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96463 at_status=$? at_failed=false
   96464 $at_check_filter
   96465 echo stderr:; tee stderr <"$at_stderr"
   96466 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96467 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96468 $at_failed && at_fn_log_failure
   96469 $at_traceon; }
   96470 
   96471 
   96472 
   96473 # Normalize the observed and expected error messages, depending upon the
   96474 # options.
   96475 # 1. Remove the traces from observed.
   96476 sed '/^Starting/d
   96477 /^Entering/d
   96478 /^Stack/d
   96479 /^Reading/d
   96480 /^Reducing/d
   96481 /^Return/d
   96482 /^Shifting/d
   96483 /^state/d
   96484 /^Cleanup:/d
   96485 /^Error:/d
   96486 /^Next/d
   96487 /^Now/d
   96488 /^Discarding/d
   96489 / \$[0-9$]* = /d
   96490 /^yydestructor:/d' stderr >at-stderr
   96491 mv at-stderr stderr
   96492 # 2. Create the reference error message.
   96493 cat >expout <<'_ATEOF'
   96494 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   96495 _ATEOF
   96496 
   96497 # 3. If locations are not used, remove them.
   96498 sed 's/^[-0-9.]*: //' expout >at-expout
   96499 mv at-expout expout
   96500 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96501 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96502 mv at-expout expout
   96503 # 5. Check
   96504 { set +x
   96505 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96506 at_fn_check_prepare_trace "calc.at:653"
   96507 ( $at_check_trace; cat stderr
   96508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96509 at_status=$? at_failed=false
   96510 $at_check_filter
   96511 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96512 $at_diff expout "$at_stdout" || at_failed=:
   96513 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96514 $at_failed && at_fn_log_failure
   96515 $at_traceon; }
   96516 
   96517 
   96518 cat >input <<'_ATEOF'
   96519 error
   96520 _ATEOF
   96521 
   96522 { set +x
   96523 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96524 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96525 ( $at_check_trace;  $PREPARSER ./calc input
   96526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96527 at_status=$? at_failed=false
   96528 $at_check_filter
   96529 echo stderr:; tee stderr <"$at_stderr"
   96530 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96531 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
   96532 $at_failed && at_fn_log_failure
   96533 $at_traceon; }
   96534 
   96535 { set +x
   96536 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96537 at_fn_check_prepare_trace "calc.at:653"
   96538 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96540 at_status=$? at_failed=false
   96541 $at_check_filter
   96542 echo stderr:; tee stderr <"$at_stderr"
   96543 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96544 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96545 $at_failed && at_fn_log_failure
   96546 $at_traceon; }
   96547 
   96548 
   96549 
   96550 # Normalize the observed and expected error messages, depending upon the
   96551 # options.
   96552 # 1. Remove the traces from observed.
   96553 sed '/^Starting/d
   96554 /^Entering/d
   96555 /^Stack/d
   96556 /^Reading/d
   96557 /^Reducing/d
   96558 /^Return/d
   96559 /^Shifting/d
   96560 /^state/d
   96561 /^Cleanup:/d
   96562 /^Error:/d
   96563 /^Next/d
   96564 /^Now/d
   96565 /^Discarding/d
   96566 / \$[0-9$]* = /d
   96567 /^yydestructor:/d' stderr >at-stderr
   96568 mv at-stderr stderr
   96569 # 2. Create the reference error message.
   96570 cat >expout <<'_ATEOF'
   96571 1.1: syntax error, unexpected $undefined
   96572 _ATEOF
   96573 
   96574 # 3. If locations are not used, remove them.
   96575 sed 's/^[-0-9.]*: //' expout >at-expout
   96576 mv at-expout expout
   96577 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96578 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96579 mv at-expout expout
   96580 # 5. Check
   96581 { set +x
   96582 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96583 at_fn_check_prepare_trace "calc.at:653"
   96584 ( $at_check_trace; cat stderr
   96585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96586 at_status=$? at_failed=false
   96587 $at_check_filter
   96588 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96589 $at_diff expout "$at_stdout" || at_failed=:
   96590 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96591 $at_failed && at_fn_log_failure
   96592 $at_traceon; }
   96593 
   96594 
   96595 cat >input <<'_ATEOF'
   96596 1 = 2 = 3
   96597 _ATEOF
   96598 
   96599 { set +x
   96600 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96601 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96602 ( $at_check_trace;  $PREPARSER ./calc input
   96603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96604 at_status=$? at_failed=false
   96605 $at_check_filter
   96606 echo stderr:; tee stderr <"$at_stderr"
   96607 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96608 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
   96609 $at_failed && at_fn_log_failure
   96610 $at_traceon; }
   96611 
   96612 { set +x
   96613 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96614 at_fn_check_prepare_trace "calc.at:653"
   96615 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96616 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96617 at_status=$? at_failed=false
   96618 $at_check_filter
   96619 echo stderr:; tee stderr <"$at_stderr"
   96620 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96621 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96622 $at_failed && at_fn_log_failure
   96623 $at_traceon; }
   96624 
   96625 
   96626 
   96627 # Normalize the observed and expected error messages, depending upon the
   96628 # options.
   96629 # 1. Remove the traces from observed.
   96630 sed '/^Starting/d
   96631 /^Entering/d
   96632 /^Stack/d
   96633 /^Reading/d
   96634 /^Reducing/d
   96635 /^Return/d
   96636 /^Shifting/d
   96637 /^state/d
   96638 /^Cleanup:/d
   96639 /^Error:/d
   96640 /^Next/d
   96641 /^Now/d
   96642 /^Discarding/d
   96643 / \$[0-9$]* = /d
   96644 /^yydestructor:/d' stderr >at-stderr
   96645 mv at-stderr stderr
   96646 # 2. Create the reference error message.
   96647 cat >expout <<'_ATEOF'
   96648 1.7: syntax error, unexpected '='
   96649 _ATEOF
   96650 
   96651 # 3. If locations are not used, remove them.
   96652 sed 's/^[-0-9.]*: //' expout >at-expout
   96653 mv at-expout expout
   96654 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96655 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96656 mv at-expout expout
   96657 # 5. Check
   96658 { set +x
   96659 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96660 at_fn_check_prepare_trace "calc.at:653"
   96661 ( $at_check_trace; cat stderr
   96662 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96663 at_status=$? at_failed=false
   96664 $at_check_filter
   96665 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96666 $at_diff expout "$at_stdout" || at_failed=:
   96667 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96668 $at_failed && at_fn_log_failure
   96669 $at_traceon; }
   96670 
   96671 
   96672 cat >input <<'_ATEOF'
   96673 
   96674 +1
   96675 _ATEOF
   96676 
   96677 { set +x
   96678 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96679 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96680 ( $at_check_trace;  $PREPARSER ./calc input
   96681 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96682 at_status=$? at_failed=false
   96683 $at_check_filter
   96684 echo stderr:; tee stderr <"$at_stderr"
   96685 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96686 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
   96687 $at_failed && at_fn_log_failure
   96688 $at_traceon; }
   96689 
   96690 { set +x
   96691 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96692 at_fn_check_prepare_trace "calc.at:653"
   96693 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96694 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96695 at_status=$? at_failed=false
   96696 $at_check_filter
   96697 echo stderr:; tee stderr <"$at_stderr"
   96698 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96699 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96700 $at_failed && at_fn_log_failure
   96701 $at_traceon; }
   96702 
   96703 
   96704 
   96705 # Normalize the observed and expected error messages, depending upon the
   96706 # options.
   96707 # 1. Remove the traces from observed.
   96708 sed '/^Starting/d
   96709 /^Entering/d
   96710 /^Stack/d
   96711 /^Reading/d
   96712 /^Reducing/d
   96713 /^Return/d
   96714 /^Shifting/d
   96715 /^state/d
   96716 /^Cleanup:/d
   96717 /^Error:/d
   96718 /^Next/d
   96719 /^Now/d
   96720 /^Discarding/d
   96721 / \$[0-9$]* = /d
   96722 /^yydestructor:/d' stderr >at-stderr
   96723 mv at-stderr stderr
   96724 # 2. Create the reference error message.
   96725 cat >expout <<'_ATEOF'
   96726 2.1: syntax error, unexpected '+'
   96727 _ATEOF
   96728 
   96729 # 3. If locations are not used, remove them.
   96730 sed 's/^[-0-9.]*: //' expout >at-expout
   96731 mv at-expout expout
   96732 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96733 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96734 mv at-expout expout
   96735 # 5. Check
   96736 { set +x
   96737 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96738 at_fn_check_prepare_trace "calc.at:653"
   96739 ( $at_check_trace; cat stderr
   96740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96741 at_status=$? at_failed=false
   96742 $at_check_filter
   96743 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96744 $at_diff expout "$at_stdout" || at_failed=:
   96745 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96746 $at_failed && at_fn_log_failure
   96747 $at_traceon; }
   96748 
   96749 
   96750 # Exercise error messages with EOF: work on an empty file.
   96751 { set +x
   96752 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc /dev/null"
   96753 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:653"
   96754 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   96755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96756 at_status=$? at_failed=false
   96757 $at_check_filter
   96758 echo stderr:; tee stderr <"$at_stderr"
   96759 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96760 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
   96761 $at_failed && at_fn_log_failure
   96762 $at_traceon; }
   96763 
   96764 { set +x
   96765 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96766 at_fn_check_prepare_trace "calc.at:653"
   96767 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96769 at_status=$? at_failed=false
   96770 $at_check_filter
   96771 echo stderr:; tee stderr <"$at_stderr"
   96772 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96773 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96774 $at_failed && at_fn_log_failure
   96775 $at_traceon; }
   96776 
   96777 
   96778 
   96779 # Normalize the observed and expected error messages, depending upon the
   96780 # options.
   96781 # 1. Remove the traces from observed.
   96782 sed '/^Starting/d
   96783 /^Entering/d
   96784 /^Stack/d
   96785 /^Reading/d
   96786 /^Reducing/d
   96787 /^Return/d
   96788 /^Shifting/d
   96789 /^state/d
   96790 /^Cleanup:/d
   96791 /^Error:/d
   96792 /^Next/d
   96793 /^Now/d
   96794 /^Discarding/d
   96795 / \$[0-9$]* = /d
   96796 /^yydestructor:/d' stderr >at-stderr
   96797 mv at-stderr stderr
   96798 # 2. Create the reference error message.
   96799 cat >expout <<'_ATEOF'
   96800 1.1: syntax error, unexpected end of input
   96801 _ATEOF
   96802 
   96803 # 3. If locations are not used, remove them.
   96804 sed 's/^[-0-9.]*: //' expout >at-expout
   96805 mv at-expout expout
   96806 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96807 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96808 mv at-expout expout
   96809 # 5. Check
   96810 { set +x
   96811 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96812 at_fn_check_prepare_trace "calc.at:653"
   96813 ( $at_check_trace; cat stderr
   96814 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96815 at_status=$? at_failed=false
   96816 $at_check_filter
   96817 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96818 $at_diff expout "$at_stdout" || at_failed=:
   96819 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96820 $at_failed && at_fn_log_failure
   96821 $at_traceon; }
   96822 
   96823 
   96824 
   96825 # Exercise the error token: without it, we die at the first error,
   96826 # hence be sure to
   96827 #
   96828 # - have several errors which exercise different shift/discardings
   96829 #   - (): nothing to pop, nothing to discard
   96830 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   96831 #   - (* * *): nothing to pop, a lot to discard
   96832 #   - (1 + 2 * *): some to pop and discard
   96833 #
   96834 # - test the action associated to `error'
   96835 #
   96836 # - check the lookahead that triggers an error is not discarded
   96837 #   when we enter error recovery.  Below, the lookahead causing the
   96838 #   first error is ")", which is needed to recover from the error and
   96839 #   produce the "0" that triggers the "0 != 1" error.
   96840 #
   96841 cat >input <<'_ATEOF'
   96842 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   96843 _ATEOF
   96844 
   96845 { set +x
   96846 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96847 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96848 ( $at_check_trace;  $PREPARSER ./calc input
   96849 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96850 at_status=$? at_failed=false
   96851 $at_check_filter
   96852 echo stderr:; tee stderr <"$at_stderr"
   96853 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96854 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96855 $at_failed && at_fn_log_failure
   96856 $at_traceon; }
   96857 
   96858 { set +x
   96859 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96860 at_fn_check_prepare_trace "calc.at:653"
   96861 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96862 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96863 at_status=$? at_failed=false
   96864 $at_check_filter
   96865 echo stderr:; tee stderr <"$at_stderr"
   96866 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96867 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96868 $at_failed && at_fn_log_failure
   96869 $at_traceon; }
   96870 
   96871 
   96872 
   96873 # Normalize the observed and expected error messages, depending upon the
   96874 # options.
   96875 # 1. Remove the traces from observed.
   96876 sed '/^Starting/d
   96877 /^Entering/d
   96878 /^Stack/d
   96879 /^Reading/d
   96880 /^Reducing/d
   96881 /^Return/d
   96882 /^Shifting/d
   96883 /^state/d
   96884 /^Cleanup:/d
   96885 /^Error:/d
   96886 /^Next/d
   96887 /^Now/d
   96888 /^Discarding/d
   96889 / \$[0-9$]* = /d
   96890 /^yydestructor:/d' stderr >at-stderr
   96891 mv at-stderr stderr
   96892 # 2. Create the reference error message.
   96893 cat >expout <<'_ATEOF'
   96894 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   96895 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   96896 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   96897 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   96898 calc: error: 4444 != 1
   96899 _ATEOF
   96900 
   96901 # 3. If locations are not used, remove them.
   96902 sed 's/^[-0-9.]*: //' expout >at-expout
   96903 mv at-expout expout
   96904 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96905 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96906 mv at-expout expout
   96907 # 5. Check
   96908 { set +x
   96909 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96910 at_fn_check_prepare_trace "calc.at:653"
   96911 ( $at_check_trace; cat stderr
   96912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96913 at_status=$? at_failed=false
   96914 $at_check_filter
   96915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96916 $at_diff expout "$at_stdout" || at_failed=:
   96917 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96918 $at_failed && at_fn_log_failure
   96919 $at_traceon; }
   96920 
   96921 
   96922 
   96923 # The same, but this time exercising explicitly triggered syntax errors.
   96924 # POSIX says the lookahead causing the error should not be discarded.
   96925 cat >input <<'_ATEOF'
   96926 (!) + (1 2) = 1
   96927 _ATEOF
   96928 
   96929 { set +x
   96930 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   96931 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   96932 ( $at_check_trace;  $PREPARSER ./calc input
   96933 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96934 at_status=$? at_failed=false
   96935 $at_check_filter
   96936 echo stderr:; tee stderr <"$at_stderr"
   96937 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96938 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96939 $at_failed && at_fn_log_failure
   96940 $at_traceon; }
   96941 
   96942 { set +x
   96943 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   96944 at_fn_check_prepare_trace "calc.at:653"
   96945 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   96946 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96947 at_status=$? at_failed=false
   96948 $at_check_filter
   96949 echo stderr:; tee stderr <"$at_stderr"
   96950 at_fn_diff_devnull "$at_stdout" || at_failed=:
   96951 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96952 $at_failed && at_fn_log_failure
   96953 $at_traceon; }
   96954 
   96955 
   96956 
   96957 # Normalize the observed and expected error messages, depending upon the
   96958 # options.
   96959 # 1. Remove the traces from observed.
   96960 sed '/^Starting/d
   96961 /^Entering/d
   96962 /^Stack/d
   96963 /^Reading/d
   96964 /^Reducing/d
   96965 /^Return/d
   96966 /^Shifting/d
   96967 /^state/d
   96968 /^Cleanup:/d
   96969 /^Error:/d
   96970 /^Next/d
   96971 /^Now/d
   96972 /^Discarding/d
   96973 / \$[0-9$]* = /d
   96974 /^yydestructor:/d' stderr >at-stderr
   96975 mv at-stderr stderr
   96976 # 2. Create the reference error message.
   96977 cat >expout <<'_ATEOF'
   96978 1.10: syntax error, unexpected number
   96979 calc: error: 2222 != 1
   96980 _ATEOF
   96981 
   96982 # 3. If locations are not used, remove them.
   96983 sed 's/^[-0-9.]*: //' expout >at-expout
   96984 mv at-expout expout
   96985 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   96986 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   96987 mv at-expout expout
   96988 # 5. Check
   96989 { set +x
   96990 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   96991 at_fn_check_prepare_trace "calc.at:653"
   96992 ( $at_check_trace; cat stderr
   96993 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   96994 at_status=$? at_failed=false
   96995 $at_check_filter
   96996 at_fn_diff_devnull "$at_stderr" || at_failed=:
   96997 $at_diff expout "$at_stdout" || at_failed=:
   96998 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   96999 $at_failed && at_fn_log_failure
   97000 $at_traceon; }
   97001 
   97002 
   97003 cat >input <<'_ATEOF'
   97004 (- *) + (1 2) = 1
   97005 _ATEOF
   97006 
   97007 { set +x
   97008 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   97009 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   97010 ( $at_check_trace;  $PREPARSER ./calc input
   97011 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97012 at_status=$? at_failed=false
   97013 $at_check_filter
   97014 echo stderr:; tee stderr <"$at_stderr"
   97015 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97016 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   97017 $at_failed && at_fn_log_failure
   97018 $at_traceon; }
   97019 
   97020 { set +x
   97021 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97022 at_fn_check_prepare_trace "calc.at:653"
   97023 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97024 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97025 at_status=$? at_failed=false
   97026 $at_check_filter
   97027 echo stderr:; tee stderr <"$at_stderr"
   97028 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97029 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   97030 $at_failed && at_fn_log_failure
   97031 $at_traceon; }
   97032 
   97033 
   97034 
   97035 # Normalize the observed and expected error messages, depending upon the
   97036 # options.
   97037 # 1. Remove the traces from observed.
   97038 sed '/^Starting/d
   97039 /^Entering/d
   97040 /^Stack/d
   97041 /^Reading/d
   97042 /^Reducing/d
   97043 /^Return/d
   97044 /^Shifting/d
   97045 /^state/d
   97046 /^Cleanup:/d
   97047 /^Error:/d
   97048 /^Next/d
   97049 /^Now/d
   97050 /^Discarding/d
   97051 / \$[0-9$]* = /d
   97052 /^yydestructor:/d' stderr >at-stderr
   97053 mv at-stderr stderr
   97054 # 2. Create the reference error message.
   97055 cat >expout <<'_ATEOF'
   97056 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   97057 1.12: syntax error, unexpected number
   97058 calc: error: 2222 != 1
   97059 _ATEOF
   97060 
   97061 # 3. If locations are not used, remove them.
   97062 sed 's/^[-0-9.]*: //' expout >at-expout
   97063 mv at-expout expout
   97064 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   97065 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   97066 mv at-expout expout
   97067 # 5. Check
   97068 { set +x
   97069 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   97070 at_fn_check_prepare_trace "calc.at:653"
   97071 ( $at_check_trace; cat stderr
   97072 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97073 at_status=$? at_failed=false
   97074 $at_check_filter
   97075 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97076 $at_diff expout "$at_stdout" || at_failed=:
   97077 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   97078 $at_failed && at_fn_log_failure
   97079 $at_traceon; }
   97080 
   97081 
   97082 
   97083 # Check that yyerrok works properly: second error is not reported,
   97084 # third and fourth are.  Parse status is succesfull.
   97085 cat >input <<'_ATEOF'
   97086 (* *) + (*) + (*)
   97087 _ATEOF
   97088 
   97089 { set +x
   97090 $as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
   97091 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
   97092 ( $at_check_trace;  $PREPARSER ./calc input
   97093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97094 at_status=$? at_failed=false
   97095 $at_check_filter
   97096 echo stderr:; tee stderr <"$at_stderr"
   97097 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97098 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   97099 $at_failed && at_fn_log_failure
   97100 $at_traceon; }
   97101 
   97102 { set +x
   97103 $as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97104 at_fn_check_prepare_trace "calc.at:653"
   97105 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97107 at_status=$? at_failed=false
   97108 $at_check_filter
   97109 echo stderr:; tee stderr <"$at_stderr"
   97110 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97111 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   97112 $at_failed && at_fn_log_failure
   97113 $at_traceon; }
   97114 
   97115 
   97116 
   97117 # Normalize the observed and expected error messages, depending upon the
   97118 # options.
   97119 # 1. Remove the traces from observed.
   97120 sed '/^Starting/d
   97121 /^Entering/d
   97122 /^Stack/d
   97123 /^Reading/d
   97124 /^Reducing/d
   97125 /^Return/d
   97126 /^Shifting/d
   97127 /^state/d
   97128 /^Cleanup:/d
   97129 /^Error:/d
   97130 /^Next/d
   97131 /^Now/d
   97132 /^Discarding/d
   97133 / \$[0-9$]* = /d
   97134 /^yydestructor:/d' stderr >at-stderr
   97135 mv at-stderr stderr
   97136 # 2. Create the reference error message.
   97137 cat >expout <<'_ATEOF'
   97138 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   97139 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   97140 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   97141 _ATEOF
   97142 
   97143 # 3. If locations are not used, remove them.
   97144 sed 's/^[-0-9.]*: //' expout >at-expout
   97145 mv at-expout expout
   97146 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   97147 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   97148 mv at-expout expout
   97149 # 5. Check
   97150 { set +x
   97151 $as_echo "$at_srcdir/calc.at:653: cat stderr"
   97152 at_fn_check_prepare_trace "calc.at:653"
   97153 ( $at_check_trace; cat stderr
   97154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97155 at_status=$? at_failed=false
   97156 $at_check_filter
   97157 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97158 $at_diff expout "$at_stdout" || at_failed=:
   97159 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
   97160 $at_failed && at_fn_log_failure
   97161 $at_traceon; }
   97162 
   97163 
   97164 
   97165 
   97166 
   97167   set +x
   97168   $at_times_p && times >"$at_times_file"
   97169 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   97170 read at_status <"$at_status_file"
   97171 #AT_STOP_229
   97172 #AT_START_230
   97173 at_fn_group_banner 230 'calc.at:654' \
   97174   "Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
   97175 at_xfail=no
   97176 (
   97177   $as_echo "230. $at_setup_line: testing $at_desc ..."
   97178   $at_traceon
   97179 
   97180 
   97181 
   97182 
   97183 
   97184 
   97185 
   97186 
   97187 
   97188 
   97189 cat >calc.y <<'_ATEOF'
   97190 %code top {
   97191 #include <config.h>
   97192 /* We don't need perfect functions for these tests. */
   97193 #undef malloc
   97194 #undef memcmp
   97195 #undef realloc
   97196 }
   97197 
   97198 /* Infix notation calculator--calc */
   97199 %glr-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
   97200 
   97201 %code requires
   97202 {
   97203 
   97204   /* Exercise pre-prologue dependency to %union.  */
   97205   typedef int semantic_value;
   97206 }
   97207 
   97208 /* Exercise %union. */
   97209 %union
   97210 {
   97211   semantic_value ival;
   97212 };
   97213 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   97214 
   97215 %code provides
   97216 {
   97217   #include <stdio.h>
   97218   /* The input.  */
   97219   extern FILE *input;
   97220   extern semantic_value global_result;
   97221   extern int global_count;
   97222 }
   97223 
   97224 %code
   97225 {
   97226 #include <assert.h>
   97227 #include <string.h>
   97228 #define USE(Var)
   97229 
   97230 FILE *input;
   97231 static int power (int base, int exponent);
   97232 
   97233 static void calcerror ( const char *msg);
   97234 int calclex (void);
   97235 }
   97236 
   97237 
   97238 
   97239 /* Bison Declarations */
   97240 %token CALC_EOF 0 "end of input"
   97241 %token <ival> NUM "number"
   97242 %type  <ival> exp
   97243 
   97244 %nonassoc '=' /* comparison            */
   97245 %left '-' '+'
   97246 %left '*' '/'
   97247 %left NEG     /* negation--unary minus */
   97248 %right '^'    /* exponentiation        */
   97249 
   97250 /* Grammar follows */
   97251 %%
   97252 input:
   97253   line
   97254 | input line         {  }
   97255 ;
   97256 
   97257 line:
   97258   '\n'
   97259 | exp '\n'           { USE ($1); }
   97260 ;
   97261 
   97262 exp:
   97263   NUM                { $$ = $1;             }
   97264 | exp '=' exp
   97265   {
   97266     if ($1 != $3)
   97267       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   97268     $$ = $1;
   97269   }
   97270 | exp '+' exp        { $$ = $1 + $3;        }
   97271 | exp '-' exp        { $$ = $1 - $3;        }
   97272 | exp '*' exp        { $$ = $1 * $3;        }
   97273 | exp '/' exp        { $$ = $1 / $3;        }
   97274 | '-' exp  %prec NEG { $$ = -$2;            }
   97275 | exp '^' exp        { $$ = power ($1, $3); }
   97276 | '(' exp ')'        { $$ = $2;             }
   97277 | '(' error ')'      { $$ = 1111; yyerrok;  }
   97278 | '!'                { $$ = 0; YYERROR;     }
   97279 | '-' error          { $$ = 0; YYERROR;     }
   97280 ;
   97281 %%
   97282 
   97283 static int
   97284 power (int base, int exponent)
   97285 {
   97286   int res = 1;
   97287   assert (0 <= exponent);
   97288   for (/* Niente */; exponent; --exponent)
   97289     res *= base;
   97290   return res;
   97291 }
   97292 
   97293 
   97294 #include <stdio.h>
   97295 /* A C error reporting function.  */
   97296 static
   97297 void calcerror ( const char *msg)
   97298 {
   97299   YY_LOCATION_PRINT (stderr, (calclloc));
   97300   fprintf (stderr, ": ");
   97301   fprintf (stderr, "%s\n", msg);
   97302 }
   97303 _ATEOF
   97304 
   97305 
   97306 
   97307 cat >calc-lex.c <<'_ATEOF'
   97308 #include <config.h>
   97309 /* We don't need perfect functions for these tests. */
   97310 #undef malloc
   97311 #undef memcmp
   97312 #undef realloc
   97313 
   97314 #include "calc.h"
   97315 
   97316 #include <ctype.h>
   97317 
   97318 int calclex (void);
   97319 static int get_char (void);
   97320 static void unget_char ( int c);
   97321 
   97322 
   97323 static YYLTYPE last_yylloc;
   97324 
   97325 static int
   97326 get_char (void)
   97327 {
   97328   int res = getc (input);
   97329   ;
   97330 
   97331   last_yylloc = (calclloc);
   97332   if (res == '\n')
   97333     {
   97334       (calclloc).last_line++;
   97335       (calclloc).last_column = 1;
   97336     }
   97337   else
   97338     (calclloc).last_column++;
   97339 
   97340   return res;
   97341 }
   97342 
   97343 static void
   97344 unget_char ( int c)
   97345 {
   97346   ;
   97347 
   97348   /* Wrong when C == `\n'. */
   97349   (calclloc) = last_yylloc;
   97350 
   97351   ungetc (c, input);
   97352 }
   97353 
   97354 static int
   97355 read_signed_integer (void)
   97356 {
   97357   int c = get_char ();
   97358   int sign = 1;
   97359   int n = 0;
   97360 
   97361   ;
   97362   if (c == '-')
   97363     {
   97364       c = get_char ();
   97365       sign = -1;
   97366     }
   97367 
   97368   while (isdigit (c))
   97369     {
   97370       n = 10 * n + (c - '0');
   97371       c = get_char ();
   97372     }
   97373 
   97374   unget_char ( c);
   97375 
   97376   return sign * n;
   97377 }
   97378 
   97379 
   97380 /*---------------------------------------------------------------.
   97381 | Lexical analyzer returns an integer on the stack and the token |
   97382 | NUM, or the ASCII character read if not a number.  Skips all   |
   97383 | blanks and tabs, returns 0 for EOF.                            |
   97384 `---------------------------------------------------------------*/
   97385 
   97386 int calclex (void)
   97387 {
   97388   int c;
   97389   /* Skip current token, then white spaces.  */
   97390   do
   97391     {
   97392      (calclloc).first_column = (calclloc).last_column;
   97393       (calclloc).first_line   = (calclloc).last_line;
   97394 
   97395     }
   97396   while ((c = get_char ()) == ' ' || c == '\t');
   97397 
   97398   /* process numbers   */
   97399   if (c == '.' || isdigit (c))
   97400     {
   97401       unget_char ( c);
   97402       (calclval).ival = read_signed_integer ();
   97403       return NUM;
   97404     }
   97405 
   97406   /* Return end-of-file.  */
   97407   if (c == EOF)
   97408     return CALC_EOF;
   97409 
   97410   /* Return single chars. */
   97411   return c;
   97412 }
   97413 _ATEOF
   97414 
   97415 
   97416 cat >calc-main.c <<'_ATEOF'
   97417 #include <config.h>
   97418 /* We don't need perfect functions for these tests. */
   97419 #undef malloc
   97420 #undef memcmp
   97421 #undef realloc
   97422 
   97423 #include "calc.h"
   97424 
   97425 #include <assert.h>
   97426 #if HAVE_UNISTD_H
   97427 # include <unistd.h>
   97428 #else
   97429 # undef alarm
   97430 # define alarm(seconds) /* empty */
   97431 #endif
   97432 
   97433 
   97434 
   97435 semantic_value global_result = 0;
   97436 int global_count = 0;
   97437 
   97438 /* A C main function.  */
   97439 int
   97440 main (int argc, const char **argv)
   97441 {
   97442   semantic_value result = 0;
   97443   int count = 0;
   97444   int status;
   97445 
   97446   /* This used to be alarm (10), but that isn't enough time for
   97447      a July 1995 vintage DEC Alphastation 200 4/100 system,
   97448      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   97449   alarm (100);
   97450 
   97451   if (argc == 2)
   97452     input = fopen (argv[1], "r");
   97453   else
   97454     input = stdin;
   97455 
   97456   if (!input)
   97457     {
   97458       perror (argv[1]);
   97459       return 3;
   97460     }
   97461 
   97462   calcdebug = 1;
   97463   status = calcparse ();
   97464   if (fclose (input))
   97465     perror ("fclose");
   97466   assert (global_result == result);
   97467   assert (global_count == count);
   97468   return status;
   97469 }
   97470 _ATEOF
   97471 
   97472 
   97473 
   97474 
   97475 
   97476 
   97477 
   97478 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   97479   at_save_special_files
   97480   mkdir xml-tests
   97481     # Don't combine these Bison invocations since we want to be sure that
   97482   # --report=all isn't required to get the full XML file.
   97483   { set +x
   97484 $as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   97485                   --graph=xml-tests/test.dot -o calc.c calc.y"
   97486 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654"
   97487 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   97488                   --graph=xml-tests/test.dot -o calc.c calc.y
   97489 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97490 at_status=$? at_failed=false
   97491 $at_check_filter
   97492 echo stderr:; cat "$at_stderr"
   97493 echo stdout:; cat "$at_stdout"
   97494 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97495 $at_failed && at_fn_log_failure
   97496 $at_traceon; }
   97497 
   97498   { set +x
   97499 $as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   97500 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:654"
   97501 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   97502 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97503 at_status=$? at_failed=false
   97504 $at_check_filter
   97505 echo stderr:; cat "$at_stderr"
   97506 echo stdout:; cat "$at_stdout"
   97507 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97508 $at_failed && at_fn_log_failure
   97509 $at_traceon; }
   97510 
   97511     cp xml-tests/test.output expout
   97512   { set +x
   97513 $as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\
   97514              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   97515              xml-tests/test.xml"
   97516 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654"
   97517 ( $at_check_trace; $XSLTPROC \
   97518              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   97519              xml-tests/test.xml
   97520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97521 at_status=$? at_failed=false
   97522 $at_check_filter
   97523 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97524 $at_diff expout "$at_stdout" || at_failed=:
   97525 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97526 $at_failed && at_fn_log_failure
   97527 $at_traceon; }
   97528 
   97529   sort xml-tests/test.dot > expout
   97530   { set +x
   97531 $as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\
   97532              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   97533              xml-tests/test.xml | sort"
   97534 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654"
   97535 ( $at_check_trace; $XSLTPROC \
   97536              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   97537              xml-tests/test.xml | sort
   97538 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97539 at_status=$? at_failed=false
   97540 $at_check_filter
   97541 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97542 $at_diff expout "$at_stdout" || at_failed=:
   97543 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97544 $at_failed && at_fn_log_failure
   97545 $at_traceon; }
   97546 
   97547   rm -rf xml-tests expout
   97548   at_restore_special_files
   97549 fi
   97550 { set +x
   97551 $as_echo "$at_srcdir/calc.at:654: bison -o calc.c calc.y"
   97552 at_fn_check_prepare_trace "calc.at:654"
   97553 ( $at_check_trace; bison -o calc.c calc.y
   97554 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97555 at_status=$? at_failed=false
   97556 $at_check_filter
   97557 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97558 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97559 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97560 $at_failed && at_fn_log_failure
   97561 $at_traceon; }
   97562 
   97563 
   97564    { set +x
   97565 $as_echo "$at_srcdir/calc.at:654: \$BISON_C_WORKS"
   97566 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:654"
   97567 ( $at_check_trace; $BISON_C_WORKS
   97568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97569 at_status=$? at_failed=false
   97570 $at_check_filter
   97571 echo stderr:; cat "$at_stderr"
   97572 echo stdout:; cat "$at_stdout"
   97573 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97574 $at_failed && at_fn_log_failure
   97575 $at_traceon; }
   97576 
   97577 { set +x
   97578 $as_echo "$at_srcdir/calc.at:654: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   97579 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:654"
   97580 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   97581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97582 at_status=$? at_failed=false
   97583 $at_check_filter
   97584 echo stderr:; cat "$at_stderr"
   97585 echo stdout:; cat "$at_stdout"
   97586 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97587 $at_failed && at_fn_log_failure
   97588 $at_traceon; }
   97589 
   97590 
   97591 { set +x
   97592 $as_echo "$at_srcdir/calc.at:654: \$PERL -ne '
   97593   chomp;
   97594   print \"\$.: {\$_}\\n\"
   97595     if (# No starting/ending empty lines.
   97596         (eof || \$. == 1) && /^\\s*\$/
   97597         # No trailing space.  FIXME: not ready for \"maint\".
   97598         # || /\\s\$/
   97599         )' calc.c
   97600 "
   97601 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654"
   97602 ( $at_check_trace; $PERL -ne '
   97603   chomp;
   97604   print "$.: {$_}\n"
   97605     if (# No starting/ending empty lines.
   97606         (eof || $. == 1) && /^\s*$/
   97607         # No trailing space.  FIXME: not ready for "maint".
   97608         # || /\s$/
   97609         )' calc.c
   97610 
   97611 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97612 at_status=$? at_failed=false
   97613 $at_check_filter
   97614 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97615 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97616 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97617 $at_failed && at_fn_log_failure
   97618 $at_traceon; }
   97619 
   97620 { set +x
   97621 $as_echo "$at_srcdir/calc.at:654: \$PERL -ne '
   97622   chomp;
   97623   print \"\$.: {\$_}\\n\"
   97624     if (# No starting/ending empty lines.
   97625         (eof || \$. == 1) && /^\\s*\$/
   97626         # No trailing space.  FIXME: not ready for \"maint\".
   97627         # || /\\s\$/
   97628         )' calc.h
   97629 "
   97630 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654"
   97631 ( $at_check_trace; $PERL -ne '
   97632   chomp;
   97633   print "$.: {$_}\n"
   97634     if (# No starting/ending empty lines.
   97635         (eof || $. == 1) && /^\s*$/
   97636         # No trailing space.  FIXME: not ready for "maint".
   97637         # || /\s$/
   97638         )' calc.h
   97639 
   97640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97641 at_status=$? at_failed=false
   97642 $at_check_filter
   97643 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97644 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97645 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97646 $at_failed && at_fn_log_failure
   97647 $at_traceon; }
   97648 
   97649 
   97650 # Test the priorities.
   97651 cat >input <<'_ATEOF'
   97652 1 + 2 * 3 = 7
   97653 1 + 2 * -3 = -5
   97654 
   97655 -1^2 = -1
   97656 (-1)^2 = 1
   97657 
   97658 ---1 = -1
   97659 
   97660 1 - 2 - 3 = -4
   97661 1 - (2 - 3) = 2
   97662 
   97663 2^2^3 = 256
   97664 (2^2)^3 = 64
   97665 _ATEOF
   97666 
   97667 { set +x
   97668 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   97669 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   97670 ( $at_check_trace;  $PREPARSER ./calc input
   97671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97672 at_status=$? at_failed=false
   97673 $at_check_filter
   97674 echo stderr:; tee stderr <"$at_stderr"
   97675 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97676 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97677 $at_failed && at_fn_log_failure
   97678 $at_traceon; }
   97679 
   97680 { set +x
   97681 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97682 at_fn_check_prepare_trace "calc.at:654"
   97683 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97685 at_status=$? at_failed=false
   97686 $at_check_filter
   97687 echo stderr:; tee stderr <"$at_stderr"
   97688 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97689 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97690 $at_failed && at_fn_log_failure
   97691 $at_traceon; }
   97692 
   97693 
   97694 
   97695 
   97696 # Some syntax errors.
   97697 cat >input <<'_ATEOF'
   97698 1 2
   97699 _ATEOF
   97700 
   97701 { set +x
   97702 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   97703 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   97704 ( $at_check_trace;  $PREPARSER ./calc input
   97705 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97706 at_status=$? at_failed=false
   97707 $at_check_filter
   97708 echo stderr:; tee stderr <"$at_stderr"
   97709 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97710 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
   97711 $at_failed && at_fn_log_failure
   97712 $at_traceon; }
   97713 
   97714 { set +x
   97715 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97716 at_fn_check_prepare_trace "calc.at:654"
   97717 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97718 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97719 at_status=$? at_failed=false
   97720 $at_check_filter
   97721 echo stderr:; tee stderr <"$at_stderr"
   97722 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97723 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97724 $at_failed && at_fn_log_failure
   97725 $at_traceon; }
   97726 
   97727 
   97728 
   97729 # Normalize the observed and expected error messages, depending upon the
   97730 # options.
   97731 # 1. Remove the traces from observed.
   97732 sed '/^Starting/d
   97733 /^Entering/d
   97734 /^Stack/d
   97735 /^Reading/d
   97736 /^Reducing/d
   97737 /^Return/d
   97738 /^Shifting/d
   97739 /^state/d
   97740 /^Cleanup:/d
   97741 /^Error:/d
   97742 /^Next/d
   97743 /^Now/d
   97744 /^Discarding/d
   97745 / \$[0-9$]* = /d
   97746 /^yydestructor:/d' stderr >at-stderr
   97747 mv at-stderr stderr
   97748 # 2. Create the reference error message.
   97749 cat >expout <<'_ATEOF'
   97750 1.3: syntax error, unexpected number
   97751 _ATEOF
   97752 
   97753 # 3. If locations are not used, remove them.
   97754 
   97755 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   97756 
   97757 # 5. Check
   97758 { set +x
   97759 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   97760 at_fn_check_prepare_trace "calc.at:654"
   97761 ( $at_check_trace; cat stderr
   97762 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97763 at_status=$? at_failed=false
   97764 $at_check_filter
   97765 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97766 $at_diff expout "$at_stdout" || at_failed=:
   97767 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97768 $at_failed && at_fn_log_failure
   97769 $at_traceon; }
   97770 
   97771 
   97772 cat >input <<'_ATEOF'
   97773 1//2
   97774 _ATEOF
   97775 
   97776 { set +x
   97777 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   97778 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   97779 ( $at_check_trace;  $PREPARSER ./calc input
   97780 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97781 at_status=$? at_failed=false
   97782 $at_check_filter
   97783 echo stderr:; tee stderr <"$at_stderr"
   97784 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97785 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
   97786 $at_failed && at_fn_log_failure
   97787 $at_traceon; }
   97788 
   97789 { set +x
   97790 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97791 at_fn_check_prepare_trace "calc.at:654"
   97792 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97793 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97794 at_status=$? at_failed=false
   97795 $at_check_filter
   97796 echo stderr:; tee stderr <"$at_stderr"
   97797 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97798 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97799 $at_failed && at_fn_log_failure
   97800 $at_traceon; }
   97801 
   97802 
   97803 
   97804 # Normalize the observed and expected error messages, depending upon the
   97805 # options.
   97806 # 1. Remove the traces from observed.
   97807 sed '/^Starting/d
   97808 /^Entering/d
   97809 /^Stack/d
   97810 /^Reading/d
   97811 /^Reducing/d
   97812 /^Return/d
   97813 /^Shifting/d
   97814 /^state/d
   97815 /^Cleanup:/d
   97816 /^Error:/d
   97817 /^Next/d
   97818 /^Now/d
   97819 /^Discarding/d
   97820 / \$[0-9$]* = /d
   97821 /^yydestructor:/d' stderr >at-stderr
   97822 mv at-stderr stderr
   97823 # 2. Create the reference error message.
   97824 cat >expout <<'_ATEOF'
   97825 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   97826 _ATEOF
   97827 
   97828 # 3. If locations are not used, remove them.
   97829 
   97830 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   97831 
   97832 # 5. Check
   97833 { set +x
   97834 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   97835 at_fn_check_prepare_trace "calc.at:654"
   97836 ( $at_check_trace; cat stderr
   97837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97838 at_status=$? at_failed=false
   97839 $at_check_filter
   97840 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97841 $at_diff expout "$at_stdout" || at_failed=:
   97842 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97843 $at_failed && at_fn_log_failure
   97844 $at_traceon; }
   97845 
   97846 
   97847 cat >input <<'_ATEOF'
   97848 error
   97849 _ATEOF
   97850 
   97851 { set +x
   97852 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   97853 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   97854 ( $at_check_trace;  $PREPARSER ./calc input
   97855 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97856 at_status=$? at_failed=false
   97857 $at_check_filter
   97858 echo stderr:; tee stderr <"$at_stderr"
   97859 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97860 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
   97861 $at_failed && at_fn_log_failure
   97862 $at_traceon; }
   97863 
   97864 { set +x
   97865 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97866 at_fn_check_prepare_trace "calc.at:654"
   97867 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97869 at_status=$? at_failed=false
   97870 $at_check_filter
   97871 echo stderr:; tee stderr <"$at_stderr"
   97872 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97873 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97874 $at_failed && at_fn_log_failure
   97875 $at_traceon; }
   97876 
   97877 
   97878 
   97879 # Normalize the observed and expected error messages, depending upon the
   97880 # options.
   97881 # 1. Remove the traces from observed.
   97882 sed '/^Starting/d
   97883 /^Entering/d
   97884 /^Stack/d
   97885 /^Reading/d
   97886 /^Reducing/d
   97887 /^Return/d
   97888 /^Shifting/d
   97889 /^state/d
   97890 /^Cleanup:/d
   97891 /^Error:/d
   97892 /^Next/d
   97893 /^Now/d
   97894 /^Discarding/d
   97895 / \$[0-9$]* = /d
   97896 /^yydestructor:/d' stderr >at-stderr
   97897 mv at-stderr stderr
   97898 # 2. Create the reference error message.
   97899 cat >expout <<'_ATEOF'
   97900 1.1: syntax error, unexpected $undefined
   97901 _ATEOF
   97902 
   97903 # 3. If locations are not used, remove them.
   97904 
   97905 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   97906 
   97907 # 5. Check
   97908 { set +x
   97909 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   97910 at_fn_check_prepare_trace "calc.at:654"
   97911 ( $at_check_trace; cat stderr
   97912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97913 at_status=$? at_failed=false
   97914 $at_check_filter
   97915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97916 $at_diff expout "$at_stdout" || at_failed=:
   97917 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97918 $at_failed && at_fn_log_failure
   97919 $at_traceon; }
   97920 
   97921 
   97922 cat >input <<'_ATEOF'
   97923 1 = 2 = 3
   97924 _ATEOF
   97925 
   97926 { set +x
   97927 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   97928 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   97929 ( $at_check_trace;  $PREPARSER ./calc input
   97930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97931 at_status=$? at_failed=false
   97932 $at_check_filter
   97933 echo stderr:; tee stderr <"$at_stderr"
   97934 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97935 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
   97936 $at_failed && at_fn_log_failure
   97937 $at_traceon; }
   97938 
   97939 { set +x
   97940 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   97941 at_fn_check_prepare_trace "calc.at:654"
   97942 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   97943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97944 at_status=$? at_failed=false
   97945 $at_check_filter
   97946 echo stderr:; tee stderr <"$at_stderr"
   97947 at_fn_diff_devnull "$at_stdout" || at_failed=:
   97948 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97949 $at_failed && at_fn_log_failure
   97950 $at_traceon; }
   97951 
   97952 
   97953 
   97954 # Normalize the observed and expected error messages, depending upon the
   97955 # options.
   97956 # 1. Remove the traces from observed.
   97957 sed '/^Starting/d
   97958 /^Entering/d
   97959 /^Stack/d
   97960 /^Reading/d
   97961 /^Reducing/d
   97962 /^Return/d
   97963 /^Shifting/d
   97964 /^state/d
   97965 /^Cleanup:/d
   97966 /^Error:/d
   97967 /^Next/d
   97968 /^Now/d
   97969 /^Discarding/d
   97970 / \$[0-9$]* = /d
   97971 /^yydestructor:/d' stderr >at-stderr
   97972 mv at-stderr stderr
   97973 # 2. Create the reference error message.
   97974 cat >expout <<'_ATEOF'
   97975 1.7: syntax error, unexpected '='
   97976 _ATEOF
   97977 
   97978 # 3. If locations are not used, remove them.
   97979 
   97980 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   97981 
   97982 # 5. Check
   97983 { set +x
   97984 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   97985 at_fn_check_prepare_trace "calc.at:654"
   97986 ( $at_check_trace; cat stderr
   97987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   97988 at_status=$? at_failed=false
   97989 $at_check_filter
   97990 at_fn_diff_devnull "$at_stderr" || at_failed=:
   97991 $at_diff expout "$at_stdout" || at_failed=:
   97992 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   97993 $at_failed && at_fn_log_failure
   97994 $at_traceon; }
   97995 
   97996 
   97997 cat >input <<'_ATEOF'
   97998 
   97999 +1
   98000 _ATEOF
   98001 
   98002 { set +x
   98003 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   98004 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   98005 ( $at_check_trace;  $PREPARSER ./calc input
   98006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98007 at_status=$? at_failed=false
   98008 $at_check_filter
   98009 echo stderr:; tee stderr <"$at_stderr"
   98010 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98011 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
   98012 $at_failed && at_fn_log_failure
   98013 $at_traceon; }
   98014 
   98015 { set +x
   98016 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98017 at_fn_check_prepare_trace "calc.at:654"
   98018 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98020 at_status=$? at_failed=false
   98021 $at_check_filter
   98022 echo stderr:; tee stderr <"$at_stderr"
   98023 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98024 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98025 $at_failed && at_fn_log_failure
   98026 $at_traceon; }
   98027 
   98028 
   98029 
   98030 # Normalize the observed and expected error messages, depending upon the
   98031 # options.
   98032 # 1. Remove the traces from observed.
   98033 sed '/^Starting/d
   98034 /^Entering/d
   98035 /^Stack/d
   98036 /^Reading/d
   98037 /^Reducing/d
   98038 /^Return/d
   98039 /^Shifting/d
   98040 /^state/d
   98041 /^Cleanup:/d
   98042 /^Error:/d
   98043 /^Next/d
   98044 /^Now/d
   98045 /^Discarding/d
   98046 / \$[0-9$]* = /d
   98047 /^yydestructor:/d' stderr >at-stderr
   98048 mv at-stderr stderr
   98049 # 2. Create the reference error message.
   98050 cat >expout <<'_ATEOF'
   98051 2.1: syntax error, unexpected '+'
   98052 _ATEOF
   98053 
   98054 # 3. If locations are not used, remove them.
   98055 
   98056 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   98057 
   98058 # 5. Check
   98059 { set +x
   98060 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   98061 at_fn_check_prepare_trace "calc.at:654"
   98062 ( $at_check_trace; cat stderr
   98063 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98064 at_status=$? at_failed=false
   98065 $at_check_filter
   98066 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98067 $at_diff expout "$at_stdout" || at_failed=:
   98068 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98069 $at_failed && at_fn_log_failure
   98070 $at_traceon; }
   98071 
   98072 
   98073 # Exercise error messages with EOF: work on an empty file.
   98074 { set +x
   98075 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc /dev/null"
   98076 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:654"
   98077 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   98078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98079 at_status=$? at_failed=false
   98080 $at_check_filter
   98081 echo stderr:; tee stderr <"$at_stderr"
   98082 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98083 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
   98084 $at_failed && at_fn_log_failure
   98085 $at_traceon; }
   98086 
   98087 { set +x
   98088 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98089 at_fn_check_prepare_trace "calc.at:654"
   98090 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98092 at_status=$? at_failed=false
   98093 $at_check_filter
   98094 echo stderr:; tee stderr <"$at_stderr"
   98095 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98096 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98097 $at_failed && at_fn_log_failure
   98098 $at_traceon; }
   98099 
   98100 
   98101 
   98102 # Normalize the observed and expected error messages, depending upon the
   98103 # options.
   98104 # 1. Remove the traces from observed.
   98105 sed '/^Starting/d
   98106 /^Entering/d
   98107 /^Stack/d
   98108 /^Reading/d
   98109 /^Reducing/d
   98110 /^Return/d
   98111 /^Shifting/d
   98112 /^state/d
   98113 /^Cleanup:/d
   98114 /^Error:/d
   98115 /^Next/d
   98116 /^Now/d
   98117 /^Discarding/d
   98118 / \$[0-9$]* = /d
   98119 /^yydestructor:/d' stderr >at-stderr
   98120 mv at-stderr stderr
   98121 # 2. Create the reference error message.
   98122 cat >expout <<'_ATEOF'
   98123 1.1: syntax error, unexpected end of input
   98124 _ATEOF
   98125 
   98126 # 3. If locations are not used, remove them.
   98127 
   98128 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   98129 
   98130 # 5. Check
   98131 { set +x
   98132 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   98133 at_fn_check_prepare_trace "calc.at:654"
   98134 ( $at_check_trace; cat stderr
   98135 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98136 at_status=$? at_failed=false
   98137 $at_check_filter
   98138 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98139 $at_diff expout "$at_stdout" || at_failed=:
   98140 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98141 $at_failed && at_fn_log_failure
   98142 $at_traceon; }
   98143 
   98144 
   98145 
   98146 # Exercise the error token: without it, we die at the first error,
   98147 # hence be sure to
   98148 #
   98149 # - have several errors which exercise different shift/discardings
   98150 #   - (): nothing to pop, nothing to discard
   98151 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   98152 #   - (* * *): nothing to pop, a lot to discard
   98153 #   - (1 + 2 * *): some to pop and discard
   98154 #
   98155 # - test the action associated to `error'
   98156 #
   98157 # - check the lookahead that triggers an error is not discarded
   98158 #   when we enter error recovery.  Below, the lookahead causing the
   98159 #   first error is ")", which is needed to recover from the error and
   98160 #   produce the "0" that triggers the "0 != 1" error.
   98161 #
   98162 cat >input <<'_ATEOF'
   98163 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   98164 _ATEOF
   98165 
   98166 { set +x
   98167 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   98168 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   98169 ( $at_check_trace;  $PREPARSER ./calc input
   98170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98171 at_status=$? at_failed=false
   98172 $at_check_filter
   98173 echo stderr:; tee stderr <"$at_stderr"
   98174 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98175 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98176 $at_failed && at_fn_log_failure
   98177 $at_traceon; }
   98178 
   98179 { set +x
   98180 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98181 at_fn_check_prepare_trace "calc.at:654"
   98182 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98184 at_status=$? at_failed=false
   98185 $at_check_filter
   98186 echo stderr:; tee stderr <"$at_stderr"
   98187 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98188 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98189 $at_failed && at_fn_log_failure
   98190 $at_traceon; }
   98191 
   98192 
   98193 
   98194 # Normalize the observed and expected error messages, depending upon the
   98195 # options.
   98196 # 1. Remove the traces from observed.
   98197 sed '/^Starting/d
   98198 /^Entering/d
   98199 /^Stack/d
   98200 /^Reading/d
   98201 /^Reducing/d
   98202 /^Return/d
   98203 /^Shifting/d
   98204 /^state/d
   98205 /^Cleanup:/d
   98206 /^Error:/d
   98207 /^Next/d
   98208 /^Now/d
   98209 /^Discarding/d
   98210 / \$[0-9$]* = /d
   98211 /^yydestructor:/d' stderr >at-stderr
   98212 mv at-stderr stderr
   98213 # 2. Create the reference error message.
   98214 cat >expout <<'_ATEOF'
   98215 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   98216 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   98217 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   98218 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   98219 calc: error: 4444 != 1
   98220 _ATEOF
   98221 
   98222 # 3. If locations are not used, remove them.
   98223 
   98224 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   98225 
   98226 # 5. Check
   98227 { set +x
   98228 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   98229 at_fn_check_prepare_trace "calc.at:654"
   98230 ( $at_check_trace; cat stderr
   98231 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98232 at_status=$? at_failed=false
   98233 $at_check_filter
   98234 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98235 $at_diff expout "$at_stdout" || at_failed=:
   98236 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98237 $at_failed && at_fn_log_failure
   98238 $at_traceon; }
   98239 
   98240 
   98241 
   98242 # The same, but this time exercising explicitly triggered syntax errors.
   98243 # POSIX says the lookahead causing the error should not be discarded.
   98244 cat >input <<'_ATEOF'
   98245 (!) + (1 2) = 1
   98246 _ATEOF
   98247 
   98248 { set +x
   98249 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   98250 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   98251 ( $at_check_trace;  $PREPARSER ./calc input
   98252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98253 at_status=$? at_failed=false
   98254 $at_check_filter
   98255 echo stderr:; tee stderr <"$at_stderr"
   98256 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98257 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98258 $at_failed && at_fn_log_failure
   98259 $at_traceon; }
   98260 
   98261 { set +x
   98262 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98263 at_fn_check_prepare_trace "calc.at:654"
   98264 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98266 at_status=$? at_failed=false
   98267 $at_check_filter
   98268 echo stderr:; tee stderr <"$at_stderr"
   98269 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98270 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98271 $at_failed && at_fn_log_failure
   98272 $at_traceon; }
   98273 
   98274 
   98275 
   98276 # Normalize the observed and expected error messages, depending upon the
   98277 # options.
   98278 # 1. Remove the traces from observed.
   98279 sed '/^Starting/d
   98280 /^Entering/d
   98281 /^Stack/d
   98282 /^Reading/d
   98283 /^Reducing/d
   98284 /^Return/d
   98285 /^Shifting/d
   98286 /^state/d
   98287 /^Cleanup:/d
   98288 /^Error:/d
   98289 /^Next/d
   98290 /^Now/d
   98291 /^Discarding/d
   98292 / \$[0-9$]* = /d
   98293 /^yydestructor:/d' stderr >at-stderr
   98294 mv at-stderr stderr
   98295 # 2. Create the reference error message.
   98296 cat >expout <<'_ATEOF'
   98297 1.10: syntax error, unexpected number
   98298 calc: error: 2222 != 1
   98299 _ATEOF
   98300 
   98301 # 3. If locations are not used, remove them.
   98302 
   98303 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   98304 
   98305 # 5. Check
   98306 { set +x
   98307 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   98308 at_fn_check_prepare_trace "calc.at:654"
   98309 ( $at_check_trace; cat stderr
   98310 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98311 at_status=$? at_failed=false
   98312 $at_check_filter
   98313 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98314 $at_diff expout "$at_stdout" || at_failed=:
   98315 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98316 $at_failed && at_fn_log_failure
   98317 $at_traceon; }
   98318 
   98319 
   98320 cat >input <<'_ATEOF'
   98321 (- *) + (1 2) = 1
   98322 _ATEOF
   98323 
   98324 { set +x
   98325 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   98326 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   98327 ( $at_check_trace;  $PREPARSER ./calc input
   98328 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98329 at_status=$? at_failed=false
   98330 $at_check_filter
   98331 echo stderr:; tee stderr <"$at_stderr"
   98332 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98333 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98334 $at_failed && at_fn_log_failure
   98335 $at_traceon; }
   98336 
   98337 { set +x
   98338 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98339 at_fn_check_prepare_trace "calc.at:654"
   98340 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98341 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98342 at_status=$? at_failed=false
   98343 $at_check_filter
   98344 echo stderr:; tee stderr <"$at_stderr"
   98345 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98346 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98347 $at_failed && at_fn_log_failure
   98348 $at_traceon; }
   98349 
   98350 
   98351 
   98352 # Normalize the observed and expected error messages, depending upon the
   98353 # options.
   98354 # 1. Remove the traces from observed.
   98355 sed '/^Starting/d
   98356 /^Entering/d
   98357 /^Stack/d
   98358 /^Reading/d
   98359 /^Reducing/d
   98360 /^Return/d
   98361 /^Shifting/d
   98362 /^state/d
   98363 /^Cleanup:/d
   98364 /^Error:/d
   98365 /^Next/d
   98366 /^Now/d
   98367 /^Discarding/d
   98368 / \$[0-9$]* = /d
   98369 /^yydestructor:/d' stderr >at-stderr
   98370 mv at-stderr stderr
   98371 # 2. Create the reference error message.
   98372 cat >expout <<'_ATEOF'
   98373 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   98374 1.12: syntax error, unexpected number
   98375 calc: error: 2222 != 1
   98376 _ATEOF
   98377 
   98378 # 3. If locations are not used, remove them.
   98379 
   98380 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   98381 
   98382 # 5. Check
   98383 { set +x
   98384 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   98385 at_fn_check_prepare_trace "calc.at:654"
   98386 ( $at_check_trace; cat stderr
   98387 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98388 at_status=$? at_failed=false
   98389 $at_check_filter
   98390 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98391 $at_diff expout "$at_stdout" || at_failed=:
   98392 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98393 $at_failed && at_fn_log_failure
   98394 $at_traceon; }
   98395 
   98396 
   98397 
   98398 # Check that yyerrok works properly: second error is not reported,
   98399 # third and fourth are.  Parse status is succesfull.
   98400 cat >input <<'_ATEOF'
   98401 (* *) + (*) + (*)
   98402 _ATEOF
   98403 
   98404 { set +x
   98405 $as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
   98406 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
   98407 ( $at_check_trace;  $PREPARSER ./calc input
   98408 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98409 at_status=$? at_failed=false
   98410 $at_check_filter
   98411 echo stderr:; tee stderr <"$at_stderr"
   98412 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98413 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98414 $at_failed && at_fn_log_failure
   98415 $at_traceon; }
   98416 
   98417 { set +x
   98418 $as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98419 at_fn_check_prepare_trace "calc.at:654"
   98420 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98422 at_status=$? at_failed=false
   98423 $at_check_filter
   98424 echo stderr:; tee stderr <"$at_stderr"
   98425 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98426 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98427 $at_failed && at_fn_log_failure
   98428 $at_traceon; }
   98429 
   98430 
   98431 
   98432 # Normalize the observed and expected error messages, depending upon the
   98433 # options.
   98434 # 1. Remove the traces from observed.
   98435 sed '/^Starting/d
   98436 /^Entering/d
   98437 /^Stack/d
   98438 /^Reading/d
   98439 /^Reducing/d
   98440 /^Return/d
   98441 /^Shifting/d
   98442 /^state/d
   98443 /^Cleanup:/d
   98444 /^Error:/d
   98445 /^Next/d
   98446 /^Now/d
   98447 /^Discarding/d
   98448 / \$[0-9$]* = /d
   98449 /^yydestructor:/d' stderr >at-stderr
   98450 mv at-stderr stderr
   98451 # 2. Create the reference error message.
   98452 cat >expout <<'_ATEOF'
   98453 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   98454 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   98455 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   98456 _ATEOF
   98457 
   98458 # 3. If locations are not used, remove them.
   98459 
   98460 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   98461 
   98462 # 5. Check
   98463 { set +x
   98464 $as_echo "$at_srcdir/calc.at:654: cat stderr"
   98465 at_fn_check_prepare_trace "calc.at:654"
   98466 ( $at_check_trace; cat stderr
   98467 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98468 at_status=$? at_failed=false
   98469 $at_check_filter
   98470 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98471 $at_diff expout "$at_stdout" || at_failed=:
   98472 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
   98473 $at_failed && at_fn_log_failure
   98474 $at_traceon; }
   98475 
   98476 
   98477 
   98478 
   98479 
   98480   set +x
   98481   $at_times_p && times >"$at_times_file"
   98482 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   98483 read at_status <"$at_status_file"
   98484 #AT_STOP_230
   98485 #AT_START_231
   98486 at_fn_group_banner 231 'calc.at:655' \
   98487   "Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 12
   98488 at_xfail=no
   98489 (
   98490   $as_echo "231. $at_setup_line: testing $at_desc ..."
   98491   $at_traceon
   98492 
   98493 
   98494 
   98495 
   98496 
   98497 
   98498 
   98499 
   98500 
   98501 
   98502 cat >calc.y <<'_ATEOF'
   98503 %code top {
   98504 #include <config.h>
   98505 /* We don't need perfect functions for these tests. */
   98506 #undef malloc
   98507 #undef memcmp
   98508 #undef realloc
   98509 }
   98510 
   98511 /* Infix notation calculator--calc */
   98512 %glr-parser %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc
   98513 
   98514 %code requires
   98515 {
   98516 
   98517   /* Exercise pre-prologue dependency to %union.  */
   98518   typedef int semantic_value;
   98519 }
   98520 
   98521 /* Exercise %union. */
   98522 %union
   98523 {
   98524   semantic_value ival;
   98525 };
   98526 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   98527 
   98528 %code provides
   98529 {
   98530   #include <stdio.h>
   98531   /* The input.  */
   98532   extern FILE *input;
   98533   extern semantic_value global_result;
   98534   extern int global_count;
   98535 }
   98536 
   98537 %code
   98538 {
   98539 #include <assert.h>
   98540 #include <string.h>
   98541 #define USE(Var)
   98542 
   98543 FILE *input;
   98544 static int power (int base, int exponent);
   98545 
   98546 static void calcerror ( const char *msg);
   98547 int calclex (void);
   98548 }
   98549 
   98550 
   98551 
   98552 /* Bison Declarations */
   98553 %token CALC_EOF 0 "end of input"
   98554 %token <ival> NUM "number"
   98555 %type  <ival> exp
   98556 
   98557 %nonassoc '=' /* comparison            */
   98558 %left '-' '+'
   98559 %left '*' '/'
   98560 %left NEG     /* negation--unary minus */
   98561 %right '^'    /* exponentiation        */
   98562 
   98563 /* Grammar follows */
   98564 %%
   98565 input:
   98566   line
   98567 | input line         {  }
   98568 ;
   98569 
   98570 line:
   98571   '\n'
   98572 | exp '\n'           { USE ($1); }
   98573 ;
   98574 
   98575 exp:
   98576   NUM                { $$ = $1;             }
   98577 | exp '=' exp
   98578   {
   98579     if ($1 != $3)
   98580       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   98581     $$ = $1;
   98582   }
   98583 | exp '+' exp        { $$ = $1 + $3;        }
   98584 | exp '-' exp        { $$ = $1 - $3;        }
   98585 | exp '*' exp        { $$ = $1 * $3;        }
   98586 | exp '/' exp        { $$ = $1 / $3;        }
   98587 | '-' exp  %prec NEG { $$ = -$2;            }
   98588 | exp '^' exp        { $$ = power ($1, $3); }
   98589 | '(' exp ')'        { $$ = $2;             }
   98590 | '(' error ')'      { $$ = 1111; yyerrok;  }
   98591 | '!'                { $$ = 0; YYERROR;     }
   98592 | '-' error          { $$ = 0; YYERROR;     }
   98593 ;
   98594 %%
   98595 
   98596 static int
   98597 power (int base, int exponent)
   98598 {
   98599   int res = 1;
   98600   assert (0 <= exponent);
   98601   for (/* Niente */; exponent; --exponent)
   98602     res *= base;
   98603   return res;
   98604 }
   98605 
   98606 
   98607 #include <stdio.h>
   98608 /* A C error reporting function.  */
   98609 static
   98610 void calcerror ( const char *msg)
   98611 {
   98612   YY_LOCATION_PRINT (stderr, (calclloc));
   98613   fprintf (stderr, ": ");
   98614   fprintf (stderr, "%s\n", msg);
   98615 }
   98616 _ATEOF
   98617 
   98618 
   98619 
   98620 cat >calc-lex.c <<'_ATEOF'
   98621 #include <config.h>
   98622 /* We don't need perfect functions for these tests. */
   98623 #undef malloc
   98624 #undef memcmp
   98625 #undef realloc
   98626 
   98627 #include "calc.h"
   98628 
   98629 #include <ctype.h>
   98630 
   98631 int calclex (void);
   98632 static int get_char (void);
   98633 static void unget_char ( int c);
   98634 
   98635 
   98636 static CALCLTYPE last_yylloc;
   98637 
   98638 static int
   98639 get_char (void)
   98640 {
   98641   int res = getc (input);
   98642   ;
   98643 
   98644   last_yylloc = (calclloc);
   98645   if (res == '\n')
   98646     {
   98647       (calclloc).last_line++;
   98648       (calclloc).last_column = 1;
   98649     }
   98650   else
   98651     (calclloc).last_column++;
   98652 
   98653   return res;
   98654 }
   98655 
   98656 static void
   98657 unget_char ( int c)
   98658 {
   98659   ;
   98660 
   98661   /* Wrong when C == `\n'. */
   98662   (calclloc) = last_yylloc;
   98663 
   98664   ungetc (c, input);
   98665 }
   98666 
   98667 static int
   98668 read_signed_integer (void)
   98669 {
   98670   int c = get_char ();
   98671   int sign = 1;
   98672   int n = 0;
   98673 
   98674   ;
   98675   if (c == '-')
   98676     {
   98677       c = get_char ();
   98678       sign = -1;
   98679     }
   98680 
   98681   while (isdigit (c))
   98682     {
   98683       n = 10 * n + (c - '0');
   98684       c = get_char ();
   98685     }
   98686 
   98687   unget_char ( c);
   98688 
   98689   return sign * n;
   98690 }
   98691 
   98692 
   98693 /*---------------------------------------------------------------.
   98694 | Lexical analyzer returns an integer on the stack and the token |
   98695 | NUM, or the ASCII character read if not a number.  Skips all   |
   98696 | blanks and tabs, returns 0 for EOF.                            |
   98697 `---------------------------------------------------------------*/
   98698 
   98699 int calclex (void)
   98700 {
   98701   int c;
   98702   /* Skip current token, then white spaces.  */
   98703   do
   98704     {
   98705      (calclloc).first_column = (calclloc).last_column;
   98706       (calclloc).first_line   = (calclloc).last_line;
   98707 
   98708     }
   98709   while ((c = get_char ()) == ' ' || c == '\t');
   98710 
   98711   /* process numbers   */
   98712   if (c == '.' || isdigit (c))
   98713     {
   98714       unget_char ( c);
   98715       (calclval).ival = read_signed_integer ();
   98716       return NUM;
   98717     }
   98718 
   98719   /* Return end-of-file.  */
   98720   if (c == EOF)
   98721     return CALC_EOF;
   98722 
   98723   /* Return single chars. */
   98724   return c;
   98725 }
   98726 _ATEOF
   98727 
   98728 
   98729 cat >calc-main.c <<'_ATEOF'
   98730 #include <config.h>
   98731 /* We don't need perfect functions for these tests. */
   98732 #undef malloc
   98733 #undef memcmp
   98734 #undef realloc
   98735 
   98736 #include "calc.h"
   98737 
   98738 #include <assert.h>
   98739 #if HAVE_UNISTD_H
   98740 # include <unistd.h>
   98741 #else
   98742 # undef alarm
   98743 # define alarm(seconds) /* empty */
   98744 #endif
   98745 
   98746 
   98747 
   98748 semantic_value global_result = 0;
   98749 int global_count = 0;
   98750 
   98751 /* A C main function.  */
   98752 int
   98753 main (int argc, const char **argv)
   98754 {
   98755   semantic_value result = 0;
   98756   int count = 0;
   98757   int status;
   98758 
   98759   /* This used to be alarm (10), but that isn't enough time for
   98760      a July 1995 vintage DEC Alphastation 200 4/100 system,
   98761      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   98762   alarm (100);
   98763 
   98764   if (argc == 2)
   98765     input = fopen (argv[1], "r");
   98766   else
   98767     input = stdin;
   98768 
   98769   if (!input)
   98770     {
   98771       perror (argv[1]);
   98772       return 3;
   98773     }
   98774 
   98775   calcdebug = 1;
   98776   status = calcparse ();
   98777   if (fclose (input))
   98778     perror ("fclose");
   98779   assert (global_result == result);
   98780   assert (global_count == count);
   98781   return status;
   98782 }
   98783 _ATEOF
   98784 
   98785 
   98786 
   98787 
   98788 
   98789 
   98790 
   98791 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   98792   at_save_special_files
   98793   mkdir xml-tests
   98794     # Don't combine these Bison invocations since we want to be sure that
   98795   # --report=all isn't required to get the full XML file.
   98796   { set +x
   98797 $as_echo "$at_srcdir/calc.at:655: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   98798                   --graph=xml-tests/test.dot -o calc.c calc.y"
   98799 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655"
   98800 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   98801                   --graph=xml-tests/test.dot -o calc.c calc.y
   98802 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98803 at_status=$? at_failed=false
   98804 $at_check_filter
   98805 echo stderr:; cat "$at_stderr"
   98806 echo stdout:; cat "$at_stdout"
   98807 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98808 $at_failed && at_fn_log_failure
   98809 $at_traceon; }
   98810 
   98811   { set +x
   98812 $as_echo "$at_srcdir/calc.at:655: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   98813 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:655"
   98814 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   98815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98816 at_status=$? at_failed=false
   98817 $at_check_filter
   98818 echo stderr:; cat "$at_stderr"
   98819 echo stdout:; cat "$at_stdout"
   98820 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98821 $at_failed && at_fn_log_failure
   98822 $at_traceon; }
   98823 
   98824     cp xml-tests/test.output expout
   98825   { set +x
   98826 $as_echo "$at_srcdir/calc.at:655: \$XSLTPROC \\
   98827              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   98828              xml-tests/test.xml"
   98829 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:655"
   98830 ( $at_check_trace; $XSLTPROC \
   98831              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   98832              xml-tests/test.xml
   98833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98834 at_status=$? at_failed=false
   98835 $at_check_filter
   98836 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98837 $at_diff expout "$at_stdout" || at_failed=:
   98838 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98839 $at_failed && at_fn_log_failure
   98840 $at_traceon; }
   98841 
   98842   sort xml-tests/test.dot > expout
   98843   { set +x
   98844 $as_echo "$at_srcdir/calc.at:655: \$XSLTPROC \\
   98845              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   98846              xml-tests/test.xml | sort"
   98847 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:655"
   98848 ( $at_check_trace; $XSLTPROC \
   98849              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   98850              xml-tests/test.xml | sort
   98851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98852 at_status=$? at_failed=false
   98853 $at_check_filter
   98854 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98855 $at_diff expout "$at_stdout" || at_failed=:
   98856 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98857 $at_failed && at_fn_log_failure
   98858 $at_traceon; }
   98859 
   98860   rm -rf xml-tests expout
   98861   at_restore_special_files
   98862 fi
   98863 { set +x
   98864 $as_echo "$at_srcdir/calc.at:655: bison -o calc.c calc.y"
   98865 at_fn_check_prepare_trace "calc.at:655"
   98866 ( $at_check_trace; bison -o calc.c calc.y
   98867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98868 at_status=$? at_failed=false
   98869 $at_check_filter
   98870 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98871 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98872 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98873 $at_failed && at_fn_log_failure
   98874 $at_traceon; }
   98875 
   98876 
   98877    { set +x
   98878 $as_echo "$at_srcdir/calc.at:655: \$BISON_C_WORKS"
   98879 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:655"
   98880 ( $at_check_trace; $BISON_C_WORKS
   98881 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98882 at_status=$? at_failed=false
   98883 $at_check_filter
   98884 echo stderr:; cat "$at_stderr"
   98885 echo stdout:; cat "$at_stdout"
   98886 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98887 $at_failed && at_fn_log_failure
   98888 $at_traceon; }
   98889 
   98890 { set +x
   98891 $as_echo "$at_srcdir/calc.at:655: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   98892 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:655"
   98893 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   98894 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98895 at_status=$? at_failed=false
   98896 $at_check_filter
   98897 echo stderr:; cat "$at_stderr"
   98898 echo stdout:; cat "$at_stdout"
   98899 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98900 $at_failed && at_fn_log_failure
   98901 $at_traceon; }
   98902 
   98903 
   98904 { set +x
   98905 $as_echo "$at_srcdir/calc.at:655: \$PERL -ne '
   98906   chomp;
   98907   print \"\$.: {\$_}\\n\"
   98908     if (# No starting/ending empty lines.
   98909         (eof || \$. == 1) && /^\\s*\$/
   98910         # No trailing space.  FIXME: not ready for \"maint\".
   98911         # || /\\s\$/
   98912         )' calc.c
   98913 "
   98914 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655"
   98915 ( $at_check_trace; $PERL -ne '
   98916   chomp;
   98917   print "$.: {$_}\n"
   98918     if (# No starting/ending empty lines.
   98919         (eof || $. == 1) && /^\s*$/
   98920         # No trailing space.  FIXME: not ready for "maint".
   98921         # || /\s$/
   98922         )' calc.c
   98923 
   98924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98925 at_status=$? at_failed=false
   98926 $at_check_filter
   98927 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98928 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98929 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98930 $at_failed && at_fn_log_failure
   98931 $at_traceon; }
   98932 
   98933 { set +x
   98934 $as_echo "$at_srcdir/calc.at:655: \$PERL -ne '
   98935   chomp;
   98936   print \"\$.: {\$_}\\n\"
   98937     if (# No starting/ending empty lines.
   98938         (eof || \$. == 1) && /^\\s*\$/
   98939         # No trailing space.  FIXME: not ready for \"maint\".
   98940         # || /\\s\$/
   98941         )' calc.h
   98942 "
   98943 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655"
   98944 ( $at_check_trace; $PERL -ne '
   98945   chomp;
   98946   print "$.: {$_}\n"
   98947     if (# No starting/ending empty lines.
   98948         (eof || $. == 1) && /^\s*$/
   98949         # No trailing space.  FIXME: not ready for "maint".
   98950         # || /\s$/
   98951         )' calc.h
   98952 
   98953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98954 at_status=$? at_failed=false
   98955 $at_check_filter
   98956 at_fn_diff_devnull "$at_stderr" || at_failed=:
   98957 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98958 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98959 $at_failed && at_fn_log_failure
   98960 $at_traceon; }
   98961 
   98962 
   98963 # Test the priorities.
   98964 cat >input <<'_ATEOF'
   98965 1 + 2 * 3 = 7
   98966 1 + 2 * -3 = -5
   98967 
   98968 -1^2 = -1
   98969 (-1)^2 = 1
   98970 
   98971 ---1 = -1
   98972 
   98973 1 - 2 - 3 = -4
   98974 1 - (2 - 3) = 2
   98975 
   98976 2^2^3 = 256
   98977 (2^2)^3 = 64
   98978 _ATEOF
   98979 
   98980 { set +x
   98981 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   98982 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   98983 ( $at_check_trace;  $PREPARSER ./calc input
   98984 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98985 at_status=$? at_failed=false
   98986 $at_check_filter
   98987 echo stderr:; tee stderr <"$at_stderr"
   98988 at_fn_diff_devnull "$at_stdout" || at_failed=:
   98989 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   98990 $at_failed && at_fn_log_failure
   98991 $at_traceon; }
   98992 
   98993 { set +x
   98994 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   98995 at_fn_check_prepare_trace "calc.at:655"
   98996 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   98997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   98998 at_status=$? at_failed=false
   98999 $at_check_filter
   99000 echo stderr:; tee stderr <"$at_stderr"
   99001 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99002 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99003 $at_failed && at_fn_log_failure
   99004 $at_traceon; }
   99005 
   99006 
   99007 
   99008 
   99009 # Some syntax errors.
   99010 cat >input <<'_ATEOF'
   99011 1 2
   99012 _ATEOF
   99013 
   99014 { set +x
   99015 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99016 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99017 ( $at_check_trace;  $PREPARSER ./calc input
   99018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99019 at_status=$? at_failed=false
   99020 $at_check_filter
   99021 echo stderr:; tee stderr <"$at_stderr"
   99022 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99023 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655"
   99024 $at_failed && at_fn_log_failure
   99025 $at_traceon; }
   99026 
   99027 { set +x
   99028 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99029 at_fn_check_prepare_trace "calc.at:655"
   99030 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99032 at_status=$? at_failed=false
   99033 $at_check_filter
   99034 echo stderr:; tee stderr <"$at_stderr"
   99035 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99036 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99037 $at_failed && at_fn_log_failure
   99038 $at_traceon; }
   99039 
   99040 
   99041 
   99042 # Normalize the observed and expected error messages, depending upon the
   99043 # options.
   99044 # 1. Remove the traces from observed.
   99045 sed '/^Starting/d
   99046 /^Entering/d
   99047 /^Stack/d
   99048 /^Reading/d
   99049 /^Reducing/d
   99050 /^Return/d
   99051 /^Shifting/d
   99052 /^state/d
   99053 /^Cleanup:/d
   99054 /^Error:/d
   99055 /^Next/d
   99056 /^Now/d
   99057 /^Discarding/d
   99058 / \$[0-9$]* = /d
   99059 /^yydestructor:/d' stderr >at-stderr
   99060 mv at-stderr stderr
   99061 # 2. Create the reference error message.
   99062 cat >expout <<'_ATEOF'
   99063 1.3: syntax error, unexpected number
   99064 _ATEOF
   99065 
   99066 # 3. If locations are not used, remove them.
   99067 
   99068 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99069 
   99070 # 5. Check
   99071 { set +x
   99072 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99073 at_fn_check_prepare_trace "calc.at:655"
   99074 ( $at_check_trace; cat stderr
   99075 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99076 at_status=$? at_failed=false
   99077 $at_check_filter
   99078 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99079 $at_diff expout "$at_stdout" || at_failed=:
   99080 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99081 $at_failed && at_fn_log_failure
   99082 $at_traceon; }
   99083 
   99084 
   99085 cat >input <<'_ATEOF'
   99086 1//2
   99087 _ATEOF
   99088 
   99089 { set +x
   99090 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99091 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99092 ( $at_check_trace;  $PREPARSER ./calc input
   99093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99094 at_status=$? at_failed=false
   99095 $at_check_filter
   99096 echo stderr:; tee stderr <"$at_stderr"
   99097 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99098 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655"
   99099 $at_failed && at_fn_log_failure
   99100 $at_traceon; }
   99101 
   99102 { set +x
   99103 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99104 at_fn_check_prepare_trace "calc.at:655"
   99105 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99107 at_status=$? at_failed=false
   99108 $at_check_filter
   99109 echo stderr:; tee stderr <"$at_stderr"
   99110 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99111 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99112 $at_failed && at_fn_log_failure
   99113 $at_traceon; }
   99114 
   99115 
   99116 
   99117 # Normalize the observed and expected error messages, depending upon the
   99118 # options.
   99119 # 1. Remove the traces from observed.
   99120 sed '/^Starting/d
   99121 /^Entering/d
   99122 /^Stack/d
   99123 /^Reading/d
   99124 /^Reducing/d
   99125 /^Return/d
   99126 /^Shifting/d
   99127 /^state/d
   99128 /^Cleanup:/d
   99129 /^Error:/d
   99130 /^Next/d
   99131 /^Now/d
   99132 /^Discarding/d
   99133 / \$[0-9$]* = /d
   99134 /^yydestructor:/d' stderr >at-stderr
   99135 mv at-stderr stderr
   99136 # 2. Create the reference error message.
   99137 cat >expout <<'_ATEOF'
   99138 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   99139 _ATEOF
   99140 
   99141 # 3. If locations are not used, remove them.
   99142 
   99143 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99144 
   99145 # 5. Check
   99146 { set +x
   99147 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99148 at_fn_check_prepare_trace "calc.at:655"
   99149 ( $at_check_trace; cat stderr
   99150 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99151 at_status=$? at_failed=false
   99152 $at_check_filter
   99153 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99154 $at_diff expout "$at_stdout" || at_failed=:
   99155 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99156 $at_failed && at_fn_log_failure
   99157 $at_traceon; }
   99158 
   99159 
   99160 cat >input <<'_ATEOF'
   99161 error
   99162 _ATEOF
   99163 
   99164 { set +x
   99165 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99166 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99167 ( $at_check_trace;  $PREPARSER ./calc input
   99168 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99169 at_status=$? at_failed=false
   99170 $at_check_filter
   99171 echo stderr:; tee stderr <"$at_stderr"
   99172 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99173 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655"
   99174 $at_failed && at_fn_log_failure
   99175 $at_traceon; }
   99176 
   99177 { set +x
   99178 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99179 at_fn_check_prepare_trace "calc.at:655"
   99180 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99181 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99182 at_status=$? at_failed=false
   99183 $at_check_filter
   99184 echo stderr:; tee stderr <"$at_stderr"
   99185 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99186 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99187 $at_failed && at_fn_log_failure
   99188 $at_traceon; }
   99189 
   99190 
   99191 
   99192 # Normalize the observed and expected error messages, depending upon the
   99193 # options.
   99194 # 1. Remove the traces from observed.
   99195 sed '/^Starting/d
   99196 /^Entering/d
   99197 /^Stack/d
   99198 /^Reading/d
   99199 /^Reducing/d
   99200 /^Return/d
   99201 /^Shifting/d
   99202 /^state/d
   99203 /^Cleanup:/d
   99204 /^Error:/d
   99205 /^Next/d
   99206 /^Now/d
   99207 /^Discarding/d
   99208 / \$[0-9$]* = /d
   99209 /^yydestructor:/d' stderr >at-stderr
   99210 mv at-stderr stderr
   99211 # 2. Create the reference error message.
   99212 cat >expout <<'_ATEOF'
   99213 1.1: syntax error, unexpected $undefined
   99214 _ATEOF
   99215 
   99216 # 3. If locations are not used, remove them.
   99217 
   99218 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99219 
   99220 # 5. Check
   99221 { set +x
   99222 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99223 at_fn_check_prepare_trace "calc.at:655"
   99224 ( $at_check_trace; cat stderr
   99225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99226 at_status=$? at_failed=false
   99227 $at_check_filter
   99228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99229 $at_diff expout "$at_stdout" || at_failed=:
   99230 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99231 $at_failed && at_fn_log_failure
   99232 $at_traceon; }
   99233 
   99234 
   99235 cat >input <<'_ATEOF'
   99236 1 = 2 = 3
   99237 _ATEOF
   99238 
   99239 { set +x
   99240 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99241 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99242 ( $at_check_trace;  $PREPARSER ./calc input
   99243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99244 at_status=$? at_failed=false
   99245 $at_check_filter
   99246 echo stderr:; tee stderr <"$at_stderr"
   99247 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99248 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655"
   99249 $at_failed && at_fn_log_failure
   99250 $at_traceon; }
   99251 
   99252 { set +x
   99253 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99254 at_fn_check_prepare_trace "calc.at:655"
   99255 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99256 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99257 at_status=$? at_failed=false
   99258 $at_check_filter
   99259 echo stderr:; tee stderr <"$at_stderr"
   99260 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99261 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99262 $at_failed && at_fn_log_failure
   99263 $at_traceon; }
   99264 
   99265 
   99266 
   99267 # Normalize the observed and expected error messages, depending upon the
   99268 # options.
   99269 # 1. Remove the traces from observed.
   99270 sed '/^Starting/d
   99271 /^Entering/d
   99272 /^Stack/d
   99273 /^Reading/d
   99274 /^Reducing/d
   99275 /^Return/d
   99276 /^Shifting/d
   99277 /^state/d
   99278 /^Cleanup:/d
   99279 /^Error:/d
   99280 /^Next/d
   99281 /^Now/d
   99282 /^Discarding/d
   99283 / \$[0-9$]* = /d
   99284 /^yydestructor:/d' stderr >at-stderr
   99285 mv at-stderr stderr
   99286 # 2. Create the reference error message.
   99287 cat >expout <<'_ATEOF'
   99288 1.7: syntax error, unexpected '='
   99289 _ATEOF
   99290 
   99291 # 3. If locations are not used, remove them.
   99292 
   99293 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99294 
   99295 # 5. Check
   99296 { set +x
   99297 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99298 at_fn_check_prepare_trace "calc.at:655"
   99299 ( $at_check_trace; cat stderr
   99300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99301 at_status=$? at_failed=false
   99302 $at_check_filter
   99303 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99304 $at_diff expout "$at_stdout" || at_failed=:
   99305 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99306 $at_failed && at_fn_log_failure
   99307 $at_traceon; }
   99308 
   99309 
   99310 cat >input <<'_ATEOF'
   99311 
   99312 +1
   99313 _ATEOF
   99314 
   99315 { set +x
   99316 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99317 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99318 ( $at_check_trace;  $PREPARSER ./calc input
   99319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99320 at_status=$? at_failed=false
   99321 $at_check_filter
   99322 echo stderr:; tee stderr <"$at_stderr"
   99323 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99324 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655"
   99325 $at_failed && at_fn_log_failure
   99326 $at_traceon; }
   99327 
   99328 { set +x
   99329 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99330 at_fn_check_prepare_trace "calc.at:655"
   99331 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99333 at_status=$? at_failed=false
   99334 $at_check_filter
   99335 echo stderr:; tee stderr <"$at_stderr"
   99336 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99337 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99338 $at_failed && at_fn_log_failure
   99339 $at_traceon; }
   99340 
   99341 
   99342 
   99343 # Normalize the observed and expected error messages, depending upon the
   99344 # options.
   99345 # 1. Remove the traces from observed.
   99346 sed '/^Starting/d
   99347 /^Entering/d
   99348 /^Stack/d
   99349 /^Reading/d
   99350 /^Reducing/d
   99351 /^Return/d
   99352 /^Shifting/d
   99353 /^state/d
   99354 /^Cleanup:/d
   99355 /^Error:/d
   99356 /^Next/d
   99357 /^Now/d
   99358 /^Discarding/d
   99359 / \$[0-9$]* = /d
   99360 /^yydestructor:/d' stderr >at-stderr
   99361 mv at-stderr stderr
   99362 # 2. Create the reference error message.
   99363 cat >expout <<'_ATEOF'
   99364 2.1: syntax error, unexpected '+'
   99365 _ATEOF
   99366 
   99367 # 3. If locations are not used, remove them.
   99368 
   99369 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99370 
   99371 # 5. Check
   99372 { set +x
   99373 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99374 at_fn_check_prepare_trace "calc.at:655"
   99375 ( $at_check_trace; cat stderr
   99376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99377 at_status=$? at_failed=false
   99378 $at_check_filter
   99379 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99380 $at_diff expout "$at_stdout" || at_failed=:
   99381 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99382 $at_failed && at_fn_log_failure
   99383 $at_traceon; }
   99384 
   99385 
   99386 # Exercise error messages with EOF: work on an empty file.
   99387 { set +x
   99388 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc /dev/null"
   99389 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:655"
   99390 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   99391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99392 at_status=$? at_failed=false
   99393 $at_check_filter
   99394 echo stderr:; tee stderr <"$at_stderr"
   99395 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99396 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655"
   99397 $at_failed && at_fn_log_failure
   99398 $at_traceon; }
   99399 
   99400 { set +x
   99401 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99402 at_fn_check_prepare_trace "calc.at:655"
   99403 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99405 at_status=$? at_failed=false
   99406 $at_check_filter
   99407 echo stderr:; tee stderr <"$at_stderr"
   99408 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99409 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99410 $at_failed && at_fn_log_failure
   99411 $at_traceon; }
   99412 
   99413 
   99414 
   99415 # Normalize the observed and expected error messages, depending upon the
   99416 # options.
   99417 # 1. Remove the traces from observed.
   99418 sed '/^Starting/d
   99419 /^Entering/d
   99420 /^Stack/d
   99421 /^Reading/d
   99422 /^Reducing/d
   99423 /^Return/d
   99424 /^Shifting/d
   99425 /^state/d
   99426 /^Cleanup:/d
   99427 /^Error:/d
   99428 /^Next/d
   99429 /^Now/d
   99430 /^Discarding/d
   99431 / \$[0-9$]* = /d
   99432 /^yydestructor:/d' stderr >at-stderr
   99433 mv at-stderr stderr
   99434 # 2. Create the reference error message.
   99435 cat >expout <<'_ATEOF'
   99436 1.1: syntax error, unexpected end of input
   99437 _ATEOF
   99438 
   99439 # 3. If locations are not used, remove them.
   99440 
   99441 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99442 
   99443 # 5. Check
   99444 { set +x
   99445 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99446 at_fn_check_prepare_trace "calc.at:655"
   99447 ( $at_check_trace; cat stderr
   99448 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99449 at_status=$? at_failed=false
   99450 $at_check_filter
   99451 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99452 $at_diff expout "$at_stdout" || at_failed=:
   99453 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99454 $at_failed && at_fn_log_failure
   99455 $at_traceon; }
   99456 
   99457 
   99458 
   99459 # Exercise the error token: without it, we die at the first error,
   99460 # hence be sure to
   99461 #
   99462 # - have several errors which exercise different shift/discardings
   99463 #   - (): nothing to pop, nothing to discard
   99464 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   99465 #   - (* * *): nothing to pop, a lot to discard
   99466 #   - (1 + 2 * *): some to pop and discard
   99467 #
   99468 # - test the action associated to `error'
   99469 #
   99470 # - check the lookahead that triggers an error is not discarded
   99471 #   when we enter error recovery.  Below, the lookahead causing the
   99472 #   first error is ")", which is needed to recover from the error and
   99473 #   produce the "0" that triggers the "0 != 1" error.
   99474 #
   99475 cat >input <<'_ATEOF'
   99476 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   99477 _ATEOF
   99478 
   99479 { set +x
   99480 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99481 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99482 ( $at_check_trace;  $PREPARSER ./calc input
   99483 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99484 at_status=$? at_failed=false
   99485 $at_check_filter
   99486 echo stderr:; tee stderr <"$at_stderr"
   99487 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99488 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99489 $at_failed && at_fn_log_failure
   99490 $at_traceon; }
   99491 
   99492 { set +x
   99493 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99494 at_fn_check_prepare_trace "calc.at:655"
   99495 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99497 at_status=$? at_failed=false
   99498 $at_check_filter
   99499 echo stderr:; tee stderr <"$at_stderr"
   99500 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99501 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99502 $at_failed && at_fn_log_failure
   99503 $at_traceon; }
   99504 
   99505 
   99506 
   99507 # Normalize the observed and expected error messages, depending upon the
   99508 # options.
   99509 # 1. Remove the traces from observed.
   99510 sed '/^Starting/d
   99511 /^Entering/d
   99512 /^Stack/d
   99513 /^Reading/d
   99514 /^Reducing/d
   99515 /^Return/d
   99516 /^Shifting/d
   99517 /^state/d
   99518 /^Cleanup:/d
   99519 /^Error:/d
   99520 /^Next/d
   99521 /^Now/d
   99522 /^Discarding/d
   99523 / \$[0-9$]* = /d
   99524 /^yydestructor:/d' stderr >at-stderr
   99525 mv at-stderr stderr
   99526 # 2. Create the reference error message.
   99527 cat >expout <<'_ATEOF'
   99528 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   99529 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   99530 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   99531 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   99532 calc: error: 4444 != 1
   99533 _ATEOF
   99534 
   99535 # 3. If locations are not used, remove them.
   99536 
   99537 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99538 
   99539 # 5. Check
   99540 { set +x
   99541 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99542 at_fn_check_prepare_trace "calc.at:655"
   99543 ( $at_check_trace; cat stderr
   99544 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99545 at_status=$? at_failed=false
   99546 $at_check_filter
   99547 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99548 $at_diff expout "$at_stdout" || at_failed=:
   99549 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99550 $at_failed && at_fn_log_failure
   99551 $at_traceon; }
   99552 
   99553 
   99554 
   99555 # The same, but this time exercising explicitly triggered syntax errors.
   99556 # POSIX says the lookahead causing the error should not be discarded.
   99557 cat >input <<'_ATEOF'
   99558 (!) + (1 2) = 1
   99559 _ATEOF
   99560 
   99561 { set +x
   99562 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99563 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99564 ( $at_check_trace;  $PREPARSER ./calc input
   99565 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99566 at_status=$? at_failed=false
   99567 $at_check_filter
   99568 echo stderr:; tee stderr <"$at_stderr"
   99569 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99570 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99571 $at_failed && at_fn_log_failure
   99572 $at_traceon; }
   99573 
   99574 { set +x
   99575 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99576 at_fn_check_prepare_trace "calc.at:655"
   99577 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99578 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99579 at_status=$? at_failed=false
   99580 $at_check_filter
   99581 echo stderr:; tee stderr <"$at_stderr"
   99582 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99583 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99584 $at_failed && at_fn_log_failure
   99585 $at_traceon; }
   99586 
   99587 
   99588 
   99589 # Normalize the observed and expected error messages, depending upon the
   99590 # options.
   99591 # 1. Remove the traces from observed.
   99592 sed '/^Starting/d
   99593 /^Entering/d
   99594 /^Stack/d
   99595 /^Reading/d
   99596 /^Reducing/d
   99597 /^Return/d
   99598 /^Shifting/d
   99599 /^state/d
   99600 /^Cleanup:/d
   99601 /^Error:/d
   99602 /^Next/d
   99603 /^Now/d
   99604 /^Discarding/d
   99605 / \$[0-9$]* = /d
   99606 /^yydestructor:/d' stderr >at-stderr
   99607 mv at-stderr stderr
   99608 # 2. Create the reference error message.
   99609 cat >expout <<'_ATEOF'
   99610 1.10: syntax error, unexpected number
   99611 calc: error: 2222 != 1
   99612 _ATEOF
   99613 
   99614 # 3. If locations are not used, remove them.
   99615 
   99616 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99617 
   99618 # 5. Check
   99619 { set +x
   99620 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99621 at_fn_check_prepare_trace "calc.at:655"
   99622 ( $at_check_trace; cat stderr
   99623 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99624 at_status=$? at_failed=false
   99625 $at_check_filter
   99626 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99627 $at_diff expout "$at_stdout" || at_failed=:
   99628 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99629 $at_failed && at_fn_log_failure
   99630 $at_traceon; }
   99631 
   99632 
   99633 cat >input <<'_ATEOF'
   99634 (- *) + (1 2) = 1
   99635 _ATEOF
   99636 
   99637 { set +x
   99638 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99639 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99640 ( $at_check_trace;  $PREPARSER ./calc input
   99641 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99642 at_status=$? at_failed=false
   99643 $at_check_filter
   99644 echo stderr:; tee stderr <"$at_stderr"
   99645 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99646 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99647 $at_failed && at_fn_log_failure
   99648 $at_traceon; }
   99649 
   99650 { set +x
   99651 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99652 at_fn_check_prepare_trace "calc.at:655"
   99653 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99655 at_status=$? at_failed=false
   99656 $at_check_filter
   99657 echo stderr:; tee stderr <"$at_stderr"
   99658 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99659 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99660 $at_failed && at_fn_log_failure
   99661 $at_traceon; }
   99662 
   99663 
   99664 
   99665 # Normalize the observed and expected error messages, depending upon the
   99666 # options.
   99667 # 1. Remove the traces from observed.
   99668 sed '/^Starting/d
   99669 /^Entering/d
   99670 /^Stack/d
   99671 /^Reading/d
   99672 /^Reducing/d
   99673 /^Return/d
   99674 /^Shifting/d
   99675 /^state/d
   99676 /^Cleanup:/d
   99677 /^Error:/d
   99678 /^Next/d
   99679 /^Now/d
   99680 /^Discarding/d
   99681 / \$[0-9$]* = /d
   99682 /^yydestructor:/d' stderr >at-stderr
   99683 mv at-stderr stderr
   99684 # 2. Create the reference error message.
   99685 cat >expout <<'_ATEOF'
   99686 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   99687 1.12: syntax error, unexpected number
   99688 calc: error: 2222 != 1
   99689 _ATEOF
   99690 
   99691 # 3. If locations are not used, remove them.
   99692 
   99693 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99694 
   99695 # 5. Check
   99696 { set +x
   99697 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99698 at_fn_check_prepare_trace "calc.at:655"
   99699 ( $at_check_trace; cat stderr
   99700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99701 at_status=$? at_failed=false
   99702 $at_check_filter
   99703 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99704 $at_diff expout "$at_stdout" || at_failed=:
   99705 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99706 $at_failed && at_fn_log_failure
   99707 $at_traceon; }
   99708 
   99709 
   99710 
   99711 # Check that yyerrok works properly: second error is not reported,
   99712 # third and fourth are.  Parse status is succesfull.
   99713 cat >input <<'_ATEOF'
   99714 (* *) + (*) + (*)
   99715 _ATEOF
   99716 
   99717 { set +x
   99718 $as_echo "$at_srcdir/calc.at:655:  \$PREPARSER ./calc input"
   99719 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655"
   99720 ( $at_check_trace;  $PREPARSER ./calc input
   99721 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99722 at_status=$? at_failed=false
   99723 $at_check_filter
   99724 echo stderr:; tee stderr <"$at_stderr"
   99725 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99726 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99727 $at_failed && at_fn_log_failure
   99728 $at_traceon; }
   99729 
   99730 { set +x
   99731 $as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   99732 at_fn_check_prepare_trace "calc.at:655"
   99733 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   99734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99735 at_status=$? at_failed=false
   99736 $at_check_filter
   99737 echo stderr:; tee stderr <"$at_stderr"
   99738 at_fn_diff_devnull "$at_stdout" || at_failed=:
   99739 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99740 $at_failed && at_fn_log_failure
   99741 $at_traceon; }
   99742 
   99743 
   99744 
   99745 # Normalize the observed and expected error messages, depending upon the
   99746 # options.
   99747 # 1. Remove the traces from observed.
   99748 sed '/^Starting/d
   99749 /^Entering/d
   99750 /^Stack/d
   99751 /^Reading/d
   99752 /^Reducing/d
   99753 /^Return/d
   99754 /^Shifting/d
   99755 /^state/d
   99756 /^Cleanup:/d
   99757 /^Error:/d
   99758 /^Next/d
   99759 /^Now/d
   99760 /^Discarding/d
   99761 / \$[0-9$]* = /d
   99762 /^yydestructor:/d' stderr >at-stderr
   99763 mv at-stderr stderr
   99764 # 2. Create the reference error message.
   99765 cat >expout <<'_ATEOF'
   99766 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   99767 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   99768 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   99769 _ATEOF
   99770 
   99771 # 3. If locations are not used, remove them.
   99772 
   99773 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   99774 
   99775 # 5. Check
   99776 { set +x
   99777 $as_echo "$at_srcdir/calc.at:655: cat stderr"
   99778 at_fn_check_prepare_trace "calc.at:655"
   99779 ( $at_check_trace; cat stderr
   99780 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   99781 at_status=$? at_failed=false
   99782 $at_check_filter
   99783 at_fn_diff_devnull "$at_stderr" || at_failed=:
   99784 $at_diff expout "$at_stdout" || at_failed=:
   99785 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655"
   99786 $at_failed && at_fn_log_failure
   99787 $at_traceon; }
   99788 
   99789 
   99790 
   99791 
   99792 
   99793   set +x
   99794   $at_times_p && times >"$at_times_file"
   99795 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   99796 read at_status <"$at_status_file"
   99797 #AT_STOP_231
   99798 #AT_START_232
   99799 at_fn_group_banner 232 'calc.at:657' \
   99800   "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
   99801 at_xfail=no
   99802 (
   99803   $as_echo "232. $at_setup_line: testing $at_desc ..."
   99804   $at_traceon
   99805 
   99806 
   99807 
   99808 
   99809 
   99810 
   99811 
   99812 
   99813 
   99814 
   99815 cat >calc.y <<'_ATEOF'
   99816 %code top {
   99817 #include <config.h>
   99818 /* We don't need perfect functions for these tests. */
   99819 #undef malloc
   99820 #undef memcmp
   99821 #undef realloc
   99822 }
   99823 
   99824 /* Infix notation calculator--calc */
   99825 %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
   99826 
   99827 %code requires
   99828 {
   99829 
   99830   /* Exercise pre-prologue dependency to %union.  */
   99831   typedef int semantic_value;
   99832 }
   99833 
   99834 /* Exercise %union. */
   99835 %union
   99836 {
   99837   semantic_value ival;
   99838 };
   99839 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   99840 
   99841 %code provides
   99842 {
   99843   #include <stdio.h>
   99844   /* The input.  */
   99845   extern FILE *input;
   99846   extern semantic_value global_result;
   99847   extern int global_count;
   99848 }
   99849 
   99850 %code
   99851 {
   99852 #include <assert.h>
   99853 #include <string.h>
   99854 #define USE(Var)
   99855 
   99856 FILE *input;
   99857 static int power (int base, int exponent);
   99858 
   99859 static void calcerror (YYLTYPE const * const llocp,  const char *msg);
   99860 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
   99861 }
   99862 
   99863 
   99864 
   99865 /* Bison Declarations */
   99866 %token CALC_EOF 0 "end of input"
   99867 %token <ival> NUM "number"
   99868 %type  <ival> exp
   99869 
   99870 %nonassoc '=' /* comparison            */
   99871 %left '-' '+'
   99872 %left '*' '/'
   99873 %left NEG     /* negation--unary minus */
   99874 %right '^'    /* exponentiation        */
   99875 
   99876 /* Grammar follows */
   99877 %%
   99878 input:
   99879   line
   99880 | input line         {  }
   99881 ;
   99882 
   99883 line:
   99884   '\n'
   99885 | exp '\n'           { USE ($1); }
   99886 ;
   99887 
   99888 exp:
   99889   NUM                { $$ = $1;             }
   99890 | exp '=' exp
   99891   {
   99892     if ($1 != $3)
   99893       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   99894     $$ = $1;
   99895   }
   99896 | exp '+' exp        { $$ = $1 + $3;        }
   99897 | exp '-' exp        { $$ = $1 - $3;        }
   99898 | exp '*' exp        { $$ = $1 * $3;        }
   99899 | exp '/' exp        { $$ = $1 / $3;        }
   99900 | '-' exp  %prec NEG { $$ = -$2;            }
   99901 | exp '^' exp        { $$ = power ($1, $3); }
   99902 | '(' exp ')'        { $$ = $2;             }
   99903 | '(' error ')'      { $$ = 1111; yyerrok;  }
   99904 | '!'                { $$ = 0; YYERROR;     }
   99905 | '-' error          { $$ = 0; YYERROR;     }
   99906 ;
   99907 %%
   99908 
   99909 static int
   99910 power (int base, int exponent)
   99911 {
   99912   int res = 1;
   99913   assert (0 <= exponent);
   99914   for (/* Niente */; exponent; --exponent)
   99915     res *= base;
   99916   return res;
   99917 }
   99918 
   99919 
   99920 #include <stdio.h>
   99921 /* A C error reporting function.  */
   99922 static
   99923 void calcerror (YYLTYPE const * const llocp,  const char *msg)
   99924 {
   99925   YY_LOCATION_PRINT (stderr, (*llocp));
   99926   fprintf (stderr, ": ");
   99927   fprintf (stderr, "%s\n", msg);
   99928 }
   99929 _ATEOF
   99930 
   99931 
   99932 
   99933 cat >calc-lex.c <<'_ATEOF'
   99934 #include <config.h>
   99935 /* We don't need perfect functions for these tests. */
   99936 #undef malloc
   99937 #undef memcmp
   99938 #undef realloc
   99939 
   99940 #include "calc.h"
   99941 
   99942 #include <ctype.h>
   99943 
   99944 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
   99945 static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
   99946 static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
   99947 
   99948 
   99949 static YYLTYPE last_yylloc;
   99950 
   99951 static int
   99952 get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
   99953 {
   99954   int res = getc (input);
   99955   (void) lvalp;(void) llocp;
   99956 
   99957   last_yylloc = (*llocp);
   99958   if (res == '\n')
   99959     {
   99960       (*llocp).last_line++;
   99961       (*llocp).last_column = 1;
   99962     }
   99963   else
   99964     (*llocp).last_column++;
   99965 
   99966   return res;
   99967 }
   99968 
   99969 static void
   99970 unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
   99971 {
   99972   (void) lvalp;(void) llocp;
   99973 
   99974   /* Wrong when C == `\n'. */
   99975   (*llocp) = last_yylloc;
   99976 
   99977   ungetc (c, input);
   99978 }
   99979 
   99980 static int
   99981 read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
   99982 {
   99983   int c = get_char (lvalp, llocp);
   99984   int sign = 1;
   99985   int n = 0;
   99986 
   99987   (void) lvalp;(void) llocp;
   99988   if (c == '-')
   99989     {
   99990       c = get_char (lvalp, llocp);
   99991       sign = -1;
   99992     }
   99993 
   99994   while (isdigit (c))
   99995     {
   99996       n = 10 * n + (c - '0');
   99997       c = get_char (lvalp, llocp);
   99998     }
   99999 
   100000   unget_char (lvalp, llocp,  c);
   100001 
   100002   return sign * n;
   100003 }
   100004 
   100005 
   100006 /*---------------------------------------------------------------.
   100007 | Lexical analyzer returns an integer on the stack and the token |
   100008 | NUM, or the ASCII character read if not a number.  Skips all   |
   100009 | blanks and tabs, returns 0 for EOF.                            |
   100010 `---------------------------------------------------------------*/
   100011 
   100012 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
   100013 {
   100014   int c;
   100015   /* Skip current token, then white spaces.  */
   100016   do
   100017     {
   100018      (*llocp).first_column = (*llocp).last_column;
   100019       (*llocp).first_line   = (*llocp).last_line;
   100020 
   100021     }
   100022   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   100023 
   100024   /* process numbers   */
   100025   if (c == '.' || isdigit (c))
   100026     {
   100027       unget_char (lvalp, llocp,  c);
   100028       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   100029       return NUM;
   100030     }
   100031 
   100032   /* Return end-of-file.  */
   100033   if (c == EOF)
   100034     return CALC_EOF;
   100035 
   100036   /* Return single chars. */
   100037   return c;
   100038 }
   100039 _ATEOF
   100040 
   100041 
   100042 cat >calc-main.c <<'_ATEOF'
   100043 #include <config.h>
   100044 /* We don't need perfect functions for these tests. */
   100045 #undef malloc
   100046 #undef memcmp
   100047 #undef realloc
   100048 
   100049 #include "calc.h"
   100050 
   100051 #include <assert.h>
   100052 #if HAVE_UNISTD_H
   100053 # include <unistd.h>
   100054 #else
   100055 # undef alarm
   100056 # define alarm(seconds) /* empty */
   100057 #endif
   100058 
   100059 
   100060 
   100061 semantic_value global_result = 0;
   100062 int global_count = 0;
   100063 
   100064 /* A C main function.  */
   100065 int
   100066 main (int argc, const char **argv)
   100067 {
   100068   semantic_value result = 0;
   100069   int count = 0;
   100070   int status;
   100071 
   100072   /* This used to be alarm (10), but that isn't enough time for
   100073      a July 1995 vintage DEC Alphastation 200 4/100 system,
   100074      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   100075   alarm (100);
   100076 
   100077   if (argc == 2)
   100078     input = fopen (argv[1], "r");
   100079   else
   100080     input = stdin;
   100081 
   100082   if (!input)
   100083     {
   100084       perror (argv[1]);
   100085       return 3;
   100086     }
   100087 
   100088   calcdebug = 1;
   100089   status = calcparse ();
   100090   if (fclose (input))
   100091     perror ("fclose");
   100092   assert (global_result == result);
   100093   assert (global_count == count);
   100094   return status;
   100095 }
   100096 _ATEOF
   100097 
   100098 
   100099 
   100100 
   100101 
   100102 
   100103 
   100104 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   100105   at_save_special_files
   100106   mkdir xml-tests
   100107     # Don't combine these Bison invocations since we want to be sure that
   100108   # --report=all isn't required to get the full XML file.
   100109   { set +x
   100110 $as_echo "$at_srcdir/calc.at:657: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   100111                   --graph=xml-tests/test.dot -o calc.c calc.y"
   100112 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657"
   100113 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   100114                   --graph=xml-tests/test.dot -o calc.c calc.y
   100115 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100116 at_status=$? at_failed=false
   100117 $at_check_filter
   100118 echo stderr:; cat "$at_stderr"
   100119 echo stdout:; cat "$at_stdout"
   100120 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100121 $at_failed && at_fn_log_failure
   100122 $at_traceon; }
   100123 
   100124   { set +x
   100125 $as_echo "$at_srcdir/calc.at:657: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   100126 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:657"
   100127 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   100128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100129 at_status=$? at_failed=false
   100130 $at_check_filter
   100131 echo stderr:; cat "$at_stderr"
   100132 echo stdout:; cat "$at_stdout"
   100133 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100134 $at_failed && at_fn_log_failure
   100135 $at_traceon; }
   100136 
   100137     cp xml-tests/test.output expout
   100138   { set +x
   100139 $as_echo "$at_srcdir/calc.at:657: \$XSLTPROC \\
   100140              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   100141              xml-tests/test.xml"
   100142 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:657"
   100143 ( $at_check_trace; $XSLTPROC \
   100144              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   100145              xml-tests/test.xml
   100146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100147 at_status=$? at_failed=false
   100148 $at_check_filter
   100149 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100150 $at_diff expout "$at_stdout" || at_failed=:
   100151 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100152 $at_failed && at_fn_log_failure
   100153 $at_traceon; }
   100154 
   100155   sort xml-tests/test.dot > expout
   100156   { set +x
   100157 $as_echo "$at_srcdir/calc.at:657: \$XSLTPROC \\
   100158              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   100159              xml-tests/test.xml | sort"
   100160 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:657"
   100161 ( $at_check_trace; $XSLTPROC \
   100162              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   100163              xml-tests/test.xml | sort
   100164 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100165 at_status=$? at_failed=false
   100166 $at_check_filter
   100167 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100168 $at_diff expout "$at_stdout" || at_failed=:
   100169 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100170 $at_failed && at_fn_log_failure
   100171 $at_traceon; }
   100172 
   100173   rm -rf xml-tests expout
   100174   at_restore_special_files
   100175 fi
   100176 { set +x
   100177 $as_echo "$at_srcdir/calc.at:657: bison -o calc.c calc.y"
   100178 at_fn_check_prepare_trace "calc.at:657"
   100179 ( $at_check_trace; bison -o calc.c calc.y
   100180 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100181 at_status=$? at_failed=false
   100182 $at_check_filter
   100183 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100184 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100185 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100186 $at_failed && at_fn_log_failure
   100187 $at_traceon; }
   100188 
   100189 
   100190    { set +x
   100191 $as_echo "$at_srcdir/calc.at:657: \$BISON_C_WORKS"
   100192 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:657"
   100193 ( $at_check_trace; $BISON_C_WORKS
   100194 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100195 at_status=$? at_failed=false
   100196 $at_check_filter
   100197 echo stderr:; cat "$at_stderr"
   100198 echo stdout:; cat "$at_stdout"
   100199 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100200 $at_failed && at_fn_log_failure
   100201 $at_traceon; }
   100202 
   100203 { set +x
   100204 $as_echo "$at_srcdir/calc.at:657: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   100205 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:657"
   100206 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   100207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100208 at_status=$? at_failed=false
   100209 $at_check_filter
   100210 echo stderr:; cat "$at_stderr"
   100211 echo stdout:; cat "$at_stdout"
   100212 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100213 $at_failed && at_fn_log_failure
   100214 $at_traceon; }
   100215 
   100216 
   100217 { set +x
   100218 $as_echo "$at_srcdir/calc.at:657: \$PERL -ne '
   100219   chomp;
   100220   print \"\$.: {\$_}\\n\"
   100221     if (# No starting/ending empty lines.
   100222         (eof || \$. == 1) && /^\\s*\$/
   100223         # No trailing space.  FIXME: not ready for \"maint\".
   100224         # || /\\s\$/
   100225         )' calc.c
   100226 "
   100227 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657"
   100228 ( $at_check_trace; $PERL -ne '
   100229   chomp;
   100230   print "$.: {$_}\n"
   100231     if (# No starting/ending empty lines.
   100232         (eof || $. == 1) && /^\s*$/
   100233         # No trailing space.  FIXME: not ready for "maint".
   100234         # || /\s$/
   100235         )' calc.c
   100236 
   100237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100238 at_status=$? at_failed=false
   100239 $at_check_filter
   100240 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100241 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100242 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100243 $at_failed && at_fn_log_failure
   100244 $at_traceon; }
   100245 
   100246 { set +x
   100247 $as_echo "$at_srcdir/calc.at:657: \$PERL -ne '
   100248   chomp;
   100249   print \"\$.: {\$_}\\n\"
   100250     if (# No starting/ending empty lines.
   100251         (eof || \$. == 1) && /^\\s*\$/
   100252         # No trailing space.  FIXME: not ready for \"maint\".
   100253         # || /\\s\$/
   100254         )' calc.h
   100255 "
   100256 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657"
   100257 ( $at_check_trace; $PERL -ne '
   100258   chomp;
   100259   print "$.: {$_}\n"
   100260     if (# No starting/ending empty lines.
   100261         (eof || $. == 1) && /^\s*$/
   100262         # No trailing space.  FIXME: not ready for "maint".
   100263         # || /\s$/
   100264         )' calc.h
   100265 
   100266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100267 at_status=$? at_failed=false
   100268 $at_check_filter
   100269 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100270 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100271 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100272 $at_failed && at_fn_log_failure
   100273 $at_traceon; }
   100274 
   100275 
   100276 # Test the priorities.
   100277 cat >input <<'_ATEOF'
   100278 1 + 2 * 3 = 7
   100279 1 + 2 * -3 = -5
   100280 
   100281 -1^2 = -1
   100282 (-1)^2 = 1
   100283 
   100284 ---1 = -1
   100285 
   100286 1 - 2 - 3 = -4
   100287 1 - (2 - 3) = 2
   100288 
   100289 2^2^3 = 256
   100290 (2^2)^3 = 64
   100291 _ATEOF
   100292 
   100293 { set +x
   100294 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100295 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100296 ( $at_check_trace;  $PREPARSER ./calc input
   100297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100298 at_status=$? at_failed=false
   100299 $at_check_filter
   100300 echo stderr:; tee stderr <"$at_stderr"
   100301 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100302 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100303 $at_failed && at_fn_log_failure
   100304 $at_traceon; }
   100305 
   100306 { set +x
   100307 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100308 at_fn_check_prepare_trace "calc.at:657"
   100309 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100310 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100311 at_status=$? at_failed=false
   100312 $at_check_filter
   100313 echo stderr:; tee stderr <"$at_stderr"
   100314 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100315 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100316 $at_failed && at_fn_log_failure
   100317 $at_traceon; }
   100318 
   100319 
   100320 
   100321 
   100322 # Some syntax errors.
   100323 cat >input <<'_ATEOF'
   100324 1 2
   100325 _ATEOF
   100326 
   100327 { set +x
   100328 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100329 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100330 ( $at_check_trace;  $PREPARSER ./calc input
   100331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100332 at_status=$? at_failed=false
   100333 $at_check_filter
   100334 echo stderr:; tee stderr <"$at_stderr"
   100335 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100336 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657"
   100337 $at_failed && at_fn_log_failure
   100338 $at_traceon; }
   100339 
   100340 { set +x
   100341 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100342 at_fn_check_prepare_trace "calc.at:657"
   100343 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100345 at_status=$? at_failed=false
   100346 $at_check_filter
   100347 echo stderr:; tee stderr <"$at_stderr"
   100348 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100349 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100350 $at_failed && at_fn_log_failure
   100351 $at_traceon; }
   100352 
   100353 
   100354 
   100355 # Normalize the observed and expected error messages, depending upon the
   100356 # options.
   100357 # 1. Remove the traces from observed.
   100358 sed '/^Starting/d
   100359 /^Entering/d
   100360 /^Stack/d
   100361 /^Reading/d
   100362 /^Reducing/d
   100363 /^Return/d
   100364 /^Shifting/d
   100365 /^state/d
   100366 /^Cleanup:/d
   100367 /^Error:/d
   100368 /^Next/d
   100369 /^Now/d
   100370 /^Discarding/d
   100371 / \$[0-9$]* = /d
   100372 /^yydestructor:/d' stderr >at-stderr
   100373 mv at-stderr stderr
   100374 # 2. Create the reference error message.
   100375 cat >expout <<'_ATEOF'
   100376 1.3: syntax error, unexpected number
   100377 _ATEOF
   100378 
   100379 # 3. If locations are not used, remove them.
   100380 
   100381 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100382 
   100383 # 5. Check
   100384 { set +x
   100385 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100386 at_fn_check_prepare_trace "calc.at:657"
   100387 ( $at_check_trace; cat stderr
   100388 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100389 at_status=$? at_failed=false
   100390 $at_check_filter
   100391 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100392 $at_diff expout "$at_stdout" || at_failed=:
   100393 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100394 $at_failed && at_fn_log_failure
   100395 $at_traceon; }
   100396 
   100397 
   100398 cat >input <<'_ATEOF'
   100399 1//2
   100400 _ATEOF
   100401 
   100402 { set +x
   100403 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100404 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100405 ( $at_check_trace;  $PREPARSER ./calc input
   100406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100407 at_status=$? at_failed=false
   100408 $at_check_filter
   100409 echo stderr:; tee stderr <"$at_stderr"
   100410 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100411 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657"
   100412 $at_failed && at_fn_log_failure
   100413 $at_traceon; }
   100414 
   100415 { set +x
   100416 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100417 at_fn_check_prepare_trace "calc.at:657"
   100418 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100420 at_status=$? at_failed=false
   100421 $at_check_filter
   100422 echo stderr:; tee stderr <"$at_stderr"
   100423 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100424 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100425 $at_failed && at_fn_log_failure
   100426 $at_traceon; }
   100427 
   100428 
   100429 
   100430 # Normalize the observed and expected error messages, depending upon the
   100431 # options.
   100432 # 1. Remove the traces from observed.
   100433 sed '/^Starting/d
   100434 /^Entering/d
   100435 /^Stack/d
   100436 /^Reading/d
   100437 /^Reducing/d
   100438 /^Return/d
   100439 /^Shifting/d
   100440 /^state/d
   100441 /^Cleanup:/d
   100442 /^Error:/d
   100443 /^Next/d
   100444 /^Now/d
   100445 /^Discarding/d
   100446 / \$[0-9$]* = /d
   100447 /^yydestructor:/d' stderr >at-stderr
   100448 mv at-stderr stderr
   100449 # 2. Create the reference error message.
   100450 cat >expout <<'_ATEOF'
   100451 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   100452 _ATEOF
   100453 
   100454 # 3. If locations are not used, remove them.
   100455 
   100456 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100457 
   100458 # 5. Check
   100459 { set +x
   100460 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100461 at_fn_check_prepare_trace "calc.at:657"
   100462 ( $at_check_trace; cat stderr
   100463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100464 at_status=$? at_failed=false
   100465 $at_check_filter
   100466 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100467 $at_diff expout "$at_stdout" || at_failed=:
   100468 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100469 $at_failed && at_fn_log_failure
   100470 $at_traceon; }
   100471 
   100472 
   100473 cat >input <<'_ATEOF'
   100474 error
   100475 _ATEOF
   100476 
   100477 { set +x
   100478 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100479 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100480 ( $at_check_trace;  $PREPARSER ./calc input
   100481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100482 at_status=$? at_failed=false
   100483 $at_check_filter
   100484 echo stderr:; tee stderr <"$at_stderr"
   100485 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100486 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657"
   100487 $at_failed && at_fn_log_failure
   100488 $at_traceon; }
   100489 
   100490 { set +x
   100491 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100492 at_fn_check_prepare_trace "calc.at:657"
   100493 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100495 at_status=$? at_failed=false
   100496 $at_check_filter
   100497 echo stderr:; tee stderr <"$at_stderr"
   100498 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100499 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100500 $at_failed && at_fn_log_failure
   100501 $at_traceon; }
   100502 
   100503 
   100504 
   100505 # Normalize the observed and expected error messages, depending upon the
   100506 # options.
   100507 # 1. Remove the traces from observed.
   100508 sed '/^Starting/d
   100509 /^Entering/d
   100510 /^Stack/d
   100511 /^Reading/d
   100512 /^Reducing/d
   100513 /^Return/d
   100514 /^Shifting/d
   100515 /^state/d
   100516 /^Cleanup:/d
   100517 /^Error:/d
   100518 /^Next/d
   100519 /^Now/d
   100520 /^Discarding/d
   100521 / \$[0-9$]* = /d
   100522 /^yydestructor:/d' stderr >at-stderr
   100523 mv at-stderr stderr
   100524 # 2. Create the reference error message.
   100525 cat >expout <<'_ATEOF'
   100526 1.1: syntax error, unexpected $undefined
   100527 _ATEOF
   100528 
   100529 # 3. If locations are not used, remove them.
   100530 
   100531 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100532 
   100533 # 5. Check
   100534 { set +x
   100535 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100536 at_fn_check_prepare_trace "calc.at:657"
   100537 ( $at_check_trace; cat stderr
   100538 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100539 at_status=$? at_failed=false
   100540 $at_check_filter
   100541 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100542 $at_diff expout "$at_stdout" || at_failed=:
   100543 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100544 $at_failed && at_fn_log_failure
   100545 $at_traceon; }
   100546 
   100547 
   100548 cat >input <<'_ATEOF'
   100549 1 = 2 = 3
   100550 _ATEOF
   100551 
   100552 { set +x
   100553 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100554 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100555 ( $at_check_trace;  $PREPARSER ./calc input
   100556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100557 at_status=$? at_failed=false
   100558 $at_check_filter
   100559 echo stderr:; tee stderr <"$at_stderr"
   100560 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100561 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657"
   100562 $at_failed && at_fn_log_failure
   100563 $at_traceon; }
   100564 
   100565 { set +x
   100566 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100567 at_fn_check_prepare_trace "calc.at:657"
   100568 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100570 at_status=$? at_failed=false
   100571 $at_check_filter
   100572 echo stderr:; tee stderr <"$at_stderr"
   100573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100574 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100575 $at_failed && at_fn_log_failure
   100576 $at_traceon; }
   100577 
   100578 
   100579 
   100580 # Normalize the observed and expected error messages, depending upon the
   100581 # options.
   100582 # 1. Remove the traces from observed.
   100583 sed '/^Starting/d
   100584 /^Entering/d
   100585 /^Stack/d
   100586 /^Reading/d
   100587 /^Reducing/d
   100588 /^Return/d
   100589 /^Shifting/d
   100590 /^state/d
   100591 /^Cleanup:/d
   100592 /^Error:/d
   100593 /^Next/d
   100594 /^Now/d
   100595 /^Discarding/d
   100596 / \$[0-9$]* = /d
   100597 /^yydestructor:/d' stderr >at-stderr
   100598 mv at-stderr stderr
   100599 # 2. Create the reference error message.
   100600 cat >expout <<'_ATEOF'
   100601 1.7: syntax error, unexpected '='
   100602 _ATEOF
   100603 
   100604 # 3. If locations are not used, remove them.
   100605 
   100606 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100607 
   100608 # 5. Check
   100609 { set +x
   100610 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100611 at_fn_check_prepare_trace "calc.at:657"
   100612 ( $at_check_trace; cat stderr
   100613 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100614 at_status=$? at_failed=false
   100615 $at_check_filter
   100616 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100617 $at_diff expout "$at_stdout" || at_failed=:
   100618 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100619 $at_failed && at_fn_log_failure
   100620 $at_traceon; }
   100621 
   100622 
   100623 cat >input <<'_ATEOF'
   100624 
   100625 +1
   100626 _ATEOF
   100627 
   100628 { set +x
   100629 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100630 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100631 ( $at_check_trace;  $PREPARSER ./calc input
   100632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100633 at_status=$? at_failed=false
   100634 $at_check_filter
   100635 echo stderr:; tee stderr <"$at_stderr"
   100636 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100637 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657"
   100638 $at_failed && at_fn_log_failure
   100639 $at_traceon; }
   100640 
   100641 { set +x
   100642 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100643 at_fn_check_prepare_trace "calc.at:657"
   100644 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100645 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100646 at_status=$? at_failed=false
   100647 $at_check_filter
   100648 echo stderr:; tee stderr <"$at_stderr"
   100649 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100650 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100651 $at_failed && at_fn_log_failure
   100652 $at_traceon; }
   100653 
   100654 
   100655 
   100656 # Normalize the observed and expected error messages, depending upon the
   100657 # options.
   100658 # 1. Remove the traces from observed.
   100659 sed '/^Starting/d
   100660 /^Entering/d
   100661 /^Stack/d
   100662 /^Reading/d
   100663 /^Reducing/d
   100664 /^Return/d
   100665 /^Shifting/d
   100666 /^state/d
   100667 /^Cleanup:/d
   100668 /^Error:/d
   100669 /^Next/d
   100670 /^Now/d
   100671 /^Discarding/d
   100672 / \$[0-9$]* = /d
   100673 /^yydestructor:/d' stderr >at-stderr
   100674 mv at-stderr stderr
   100675 # 2. Create the reference error message.
   100676 cat >expout <<'_ATEOF'
   100677 2.1: syntax error, unexpected '+'
   100678 _ATEOF
   100679 
   100680 # 3. If locations are not used, remove them.
   100681 
   100682 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100683 
   100684 # 5. Check
   100685 { set +x
   100686 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100687 at_fn_check_prepare_trace "calc.at:657"
   100688 ( $at_check_trace; cat stderr
   100689 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100690 at_status=$? at_failed=false
   100691 $at_check_filter
   100692 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100693 $at_diff expout "$at_stdout" || at_failed=:
   100694 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100695 $at_failed && at_fn_log_failure
   100696 $at_traceon; }
   100697 
   100698 
   100699 # Exercise error messages with EOF: work on an empty file.
   100700 { set +x
   100701 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc /dev/null"
   100702 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:657"
   100703 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   100704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100705 at_status=$? at_failed=false
   100706 $at_check_filter
   100707 echo stderr:; tee stderr <"$at_stderr"
   100708 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100709 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657"
   100710 $at_failed && at_fn_log_failure
   100711 $at_traceon; }
   100712 
   100713 { set +x
   100714 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100715 at_fn_check_prepare_trace "calc.at:657"
   100716 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100718 at_status=$? at_failed=false
   100719 $at_check_filter
   100720 echo stderr:; tee stderr <"$at_stderr"
   100721 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100722 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100723 $at_failed && at_fn_log_failure
   100724 $at_traceon; }
   100725 
   100726 
   100727 
   100728 # Normalize the observed and expected error messages, depending upon the
   100729 # options.
   100730 # 1. Remove the traces from observed.
   100731 sed '/^Starting/d
   100732 /^Entering/d
   100733 /^Stack/d
   100734 /^Reading/d
   100735 /^Reducing/d
   100736 /^Return/d
   100737 /^Shifting/d
   100738 /^state/d
   100739 /^Cleanup:/d
   100740 /^Error:/d
   100741 /^Next/d
   100742 /^Now/d
   100743 /^Discarding/d
   100744 / \$[0-9$]* = /d
   100745 /^yydestructor:/d' stderr >at-stderr
   100746 mv at-stderr stderr
   100747 # 2. Create the reference error message.
   100748 cat >expout <<'_ATEOF'
   100749 1.1: syntax error, unexpected end of input
   100750 _ATEOF
   100751 
   100752 # 3. If locations are not used, remove them.
   100753 
   100754 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100755 
   100756 # 5. Check
   100757 { set +x
   100758 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100759 at_fn_check_prepare_trace "calc.at:657"
   100760 ( $at_check_trace; cat stderr
   100761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100762 at_status=$? at_failed=false
   100763 $at_check_filter
   100764 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100765 $at_diff expout "$at_stdout" || at_failed=:
   100766 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100767 $at_failed && at_fn_log_failure
   100768 $at_traceon; }
   100769 
   100770 
   100771 
   100772 # Exercise the error token: without it, we die at the first error,
   100773 # hence be sure to
   100774 #
   100775 # - have several errors which exercise different shift/discardings
   100776 #   - (): nothing to pop, nothing to discard
   100777 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   100778 #   - (* * *): nothing to pop, a lot to discard
   100779 #   - (1 + 2 * *): some to pop and discard
   100780 #
   100781 # - test the action associated to `error'
   100782 #
   100783 # - check the lookahead that triggers an error is not discarded
   100784 #   when we enter error recovery.  Below, the lookahead causing the
   100785 #   first error is ")", which is needed to recover from the error and
   100786 #   produce the "0" that triggers the "0 != 1" error.
   100787 #
   100788 cat >input <<'_ATEOF'
   100789 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   100790 _ATEOF
   100791 
   100792 { set +x
   100793 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100794 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100795 ( $at_check_trace;  $PREPARSER ./calc input
   100796 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100797 at_status=$? at_failed=false
   100798 $at_check_filter
   100799 echo stderr:; tee stderr <"$at_stderr"
   100800 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100801 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100802 $at_failed && at_fn_log_failure
   100803 $at_traceon; }
   100804 
   100805 { set +x
   100806 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100807 at_fn_check_prepare_trace "calc.at:657"
   100808 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100809 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100810 at_status=$? at_failed=false
   100811 $at_check_filter
   100812 echo stderr:; tee stderr <"$at_stderr"
   100813 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100814 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100815 $at_failed && at_fn_log_failure
   100816 $at_traceon; }
   100817 
   100818 
   100819 
   100820 # Normalize the observed and expected error messages, depending upon the
   100821 # options.
   100822 # 1. Remove the traces from observed.
   100823 sed '/^Starting/d
   100824 /^Entering/d
   100825 /^Stack/d
   100826 /^Reading/d
   100827 /^Reducing/d
   100828 /^Return/d
   100829 /^Shifting/d
   100830 /^state/d
   100831 /^Cleanup:/d
   100832 /^Error:/d
   100833 /^Next/d
   100834 /^Now/d
   100835 /^Discarding/d
   100836 / \$[0-9$]* = /d
   100837 /^yydestructor:/d' stderr >at-stderr
   100838 mv at-stderr stderr
   100839 # 2. Create the reference error message.
   100840 cat >expout <<'_ATEOF'
   100841 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   100842 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   100843 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   100844 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   100845 calc: error: 4444 != 1
   100846 _ATEOF
   100847 
   100848 # 3. If locations are not used, remove them.
   100849 
   100850 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100851 
   100852 # 5. Check
   100853 { set +x
   100854 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100855 at_fn_check_prepare_trace "calc.at:657"
   100856 ( $at_check_trace; cat stderr
   100857 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100858 at_status=$? at_failed=false
   100859 $at_check_filter
   100860 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100861 $at_diff expout "$at_stdout" || at_failed=:
   100862 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100863 $at_failed && at_fn_log_failure
   100864 $at_traceon; }
   100865 
   100866 
   100867 
   100868 # The same, but this time exercising explicitly triggered syntax errors.
   100869 # POSIX says the lookahead causing the error should not be discarded.
   100870 cat >input <<'_ATEOF'
   100871 (!) + (1 2) = 1
   100872 _ATEOF
   100873 
   100874 { set +x
   100875 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100876 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100877 ( $at_check_trace;  $PREPARSER ./calc input
   100878 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100879 at_status=$? at_failed=false
   100880 $at_check_filter
   100881 echo stderr:; tee stderr <"$at_stderr"
   100882 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100883 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100884 $at_failed && at_fn_log_failure
   100885 $at_traceon; }
   100886 
   100887 { set +x
   100888 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100889 at_fn_check_prepare_trace "calc.at:657"
   100890 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100891 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100892 at_status=$? at_failed=false
   100893 $at_check_filter
   100894 echo stderr:; tee stderr <"$at_stderr"
   100895 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100896 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100897 $at_failed && at_fn_log_failure
   100898 $at_traceon; }
   100899 
   100900 
   100901 
   100902 # Normalize the observed and expected error messages, depending upon the
   100903 # options.
   100904 # 1. Remove the traces from observed.
   100905 sed '/^Starting/d
   100906 /^Entering/d
   100907 /^Stack/d
   100908 /^Reading/d
   100909 /^Reducing/d
   100910 /^Return/d
   100911 /^Shifting/d
   100912 /^state/d
   100913 /^Cleanup:/d
   100914 /^Error:/d
   100915 /^Next/d
   100916 /^Now/d
   100917 /^Discarding/d
   100918 / \$[0-9$]* = /d
   100919 /^yydestructor:/d' stderr >at-stderr
   100920 mv at-stderr stderr
   100921 # 2. Create the reference error message.
   100922 cat >expout <<'_ATEOF'
   100923 1.10: syntax error, unexpected number
   100924 calc: error: 2222 != 1
   100925 _ATEOF
   100926 
   100927 # 3. If locations are not used, remove them.
   100928 
   100929 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   100930 
   100931 # 5. Check
   100932 { set +x
   100933 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   100934 at_fn_check_prepare_trace "calc.at:657"
   100935 ( $at_check_trace; cat stderr
   100936 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100937 at_status=$? at_failed=false
   100938 $at_check_filter
   100939 at_fn_diff_devnull "$at_stderr" || at_failed=:
   100940 $at_diff expout "$at_stdout" || at_failed=:
   100941 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100942 $at_failed && at_fn_log_failure
   100943 $at_traceon; }
   100944 
   100945 
   100946 cat >input <<'_ATEOF'
   100947 (- *) + (1 2) = 1
   100948 _ATEOF
   100949 
   100950 { set +x
   100951 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   100952 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   100953 ( $at_check_trace;  $PREPARSER ./calc input
   100954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100955 at_status=$? at_failed=false
   100956 $at_check_filter
   100957 echo stderr:; tee stderr <"$at_stderr"
   100958 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100959 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100960 $at_failed && at_fn_log_failure
   100961 $at_traceon; }
   100962 
   100963 { set +x
   100964 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   100965 at_fn_check_prepare_trace "calc.at:657"
   100966 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   100967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   100968 at_status=$? at_failed=false
   100969 $at_check_filter
   100970 echo stderr:; tee stderr <"$at_stderr"
   100971 at_fn_diff_devnull "$at_stdout" || at_failed=:
   100972 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   100973 $at_failed && at_fn_log_failure
   100974 $at_traceon; }
   100975 
   100976 
   100977 
   100978 # Normalize the observed and expected error messages, depending upon the
   100979 # options.
   100980 # 1. Remove the traces from observed.
   100981 sed '/^Starting/d
   100982 /^Entering/d
   100983 /^Stack/d
   100984 /^Reading/d
   100985 /^Reducing/d
   100986 /^Return/d
   100987 /^Shifting/d
   100988 /^state/d
   100989 /^Cleanup:/d
   100990 /^Error:/d
   100991 /^Next/d
   100992 /^Now/d
   100993 /^Discarding/d
   100994 / \$[0-9$]* = /d
   100995 /^yydestructor:/d' stderr >at-stderr
   100996 mv at-stderr stderr
   100997 # 2. Create the reference error message.
   100998 cat >expout <<'_ATEOF'
   100999 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   101000 1.12: syntax error, unexpected number
   101001 calc: error: 2222 != 1
   101002 _ATEOF
   101003 
   101004 # 3. If locations are not used, remove them.
   101005 
   101006 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101007 
   101008 # 5. Check
   101009 { set +x
   101010 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   101011 at_fn_check_prepare_trace "calc.at:657"
   101012 ( $at_check_trace; cat stderr
   101013 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101014 at_status=$? at_failed=false
   101015 $at_check_filter
   101016 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101017 $at_diff expout "$at_stdout" || at_failed=:
   101018 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   101019 $at_failed && at_fn_log_failure
   101020 $at_traceon; }
   101021 
   101022 
   101023 
   101024 # Check that yyerrok works properly: second error is not reported,
   101025 # third and fourth are.  Parse status is succesfull.
   101026 cat >input <<'_ATEOF'
   101027 (* *) + (*) + (*)
   101028 _ATEOF
   101029 
   101030 { set +x
   101031 $as_echo "$at_srcdir/calc.at:657:  \$PREPARSER ./calc input"
   101032 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657"
   101033 ( $at_check_trace;  $PREPARSER ./calc input
   101034 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101035 at_status=$? at_failed=false
   101036 $at_check_filter
   101037 echo stderr:; tee stderr <"$at_stderr"
   101038 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101039 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   101040 $at_failed && at_fn_log_failure
   101041 $at_traceon; }
   101042 
   101043 { set +x
   101044 $as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101045 at_fn_check_prepare_trace "calc.at:657"
   101046 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101048 at_status=$? at_failed=false
   101049 $at_check_filter
   101050 echo stderr:; tee stderr <"$at_stderr"
   101051 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101052 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   101053 $at_failed && at_fn_log_failure
   101054 $at_traceon; }
   101055 
   101056 
   101057 
   101058 # Normalize the observed and expected error messages, depending upon the
   101059 # options.
   101060 # 1. Remove the traces from observed.
   101061 sed '/^Starting/d
   101062 /^Entering/d
   101063 /^Stack/d
   101064 /^Reading/d
   101065 /^Reducing/d
   101066 /^Return/d
   101067 /^Shifting/d
   101068 /^state/d
   101069 /^Cleanup:/d
   101070 /^Error:/d
   101071 /^Next/d
   101072 /^Now/d
   101073 /^Discarding/d
   101074 / \$[0-9$]* = /d
   101075 /^yydestructor:/d' stderr >at-stderr
   101076 mv at-stderr stderr
   101077 # 2. Create the reference error message.
   101078 cat >expout <<'_ATEOF'
   101079 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   101080 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   101081 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   101082 _ATEOF
   101083 
   101084 # 3. If locations are not used, remove them.
   101085 
   101086 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101087 
   101088 # 5. Check
   101089 { set +x
   101090 $as_echo "$at_srcdir/calc.at:657: cat stderr"
   101091 at_fn_check_prepare_trace "calc.at:657"
   101092 ( $at_check_trace; cat stderr
   101093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101094 at_status=$? at_failed=false
   101095 $at_check_filter
   101096 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101097 $at_diff expout "$at_stdout" || at_failed=:
   101098 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657"
   101099 $at_failed && at_fn_log_failure
   101100 $at_traceon; }
   101101 
   101102 
   101103 
   101104 
   101105 
   101106   set +x
   101107   $at_times_p && times >"$at_times_file"
   101108 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   101109 read at_status <"$at_status_file"
   101110 #AT_STOP_232
   101111 #AT_START_233
   101112 at_fn_group_banner 233 'calc.at:659' \
   101113   "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 12
   101114 at_xfail=no
   101115 (
   101116   $as_echo "233. $at_setup_line: testing $at_desc ..."
   101117   $at_traceon
   101118 
   101119 
   101120 
   101121 
   101122 
   101123 
   101124 
   101125 
   101126 
   101127 
   101128 cat >calc.y <<'_ATEOF'
   101129 %code top {
   101130 #include <config.h>
   101131 /* We don't need perfect functions for these tests. */
   101132 #undef malloc
   101133 #undef memcmp
   101134 #undef realloc
   101135 }
   101136 
   101137 /* Infix notation calculator--calc */
   101138 %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   101139 
   101140 %code requires
   101141 {
   101142 
   101143   /* Exercise pre-prologue dependency to %union.  */
   101144   typedef int semantic_value;
   101145 }
   101146 
   101147 /* Exercise %union. */
   101148 %union
   101149 {
   101150   semantic_value ival;
   101151 };
   101152 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   101153 
   101154 %code provides
   101155 {
   101156   #include <stdio.h>
   101157   /* The input.  */
   101158   extern FILE *input;
   101159   extern semantic_value global_result;
   101160   extern int global_count;
   101161 }
   101162 
   101163 %code
   101164 {
   101165 #include <assert.h>
   101166 #include <string.h>
   101167 #define USE(Var)
   101168 
   101169 FILE *input;
   101170 static int power (int base, int exponent);
   101171 
   101172 static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg);
   101173 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
   101174 }
   101175 
   101176 
   101177 
   101178 /* Bison Declarations */
   101179 %token CALC_EOF 0 "end of input"
   101180 %token <ival> NUM "number"
   101181 %type  <ival> exp
   101182 
   101183 %nonassoc '=' /* comparison            */
   101184 %left '-' '+'
   101185 %left '*' '/'
   101186 %left NEG     /* negation--unary minus */
   101187 %right '^'    /* exponentiation        */
   101188 
   101189 /* Grammar follows */
   101190 %%
   101191 input:
   101192   line
   101193 | input line         { ++*count; ++global_count; }
   101194 ;
   101195 
   101196 line:
   101197   '\n'
   101198 | exp '\n'           { *result = global_result = $1; }
   101199 ;
   101200 
   101201 exp:
   101202   NUM                { $$ = $1;             }
   101203 | exp '=' exp
   101204   {
   101205     if ($1 != $3)
   101206       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   101207     $$ = $1;
   101208   }
   101209 | exp '+' exp        { $$ = $1 + $3;        }
   101210 | exp '-' exp        { $$ = $1 - $3;        }
   101211 | exp '*' exp        { $$ = $1 * $3;        }
   101212 | exp '/' exp        { $$ = $1 / $3;        }
   101213 | '-' exp  %prec NEG { $$ = -$2;            }
   101214 | exp '^' exp        { $$ = power ($1, $3); }
   101215 | '(' exp ')'        { $$ = $2;             }
   101216 | '(' error ')'      { $$ = 1111; yyerrok;  }
   101217 | '!'                { $$ = 0; YYERROR;     }
   101218 | '-' error          { $$ = 0; YYERROR;     }
   101219 ;
   101220 %%
   101221 
   101222 static int
   101223 power (int base, int exponent)
   101224 {
   101225   int res = 1;
   101226   assert (0 <= exponent);
   101227   for (/* Niente */; exponent; --exponent)
   101228     res *= base;
   101229   return res;
   101230 }
   101231 
   101232 
   101233 #include <stdio.h>
   101234 /* A C error reporting function.  */
   101235 static
   101236 void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg)
   101237 {
   101238   YYUSE(result);
   101239   YYUSE(count);
   101240   YY_LOCATION_PRINT (stderr, (*llocp));
   101241   fprintf (stderr, ": ");
   101242   fprintf (stderr, "%s\n", msg);
   101243 }
   101244 _ATEOF
   101245 
   101246 
   101247 
   101248 cat >calc-lex.c <<'_ATEOF'
   101249 #include <config.h>
   101250 /* We don't need perfect functions for these tests. */
   101251 #undef malloc
   101252 #undef memcmp
   101253 #undef realloc
   101254 
   101255 #include "calc.h"
   101256 
   101257 #include <ctype.h>
   101258 
   101259 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
   101260 static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
   101261 static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);
   101262 
   101263 
   101264 static YYLTYPE last_yylloc;
   101265 
   101266 static int
   101267 get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
   101268 {
   101269   int res = getc (input);
   101270   (void) lvalp;(void) llocp;
   101271 
   101272   last_yylloc = (*llocp);
   101273   if (res == '\n')
   101274     {
   101275       (*llocp).last_line++;
   101276       (*llocp).last_column = 1;
   101277     }
   101278   else
   101279     (*llocp).last_column++;
   101280 
   101281   return res;
   101282 }
   101283 
   101284 static void
   101285 unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
   101286 {
   101287   (void) lvalp;(void) llocp;
   101288 
   101289   /* Wrong when C == `\n'. */
   101290   (*llocp) = last_yylloc;
   101291 
   101292   ungetc (c, input);
   101293 }
   101294 
   101295 static int
   101296 read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
   101297 {
   101298   int c = get_char (lvalp, llocp);
   101299   int sign = 1;
   101300   int n = 0;
   101301 
   101302   (void) lvalp;(void) llocp;
   101303   if (c == '-')
   101304     {
   101305       c = get_char (lvalp, llocp);
   101306       sign = -1;
   101307     }
   101308 
   101309   while (isdigit (c))
   101310     {
   101311       n = 10 * n + (c - '0');
   101312       c = get_char (lvalp, llocp);
   101313     }
   101314 
   101315   unget_char (lvalp, llocp,  c);
   101316 
   101317   return sign * n;
   101318 }
   101319 
   101320 
   101321 /*---------------------------------------------------------------.
   101322 | Lexical analyzer returns an integer on the stack and the token |
   101323 | NUM, or the ASCII character read if not a number.  Skips all   |
   101324 | blanks and tabs, returns 0 for EOF.                            |
   101325 `---------------------------------------------------------------*/
   101326 
   101327 int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
   101328 {
   101329   int c;
   101330   /* Skip current token, then white spaces.  */
   101331   do
   101332     {
   101333      (*llocp).first_column = (*llocp).last_column;
   101334       (*llocp).first_line   = (*llocp).last_line;
   101335 
   101336     }
   101337   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   101338 
   101339   /* process numbers   */
   101340   if (c == '.' || isdigit (c))
   101341     {
   101342       unget_char (lvalp, llocp,  c);
   101343       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   101344       return NUM;
   101345     }
   101346 
   101347   /* Return end-of-file.  */
   101348   if (c == EOF)
   101349     return CALC_EOF;
   101350 
   101351   /* Return single chars. */
   101352   return c;
   101353 }
   101354 _ATEOF
   101355 
   101356 
   101357 cat >calc-main.c <<'_ATEOF'
   101358 #include <config.h>
   101359 /* We don't need perfect functions for these tests. */
   101360 #undef malloc
   101361 #undef memcmp
   101362 #undef realloc
   101363 
   101364 #include "calc.h"
   101365 
   101366 #include <assert.h>
   101367 #if HAVE_UNISTD_H
   101368 # include <unistd.h>
   101369 #else
   101370 # undef alarm
   101371 # define alarm(seconds) /* empty */
   101372 #endif
   101373 
   101374 
   101375 
   101376 semantic_value global_result = 0;
   101377 int global_count = 0;
   101378 
   101379 /* A C main function.  */
   101380 int
   101381 main (int argc, const char **argv)
   101382 {
   101383   semantic_value result = 0;
   101384   int count = 0;
   101385   int status;
   101386 
   101387   /* This used to be alarm (10), but that isn't enough time for
   101388      a July 1995 vintage DEC Alphastation 200 4/100 system,
   101389      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   101390   alarm (100);
   101391 
   101392   if (argc == 2)
   101393     input = fopen (argv[1], "r");
   101394   else
   101395     input = stdin;
   101396 
   101397   if (!input)
   101398     {
   101399       perror (argv[1]);
   101400       return 3;
   101401     }
   101402 
   101403   calcdebug = 1;
   101404   status = calcparse (&result, &count);
   101405   if (fclose (input))
   101406     perror ("fclose");
   101407   assert (global_result == result);
   101408   assert (global_count == count);
   101409   return status;
   101410 }
   101411 _ATEOF
   101412 
   101413 
   101414 
   101415 
   101416 
   101417 
   101418 
   101419 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   101420   at_save_special_files
   101421   mkdir xml-tests
   101422     # Don't combine these Bison invocations since we want to be sure that
   101423   # --report=all isn't required to get the full XML file.
   101424   { set +x
   101425 $as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   101426                   --graph=xml-tests/test.dot -o calc.c calc.y"
   101427 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659"
   101428 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   101429                   --graph=xml-tests/test.dot -o calc.c calc.y
   101430 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101431 at_status=$? at_failed=false
   101432 $at_check_filter
   101433 echo stderr:; cat "$at_stderr"
   101434 echo stdout:; cat "$at_stdout"
   101435 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101436 $at_failed && at_fn_log_failure
   101437 $at_traceon; }
   101438 
   101439   { set +x
   101440 $as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   101441 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:659"
   101442 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   101443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101444 at_status=$? at_failed=false
   101445 $at_check_filter
   101446 echo stderr:; cat "$at_stderr"
   101447 echo stdout:; cat "$at_stdout"
   101448 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101449 $at_failed && at_fn_log_failure
   101450 $at_traceon; }
   101451 
   101452     cp xml-tests/test.output expout
   101453   { set +x
   101454 $as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\
   101455              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   101456              xml-tests/test.xml"
   101457 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659"
   101458 ( $at_check_trace; $XSLTPROC \
   101459              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   101460              xml-tests/test.xml
   101461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101462 at_status=$? at_failed=false
   101463 $at_check_filter
   101464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101465 $at_diff expout "$at_stdout" || at_failed=:
   101466 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101467 $at_failed && at_fn_log_failure
   101468 $at_traceon; }
   101469 
   101470   sort xml-tests/test.dot > expout
   101471   { set +x
   101472 $as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\
   101473              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   101474              xml-tests/test.xml | sort"
   101475 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659"
   101476 ( $at_check_trace; $XSLTPROC \
   101477              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   101478              xml-tests/test.xml | sort
   101479 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101480 at_status=$? at_failed=false
   101481 $at_check_filter
   101482 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101483 $at_diff expout "$at_stdout" || at_failed=:
   101484 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101485 $at_failed && at_fn_log_failure
   101486 $at_traceon; }
   101487 
   101488   rm -rf xml-tests expout
   101489   at_restore_special_files
   101490 fi
   101491 { set +x
   101492 $as_echo "$at_srcdir/calc.at:659: bison -o calc.c calc.y"
   101493 at_fn_check_prepare_trace "calc.at:659"
   101494 ( $at_check_trace; bison -o calc.c calc.y
   101495 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101496 at_status=$? at_failed=false
   101497 $at_check_filter
   101498 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101499 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101500 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101501 $at_failed && at_fn_log_failure
   101502 $at_traceon; }
   101503 
   101504 
   101505    { set +x
   101506 $as_echo "$at_srcdir/calc.at:659: \$BISON_C_WORKS"
   101507 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:659"
   101508 ( $at_check_trace; $BISON_C_WORKS
   101509 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101510 at_status=$? at_failed=false
   101511 $at_check_filter
   101512 echo stderr:; cat "$at_stderr"
   101513 echo stdout:; cat "$at_stdout"
   101514 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101515 $at_failed && at_fn_log_failure
   101516 $at_traceon; }
   101517 
   101518 { set +x
   101519 $as_echo "$at_srcdir/calc.at:659: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   101520 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:659"
   101521 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   101522 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101523 at_status=$? at_failed=false
   101524 $at_check_filter
   101525 echo stderr:; cat "$at_stderr"
   101526 echo stdout:; cat "$at_stdout"
   101527 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101528 $at_failed && at_fn_log_failure
   101529 $at_traceon; }
   101530 
   101531 
   101532 { set +x
   101533 $as_echo "$at_srcdir/calc.at:659: \$PERL -ne '
   101534   chomp;
   101535   print \"\$.: {\$_}\\n\"
   101536     if (# No starting/ending empty lines.
   101537         (eof || \$. == 1) && /^\\s*\$/
   101538         # No trailing space.  FIXME: not ready for \"maint\".
   101539         # || /\\s\$/
   101540         )' calc.c
   101541 "
   101542 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659"
   101543 ( $at_check_trace; $PERL -ne '
   101544   chomp;
   101545   print "$.: {$_}\n"
   101546     if (# No starting/ending empty lines.
   101547         (eof || $. == 1) && /^\s*$/
   101548         # No trailing space.  FIXME: not ready for "maint".
   101549         # || /\s$/
   101550         )' calc.c
   101551 
   101552 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101553 at_status=$? at_failed=false
   101554 $at_check_filter
   101555 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101556 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101557 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101558 $at_failed && at_fn_log_failure
   101559 $at_traceon; }
   101560 
   101561 { set +x
   101562 $as_echo "$at_srcdir/calc.at:659: \$PERL -ne '
   101563   chomp;
   101564   print \"\$.: {\$_}\\n\"
   101565     if (# No starting/ending empty lines.
   101566         (eof || \$. == 1) && /^\\s*\$/
   101567         # No trailing space.  FIXME: not ready for \"maint\".
   101568         # || /\\s\$/
   101569         )' calc.h
   101570 "
   101571 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659"
   101572 ( $at_check_trace; $PERL -ne '
   101573   chomp;
   101574   print "$.: {$_}\n"
   101575     if (# No starting/ending empty lines.
   101576         (eof || $. == 1) && /^\s*$/
   101577         # No trailing space.  FIXME: not ready for "maint".
   101578         # || /\s$/
   101579         )' calc.h
   101580 
   101581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101582 at_status=$? at_failed=false
   101583 $at_check_filter
   101584 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101585 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101586 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101587 $at_failed && at_fn_log_failure
   101588 $at_traceon; }
   101589 
   101590 
   101591 # Test the priorities.
   101592 cat >input <<'_ATEOF'
   101593 1 + 2 * 3 = 7
   101594 1 + 2 * -3 = -5
   101595 
   101596 -1^2 = -1
   101597 (-1)^2 = 1
   101598 
   101599 ---1 = -1
   101600 
   101601 1 - 2 - 3 = -4
   101602 1 - (2 - 3) = 2
   101603 
   101604 2^2^3 = 256
   101605 (2^2)^3 = 64
   101606 _ATEOF
   101607 
   101608 { set +x
   101609 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   101610 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   101611 ( $at_check_trace;  $PREPARSER ./calc input
   101612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101613 at_status=$? at_failed=false
   101614 $at_check_filter
   101615 echo stderr:; tee stderr <"$at_stderr"
   101616 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101617 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101618 $at_failed && at_fn_log_failure
   101619 $at_traceon; }
   101620 
   101621 { set +x
   101622 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101623 at_fn_check_prepare_trace "calc.at:659"
   101624 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101625 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101626 at_status=$? at_failed=false
   101627 $at_check_filter
   101628 echo stderr:; tee stderr <"$at_stderr"
   101629 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101630 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101631 $at_failed && at_fn_log_failure
   101632 $at_traceon; }
   101633 
   101634 
   101635 
   101636 
   101637 # Some syntax errors.
   101638 cat >input <<'_ATEOF'
   101639 1 2
   101640 _ATEOF
   101641 
   101642 { set +x
   101643 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   101644 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   101645 ( $at_check_trace;  $PREPARSER ./calc input
   101646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101647 at_status=$? at_failed=false
   101648 $at_check_filter
   101649 echo stderr:; tee stderr <"$at_stderr"
   101650 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101651 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
   101652 $at_failed && at_fn_log_failure
   101653 $at_traceon; }
   101654 
   101655 { set +x
   101656 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101657 at_fn_check_prepare_trace "calc.at:659"
   101658 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101659 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101660 at_status=$? at_failed=false
   101661 $at_check_filter
   101662 echo stderr:; tee stderr <"$at_stderr"
   101663 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101664 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101665 $at_failed && at_fn_log_failure
   101666 $at_traceon; }
   101667 
   101668 
   101669 
   101670 # Normalize the observed and expected error messages, depending upon the
   101671 # options.
   101672 # 1. Remove the traces from observed.
   101673 sed '/^Starting/d
   101674 /^Entering/d
   101675 /^Stack/d
   101676 /^Reading/d
   101677 /^Reducing/d
   101678 /^Return/d
   101679 /^Shifting/d
   101680 /^state/d
   101681 /^Cleanup:/d
   101682 /^Error:/d
   101683 /^Next/d
   101684 /^Now/d
   101685 /^Discarding/d
   101686 / \$[0-9$]* = /d
   101687 /^yydestructor:/d' stderr >at-stderr
   101688 mv at-stderr stderr
   101689 # 2. Create the reference error message.
   101690 cat >expout <<'_ATEOF'
   101691 1.3: syntax error, unexpected number
   101692 _ATEOF
   101693 
   101694 # 3. If locations are not used, remove them.
   101695 
   101696 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101697 
   101698 # 5. Check
   101699 { set +x
   101700 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   101701 at_fn_check_prepare_trace "calc.at:659"
   101702 ( $at_check_trace; cat stderr
   101703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101704 at_status=$? at_failed=false
   101705 $at_check_filter
   101706 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101707 $at_diff expout "$at_stdout" || at_failed=:
   101708 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101709 $at_failed && at_fn_log_failure
   101710 $at_traceon; }
   101711 
   101712 
   101713 cat >input <<'_ATEOF'
   101714 1//2
   101715 _ATEOF
   101716 
   101717 { set +x
   101718 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   101719 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   101720 ( $at_check_trace;  $PREPARSER ./calc input
   101721 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101722 at_status=$? at_failed=false
   101723 $at_check_filter
   101724 echo stderr:; tee stderr <"$at_stderr"
   101725 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101726 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
   101727 $at_failed && at_fn_log_failure
   101728 $at_traceon; }
   101729 
   101730 { set +x
   101731 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101732 at_fn_check_prepare_trace "calc.at:659"
   101733 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101735 at_status=$? at_failed=false
   101736 $at_check_filter
   101737 echo stderr:; tee stderr <"$at_stderr"
   101738 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101739 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101740 $at_failed && at_fn_log_failure
   101741 $at_traceon; }
   101742 
   101743 
   101744 
   101745 # Normalize the observed and expected error messages, depending upon the
   101746 # options.
   101747 # 1. Remove the traces from observed.
   101748 sed '/^Starting/d
   101749 /^Entering/d
   101750 /^Stack/d
   101751 /^Reading/d
   101752 /^Reducing/d
   101753 /^Return/d
   101754 /^Shifting/d
   101755 /^state/d
   101756 /^Cleanup:/d
   101757 /^Error:/d
   101758 /^Next/d
   101759 /^Now/d
   101760 /^Discarding/d
   101761 / \$[0-9$]* = /d
   101762 /^yydestructor:/d' stderr >at-stderr
   101763 mv at-stderr stderr
   101764 # 2. Create the reference error message.
   101765 cat >expout <<'_ATEOF'
   101766 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   101767 _ATEOF
   101768 
   101769 # 3. If locations are not used, remove them.
   101770 
   101771 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101772 
   101773 # 5. Check
   101774 { set +x
   101775 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   101776 at_fn_check_prepare_trace "calc.at:659"
   101777 ( $at_check_trace; cat stderr
   101778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101779 at_status=$? at_failed=false
   101780 $at_check_filter
   101781 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101782 $at_diff expout "$at_stdout" || at_failed=:
   101783 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101784 $at_failed && at_fn_log_failure
   101785 $at_traceon; }
   101786 
   101787 
   101788 cat >input <<'_ATEOF'
   101789 error
   101790 _ATEOF
   101791 
   101792 { set +x
   101793 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   101794 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   101795 ( $at_check_trace;  $PREPARSER ./calc input
   101796 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101797 at_status=$? at_failed=false
   101798 $at_check_filter
   101799 echo stderr:; tee stderr <"$at_stderr"
   101800 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101801 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
   101802 $at_failed && at_fn_log_failure
   101803 $at_traceon; }
   101804 
   101805 { set +x
   101806 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101807 at_fn_check_prepare_trace "calc.at:659"
   101808 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101809 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101810 at_status=$? at_failed=false
   101811 $at_check_filter
   101812 echo stderr:; tee stderr <"$at_stderr"
   101813 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101814 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101815 $at_failed && at_fn_log_failure
   101816 $at_traceon; }
   101817 
   101818 
   101819 
   101820 # Normalize the observed and expected error messages, depending upon the
   101821 # options.
   101822 # 1. Remove the traces from observed.
   101823 sed '/^Starting/d
   101824 /^Entering/d
   101825 /^Stack/d
   101826 /^Reading/d
   101827 /^Reducing/d
   101828 /^Return/d
   101829 /^Shifting/d
   101830 /^state/d
   101831 /^Cleanup:/d
   101832 /^Error:/d
   101833 /^Next/d
   101834 /^Now/d
   101835 /^Discarding/d
   101836 / \$[0-9$]* = /d
   101837 /^yydestructor:/d' stderr >at-stderr
   101838 mv at-stderr stderr
   101839 # 2. Create the reference error message.
   101840 cat >expout <<'_ATEOF'
   101841 1.1: syntax error, unexpected $undefined
   101842 _ATEOF
   101843 
   101844 # 3. If locations are not used, remove them.
   101845 
   101846 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101847 
   101848 # 5. Check
   101849 { set +x
   101850 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   101851 at_fn_check_prepare_trace "calc.at:659"
   101852 ( $at_check_trace; cat stderr
   101853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101854 at_status=$? at_failed=false
   101855 $at_check_filter
   101856 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101857 $at_diff expout "$at_stdout" || at_failed=:
   101858 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101859 $at_failed && at_fn_log_failure
   101860 $at_traceon; }
   101861 
   101862 
   101863 cat >input <<'_ATEOF'
   101864 1 = 2 = 3
   101865 _ATEOF
   101866 
   101867 { set +x
   101868 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   101869 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   101870 ( $at_check_trace;  $PREPARSER ./calc input
   101871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101872 at_status=$? at_failed=false
   101873 $at_check_filter
   101874 echo stderr:; tee stderr <"$at_stderr"
   101875 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101876 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
   101877 $at_failed && at_fn_log_failure
   101878 $at_traceon; }
   101879 
   101880 { set +x
   101881 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101882 at_fn_check_prepare_trace "calc.at:659"
   101883 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101885 at_status=$? at_failed=false
   101886 $at_check_filter
   101887 echo stderr:; tee stderr <"$at_stderr"
   101888 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101889 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101890 $at_failed && at_fn_log_failure
   101891 $at_traceon; }
   101892 
   101893 
   101894 
   101895 # Normalize the observed and expected error messages, depending upon the
   101896 # options.
   101897 # 1. Remove the traces from observed.
   101898 sed '/^Starting/d
   101899 /^Entering/d
   101900 /^Stack/d
   101901 /^Reading/d
   101902 /^Reducing/d
   101903 /^Return/d
   101904 /^Shifting/d
   101905 /^state/d
   101906 /^Cleanup:/d
   101907 /^Error:/d
   101908 /^Next/d
   101909 /^Now/d
   101910 /^Discarding/d
   101911 / \$[0-9$]* = /d
   101912 /^yydestructor:/d' stderr >at-stderr
   101913 mv at-stderr stderr
   101914 # 2. Create the reference error message.
   101915 cat >expout <<'_ATEOF'
   101916 1.7: syntax error, unexpected '='
   101917 _ATEOF
   101918 
   101919 # 3. If locations are not used, remove them.
   101920 
   101921 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101922 
   101923 # 5. Check
   101924 { set +x
   101925 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   101926 at_fn_check_prepare_trace "calc.at:659"
   101927 ( $at_check_trace; cat stderr
   101928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101929 at_status=$? at_failed=false
   101930 $at_check_filter
   101931 at_fn_diff_devnull "$at_stderr" || at_failed=:
   101932 $at_diff expout "$at_stdout" || at_failed=:
   101933 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101934 $at_failed && at_fn_log_failure
   101935 $at_traceon; }
   101936 
   101937 
   101938 cat >input <<'_ATEOF'
   101939 
   101940 +1
   101941 _ATEOF
   101942 
   101943 { set +x
   101944 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   101945 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   101946 ( $at_check_trace;  $PREPARSER ./calc input
   101947 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101948 at_status=$? at_failed=false
   101949 $at_check_filter
   101950 echo stderr:; tee stderr <"$at_stderr"
   101951 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101952 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
   101953 $at_failed && at_fn_log_failure
   101954 $at_traceon; }
   101955 
   101956 { set +x
   101957 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   101958 at_fn_check_prepare_trace "calc.at:659"
   101959 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   101960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   101961 at_status=$? at_failed=false
   101962 $at_check_filter
   101963 echo stderr:; tee stderr <"$at_stderr"
   101964 at_fn_diff_devnull "$at_stdout" || at_failed=:
   101965 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   101966 $at_failed && at_fn_log_failure
   101967 $at_traceon; }
   101968 
   101969 
   101970 
   101971 # Normalize the observed and expected error messages, depending upon the
   101972 # options.
   101973 # 1. Remove the traces from observed.
   101974 sed '/^Starting/d
   101975 /^Entering/d
   101976 /^Stack/d
   101977 /^Reading/d
   101978 /^Reducing/d
   101979 /^Return/d
   101980 /^Shifting/d
   101981 /^state/d
   101982 /^Cleanup:/d
   101983 /^Error:/d
   101984 /^Next/d
   101985 /^Now/d
   101986 /^Discarding/d
   101987 / \$[0-9$]* = /d
   101988 /^yydestructor:/d' stderr >at-stderr
   101989 mv at-stderr stderr
   101990 # 2. Create the reference error message.
   101991 cat >expout <<'_ATEOF'
   101992 2.1: syntax error, unexpected '+'
   101993 _ATEOF
   101994 
   101995 # 3. If locations are not used, remove them.
   101996 
   101997 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   101998 
   101999 # 5. Check
   102000 { set +x
   102001 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   102002 at_fn_check_prepare_trace "calc.at:659"
   102003 ( $at_check_trace; cat stderr
   102004 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102005 at_status=$? at_failed=false
   102006 $at_check_filter
   102007 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102008 $at_diff expout "$at_stdout" || at_failed=:
   102009 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102010 $at_failed && at_fn_log_failure
   102011 $at_traceon; }
   102012 
   102013 
   102014 # Exercise error messages with EOF: work on an empty file.
   102015 { set +x
   102016 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc /dev/null"
   102017 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:659"
   102018 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   102019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102020 at_status=$? at_failed=false
   102021 $at_check_filter
   102022 echo stderr:; tee stderr <"$at_stderr"
   102023 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102024 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
   102025 $at_failed && at_fn_log_failure
   102026 $at_traceon; }
   102027 
   102028 { set +x
   102029 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102030 at_fn_check_prepare_trace "calc.at:659"
   102031 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102032 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102033 at_status=$? at_failed=false
   102034 $at_check_filter
   102035 echo stderr:; tee stderr <"$at_stderr"
   102036 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102037 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102038 $at_failed && at_fn_log_failure
   102039 $at_traceon; }
   102040 
   102041 
   102042 
   102043 # Normalize the observed and expected error messages, depending upon the
   102044 # options.
   102045 # 1. Remove the traces from observed.
   102046 sed '/^Starting/d
   102047 /^Entering/d
   102048 /^Stack/d
   102049 /^Reading/d
   102050 /^Reducing/d
   102051 /^Return/d
   102052 /^Shifting/d
   102053 /^state/d
   102054 /^Cleanup:/d
   102055 /^Error:/d
   102056 /^Next/d
   102057 /^Now/d
   102058 /^Discarding/d
   102059 / \$[0-9$]* = /d
   102060 /^yydestructor:/d' stderr >at-stderr
   102061 mv at-stderr stderr
   102062 # 2. Create the reference error message.
   102063 cat >expout <<'_ATEOF'
   102064 1.1: syntax error, unexpected end of input
   102065 _ATEOF
   102066 
   102067 # 3. If locations are not used, remove them.
   102068 
   102069 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   102070 
   102071 # 5. Check
   102072 { set +x
   102073 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   102074 at_fn_check_prepare_trace "calc.at:659"
   102075 ( $at_check_trace; cat stderr
   102076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102077 at_status=$? at_failed=false
   102078 $at_check_filter
   102079 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102080 $at_diff expout "$at_stdout" || at_failed=:
   102081 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102082 $at_failed && at_fn_log_failure
   102083 $at_traceon; }
   102084 
   102085 
   102086 
   102087 # Exercise the error token: without it, we die at the first error,
   102088 # hence be sure to
   102089 #
   102090 # - have several errors which exercise different shift/discardings
   102091 #   - (): nothing to pop, nothing to discard
   102092 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   102093 #   - (* * *): nothing to pop, a lot to discard
   102094 #   - (1 + 2 * *): some to pop and discard
   102095 #
   102096 # - test the action associated to `error'
   102097 #
   102098 # - check the lookahead that triggers an error is not discarded
   102099 #   when we enter error recovery.  Below, the lookahead causing the
   102100 #   first error is ")", which is needed to recover from the error and
   102101 #   produce the "0" that triggers the "0 != 1" error.
   102102 #
   102103 cat >input <<'_ATEOF'
   102104 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   102105 _ATEOF
   102106 
   102107 { set +x
   102108 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   102109 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   102110 ( $at_check_trace;  $PREPARSER ./calc input
   102111 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102112 at_status=$? at_failed=false
   102113 $at_check_filter
   102114 echo stderr:; tee stderr <"$at_stderr"
   102115 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102116 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102117 $at_failed && at_fn_log_failure
   102118 $at_traceon; }
   102119 
   102120 { set +x
   102121 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102122 at_fn_check_prepare_trace "calc.at:659"
   102123 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102125 at_status=$? at_failed=false
   102126 $at_check_filter
   102127 echo stderr:; tee stderr <"$at_stderr"
   102128 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102129 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102130 $at_failed && at_fn_log_failure
   102131 $at_traceon; }
   102132 
   102133 
   102134 
   102135 # Normalize the observed and expected error messages, depending upon the
   102136 # options.
   102137 # 1. Remove the traces from observed.
   102138 sed '/^Starting/d
   102139 /^Entering/d
   102140 /^Stack/d
   102141 /^Reading/d
   102142 /^Reducing/d
   102143 /^Return/d
   102144 /^Shifting/d
   102145 /^state/d
   102146 /^Cleanup:/d
   102147 /^Error:/d
   102148 /^Next/d
   102149 /^Now/d
   102150 /^Discarding/d
   102151 / \$[0-9$]* = /d
   102152 /^yydestructor:/d' stderr >at-stderr
   102153 mv at-stderr stderr
   102154 # 2. Create the reference error message.
   102155 cat >expout <<'_ATEOF'
   102156 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   102157 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   102158 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   102159 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   102160 calc: error: 4444 != 1
   102161 _ATEOF
   102162 
   102163 # 3. If locations are not used, remove them.
   102164 
   102165 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   102166 
   102167 # 5. Check
   102168 { set +x
   102169 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   102170 at_fn_check_prepare_trace "calc.at:659"
   102171 ( $at_check_trace; cat stderr
   102172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102173 at_status=$? at_failed=false
   102174 $at_check_filter
   102175 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102176 $at_diff expout "$at_stdout" || at_failed=:
   102177 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102178 $at_failed && at_fn_log_failure
   102179 $at_traceon; }
   102180 
   102181 
   102182 
   102183 # The same, but this time exercising explicitly triggered syntax errors.
   102184 # POSIX says the lookahead causing the error should not be discarded.
   102185 cat >input <<'_ATEOF'
   102186 (!) + (1 2) = 1
   102187 _ATEOF
   102188 
   102189 { set +x
   102190 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   102191 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   102192 ( $at_check_trace;  $PREPARSER ./calc input
   102193 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102194 at_status=$? at_failed=false
   102195 $at_check_filter
   102196 echo stderr:; tee stderr <"$at_stderr"
   102197 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102198 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102199 $at_failed && at_fn_log_failure
   102200 $at_traceon; }
   102201 
   102202 { set +x
   102203 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102204 at_fn_check_prepare_trace "calc.at:659"
   102205 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102206 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102207 at_status=$? at_failed=false
   102208 $at_check_filter
   102209 echo stderr:; tee stderr <"$at_stderr"
   102210 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102211 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102212 $at_failed && at_fn_log_failure
   102213 $at_traceon; }
   102214 
   102215 
   102216 
   102217 # Normalize the observed and expected error messages, depending upon the
   102218 # options.
   102219 # 1. Remove the traces from observed.
   102220 sed '/^Starting/d
   102221 /^Entering/d
   102222 /^Stack/d
   102223 /^Reading/d
   102224 /^Reducing/d
   102225 /^Return/d
   102226 /^Shifting/d
   102227 /^state/d
   102228 /^Cleanup:/d
   102229 /^Error:/d
   102230 /^Next/d
   102231 /^Now/d
   102232 /^Discarding/d
   102233 / \$[0-9$]* = /d
   102234 /^yydestructor:/d' stderr >at-stderr
   102235 mv at-stderr stderr
   102236 # 2. Create the reference error message.
   102237 cat >expout <<'_ATEOF'
   102238 1.10: syntax error, unexpected number
   102239 calc: error: 2222 != 1
   102240 _ATEOF
   102241 
   102242 # 3. If locations are not used, remove them.
   102243 
   102244 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   102245 
   102246 # 5. Check
   102247 { set +x
   102248 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   102249 at_fn_check_prepare_trace "calc.at:659"
   102250 ( $at_check_trace; cat stderr
   102251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102252 at_status=$? at_failed=false
   102253 $at_check_filter
   102254 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102255 $at_diff expout "$at_stdout" || at_failed=:
   102256 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102257 $at_failed && at_fn_log_failure
   102258 $at_traceon; }
   102259 
   102260 
   102261 cat >input <<'_ATEOF'
   102262 (- *) + (1 2) = 1
   102263 _ATEOF
   102264 
   102265 { set +x
   102266 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   102267 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   102268 ( $at_check_trace;  $PREPARSER ./calc input
   102269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102270 at_status=$? at_failed=false
   102271 $at_check_filter
   102272 echo stderr:; tee stderr <"$at_stderr"
   102273 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102274 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102275 $at_failed && at_fn_log_failure
   102276 $at_traceon; }
   102277 
   102278 { set +x
   102279 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102280 at_fn_check_prepare_trace "calc.at:659"
   102281 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102283 at_status=$? at_failed=false
   102284 $at_check_filter
   102285 echo stderr:; tee stderr <"$at_stderr"
   102286 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102287 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102288 $at_failed && at_fn_log_failure
   102289 $at_traceon; }
   102290 
   102291 
   102292 
   102293 # Normalize the observed and expected error messages, depending upon the
   102294 # options.
   102295 # 1. Remove the traces from observed.
   102296 sed '/^Starting/d
   102297 /^Entering/d
   102298 /^Stack/d
   102299 /^Reading/d
   102300 /^Reducing/d
   102301 /^Return/d
   102302 /^Shifting/d
   102303 /^state/d
   102304 /^Cleanup:/d
   102305 /^Error:/d
   102306 /^Next/d
   102307 /^Now/d
   102308 /^Discarding/d
   102309 / \$[0-9$]* = /d
   102310 /^yydestructor:/d' stderr >at-stderr
   102311 mv at-stderr stderr
   102312 # 2. Create the reference error message.
   102313 cat >expout <<'_ATEOF'
   102314 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   102315 1.12: syntax error, unexpected number
   102316 calc: error: 2222 != 1
   102317 _ATEOF
   102318 
   102319 # 3. If locations are not used, remove them.
   102320 
   102321 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   102322 
   102323 # 5. Check
   102324 { set +x
   102325 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   102326 at_fn_check_prepare_trace "calc.at:659"
   102327 ( $at_check_trace; cat stderr
   102328 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102329 at_status=$? at_failed=false
   102330 $at_check_filter
   102331 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102332 $at_diff expout "$at_stdout" || at_failed=:
   102333 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102334 $at_failed && at_fn_log_failure
   102335 $at_traceon; }
   102336 
   102337 
   102338 
   102339 # Check that yyerrok works properly: second error is not reported,
   102340 # third and fourth are.  Parse status is succesfull.
   102341 cat >input <<'_ATEOF'
   102342 (* *) + (*) + (*)
   102343 _ATEOF
   102344 
   102345 { set +x
   102346 $as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
   102347 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
   102348 ( $at_check_trace;  $PREPARSER ./calc input
   102349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102350 at_status=$? at_failed=false
   102351 $at_check_filter
   102352 echo stderr:; tee stderr <"$at_stderr"
   102353 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102354 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102355 $at_failed && at_fn_log_failure
   102356 $at_traceon; }
   102357 
   102358 { set +x
   102359 $as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102360 at_fn_check_prepare_trace "calc.at:659"
   102361 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102363 at_status=$? at_failed=false
   102364 $at_check_filter
   102365 echo stderr:; tee stderr <"$at_stderr"
   102366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102367 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102368 $at_failed && at_fn_log_failure
   102369 $at_traceon; }
   102370 
   102371 
   102372 
   102373 # Normalize the observed and expected error messages, depending upon the
   102374 # options.
   102375 # 1. Remove the traces from observed.
   102376 sed '/^Starting/d
   102377 /^Entering/d
   102378 /^Stack/d
   102379 /^Reading/d
   102380 /^Reducing/d
   102381 /^Return/d
   102382 /^Shifting/d
   102383 /^state/d
   102384 /^Cleanup:/d
   102385 /^Error:/d
   102386 /^Next/d
   102387 /^Now/d
   102388 /^Discarding/d
   102389 / \$[0-9$]* = /d
   102390 /^yydestructor:/d' stderr >at-stderr
   102391 mv at-stderr stderr
   102392 # 2. Create the reference error message.
   102393 cat >expout <<'_ATEOF'
   102394 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   102395 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   102396 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   102397 _ATEOF
   102398 
   102399 # 3. If locations are not used, remove them.
   102400 
   102401 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   102402 
   102403 # 5. Check
   102404 { set +x
   102405 $as_echo "$at_srcdir/calc.at:659: cat stderr"
   102406 at_fn_check_prepare_trace "calc.at:659"
   102407 ( $at_check_trace; cat stderr
   102408 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102409 at_status=$? at_failed=false
   102410 $at_check_filter
   102411 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102412 $at_diff expout "$at_stdout" || at_failed=:
   102413 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
   102414 $at_failed && at_fn_log_failure
   102415 $at_traceon; }
   102416 
   102417 
   102418 
   102419 
   102420 
   102421   set +x
   102422   $at_times_p && times >"$at_times_file"
   102423 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   102424 read at_status <"$at_status_file"
   102425 #AT_STOP_233
   102426 #AT_START_234
   102427 at_fn_group_banner 234 'calc.at:660' \
   102428   "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 12
   102429 at_xfail=no
   102430 (
   102431   $as_echo "234. $at_setup_line: testing $at_desc ..."
   102432   $at_traceon
   102433 
   102434 
   102435 
   102436 
   102437 
   102438 
   102439 
   102440 
   102441 
   102442 
   102443 cat >calc.y <<'_ATEOF'
   102444 %code top {
   102445 #include <config.h>
   102446 /* We don't need perfect functions for these tests. */
   102447 #undef malloc
   102448 #undef memcmp
   102449 #undef realloc
   102450 }
   102451 
   102452 /* Infix notation calculator--calc */
   102453 %glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   102454 
   102455 %code requires
   102456 {
   102457 
   102458   /* Exercise pre-prologue dependency to %union.  */
   102459   typedef int semantic_value;
   102460 }
   102461 
   102462 /* Exercise %union. */
   102463 %union
   102464 {
   102465   semantic_value ival;
   102466 };
   102467 %printer { fprintf (yyoutput, "%d", $$); } <ival>;
   102468 
   102469 %code provides
   102470 {
   102471   #include <stdio.h>
   102472   /* The input.  */
   102473   extern FILE *input;
   102474   extern semantic_value global_result;
   102475   extern int global_count;
   102476 }
   102477 
   102478 %code
   102479 {
   102480 #include <assert.h>
   102481 #include <string.h>
   102482 #define USE(Var)
   102483 
   102484 FILE *input;
   102485 static int power (int base, int exponent);
   102486 
   102487 static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg);
   102488 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   102489 }
   102490 
   102491 
   102492 
   102493 /* Bison Declarations */
   102494 %token CALC_EOF 0 "end of input"
   102495 %token <ival> NUM "number"
   102496 %type  <ival> exp
   102497 
   102498 %nonassoc '=' /* comparison            */
   102499 %left '-' '+'
   102500 %left '*' '/'
   102501 %left NEG     /* negation--unary minus */
   102502 %right '^'    /* exponentiation        */
   102503 
   102504 /* Grammar follows */
   102505 %%
   102506 input:
   102507   line
   102508 | input line         { ++*count; ++global_count; }
   102509 ;
   102510 
   102511 line:
   102512   '\n'
   102513 | exp '\n'           { *result = global_result = $1; }
   102514 ;
   102515 
   102516 exp:
   102517   NUM                { $$ = $1;             }
   102518 | exp '=' exp
   102519   {
   102520     if ($1 != $3)
   102521       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   102522     $$ = $1;
   102523   }
   102524 | exp '+' exp        { $$ = $1 + $3;        }
   102525 | exp '-' exp        { $$ = $1 - $3;        }
   102526 | exp '*' exp        { $$ = $1 * $3;        }
   102527 | exp '/' exp        { $$ = $1 / $3;        }
   102528 | '-' exp  %prec NEG { $$ = -$2;            }
   102529 | exp '^' exp        { $$ = power ($1, $3); }
   102530 | '(' exp ')'        { $$ = $2;             }
   102531 | '(' error ')'      { $$ = 1111; yyerrok;  }
   102532 | '!'                { $$ = 0; YYERROR;     }
   102533 | '-' error          { $$ = 0; YYERROR;     }
   102534 ;
   102535 %%
   102536 
   102537 static int
   102538 power (int base, int exponent)
   102539 {
   102540   int res = 1;
   102541   assert (0 <= exponent);
   102542   for (/* Niente */; exponent; --exponent)
   102543     res *= base;
   102544   return res;
   102545 }
   102546 
   102547 
   102548 #include <stdio.h>
   102549 /* A C error reporting function.  */
   102550 static
   102551 void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count,  const char *msg)
   102552 {
   102553   YYUSE(result);
   102554   YYUSE(count);
   102555   YY_LOCATION_PRINT (stderr, (*llocp));
   102556   fprintf (stderr, ": ");
   102557   fprintf (stderr, "%s\n", msg);
   102558 }
   102559 _ATEOF
   102560 
   102561 
   102562 
   102563 cat >calc-lex.c <<'_ATEOF'
   102564 #include <config.h>
   102565 /* We don't need perfect functions for these tests. */
   102566 #undef malloc
   102567 #undef memcmp
   102568 #undef realloc
   102569 
   102570 #include "calc.h"
   102571 
   102572 #include <ctype.h>
   102573 
   102574 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   102575 static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
   102576 static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);
   102577 
   102578 
   102579 static CALCLTYPE last_yylloc;
   102580 
   102581 static int
   102582 get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   102583 {
   102584   int res = getc (input);
   102585   (void) lvalp;(void) llocp;
   102586 
   102587   last_yylloc = (*llocp);
   102588   if (res == '\n')
   102589     {
   102590       (*llocp).last_line++;
   102591       (*llocp).last_column = 1;
   102592     }
   102593   else
   102594     (*llocp).last_column++;
   102595 
   102596   return res;
   102597 }
   102598 
   102599 static void
   102600 unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c)
   102601 {
   102602   (void) lvalp;(void) llocp;
   102603 
   102604   /* Wrong when C == `\n'. */
   102605   (*llocp) = last_yylloc;
   102606 
   102607   ungetc (c, input);
   102608 }
   102609 
   102610 static int
   102611 read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   102612 {
   102613   int c = get_char (lvalp, llocp);
   102614   int sign = 1;
   102615   int n = 0;
   102616 
   102617   (void) lvalp;(void) llocp;
   102618   if (c == '-')
   102619     {
   102620       c = get_char (lvalp, llocp);
   102621       sign = -1;
   102622     }
   102623 
   102624   while (isdigit (c))
   102625     {
   102626       n = 10 * n + (c - '0');
   102627       c = get_char (lvalp, llocp);
   102628     }
   102629 
   102630   unget_char (lvalp, llocp,  c);
   102631 
   102632   return sign * n;
   102633 }
   102634 
   102635 
   102636 /*---------------------------------------------------------------.
   102637 | Lexical analyzer returns an integer on the stack and the token |
   102638 | NUM, or the ASCII character read if not a number.  Skips all   |
   102639 | blanks and tabs, returns 0 for EOF.                            |
   102640 `---------------------------------------------------------------*/
   102641 
   102642 int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
   102643 {
   102644   int c;
   102645   /* Skip current token, then white spaces.  */
   102646   do
   102647     {
   102648      (*llocp).first_column = (*llocp).last_column;
   102649       (*llocp).first_line   = (*llocp).last_line;
   102650 
   102651     }
   102652   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   102653 
   102654   /* process numbers   */
   102655   if (c == '.' || isdigit (c))
   102656     {
   102657       unget_char (lvalp, llocp,  c);
   102658       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   102659       return NUM;
   102660     }
   102661 
   102662   /* Return end-of-file.  */
   102663   if (c == EOF)
   102664     return CALC_EOF;
   102665 
   102666   /* Return single chars. */
   102667   return c;
   102668 }
   102669 _ATEOF
   102670 
   102671 
   102672 cat >calc-main.c <<'_ATEOF'
   102673 #include <config.h>
   102674 /* We don't need perfect functions for these tests. */
   102675 #undef malloc
   102676 #undef memcmp
   102677 #undef realloc
   102678 
   102679 #include "calc.h"
   102680 
   102681 #include <assert.h>
   102682 #if HAVE_UNISTD_H
   102683 # include <unistd.h>
   102684 #else
   102685 # undef alarm
   102686 # define alarm(seconds) /* empty */
   102687 #endif
   102688 
   102689 
   102690 
   102691 semantic_value global_result = 0;
   102692 int global_count = 0;
   102693 
   102694 /* A C main function.  */
   102695 int
   102696 main (int argc, const char **argv)
   102697 {
   102698   semantic_value result = 0;
   102699   int count = 0;
   102700   int status;
   102701 
   102702   /* This used to be alarm (10), but that isn't enough time for
   102703      a July 1995 vintage DEC Alphastation 200 4/100 system,
   102704      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   102705   alarm (100);
   102706 
   102707   if (argc == 2)
   102708     input = fopen (argv[1], "r");
   102709   else
   102710     input = stdin;
   102711 
   102712   if (!input)
   102713     {
   102714       perror (argv[1]);
   102715       return 3;
   102716     }
   102717 
   102718   calcdebug = 1;
   102719   status = calcparse (&result, &count);
   102720   if (fclose (input))
   102721     perror ("fclose");
   102722   assert (global_result == result);
   102723   assert (global_count == count);
   102724   return status;
   102725 }
   102726 _ATEOF
   102727 
   102728 
   102729 
   102730 
   102731 
   102732 
   102733 
   102734 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   102735   at_save_special_files
   102736   mkdir xml-tests
   102737     # Don't combine these Bison invocations since we want to be sure that
   102738   # --report=all isn't required to get the full XML file.
   102739   { set +x
   102740 $as_echo "$at_srcdir/calc.at:660: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   102741                   --graph=xml-tests/test.dot -o calc.c calc.y"
   102742 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660"
   102743 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   102744                   --graph=xml-tests/test.dot -o calc.c calc.y
   102745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102746 at_status=$? at_failed=false
   102747 $at_check_filter
   102748 echo stderr:; cat "$at_stderr"
   102749 echo stdout:; cat "$at_stdout"
   102750 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102751 $at_failed && at_fn_log_failure
   102752 $at_traceon; }
   102753 
   102754   { set +x
   102755 $as_echo "$at_srcdir/calc.at:660: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y"
   102756 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:660"
   102757 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y
   102758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102759 at_status=$? at_failed=false
   102760 $at_check_filter
   102761 echo stderr:; cat "$at_stderr"
   102762 echo stdout:; cat "$at_stdout"
   102763 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102764 $at_failed && at_fn_log_failure
   102765 $at_traceon; }
   102766 
   102767     cp xml-tests/test.output expout
   102768   { set +x
   102769 $as_echo "$at_srcdir/calc.at:660: \$XSLTPROC \\
   102770              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   102771              xml-tests/test.xml"
   102772 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:660"
   102773 ( $at_check_trace; $XSLTPROC \
   102774              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   102775              xml-tests/test.xml
   102776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102777 at_status=$? at_failed=false
   102778 $at_check_filter
   102779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102780 $at_diff expout "$at_stdout" || at_failed=:
   102781 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102782 $at_failed && at_fn_log_failure
   102783 $at_traceon; }
   102784 
   102785   sort xml-tests/test.dot > expout
   102786   { set +x
   102787 $as_echo "$at_srcdir/calc.at:660: \$XSLTPROC \\
   102788              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   102789              xml-tests/test.xml | sort"
   102790 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:660"
   102791 ( $at_check_trace; $XSLTPROC \
   102792              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   102793              xml-tests/test.xml | sort
   102794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102795 at_status=$? at_failed=false
   102796 $at_check_filter
   102797 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102798 $at_diff expout "$at_stdout" || at_failed=:
   102799 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102800 $at_failed && at_fn_log_failure
   102801 $at_traceon; }
   102802 
   102803   rm -rf xml-tests expout
   102804   at_restore_special_files
   102805 fi
   102806 { set +x
   102807 $as_echo "$at_srcdir/calc.at:660: bison -o calc.c calc.y"
   102808 at_fn_check_prepare_trace "calc.at:660"
   102809 ( $at_check_trace; bison -o calc.c calc.y
   102810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102811 at_status=$? at_failed=false
   102812 $at_check_filter
   102813 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102814 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102815 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102816 $at_failed && at_fn_log_failure
   102817 $at_traceon; }
   102818 
   102819 
   102820    { set +x
   102821 $as_echo "$at_srcdir/calc.at:660: \$BISON_C_WORKS"
   102822 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:660"
   102823 ( $at_check_trace; $BISON_C_WORKS
   102824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102825 at_status=$? at_failed=false
   102826 $at_check_filter
   102827 echo stderr:; cat "$at_stderr"
   102828 echo stdout:; cat "$at_stdout"
   102829 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102830 $at_failed && at_fn_log_failure
   102831 $at_traceon; }
   102832 
   102833 { set +x
   102834 $as_echo "$at_srcdir/calc.at:660: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
   102835 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:660"
   102836 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
   102837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102838 at_status=$? at_failed=false
   102839 $at_check_filter
   102840 echo stderr:; cat "$at_stderr"
   102841 echo stdout:; cat "$at_stdout"
   102842 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102843 $at_failed && at_fn_log_failure
   102844 $at_traceon; }
   102845 
   102846 
   102847 { set +x
   102848 $as_echo "$at_srcdir/calc.at:660: \$PERL -ne '
   102849   chomp;
   102850   print \"\$.: {\$_}\\n\"
   102851     if (# No starting/ending empty lines.
   102852         (eof || \$. == 1) && /^\\s*\$/
   102853         # No trailing space.  FIXME: not ready for \"maint\".
   102854         # || /\\s\$/
   102855         )' calc.c
   102856 "
   102857 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660"
   102858 ( $at_check_trace; $PERL -ne '
   102859   chomp;
   102860   print "$.: {$_}\n"
   102861     if (# No starting/ending empty lines.
   102862         (eof || $. == 1) && /^\s*$/
   102863         # No trailing space.  FIXME: not ready for "maint".
   102864         # || /\s$/
   102865         )' calc.c
   102866 
   102867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102868 at_status=$? at_failed=false
   102869 $at_check_filter
   102870 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102871 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102872 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102873 $at_failed && at_fn_log_failure
   102874 $at_traceon; }
   102875 
   102876 { set +x
   102877 $as_echo "$at_srcdir/calc.at:660: \$PERL -ne '
   102878   chomp;
   102879   print \"\$.: {\$_}\\n\"
   102880     if (# No starting/ending empty lines.
   102881         (eof || \$. == 1) && /^\\s*\$/
   102882         # No trailing space.  FIXME: not ready for \"maint\".
   102883         # || /\\s\$/
   102884         )' calc.h
   102885 "
   102886 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660"
   102887 ( $at_check_trace; $PERL -ne '
   102888   chomp;
   102889   print "$.: {$_}\n"
   102890     if (# No starting/ending empty lines.
   102891         (eof || $. == 1) && /^\s*$/
   102892         # No trailing space.  FIXME: not ready for "maint".
   102893         # || /\s$/
   102894         )' calc.h
   102895 
   102896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102897 at_status=$? at_failed=false
   102898 $at_check_filter
   102899 at_fn_diff_devnull "$at_stderr" || at_failed=:
   102900 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102901 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102902 $at_failed && at_fn_log_failure
   102903 $at_traceon; }
   102904 
   102905 
   102906 # Test the priorities.
   102907 cat >input <<'_ATEOF'
   102908 1 + 2 * 3 = 7
   102909 1 + 2 * -3 = -5
   102910 
   102911 -1^2 = -1
   102912 (-1)^2 = 1
   102913 
   102914 ---1 = -1
   102915 
   102916 1 - 2 - 3 = -4
   102917 1 - (2 - 3) = 2
   102918 
   102919 2^2^3 = 256
   102920 (2^2)^3 = 64
   102921 _ATEOF
   102922 
   102923 { set +x
   102924 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   102925 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   102926 ( $at_check_trace;  $PREPARSER ./calc input
   102927 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102928 at_status=$? at_failed=false
   102929 $at_check_filter
   102930 echo stderr:; tee stderr <"$at_stderr"
   102931 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102932 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102933 $at_failed && at_fn_log_failure
   102934 $at_traceon; }
   102935 
   102936 { set +x
   102937 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102938 at_fn_check_prepare_trace "calc.at:660"
   102939 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102941 at_status=$? at_failed=false
   102942 $at_check_filter
   102943 echo stderr:; tee stderr <"$at_stderr"
   102944 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102945 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102946 $at_failed && at_fn_log_failure
   102947 $at_traceon; }
   102948 
   102949 
   102950 
   102951 
   102952 # Some syntax errors.
   102953 cat >input <<'_ATEOF'
   102954 1 2
   102955 _ATEOF
   102956 
   102957 { set +x
   102958 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   102959 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   102960 ( $at_check_trace;  $PREPARSER ./calc input
   102961 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102962 at_status=$? at_failed=false
   102963 $at_check_filter
   102964 echo stderr:; tee stderr <"$at_stderr"
   102965 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102966 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660"
   102967 $at_failed && at_fn_log_failure
   102968 $at_traceon; }
   102969 
   102970 { set +x
   102971 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   102972 at_fn_check_prepare_trace "calc.at:660"
   102973 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   102974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   102975 at_status=$? at_failed=false
   102976 $at_check_filter
   102977 echo stderr:; tee stderr <"$at_stderr"
   102978 at_fn_diff_devnull "$at_stdout" || at_failed=:
   102979 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   102980 $at_failed && at_fn_log_failure
   102981 $at_traceon; }
   102982 
   102983 
   102984 
   102985 # Normalize the observed and expected error messages, depending upon the
   102986 # options.
   102987 # 1. Remove the traces from observed.
   102988 sed '/^Starting/d
   102989 /^Entering/d
   102990 /^Stack/d
   102991 /^Reading/d
   102992 /^Reducing/d
   102993 /^Return/d
   102994 /^Shifting/d
   102995 /^state/d
   102996 /^Cleanup:/d
   102997 /^Error:/d
   102998 /^Next/d
   102999 /^Now/d
   103000 /^Discarding/d
   103001 / \$[0-9$]* = /d
   103002 /^yydestructor:/d' stderr >at-stderr
   103003 mv at-stderr stderr
   103004 # 2. Create the reference error message.
   103005 cat >expout <<'_ATEOF'
   103006 1.3: syntax error, unexpected number
   103007 _ATEOF
   103008 
   103009 # 3. If locations are not used, remove them.
   103010 
   103011 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103012 
   103013 # 5. Check
   103014 { set +x
   103015 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103016 at_fn_check_prepare_trace "calc.at:660"
   103017 ( $at_check_trace; cat stderr
   103018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103019 at_status=$? at_failed=false
   103020 $at_check_filter
   103021 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103022 $at_diff expout "$at_stdout" || at_failed=:
   103023 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103024 $at_failed && at_fn_log_failure
   103025 $at_traceon; }
   103026 
   103027 
   103028 cat >input <<'_ATEOF'
   103029 1//2
   103030 _ATEOF
   103031 
   103032 { set +x
   103033 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103034 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103035 ( $at_check_trace;  $PREPARSER ./calc input
   103036 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103037 at_status=$? at_failed=false
   103038 $at_check_filter
   103039 echo stderr:; tee stderr <"$at_stderr"
   103040 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103041 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660"
   103042 $at_failed && at_fn_log_failure
   103043 $at_traceon; }
   103044 
   103045 { set +x
   103046 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103047 at_fn_check_prepare_trace "calc.at:660"
   103048 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103049 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103050 at_status=$? at_failed=false
   103051 $at_check_filter
   103052 echo stderr:; tee stderr <"$at_stderr"
   103053 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103054 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103055 $at_failed && at_fn_log_failure
   103056 $at_traceon; }
   103057 
   103058 
   103059 
   103060 # Normalize the observed and expected error messages, depending upon the
   103061 # options.
   103062 # 1. Remove the traces from observed.
   103063 sed '/^Starting/d
   103064 /^Entering/d
   103065 /^Stack/d
   103066 /^Reading/d
   103067 /^Reducing/d
   103068 /^Return/d
   103069 /^Shifting/d
   103070 /^state/d
   103071 /^Cleanup:/d
   103072 /^Error:/d
   103073 /^Next/d
   103074 /^Now/d
   103075 /^Discarding/d
   103076 / \$[0-9$]* = /d
   103077 /^yydestructor:/d' stderr >at-stderr
   103078 mv at-stderr stderr
   103079 # 2. Create the reference error message.
   103080 cat >expout <<'_ATEOF'
   103081 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   103082 _ATEOF
   103083 
   103084 # 3. If locations are not used, remove them.
   103085 
   103086 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103087 
   103088 # 5. Check
   103089 { set +x
   103090 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103091 at_fn_check_prepare_trace "calc.at:660"
   103092 ( $at_check_trace; cat stderr
   103093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103094 at_status=$? at_failed=false
   103095 $at_check_filter
   103096 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103097 $at_diff expout "$at_stdout" || at_failed=:
   103098 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103099 $at_failed && at_fn_log_failure
   103100 $at_traceon; }
   103101 
   103102 
   103103 cat >input <<'_ATEOF'
   103104 error
   103105 _ATEOF
   103106 
   103107 { set +x
   103108 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103109 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103110 ( $at_check_trace;  $PREPARSER ./calc input
   103111 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103112 at_status=$? at_failed=false
   103113 $at_check_filter
   103114 echo stderr:; tee stderr <"$at_stderr"
   103115 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103116 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660"
   103117 $at_failed && at_fn_log_failure
   103118 $at_traceon; }
   103119 
   103120 { set +x
   103121 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103122 at_fn_check_prepare_trace "calc.at:660"
   103123 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103125 at_status=$? at_failed=false
   103126 $at_check_filter
   103127 echo stderr:; tee stderr <"$at_stderr"
   103128 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103129 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103130 $at_failed && at_fn_log_failure
   103131 $at_traceon; }
   103132 
   103133 
   103134 
   103135 # Normalize the observed and expected error messages, depending upon the
   103136 # options.
   103137 # 1. Remove the traces from observed.
   103138 sed '/^Starting/d
   103139 /^Entering/d
   103140 /^Stack/d
   103141 /^Reading/d
   103142 /^Reducing/d
   103143 /^Return/d
   103144 /^Shifting/d
   103145 /^state/d
   103146 /^Cleanup:/d
   103147 /^Error:/d
   103148 /^Next/d
   103149 /^Now/d
   103150 /^Discarding/d
   103151 / \$[0-9$]* = /d
   103152 /^yydestructor:/d' stderr >at-stderr
   103153 mv at-stderr stderr
   103154 # 2. Create the reference error message.
   103155 cat >expout <<'_ATEOF'
   103156 1.1: syntax error, unexpected $undefined
   103157 _ATEOF
   103158 
   103159 # 3. If locations are not used, remove them.
   103160 
   103161 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103162 
   103163 # 5. Check
   103164 { set +x
   103165 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103166 at_fn_check_prepare_trace "calc.at:660"
   103167 ( $at_check_trace; cat stderr
   103168 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103169 at_status=$? at_failed=false
   103170 $at_check_filter
   103171 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103172 $at_diff expout "$at_stdout" || at_failed=:
   103173 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103174 $at_failed && at_fn_log_failure
   103175 $at_traceon; }
   103176 
   103177 
   103178 cat >input <<'_ATEOF'
   103179 1 = 2 = 3
   103180 _ATEOF
   103181 
   103182 { set +x
   103183 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103184 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103185 ( $at_check_trace;  $PREPARSER ./calc input
   103186 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103187 at_status=$? at_failed=false
   103188 $at_check_filter
   103189 echo stderr:; tee stderr <"$at_stderr"
   103190 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103191 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660"
   103192 $at_failed && at_fn_log_failure
   103193 $at_traceon; }
   103194 
   103195 { set +x
   103196 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103197 at_fn_check_prepare_trace "calc.at:660"
   103198 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103200 at_status=$? at_failed=false
   103201 $at_check_filter
   103202 echo stderr:; tee stderr <"$at_stderr"
   103203 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103204 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103205 $at_failed && at_fn_log_failure
   103206 $at_traceon; }
   103207 
   103208 
   103209 
   103210 # Normalize the observed and expected error messages, depending upon the
   103211 # options.
   103212 # 1. Remove the traces from observed.
   103213 sed '/^Starting/d
   103214 /^Entering/d
   103215 /^Stack/d
   103216 /^Reading/d
   103217 /^Reducing/d
   103218 /^Return/d
   103219 /^Shifting/d
   103220 /^state/d
   103221 /^Cleanup:/d
   103222 /^Error:/d
   103223 /^Next/d
   103224 /^Now/d
   103225 /^Discarding/d
   103226 / \$[0-9$]* = /d
   103227 /^yydestructor:/d' stderr >at-stderr
   103228 mv at-stderr stderr
   103229 # 2. Create the reference error message.
   103230 cat >expout <<'_ATEOF'
   103231 1.7: syntax error, unexpected '='
   103232 _ATEOF
   103233 
   103234 # 3. If locations are not used, remove them.
   103235 
   103236 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103237 
   103238 # 5. Check
   103239 { set +x
   103240 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103241 at_fn_check_prepare_trace "calc.at:660"
   103242 ( $at_check_trace; cat stderr
   103243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103244 at_status=$? at_failed=false
   103245 $at_check_filter
   103246 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103247 $at_diff expout "$at_stdout" || at_failed=:
   103248 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103249 $at_failed && at_fn_log_failure
   103250 $at_traceon; }
   103251 
   103252 
   103253 cat >input <<'_ATEOF'
   103254 
   103255 +1
   103256 _ATEOF
   103257 
   103258 { set +x
   103259 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103260 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103261 ( $at_check_trace;  $PREPARSER ./calc input
   103262 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103263 at_status=$? at_failed=false
   103264 $at_check_filter
   103265 echo stderr:; tee stderr <"$at_stderr"
   103266 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103267 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660"
   103268 $at_failed && at_fn_log_failure
   103269 $at_traceon; }
   103270 
   103271 { set +x
   103272 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103273 at_fn_check_prepare_trace "calc.at:660"
   103274 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103276 at_status=$? at_failed=false
   103277 $at_check_filter
   103278 echo stderr:; tee stderr <"$at_stderr"
   103279 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103280 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103281 $at_failed && at_fn_log_failure
   103282 $at_traceon; }
   103283 
   103284 
   103285 
   103286 # Normalize the observed and expected error messages, depending upon the
   103287 # options.
   103288 # 1. Remove the traces from observed.
   103289 sed '/^Starting/d
   103290 /^Entering/d
   103291 /^Stack/d
   103292 /^Reading/d
   103293 /^Reducing/d
   103294 /^Return/d
   103295 /^Shifting/d
   103296 /^state/d
   103297 /^Cleanup:/d
   103298 /^Error:/d
   103299 /^Next/d
   103300 /^Now/d
   103301 /^Discarding/d
   103302 / \$[0-9$]* = /d
   103303 /^yydestructor:/d' stderr >at-stderr
   103304 mv at-stderr stderr
   103305 # 2. Create the reference error message.
   103306 cat >expout <<'_ATEOF'
   103307 2.1: syntax error, unexpected '+'
   103308 _ATEOF
   103309 
   103310 # 3. If locations are not used, remove them.
   103311 
   103312 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103313 
   103314 # 5. Check
   103315 { set +x
   103316 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103317 at_fn_check_prepare_trace "calc.at:660"
   103318 ( $at_check_trace; cat stderr
   103319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103320 at_status=$? at_failed=false
   103321 $at_check_filter
   103322 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103323 $at_diff expout "$at_stdout" || at_failed=:
   103324 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103325 $at_failed && at_fn_log_failure
   103326 $at_traceon; }
   103327 
   103328 
   103329 # Exercise error messages with EOF: work on an empty file.
   103330 { set +x
   103331 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc /dev/null"
   103332 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:660"
   103333 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   103334 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103335 at_status=$? at_failed=false
   103336 $at_check_filter
   103337 echo stderr:; tee stderr <"$at_stderr"
   103338 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103339 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660"
   103340 $at_failed && at_fn_log_failure
   103341 $at_traceon; }
   103342 
   103343 { set +x
   103344 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103345 at_fn_check_prepare_trace "calc.at:660"
   103346 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103347 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103348 at_status=$? at_failed=false
   103349 $at_check_filter
   103350 echo stderr:; tee stderr <"$at_stderr"
   103351 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103352 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103353 $at_failed && at_fn_log_failure
   103354 $at_traceon; }
   103355 
   103356 
   103357 
   103358 # Normalize the observed and expected error messages, depending upon the
   103359 # options.
   103360 # 1. Remove the traces from observed.
   103361 sed '/^Starting/d
   103362 /^Entering/d
   103363 /^Stack/d
   103364 /^Reading/d
   103365 /^Reducing/d
   103366 /^Return/d
   103367 /^Shifting/d
   103368 /^state/d
   103369 /^Cleanup:/d
   103370 /^Error:/d
   103371 /^Next/d
   103372 /^Now/d
   103373 /^Discarding/d
   103374 / \$[0-9$]* = /d
   103375 /^yydestructor:/d' stderr >at-stderr
   103376 mv at-stderr stderr
   103377 # 2. Create the reference error message.
   103378 cat >expout <<'_ATEOF'
   103379 1.1: syntax error, unexpected end of input
   103380 _ATEOF
   103381 
   103382 # 3. If locations are not used, remove them.
   103383 
   103384 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103385 
   103386 # 5. Check
   103387 { set +x
   103388 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103389 at_fn_check_prepare_trace "calc.at:660"
   103390 ( $at_check_trace; cat stderr
   103391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103392 at_status=$? at_failed=false
   103393 $at_check_filter
   103394 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103395 $at_diff expout "$at_stdout" || at_failed=:
   103396 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103397 $at_failed && at_fn_log_failure
   103398 $at_traceon; }
   103399 
   103400 
   103401 
   103402 # Exercise the error token: without it, we die at the first error,
   103403 # hence be sure to
   103404 #
   103405 # - have several errors which exercise different shift/discardings
   103406 #   - (): nothing to pop, nothing to discard
   103407 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   103408 #   - (* * *): nothing to pop, a lot to discard
   103409 #   - (1 + 2 * *): some to pop and discard
   103410 #
   103411 # - test the action associated to `error'
   103412 #
   103413 # - check the lookahead that triggers an error is not discarded
   103414 #   when we enter error recovery.  Below, the lookahead causing the
   103415 #   first error is ")", which is needed to recover from the error and
   103416 #   produce the "0" that triggers the "0 != 1" error.
   103417 #
   103418 cat >input <<'_ATEOF'
   103419 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   103420 _ATEOF
   103421 
   103422 { set +x
   103423 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103424 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103425 ( $at_check_trace;  $PREPARSER ./calc input
   103426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103427 at_status=$? at_failed=false
   103428 $at_check_filter
   103429 echo stderr:; tee stderr <"$at_stderr"
   103430 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103431 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103432 $at_failed && at_fn_log_failure
   103433 $at_traceon; }
   103434 
   103435 { set +x
   103436 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103437 at_fn_check_prepare_trace "calc.at:660"
   103438 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103439 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103440 at_status=$? at_failed=false
   103441 $at_check_filter
   103442 echo stderr:; tee stderr <"$at_stderr"
   103443 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103444 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103445 $at_failed && at_fn_log_failure
   103446 $at_traceon; }
   103447 
   103448 
   103449 
   103450 # Normalize the observed and expected error messages, depending upon the
   103451 # options.
   103452 # 1. Remove the traces from observed.
   103453 sed '/^Starting/d
   103454 /^Entering/d
   103455 /^Stack/d
   103456 /^Reading/d
   103457 /^Reducing/d
   103458 /^Return/d
   103459 /^Shifting/d
   103460 /^state/d
   103461 /^Cleanup:/d
   103462 /^Error:/d
   103463 /^Next/d
   103464 /^Now/d
   103465 /^Discarding/d
   103466 / \$[0-9$]* = /d
   103467 /^yydestructor:/d' stderr >at-stderr
   103468 mv at-stderr stderr
   103469 # 2. Create the reference error message.
   103470 cat >expout <<'_ATEOF'
   103471 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   103472 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   103473 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   103474 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   103475 calc: error: 4444 != 1
   103476 _ATEOF
   103477 
   103478 # 3. If locations are not used, remove them.
   103479 
   103480 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103481 
   103482 # 5. Check
   103483 { set +x
   103484 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103485 at_fn_check_prepare_trace "calc.at:660"
   103486 ( $at_check_trace; cat stderr
   103487 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103488 at_status=$? at_failed=false
   103489 $at_check_filter
   103490 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103491 $at_diff expout "$at_stdout" || at_failed=:
   103492 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103493 $at_failed && at_fn_log_failure
   103494 $at_traceon; }
   103495 
   103496 
   103497 
   103498 # The same, but this time exercising explicitly triggered syntax errors.
   103499 # POSIX says the lookahead causing the error should not be discarded.
   103500 cat >input <<'_ATEOF'
   103501 (!) + (1 2) = 1
   103502 _ATEOF
   103503 
   103504 { set +x
   103505 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103506 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103507 ( $at_check_trace;  $PREPARSER ./calc input
   103508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103509 at_status=$? at_failed=false
   103510 $at_check_filter
   103511 echo stderr:; tee stderr <"$at_stderr"
   103512 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103513 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103514 $at_failed && at_fn_log_failure
   103515 $at_traceon; }
   103516 
   103517 { set +x
   103518 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103519 at_fn_check_prepare_trace "calc.at:660"
   103520 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103521 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103522 at_status=$? at_failed=false
   103523 $at_check_filter
   103524 echo stderr:; tee stderr <"$at_stderr"
   103525 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103526 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103527 $at_failed && at_fn_log_failure
   103528 $at_traceon; }
   103529 
   103530 
   103531 
   103532 # Normalize the observed and expected error messages, depending upon the
   103533 # options.
   103534 # 1. Remove the traces from observed.
   103535 sed '/^Starting/d
   103536 /^Entering/d
   103537 /^Stack/d
   103538 /^Reading/d
   103539 /^Reducing/d
   103540 /^Return/d
   103541 /^Shifting/d
   103542 /^state/d
   103543 /^Cleanup:/d
   103544 /^Error:/d
   103545 /^Next/d
   103546 /^Now/d
   103547 /^Discarding/d
   103548 / \$[0-9$]* = /d
   103549 /^yydestructor:/d' stderr >at-stderr
   103550 mv at-stderr stderr
   103551 # 2. Create the reference error message.
   103552 cat >expout <<'_ATEOF'
   103553 1.10: syntax error, unexpected number
   103554 calc: error: 2222 != 1
   103555 _ATEOF
   103556 
   103557 # 3. If locations are not used, remove them.
   103558 
   103559 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103560 
   103561 # 5. Check
   103562 { set +x
   103563 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103564 at_fn_check_prepare_trace "calc.at:660"
   103565 ( $at_check_trace; cat stderr
   103566 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103567 at_status=$? at_failed=false
   103568 $at_check_filter
   103569 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103570 $at_diff expout "$at_stdout" || at_failed=:
   103571 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103572 $at_failed && at_fn_log_failure
   103573 $at_traceon; }
   103574 
   103575 
   103576 cat >input <<'_ATEOF'
   103577 (- *) + (1 2) = 1
   103578 _ATEOF
   103579 
   103580 { set +x
   103581 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103582 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103583 ( $at_check_trace;  $PREPARSER ./calc input
   103584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103585 at_status=$? at_failed=false
   103586 $at_check_filter
   103587 echo stderr:; tee stderr <"$at_stderr"
   103588 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103589 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103590 $at_failed && at_fn_log_failure
   103591 $at_traceon; }
   103592 
   103593 { set +x
   103594 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103595 at_fn_check_prepare_trace "calc.at:660"
   103596 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103598 at_status=$? at_failed=false
   103599 $at_check_filter
   103600 echo stderr:; tee stderr <"$at_stderr"
   103601 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103602 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103603 $at_failed && at_fn_log_failure
   103604 $at_traceon; }
   103605 
   103606 
   103607 
   103608 # Normalize the observed and expected error messages, depending upon the
   103609 # options.
   103610 # 1. Remove the traces from observed.
   103611 sed '/^Starting/d
   103612 /^Entering/d
   103613 /^Stack/d
   103614 /^Reading/d
   103615 /^Reducing/d
   103616 /^Return/d
   103617 /^Shifting/d
   103618 /^state/d
   103619 /^Cleanup:/d
   103620 /^Error:/d
   103621 /^Next/d
   103622 /^Now/d
   103623 /^Discarding/d
   103624 / \$[0-9$]* = /d
   103625 /^yydestructor:/d' stderr >at-stderr
   103626 mv at-stderr stderr
   103627 # 2. Create the reference error message.
   103628 cat >expout <<'_ATEOF'
   103629 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   103630 1.12: syntax error, unexpected number
   103631 calc: error: 2222 != 1
   103632 _ATEOF
   103633 
   103634 # 3. If locations are not used, remove them.
   103635 
   103636 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103637 
   103638 # 5. Check
   103639 { set +x
   103640 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103641 at_fn_check_prepare_trace "calc.at:660"
   103642 ( $at_check_trace; cat stderr
   103643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103644 at_status=$? at_failed=false
   103645 $at_check_filter
   103646 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103647 $at_diff expout "$at_stdout" || at_failed=:
   103648 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103649 $at_failed && at_fn_log_failure
   103650 $at_traceon; }
   103651 
   103652 
   103653 
   103654 # Check that yyerrok works properly: second error is not reported,
   103655 # third and fourth are.  Parse status is succesfull.
   103656 cat >input <<'_ATEOF'
   103657 (* *) + (*) + (*)
   103658 _ATEOF
   103659 
   103660 { set +x
   103661 $as_echo "$at_srcdir/calc.at:660:  \$PREPARSER ./calc input"
   103662 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660"
   103663 ( $at_check_trace;  $PREPARSER ./calc input
   103664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103665 at_status=$? at_failed=false
   103666 $at_check_filter
   103667 echo stderr:; tee stderr <"$at_stderr"
   103668 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103669 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103670 $at_failed && at_fn_log_failure
   103671 $at_traceon; }
   103672 
   103673 { set +x
   103674 $as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   103675 at_fn_check_prepare_trace "calc.at:660"
   103676 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   103677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103678 at_status=$? at_failed=false
   103679 $at_check_filter
   103680 echo stderr:; tee stderr <"$at_stderr"
   103681 at_fn_diff_devnull "$at_stdout" || at_failed=:
   103682 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103683 $at_failed && at_fn_log_failure
   103684 $at_traceon; }
   103685 
   103686 
   103687 
   103688 # Normalize the observed and expected error messages, depending upon the
   103689 # options.
   103690 # 1. Remove the traces from observed.
   103691 sed '/^Starting/d
   103692 /^Entering/d
   103693 /^Stack/d
   103694 /^Reading/d
   103695 /^Reducing/d
   103696 /^Return/d
   103697 /^Shifting/d
   103698 /^state/d
   103699 /^Cleanup:/d
   103700 /^Error:/d
   103701 /^Next/d
   103702 /^Now/d
   103703 /^Discarding/d
   103704 / \$[0-9$]* = /d
   103705 /^yydestructor:/d' stderr >at-stderr
   103706 mv at-stderr stderr
   103707 # 2. Create the reference error message.
   103708 cat >expout <<'_ATEOF'
   103709 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   103710 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   103711 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   103712 _ATEOF
   103713 
   103714 # 3. If locations are not used, remove them.
   103715 
   103716 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   103717 
   103718 # 5. Check
   103719 { set +x
   103720 $as_echo "$at_srcdir/calc.at:660: cat stderr"
   103721 at_fn_check_prepare_trace "calc.at:660"
   103722 ( $at_check_trace; cat stderr
   103723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   103724 at_status=$? at_failed=false
   103725 $at_check_filter
   103726 at_fn_diff_devnull "$at_stderr" || at_failed=:
   103727 $at_diff expout "$at_stdout" || at_failed=:
   103728 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660"
   103729 $at_failed && at_fn_log_failure
   103730 $at_traceon; }
   103731 
   103732 
   103733 
   103734 
   103735 
   103736   set +x
   103737   $at_times_p && times >"$at_times_file"
   103738 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   103739 read at_status <"$at_status_file"
   103740 #AT_STOP_234
   103741 #AT_START_235
   103742 at_fn_group_banner 235 'calc.at:670' \
   103743   "Calculator %skeleton \"lalr1.cc\" %defines %locations" "" 13
   103744 at_xfail=no
   103745 (
   103746   $as_echo "235. $at_setup_line: testing $at_desc ..."
   103747   $at_traceon
   103748 
   103749 
   103750 
   103751 
   103752 
   103753 
   103754 
   103755 
   103756 
   103757 
   103758 cat >calc.y <<'_ATEOF'
   103759 %code top {
   103760 #include <config.h>
   103761 /* We don't need perfect functions for these tests. */
   103762 #undef malloc
   103763 #undef memcmp
   103764 #undef realloc
   103765 }
   103766 
   103767 /* Infix notation calculator--calc */
   103768 %skeleton "lalr1.cc" %defines %locations
   103769 %define global_tokens_and_yystype
   103770 %code requires
   103771 {
   103772 
   103773   /* Exercise pre-prologue dependency to %union.  */
   103774   typedef int semantic_value;
   103775 }
   103776 
   103777 /* Exercise %union. */
   103778 %union
   103779 {
   103780   semantic_value ival;
   103781 };
   103782 %printer { yyoutput << $$; } <ival>;
   103783 
   103784 %code provides
   103785 {
   103786   #include <stdio.h>
   103787   /* The input.  */
   103788   extern FILE *input;
   103789   extern semantic_value global_result;
   103790   extern int global_count;
   103791 }
   103792 
   103793 %code
   103794 {
   103795 #include <assert.h>
   103796 #include <string.h>
   103797 #define USE(Var)
   103798 
   103799 FILE *input;
   103800 static int power (int base, int exponent);
   103801 
   103802 
   103803 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   103804 }
   103805 
   103806 
   103807 
   103808 /* Bison Declarations */
   103809 %token CALC_EOF 0 "end of input"
   103810 %token <ival> NUM "number"
   103811 %type  <ival> exp
   103812 
   103813 %nonassoc '=' /* comparison            */
   103814 %left '-' '+'
   103815 %left '*' '/'
   103816 %left NEG     /* negation--unary minus */
   103817 %right '^'    /* exponentiation        */
   103818 
   103819 /* Grammar follows */
   103820 %%
   103821 input:
   103822   line
   103823 | input line         {  }
   103824 ;
   103825 
   103826 line:
   103827   '\n'
   103828 | exp '\n'           { USE ($1); }
   103829 ;
   103830 
   103831 exp:
   103832   NUM                { $$ = $1;             }
   103833 | exp '=' exp
   103834   {
   103835     if ($1 != $3)
   103836       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   103837     $$ = $1;
   103838   }
   103839 | exp '+' exp        { $$ = $1 + $3;        }
   103840 | exp '-' exp        { $$ = $1 - $3;        }
   103841 | exp '*' exp        { $$ = $1 * $3;        }
   103842 | exp '/' exp        { $$ = $1 / $3;        }
   103843 | '-' exp  %prec NEG { $$ = -$2;            }
   103844 | exp '^' exp        { $$ = power ($1, $3); }
   103845 | '(' exp ')'        { $$ = $2;             }
   103846 | '(' error ')'      { $$ = 1111; yyerrok;  }
   103847 | '!'                { $$ = 0; YYERROR;     }
   103848 | '-' error          { $$ = 0; YYERROR;     }
   103849 ;
   103850 %%
   103851 
   103852 static int
   103853 power (int base, int exponent)
   103854 {
   103855   int res = 1;
   103856   assert (0 <= exponent);
   103857   for (/* Niente */; exponent; --exponent)
   103858     res *= base;
   103859   return res;
   103860 }
   103861 
   103862 
   103863 /* A C++ error reporting function.  */
   103864 void
   103865 yy::parser::error (const location_type& l, const std::string& m)
   103866 {
   103867   (void) l;
   103868   std::cerr << l << ": " << m << std::endl;
   103869 }
   103870 _ATEOF
   103871 
   103872 
   103873 
   103874 cat >calc-lex.cc <<'_ATEOF'
   103875 #include <config.h>
   103876 /* We don't need perfect functions for these tests. */
   103877 #undef malloc
   103878 #undef memcmp
   103879 #undef realloc
   103880 
   103881 #include "calc.hh"
   103882 
   103883 #include <ctype.h>
   103884 
   103885 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   103886 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   103887 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   103888 
   103889 
   103890 static yy::parser::location_type last_yylloc;
   103891 
   103892 static int
   103893 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   103894 {
   103895   int res = getc (input);
   103896   (void) lvalp;(void) llocp;
   103897 
   103898   last_yylloc = (*llocp);
   103899   if (res == '\n')
   103900     {
   103901       (*llocp).end.line++;
   103902       (*llocp).end.column = 1;
   103903     }
   103904   else
   103905     (*llocp).end.column++;
   103906 
   103907   return res;
   103908 }
   103909 
   103910 static void
   103911 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   103912 {
   103913   (void) lvalp;(void) llocp;
   103914 
   103915   /* Wrong when C == `\n'. */
   103916   (*llocp) = last_yylloc;
   103917 
   103918   ungetc (c, input);
   103919 }
   103920 
   103921 static int
   103922 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   103923 {
   103924   int c = get_char (lvalp, llocp);
   103925   int sign = 1;
   103926   int n = 0;
   103927 
   103928   (void) lvalp;(void) llocp;
   103929   if (c == '-')
   103930     {
   103931       c = get_char (lvalp, llocp);
   103932       sign = -1;
   103933     }
   103934 
   103935   while (isdigit (c))
   103936     {
   103937       n = 10 * n + (c - '0');
   103938       c = get_char (lvalp, llocp);
   103939     }
   103940 
   103941   unget_char (lvalp, llocp,  c);
   103942 
   103943   return sign * n;
   103944 }
   103945 
   103946 
   103947 /*---------------------------------------------------------------.
   103948 | Lexical analyzer returns an integer on the stack and the token |
   103949 | NUM, or the ASCII character read if not a number.  Skips all   |
   103950 | blanks and tabs, returns 0 for EOF.                            |
   103951 `---------------------------------------------------------------*/
   103952 
   103953 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   103954 {
   103955   int c;
   103956   /* Skip current token, then white spaces.  */
   103957   do
   103958     {
   103959      (*llocp).begin.column = (*llocp).end.column;
   103960       (*llocp).begin.line   = (*llocp).end.line;
   103961 
   103962     }
   103963   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   103964 
   103965   /* process numbers   */
   103966   if (c == '.' || isdigit (c))
   103967     {
   103968       unget_char (lvalp, llocp,  c);
   103969       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   103970       return NUM;
   103971     }
   103972 
   103973   /* Return end-of-file.  */
   103974   if (c == EOF)
   103975     return CALC_EOF;
   103976 
   103977   /* Return single chars. */
   103978   return c;
   103979 }
   103980 _ATEOF
   103981 
   103982 
   103983 cat >calc-main.cc <<'_ATEOF'
   103984 #include <config.h>
   103985 /* We don't need perfect functions for these tests. */
   103986 #undef malloc
   103987 #undef memcmp
   103988 #undef realloc
   103989 
   103990 #include "calc.hh"
   103991 
   103992 #include <assert.h>
   103993 #if HAVE_UNISTD_H
   103994 # include <unistd.h>
   103995 #else
   103996 # undef alarm
   103997 # define alarm(seconds) /* empty */
   103998 #endif
   103999 
   104000 
   104001 /* A C++ yyparse that simulates the C signature.  */
   104002 int
   104003 yyparse ()
   104004 {
   104005   yy::parser parser;
   104006 #if YYDEBUG
   104007   parser.set_debug_level (1);
   104008 #endif
   104009   return parser.parse ();
   104010 }
   104011 
   104012 
   104013 semantic_value global_result = 0;
   104014 int global_count = 0;
   104015 
   104016 /* A C main function.  */
   104017 int
   104018 main (int argc, const char **argv)
   104019 {
   104020   semantic_value result = 0;
   104021   int count = 0;
   104022   int status;
   104023 
   104024   /* This used to be alarm (10), but that isn't enough time for
   104025      a July 1995 vintage DEC Alphastation 200 4/100 system,
   104026      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   104027   alarm (100);
   104028 
   104029   if (argc == 2)
   104030     input = fopen (argv[1], "r");
   104031   else
   104032     input = stdin;
   104033 
   104034   if (!input)
   104035     {
   104036       perror (argv[1]);
   104037       return 3;
   104038     }
   104039 
   104040 
   104041   status = yyparse ();
   104042   if (fclose (input))
   104043     perror ("fclose");
   104044   assert (global_result == result);
   104045   assert (global_count == count);
   104046   return status;
   104047 }
   104048 _ATEOF
   104049 
   104050 
   104051 
   104052 
   104053 
   104054 
   104055 
   104056 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   104057   at_save_special_files
   104058   mkdir xml-tests
   104059     # Don't combine these Bison invocations since we want to be sure that
   104060   # --report=all isn't required to get the full XML file.
   104061   { set +x
   104062 $as_echo "$at_srcdir/calc.at:670: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   104063                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   104064 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670"
   104065 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   104066                   --graph=xml-tests/test.dot -o calc.cc calc.y
   104067 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104068 at_status=$? at_failed=false
   104069 $at_check_filter
   104070 echo stderr:; cat "$at_stderr"
   104071 echo stdout:; cat "$at_stdout"
   104072 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104073 $at_failed && at_fn_log_failure
   104074 $at_traceon; }
   104075 
   104076   { set +x
   104077 $as_echo "$at_srcdir/calc.at:670: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   104078 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:670"
   104079 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   104080 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104081 at_status=$? at_failed=false
   104082 $at_check_filter
   104083 echo stderr:; cat "$at_stderr"
   104084 echo stdout:; cat "$at_stdout"
   104085 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104086 $at_failed && at_fn_log_failure
   104087 $at_traceon; }
   104088 
   104089     cp xml-tests/test.output expout
   104090   { set +x
   104091 $as_echo "$at_srcdir/calc.at:670: \$XSLTPROC \\
   104092              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   104093              xml-tests/test.xml"
   104094 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:670"
   104095 ( $at_check_trace; $XSLTPROC \
   104096              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   104097              xml-tests/test.xml
   104098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104099 at_status=$? at_failed=false
   104100 $at_check_filter
   104101 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104102 $at_diff expout "$at_stdout" || at_failed=:
   104103 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104104 $at_failed && at_fn_log_failure
   104105 $at_traceon; }
   104106 
   104107   sort xml-tests/test.dot > expout
   104108   { set +x
   104109 $as_echo "$at_srcdir/calc.at:670: \$XSLTPROC \\
   104110              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   104111              xml-tests/test.xml | sort"
   104112 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:670"
   104113 ( $at_check_trace; $XSLTPROC \
   104114              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   104115              xml-tests/test.xml | sort
   104116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104117 at_status=$? at_failed=false
   104118 $at_check_filter
   104119 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104120 $at_diff expout "$at_stdout" || at_failed=:
   104121 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104122 $at_failed && at_fn_log_failure
   104123 $at_traceon; }
   104124 
   104125   rm -rf xml-tests expout
   104126   at_restore_special_files
   104127 fi
   104128 { set +x
   104129 $as_echo "$at_srcdir/calc.at:670: bison -o calc.cc calc.y"
   104130 at_fn_check_prepare_trace "calc.at:670"
   104131 ( $at_check_trace; bison -o calc.cc calc.y
   104132 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104133 at_status=$? at_failed=false
   104134 $at_check_filter
   104135 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104136 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104137 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104138 $at_failed && at_fn_log_failure
   104139 $at_traceon; }
   104140 
   104141 
   104142 
   104143 { set +x
   104144 $as_echo "$at_srcdir/calc.at:670: \$BISON_CXX_WORKS"
   104145 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:670"
   104146 ( $at_check_trace; $BISON_CXX_WORKS
   104147 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104148 at_status=$? at_failed=false
   104149 $at_check_filter
   104150 echo stderr:; cat "$at_stderr"
   104151 echo stdout:; cat "$at_stdout"
   104152 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104153 $at_failed && at_fn_log_failure
   104154 $at_traceon; }
   104155 
   104156 { set +x
   104157 $as_echo "$at_srcdir/calc.at:670: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   104158 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:670"
   104159 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   104160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104161 at_status=$? at_failed=false
   104162 $at_check_filter
   104163 echo stderr:; cat "$at_stderr"
   104164 echo stdout:; cat "$at_stdout"
   104165 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104166 $at_failed && at_fn_log_failure
   104167 $at_traceon; }
   104168 
   104169 
   104170 { set +x
   104171 $as_echo "$at_srcdir/calc.at:670: \$PERL -ne '
   104172   chomp;
   104173   print \"\$.: {\$_}\\n\"
   104174     if (# No starting/ending empty lines.
   104175         (eof || \$. == 1) && /^\\s*\$/
   104176         # No trailing space.  FIXME: not ready for \"maint\".
   104177         # || /\\s\$/
   104178         )' calc.cc
   104179 "
   104180 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670"
   104181 ( $at_check_trace; $PERL -ne '
   104182   chomp;
   104183   print "$.: {$_}\n"
   104184     if (# No starting/ending empty lines.
   104185         (eof || $. == 1) && /^\s*$/
   104186         # No trailing space.  FIXME: not ready for "maint".
   104187         # || /\s$/
   104188         )' calc.cc
   104189 
   104190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104191 at_status=$? at_failed=false
   104192 $at_check_filter
   104193 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104194 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104195 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104196 $at_failed && at_fn_log_failure
   104197 $at_traceon; }
   104198 
   104199 { set +x
   104200 $as_echo "$at_srcdir/calc.at:670: \$PERL -ne '
   104201   chomp;
   104202   print \"\$.: {\$_}\\n\"
   104203     if (# No starting/ending empty lines.
   104204         (eof || \$. == 1) && /^\\s*\$/
   104205         # No trailing space.  FIXME: not ready for \"maint\".
   104206         # || /\\s\$/
   104207         )' calc.hh
   104208 "
   104209 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670"
   104210 ( $at_check_trace; $PERL -ne '
   104211   chomp;
   104212   print "$.: {$_}\n"
   104213     if (# No starting/ending empty lines.
   104214         (eof || $. == 1) && /^\s*$/
   104215         # No trailing space.  FIXME: not ready for "maint".
   104216         # || /\s$/
   104217         )' calc.hh
   104218 
   104219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104220 at_status=$? at_failed=false
   104221 $at_check_filter
   104222 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104223 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104224 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104225 $at_failed && at_fn_log_failure
   104226 $at_traceon; }
   104227 
   104228 
   104229 # Test the priorities.
   104230 cat >input <<'_ATEOF'
   104231 1 + 2 * 3 = 7
   104232 1 + 2 * -3 = -5
   104233 
   104234 -1^2 = -1
   104235 (-1)^2 = 1
   104236 
   104237 ---1 = -1
   104238 
   104239 1 - 2 - 3 = -4
   104240 1 - (2 - 3) = 2
   104241 
   104242 2^2^3 = 256
   104243 (2^2)^3 = 64
   104244 _ATEOF
   104245 
   104246 { set +x
   104247 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104248 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104249 ( $at_check_trace;  $PREPARSER ./calc input
   104250 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104251 at_status=$? at_failed=false
   104252 $at_check_filter
   104253 echo stderr:; tee stderr <"$at_stderr"
   104254 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104255 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104256 $at_failed && at_fn_log_failure
   104257 $at_traceon; }
   104258 
   104259 { set +x
   104260 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104261 at_fn_check_prepare_trace "calc.at:670"
   104262 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104263 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104264 at_status=$? at_failed=false
   104265 $at_check_filter
   104266 echo stderr:; tee stderr <"$at_stderr"
   104267 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104268 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104269 $at_failed && at_fn_log_failure
   104270 $at_traceon; }
   104271 
   104272 
   104273 
   104274 
   104275 # Some syntax errors.
   104276 cat >input <<'_ATEOF'
   104277 1 2
   104278 _ATEOF
   104279 
   104280 { set +x
   104281 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104282 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104283 ( $at_check_trace;  $PREPARSER ./calc input
   104284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104285 at_status=$? at_failed=false
   104286 $at_check_filter
   104287 echo stderr:; tee stderr <"$at_stderr"
   104288 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104289 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670"
   104290 $at_failed && at_fn_log_failure
   104291 $at_traceon; }
   104292 
   104293 { set +x
   104294 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104295 at_fn_check_prepare_trace "calc.at:670"
   104296 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104298 at_status=$? at_failed=false
   104299 $at_check_filter
   104300 echo stderr:; tee stderr <"$at_stderr"
   104301 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104302 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104303 $at_failed && at_fn_log_failure
   104304 $at_traceon; }
   104305 
   104306 
   104307 
   104308 # Normalize the observed and expected error messages, depending upon the
   104309 # options.
   104310 # 1. Remove the traces from observed.
   104311 sed '/^Starting/d
   104312 /^Entering/d
   104313 /^Stack/d
   104314 /^Reading/d
   104315 /^Reducing/d
   104316 /^Return/d
   104317 /^Shifting/d
   104318 /^state/d
   104319 /^Cleanup:/d
   104320 /^Error:/d
   104321 /^Next/d
   104322 /^Now/d
   104323 /^Discarding/d
   104324 / \$[0-9$]* = /d
   104325 /^yydestructor:/d' stderr >at-stderr
   104326 mv at-stderr stderr
   104327 # 2. Create the reference error message.
   104328 cat >expout <<'_ATEOF'
   104329 1.3: syntax error, unexpected number
   104330 _ATEOF
   104331 
   104332 # 3. If locations are not used, remove them.
   104333 
   104334 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104335 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104336 mv at-expout expout
   104337 # 5. Check
   104338 { set +x
   104339 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104340 at_fn_check_prepare_trace "calc.at:670"
   104341 ( $at_check_trace; cat stderr
   104342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104343 at_status=$? at_failed=false
   104344 $at_check_filter
   104345 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104346 $at_diff expout "$at_stdout" || at_failed=:
   104347 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104348 $at_failed && at_fn_log_failure
   104349 $at_traceon; }
   104350 
   104351 
   104352 cat >input <<'_ATEOF'
   104353 1//2
   104354 _ATEOF
   104355 
   104356 { set +x
   104357 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104358 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104359 ( $at_check_trace;  $PREPARSER ./calc input
   104360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104361 at_status=$? at_failed=false
   104362 $at_check_filter
   104363 echo stderr:; tee stderr <"$at_stderr"
   104364 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104365 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670"
   104366 $at_failed && at_fn_log_failure
   104367 $at_traceon; }
   104368 
   104369 { set +x
   104370 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104371 at_fn_check_prepare_trace "calc.at:670"
   104372 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104374 at_status=$? at_failed=false
   104375 $at_check_filter
   104376 echo stderr:; tee stderr <"$at_stderr"
   104377 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104378 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104379 $at_failed && at_fn_log_failure
   104380 $at_traceon; }
   104381 
   104382 
   104383 
   104384 # Normalize the observed and expected error messages, depending upon the
   104385 # options.
   104386 # 1. Remove the traces from observed.
   104387 sed '/^Starting/d
   104388 /^Entering/d
   104389 /^Stack/d
   104390 /^Reading/d
   104391 /^Reducing/d
   104392 /^Return/d
   104393 /^Shifting/d
   104394 /^state/d
   104395 /^Cleanup:/d
   104396 /^Error:/d
   104397 /^Next/d
   104398 /^Now/d
   104399 /^Discarding/d
   104400 / \$[0-9$]* = /d
   104401 /^yydestructor:/d' stderr >at-stderr
   104402 mv at-stderr stderr
   104403 # 2. Create the reference error message.
   104404 cat >expout <<'_ATEOF'
   104405 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   104406 _ATEOF
   104407 
   104408 # 3. If locations are not used, remove them.
   104409 
   104410 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104411 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104412 mv at-expout expout
   104413 # 5. Check
   104414 { set +x
   104415 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104416 at_fn_check_prepare_trace "calc.at:670"
   104417 ( $at_check_trace; cat stderr
   104418 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104419 at_status=$? at_failed=false
   104420 $at_check_filter
   104421 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104422 $at_diff expout "$at_stdout" || at_failed=:
   104423 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104424 $at_failed && at_fn_log_failure
   104425 $at_traceon; }
   104426 
   104427 
   104428 cat >input <<'_ATEOF'
   104429 error
   104430 _ATEOF
   104431 
   104432 { set +x
   104433 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104434 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104435 ( $at_check_trace;  $PREPARSER ./calc input
   104436 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104437 at_status=$? at_failed=false
   104438 $at_check_filter
   104439 echo stderr:; tee stderr <"$at_stderr"
   104440 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104441 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670"
   104442 $at_failed && at_fn_log_failure
   104443 $at_traceon; }
   104444 
   104445 { set +x
   104446 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104447 at_fn_check_prepare_trace "calc.at:670"
   104448 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104450 at_status=$? at_failed=false
   104451 $at_check_filter
   104452 echo stderr:; tee stderr <"$at_stderr"
   104453 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104454 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104455 $at_failed && at_fn_log_failure
   104456 $at_traceon; }
   104457 
   104458 
   104459 
   104460 # Normalize the observed and expected error messages, depending upon the
   104461 # options.
   104462 # 1. Remove the traces from observed.
   104463 sed '/^Starting/d
   104464 /^Entering/d
   104465 /^Stack/d
   104466 /^Reading/d
   104467 /^Reducing/d
   104468 /^Return/d
   104469 /^Shifting/d
   104470 /^state/d
   104471 /^Cleanup:/d
   104472 /^Error:/d
   104473 /^Next/d
   104474 /^Now/d
   104475 /^Discarding/d
   104476 / \$[0-9$]* = /d
   104477 /^yydestructor:/d' stderr >at-stderr
   104478 mv at-stderr stderr
   104479 # 2. Create the reference error message.
   104480 cat >expout <<'_ATEOF'
   104481 1.1: syntax error, unexpected $undefined
   104482 _ATEOF
   104483 
   104484 # 3. If locations are not used, remove them.
   104485 
   104486 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104487 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104488 mv at-expout expout
   104489 # 5. Check
   104490 { set +x
   104491 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104492 at_fn_check_prepare_trace "calc.at:670"
   104493 ( $at_check_trace; cat stderr
   104494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104495 at_status=$? at_failed=false
   104496 $at_check_filter
   104497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104498 $at_diff expout "$at_stdout" || at_failed=:
   104499 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104500 $at_failed && at_fn_log_failure
   104501 $at_traceon; }
   104502 
   104503 
   104504 cat >input <<'_ATEOF'
   104505 1 = 2 = 3
   104506 _ATEOF
   104507 
   104508 { set +x
   104509 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104510 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104511 ( $at_check_trace;  $PREPARSER ./calc input
   104512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104513 at_status=$? at_failed=false
   104514 $at_check_filter
   104515 echo stderr:; tee stderr <"$at_stderr"
   104516 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104517 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670"
   104518 $at_failed && at_fn_log_failure
   104519 $at_traceon; }
   104520 
   104521 { set +x
   104522 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104523 at_fn_check_prepare_trace "calc.at:670"
   104524 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104525 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104526 at_status=$? at_failed=false
   104527 $at_check_filter
   104528 echo stderr:; tee stderr <"$at_stderr"
   104529 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104530 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104531 $at_failed && at_fn_log_failure
   104532 $at_traceon; }
   104533 
   104534 
   104535 
   104536 # Normalize the observed and expected error messages, depending upon the
   104537 # options.
   104538 # 1. Remove the traces from observed.
   104539 sed '/^Starting/d
   104540 /^Entering/d
   104541 /^Stack/d
   104542 /^Reading/d
   104543 /^Reducing/d
   104544 /^Return/d
   104545 /^Shifting/d
   104546 /^state/d
   104547 /^Cleanup:/d
   104548 /^Error:/d
   104549 /^Next/d
   104550 /^Now/d
   104551 /^Discarding/d
   104552 / \$[0-9$]* = /d
   104553 /^yydestructor:/d' stderr >at-stderr
   104554 mv at-stderr stderr
   104555 # 2. Create the reference error message.
   104556 cat >expout <<'_ATEOF'
   104557 1.7: syntax error, unexpected '='
   104558 _ATEOF
   104559 
   104560 # 3. If locations are not used, remove them.
   104561 
   104562 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104563 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104564 mv at-expout expout
   104565 # 5. Check
   104566 { set +x
   104567 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104568 at_fn_check_prepare_trace "calc.at:670"
   104569 ( $at_check_trace; cat stderr
   104570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104571 at_status=$? at_failed=false
   104572 $at_check_filter
   104573 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104574 $at_diff expout "$at_stdout" || at_failed=:
   104575 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104576 $at_failed && at_fn_log_failure
   104577 $at_traceon; }
   104578 
   104579 
   104580 cat >input <<'_ATEOF'
   104581 
   104582 +1
   104583 _ATEOF
   104584 
   104585 { set +x
   104586 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104587 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104588 ( $at_check_trace;  $PREPARSER ./calc input
   104589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104590 at_status=$? at_failed=false
   104591 $at_check_filter
   104592 echo stderr:; tee stderr <"$at_stderr"
   104593 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104594 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670"
   104595 $at_failed && at_fn_log_failure
   104596 $at_traceon; }
   104597 
   104598 { set +x
   104599 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104600 at_fn_check_prepare_trace "calc.at:670"
   104601 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104603 at_status=$? at_failed=false
   104604 $at_check_filter
   104605 echo stderr:; tee stderr <"$at_stderr"
   104606 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104607 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104608 $at_failed && at_fn_log_failure
   104609 $at_traceon; }
   104610 
   104611 
   104612 
   104613 # Normalize the observed and expected error messages, depending upon the
   104614 # options.
   104615 # 1. Remove the traces from observed.
   104616 sed '/^Starting/d
   104617 /^Entering/d
   104618 /^Stack/d
   104619 /^Reading/d
   104620 /^Reducing/d
   104621 /^Return/d
   104622 /^Shifting/d
   104623 /^state/d
   104624 /^Cleanup:/d
   104625 /^Error:/d
   104626 /^Next/d
   104627 /^Now/d
   104628 /^Discarding/d
   104629 / \$[0-9$]* = /d
   104630 /^yydestructor:/d' stderr >at-stderr
   104631 mv at-stderr stderr
   104632 # 2. Create the reference error message.
   104633 cat >expout <<'_ATEOF'
   104634 2.1: syntax error, unexpected '+'
   104635 _ATEOF
   104636 
   104637 # 3. If locations are not used, remove them.
   104638 
   104639 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104640 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104641 mv at-expout expout
   104642 # 5. Check
   104643 { set +x
   104644 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104645 at_fn_check_prepare_trace "calc.at:670"
   104646 ( $at_check_trace; cat stderr
   104647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104648 at_status=$? at_failed=false
   104649 $at_check_filter
   104650 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104651 $at_diff expout "$at_stdout" || at_failed=:
   104652 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104653 $at_failed && at_fn_log_failure
   104654 $at_traceon; }
   104655 
   104656 
   104657 # Exercise error messages with EOF: work on an empty file.
   104658 { set +x
   104659 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc /dev/null"
   104660 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:670"
   104661 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   104662 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104663 at_status=$? at_failed=false
   104664 $at_check_filter
   104665 echo stderr:; tee stderr <"$at_stderr"
   104666 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104667 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670"
   104668 $at_failed && at_fn_log_failure
   104669 $at_traceon; }
   104670 
   104671 { set +x
   104672 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104673 at_fn_check_prepare_trace "calc.at:670"
   104674 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104676 at_status=$? at_failed=false
   104677 $at_check_filter
   104678 echo stderr:; tee stderr <"$at_stderr"
   104679 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104680 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104681 $at_failed && at_fn_log_failure
   104682 $at_traceon; }
   104683 
   104684 
   104685 
   104686 # Normalize the observed and expected error messages, depending upon the
   104687 # options.
   104688 # 1. Remove the traces from observed.
   104689 sed '/^Starting/d
   104690 /^Entering/d
   104691 /^Stack/d
   104692 /^Reading/d
   104693 /^Reducing/d
   104694 /^Return/d
   104695 /^Shifting/d
   104696 /^state/d
   104697 /^Cleanup:/d
   104698 /^Error:/d
   104699 /^Next/d
   104700 /^Now/d
   104701 /^Discarding/d
   104702 / \$[0-9$]* = /d
   104703 /^yydestructor:/d' stderr >at-stderr
   104704 mv at-stderr stderr
   104705 # 2. Create the reference error message.
   104706 cat >expout <<'_ATEOF'
   104707 1.1: syntax error, unexpected end of input
   104708 _ATEOF
   104709 
   104710 # 3. If locations are not used, remove them.
   104711 
   104712 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104713 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104714 mv at-expout expout
   104715 # 5. Check
   104716 { set +x
   104717 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104718 at_fn_check_prepare_trace "calc.at:670"
   104719 ( $at_check_trace; cat stderr
   104720 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104721 at_status=$? at_failed=false
   104722 $at_check_filter
   104723 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104724 $at_diff expout "$at_stdout" || at_failed=:
   104725 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104726 $at_failed && at_fn_log_failure
   104727 $at_traceon; }
   104728 
   104729 
   104730 
   104731 # Exercise the error token: without it, we die at the first error,
   104732 # hence be sure to
   104733 #
   104734 # - have several errors which exercise different shift/discardings
   104735 #   - (): nothing to pop, nothing to discard
   104736 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   104737 #   - (* * *): nothing to pop, a lot to discard
   104738 #   - (1 + 2 * *): some to pop and discard
   104739 #
   104740 # - test the action associated to `error'
   104741 #
   104742 # - check the lookahead that triggers an error is not discarded
   104743 #   when we enter error recovery.  Below, the lookahead causing the
   104744 #   first error is ")", which is needed to recover from the error and
   104745 #   produce the "0" that triggers the "0 != 1" error.
   104746 #
   104747 cat >input <<'_ATEOF'
   104748 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   104749 _ATEOF
   104750 
   104751 { set +x
   104752 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104753 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104754 ( $at_check_trace;  $PREPARSER ./calc input
   104755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104756 at_status=$? at_failed=false
   104757 $at_check_filter
   104758 echo stderr:; tee stderr <"$at_stderr"
   104759 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104760 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104761 $at_failed && at_fn_log_failure
   104762 $at_traceon; }
   104763 
   104764 { set +x
   104765 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104766 at_fn_check_prepare_trace "calc.at:670"
   104767 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104769 at_status=$? at_failed=false
   104770 $at_check_filter
   104771 echo stderr:; tee stderr <"$at_stderr"
   104772 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104773 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104774 $at_failed && at_fn_log_failure
   104775 $at_traceon; }
   104776 
   104777 
   104778 
   104779 # Normalize the observed and expected error messages, depending upon the
   104780 # options.
   104781 # 1. Remove the traces from observed.
   104782 sed '/^Starting/d
   104783 /^Entering/d
   104784 /^Stack/d
   104785 /^Reading/d
   104786 /^Reducing/d
   104787 /^Return/d
   104788 /^Shifting/d
   104789 /^state/d
   104790 /^Cleanup:/d
   104791 /^Error:/d
   104792 /^Next/d
   104793 /^Now/d
   104794 /^Discarding/d
   104795 / \$[0-9$]* = /d
   104796 /^yydestructor:/d' stderr >at-stderr
   104797 mv at-stderr stderr
   104798 # 2. Create the reference error message.
   104799 cat >expout <<'_ATEOF'
   104800 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   104801 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   104802 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   104803 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   104804 calc: error: 4444 != 1
   104805 _ATEOF
   104806 
   104807 # 3. If locations are not used, remove them.
   104808 
   104809 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104810 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104811 mv at-expout expout
   104812 # 5. Check
   104813 { set +x
   104814 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104815 at_fn_check_prepare_trace "calc.at:670"
   104816 ( $at_check_trace; cat stderr
   104817 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104818 at_status=$? at_failed=false
   104819 $at_check_filter
   104820 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104821 $at_diff expout "$at_stdout" || at_failed=:
   104822 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104823 $at_failed && at_fn_log_failure
   104824 $at_traceon; }
   104825 
   104826 
   104827 
   104828 # The same, but this time exercising explicitly triggered syntax errors.
   104829 # POSIX says the lookahead causing the error should not be discarded.
   104830 cat >input <<'_ATEOF'
   104831 (!) + (1 2) = 1
   104832 _ATEOF
   104833 
   104834 { set +x
   104835 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104836 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104837 ( $at_check_trace;  $PREPARSER ./calc input
   104838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104839 at_status=$? at_failed=false
   104840 $at_check_filter
   104841 echo stderr:; tee stderr <"$at_stderr"
   104842 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104843 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104844 $at_failed && at_fn_log_failure
   104845 $at_traceon; }
   104846 
   104847 { set +x
   104848 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104849 at_fn_check_prepare_trace "calc.at:670"
   104850 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104852 at_status=$? at_failed=false
   104853 $at_check_filter
   104854 echo stderr:; tee stderr <"$at_stderr"
   104855 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104856 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104857 $at_failed && at_fn_log_failure
   104858 $at_traceon; }
   104859 
   104860 
   104861 
   104862 # Normalize the observed and expected error messages, depending upon the
   104863 # options.
   104864 # 1. Remove the traces from observed.
   104865 sed '/^Starting/d
   104866 /^Entering/d
   104867 /^Stack/d
   104868 /^Reading/d
   104869 /^Reducing/d
   104870 /^Return/d
   104871 /^Shifting/d
   104872 /^state/d
   104873 /^Cleanup:/d
   104874 /^Error:/d
   104875 /^Next/d
   104876 /^Now/d
   104877 /^Discarding/d
   104878 / \$[0-9$]* = /d
   104879 /^yydestructor:/d' stderr >at-stderr
   104880 mv at-stderr stderr
   104881 # 2. Create the reference error message.
   104882 cat >expout <<'_ATEOF'
   104883 1.10: syntax error, unexpected number
   104884 calc: error: 2222 != 1
   104885 _ATEOF
   104886 
   104887 # 3. If locations are not used, remove them.
   104888 
   104889 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104890 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104891 mv at-expout expout
   104892 # 5. Check
   104893 { set +x
   104894 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104895 at_fn_check_prepare_trace "calc.at:670"
   104896 ( $at_check_trace; cat stderr
   104897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104898 at_status=$? at_failed=false
   104899 $at_check_filter
   104900 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104901 $at_diff expout "$at_stdout" || at_failed=:
   104902 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104903 $at_failed && at_fn_log_failure
   104904 $at_traceon; }
   104905 
   104906 
   104907 cat >input <<'_ATEOF'
   104908 (- *) + (1 2) = 1
   104909 _ATEOF
   104910 
   104911 { set +x
   104912 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104913 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104914 ( $at_check_trace;  $PREPARSER ./calc input
   104915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104916 at_status=$? at_failed=false
   104917 $at_check_filter
   104918 echo stderr:; tee stderr <"$at_stderr"
   104919 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104920 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104921 $at_failed && at_fn_log_failure
   104922 $at_traceon; }
   104923 
   104924 { set +x
   104925 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   104926 at_fn_check_prepare_trace "calc.at:670"
   104927 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   104928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104929 at_status=$? at_failed=false
   104930 $at_check_filter
   104931 echo stderr:; tee stderr <"$at_stderr"
   104932 at_fn_diff_devnull "$at_stdout" || at_failed=:
   104933 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104934 $at_failed && at_fn_log_failure
   104935 $at_traceon; }
   104936 
   104937 
   104938 
   104939 # Normalize the observed and expected error messages, depending upon the
   104940 # options.
   104941 # 1. Remove the traces from observed.
   104942 sed '/^Starting/d
   104943 /^Entering/d
   104944 /^Stack/d
   104945 /^Reading/d
   104946 /^Reducing/d
   104947 /^Return/d
   104948 /^Shifting/d
   104949 /^state/d
   104950 /^Cleanup:/d
   104951 /^Error:/d
   104952 /^Next/d
   104953 /^Now/d
   104954 /^Discarding/d
   104955 / \$[0-9$]* = /d
   104956 /^yydestructor:/d' stderr >at-stderr
   104957 mv at-stderr stderr
   104958 # 2. Create the reference error message.
   104959 cat >expout <<'_ATEOF'
   104960 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   104961 1.12: syntax error, unexpected number
   104962 calc: error: 2222 != 1
   104963 _ATEOF
   104964 
   104965 # 3. If locations are not used, remove them.
   104966 
   104967 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   104968 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   104969 mv at-expout expout
   104970 # 5. Check
   104971 { set +x
   104972 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   104973 at_fn_check_prepare_trace "calc.at:670"
   104974 ( $at_check_trace; cat stderr
   104975 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104976 at_status=$? at_failed=false
   104977 $at_check_filter
   104978 at_fn_diff_devnull "$at_stderr" || at_failed=:
   104979 $at_diff expout "$at_stdout" || at_failed=:
   104980 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   104981 $at_failed && at_fn_log_failure
   104982 $at_traceon; }
   104983 
   104984 
   104985 
   104986 # Check that yyerrok works properly: second error is not reported,
   104987 # third and fourth are.  Parse status is succesfull.
   104988 cat >input <<'_ATEOF'
   104989 (* *) + (*) + (*)
   104990 _ATEOF
   104991 
   104992 { set +x
   104993 $as_echo "$at_srcdir/calc.at:670:  \$PREPARSER ./calc input"
   104994 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670"
   104995 ( $at_check_trace;  $PREPARSER ./calc input
   104996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   104997 at_status=$? at_failed=false
   104998 $at_check_filter
   104999 echo stderr:; tee stderr <"$at_stderr"
   105000 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105001 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   105002 $at_failed && at_fn_log_failure
   105003 $at_traceon; }
   105004 
   105005 { set +x
   105006 $as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105007 at_fn_check_prepare_trace "calc.at:670"
   105008 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105010 at_status=$? at_failed=false
   105011 $at_check_filter
   105012 echo stderr:; tee stderr <"$at_stderr"
   105013 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105014 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   105015 $at_failed && at_fn_log_failure
   105016 $at_traceon; }
   105017 
   105018 
   105019 
   105020 # Normalize the observed and expected error messages, depending upon the
   105021 # options.
   105022 # 1. Remove the traces from observed.
   105023 sed '/^Starting/d
   105024 /^Entering/d
   105025 /^Stack/d
   105026 /^Reading/d
   105027 /^Reducing/d
   105028 /^Return/d
   105029 /^Shifting/d
   105030 /^state/d
   105031 /^Cleanup:/d
   105032 /^Error:/d
   105033 /^Next/d
   105034 /^Now/d
   105035 /^Discarding/d
   105036 / \$[0-9$]* = /d
   105037 /^yydestructor:/d' stderr >at-stderr
   105038 mv at-stderr stderr
   105039 # 2. Create the reference error message.
   105040 cat >expout <<'_ATEOF'
   105041 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   105042 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   105043 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   105044 _ATEOF
   105045 
   105046 # 3. If locations are not used, remove them.
   105047 
   105048 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   105049 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   105050 mv at-expout expout
   105051 # 5. Check
   105052 { set +x
   105053 $as_echo "$at_srcdir/calc.at:670: cat stderr"
   105054 at_fn_check_prepare_trace "calc.at:670"
   105055 ( $at_check_trace; cat stderr
   105056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105057 at_status=$? at_failed=false
   105058 $at_check_filter
   105059 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105060 $at_diff expout "$at_stdout" || at_failed=:
   105061 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670"
   105062 $at_failed && at_fn_log_failure
   105063 $at_traceon; }
   105064 
   105065 
   105066 
   105067 
   105068 
   105069   set +x
   105070   $at_times_p && times >"$at_times_file"
   105071 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   105072 read at_status <"$at_status_file"
   105073 #AT_STOP_235
   105074 #AT_START_236
   105075 at_fn_group_banner 236 'calc.at:679' \
   105076   "Calculator %language \"C++\" %defines %locations " "" 13
   105077 at_xfail=no
   105078 (
   105079   $as_echo "236. $at_setup_line: testing $at_desc ..."
   105080   $at_traceon
   105081 
   105082 
   105083 
   105084 
   105085 
   105086 
   105087 
   105088 
   105089 
   105090 
   105091 cat >calc.y <<'_ATEOF'
   105092 %code top {
   105093 #include <config.h>
   105094 /* We don't need perfect functions for these tests. */
   105095 #undef malloc
   105096 #undef memcmp
   105097 #undef realloc
   105098 }
   105099 
   105100 /* Infix notation calculator--calc */
   105101 %language "C++" %defines %locations
   105102 %define global_tokens_and_yystype
   105103 %code requires
   105104 {
   105105 
   105106   /* Exercise pre-prologue dependency to %union.  */
   105107   typedef int semantic_value;
   105108 }
   105109 
   105110 /* Exercise %union. */
   105111 %union
   105112 {
   105113   semantic_value ival;
   105114 };
   105115 %printer { yyoutput << $$; } <ival>;
   105116 
   105117 %code provides
   105118 {
   105119   #include <stdio.h>
   105120   /* The input.  */
   105121   extern FILE *input;
   105122   extern semantic_value global_result;
   105123   extern int global_count;
   105124 }
   105125 
   105126 %code
   105127 {
   105128 #include <assert.h>
   105129 #include <string.h>
   105130 #define USE(Var)
   105131 
   105132 FILE *input;
   105133 static int power (int base, int exponent);
   105134 
   105135 
   105136 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   105137 }
   105138 
   105139 
   105140 
   105141 /* Bison Declarations */
   105142 %token CALC_EOF 0 "end of input"
   105143 %token <ival> NUM "number"
   105144 %type  <ival> exp
   105145 
   105146 %nonassoc '=' /* comparison            */
   105147 %left '-' '+'
   105148 %left '*' '/'
   105149 %left NEG     /* negation--unary minus */
   105150 %right '^'    /* exponentiation        */
   105151 
   105152 /* Grammar follows */
   105153 %%
   105154 input:
   105155   line
   105156 | input line         {  }
   105157 ;
   105158 
   105159 line:
   105160   '\n'
   105161 | exp '\n'           { USE ($1); }
   105162 ;
   105163 
   105164 exp:
   105165   NUM                { $$ = $1;             }
   105166 | exp '=' exp
   105167   {
   105168     if ($1 != $3)
   105169       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   105170     $$ = $1;
   105171   }
   105172 | exp '+' exp        { $$ = $1 + $3;        }
   105173 | exp '-' exp        { $$ = $1 - $3;        }
   105174 | exp '*' exp        { $$ = $1 * $3;        }
   105175 | exp '/' exp        { $$ = $1 / $3;        }
   105176 | '-' exp  %prec NEG { $$ = -$2;            }
   105177 | exp '^' exp        { $$ = power ($1, $3); }
   105178 | '(' exp ')'        { $$ = $2;             }
   105179 | '(' error ')'      { $$ = 1111; yyerrok;  }
   105180 | '!'                { $$ = 0; YYERROR;     }
   105181 | '-' error          { $$ = 0; YYERROR;     }
   105182 ;
   105183 %%
   105184 
   105185 static int
   105186 power (int base, int exponent)
   105187 {
   105188   int res = 1;
   105189   assert (0 <= exponent);
   105190   for (/* Niente */; exponent; --exponent)
   105191     res *= base;
   105192   return res;
   105193 }
   105194 
   105195 
   105196 /* A C++ error reporting function.  */
   105197 void
   105198 yy::parser::error (const location_type& l, const std::string& m)
   105199 {
   105200   (void) l;
   105201   std::cerr << l << ": " << m << std::endl;
   105202 }
   105203 _ATEOF
   105204 
   105205 
   105206 
   105207 cat >calc-lex.cc <<'_ATEOF'
   105208 #include <config.h>
   105209 /* We don't need perfect functions for these tests. */
   105210 #undef malloc
   105211 #undef memcmp
   105212 #undef realloc
   105213 
   105214 #include "calc.hh"
   105215 
   105216 #include <ctype.h>
   105217 
   105218 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   105219 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   105220 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   105221 
   105222 
   105223 static yy::parser::location_type last_yylloc;
   105224 
   105225 static int
   105226 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   105227 {
   105228   int res = getc (input);
   105229   (void) lvalp;(void) llocp;
   105230 
   105231   last_yylloc = (*llocp);
   105232   if (res == '\n')
   105233     {
   105234       (*llocp).end.line++;
   105235       (*llocp).end.column = 1;
   105236     }
   105237   else
   105238     (*llocp).end.column++;
   105239 
   105240   return res;
   105241 }
   105242 
   105243 static void
   105244 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   105245 {
   105246   (void) lvalp;(void) llocp;
   105247 
   105248   /* Wrong when C == `\n'. */
   105249   (*llocp) = last_yylloc;
   105250 
   105251   ungetc (c, input);
   105252 }
   105253 
   105254 static int
   105255 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   105256 {
   105257   int c = get_char (lvalp, llocp);
   105258   int sign = 1;
   105259   int n = 0;
   105260 
   105261   (void) lvalp;(void) llocp;
   105262   if (c == '-')
   105263     {
   105264       c = get_char (lvalp, llocp);
   105265       sign = -1;
   105266     }
   105267 
   105268   while (isdigit (c))
   105269     {
   105270       n = 10 * n + (c - '0');
   105271       c = get_char (lvalp, llocp);
   105272     }
   105273 
   105274   unget_char (lvalp, llocp,  c);
   105275 
   105276   return sign * n;
   105277 }
   105278 
   105279 
   105280 /*---------------------------------------------------------------.
   105281 | Lexical analyzer returns an integer on the stack and the token |
   105282 | NUM, or the ASCII character read if not a number.  Skips all   |
   105283 | blanks and tabs, returns 0 for EOF.                            |
   105284 `---------------------------------------------------------------*/
   105285 
   105286 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   105287 {
   105288   int c;
   105289   /* Skip current token, then white spaces.  */
   105290   do
   105291     {
   105292      (*llocp).begin.column = (*llocp).end.column;
   105293       (*llocp).begin.line   = (*llocp).end.line;
   105294 
   105295     }
   105296   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   105297 
   105298   /* process numbers   */
   105299   if (c == '.' || isdigit (c))
   105300     {
   105301       unget_char (lvalp, llocp,  c);
   105302       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   105303       return NUM;
   105304     }
   105305 
   105306   /* Return end-of-file.  */
   105307   if (c == EOF)
   105308     return CALC_EOF;
   105309 
   105310   /* Return single chars. */
   105311   return c;
   105312 }
   105313 _ATEOF
   105314 
   105315 
   105316 cat >calc-main.cc <<'_ATEOF'
   105317 #include <config.h>
   105318 /* We don't need perfect functions for these tests. */
   105319 #undef malloc
   105320 #undef memcmp
   105321 #undef realloc
   105322 
   105323 #include "calc.hh"
   105324 
   105325 #include <assert.h>
   105326 #if HAVE_UNISTD_H
   105327 # include <unistd.h>
   105328 #else
   105329 # undef alarm
   105330 # define alarm(seconds) /* empty */
   105331 #endif
   105332 
   105333 
   105334 /* A C++ yyparse that simulates the C signature.  */
   105335 int
   105336 yyparse ()
   105337 {
   105338   yy::parser parser;
   105339 #if YYDEBUG
   105340   parser.set_debug_level (1);
   105341 #endif
   105342   return parser.parse ();
   105343 }
   105344 
   105345 
   105346 semantic_value global_result = 0;
   105347 int global_count = 0;
   105348 
   105349 /* A C main function.  */
   105350 int
   105351 main (int argc, const char **argv)
   105352 {
   105353   semantic_value result = 0;
   105354   int count = 0;
   105355   int status;
   105356 
   105357   /* This used to be alarm (10), but that isn't enough time for
   105358      a July 1995 vintage DEC Alphastation 200 4/100 system,
   105359      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   105360   alarm (100);
   105361 
   105362   if (argc == 2)
   105363     input = fopen (argv[1], "r");
   105364   else
   105365     input = stdin;
   105366 
   105367   if (!input)
   105368     {
   105369       perror (argv[1]);
   105370       return 3;
   105371     }
   105372 
   105373 
   105374   status = yyparse ();
   105375   if (fclose (input))
   105376     perror ("fclose");
   105377   assert (global_result == result);
   105378   assert (global_count == count);
   105379   return status;
   105380 }
   105381 _ATEOF
   105382 
   105383 
   105384 
   105385 
   105386 
   105387 
   105388 
   105389 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   105390   at_save_special_files
   105391   mkdir xml-tests
   105392     # Don't combine these Bison invocations since we want to be sure that
   105393   # --report=all isn't required to get the full XML file.
   105394   { set +x
   105395 $as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   105396                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   105397 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679"
   105398 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   105399                   --graph=xml-tests/test.dot -o calc.cc calc.y
   105400 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105401 at_status=$? at_failed=false
   105402 $at_check_filter
   105403 echo stderr:; cat "$at_stderr"
   105404 echo stdout:; cat "$at_stdout"
   105405 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105406 $at_failed && at_fn_log_failure
   105407 $at_traceon; }
   105408 
   105409   { set +x
   105410 $as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   105411 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:679"
   105412 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   105413 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105414 at_status=$? at_failed=false
   105415 $at_check_filter
   105416 echo stderr:; cat "$at_stderr"
   105417 echo stdout:; cat "$at_stdout"
   105418 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105419 $at_failed && at_fn_log_failure
   105420 $at_traceon; }
   105421 
   105422     cp xml-tests/test.output expout
   105423   { set +x
   105424 $as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\
   105425              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   105426              xml-tests/test.xml"
   105427 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679"
   105428 ( $at_check_trace; $XSLTPROC \
   105429              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   105430              xml-tests/test.xml
   105431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105432 at_status=$? at_failed=false
   105433 $at_check_filter
   105434 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105435 $at_diff expout "$at_stdout" || at_failed=:
   105436 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105437 $at_failed && at_fn_log_failure
   105438 $at_traceon; }
   105439 
   105440   sort xml-tests/test.dot > expout
   105441   { set +x
   105442 $as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\
   105443              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   105444              xml-tests/test.xml | sort"
   105445 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679"
   105446 ( $at_check_trace; $XSLTPROC \
   105447              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   105448              xml-tests/test.xml | sort
   105449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105450 at_status=$? at_failed=false
   105451 $at_check_filter
   105452 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105453 $at_diff expout "$at_stdout" || at_failed=:
   105454 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105455 $at_failed && at_fn_log_failure
   105456 $at_traceon; }
   105457 
   105458   rm -rf xml-tests expout
   105459   at_restore_special_files
   105460 fi
   105461 { set +x
   105462 $as_echo "$at_srcdir/calc.at:679: bison -o calc.cc calc.y"
   105463 at_fn_check_prepare_trace "calc.at:679"
   105464 ( $at_check_trace; bison -o calc.cc calc.y
   105465 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105466 at_status=$? at_failed=false
   105467 $at_check_filter
   105468 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105469 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105470 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105471 $at_failed && at_fn_log_failure
   105472 $at_traceon; }
   105473 
   105474 
   105475 
   105476 { set +x
   105477 $as_echo "$at_srcdir/calc.at:679: \$BISON_CXX_WORKS"
   105478 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:679"
   105479 ( $at_check_trace; $BISON_CXX_WORKS
   105480 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105481 at_status=$? at_failed=false
   105482 $at_check_filter
   105483 echo stderr:; cat "$at_stderr"
   105484 echo stdout:; cat "$at_stdout"
   105485 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105486 $at_failed && at_fn_log_failure
   105487 $at_traceon; }
   105488 
   105489 { set +x
   105490 $as_echo "$at_srcdir/calc.at:679: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   105491 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:679"
   105492 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   105493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105494 at_status=$? at_failed=false
   105495 $at_check_filter
   105496 echo stderr:; cat "$at_stderr"
   105497 echo stdout:; cat "$at_stdout"
   105498 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105499 $at_failed && at_fn_log_failure
   105500 $at_traceon; }
   105501 
   105502 
   105503 { set +x
   105504 $as_echo "$at_srcdir/calc.at:679: \$PERL -ne '
   105505   chomp;
   105506   print \"\$.: {\$_}\\n\"
   105507     if (# No starting/ending empty lines.
   105508         (eof || \$. == 1) && /^\\s*\$/
   105509         # No trailing space.  FIXME: not ready for \"maint\".
   105510         # || /\\s\$/
   105511         )' calc.cc
   105512 "
   105513 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679"
   105514 ( $at_check_trace; $PERL -ne '
   105515   chomp;
   105516   print "$.: {$_}\n"
   105517     if (# No starting/ending empty lines.
   105518         (eof || $. == 1) && /^\s*$/
   105519         # No trailing space.  FIXME: not ready for "maint".
   105520         # || /\s$/
   105521         )' calc.cc
   105522 
   105523 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105524 at_status=$? at_failed=false
   105525 $at_check_filter
   105526 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105527 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105528 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105529 $at_failed && at_fn_log_failure
   105530 $at_traceon; }
   105531 
   105532 { set +x
   105533 $as_echo "$at_srcdir/calc.at:679: \$PERL -ne '
   105534   chomp;
   105535   print \"\$.: {\$_}\\n\"
   105536     if (# No starting/ending empty lines.
   105537         (eof || \$. == 1) && /^\\s*\$/
   105538         # No trailing space.  FIXME: not ready for \"maint\".
   105539         # || /\\s\$/
   105540         )' calc.hh
   105541 "
   105542 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679"
   105543 ( $at_check_trace; $PERL -ne '
   105544   chomp;
   105545   print "$.: {$_}\n"
   105546     if (# No starting/ending empty lines.
   105547         (eof || $. == 1) && /^\s*$/
   105548         # No trailing space.  FIXME: not ready for "maint".
   105549         # || /\s$/
   105550         )' calc.hh
   105551 
   105552 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105553 at_status=$? at_failed=false
   105554 $at_check_filter
   105555 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105556 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105557 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105558 $at_failed && at_fn_log_failure
   105559 $at_traceon; }
   105560 
   105561 
   105562 # Test the priorities.
   105563 cat >input <<'_ATEOF'
   105564 1 + 2 * 3 = 7
   105565 1 + 2 * -3 = -5
   105566 
   105567 -1^2 = -1
   105568 (-1)^2 = 1
   105569 
   105570 ---1 = -1
   105571 
   105572 1 - 2 - 3 = -4
   105573 1 - (2 - 3) = 2
   105574 
   105575 2^2^3 = 256
   105576 (2^2)^3 = 64
   105577 _ATEOF
   105578 
   105579 { set +x
   105580 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   105581 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   105582 ( $at_check_trace;  $PREPARSER ./calc input
   105583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105584 at_status=$? at_failed=false
   105585 $at_check_filter
   105586 echo stderr:; tee stderr <"$at_stderr"
   105587 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105588 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105589 $at_failed && at_fn_log_failure
   105590 $at_traceon; }
   105591 
   105592 { set +x
   105593 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105594 at_fn_check_prepare_trace "calc.at:679"
   105595 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105597 at_status=$? at_failed=false
   105598 $at_check_filter
   105599 echo stderr:; tee stderr <"$at_stderr"
   105600 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105601 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105602 $at_failed && at_fn_log_failure
   105603 $at_traceon; }
   105604 
   105605 
   105606 
   105607 
   105608 # Some syntax errors.
   105609 cat >input <<'_ATEOF'
   105610 1 2
   105611 _ATEOF
   105612 
   105613 { set +x
   105614 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   105615 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   105616 ( $at_check_trace;  $PREPARSER ./calc input
   105617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105618 at_status=$? at_failed=false
   105619 $at_check_filter
   105620 echo stderr:; tee stderr <"$at_stderr"
   105621 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105622 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
   105623 $at_failed && at_fn_log_failure
   105624 $at_traceon; }
   105625 
   105626 { set +x
   105627 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105628 at_fn_check_prepare_trace "calc.at:679"
   105629 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105630 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105631 at_status=$? at_failed=false
   105632 $at_check_filter
   105633 echo stderr:; tee stderr <"$at_stderr"
   105634 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105635 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105636 $at_failed && at_fn_log_failure
   105637 $at_traceon; }
   105638 
   105639 
   105640 
   105641 # Normalize the observed and expected error messages, depending upon the
   105642 # options.
   105643 # 1. Remove the traces from observed.
   105644 sed '/^Starting/d
   105645 /^Entering/d
   105646 /^Stack/d
   105647 /^Reading/d
   105648 /^Reducing/d
   105649 /^Return/d
   105650 /^Shifting/d
   105651 /^state/d
   105652 /^Cleanup:/d
   105653 /^Error:/d
   105654 /^Next/d
   105655 /^Now/d
   105656 /^Discarding/d
   105657 / \$[0-9$]* = /d
   105658 /^yydestructor:/d' stderr >at-stderr
   105659 mv at-stderr stderr
   105660 # 2. Create the reference error message.
   105661 cat >expout <<'_ATEOF'
   105662 1.3: syntax error, unexpected number
   105663 _ATEOF
   105664 
   105665 # 3. If locations are not used, remove them.
   105666 
   105667 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   105668 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   105669 mv at-expout expout
   105670 # 5. Check
   105671 { set +x
   105672 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   105673 at_fn_check_prepare_trace "calc.at:679"
   105674 ( $at_check_trace; cat stderr
   105675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105676 at_status=$? at_failed=false
   105677 $at_check_filter
   105678 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105679 $at_diff expout "$at_stdout" || at_failed=:
   105680 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105681 $at_failed && at_fn_log_failure
   105682 $at_traceon; }
   105683 
   105684 
   105685 cat >input <<'_ATEOF'
   105686 1//2
   105687 _ATEOF
   105688 
   105689 { set +x
   105690 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   105691 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   105692 ( $at_check_trace;  $PREPARSER ./calc input
   105693 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105694 at_status=$? at_failed=false
   105695 $at_check_filter
   105696 echo stderr:; tee stderr <"$at_stderr"
   105697 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105698 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
   105699 $at_failed && at_fn_log_failure
   105700 $at_traceon; }
   105701 
   105702 { set +x
   105703 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105704 at_fn_check_prepare_trace "calc.at:679"
   105705 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105707 at_status=$? at_failed=false
   105708 $at_check_filter
   105709 echo stderr:; tee stderr <"$at_stderr"
   105710 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105711 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105712 $at_failed && at_fn_log_failure
   105713 $at_traceon; }
   105714 
   105715 
   105716 
   105717 # Normalize the observed and expected error messages, depending upon the
   105718 # options.
   105719 # 1. Remove the traces from observed.
   105720 sed '/^Starting/d
   105721 /^Entering/d
   105722 /^Stack/d
   105723 /^Reading/d
   105724 /^Reducing/d
   105725 /^Return/d
   105726 /^Shifting/d
   105727 /^state/d
   105728 /^Cleanup:/d
   105729 /^Error:/d
   105730 /^Next/d
   105731 /^Now/d
   105732 /^Discarding/d
   105733 / \$[0-9$]* = /d
   105734 /^yydestructor:/d' stderr >at-stderr
   105735 mv at-stderr stderr
   105736 # 2. Create the reference error message.
   105737 cat >expout <<'_ATEOF'
   105738 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   105739 _ATEOF
   105740 
   105741 # 3. If locations are not used, remove them.
   105742 
   105743 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   105744 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   105745 mv at-expout expout
   105746 # 5. Check
   105747 { set +x
   105748 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   105749 at_fn_check_prepare_trace "calc.at:679"
   105750 ( $at_check_trace; cat stderr
   105751 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105752 at_status=$? at_failed=false
   105753 $at_check_filter
   105754 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105755 $at_diff expout "$at_stdout" || at_failed=:
   105756 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105757 $at_failed && at_fn_log_failure
   105758 $at_traceon; }
   105759 
   105760 
   105761 cat >input <<'_ATEOF'
   105762 error
   105763 _ATEOF
   105764 
   105765 { set +x
   105766 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   105767 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   105768 ( $at_check_trace;  $PREPARSER ./calc input
   105769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105770 at_status=$? at_failed=false
   105771 $at_check_filter
   105772 echo stderr:; tee stderr <"$at_stderr"
   105773 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105774 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
   105775 $at_failed && at_fn_log_failure
   105776 $at_traceon; }
   105777 
   105778 { set +x
   105779 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105780 at_fn_check_prepare_trace "calc.at:679"
   105781 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105783 at_status=$? at_failed=false
   105784 $at_check_filter
   105785 echo stderr:; tee stderr <"$at_stderr"
   105786 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105787 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105788 $at_failed && at_fn_log_failure
   105789 $at_traceon; }
   105790 
   105791 
   105792 
   105793 # Normalize the observed and expected error messages, depending upon the
   105794 # options.
   105795 # 1. Remove the traces from observed.
   105796 sed '/^Starting/d
   105797 /^Entering/d
   105798 /^Stack/d
   105799 /^Reading/d
   105800 /^Reducing/d
   105801 /^Return/d
   105802 /^Shifting/d
   105803 /^state/d
   105804 /^Cleanup:/d
   105805 /^Error:/d
   105806 /^Next/d
   105807 /^Now/d
   105808 /^Discarding/d
   105809 / \$[0-9$]* = /d
   105810 /^yydestructor:/d' stderr >at-stderr
   105811 mv at-stderr stderr
   105812 # 2. Create the reference error message.
   105813 cat >expout <<'_ATEOF'
   105814 1.1: syntax error, unexpected $undefined
   105815 _ATEOF
   105816 
   105817 # 3. If locations are not used, remove them.
   105818 
   105819 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   105820 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   105821 mv at-expout expout
   105822 # 5. Check
   105823 { set +x
   105824 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   105825 at_fn_check_prepare_trace "calc.at:679"
   105826 ( $at_check_trace; cat stderr
   105827 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105828 at_status=$? at_failed=false
   105829 $at_check_filter
   105830 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105831 $at_diff expout "$at_stdout" || at_failed=:
   105832 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105833 $at_failed && at_fn_log_failure
   105834 $at_traceon; }
   105835 
   105836 
   105837 cat >input <<'_ATEOF'
   105838 1 = 2 = 3
   105839 _ATEOF
   105840 
   105841 { set +x
   105842 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   105843 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   105844 ( $at_check_trace;  $PREPARSER ./calc input
   105845 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105846 at_status=$? at_failed=false
   105847 $at_check_filter
   105848 echo stderr:; tee stderr <"$at_stderr"
   105849 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105850 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
   105851 $at_failed && at_fn_log_failure
   105852 $at_traceon; }
   105853 
   105854 { set +x
   105855 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105856 at_fn_check_prepare_trace "calc.at:679"
   105857 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105858 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105859 at_status=$? at_failed=false
   105860 $at_check_filter
   105861 echo stderr:; tee stderr <"$at_stderr"
   105862 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105863 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105864 $at_failed && at_fn_log_failure
   105865 $at_traceon; }
   105866 
   105867 
   105868 
   105869 # Normalize the observed and expected error messages, depending upon the
   105870 # options.
   105871 # 1. Remove the traces from observed.
   105872 sed '/^Starting/d
   105873 /^Entering/d
   105874 /^Stack/d
   105875 /^Reading/d
   105876 /^Reducing/d
   105877 /^Return/d
   105878 /^Shifting/d
   105879 /^state/d
   105880 /^Cleanup:/d
   105881 /^Error:/d
   105882 /^Next/d
   105883 /^Now/d
   105884 /^Discarding/d
   105885 / \$[0-9$]* = /d
   105886 /^yydestructor:/d' stderr >at-stderr
   105887 mv at-stderr stderr
   105888 # 2. Create the reference error message.
   105889 cat >expout <<'_ATEOF'
   105890 1.7: syntax error, unexpected '='
   105891 _ATEOF
   105892 
   105893 # 3. If locations are not used, remove them.
   105894 
   105895 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   105896 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   105897 mv at-expout expout
   105898 # 5. Check
   105899 { set +x
   105900 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   105901 at_fn_check_prepare_trace "calc.at:679"
   105902 ( $at_check_trace; cat stderr
   105903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105904 at_status=$? at_failed=false
   105905 $at_check_filter
   105906 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105907 $at_diff expout "$at_stdout" || at_failed=:
   105908 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105909 $at_failed && at_fn_log_failure
   105910 $at_traceon; }
   105911 
   105912 
   105913 cat >input <<'_ATEOF'
   105914 
   105915 +1
   105916 _ATEOF
   105917 
   105918 { set +x
   105919 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   105920 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   105921 ( $at_check_trace;  $PREPARSER ./calc input
   105922 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105923 at_status=$? at_failed=false
   105924 $at_check_filter
   105925 echo stderr:; tee stderr <"$at_stderr"
   105926 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105927 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
   105928 $at_failed && at_fn_log_failure
   105929 $at_traceon; }
   105930 
   105931 { set +x
   105932 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   105933 at_fn_check_prepare_trace "calc.at:679"
   105934 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   105935 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105936 at_status=$? at_failed=false
   105937 $at_check_filter
   105938 echo stderr:; tee stderr <"$at_stderr"
   105939 at_fn_diff_devnull "$at_stdout" || at_failed=:
   105940 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105941 $at_failed && at_fn_log_failure
   105942 $at_traceon; }
   105943 
   105944 
   105945 
   105946 # Normalize the observed and expected error messages, depending upon the
   105947 # options.
   105948 # 1. Remove the traces from observed.
   105949 sed '/^Starting/d
   105950 /^Entering/d
   105951 /^Stack/d
   105952 /^Reading/d
   105953 /^Reducing/d
   105954 /^Return/d
   105955 /^Shifting/d
   105956 /^state/d
   105957 /^Cleanup:/d
   105958 /^Error:/d
   105959 /^Next/d
   105960 /^Now/d
   105961 /^Discarding/d
   105962 / \$[0-9$]* = /d
   105963 /^yydestructor:/d' stderr >at-stderr
   105964 mv at-stderr stderr
   105965 # 2. Create the reference error message.
   105966 cat >expout <<'_ATEOF'
   105967 2.1: syntax error, unexpected '+'
   105968 _ATEOF
   105969 
   105970 # 3. If locations are not used, remove them.
   105971 
   105972 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   105973 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   105974 mv at-expout expout
   105975 # 5. Check
   105976 { set +x
   105977 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   105978 at_fn_check_prepare_trace "calc.at:679"
   105979 ( $at_check_trace; cat stderr
   105980 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105981 at_status=$? at_failed=false
   105982 $at_check_filter
   105983 at_fn_diff_devnull "$at_stderr" || at_failed=:
   105984 $at_diff expout "$at_stdout" || at_failed=:
   105985 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   105986 $at_failed && at_fn_log_failure
   105987 $at_traceon; }
   105988 
   105989 
   105990 # Exercise error messages with EOF: work on an empty file.
   105991 { set +x
   105992 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc /dev/null"
   105993 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:679"
   105994 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   105995 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   105996 at_status=$? at_failed=false
   105997 $at_check_filter
   105998 echo stderr:; tee stderr <"$at_stderr"
   105999 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106000 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
   106001 $at_failed && at_fn_log_failure
   106002 $at_traceon; }
   106003 
   106004 { set +x
   106005 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   106006 at_fn_check_prepare_trace "calc.at:679"
   106007 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   106008 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106009 at_status=$? at_failed=false
   106010 $at_check_filter
   106011 echo stderr:; tee stderr <"$at_stderr"
   106012 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106013 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106014 $at_failed && at_fn_log_failure
   106015 $at_traceon; }
   106016 
   106017 
   106018 
   106019 # Normalize the observed and expected error messages, depending upon the
   106020 # options.
   106021 # 1. Remove the traces from observed.
   106022 sed '/^Starting/d
   106023 /^Entering/d
   106024 /^Stack/d
   106025 /^Reading/d
   106026 /^Reducing/d
   106027 /^Return/d
   106028 /^Shifting/d
   106029 /^state/d
   106030 /^Cleanup:/d
   106031 /^Error:/d
   106032 /^Next/d
   106033 /^Now/d
   106034 /^Discarding/d
   106035 / \$[0-9$]* = /d
   106036 /^yydestructor:/d' stderr >at-stderr
   106037 mv at-stderr stderr
   106038 # 2. Create the reference error message.
   106039 cat >expout <<'_ATEOF'
   106040 1.1: syntax error, unexpected end of input
   106041 _ATEOF
   106042 
   106043 # 3. If locations are not used, remove them.
   106044 
   106045 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   106046 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   106047 mv at-expout expout
   106048 # 5. Check
   106049 { set +x
   106050 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   106051 at_fn_check_prepare_trace "calc.at:679"
   106052 ( $at_check_trace; cat stderr
   106053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106054 at_status=$? at_failed=false
   106055 $at_check_filter
   106056 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106057 $at_diff expout "$at_stdout" || at_failed=:
   106058 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106059 $at_failed && at_fn_log_failure
   106060 $at_traceon; }
   106061 
   106062 
   106063 
   106064 # Exercise the error token: without it, we die at the first error,
   106065 # hence be sure to
   106066 #
   106067 # - have several errors which exercise different shift/discardings
   106068 #   - (): nothing to pop, nothing to discard
   106069 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   106070 #   - (* * *): nothing to pop, a lot to discard
   106071 #   - (1 + 2 * *): some to pop and discard
   106072 #
   106073 # - test the action associated to `error'
   106074 #
   106075 # - check the lookahead that triggers an error is not discarded
   106076 #   when we enter error recovery.  Below, the lookahead causing the
   106077 #   first error is ")", which is needed to recover from the error and
   106078 #   produce the "0" that triggers the "0 != 1" error.
   106079 #
   106080 cat >input <<'_ATEOF'
   106081 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   106082 _ATEOF
   106083 
   106084 { set +x
   106085 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   106086 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   106087 ( $at_check_trace;  $PREPARSER ./calc input
   106088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106089 at_status=$? at_failed=false
   106090 $at_check_filter
   106091 echo stderr:; tee stderr <"$at_stderr"
   106092 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106093 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106094 $at_failed && at_fn_log_failure
   106095 $at_traceon; }
   106096 
   106097 { set +x
   106098 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   106099 at_fn_check_prepare_trace "calc.at:679"
   106100 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   106101 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106102 at_status=$? at_failed=false
   106103 $at_check_filter
   106104 echo stderr:; tee stderr <"$at_stderr"
   106105 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106106 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106107 $at_failed && at_fn_log_failure
   106108 $at_traceon; }
   106109 
   106110 
   106111 
   106112 # Normalize the observed and expected error messages, depending upon the
   106113 # options.
   106114 # 1. Remove the traces from observed.
   106115 sed '/^Starting/d
   106116 /^Entering/d
   106117 /^Stack/d
   106118 /^Reading/d
   106119 /^Reducing/d
   106120 /^Return/d
   106121 /^Shifting/d
   106122 /^state/d
   106123 /^Cleanup:/d
   106124 /^Error:/d
   106125 /^Next/d
   106126 /^Now/d
   106127 /^Discarding/d
   106128 / \$[0-9$]* = /d
   106129 /^yydestructor:/d' stderr >at-stderr
   106130 mv at-stderr stderr
   106131 # 2. Create the reference error message.
   106132 cat >expout <<'_ATEOF'
   106133 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   106134 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   106135 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   106136 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   106137 calc: error: 4444 != 1
   106138 _ATEOF
   106139 
   106140 # 3. If locations are not used, remove them.
   106141 
   106142 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   106143 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   106144 mv at-expout expout
   106145 # 5. Check
   106146 { set +x
   106147 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   106148 at_fn_check_prepare_trace "calc.at:679"
   106149 ( $at_check_trace; cat stderr
   106150 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106151 at_status=$? at_failed=false
   106152 $at_check_filter
   106153 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106154 $at_diff expout "$at_stdout" || at_failed=:
   106155 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106156 $at_failed && at_fn_log_failure
   106157 $at_traceon; }
   106158 
   106159 
   106160 
   106161 # The same, but this time exercising explicitly triggered syntax errors.
   106162 # POSIX says the lookahead causing the error should not be discarded.
   106163 cat >input <<'_ATEOF'
   106164 (!) + (1 2) = 1
   106165 _ATEOF
   106166 
   106167 { set +x
   106168 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   106169 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   106170 ( $at_check_trace;  $PREPARSER ./calc input
   106171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106172 at_status=$? at_failed=false
   106173 $at_check_filter
   106174 echo stderr:; tee stderr <"$at_stderr"
   106175 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106176 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106177 $at_failed && at_fn_log_failure
   106178 $at_traceon; }
   106179 
   106180 { set +x
   106181 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   106182 at_fn_check_prepare_trace "calc.at:679"
   106183 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   106184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106185 at_status=$? at_failed=false
   106186 $at_check_filter
   106187 echo stderr:; tee stderr <"$at_stderr"
   106188 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106189 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106190 $at_failed && at_fn_log_failure
   106191 $at_traceon; }
   106192 
   106193 
   106194 
   106195 # Normalize the observed and expected error messages, depending upon the
   106196 # options.
   106197 # 1. Remove the traces from observed.
   106198 sed '/^Starting/d
   106199 /^Entering/d
   106200 /^Stack/d
   106201 /^Reading/d
   106202 /^Reducing/d
   106203 /^Return/d
   106204 /^Shifting/d
   106205 /^state/d
   106206 /^Cleanup:/d
   106207 /^Error:/d
   106208 /^Next/d
   106209 /^Now/d
   106210 /^Discarding/d
   106211 / \$[0-9$]* = /d
   106212 /^yydestructor:/d' stderr >at-stderr
   106213 mv at-stderr stderr
   106214 # 2. Create the reference error message.
   106215 cat >expout <<'_ATEOF'
   106216 1.10: syntax error, unexpected number
   106217 calc: error: 2222 != 1
   106218 _ATEOF
   106219 
   106220 # 3. If locations are not used, remove them.
   106221 
   106222 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   106223 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   106224 mv at-expout expout
   106225 # 5. Check
   106226 { set +x
   106227 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   106228 at_fn_check_prepare_trace "calc.at:679"
   106229 ( $at_check_trace; cat stderr
   106230 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106231 at_status=$? at_failed=false
   106232 $at_check_filter
   106233 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106234 $at_diff expout "$at_stdout" || at_failed=:
   106235 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106236 $at_failed && at_fn_log_failure
   106237 $at_traceon; }
   106238 
   106239 
   106240 cat >input <<'_ATEOF'
   106241 (- *) + (1 2) = 1
   106242 _ATEOF
   106243 
   106244 { set +x
   106245 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   106246 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   106247 ( $at_check_trace;  $PREPARSER ./calc input
   106248 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106249 at_status=$? at_failed=false
   106250 $at_check_filter
   106251 echo stderr:; tee stderr <"$at_stderr"
   106252 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106253 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106254 $at_failed && at_fn_log_failure
   106255 $at_traceon; }
   106256 
   106257 { set +x
   106258 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   106259 at_fn_check_prepare_trace "calc.at:679"
   106260 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   106261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106262 at_status=$? at_failed=false
   106263 $at_check_filter
   106264 echo stderr:; tee stderr <"$at_stderr"
   106265 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106266 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106267 $at_failed && at_fn_log_failure
   106268 $at_traceon; }
   106269 
   106270 
   106271 
   106272 # Normalize the observed and expected error messages, depending upon the
   106273 # options.
   106274 # 1. Remove the traces from observed.
   106275 sed '/^Starting/d
   106276 /^Entering/d
   106277 /^Stack/d
   106278 /^Reading/d
   106279 /^Reducing/d
   106280 /^Return/d
   106281 /^Shifting/d
   106282 /^state/d
   106283 /^Cleanup:/d
   106284 /^Error:/d
   106285 /^Next/d
   106286 /^Now/d
   106287 /^Discarding/d
   106288 / \$[0-9$]* = /d
   106289 /^yydestructor:/d' stderr >at-stderr
   106290 mv at-stderr stderr
   106291 # 2. Create the reference error message.
   106292 cat >expout <<'_ATEOF'
   106293 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   106294 1.12: syntax error, unexpected number
   106295 calc: error: 2222 != 1
   106296 _ATEOF
   106297 
   106298 # 3. If locations are not used, remove them.
   106299 
   106300 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   106301 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   106302 mv at-expout expout
   106303 # 5. Check
   106304 { set +x
   106305 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   106306 at_fn_check_prepare_trace "calc.at:679"
   106307 ( $at_check_trace; cat stderr
   106308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106309 at_status=$? at_failed=false
   106310 $at_check_filter
   106311 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106312 $at_diff expout "$at_stdout" || at_failed=:
   106313 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106314 $at_failed && at_fn_log_failure
   106315 $at_traceon; }
   106316 
   106317 
   106318 
   106319 # Check that yyerrok works properly: second error is not reported,
   106320 # third and fourth are.  Parse status is succesfull.
   106321 cat >input <<'_ATEOF'
   106322 (* *) + (*) + (*)
   106323 _ATEOF
   106324 
   106325 { set +x
   106326 $as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
   106327 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
   106328 ( $at_check_trace;  $PREPARSER ./calc input
   106329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106330 at_status=$? at_failed=false
   106331 $at_check_filter
   106332 echo stderr:; tee stderr <"$at_stderr"
   106333 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106334 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106335 $at_failed && at_fn_log_failure
   106336 $at_traceon; }
   106337 
   106338 { set +x
   106339 $as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   106340 at_fn_check_prepare_trace "calc.at:679"
   106341 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   106342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106343 at_status=$? at_failed=false
   106344 $at_check_filter
   106345 echo stderr:; tee stderr <"$at_stderr"
   106346 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106347 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106348 $at_failed && at_fn_log_failure
   106349 $at_traceon; }
   106350 
   106351 
   106352 
   106353 # Normalize the observed and expected error messages, depending upon the
   106354 # options.
   106355 # 1. Remove the traces from observed.
   106356 sed '/^Starting/d
   106357 /^Entering/d
   106358 /^Stack/d
   106359 /^Reading/d
   106360 /^Reducing/d
   106361 /^Return/d
   106362 /^Shifting/d
   106363 /^state/d
   106364 /^Cleanup:/d
   106365 /^Error:/d
   106366 /^Next/d
   106367 /^Now/d
   106368 /^Discarding/d
   106369 / \$[0-9$]* = /d
   106370 /^yydestructor:/d' stderr >at-stderr
   106371 mv at-stderr stderr
   106372 # 2. Create the reference error message.
   106373 cat >expout <<'_ATEOF'
   106374 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   106375 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   106376 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   106377 _ATEOF
   106378 
   106379 # 3. If locations are not used, remove them.
   106380 
   106381 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   106382 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   106383 mv at-expout expout
   106384 # 5. Check
   106385 { set +x
   106386 $as_echo "$at_srcdir/calc.at:679: cat stderr"
   106387 at_fn_check_prepare_trace "calc.at:679"
   106388 ( $at_check_trace; cat stderr
   106389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106390 at_status=$? at_failed=false
   106391 $at_check_filter
   106392 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106393 $at_diff expout "$at_stdout" || at_failed=:
   106394 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
   106395 $at_failed && at_fn_log_failure
   106396 $at_traceon; }
   106397 
   106398 
   106399 
   106400 
   106401 
   106402   set +x
   106403   $at_times_p && times >"$at_times_file"
   106404 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   106405 read at_status <"$at_status_file"
   106406 #AT_STOP_236
   106407 #AT_START_237
   106408 at_fn_group_banner 237 'calc.at:680' \
   106409   "Calculator %language \"C++\" %defines %locations %define api.location.type Span" "" 13
   106410 at_xfail=no
   106411 (
   106412   $as_echo "237. $at_setup_line: testing $at_desc ..."
   106413   $at_traceon
   106414 
   106415 
   106416 
   106417 
   106418 
   106419 
   106420 
   106421 
   106422 
   106423 
   106424 cat >calc.y <<'_ATEOF'
   106425 %code top {
   106426 #include <config.h>
   106427 /* We don't need perfect functions for these tests. */
   106428 #undef malloc
   106429 #undef memcmp
   106430 #undef realloc
   106431 }
   106432 
   106433 /* Infix notation calculator--calc */
   106434 %language "C++" %defines %locations %define api.location.type Span
   106435 %define global_tokens_and_yystype
   106436 %code requires
   106437 {
   106438 
   106439 # include <iostream>
   106440   struct Point
   106441   {
   106442     int l;
   106443     int c;
   106444   };
   106445 
   106446   struct Span
   106447   {
   106448     Point first;
   106449     Point last;
   106450   };
   106451 
   106452 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
   106453   do                                                                    \
   106454     if (N)                                                              \
   106455       {                                                                 \
   106456         (Current).first = YYRHSLOC (Rhs, 1).first;                      \
   106457         (Current).last  = YYRHSLOC (Rhs, N).last;                       \
   106458       }                                                                 \
   106459     else                                                                \
   106460       {                                                                 \
   106461         (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last;      \
   106462       }                                                                 \
   106463   while (false)
   106464 
   106465 
   106466   /* Exercise pre-prologue dependency to %union.  */
   106467   typedef int semantic_value;
   106468 }
   106469 
   106470 /* Exercise %union. */
   106471 %union
   106472 {
   106473   semantic_value ival;
   106474 };
   106475 %printer { yyoutput << $$; } <ival>;
   106476 
   106477 %code provides
   106478 {
   106479   #include <stdio.h>
   106480   /* The input.  */
   106481   extern FILE *input;
   106482   extern semantic_value global_result;
   106483   extern int global_count;
   106484 }
   106485 
   106486 %code
   106487 {
   106488 #include <assert.h>
   106489 #include <string.h>
   106490 #define USE(Var)
   106491 
   106492 FILE *input;
   106493 static int power (int base, int exponent);
   106494 
   106495 
   106496 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   106497 }
   106498 
   106499 
   106500 %initial-action
   106501 {
   106502   @$.first.l = @$.first.c = 1;
   106503   @$.last = @$.first;
   106504 }
   106505 
   106506 /* Bison Declarations */
   106507 %token CALC_EOF 0 "end of input"
   106508 %token <ival> NUM "number"
   106509 %type  <ival> exp
   106510 
   106511 %nonassoc '=' /* comparison            */
   106512 %left '-' '+'
   106513 %left '*' '/'
   106514 %left NEG     /* negation--unary minus */
   106515 %right '^'    /* exponentiation        */
   106516 
   106517 /* Grammar follows */
   106518 %%
   106519 input:
   106520   line
   106521 | input line         {  }
   106522 ;
   106523 
   106524 line:
   106525   '\n'
   106526 | exp '\n'           { USE ($1); }
   106527 ;
   106528 
   106529 exp:
   106530   NUM                { $$ = $1;             }
   106531 | exp '=' exp
   106532   {
   106533     if ($1 != $3)
   106534       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   106535     $$ = $1;
   106536   }
   106537 | exp '+' exp        { $$ = $1 + $3;        }
   106538 | exp '-' exp        { $$ = $1 - $3;        }
   106539 | exp '*' exp        { $$ = $1 * $3;        }
   106540 | exp '/' exp        { $$ = $1 / $3;        }
   106541 | '-' exp  %prec NEG { $$ = -$2;            }
   106542 | exp '^' exp        { $$ = power ($1, $3); }
   106543 | '(' exp ')'        { $$ = $2;             }
   106544 | '(' error ')'      { $$ = 1111; yyerrok;  }
   106545 | '!'                { $$ = 0; YYERROR;     }
   106546 | '-' error          { $$ = 0; YYERROR;     }
   106547 ;
   106548 %%
   106549 
   106550 static int
   106551 power (int base, int exponent)
   106552 {
   106553   int res = 1;
   106554   assert (0 <= exponent);
   106555   for (/* Niente */; exponent; --exponent)
   106556     res *= base;
   106557   return res;
   106558 }
   106559 
   106560 
   106561   std::ostream&
   106562   operator<< (std::ostream& o, const Span& s)
   106563   {
   106564     o << s.first.l << '.' << s.first.c;
   106565     if (s.first.l != s.last.l)
   106566       o << '-' << s.last.l << '.' << s.last.c - 1;
   106567     else if (s.first.c != s.last.c - 1)
   106568       o << '-' << s.last.c - 1;
   106569     return o;
   106570   }
   106571 
   106572 /* A C++ error reporting function.  */
   106573 void
   106574 yy::parser::error (const location_type& l, const std::string& m)
   106575 {
   106576   (void) l;
   106577   std::cerr << l << ": " << m << std::endl;
   106578 }
   106579 _ATEOF
   106580 
   106581 
   106582 
   106583 cat >calc-lex.cc <<'_ATEOF'
   106584 #include <config.h>
   106585 /* We don't need perfect functions for these tests. */
   106586 #undef malloc
   106587 #undef memcmp
   106588 #undef realloc
   106589 
   106590 #include "calc.hh"
   106591 
   106592 #include <ctype.h>
   106593 
   106594 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   106595 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   106596 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   106597 
   106598 
   106599 static yy::parser::location_type last_yylloc;
   106600 
   106601 static int
   106602 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   106603 {
   106604   int res = getc (input);
   106605   (void) lvalp;(void) llocp;
   106606 
   106607   last_yylloc = (*llocp);
   106608   if (res == '\n')
   106609     {
   106610       (*llocp).last.l++;
   106611       (*llocp).last.c = 1;
   106612     }
   106613   else
   106614     (*llocp).last.c++;
   106615 
   106616   return res;
   106617 }
   106618 
   106619 static void
   106620 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   106621 {
   106622   (void) lvalp;(void) llocp;
   106623 
   106624   /* Wrong when C == `\n'. */
   106625   (*llocp) = last_yylloc;
   106626 
   106627   ungetc (c, input);
   106628 }
   106629 
   106630 static int
   106631 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   106632 {
   106633   int c = get_char (lvalp, llocp);
   106634   int sign = 1;
   106635   int n = 0;
   106636 
   106637   (void) lvalp;(void) llocp;
   106638   if (c == '-')
   106639     {
   106640       c = get_char (lvalp, llocp);
   106641       sign = -1;
   106642     }
   106643 
   106644   while (isdigit (c))
   106645     {
   106646       n = 10 * n + (c - '0');
   106647       c = get_char (lvalp, llocp);
   106648     }
   106649 
   106650   unget_char (lvalp, llocp,  c);
   106651 
   106652   return sign * n;
   106653 }
   106654 
   106655 
   106656 /*---------------------------------------------------------------.
   106657 | Lexical analyzer returns an integer on the stack and the token |
   106658 | NUM, or the ASCII character read if not a number.  Skips all   |
   106659 | blanks and tabs, returns 0 for EOF.                            |
   106660 `---------------------------------------------------------------*/
   106661 
   106662 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   106663 {
   106664   int c;
   106665   /* Skip current token, then white spaces.  */
   106666   do
   106667     {
   106668      (*llocp).first.c = (*llocp).last.c;
   106669       (*llocp).first.l   = (*llocp).last.l;
   106670 
   106671     }
   106672   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   106673 
   106674   /* process numbers   */
   106675   if (c == '.' || isdigit (c))
   106676     {
   106677       unget_char (lvalp, llocp,  c);
   106678       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   106679       return NUM;
   106680     }
   106681 
   106682   /* Return end-of-file.  */
   106683   if (c == EOF)
   106684     return CALC_EOF;
   106685 
   106686   /* Return single chars. */
   106687   return c;
   106688 }
   106689 _ATEOF
   106690 
   106691 
   106692 cat >calc-main.cc <<'_ATEOF'
   106693 #include <config.h>
   106694 /* We don't need perfect functions for these tests. */
   106695 #undef malloc
   106696 #undef memcmp
   106697 #undef realloc
   106698 
   106699 #include "calc.hh"
   106700 
   106701 #include <assert.h>
   106702 #if HAVE_UNISTD_H
   106703 # include <unistd.h>
   106704 #else
   106705 # undef alarm
   106706 # define alarm(seconds) /* empty */
   106707 #endif
   106708 
   106709 
   106710 /* A C++ yyparse that simulates the C signature.  */
   106711 int
   106712 yyparse ()
   106713 {
   106714   yy::parser parser;
   106715 #if YYDEBUG
   106716   parser.set_debug_level (1);
   106717 #endif
   106718   return parser.parse ();
   106719 }
   106720 
   106721 
   106722 semantic_value global_result = 0;
   106723 int global_count = 0;
   106724 
   106725 /* A C main function.  */
   106726 int
   106727 main (int argc, const char **argv)
   106728 {
   106729   semantic_value result = 0;
   106730   int count = 0;
   106731   int status;
   106732 
   106733   /* This used to be alarm (10), but that isn't enough time for
   106734      a July 1995 vintage DEC Alphastation 200 4/100 system,
   106735      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   106736   alarm (100);
   106737 
   106738   if (argc == 2)
   106739     input = fopen (argv[1], "r");
   106740   else
   106741     input = stdin;
   106742 
   106743   if (!input)
   106744     {
   106745       perror (argv[1]);
   106746       return 3;
   106747     }
   106748 
   106749 
   106750   status = yyparse ();
   106751   if (fclose (input))
   106752     perror ("fclose");
   106753   assert (global_result == result);
   106754   assert (global_count == count);
   106755   return status;
   106756 }
   106757 _ATEOF
   106758 
   106759 
   106760 
   106761 
   106762 
   106763 
   106764 
   106765 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   106766   at_save_special_files
   106767   mkdir xml-tests
   106768     # Don't combine these Bison invocations since we want to be sure that
   106769   # --report=all isn't required to get the full XML file.
   106770   { set +x
   106771 $as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   106772                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   106773 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680"
   106774 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   106775                   --graph=xml-tests/test.dot -o calc.cc calc.y
   106776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106777 at_status=$? at_failed=false
   106778 $at_check_filter
   106779 echo stderr:; cat "$at_stderr"
   106780 echo stdout:; cat "$at_stdout"
   106781 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106782 $at_failed && at_fn_log_failure
   106783 $at_traceon; }
   106784 
   106785   { set +x
   106786 $as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   106787 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:680"
   106788 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   106789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106790 at_status=$? at_failed=false
   106791 $at_check_filter
   106792 echo stderr:; cat "$at_stderr"
   106793 echo stdout:; cat "$at_stdout"
   106794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106795 $at_failed && at_fn_log_failure
   106796 $at_traceon; }
   106797 
   106798     cp xml-tests/test.output expout
   106799   { set +x
   106800 $as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\
   106801              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   106802              xml-tests/test.xml"
   106803 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680"
   106804 ( $at_check_trace; $XSLTPROC \
   106805              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   106806              xml-tests/test.xml
   106807 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106808 at_status=$? at_failed=false
   106809 $at_check_filter
   106810 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106811 $at_diff expout "$at_stdout" || at_failed=:
   106812 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106813 $at_failed && at_fn_log_failure
   106814 $at_traceon; }
   106815 
   106816   sort xml-tests/test.dot > expout
   106817   { set +x
   106818 $as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\
   106819              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   106820              xml-tests/test.xml | sort"
   106821 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680"
   106822 ( $at_check_trace; $XSLTPROC \
   106823              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   106824              xml-tests/test.xml | sort
   106825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106826 at_status=$? at_failed=false
   106827 $at_check_filter
   106828 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106829 $at_diff expout "$at_stdout" || at_failed=:
   106830 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106831 $at_failed && at_fn_log_failure
   106832 $at_traceon; }
   106833 
   106834   rm -rf xml-tests expout
   106835   at_restore_special_files
   106836 fi
   106837 { set +x
   106838 $as_echo "$at_srcdir/calc.at:680: bison -o calc.cc calc.y"
   106839 at_fn_check_prepare_trace "calc.at:680"
   106840 ( $at_check_trace; bison -o calc.cc calc.y
   106841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106842 at_status=$? at_failed=false
   106843 $at_check_filter
   106844 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106845 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106846 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106847 $at_failed && at_fn_log_failure
   106848 $at_traceon; }
   106849 
   106850 
   106851 
   106852 { set +x
   106853 $as_echo "$at_srcdir/calc.at:680: \$BISON_CXX_WORKS"
   106854 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:680"
   106855 ( $at_check_trace; $BISON_CXX_WORKS
   106856 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106857 at_status=$? at_failed=false
   106858 $at_check_filter
   106859 echo stderr:; cat "$at_stderr"
   106860 echo stdout:; cat "$at_stdout"
   106861 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106862 $at_failed && at_fn_log_failure
   106863 $at_traceon; }
   106864 
   106865 { set +x
   106866 $as_echo "$at_srcdir/calc.at:680: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   106867 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:680"
   106868 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   106869 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106870 at_status=$? at_failed=false
   106871 $at_check_filter
   106872 echo stderr:; cat "$at_stderr"
   106873 echo stdout:; cat "$at_stdout"
   106874 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106875 $at_failed && at_fn_log_failure
   106876 $at_traceon; }
   106877 
   106878 
   106879 { set +x
   106880 $as_echo "$at_srcdir/calc.at:680: \$PERL -ne '
   106881   chomp;
   106882   print \"\$.: {\$_}\\n\"
   106883     if (# No starting/ending empty lines.
   106884         (eof || \$. == 1) && /^\\s*\$/
   106885         # No trailing space.  FIXME: not ready for \"maint\".
   106886         # || /\\s\$/
   106887         )' calc.cc
   106888 "
   106889 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680"
   106890 ( $at_check_trace; $PERL -ne '
   106891   chomp;
   106892   print "$.: {$_}\n"
   106893     if (# No starting/ending empty lines.
   106894         (eof || $. == 1) && /^\s*$/
   106895         # No trailing space.  FIXME: not ready for "maint".
   106896         # || /\s$/
   106897         )' calc.cc
   106898 
   106899 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106900 at_status=$? at_failed=false
   106901 $at_check_filter
   106902 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106903 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106904 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106905 $at_failed && at_fn_log_failure
   106906 $at_traceon; }
   106907 
   106908 { set +x
   106909 $as_echo "$at_srcdir/calc.at:680: \$PERL -ne '
   106910   chomp;
   106911   print \"\$.: {\$_}\\n\"
   106912     if (# No starting/ending empty lines.
   106913         (eof || \$. == 1) && /^\\s*\$/
   106914         # No trailing space.  FIXME: not ready for \"maint\".
   106915         # || /\\s\$/
   106916         )' calc.hh
   106917 "
   106918 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680"
   106919 ( $at_check_trace; $PERL -ne '
   106920   chomp;
   106921   print "$.: {$_}\n"
   106922     if (# No starting/ending empty lines.
   106923         (eof || $. == 1) && /^\s*$/
   106924         # No trailing space.  FIXME: not ready for "maint".
   106925         # || /\s$/
   106926         )' calc.hh
   106927 
   106928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106929 at_status=$? at_failed=false
   106930 $at_check_filter
   106931 at_fn_diff_devnull "$at_stderr" || at_failed=:
   106932 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106933 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106934 $at_failed && at_fn_log_failure
   106935 $at_traceon; }
   106936 
   106937 
   106938 # Test the priorities.
   106939 cat >input <<'_ATEOF'
   106940 1 + 2 * 3 = 7
   106941 1 + 2 * -3 = -5
   106942 
   106943 -1^2 = -1
   106944 (-1)^2 = 1
   106945 
   106946 ---1 = -1
   106947 
   106948 1 - 2 - 3 = -4
   106949 1 - (2 - 3) = 2
   106950 
   106951 2^2^3 = 256
   106952 (2^2)^3 = 64
   106953 _ATEOF
   106954 
   106955 { set +x
   106956 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   106957 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   106958 ( $at_check_trace;  $PREPARSER ./calc input
   106959 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106960 at_status=$? at_failed=false
   106961 $at_check_filter
   106962 echo stderr:; tee stderr <"$at_stderr"
   106963 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106964 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106965 $at_failed && at_fn_log_failure
   106966 $at_traceon; }
   106967 
   106968 { set +x
   106969 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   106970 at_fn_check_prepare_trace "calc.at:680"
   106971 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   106972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106973 at_status=$? at_failed=false
   106974 $at_check_filter
   106975 echo stderr:; tee stderr <"$at_stderr"
   106976 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106977 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   106978 $at_failed && at_fn_log_failure
   106979 $at_traceon; }
   106980 
   106981 
   106982 
   106983 
   106984 # Some syntax errors.
   106985 cat >input <<'_ATEOF'
   106986 1 2
   106987 _ATEOF
   106988 
   106989 { set +x
   106990 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   106991 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   106992 ( $at_check_trace;  $PREPARSER ./calc input
   106993 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   106994 at_status=$? at_failed=false
   106995 $at_check_filter
   106996 echo stderr:; tee stderr <"$at_stderr"
   106997 at_fn_diff_devnull "$at_stdout" || at_failed=:
   106998 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
   106999 $at_failed && at_fn_log_failure
   107000 $at_traceon; }
   107001 
   107002 { set +x
   107003 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107004 at_fn_check_prepare_trace "calc.at:680"
   107005 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107007 at_status=$? at_failed=false
   107008 $at_check_filter
   107009 echo stderr:; tee stderr <"$at_stderr"
   107010 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107011 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107012 $at_failed && at_fn_log_failure
   107013 $at_traceon; }
   107014 
   107015 
   107016 
   107017 # Normalize the observed and expected error messages, depending upon the
   107018 # options.
   107019 # 1. Remove the traces from observed.
   107020 sed '/^Starting/d
   107021 /^Entering/d
   107022 /^Stack/d
   107023 /^Reading/d
   107024 /^Reducing/d
   107025 /^Return/d
   107026 /^Shifting/d
   107027 /^state/d
   107028 /^Cleanup:/d
   107029 /^Error:/d
   107030 /^Next/d
   107031 /^Now/d
   107032 /^Discarding/d
   107033 / \$[0-9$]* = /d
   107034 /^yydestructor:/d' stderr >at-stderr
   107035 mv at-stderr stderr
   107036 # 2. Create the reference error message.
   107037 cat >expout <<'_ATEOF'
   107038 1.3: syntax error, unexpected number
   107039 _ATEOF
   107040 
   107041 # 3. If locations are not used, remove them.
   107042 
   107043 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107044 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107045 mv at-expout expout
   107046 # 5. Check
   107047 { set +x
   107048 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107049 at_fn_check_prepare_trace "calc.at:680"
   107050 ( $at_check_trace; cat stderr
   107051 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107052 at_status=$? at_failed=false
   107053 $at_check_filter
   107054 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107055 $at_diff expout "$at_stdout" || at_failed=:
   107056 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107057 $at_failed && at_fn_log_failure
   107058 $at_traceon; }
   107059 
   107060 
   107061 cat >input <<'_ATEOF'
   107062 1//2
   107063 _ATEOF
   107064 
   107065 { set +x
   107066 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107067 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107068 ( $at_check_trace;  $PREPARSER ./calc input
   107069 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107070 at_status=$? at_failed=false
   107071 $at_check_filter
   107072 echo stderr:; tee stderr <"$at_stderr"
   107073 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107074 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
   107075 $at_failed && at_fn_log_failure
   107076 $at_traceon; }
   107077 
   107078 { set +x
   107079 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107080 at_fn_check_prepare_trace "calc.at:680"
   107081 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107083 at_status=$? at_failed=false
   107084 $at_check_filter
   107085 echo stderr:; tee stderr <"$at_stderr"
   107086 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107087 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107088 $at_failed && at_fn_log_failure
   107089 $at_traceon; }
   107090 
   107091 
   107092 
   107093 # Normalize the observed and expected error messages, depending upon the
   107094 # options.
   107095 # 1. Remove the traces from observed.
   107096 sed '/^Starting/d
   107097 /^Entering/d
   107098 /^Stack/d
   107099 /^Reading/d
   107100 /^Reducing/d
   107101 /^Return/d
   107102 /^Shifting/d
   107103 /^state/d
   107104 /^Cleanup:/d
   107105 /^Error:/d
   107106 /^Next/d
   107107 /^Now/d
   107108 /^Discarding/d
   107109 / \$[0-9$]* = /d
   107110 /^yydestructor:/d' stderr >at-stderr
   107111 mv at-stderr stderr
   107112 # 2. Create the reference error message.
   107113 cat >expout <<'_ATEOF'
   107114 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   107115 _ATEOF
   107116 
   107117 # 3. If locations are not used, remove them.
   107118 
   107119 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107120 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107121 mv at-expout expout
   107122 # 5. Check
   107123 { set +x
   107124 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107125 at_fn_check_prepare_trace "calc.at:680"
   107126 ( $at_check_trace; cat stderr
   107127 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107128 at_status=$? at_failed=false
   107129 $at_check_filter
   107130 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107131 $at_diff expout "$at_stdout" || at_failed=:
   107132 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107133 $at_failed && at_fn_log_failure
   107134 $at_traceon; }
   107135 
   107136 
   107137 cat >input <<'_ATEOF'
   107138 error
   107139 _ATEOF
   107140 
   107141 { set +x
   107142 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107143 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107144 ( $at_check_trace;  $PREPARSER ./calc input
   107145 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107146 at_status=$? at_failed=false
   107147 $at_check_filter
   107148 echo stderr:; tee stderr <"$at_stderr"
   107149 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107150 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
   107151 $at_failed && at_fn_log_failure
   107152 $at_traceon; }
   107153 
   107154 { set +x
   107155 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107156 at_fn_check_prepare_trace "calc.at:680"
   107157 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107159 at_status=$? at_failed=false
   107160 $at_check_filter
   107161 echo stderr:; tee stderr <"$at_stderr"
   107162 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107163 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107164 $at_failed && at_fn_log_failure
   107165 $at_traceon; }
   107166 
   107167 
   107168 
   107169 # Normalize the observed and expected error messages, depending upon the
   107170 # options.
   107171 # 1. Remove the traces from observed.
   107172 sed '/^Starting/d
   107173 /^Entering/d
   107174 /^Stack/d
   107175 /^Reading/d
   107176 /^Reducing/d
   107177 /^Return/d
   107178 /^Shifting/d
   107179 /^state/d
   107180 /^Cleanup:/d
   107181 /^Error:/d
   107182 /^Next/d
   107183 /^Now/d
   107184 /^Discarding/d
   107185 / \$[0-9$]* = /d
   107186 /^yydestructor:/d' stderr >at-stderr
   107187 mv at-stderr stderr
   107188 # 2. Create the reference error message.
   107189 cat >expout <<'_ATEOF'
   107190 1.1: syntax error, unexpected $undefined
   107191 _ATEOF
   107192 
   107193 # 3. If locations are not used, remove them.
   107194 
   107195 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107196 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107197 mv at-expout expout
   107198 # 5. Check
   107199 { set +x
   107200 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107201 at_fn_check_prepare_trace "calc.at:680"
   107202 ( $at_check_trace; cat stderr
   107203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107204 at_status=$? at_failed=false
   107205 $at_check_filter
   107206 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107207 $at_diff expout "$at_stdout" || at_failed=:
   107208 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107209 $at_failed && at_fn_log_failure
   107210 $at_traceon; }
   107211 
   107212 
   107213 cat >input <<'_ATEOF'
   107214 1 = 2 = 3
   107215 _ATEOF
   107216 
   107217 { set +x
   107218 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107219 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107220 ( $at_check_trace;  $PREPARSER ./calc input
   107221 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107222 at_status=$? at_failed=false
   107223 $at_check_filter
   107224 echo stderr:; tee stderr <"$at_stderr"
   107225 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107226 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
   107227 $at_failed && at_fn_log_failure
   107228 $at_traceon; }
   107229 
   107230 { set +x
   107231 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107232 at_fn_check_prepare_trace "calc.at:680"
   107233 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107235 at_status=$? at_failed=false
   107236 $at_check_filter
   107237 echo stderr:; tee stderr <"$at_stderr"
   107238 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107239 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107240 $at_failed && at_fn_log_failure
   107241 $at_traceon; }
   107242 
   107243 
   107244 
   107245 # Normalize the observed and expected error messages, depending upon the
   107246 # options.
   107247 # 1. Remove the traces from observed.
   107248 sed '/^Starting/d
   107249 /^Entering/d
   107250 /^Stack/d
   107251 /^Reading/d
   107252 /^Reducing/d
   107253 /^Return/d
   107254 /^Shifting/d
   107255 /^state/d
   107256 /^Cleanup:/d
   107257 /^Error:/d
   107258 /^Next/d
   107259 /^Now/d
   107260 /^Discarding/d
   107261 / \$[0-9$]* = /d
   107262 /^yydestructor:/d' stderr >at-stderr
   107263 mv at-stderr stderr
   107264 # 2. Create the reference error message.
   107265 cat >expout <<'_ATEOF'
   107266 1.7: syntax error, unexpected '='
   107267 _ATEOF
   107268 
   107269 # 3. If locations are not used, remove them.
   107270 
   107271 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107272 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107273 mv at-expout expout
   107274 # 5. Check
   107275 { set +x
   107276 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107277 at_fn_check_prepare_trace "calc.at:680"
   107278 ( $at_check_trace; cat stderr
   107279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107280 at_status=$? at_failed=false
   107281 $at_check_filter
   107282 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107283 $at_diff expout "$at_stdout" || at_failed=:
   107284 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107285 $at_failed && at_fn_log_failure
   107286 $at_traceon; }
   107287 
   107288 
   107289 cat >input <<'_ATEOF'
   107290 
   107291 +1
   107292 _ATEOF
   107293 
   107294 { set +x
   107295 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107296 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107297 ( $at_check_trace;  $PREPARSER ./calc input
   107298 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107299 at_status=$? at_failed=false
   107300 $at_check_filter
   107301 echo stderr:; tee stderr <"$at_stderr"
   107302 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107303 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
   107304 $at_failed && at_fn_log_failure
   107305 $at_traceon; }
   107306 
   107307 { set +x
   107308 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107309 at_fn_check_prepare_trace "calc.at:680"
   107310 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107312 at_status=$? at_failed=false
   107313 $at_check_filter
   107314 echo stderr:; tee stderr <"$at_stderr"
   107315 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107316 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107317 $at_failed && at_fn_log_failure
   107318 $at_traceon; }
   107319 
   107320 
   107321 
   107322 # Normalize the observed and expected error messages, depending upon the
   107323 # options.
   107324 # 1. Remove the traces from observed.
   107325 sed '/^Starting/d
   107326 /^Entering/d
   107327 /^Stack/d
   107328 /^Reading/d
   107329 /^Reducing/d
   107330 /^Return/d
   107331 /^Shifting/d
   107332 /^state/d
   107333 /^Cleanup:/d
   107334 /^Error:/d
   107335 /^Next/d
   107336 /^Now/d
   107337 /^Discarding/d
   107338 / \$[0-9$]* = /d
   107339 /^yydestructor:/d' stderr >at-stderr
   107340 mv at-stderr stderr
   107341 # 2. Create the reference error message.
   107342 cat >expout <<'_ATEOF'
   107343 2.1: syntax error, unexpected '+'
   107344 _ATEOF
   107345 
   107346 # 3. If locations are not used, remove them.
   107347 
   107348 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107349 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107350 mv at-expout expout
   107351 # 5. Check
   107352 { set +x
   107353 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107354 at_fn_check_prepare_trace "calc.at:680"
   107355 ( $at_check_trace; cat stderr
   107356 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107357 at_status=$? at_failed=false
   107358 $at_check_filter
   107359 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107360 $at_diff expout "$at_stdout" || at_failed=:
   107361 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107362 $at_failed && at_fn_log_failure
   107363 $at_traceon; }
   107364 
   107365 
   107366 # Exercise error messages with EOF: work on an empty file.
   107367 { set +x
   107368 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc /dev/null"
   107369 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:680"
   107370 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   107371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107372 at_status=$? at_failed=false
   107373 $at_check_filter
   107374 echo stderr:; tee stderr <"$at_stderr"
   107375 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107376 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
   107377 $at_failed && at_fn_log_failure
   107378 $at_traceon; }
   107379 
   107380 { set +x
   107381 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107382 at_fn_check_prepare_trace "calc.at:680"
   107383 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107385 at_status=$? at_failed=false
   107386 $at_check_filter
   107387 echo stderr:; tee stderr <"$at_stderr"
   107388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107389 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107390 $at_failed && at_fn_log_failure
   107391 $at_traceon; }
   107392 
   107393 
   107394 
   107395 # Normalize the observed and expected error messages, depending upon the
   107396 # options.
   107397 # 1. Remove the traces from observed.
   107398 sed '/^Starting/d
   107399 /^Entering/d
   107400 /^Stack/d
   107401 /^Reading/d
   107402 /^Reducing/d
   107403 /^Return/d
   107404 /^Shifting/d
   107405 /^state/d
   107406 /^Cleanup:/d
   107407 /^Error:/d
   107408 /^Next/d
   107409 /^Now/d
   107410 /^Discarding/d
   107411 / \$[0-9$]* = /d
   107412 /^yydestructor:/d' stderr >at-stderr
   107413 mv at-stderr stderr
   107414 # 2. Create the reference error message.
   107415 cat >expout <<'_ATEOF'
   107416 1.1: syntax error, unexpected end of input
   107417 _ATEOF
   107418 
   107419 # 3. If locations are not used, remove them.
   107420 
   107421 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107422 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107423 mv at-expout expout
   107424 # 5. Check
   107425 { set +x
   107426 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107427 at_fn_check_prepare_trace "calc.at:680"
   107428 ( $at_check_trace; cat stderr
   107429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107430 at_status=$? at_failed=false
   107431 $at_check_filter
   107432 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107433 $at_diff expout "$at_stdout" || at_failed=:
   107434 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107435 $at_failed && at_fn_log_failure
   107436 $at_traceon; }
   107437 
   107438 
   107439 
   107440 # Exercise the error token: without it, we die at the first error,
   107441 # hence be sure to
   107442 #
   107443 # - have several errors which exercise different shift/discardings
   107444 #   - (): nothing to pop, nothing to discard
   107445 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   107446 #   - (* * *): nothing to pop, a lot to discard
   107447 #   - (1 + 2 * *): some to pop and discard
   107448 #
   107449 # - test the action associated to `error'
   107450 #
   107451 # - check the lookahead that triggers an error is not discarded
   107452 #   when we enter error recovery.  Below, the lookahead causing the
   107453 #   first error is ")", which is needed to recover from the error and
   107454 #   produce the "0" that triggers the "0 != 1" error.
   107455 #
   107456 cat >input <<'_ATEOF'
   107457 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   107458 _ATEOF
   107459 
   107460 { set +x
   107461 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107462 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107463 ( $at_check_trace;  $PREPARSER ./calc input
   107464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107465 at_status=$? at_failed=false
   107466 $at_check_filter
   107467 echo stderr:; tee stderr <"$at_stderr"
   107468 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107469 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107470 $at_failed && at_fn_log_failure
   107471 $at_traceon; }
   107472 
   107473 { set +x
   107474 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107475 at_fn_check_prepare_trace "calc.at:680"
   107476 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107478 at_status=$? at_failed=false
   107479 $at_check_filter
   107480 echo stderr:; tee stderr <"$at_stderr"
   107481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107482 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107483 $at_failed && at_fn_log_failure
   107484 $at_traceon; }
   107485 
   107486 
   107487 
   107488 # Normalize the observed and expected error messages, depending upon the
   107489 # options.
   107490 # 1. Remove the traces from observed.
   107491 sed '/^Starting/d
   107492 /^Entering/d
   107493 /^Stack/d
   107494 /^Reading/d
   107495 /^Reducing/d
   107496 /^Return/d
   107497 /^Shifting/d
   107498 /^state/d
   107499 /^Cleanup:/d
   107500 /^Error:/d
   107501 /^Next/d
   107502 /^Now/d
   107503 /^Discarding/d
   107504 / \$[0-9$]* = /d
   107505 /^yydestructor:/d' stderr >at-stderr
   107506 mv at-stderr stderr
   107507 # 2. Create the reference error message.
   107508 cat >expout <<'_ATEOF'
   107509 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   107510 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   107511 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   107512 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   107513 calc: error: 4444 != 1
   107514 _ATEOF
   107515 
   107516 # 3. If locations are not used, remove them.
   107517 
   107518 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107519 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107520 mv at-expout expout
   107521 # 5. Check
   107522 { set +x
   107523 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107524 at_fn_check_prepare_trace "calc.at:680"
   107525 ( $at_check_trace; cat stderr
   107526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107527 at_status=$? at_failed=false
   107528 $at_check_filter
   107529 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107530 $at_diff expout "$at_stdout" || at_failed=:
   107531 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107532 $at_failed && at_fn_log_failure
   107533 $at_traceon; }
   107534 
   107535 
   107536 
   107537 # The same, but this time exercising explicitly triggered syntax errors.
   107538 # POSIX says the lookahead causing the error should not be discarded.
   107539 cat >input <<'_ATEOF'
   107540 (!) + (1 2) = 1
   107541 _ATEOF
   107542 
   107543 { set +x
   107544 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107545 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107546 ( $at_check_trace;  $PREPARSER ./calc input
   107547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107548 at_status=$? at_failed=false
   107549 $at_check_filter
   107550 echo stderr:; tee stderr <"$at_stderr"
   107551 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107552 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107553 $at_failed && at_fn_log_failure
   107554 $at_traceon; }
   107555 
   107556 { set +x
   107557 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107558 at_fn_check_prepare_trace "calc.at:680"
   107559 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107560 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107561 at_status=$? at_failed=false
   107562 $at_check_filter
   107563 echo stderr:; tee stderr <"$at_stderr"
   107564 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107565 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107566 $at_failed && at_fn_log_failure
   107567 $at_traceon; }
   107568 
   107569 
   107570 
   107571 # Normalize the observed and expected error messages, depending upon the
   107572 # options.
   107573 # 1. Remove the traces from observed.
   107574 sed '/^Starting/d
   107575 /^Entering/d
   107576 /^Stack/d
   107577 /^Reading/d
   107578 /^Reducing/d
   107579 /^Return/d
   107580 /^Shifting/d
   107581 /^state/d
   107582 /^Cleanup:/d
   107583 /^Error:/d
   107584 /^Next/d
   107585 /^Now/d
   107586 /^Discarding/d
   107587 / \$[0-9$]* = /d
   107588 /^yydestructor:/d' stderr >at-stderr
   107589 mv at-stderr stderr
   107590 # 2. Create the reference error message.
   107591 cat >expout <<'_ATEOF'
   107592 1.10: syntax error, unexpected number
   107593 calc: error: 2222 != 1
   107594 _ATEOF
   107595 
   107596 # 3. If locations are not used, remove them.
   107597 
   107598 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107599 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107600 mv at-expout expout
   107601 # 5. Check
   107602 { set +x
   107603 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107604 at_fn_check_prepare_trace "calc.at:680"
   107605 ( $at_check_trace; cat stderr
   107606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107607 at_status=$? at_failed=false
   107608 $at_check_filter
   107609 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107610 $at_diff expout "$at_stdout" || at_failed=:
   107611 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107612 $at_failed && at_fn_log_failure
   107613 $at_traceon; }
   107614 
   107615 
   107616 cat >input <<'_ATEOF'
   107617 (- *) + (1 2) = 1
   107618 _ATEOF
   107619 
   107620 { set +x
   107621 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107622 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107623 ( $at_check_trace;  $PREPARSER ./calc input
   107624 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107625 at_status=$? at_failed=false
   107626 $at_check_filter
   107627 echo stderr:; tee stderr <"$at_stderr"
   107628 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107629 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107630 $at_failed && at_fn_log_failure
   107631 $at_traceon; }
   107632 
   107633 { set +x
   107634 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107635 at_fn_check_prepare_trace "calc.at:680"
   107636 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107638 at_status=$? at_failed=false
   107639 $at_check_filter
   107640 echo stderr:; tee stderr <"$at_stderr"
   107641 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107642 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107643 $at_failed && at_fn_log_failure
   107644 $at_traceon; }
   107645 
   107646 
   107647 
   107648 # Normalize the observed and expected error messages, depending upon the
   107649 # options.
   107650 # 1. Remove the traces from observed.
   107651 sed '/^Starting/d
   107652 /^Entering/d
   107653 /^Stack/d
   107654 /^Reading/d
   107655 /^Reducing/d
   107656 /^Return/d
   107657 /^Shifting/d
   107658 /^state/d
   107659 /^Cleanup:/d
   107660 /^Error:/d
   107661 /^Next/d
   107662 /^Now/d
   107663 /^Discarding/d
   107664 / \$[0-9$]* = /d
   107665 /^yydestructor:/d' stderr >at-stderr
   107666 mv at-stderr stderr
   107667 # 2. Create the reference error message.
   107668 cat >expout <<'_ATEOF'
   107669 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   107670 1.12: syntax error, unexpected number
   107671 calc: error: 2222 != 1
   107672 _ATEOF
   107673 
   107674 # 3. If locations are not used, remove them.
   107675 
   107676 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107677 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107678 mv at-expout expout
   107679 # 5. Check
   107680 { set +x
   107681 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107682 at_fn_check_prepare_trace "calc.at:680"
   107683 ( $at_check_trace; cat stderr
   107684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107685 at_status=$? at_failed=false
   107686 $at_check_filter
   107687 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107688 $at_diff expout "$at_stdout" || at_failed=:
   107689 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107690 $at_failed && at_fn_log_failure
   107691 $at_traceon; }
   107692 
   107693 
   107694 
   107695 # Check that yyerrok works properly: second error is not reported,
   107696 # third and fourth are.  Parse status is succesfull.
   107697 cat >input <<'_ATEOF'
   107698 (* *) + (*) + (*)
   107699 _ATEOF
   107700 
   107701 { set +x
   107702 $as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
   107703 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
   107704 ( $at_check_trace;  $PREPARSER ./calc input
   107705 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107706 at_status=$? at_failed=false
   107707 $at_check_filter
   107708 echo stderr:; tee stderr <"$at_stderr"
   107709 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107710 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107711 $at_failed && at_fn_log_failure
   107712 $at_traceon; }
   107713 
   107714 { set +x
   107715 $as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   107716 at_fn_check_prepare_trace "calc.at:680"
   107717 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   107718 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107719 at_status=$? at_failed=false
   107720 $at_check_filter
   107721 echo stderr:; tee stderr <"$at_stderr"
   107722 at_fn_diff_devnull "$at_stdout" || at_failed=:
   107723 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107724 $at_failed && at_fn_log_failure
   107725 $at_traceon; }
   107726 
   107727 
   107728 
   107729 # Normalize the observed and expected error messages, depending upon the
   107730 # options.
   107731 # 1. Remove the traces from observed.
   107732 sed '/^Starting/d
   107733 /^Entering/d
   107734 /^Stack/d
   107735 /^Reading/d
   107736 /^Reducing/d
   107737 /^Return/d
   107738 /^Shifting/d
   107739 /^state/d
   107740 /^Cleanup:/d
   107741 /^Error:/d
   107742 /^Next/d
   107743 /^Now/d
   107744 /^Discarding/d
   107745 / \$[0-9$]* = /d
   107746 /^yydestructor:/d' stderr >at-stderr
   107747 mv at-stderr stderr
   107748 # 2. Create the reference error message.
   107749 cat >expout <<'_ATEOF'
   107750 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   107751 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   107752 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   107753 _ATEOF
   107754 
   107755 # 3. If locations are not used, remove them.
   107756 
   107757 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   107758 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   107759 mv at-expout expout
   107760 # 5. Check
   107761 { set +x
   107762 $as_echo "$at_srcdir/calc.at:680: cat stderr"
   107763 at_fn_check_prepare_trace "calc.at:680"
   107764 ( $at_check_trace; cat stderr
   107765 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   107766 at_status=$? at_failed=false
   107767 $at_check_filter
   107768 at_fn_diff_devnull "$at_stderr" || at_failed=:
   107769 $at_diff expout "$at_stdout" || at_failed=:
   107770 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
   107771 $at_failed && at_fn_log_failure
   107772 $at_traceon; }
   107773 
   107774 
   107775 
   107776 
   107777 
   107778   set +x
   107779   $at_times_p && times >"$at_times_file"
   107780 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   107781 read at_status <"$at_status_file"
   107782 #AT_STOP_237
   107783 #AT_START_238
   107784 at_fn_group_banner 238 'calc.at:681' \
   107785   "Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 13
   107786 at_xfail=no
   107787 (
   107788   $as_echo "238. $at_setup_line: testing $at_desc ..."
   107789   $at_traceon
   107790 
   107791 
   107792 
   107793 
   107794 
   107795 
   107796 
   107797 
   107798 
   107799 
   107800 cat >calc.y <<'_ATEOF'
   107801 %code top {
   107802 #include <config.h>
   107803 /* We don't need perfect functions for these tests. */
   107804 #undef malloc
   107805 #undef memcmp
   107806 #undef realloc
   107807 }
   107808 
   107809 /* Infix notation calculator--calc */
   107810 %language "C++" %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc
   107811 %define global_tokens_and_yystype
   107812 %code requires
   107813 {
   107814 
   107815   /* Exercise pre-prologue dependency to %union.  */
   107816   typedef int semantic_value;
   107817 }
   107818 
   107819 /* Exercise %union. */
   107820 %union
   107821 {
   107822   semantic_value ival;
   107823 };
   107824 %printer { yyoutput << $$; } <ival>;
   107825 
   107826 %code provides
   107827 {
   107828   #include <stdio.h>
   107829   /* The input.  */
   107830   extern FILE *input;
   107831   extern semantic_value global_result;
   107832   extern int global_count;
   107833 }
   107834 
   107835 %code
   107836 {
   107837 #include <assert.h>
   107838 #include <string.h>
   107839 #define USE(Var)
   107840 
   107841 FILE *input;
   107842 static int power (int base, int exponent);
   107843 
   107844 
   107845 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   107846 }
   107847 
   107848 
   107849 
   107850 /* Bison Declarations */
   107851 %token CALC_EOF 0 "end of input"
   107852 %token <ival> NUM "number"
   107853 %type  <ival> exp
   107854 
   107855 %nonassoc '=' /* comparison            */
   107856 %left '-' '+'
   107857 %left '*' '/'
   107858 %left NEG     /* negation--unary minus */
   107859 %right '^'    /* exponentiation        */
   107860 
   107861 /* Grammar follows */
   107862 %%
   107863 input:
   107864   line
   107865 | input line         {  }
   107866 ;
   107867 
   107868 line:
   107869   '\n'
   107870 | exp '\n'           { USE ($1); }
   107871 ;
   107872 
   107873 exp:
   107874   NUM                { $$ = $1;             }
   107875 | exp '=' exp
   107876   {
   107877     if ($1 != $3)
   107878       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   107879     $$ = $1;
   107880   }
   107881 | exp '+' exp        { $$ = $1 + $3;        }
   107882 | exp '-' exp        { $$ = $1 - $3;        }
   107883 | exp '*' exp        { $$ = $1 * $3;        }
   107884 | exp '/' exp        { $$ = $1 / $3;        }
   107885 | '-' exp  %prec NEG { $$ = -$2;            }
   107886 | exp '^' exp        { $$ = power ($1, $3); }
   107887 | '(' exp ')'        { $$ = $2;             }
   107888 | '(' error ')'      { $$ = 1111; yyerrok;  }
   107889 | '!'                { $$ = 0; YYERROR;     }
   107890 | '-' error          { $$ = 0; YYERROR;     }
   107891 ;
   107892 %%
   107893 
   107894 static int
   107895 power (int base, int exponent)
   107896 {
   107897   int res = 1;
   107898   assert (0 <= exponent);
   107899   for (/* Niente */; exponent; --exponent)
   107900     res *= base;
   107901   return res;
   107902 }
   107903 
   107904 
   107905 /* A C++ error reporting function.  */
   107906 void
   107907 calc::parser::error (const location_type& l, const std::string& m)
   107908 {
   107909   (void) l;
   107910   std::cerr << l << ": " << m << std::endl;
   107911 }
   107912 _ATEOF
   107913 
   107914 
   107915 
   107916 cat >calc-lex.cc <<'_ATEOF'
   107917 #include <config.h>
   107918 /* We don't need perfect functions for these tests. */
   107919 #undef malloc
   107920 #undef memcmp
   107921 #undef realloc
   107922 
   107923 #include "calc.hh"
   107924 
   107925 #include <ctype.h>
   107926 
   107927 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   107928 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   107929 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   107930 
   107931 
   107932 static calc::parser::location_type last_yylloc;
   107933 
   107934 static int
   107935 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   107936 {
   107937   int res = getc (input);
   107938   (void) lvalp;(void) llocp;
   107939 
   107940   last_yylloc = (*llocp);
   107941   if (res == '\n')
   107942     {
   107943       (*llocp).end.line++;
   107944       (*llocp).end.column = 1;
   107945     }
   107946   else
   107947     (*llocp).end.column++;
   107948 
   107949   return res;
   107950 }
   107951 
   107952 static void
   107953 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   107954 {
   107955   (void) lvalp;(void) llocp;
   107956 
   107957   /* Wrong when C == `\n'. */
   107958   (*llocp) = last_yylloc;
   107959 
   107960   ungetc (c, input);
   107961 }
   107962 
   107963 static int
   107964 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   107965 {
   107966   int c = get_char (lvalp, llocp);
   107967   int sign = 1;
   107968   int n = 0;
   107969 
   107970   (void) lvalp;(void) llocp;
   107971   if (c == '-')
   107972     {
   107973       c = get_char (lvalp, llocp);
   107974       sign = -1;
   107975     }
   107976 
   107977   while (isdigit (c))
   107978     {
   107979       n = 10 * n + (c - '0');
   107980       c = get_char (lvalp, llocp);
   107981     }
   107982 
   107983   unget_char (lvalp, llocp,  c);
   107984 
   107985   return sign * n;
   107986 }
   107987 
   107988 
   107989 /*---------------------------------------------------------------.
   107990 | Lexical analyzer returns an integer on the stack and the token |
   107991 | NUM, or the ASCII character read if not a number.  Skips all   |
   107992 | blanks and tabs, returns 0 for EOF.                            |
   107993 `---------------------------------------------------------------*/
   107994 
   107995 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   107996 {
   107997   int c;
   107998   /* Skip current token, then white spaces.  */
   107999   do
   108000     {
   108001      (*llocp).begin.column = (*llocp).end.column;
   108002       (*llocp).begin.line   = (*llocp).end.line;
   108003 
   108004     }
   108005   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   108006 
   108007   /* process numbers   */
   108008   if (c == '.' || isdigit (c))
   108009     {
   108010       unget_char (lvalp, llocp,  c);
   108011       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   108012       return NUM;
   108013     }
   108014 
   108015   /* Return end-of-file.  */
   108016   if (c == EOF)
   108017     return CALC_EOF;
   108018 
   108019   /* Return single chars. */
   108020   return c;
   108021 }
   108022 _ATEOF
   108023 
   108024 
   108025 cat >calc-main.cc <<'_ATEOF'
   108026 #include <config.h>
   108027 /* We don't need perfect functions for these tests. */
   108028 #undef malloc
   108029 #undef memcmp
   108030 #undef realloc
   108031 
   108032 #include "calc.hh"
   108033 
   108034 #include <assert.h>
   108035 #if HAVE_UNISTD_H
   108036 # include <unistd.h>
   108037 #else
   108038 # undef alarm
   108039 # define alarm(seconds) /* empty */
   108040 #endif
   108041 
   108042 
   108043 /* A C++ calcparse that simulates the C signature.  */
   108044 int
   108045 calcparse ()
   108046 {
   108047   calc::parser parser;
   108048 #if YYDEBUG
   108049   parser.set_debug_level (1);
   108050 #endif
   108051   return parser.parse ();
   108052 }
   108053 
   108054 
   108055 semantic_value global_result = 0;
   108056 int global_count = 0;
   108057 
   108058 /* A C main function.  */
   108059 int
   108060 main (int argc, const char **argv)
   108061 {
   108062   semantic_value result = 0;
   108063   int count = 0;
   108064   int status;
   108065 
   108066   /* This used to be alarm (10), but that isn't enough time for
   108067      a July 1995 vintage DEC Alphastation 200 4/100 system,
   108068      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   108069   alarm (100);
   108070 
   108071   if (argc == 2)
   108072     input = fopen (argv[1], "r");
   108073   else
   108074     input = stdin;
   108075 
   108076   if (!input)
   108077     {
   108078       perror (argv[1]);
   108079       return 3;
   108080     }
   108081 
   108082 
   108083   status = calcparse ();
   108084   if (fclose (input))
   108085     perror ("fclose");
   108086   assert (global_result == result);
   108087   assert (global_count == count);
   108088   return status;
   108089 }
   108090 _ATEOF
   108091 
   108092 
   108093 
   108094 
   108095 
   108096 
   108097 
   108098 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   108099   at_save_special_files
   108100   mkdir xml-tests
   108101     # Don't combine these Bison invocations since we want to be sure that
   108102   # --report=all isn't required to get the full XML file.
   108103   { set +x
   108104 $as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   108105                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   108106 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681"
   108107 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   108108                   --graph=xml-tests/test.dot -o calc.cc calc.y
   108109 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108110 at_status=$? at_failed=false
   108111 $at_check_filter
   108112 echo stderr:; cat "$at_stderr"
   108113 echo stdout:; cat "$at_stdout"
   108114 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108115 $at_failed && at_fn_log_failure
   108116 $at_traceon; }
   108117 
   108118   { set +x
   108119 $as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   108120 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:681"
   108121 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   108122 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108123 at_status=$? at_failed=false
   108124 $at_check_filter
   108125 echo stderr:; cat "$at_stderr"
   108126 echo stdout:; cat "$at_stdout"
   108127 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108128 $at_failed && at_fn_log_failure
   108129 $at_traceon; }
   108130 
   108131     cp xml-tests/test.output expout
   108132   { set +x
   108133 $as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\
   108134              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   108135              xml-tests/test.xml"
   108136 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681"
   108137 ( $at_check_trace; $XSLTPROC \
   108138              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   108139              xml-tests/test.xml
   108140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108141 at_status=$? at_failed=false
   108142 $at_check_filter
   108143 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108144 $at_diff expout "$at_stdout" || at_failed=:
   108145 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108146 $at_failed && at_fn_log_failure
   108147 $at_traceon; }
   108148 
   108149   sort xml-tests/test.dot > expout
   108150   { set +x
   108151 $as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\
   108152              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   108153              xml-tests/test.xml | sort"
   108154 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681"
   108155 ( $at_check_trace; $XSLTPROC \
   108156              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   108157              xml-tests/test.xml | sort
   108158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108159 at_status=$? at_failed=false
   108160 $at_check_filter
   108161 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108162 $at_diff expout "$at_stdout" || at_failed=:
   108163 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108164 $at_failed && at_fn_log_failure
   108165 $at_traceon; }
   108166 
   108167   rm -rf xml-tests expout
   108168   at_restore_special_files
   108169 fi
   108170 { set +x
   108171 $as_echo "$at_srcdir/calc.at:681: bison -o calc.cc calc.y"
   108172 at_fn_check_prepare_trace "calc.at:681"
   108173 ( $at_check_trace; bison -o calc.cc calc.y
   108174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108175 at_status=$? at_failed=false
   108176 $at_check_filter
   108177 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108178 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108179 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108180 $at_failed && at_fn_log_failure
   108181 $at_traceon; }
   108182 
   108183 
   108184 
   108185 { set +x
   108186 $as_echo "$at_srcdir/calc.at:681: \$BISON_CXX_WORKS"
   108187 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:681"
   108188 ( $at_check_trace; $BISON_CXX_WORKS
   108189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108190 at_status=$? at_failed=false
   108191 $at_check_filter
   108192 echo stderr:; cat "$at_stderr"
   108193 echo stdout:; cat "$at_stdout"
   108194 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108195 $at_failed && at_fn_log_failure
   108196 $at_traceon; }
   108197 
   108198 { set +x
   108199 $as_echo "$at_srcdir/calc.at:681: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   108200 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:681"
   108201 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   108202 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108203 at_status=$? at_failed=false
   108204 $at_check_filter
   108205 echo stderr:; cat "$at_stderr"
   108206 echo stdout:; cat "$at_stdout"
   108207 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108208 $at_failed && at_fn_log_failure
   108209 $at_traceon; }
   108210 
   108211 
   108212 { set +x
   108213 $as_echo "$at_srcdir/calc.at:681: \$PERL -ne '
   108214   chomp;
   108215   print \"\$.: {\$_}\\n\"
   108216     if (# No starting/ending empty lines.
   108217         (eof || \$. == 1) && /^\\s*\$/
   108218         # No trailing space.  FIXME: not ready for \"maint\".
   108219         # || /\\s\$/
   108220         )' calc.cc
   108221 "
   108222 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681"
   108223 ( $at_check_trace; $PERL -ne '
   108224   chomp;
   108225   print "$.: {$_}\n"
   108226     if (# No starting/ending empty lines.
   108227         (eof || $. == 1) && /^\s*$/
   108228         # No trailing space.  FIXME: not ready for "maint".
   108229         # || /\s$/
   108230         )' calc.cc
   108231 
   108232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108233 at_status=$? at_failed=false
   108234 $at_check_filter
   108235 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108236 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108237 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108238 $at_failed && at_fn_log_failure
   108239 $at_traceon; }
   108240 
   108241 { set +x
   108242 $as_echo "$at_srcdir/calc.at:681: \$PERL -ne '
   108243   chomp;
   108244   print \"\$.: {\$_}\\n\"
   108245     if (# No starting/ending empty lines.
   108246         (eof || \$. == 1) && /^\\s*\$/
   108247         # No trailing space.  FIXME: not ready for \"maint\".
   108248         # || /\\s\$/
   108249         )' calc.hh
   108250 "
   108251 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681"
   108252 ( $at_check_trace; $PERL -ne '
   108253   chomp;
   108254   print "$.: {$_}\n"
   108255     if (# No starting/ending empty lines.
   108256         (eof || $. == 1) && /^\s*$/
   108257         # No trailing space.  FIXME: not ready for "maint".
   108258         # || /\s$/
   108259         )' calc.hh
   108260 
   108261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108262 at_status=$? at_failed=false
   108263 $at_check_filter
   108264 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108265 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108266 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108267 $at_failed && at_fn_log_failure
   108268 $at_traceon; }
   108269 
   108270 
   108271 # Test the priorities.
   108272 cat >input <<'_ATEOF'
   108273 1 + 2 * 3 = 7
   108274 1 + 2 * -3 = -5
   108275 
   108276 -1^2 = -1
   108277 (-1)^2 = 1
   108278 
   108279 ---1 = -1
   108280 
   108281 1 - 2 - 3 = -4
   108282 1 - (2 - 3) = 2
   108283 
   108284 2^2^3 = 256
   108285 (2^2)^3 = 64
   108286 _ATEOF
   108287 
   108288 { set +x
   108289 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108290 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108291 ( $at_check_trace;  $PREPARSER ./calc input
   108292 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108293 at_status=$? at_failed=false
   108294 $at_check_filter
   108295 echo stderr:; tee stderr <"$at_stderr"
   108296 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108297 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108298 $at_failed && at_fn_log_failure
   108299 $at_traceon; }
   108300 
   108301 { set +x
   108302 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108303 at_fn_check_prepare_trace "calc.at:681"
   108304 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108306 at_status=$? at_failed=false
   108307 $at_check_filter
   108308 echo stderr:; tee stderr <"$at_stderr"
   108309 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108310 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108311 $at_failed && at_fn_log_failure
   108312 $at_traceon; }
   108313 
   108314 
   108315 
   108316 
   108317 # Some syntax errors.
   108318 cat >input <<'_ATEOF'
   108319 1 2
   108320 _ATEOF
   108321 
   108322 { set +x
   108323 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108324 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108325 ( $at_check_trace;  $PREPARSER ./calc input
   108326 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108327 at_status=$? at_failed=false
   108328 $at_check_filter
   108329 echo stderr:; tee stderr <"$at_stderr"
   108330 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108331 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
   108332 $at_failed && at_fn_log_failure
   108333 $at_traceon; }
   108334 
   108335 { set +x
   108336 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108337 at_fn_check_prepare_trace "calc.at:681"
   108338 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108339 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108340 at_status=$? at_failed=false
   108341 $at_check_filter
   108342 echo stderr:; tee stderr <"$at_stderr"
   108343 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108344 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108345 $at_failed && at_fn_log_failure
   108346 $at_traceon; }
   108347 
   108348 
   108349 
   108350 # Normalize the observed and expected error messages, depending upon the
   108351 # options.
   108352 # 1. Remove the traces from observed.
   108353 sed '/^Starting/d
   108354 /^Entering/d
   108355 /^Stack/d
   108356 /^Reading/d
   108357 /^Reducing/d
   108358 /^Return/d
   108359 /^Shifting/d
   108360 /^state/d
   108361 /^Cleanup:/d
   108362 /^Error:/d
   108363 /^Next/d
   108364 /^Now/d
   108365 /^Discarding/d
   108366 / \$[0-9$]* = /d
   108367 /^yydestructor:/d' stderr >at-stderr
   108368 mv at-stderr stderr
   108369 # 2. Create the reference error message.
   108370 cat >expout <<'_ATEOF'
   108371 1.3: syntax error, unexpected number
   108372 _ATEOF
   108373 
   108374 # 3. If locations are not used, remove them.
   108375 
   108376 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108377 
   108378 # 5. Check
   108379 { set +x
   108380 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108381 at_fn_check_prepare_trace "calc.at:681"
   108382 ( $at_check_trace; cat stderr
   108383 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108384 at_status=$? at_failed=false
   108385 $at_check_filter
   108386 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108387 $at_diff expout "$at_stdout" || at_failed=:
   108388 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108389 $at_failed && at_fn_log_failure
   108390 $at_traceon; }
   108391 
   108392 
   108393 cat >input <<'_ATEOF'
   108394 1//2
   108395 _ATEOF
   108396 
   108397 { set +x
   108398 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108399 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108400 ( $at_check_trace;  $PREPARSER ./calc input
   108401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108402 at_status=$? at_failed=false
   108403 $at_check_filter
   108404 echo stderr:; tee stderr <"$at_stderr"
   108405 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108406 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
   108407 $at_failed && at_fn_log_failure
   108408 $at_traceon; }
   108409 
   108410 { set +x
   108411 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108412 at_fn_check_prepare_trace "calc.at:681"
   108413 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108414 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108415 at_status=$? at_failed=false
   108416 $at_check_filter
   108417 echo stderr:; tee stderr <"$at_stderr"
   108418 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108419 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108420 $at_failed && at_fn_log_failure
   108421 $at_traceon; }
   108422 
   108423 
   108424 
   108425 # Normalize the observed and expected error messages, depending upon the
   108426 # options.
   108427 # 1. Remove the traces from observed.
   108428 sed '/^Starting/d
   108429 /^Entering/d
   108430 /^Stack/d
   108431 /^Reading/d
   108432 /^Reducing/d
   108433 /^Return/d
   108434 /^Shifting/d
   108435 /^state/d
   108436 /^Cleanup:/d
   108437 /^Error:/d
   108438 /^Next/d
   108439 /^Now/d
   108440 /^Discarding/d
   108441 / \$[0-9$]* = /d
   108442 /^yydestructor:/d' stderr >at-stderr
   108443 mv at-stderr stderr
   108444 # 2. Create the reference error message.
   108445 cat >expout <<'_ATEOF'
   108446 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   108447 _ATEOF
   108448 
   108449 # 3. If locations are not used, remove them.
   108450 
   108451 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108452 
   108453 # 5. Check
   108454 { set +x
   108455 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108456 at_fn_check_prepare_trace "calc.at:681"
   108457 ( $at_check_trace; cat stderr
   108458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108459 at_status=$? at_failed=false
   108460 $at_check_filter
   108461 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108462 $at_diff expout "$at_stdout" || at_failed=:
   108463 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108464 $at_failed && at_fn_log_failure
   108465 $at_traceon; }
   108466 
   108467 
   108468 cat >input <<'_ATEOF'
   108469 error
   108470 _ATEOF
   108471 
   108472 { set +x
   108473 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108474 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108475 ( $at_check_trace;  $PREPARSER ./calc input
   108476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108477 at_status=$? at_failed=false
   108478 $at_check_filter
   108479 echo stderr:; tee stderr <"$at_stderr"
   108480 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108481 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
   108482 $at_failed && at_fn_log_failure
   108483 $at_traceon; }
   108484 
   108485 { set +x
   108486 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108487 at_fn_check_prepare_trace "calc.at:681"
   108488 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108489 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108490 at_status=$? at_failed=false
   108491 $at_check_filter
   108492 echo stderr:; tee stderr <"$at_stderr"
   108493 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108494 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108495 $at_failed && at_fn_log_failure
   108496 $at_traceon; }
   108497 
   108498 
   108499 
   108500 # Normalize the observed and expected error messages, depending upon the
   108501 # options.
   108502 # 1. Remove the traces from observed.
   108503 sed '/^Starting/d
   108504 /^Entering/d
   108505 /^Stack/d
   108506 /^Reading/d
   108507 /^Reducing/d
   108508 /^Return/d
   108509 /^Shifting/d
   108510 /^state/d
   108511 /^Cleanup:/d
   108512 /^Error:/d
   108513 /^Next/d
   108514 /^Now/d
   108515 /^Discarding/d
   108516 / \$[0-9$]* = /d
   108517 /^yydestructor:/d' stderr >at-stderr
   108518 mv at-stderr stderr
   108519 # 2. Create the reference error message.
   108520 cat >expout <<'_ATEOF'
   108521 1.1: syntax error, unexpected $undefined
   108522 _ATEOF
   108523 
   108524 # 3. If locations are not used, remove them.
   108525 
   108526 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108527 
   108528 # 5. Check
   108529 { set +x
   108530 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108531 at_fn_check_prepare_trace "calc.at:681"
   108532 ( $at_check_trace; cat stderr
   108533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108534 at_status=$? at_failed=false
   108535 $at_check_filter
   108536 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108537 $at_diff expout "$at_stdout" || at_failed=:
   108538 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108539 $at_failed && at_fn_log_failure
   108540 $at_traceon; }
   108541 
   108542 
   108543 cat >input <<'_ATEOF'
   108544 1 = 2 = 3
   108545 _ATEOF
   108546 
   108547 { set +x
   108548 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108549 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108550 ( $at_check_trace;  $PREPARSER ./calc input
   108551 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108552 at_status=$? at_failed=false
   108553 $at_check_filter
   108554 echo stderr:; tee stderr <"$at_stderr"
   108555 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108556 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
   108557 $at_failed && at_fn_log_failure
   108558 $at_traceon; }
   108559 
   108560 { set +x
   108561 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108562 at_fn_check_prepare_trace "calc.at:681"
   108563 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108565 at_status=$? at_failed=false
   108566 $at_check_filter
   108567 echo stderr:; tee stderr <"$at_stderr"
   108568 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108569 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108570 $at_failed && at_fn_log_failure
   108571 $at_traceon; }
   108572 
   108573 
   108574 
   108575 # Normalize the observed and expected error messages, depending upon the
   108576 # options.
   108577 # 1. Remove the traces from observed.
   108578 sed '/^Starting/d
   108579 /^Entering/d
   108580 /^Stack/d
   108581 /^Reading/d
   108582 /^Reducing/d
   108583 /^Return/d
   108584 /^Shifting/d
   108585 /^state/d
   108586 /^Cleanup:/d
   108587 /^Error:/d
   108588 /^Next/d
   108589 /^Now/d
   108590 /^Discarding/d
   108591 / \$[0-9$]* = /d
   108592 /^yydestructor:/d' stderr >at-stderr
   108593 mv at-stderr stderr
   108594 # 2. Create the reference error message.
   108595 cat >expout <<'_ATEOF'
   108596 1.7: syntax error, unexpected '='
   108597 _ATEOF
   108598 
   108599 # 3. If locations are not used, remove them.
   108600 
   108601 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108602 
   108603 # 5. Check
   108604 { set +x
   108605 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108606 at_fn_check_prepare_trace "calc.at:681"
   108607 ( $at_check_trace; cat stderr
   108608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108609 at_status=$? at_failed=false
   108610 $at_check_filter
   108611 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108612 $at_diff expout "$at_stdout" || at_failed=:
   108613 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108614 $at_failed && at_fn_log_failure
   108615 $at_traceon; }
   108616 
   108617 
   108618 cat >input <<'_ATEOF'
   108619 
   108620 +1
   108621 _ATEOF
   108622 
   108623 { set +x
   108624 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108625 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108626 ( $at_check_trace;  $PREPARSER ./calc input
   108627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108628 at_status=$? at_failed=false
   108629 $at_check_filter
   108630 echo stderr:; tee stderr <"$at_stderr"
   108631 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108632 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
   108633 $at_failed && at_fn_log_failure
   108634 $at_traceon; }
   108635 
   108636 { set +x
   108637 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108638 at_fn_check_prepare_trace "calc.at:681"
   108639 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108641 at_status=$? at_failed=false
   108642 $at_check_filter
   108643 echo stderr:; tee stderr <"$at_stderr"
   108644 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108645 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108646 $at_failed && at_fn_log_failure
   108647 $at_traceon; }
   108648 
   108649 
   108650 
   108651 # Normalize the observed and expected error messages, depending upon the
   108652 # options.
   108653 # 1. Remove the traces from observed.
   108654 sed '/^Starting/d
   108655 /^Entering/d
   108656 /^Stack/d
   108657 /^Reading/d
   108658 /^Reducing/d
   108659 /^Return/d
   108660 /^Shifting/d
   108661 /^state/d
   108662 /^Cleanup:/d
   108663 /^Error:/d
   108664 /^Next/d
   108665 /^Now/d
   108666 /^Discarding/d
   108667 / \$[0-9$]* = /d
   108668 /^yydestructor:/d' stderr >at-stderr
   108669 mv at-stderr stderr
   108670 # 2. Create the reference error message.
   108671 cat >expout <<'_ATEOF'
   108672 2.1: syntax error, unexpected '+'
   108673 _ATEOF
   108674 
   108675 # 3. If locations are not used, remove them.
   108676 
   108677 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108678 
   108679 # 5. Check
   108680 { set +x
   108681 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108682 at_fn_check_prepare_trace "calc.at:681"
   108683 ( $at_check_trace; cat stderr
   108684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108685 at_status=$? at_failed=false
   108686 $at_check_filter
   108687 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108688 $at_diff expout "$at_stdout" || at_failed=:
   108689 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108690 $at_failed && at_fn_log_failure
   108691 $at_traceon; }
   108692 
   108693 
   108694 # Exercise error messages with EOF: work on an empty file.
   108695 { set +x
   108696 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc /dev/null"
   108697 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:681"
   108698 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   108699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108700 at_status=$? at_failed=false
   108701 $at_check_filter
   108702 echo stderr:; tee stderr <"$at_stderr"
   108703 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108704 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
   108705 $at_failed && at_fn_log_failure
   108706 $at_traceon; }
   108707 
   108708 { set +x
   108709 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108710 at_fn_check_prepare_trace "calc.at:681"
   108711 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108713 at_status=$? at_failed=false
   108714 $at_check_filter
   108715 echo stderr:; tee stderr <"$at_stderr"
   108716 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108717 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108718 $at_failed && at_fn_log_failure
   108719 $at_traceon; }
   108720 
   108721 
   108722 
   108723 # Normalize the observed and expected error messages, depending upon the
   108724 # options.
   108725 # 1. Remove the traces from observed.
   108726 sed '/^Starting/d
   108727 /^Entering/d
   108728 /^Stack/d
   108729 /^Reading/d
   108730 /^Reducing/d
   108731 /^Return/d
   108732 /^Shifting/d
   108733 /^state/d
   108734 /^Cleanup:/d
   108735 /^Error:/d
   108736 /^Next/d
   108737 /^Now/d
   108738 /^Discarding/d
   108739 / \$[0-9$]* = /d
   108740 /^yydestructor:/d' stderr >at-stderr
   108741 mv at-stderr stderr
   108742 # 2. Create the reference error message.
   108743 cat >expout <<'_ATEOF'
   108744 1.1: syntax error, unexpected end of input
   108745 _ATEOF
   108746 
   108747 # 3. If locations are not used, remove them.
   108748 
   108749 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108750 
   108751 # 5. Check
   108752 { set +x
   108753 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108754 at_fn_check_prepare_trace "calc.at:681"
   108755 ( $at_check_trace; cat stderr
   108756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108757 at_status=$? at_failed=false
   108758 $at_check_filter
   108759 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108760 $at_diff expout "$at_stdout" || at_failed=:
   108761 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108762 $at_failed && at_fn_log_failure
   108763 $at_traceon; }
   108764 
   108765 
   108766 
   108767 # Exercise the error token: without it, we die at the first error,
   108768 # hence be sure to
   108769 #
   108770 # - have several errors which exercise different shift/discardings
   108771 #   - (): nothing to pop, nothing to discard
   108772 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   108773 #   - (* * *): nothing to pop, a lot to discard
   108774 #   - (1 + 2 * *): some to pop and discard
   108775 #
   108776 # - test the action associated to `error'
   108777 #
   108778 # - check the lookahead that triggers an error is not discarded
   108779 #   when we enter error recovery.  Below, the lookahead causing the
   108780 #   first error is ")", which is needed to recover from the error and
   108781 #   produce the "0" that triggers the "0 != 1" error.
   108782 #
   108783 cat >input <<'_ATEOF'
   108784 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   108785 _ATEOF
   108786 
   108787 { set +x
   108788 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108789 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108790 ( $at_check_trace;  $PREPARSER ./calc input
   108791 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108792 at_status=$? at_failed=false
   108793 $at_check_filter
   108794 echo stderr:; tee stderr <"$at_stderr"
   108795 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108796 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108797 $at_failed && at_fn_log_failure
   108798 $at_traceon; }
   108799 
   108800 { set +x
   108801 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108802 at_fn_check_prepare_trace "calc.at:681"
   108803 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108805 at_status=$? at_failed=false
   108806 $at_check_filter
   108807 echo stderr:; tee stderr <"$at_stderr"
   108808 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108809 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108810 $at_failed && at_fn_log_failure
   108811 $at_traceon; }
   108812 
   108813 
   108814 
   108815 # Normalize the observed and expected error messages, depending upon the
   108816 # options.
   108817 # 1. Remove the traces from observed.
   108818 sed '/^Starting/d
   108819 /^Entering/d
   108820 /^Stack/d
   108821 /^Reading/d
   108822 /^Reducing/d
   108823 /^Return/d
   108824 /^Shifting/d
   108825 /^state/d
   108826 /^Cleanup:/d
   108827 /^Error:/d
   108828 /^Next/d
   108829 /^Now/d
   108830 /^Discarding/d
   108831 / \$[0-9$]* = /d
   108832 /^yydestructor:/d' stderr >at-stderr
   108833 mv at-stderr stderr
   108834 # 2. Create the reference error message.
   108835 cat >expout <<'_ATEOF'
   108836 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   108837 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   108838 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   108839 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   108840 calc: error: 4444 != 1
   108841 _ATEOF
   108842 
   108843 # 3. If locations are not used, remove them.
   108844 
   108845 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108846 
   108847 # 5. Check
   108848 { set +x
   108849 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108850 at_fn_check_prepare_trace "calc.at:681"
   108851 ( $at_check_trace; cat stderr
   108852 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108853 at_status=$? at_failed=false
   108854 $at_check_filter
   108855 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108856 $at_diff expout "$at_stdout" || at_failed=:
   108857 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108858 $at_failed && at_fn_log_failure
   108859 $at_traceon; }
   108860 
   108861 
   108862 
   108863 # The same, but this time exercising explicitly triggered syntax errors.
   108864 # POSIX says the lookahead causing the error should not be discarded.
   108865 cat >input <<'_ATEOF'
   108866 (!) + (1 2) = 1
   108867 _ATEOF
   108868 
   108869 { set +x
   108870 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108871 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108872 ( $at_check_trace;  $PREPARSER ./calc input
   108873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108874 at_status=$? at_failed=false
   108875 $at_check_filter
   108876 echo stderr:; tee stderr <"$at_stderr"
   108877 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108878 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108879 $at_failed && at_fn_log_failure
   108880 $at_traceon; }
   108881 
   108882 { set +x
   108883 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108884 at_fn_check_prepare_trace "calc.at:681"
   108885 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108886 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108887 at_status=$? at_failed=false
   108888 $at_check_filter
   108889 echo stderr:; tee stderr <"$at_stderr"
   108890 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108891 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108892 $at_failed && at_fn_log_failure
   108893 $at_traceon; }
   108894 
   108895 
   108896 
   108897 # Normalize the observed and expected error messages, depending upon the
   108898 # options.
   108899 # 1. Remove the traces from observed.
   108900 sed '/^Starting/d
   108901 /^Entering/d
   108902 /^Stack/d
   108903 /^Reading/d
   108904 /^Reducing/d
   108905 /^Return/d
   108906 /^Shifting/d
   108907 /^state/d
   108908 /^Cleanup:/d
   108909 /^Error:/d
   108910 /^Next/d
   108911 /^Now/d
   108912 /^Discarding/d
   108913 / \$[0-9$]* = /d
   108914 /^yydestructor:/d' stderr >at-stderr
   108915 mv at-stderr stderr
   108916 # 2. Create the reference error message.
   108917 cat >expout <<'_ATEOF'
   108918 1.10: syntax error, unexpected number
   108919 calc: error: 2222 != 1
   108920 _ATEOF
   108921 
   108922 # 3. If locations are not used, remove them.
   108923 
   108924 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   108925 
   108926 # 5. Check
   108927 { set +x
   108928 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   108929 at_fn_check_prepare_trace "calc.at:681"
   108930 ( $at_check_trace; cat stderr
   108931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108932 at_status=$? at_failed=false
   108933 $at_check_filter
   108934 at_fn_diff_devnull "$at_stderr" || at_failed=:
   108935 $at_diff expout "$at_stdout" || at_failed=:
   108936 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108937 $at_failed && at_fn_log_failure
   108938 $at_traceon; }
   108939 
   108940 
   108941 cat >input <<'_ATEOF'
   108942 (- *) + (1 2) = 1
   108943 _ATEOF
   108944 
   108945 { set +x
   108946 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   108947 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   108948 ( $at_check_trace;  $PREPARSER ./calc input
   108949 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108950 at_status=$? at_failed=false
   108951 $at_check_filter
   108952 echo stderr:; tee stderr <"$at_stderr"
   108953 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108954 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108955 $at_failed && at_fn_log_failure
   108956 $at_traceon; }
   108957 
   108958 { set +x
   108959 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   108960 at_fn_check_prepare_trace "calc.at:681"
   108961 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   108962 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   108963 at_status=$? at_failed=false
   108964 $at_check_filter
   108965 echo stderr:; tee stderr <"$at_stderr"
   108966 at_fn_diff_devnull "$at_stdout" || at_failed=:
   108967 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   108968 $at_failed && at_fn_log_failure
   108969 $at_traceon; }
   108970 
   108971 
   108972 
   108973 # Normalize the observed and expected error messages, depending upon the
   108974 # options.
   108975 # 1. Remove the traces from observed.
   108976 sed '/^Starting/d
   108977 /^Entering/d
   108978 /^Stack/d
   108979 /^Reading/d
   108980 /^Reducing/d
   108981 /^Return/d
   108982 /^Shifting/d
   108983 /^state/d
   108984 /^Cleanup:/d
   108985 /^Error:/d
   108986 /^Next/d
   108987 /^Now/d
   108988 /^Discarding/d
   108989 / \$[0-9$]* = /d
   108990 /^yydestructor:/d' stderr >at-stderr
   108991 mv at-stderr stderr
   108992 # 2. Create the reference error message.
   108993 cat >expout <<'_ATEOF'
   108994 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   108995 1.12: syntax error, unexpected number
   108996 calc: error: 2222 != 1
   108997 _ATEOF
   108998 
   108999 # 3. If locations are not used, remove them.
   109000 
   109001 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   109002 
   109003 # 5. Check
   109004 { set +x
   109005 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   109006 at_fn_check_prepare_trace "calc.at:681"
   109007 ( $at_check_trace; cat stderr
   109008 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109009 at_status=$? at_failed=false
   109010 $at_check_filter
   109011 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109012 $at_diff expout "$at_stdout" || at_failed=:
   109013 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   109014 $at_failed && at_fn_log_failure
   109015 $at_traceon; }
   109016 
   109017 
   109018 
   109019 # Check that yyerrok works properly: second error is not reported,
   109020 # third and fourth are.  Parse status is succesfull.
   109021 cat >input <<'_ATEOF'
   109022 (* *) + (*) + (*)
   109023 _ATEOF
   109024 
   109025 { set +x
   109026 $as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
   109027 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
   109028 ( $at_check_trace;  $PREPARSER ./calc input
   109029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109030 at_status=$? at_failed=false
   109031 $at_check_filter
   109032 echo stderr:; tee stderr <"$at_stderr"
   109033 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109034 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   109035 $at_failed && at_fn_log_failure
   109036 $at_traceon; }
   109037 
   109038 { set +x
   109039 $as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109040 at_fn_check_prepare_trace "calc.at:681"
   109041 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109042 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109043 at_status=$? at_failed=false
   109044 $at_check_filter
   109045 echo stderr:; tee stderr <"$at_stderr"
   109046 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109047 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   109048 $at_failed && at_fn_log_failure
   109049 $at_traceon; }
   109050 
   109051 
   109052 
   109053 # Normalize the observed and expected error messages, depending upon the
   109054 # options.
   109055 # 1. Remove the traces from observed.
   109056 sed '/^Starting/d
   109057 /^Entering/d
   109058 /^Stack/d
   109059 /^Reading/d
   109060 /^Reducing/d
   109061 /^Return/d
   109062 /^Shifting/d
   109063 /^state/d
   109064 /^Cleanup:/d
   109065 /^Error:/d
   109066 /^Next/d
   109067 /^Now/d
   109068 /^Discarding/d
   109069 / \$[0-9$]* = /d
   109070 /^yydestructor:/d' stderr >at-stderr
   109071 mv at-stderr stderr
   109072 # 2. Create the reference error message.
   109073 cat >expout <<'_ATEOF'
   109074 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   109075 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   109076 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   109077 _ATEOF
   109078 
   109079 # 3. If locations are not used, remove them.
   109080 
   109081 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   109082 
   109083 # 5. Check
   109084 { set +x
   109085 $as_echo "$at_srcdir/calc.at:681: cat stderr"
   109086 at_fn_check_prepare_trace "calc.at:681"
   109087 ( $at_check_trace; cat stderr
   109088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109089 at_status=$? at_failed=false
   109090 $at_check_filter
   109091 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109092 $at_diff expout "$at_stdout" || at_failed=:
   109093 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
   109094 $at_failed && at_fn_log_failure
   109095 $at_traceon; }
   109096 
   109097 
   109098 
   109099 
   109100 
   109101   set +x
   109102   $at_times_p && times >"$at_times_file"
   109103 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   109104 read at_status <"$at_status_file"
   109105 #AT_STOP_238
   109106 #AT_START_239
   109107 at_fn_group_banner 239 'calc.at:682' \
   109108   "Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 13
   109109 at_xfail=no
   109110 (
   109111   $as_echo "239. $at_setup_line: testing $at_desc ..."
   109112   $at_traceon
   109113 
   109114 
   109115 
   109116 
   109117 
   109118 
   109119 
   109120 
   109121 
   109122 
   109123 cat >calc.y <<'_ATEOF'
   109124 %code top {
   109125 #include <config.h>
   109126 /* We don't need perfect functions for these tests. */
   109127 #undef malloc
   109128 #undef memcmp
   109129 #undef realloc
   109130 }
   109131 
   109132 /* Infix notation calculator--calc */
   109133 %language "C++" %defines %locations %error-verbose %define api.prefix "calc" %verbose %yacc
   109134 %define global_tokens_and_yystype
   109135 %code requires
   109136 {
   109137 
   109138   /* Exercise pre-prologue dependency to %union.  */
   109139   typedef int semantic_value;
   109140 }
   109141 
   109142 /* Exercise %union. */
   109143 %union
   109144 {
   109145   semantic_value ival;
   109146 };
   109147 %printer { yyoutput << $$; } <ival>;
   109148 
   109149 %code provides
   109150 {
   109151   #include <stdio.h>
   109152   /* The input.  */
   109153   extern FILE *input;
   109154   extern semantic_value global_result;
   109155   extern int global_count;
   109156 }
   109157 
   109158 %code
   109159 {
   109160 #include <assert.h>
   109161 #include <string.h>
   109162 #define USE(Var)
   109163 
   109164 FILE *input;
   109165 static int power (int base, int exponent);
   109166 
   109167 
   109168 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   109169 }
   109170 
   109171 
   109172 
   109173 /* Bison Declarations */
   109174 %token CALC_EOF 0 "end of input"
   109175 %token <ival> NUM "number"
   109176 %type  <ival> exp
   109177 
   109178 %nonassoc '=' /* comparison            */
   109179 %left '-' '+'
   109180 %left '*' '/'
   109181 %left NEG     /* negation--unary minus */
   109182 %right '^'    /* exponentiation        */
   109183 
   109184 /* Grammar follows */
   109185 %%
   109186 input:
   109187   line
   109188 | input line         {  }
   109189 ;
   109190 
   109191 line:
   109192   '\n'
   109193 | exp '\n'           { USE ($1); }
   109194 ;
   109195 
   109196 exp:
   109197   NUM                { $$ = $1;             }
   109198 | exp '=' exp
   109199   {
   109200     if ($1 != $3)
   109201       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   109202     $$ = $1;
   109203   }
   109204 | exp '+' exp        { $$ = $1 + $3;        }
   109205 | exp '-' exp        { $$ = $1 - $3;        }
   109206 | exp '*' exp        { $$ = $1 * $3;        }
   109207 | exp '/' exp        { $$ = $1 / $3;        }
   109208 | '-' exp  %prec NEG { $$ = -$2;            }
   109209 | exp '^' exp        { $$ = power ($1, $3); }
   109210 | '(' exp ')'        { $$ = $2;             }
   109211 | '(' error ')'      { $$ = 1111; yyerrok;  }
   109212 | '!'                { $$ = 0; YYERROR;     }
   109213 | '-' error          { $$ = 0; YYERROR;     }
   109214 ;
   109215 %%
   109216 
   109217 static int
   109218 power (int base, int exponent)
   109219 {
   109220   int res = 1;
   109221   assert (0 <= exponent);
   109222   for (/* Niente */; exponent; --exponent)
   109223     res *= base;
   109224   return res;
   109225 }
   109226 
   109227 
   109228 /* A C++ error reporting function.  */
   109229 void
   109230 calc::parser::error (const location_type& l, const std::string& m)
   109231 {
   109232   (void) l;
   109233   std::cerr << l << ": " << m << std::endl;
   109234 }
   109235 _ATEOF
   109236 
   109237 
   109238 
   109239 cat >calc-lex.cc <<'_ATEOF'
   109240 #include <config.h>
   109241 /* We don't need perfect functions for these tests. */
   109242 #undef malloc
   109243 #undef memcmp
   109244 #undef realloc
   109245 
   109246 #include "calc.hh"
   109247 
   109248 #include <ctype.h>
   109249 
   109250 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   109251 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   109252 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   109253 
   109254 
   109255 static calc::parser::location_type last_yylloc;
   109256 
   109257 static int
   109258 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   109259 {
   109260   int res = getc (input);
   109261   (void) lvalp;(void) llocp;
   109262 
   109263   last_yylloc = (*llocp);
   109264   if (res == '\n')
   109265     {
   109266       (*llocp).end.line++;
   109267       (*llocp).end.column = 1;
   109268     }
   109269   else
   109270     (*llocp).end.column++;
   109271 
   109272   return res;
   109273 }
   109274 
   109275 static void
   109276 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   109277 {
   109278   (void) lvalp;(void) llocp;
   109279 
   109280   /* Wrong when C == `\n'. */
   109281   (*llocp) = last_yylloc;
   109282 
   109283   ungetc (c, input);
   109284 }
   109285 
   109286 static int
   109287 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   109288 {
   109289   int c = get_char (lvalp, llocp);
   109290   int sign = 1;
   109291   int n = 0;
   109292 
   109293   (void) lvalp;(void) llocp;
   109294   if (c == '-')
   109295     {
   109296       c = get_char (lvalp, llocp);
   109297       sign = -1;
   109298     }
   109299 
   109300   while (isdigit (c))
   109301     {
   109302       n = 10 * n + (c - '0');
   109303       c = get_char (lvalp, llocp);
   109304     }
   109305 
   109306   unget_char (lvalp, llocp,  c);
   109307 
   109308   return sign * n;
   109309 }
   109310 
   109311 
   109312 /*---------------------------------------------------------------.
   109313 | Lexical analyzer returns an integer on the stack and the token |
   109314 | NUM, or the ASCII character read if not a number.  Skips all   |
   109315 | blanks and tabs, returns 0 for EOF.                            |
   109316 `---------------------------------------------------------------*/
   109317 
   109318 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   109319 {
   109320   int c;
   109321   /* Skip current token, then white spaces.  */
   109322   do
   109323     {
   109324      (*llocp).begin.column = (*llocp).end.column;
   109325       (*llocp).begin.line   = (*llocp).end.line;
   109326 
   109327     }
   109328   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   109329 
   109330   /* process numbers   */
   109331   if (c == '.' || isdigit (c))
   109332     {
   109333       unget_char (lvalp, llocp,  c);
   109334       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   109335       return NUM;
   109336     }
   109337 
   109338   /* Return end-of-file.  */
   109339   if (c == EOF)
   109340     return CALC_EOF;
   109341 
   109342   /* Return single chars. */
   109343   return c;
   109344 }
   109345 _ATEOF
   109346 
   109347 
   109348 cat >calc-main.cc <<'_ATEOF'
   109349 #include <config.h>
   109350 /* We don't need perfect functions for these tests. */
   109351 #undef malloc
   109352 #undef memcmp
   109353 #undef realloc
   109354 
   109355 #include "calc.hh"
   109356 
   109357 #include <assert.h>
   109358 #if HAVE_UNISTD_H
   109359 # include <unistd.h>
   109360 #else
   109361 # undef alarm
   109362 # define alarm(seconds) /* empty */
   109363 #endif
   109364 
   109365 
   109366 /* A C++ calcparse that simulates the C signature.  */
   109367 int
   109368 calcparse ()
   109369 {
   109370   calc::parser parser;
   109371 #if CALCDEBUG
   109372   parser.set_debug_level (1);
   109373 #endif
   109374   return parser.parse ();
   109375 }
   109376 
   109377 
   109378 semantic_value global_result = 0;
   109379 int global_count = 0;
   109380 
   109381 /* A C main function.  */
   109382 int
   109383 main (int argc, const char **argv)
   109384 {
   109385   semantic_value result = 0;
   109386   int count = 0;
   109387   int status;
   109388 
   109389   /* This used to be alarm (10), but that isn't enough time for
   109390      a July 1995 vintage DEC Alphastation 200 4/100 system,
   109391      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   109392   alarm (100);
   109393 
   109394   if (argc == 2)
   109395     input = fopen (argv[1], "r");
   109396   else
   109397     input = stdin;
   109398 
   109399   if (!input)
   109400     {
   109401       perror (argv[1]);
   109402       return 3;
   109403     }
   109404 
   109405 
   109406   status = calcparse ();
   109407   if (fclose (input))
   109408     perror ("fclose");
   109409   assert (global_result == result);
   109410   assert (global_count == count);
   109411   return status;
   109412 }
   109413 _ATEOF
   109414 
   109415 
   109416 
   109417 
   109418 
   109419 
   109420 
   109421 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   109422   at_save_special_files
   109423   mkdir xml-tests
   109424     # Don't combine these Bison invocations since we want to be sure that
   109425   # --report=all isn't required to get the full XML file.
   109426   { set +x
   109427 $as_echo "$at_srcdir/calc.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   109428                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   109429 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682"
   109430 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   109431                   --graph=xml-tests/test.dot -o calc.cc calc.y
   109432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109433 at_status=$? at_failed=false
   109434 $at_check_filter
   109435 echo stderr:; cat "$at_stderr"
   109436 echo stdout:; cat "$at_stdout"
   109437 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109438 $at_failed && at_fn_log_failure
   109439 $at_traceon; }
   109440 
   109441   { set +x
   109442 $as_echo "$at_srcdir/calc.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   109443 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:682"
   109444 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   109445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109446 at_status=$? at_failed=false
   109447 $at_check_filter
   109448 echo stderr:; cat "$at_stderr"
   109449 echo stdout:; cat "$at_stdout"
   109450 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109451 $at_failed && at_fn_log_failure
   109452 $at_traceon; }
   109453 
   109454     cp xml-tests/test.output expout
   109455   { set +x
   109456 $as_echo "$at_srcdir/calc.at:682: \$XSLTPROC \\
   109457              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   109458              xml-tests/test.xml"
   109459 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:682"
   109460 ( $at_check_trace; $XSLTPROC \
   109461              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   109462              xml-tests/test.xml
   109463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109464 at_status=$? at_failed=false
   109465 $at_check_filter
   109466 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109467 $at_diff expout "$at_stdout" || at_failed=:
   109468 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109469 $at_failed && at_fn_log_failure
   109470 $at_traceon; }
   109471 
   109472   sort xml-tests/test.dot > expout
   109473   { set +x
   109474 $as_echo "$at_srcdir/calc.at:682: \$XSLTPROC \\
   109475              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   109476              xml-tests/test.xml | sort"
   109477 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:682"
   109478 ( $at_check_trace; $XSLTPROC \
   109479              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   109480              xml-tests/test.xml | sort
   109481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109482 at_status=$? at_failed=false
   109483 $at_check_filter
   109484 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109485 $at_diff expout "$at_stdout" || at_failed=:
   109486 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109487 $at_failed && at_fn_log_failure
   109488 $at_traceon; }
   109489 
   109490   rm -rf xml-tests expout
   109491   at_restore_special_files
   109492 fi
   109493 { set +x
   109494 $as_echo "$at_srcdir/calc.at:682: bison -o calc.cc calc.y"
   109495 at_fn_check_prepare_trace "calc.at:682"
   109496 ( $at_check_trace; bison -o calc.cc calc.y
   109497 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109498 at_status=$? at_failed=false
   109499 $at_check_filter
   109500 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109501 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109502 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109503 $at_failed && at_fn_log_failure
   109504 $at_traceon; }
   109505 
   109506 
   109507 
   109508 { set +x
   109509 $as_echo "$at_srcdir/calc.at:682: \$BISON_CXX_WORKS"
   109510 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:682"
   109511 ( $at_check_trace; $BISON_CXX_WORKS
   109512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109513 at_status=$? at_failed=false
   109514 $at_check_filter
   109515 echo stderr:; cat "$at_stderr"
   109516 echo stdout:; cat "$at_stdout"
   109517 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109518 $at_failed && at_fn_log_failure
   109519 $at_traceon; }
   109520 
   109521 { set +x
   109522 $as_echo "$at_srcdir/calc.at:682: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   109523 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:682"
   109524 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   109525 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109526 at_status=$? at_failed=false
   109527 $at_check_filter
   109528 echo stderr:; cat "$at_stderr"
   109529 echo stdout:; cat "$at_stdout"
   109530 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109531 $at_failed && at_fn_log_failure
   109532 $at_traceon; }
   109533 
   109534 
   109535 { set +x
   109536 $as_echo "$at_srcdir/calc.at:682: \$PERL -ne '
   109537   chomp;
   109538   print \"\$.: {\$_}\\n\"
   109539     if (# No starting/ending empty lines.
   109540         (eof || \$. == 1) && /^\\s*\$/
   109541         # No trailing space.  FIXME: not ready for \"maint\".
   109542         # || /\\s\$/
   109543         )' calc.cc
   109544 "
   109545 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682"
   109546 ( $at_check_trace; $PERL -ne '
   109547   chomp;
   109548   print "$.: {$_}\n"
   109549     if (# No starting/ending empty lines.
   109550         (eof || $. == 1) && /^\s*$/
   109551         # No trailing space.  FIXME: not ready for "maint".
   109552         # || /\s$/
   109553         )' calc.cc
   109554 
   109555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109556 at_status=$? at_failed=false
   109557 $at_check_filter
   109558 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109559 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109560 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109561 $at_failed && at_fn_log_failure
   109562 $at_traceon; }
   109563 
   109564 { set +x
   109565 $as_echo "$at_srcdir/calc.at:682: \$PERL -ne '
   109566   chomp;
   109567   print \"\$.: {\$_}\\n\"
   109568     if (# No starting/ending empty lines.
   109569         (eof || \$. == 1) && /^\\s*\$/
   109570         # No trailing space.  FIXME: not ready for \"maint\".
   109571         # || /\\s\$/
   109572         )' calc.hh
   109573 "
   109574 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682"
   109575 ( $at_check_trace; $PERL -ne '
   109576   chomp;
   109577   print "$.: {$_}\n"
   109578     if (# No starting/ending empty lines.
   109579         (eof || $. == 1) && /^\s*$/
   109580         # No trailing space.  FIXME: not ready for "maint".
   109581         # || /\s$/
   109582         )' calc.hh
   109583 
   109584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109585 at_status=$? at_failed=false
   109586 $at_check_filter
   109587 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109588 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109589 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109590 $at_failed && at_fn_log_failure
   109591 $at_traceon; }
   109592 
   109593 
   109594 # Test the priorities.
   109595 cat >input <<'_ATEOF'
   109596 1 + 2 * 3 = 7
   109597 1 + 2 * -3 = -5
   109598 
   109599 -1^2 = -1
   109600 (-1)^2 = 1
   109601 
   109602 ---1 = -1
   109603 
   109604 1 - 2 - 3 = -4
   109605 1 - (2 - 3) = 2
   109606 
   109607 2^2^3 = 256
   109608 (2^2)^3 = 64
   109609 _ATEOF
   109610 
   109611 { set +x
   109612 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   109613 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   109614 ( $at_check_trace;  $PREPARSER ./calc input
   109615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109616 at_status=$? at_failed=false
   109617 $at_check_filter
   109618 echo stderr:; tee stderr <"$at_stderr"
   109619 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109620 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109621 $at_failed && at_fn_log_failure
   109622 $at_traceon; }
   109623 
   109624 { set +x
   109625 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109626 at_fn_check_prepare_trace "calc.at:682"
   109627 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109628 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109629 at_status=$? at_failed=false
   109630 $at_check_filter
   109631 echo stderr:; tee stderr <"$at_stderr"
   109632 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109633 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109634 $at_failed && at_fn_log_failure
   109635 $at_traceon; }
   109636 
   109637 
   109638 
   109639 
   109640 # Some syntax errors.
   109641 cat >input <<'_ATEOF'
   109642 1 2
   109643 _ATEOF
   109644 
   109645 { set +x
   109646 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   109647 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   109648 ( $at_check_trace;  $PREPARSER ./calc input
   109649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109650 at_status=$? at_failed=false
   109651 $at_check_filter
   109652 echo stderr:; tee stderr <"$at_stderr"
   109653 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109654 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682"
   109655 $at_failed && at_fn_log_failure
   109656 $at_traceon; }
   109657 
   109658 { set +x
   109659 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109660 at_fn_check_prepare_trace "calc.at:682"
   109661 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109662 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109663 at_status=$? at_failed=false
   109664 $at_check_filter
   109665 echo stderr:; tee stderr <"$at_stderr"
   109666 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109667 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109668 $at_failed && at_fn_log_failure
   109669 $at_traceon; }
   109670 
   109671 
   109672 
   109673 # Normalize the observed and expected error messages, depending upon the
   109674 # options.
   109675 # 1. Remove the traces from observed.
   109676 sed '/^Starting/d
   109677 /^Entering/d
   109678 /^Stack/d
   109679 /^Reading/d
   109680 /^Reducing/d
   109681 /^Return/d
   109682 /^Shifting/d
   109683 /^state/d
   109684 /^Cleanup:/d
   109685 /^Error:/d
   109686 /^Next/d
   109687 /^Now/d
   109688 /^Discarding/d
   109689 / \$[0-9$]* = /d
   109690 /^yydestructor:/d' stderr >at-stderr
   109691 mv at-stderr stderr
   109692 # 2. Create the reference error message.
   109693 cat >expout <<'_ATEOF'
   109694 1.3: syntax error, unexpected number
   109695 _ATEOF
   109696 
   109697 # 3. If locations are not used, remove them.
   109698 
   109699 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   109700 
   109701 # 5. Check
   109702 { set +x
   109703 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   109704 at_fn_check_prepare_trace "calc.at:682"
   109705 ( $at_check_trace; cat stderr
   109706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109707 at_status=$? at_failed=false
   109708 $at_check_filter
   109709 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109710 $at_diff expout "$at_stdout" || at_failed=:
   109711 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109712 $at_failed && at_fn_log_failure
   109713 $at_traceon; }
   109714 
   109715 
   109716 cat >input <<'_ATEOF'
   109717 1//2
   109718 _ATEOF
   109719 
   109720 { set +x
   109721 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   109722 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   109723 ( $at_check_trace;  $PREPARSER ./calc input
   109724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109725 at_status=$? at_failed=false
   109726 $at_check_filter
   109727 echo stderr:; tee stderr <"$at_stderr"
   109728 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109729 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682"
   109730 $at_failed && at_fn_log_failure
   109731 $at_traceon; }
   109732 
   109733 { set +x
   109734 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109735 at_fn_check_prepare_trace "calc.at:682"
   109736 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109737 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109738 at_status=$? at_failed=false
   109739 $at_check_filter
   109740 echo stderr:; tee stderr <"$at_stderr"
   109741 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109742 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109743 $at_failed && at_fn_log_failure
   109744 $at_traceon; }
   109745 
   109746 
   109747 
   109748 # Normalize the observed and expected error messages, depending upon the
   109749 # options.
   109750 # 1. Remove the traces from observed.
   109751 sed '/^Starting/d
   109752 /^Entering/d
   109753 /^Stack/d
   109754 /^Reading/d
   109755 /^Reducing/d
   109756 /^Return/d
   109757 /^Shifting/d
   109758 /^state/d
   109759 /^Cleanup:/d
   109760 /^Error:/d
   109761 /^Next/d
   109762 /^Now/d
   109763 /^Discarding/d
   109764 / \$[0-9$]* = /d
   109765 /^yydestructor:/d' stderr >at-stderr
   109766 mv at-stderr stderr
   109767 # 2. Create the reference error message.
   109768 cat >expout <<'_ATEOF'
   109769 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   109770 _ATEOF
   109771 
   109772 # 3. If locations are not used, remove them.
   109773 
   109774 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   109775 
   109776 # 5. Check
   109777 { set +x
   109778 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   109779 at_fn_check_prepare_trace "calc.at:682"
   109780 ( $at_check_trace; cat stderr
   109781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109782 at_status=$? at_failed=false
   109783 $at_check_filter
   109784 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109785 $at_diff expout "$at_stdout" || at_failed=:
   109786 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109787 $at_failed && at_fn_log_failure
   109788 $at_traceon; }
   109789 
   109790 
   109791 cat >input <<'_ATEOF'
   109792 error
   109793 _ATEOF
   109794 
   109795 { set +x
   109796 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   109797 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   109798 ( $at_check_trace;  $PREPARSER ./calc input
   109799 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109800 at_status=$? at_failed=false
   109801 $at_check_filter
   109802 echo stderr:; tee stderr <"$at_stderr"
   109803 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109804 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682"
   109805 $at_failed && at_fn_log_failure
   109806 $at_traceon; }
   109807 
   109808 { set +x
   109809 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109810 at_fn_check_prepare_trace "calc.at:682"
   109811 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109813 at_status=$? at_failed=false
   109814 $at_check_filter
   109815 echo stderr:; tee stderr <"$at_stderr"
   109816 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109817 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109818 $at_failed && at_fn_log_failure
   109819 $at_traceon; }
   109820 
   109821 
   109822 
   109823 # Normalize the observed and expected error messages, depending upon the
   109824 # options.
   109825 # 1. Remove the traces from observed.
   109826 sed '/^Starting/d
   109827 /^Entering/d
   109828 /^Stack/d
   109829 /^Reading/d
   109830 /^Reducing/d
   109831 /^Return/d
   109832 /^Shifting/d
   109833 /^state/d
   109834 /^Cleanup:/d
   109835 /^Error:/d
   109836 /^Next/d
   109837 /^Now/d
   109838 /^Discarding/d
   109839 / \$[0-9$]* = /d
   109840 /^yydestructor:/d' stderr >at-stderr
   109841 mv at-stderr stderr
   109842 # 2. Create the reference error message.
   109843 cat >expout <<'_ATEOF'
   109844 1.1: syntax error, unexpected $undefined
   109845 _ATEOF
   109846 
   109847 # 3. If locations are not used, remove them.
   109848 
   109849 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   109850 
   109851 # 5. Check
   109852 { set +x
   109853 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   109854 at_fn_check_prepare_trace "calc.at:682"
   109855 ( $at_check_trace; cat stderr
   109856 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109857 at_status=$? at_failed=false
   109858 $at_check_filter
   109859 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109860 $at_diff expout "$at_stdout" || at_failed=:
   109861 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109862 $at_failed && at_fn_log_failure
   109863 $at_traceon; }
   109864 
   109865 
   109866 cat >input <<'_ATEOF'
   109867 1 = 2 = 3
   109868 _ATEOF
   109869 
   109870 { set +x
   109871 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   109872 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   109873 ( $at_check_trace;  $PREPARSER ./calc input
   109874 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109875 at_status=$? at_failed=false
   109876 $at_check_filter
   109877 echo stderr:; tee stderr <"$at_stderr"
   109878 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109879 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682"
   109880 $at_failed && at_fn_log_failure
   109881 $at_traceon; }
   109882 
   109883 { set +x
   109884 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109885 at_fn_check_prepare_trace "calc.at:682"
   109886 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109887 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109888 at_status=$? at_failed=false
   109889 $at_check_filter
   109890 echo stderr:; tee stderr <"$at_stderr"
   109891 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109892 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109893 $at_failed && at_fn_log_failure
   109894 $at_traceon; }
   109895 
   109896 
   109897 
   109898 # Normalize the observed and expected error messages, depending upon the
   109899 # options.
   109900 # 1. Remove the traces from observed.
   109901 sed '/^Starting/d
   109902 /^Entering/d
   109903 /^Stack/d
   109904 /^Reading/d
   109905 /^Reducing/d
   109906 /^Return/d
   109907 /^Shifting/d
   109908 /^state/d
   109909 /^Cleanup:/d
   109910 /^Error:/d
   109911 /^Next/d
   109912 /^Now/d
   109913 /^Discarding/d
   109914 / \$[0-9$]* = /d
   109915 /^yydestructor:/d' stderr >at-stderr
   109916 mv at-stderr stderr
   109917 # 2. Create the reference error message.
   109918 cat >expout <<'_ATEOF'
   109919 1.7: syntax error, unexpected '='
   109920 _ATEOF
   109921 
   109922 # 3. If locations are not used, remove them.
   109923 
   109924 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   109925 
   109926 # 5. Check
   109927 { set +x
   109928 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   109929 at_fn_check_prepare_trace "calc.at:682"
   109930 ( $at_check_trace; cat stderr
   109931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109932 at_status=$? at_failed=false
   109933 $at_check_filter
   109934 at_fn_diff_devnull "$at_stderr" || at_failed=:
   109935 $at_diff expout "$at_stdout" || at_failed=:
   109936 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109937 $at_failed && at_fn_log_failure
   109938 $at_traceon; }
   109939 
   109940 
   109941 cat >input <<'_ATEOF'
   109942 
   109943 +1
   109944 _ATEOF
   109945 
   109946 { set +x
   109947 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   109948 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   109949 ( $at_check_trace;  $PREPARSER ./calc input
   109950 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109951 at_status=$? at_failed=false
   109952 $at_check_filter
   109953 echo stderr:; tee stderr <"$at_stderr"
   109954 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109955 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682"
   109956 $at_failed && at_fn_log_failure
   109957 $at_traceon; }
   109958 
   109959 { set +x
   109960 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   109961 at_fn_check_prepare_trace "calc.at:682"
   109962 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   109963 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   109964 at_status=$? at_failed=false
   109965 $at_check_filter
   109966 echo stderr:; tee stderr <"$at_stderr"
   109967 at_fn_diff_devnull "$at_stdout" || at_failed=:
   109968 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   109969 $at_failed && at_fn_log_failure
   109970 $at_traceon; }
   109971 
   109972 
   109973 
   109974 # Normalize the observed and expected error messages, depending upon the
   109975 # options.
   109976 # 1. Remove the traces from observed.
   109977 sed '/^Starting/d
   109978 /^Entering/d
   109979 /^Stack/d
   109980 /^Reading/d
   109981 /^Reducing/d
   109982 /^Return/d
   109983 /^Shifting/d
   109984 /^state/d
   109985 /^Cleanup:/d
   109986 /^Error:/d
   109987 /^Next/d
   109988 /^Now/d
   109989 /^Discarding/d
   109990 / \$[0-9$]* = /d
   109991 /^yydestructor:/d' stderr >at-stderr
   109992 mv at-stderr stderr
   109993 # 2. Create the reference error message.
   109994 cat >expout <<'_ATEOF'
   109995 2.1: syntax error, unexpected '+'
   109996 _ATEOF
   109997 
   109998 # 3. If locations are not used, remove them.
   109999 
   110000 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   110001 
   110002 # 5. Check
   110003 { set +x
   110004 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   110005 at_fn_check_prepare_trace "calc.at:682"
   110006 ( $at_check_trace; cat stderr
   110007 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110008 at_status=$? at_failed=false
   110009 $at_check_filter
   110010 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110011 $at_diff expout "$at_stdout" || at_failed=:
   110012 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110013 $at_failed && at_fn_log_failure
   110014 $at_traceon; }
   110015 
   110016 
   110017 # Exercise error messages with EOF: work on an empty file.
   110018 { set +x
   110019 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc /dev/null"
   110020 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:682"
   110021 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   110022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110023 at_status=$? at_failed=false
   110024 $at_check_filter
   110025 echo stderr:; tee stderr <"$at_stderr"
   110026 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110027 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682"
   110028 $at_failed && at_fn_log_failure
   110029 $at_traceon; }
   110030 
   110031 { set +x
   110032 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110033 at_fn_check_prepare_trace "calc.at:682"
   110034 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110036 at_status=$? at_failed=false
   110037 $at_check_filter
   110038 echo stderr:; tee stderr <"$at_stderr"
   110039 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110040 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110041 $at_failed && at_fn_log_failure
   110042 $at_traceon; }
   110043 
   110044 
   110045 
   110046 # Normalize the observed and expected error messages, depending upon the
   110047 # options.
   110048 # 1. Remove the traces from observed.
   110049 sed '/^Starting/d
   110050 /^Entering/d
   110051 /^Stack/d
   110052 /^Reading/d
   110053 /^Reducing/d
   110054 /^Return/d
   110055 /^Shifting/d
   110056 /^state/d
   110057 /^Cleanup:/d
   110058 /^Error:/d
   110059 /^Next/d
   110060 /^Now/d
   110061 /^Discarding/d
   110062 / \$[0-9$]* = /d
   110063 /^yydestructor:/d' stderr >at-stderr
   110064 mv at-stderr stderr
   110065 # 2. Create the reference error message.
   110066 cat >expout <<'_ATEOF'
   110067 1.1: syntax error, unexpected end of input
   110068 _ATEOF
   110069 
   110070 # 3. If locations are not used, remove them.
   110071 
   110072 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   110073 
   110074 # 5. Check
   110075 { set +x
   110076 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   110077 at_fn_check_prepare_trace "calc.at:682"
   110078 ( $at_check_trace; cat stderr
   110079 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110080 at_status=$? at_failed=false
   110081 $at_check_filter
   110082 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110083 $at_diff expout "$at_stdout" || at_failed=:
   110084 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110085 $at_failed && at_fn_log_failure
   110086 $at_traceon; }
   110087 
   110088 
   110089 
   110090 # Exercise the error token: without it, we die at the first error,
   110091 # hence be sure to
   110092 #
   110093 # - have several errors which exercise different shift/discardings
   110094 #   - (): nothing to pop, nothing to discard
   110095 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   110096 #   - (* * *): nothing to pop, a lot to discard
   110097 #   - (1 + 2 * *): some to pop and discard
   110098 #
   110099 # - test the action associated to `error'
   110100 #
   110101 # - check the lookahead that triggers an error is not discarded
   110102 #   when we enter error recovery.  Below, the lookahead causing the
   110103 #   first error is ")", which is needed to recover from the error and
   110104 #   produce the "0" that triggers the "0 != 1" error.
   110105 #
   110106 cat >input <<'_ATEOF'
   110107 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   110108 _ATEOF
   110109 
   110110 { set +x
   110111 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   110112 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   110113 ( $at_check_trace;  $PREPARSER ./calc input
   110114 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110115 at_status=$? at_failed=false
   110116 $at_check_filter
   110117 echo stderr:; tee stderr <"$at_stderr"
   110118 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110119 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110120 $at_failed && at_fn_log_failure
   110121 $at_traceon; }
   110122 
   110123 { set +x
   110124 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110125 at_fn_check_prepare_trace "calc.at:682"
   110126 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110127 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110128 at_status=$? at_failed=false
   110129 $at_check_filter
   110130 echo stderr:; tee stderr <"$at_stderr"
   110131 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110132 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110133 $at_failed && at_fn_log_failure
   110134 $at_traceon; }
   110135 
   110136 
   110137 
   110138 # Normalize the observed and expected error messages, depending upon the
   110139 # options.
   110140 # 1. Remove the traces from observed.
   110141 sed '/^Starting/d
   110142 /^Entering/d
   110143 /^Stack/d
   110144 /^Reading/d
   110145 /^Reducing/d
   110146 /^Return/d
   110147 /^Shifting/d
   110148 /^state/d
   110149 /^Cleanup:/d
   110150 /^Error:/d
   110151 /^Next/d
   110152 /^Now/d
   110153 /^Discarding/d
   110154 / \$[0-9$]* = /d
   110155 /^yydestructor:/d' stderr >at-stderr
   110156 mv at-stderr stderr
   110157 # 2. Create the reference error message.
   110158 cat >expout <<'_ATEOF'
   110159 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   110160 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   110161 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   110162 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   110163 calc: error: 4444 != 1
   110164 _ATEOF
   110165 
   110166 # 3. If locations are not used, remove them.
   110167 
   110168 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   110169 
   110170 # 5. Check
   110171 { set +x
   110172 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   110173 at_fn_check_prepare_trace "calc.at:682"
   110174 ( $at_check_trace; cat stderr
   110175 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110176 at_status=$? at_failed=false
   110177 $at_check_filter
   110178 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110179 $at_diff expout "$at_stdout" || at_failed=:
   110180 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110181 $at_failed && at_fn_log_failure
   110182 $at_traceon; }
   110183 
   110184 
   110185 
   110186 # The same, but this time exercising explicitly triggered syntax errors.
   110187 # POSIX says the lookahead causing the error should not be discarded.
   110188 cat >input <<'_ATEOF'
   110189 (!) + (1 2) = 1
   110190 _ATEOF
   110191 
   110192 { set +x
   110193 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   110194 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   110195 ( $at_check_trace;  $PREPARSER ./calc input
   110196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110197 at_status=$? at_failed=false
   110198 $at_check_filter
   110199 echo stderr:; tee stderr <"$at_stderr"
   110200 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110201 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110202 $at_failed && at_fn_log_failure
   110203 $at_traceon; }
   110204 
   110205 { set +x
   110206 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110207 at_fn_check_prepare_trace "calc.at:682"
   110208 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110209 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110210 at_status=$? at_failed=false
   110211 $at_check_filter
   110212 echo stderr:; tee stderr <"$at_stderr"
   110213 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110214 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110215 $at_failed && at_fn_log_failure
   110216 $at_traceon; }
   110217 
   110218 
   110219 
   110220 # Normalize the observed and expected error messages, depending upon the
   110221 # options.
   110222 # 1. Remove the traces from observed.
   110223 sed '/^Starting/d
   110224 /^Entering/d
   110225 /^Stack/d
   110226 /^Reading/d
   110227 /^Reducing/d
   110228 /^Return/d
   110229 /^Shifting/d
   110230 /^state/d
   110231 /^Cleanup:/d
   110232 /^Error:/d
   110233 /^Next/d
   110234 /^Now/d
   110235 /^Discarding/d
   110236 / \$[0-9$]* = /d
   110237 /^yydestructor:/d' stderr >at-stderr
   110238 mv at-stderr stderr
   110239 # 2. Create the reference error message.
   110240 cat >expout <<'_ATEOF'
   110241 1.10: syntax error, unexpected number
   110242 calc: error: 2222 != 1
   110243 _ATEOF
   110244 
   110245 # 3. If locations are not used, remove them.
   110246 
   110247 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   110248 
   110249 # 5. Check
   110250 { set +x
   110251 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   110252 at_fn_check_prepare_trace "calc.at:682"
   110253 ( $at_check_trace; cat stderr
   110254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110255 at_status=$? at_failed=false
   110256 $at_check_filter
   110257 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110258 $at_diff expout "$at_stdout" || at_failed=:
   110259 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110260 $at_failed && at_fn_log_failure
   110261 $at_traceon; }
   110262 
   110263 
   110264 cat >input <<'_ATEOF'
   110265 (- *) + (1 2) = 1
   110266 _ATEOF
   110267 
   110268 { set +x
   110269 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   110270 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   110271 ( $at_check_trace;  $PREPARSER ./calc input
   110272 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110273 at_status=$? at_failed=false
   110274 $at_check_filter
   110275 echo stderr:; tee stderr <"$at_stderr"
   110276 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110277 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110278 $at_failed && at_fn_log_failure
   110279 $at_traceon; }
   110280 
   110281 { set +x
   110282 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110283 at_fn_check_prepare_trace "calc.at:682"
   110284 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110286 at_status=$? at_failed=false
   110287 $at_check_filter
   110288 echo stderr:; tee stderr <"$at_stderr"
   110289 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110290 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110291 $at_failed && at_fn_log_failure
   110292 $at_traceon; }
   110293 
   110294 
   110295 
   110296 # Normalize the observed and expected error messages, depending upon the
   110297 # options.
   110298 # 1. Remove the traces from observed.
   110299 sed '/^Starting/d
   110300 /^Entering/d
   110301 /^Stack/d
   110302 /^Reading/d
   110303 /^Reducing/d
   110304 /^Return/d
   110305 /^Shifting/d
   110306 /^state/d
   110307 /^Cleanup:/d
   110308 /^Error:/d
   110309 /^Next/d
   110310 /^Now/d
   110311 /^Discarding/d
   110312 / \$[0-9$]* = /d
   110313 /^yydestructor:/d' stderr >at-stderr
   110314 mv at-stderr stderr
   110315 # 2. Create the reference error message.
   110316 cat >expout <<'_ATEOF'
   110317 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   110318 1.12: syntax error, unexpected number
   110319 calc: error: 2222 != 1
   110320 _ATEOF
   110321 
   110322 # 3. If locations are not used, remove them.
   110323 
   110324 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   110325 
   110326 # 5. Check
   110327 { set +x
   110328 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   110329 at_fn_check_prepare_trace "calc.at:682"
   110330 ( $at_check_trace; cat stderr
   110331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110332 at_status=$? at_failed=false
   110333 $at_check_filter
   110334 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110335 $at_diff expout "$at_stdout" || at_failed=:
   110336 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110337 $at_failed && at_fn_log_failure
   110338 $at_traceon; }
   110339 
   110340 
   110341 
   110342 # Check that yyerrok works properly: second error is not reported,
   110343 # third and fourth are.  Parse status is succesfull.
   110344 cat >input <<'_ATEOF'
   110345 (* *) + (*) + (*)
   110346 _ATEOF
   110347 
   110348 { set +x
   110349 $as_echo "$at_srcdir/calc.at:682:  \$PREPARSER ./calc input"
   110350 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682"
   110351 ( $at_check_trace;  $PREPARSER ./calc input
   110352 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110353 at_status=$? at_failed=false
   110354 $at_check_filter
   110355 echo stderr:; tee stderr <"$at_stderr"
   110356 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110357 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110358 $at_failed && at_fn_log_failure
   110359 $at_traceon; }
   110360 
   110361 { set +x
   110362 $as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110363 at_fn_check_prepare_trace "calc.at:682"
   110364 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110366 at_status=$? at_failed=false
   110367 $at_check_filter
   110368 echo stderr:; tee stderr <"$at_stderr"
   110369 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110370 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110371 $at_failed && at_fn_log_failure
   110372 $at_traceon; }
   110373 
   110374 
   110375 
   110376 # Normalize the observed and expected error messages, depending upon the
   110377 # options.
   110378 # 1. Remove the traces from observed.
   110379 sed '/^Starting/d
   110380 /^Entering/d
   110381 /^Stack/d
   110382 /^Reading/d
   110383 /^Reducing/d
   110384 /^Return/d
   110385 /^Shifting/d
   110386 /^state/d
   110387 /^Cleanup:/d
   110388 /^Error:/d
   110389 /^Next/d
   110390 /^Now/d
   110391 /^Discarding/d
   110392 / \$[0-9$]* = /d
   110393 /^yydestructor:/d' stderr >at-stderr
   110394 mv at-stderr stderr
   110395 # 2. Create the reference error message.
   110396 cat >expout <<'_ATEOF'
   110397 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   110398 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   110399 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   110400 _ATEOF
   110401 
   110402 # 3. If locations are not used, remove them.
   110403 
   110404 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   110405 
   110406 # 5. Check
   110407 { set +x
   110408 $as_echo "$at_srcdir/calc.at:682: cat stderr"
   110409 at_fn_check_prepare_trace "calc.at:682"
   110410 ( $at_check_trace; cat stderr
   110411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110412 at_status=$? at_failed=false
   110413 $at_check_filter
   110414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110415 $at_diff expout "$at_stdout" || at_failed=:
   110416 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682"
   110417 $at_failed && at_fn_log_failure
   110418 $at_traceon; }
   110419 
   110420 
   110421 
   110422 
   110423 
   110424   set +x
   110425   $at_times_p && times >"$at_times_file"
   110426 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   110427 read at_status <"$at_status_file"
   110428 #AT_STOP_239
   110429 #AT_START_240
   110430 at_fn_group_banner 240 'calc.at:683' \
   110431   "Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 13
   110432 at_xfail=no
   110433 (
   110434   $as_echo "240. $at_setup_line: testing $at_desc ..."
   110435   $at_traceon
   110436 
   110437 
   110438 
   110439 
   110440 
   110441 
   110442 
   110443 
   110444 
   110445 
   110446 cat >calc.y <<'_ATEOF'
   110447 %code top {
   110448 #include <config.h>
   110449 /* We don't need perfect functions for these tests. */
   110450 #undef malloc
   110451 #undef memcmp
   110452 #undef realloc
   110453 }
   110454 
   110455 /* Infix notation calculator--calc */
   110456 %language "C++" %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc
   110457 %define global_tokens_and_yystype
   110458 %code requires
   110459 {
   110460 
   110461   /* Exercise pre-prologue dependency to %union.  */
   110462   typedef int semantic_value;
   110463 }
   110464 
   110465 /* Exercise %union. */
   110466 %union
   110467 {
   110468   semantic_value ival;
   110469 };
   110470 %printer { yyoutput << $$; } <ival>;
   110471 
   110472 %code provides
   110473 {
   110474   #include <stdio.h>
   110475   /* The input.  */
   110476   extern FILE *input;
   110477   extern semantic_value global_result;
   110478   extern int global_count;
   110479 }
   110480 
   110481 %code
   110482 {
   110483 #include <assert.h>
   110484 #include <string.h>
   110485 #define USE(Var)
   110486 
   110487 FILE *input;
   110488 static int power (int base, int exponent);
   110489 
   110490 
   110491 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   110492 }
   110493 
   110494 
   110495 
   110496 /* Bison Declarations */
   110497 %token CALC_EOF 0 "end of input"
   110498 %token <ival> NUM "number"
   110499 %type  <ival> exp
   110500 
   110501 %nonassoc '=' /* comparison            */
   110502 %left '-' '+'
   110503 %left '*' '/'
   110504 %left NEG     /* negation--unary minus */
   110505 %right '^'    /* exponentiation        */
   110506 
   110507 /* Grammar follows */
   110508 %%
   110509 input:
   110510   line
   110511 | input line         {  }
   110512 ;
   110513 
   110514 line:
   110515   '\n'
   110516 | exp '\n'           { USE ($1); }
   110517 ;
   110518 
   110519 exp:
   110520   NUM                { $$ = $1;             }
   110521 | exp '=' exp
   110522   {
   110523     if ($1 != $3)
   110524       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   110525     $$ = $1;
   110526   }
   110527 | exp '+' exp        { $$ = $1 + $3;        }
   110528 | exp '-' exp        { $$ = $1 - $3;        }
   110529 | exp '*' exp        { $$ = $1 * $3;        }
   110530 | exp '/' exp        { $$ = $1 / $3;        }
   110531 | '-' exp  %prec NEG { $$ = -$2;            }
   110532 | exp '^' exp        { $$ = power ($1, $3); }
   110533 | '(' exp ')'        { $$ = $2;             }
   110534 | '(' error ')'      { $$ = 1111; yyerrok;  }
   110535 | '!'                { $$ = 0; YYERROR;     }
   110536 | '-' error          { $$ = 0; YYERROR;     }
   110537 ;
   110538 %%
   110539 
   110540 static int
   110541 power (int base, int exponent)
   110542 {
   110543   int res = 1;
   110544   assert (0 <= exponent);
   110545   for (/* Niente */; exponent; --exponent)
   110546     res *= base;
   110547   return res;
   110548 }
   110549 
   110550 
   110551 /* A C++ error reporting function.  */
   110552 void
   110553 calc::parser::error (const location_type& l, const std::string& m)
   110554 {
   110555   (void) l;
   110556   std::cerr << l << ": " << m << std::endl;
   110557 }
   110558 _ATEOF
   110559 
   110560 
   110561 
   110562 cat >calc-lex.cc <<'_ATEOF'
   110563 #include <config.h>
   110564 /* We don't need perfect functions for these tests. */
   110565 #undef malloc
   110566 #undef memcmp
   110567 #undef realloc
   110568 
   110569 #include "calc.hh"
   110570 
   110571 #include <ctype.h>
   110572 
   110573 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   110574 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   110575 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   110576 
   110577 
   110578 static calc::parser::location_type last_yylloc;
   110579 
   110580 static int
   110581 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   110582 {
   110583   int res = getc (input);
   110584   (void) lvalp;(void) llocp;
   110585 
   110586   last_yylloc = (*llocp);
   110587   if (res == '\n')
   110588     {
   110589       (*llocp).end.line++;
   110590       (*llocp).end.column = 1;
   110591     }
   110592   else
   110593     (*llocp).end.column++;
   110594 
   110595   return res;
   110596 }
   110597 
   110598 static void
   110599 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   110600 {
   110601   (void) lvalp;(void) llocp;
   110602 
   110603   /* Wrong when C == `\n'. */
   110604   (*llocp) = last_yylloc;
   110605 
   110606   ungetc (c, input);
   110607 }
   110608 
   110609 static int
   110610 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   110611 {
   110612   int c = get_char (lvalp, llocp);
   110613   int sign = 1;
   110614   int n = 0;
   110615 
   110616   (void) lvalp;(void) llocp;
   110617   if (c == '-')
   110618     {
   110619       c = get_char (lvalp, llocp);
   110620       sign = -1;
   110621     }
   110622 
   110623   while (isdigit (c))
   110624     {
   110625       n = 10 * n + (c - '0');
   110626       c = get_char (lvalp, llocp);
   110627     }
   110628 
   110629   unget_char (lvalp, llocp,  c);
   110630 
   110631   return sign * n;
   110632 }
   110633 
   110634 
   110635 /*---------------------------------------------------------------.
   110636 | Lexical analyzer returns an integer on the stack and the token |
   110637 | NUM, or the ASCII character read if not a number.  Skips all   |
   110638 | blanks and tabs, returns 0 for EOF.                            |
   110639 `---------------------------------------------------------------*/
   110640 
   110641 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   110642 {
   110643   int c;
   110644   /* Skip current token, then white spaces.  */
   110645   do
   110646     {
   110647      (*llocp).begin.column = (*llocp).end.column;
   110648       (*llocp).begin.line   = (*llocp).end.line;
   110649 
   110650     }
   110651   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   110652 
   110653   /* process numbers   */
   110654   if (c == '.' || isdigit (c))
   110655     {
   110656       unget_char (lvalp, llocp,  c);
   110657       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   110658       return NUM;
   110659     }
   110660 
   110661   /* Return end-of-file.  */
   110662   if (c == EOF)
   110663     return CALC_EOF;
   110664 
   110665   /* Return single chars. */
   110666   return c;
   110667 }
   110668 _ATEOF
   110669 
   110670 
   110671 cat >calc-main.cc <<'_ATEOF'
   110672 #include <config.h>
   110673 /* We don't need perfect functions for these tests. */
   110674 #undef malloc
   110675 #undef memcmp
   110676 #undef realloc
   110677 
   110678 #include "calc.hh"
   110679 
   110680 #include <assert.h>
   110681 #if HAVE_UNISTD_H
   110682 # include <unistd.h>
   110683 #else
   110684 # undef alarm
   110685 # define alarm(seconds) /* empty */
   110686 #endif
   110687 
   110688 
   110689 /* A C++ calcparse that simulates the C signature.  */
   110690 int
   110691 calcparse ()
   110692 {
   110693   calc::parser parser;
   110694 #if YYDEBUG
   110695   parser.set_debug_level (1);
   110696 #endif
   110697   return parser.parse ();
   110698 }
   110699 
   110700 
   110701 semantic_value global_result = 0;
   110702 int global_count = 0;
   110703 
   110704 /* A C main function.  */
   110705 int
   110706 main (int argc, const char **argv)
   110707 {
   110708   semantic_value result = 0;
   110709   int count = 0;
   110710   int status;
   110711 
   110712   /* This used to be alarm (10), but that isn't enough time for
   110713      a July 1995 vintage DEC Alphastation 200 4/100 system,
   110714      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   110715   alarm (100);
   110716 
   110717   if (argc == 2)
   110718     input = fopen (argv[1], "r");
   110719   else
   110720     input = stdin;
   110721 
   110722   if (!input)
   110723     {
   110724       perror (argv[1]);
   110725       return 3;
   110726     }
   110727 
   110728 
   110729   status = calcparse ();
   110730   if (fclose (input))
   110731     perror ("fclose");
   110732   assert (global_result == result);
   110733   assert (global_count == count);
   110734   return status;
   110735 }
   110736 _ATEOF
   110737 
   110738 
   110739 
   110740 
   110741 
   110742 
   110743 
   110744 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   110745   at_save_special_files
   110746   mkdir xml-tests
   110747     # Don't combine these Bison invocations since we want to be sure that
   110748   # --report=all isn't required to get the full XML file.
   110749   { set +x
   110750 $as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   110751                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   110752 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683"
   110753 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   110754                   --graph=xml-tests/test.dot -o calc.cc calc.y
   110755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110756 at_status=$? at_failed=false
   110757 $at_check_filter
   110758 echo stderr:; cat "$at_stderr"
   110759 echo stdout:; cat "$at_stdout"
   110760 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110761 $at_failed && at_fn_log_failure
   110762 $at_traceon; }
   110763 
   110764   { set +x
   110765 $as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   110766 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:683"
   110767 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   110768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110769 at_status=$? at_failed=false
   110770 $at_check_filter
   110771 echo stderr:; cat "$at_stderr"
   110772 echo stdout:; cat "$at_stdout"
   110773 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110774 $at_failed && at_fn_log_failure
   110775 $at_traceon; }
   110776 
   110777     cp xml-tests/test.output expout
   110778   { set +x
   110779 $as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\
   110780              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   110781              xml-tests/test.xml"
   110782 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683"
   110783 ( $at_check_trace; $XSLTPROC \
   110784              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   110785              xml-tests/test.xml
   110786 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110787 at_status=$? at_failed=false
   110788 $at_check_filter
   110789 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110790 $at_diff expout "$at_stdout" || at_failed=:
   110791 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110792 $at_failed && at_fn_log_failure
   110793 $at_traceon; }
   110794 
   110795   sort xml-tests/test.dot > expout
   110796   { set +x
   110797 $as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\
   110798              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   110799              xml-tests/test.xml | sort"
   110800 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683"
   110801 ( $at_check_trace; $XSLTPROC \
   110802              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   110803              xml-tests/test.xml | sort
   110804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110805 at_status=$? at_failed=false
   110806 $at_check_filter
   110807 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110808 $at_diff expout "$at_stdout" || at_failed=:
   110809 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110810 $at_failed && at_fn_log_failure
   110811 $at_traceon; }
   110812 
   110813   rm -rf xml-tests expout
   110814   at_restore_special_files
   110815 fi
   110816 { set +x
   110817 $as_echo "$at_srcdir/calc.at:683: bison -o calc.cc calc.y"
   110818 at_fn_check_prepare_trace "calc.at:683"
   110819 ( $at_check_trace; bison -o calc.cc calc.y
   110820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110821 at_status=$? at_failed=false
   110822 $at_check_filter
   110823 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110824 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110825 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110826 $at_failed && at_fn_log_failure
   110827 $at_traceon; }
   110828 
   110829 
   110830 
   110831 { set +x
   110832 $as_echo "$at_srcdir/calc.at:683: \$BISON_CXX_WORKS"
   110833 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:683"
   110834 ( $at_check_trace; $BISON_CXX_WORKS
   110835 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110836 at_status=$? at_failed=false
   110837 $at_check_filter
   110838 echo stderr:; cat "$at_stderr"
   110839 echo stdout:; cat "$at_stdout"
   110840 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110841 $at_failed && at_fn_log_failure
   110842 $at_traceon; }
   110843 
   110844 { set +x
   110845 $as_echo "$at_srcdir/calc.at:683: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   110846 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:683"
   110847 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   110848 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110849 at_status=$? at_failed=false
   110850 $at_check_filter
   110851 echo stderr:; cat "$at_stderr"
   110852 echo stdout:; cat "$at_stdout"
   110853 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110854 $at_failed && at_fn_log_failure
   110855 $at_traceon; }
   110856 
   110857 
   110858 { set +x
   110859 $as_echo "$at_srcdir/calc.at:683: \$PERL -ne '
   110860   chomp;
   110861   print \"\$.: {\$_}\\n\"
   110862     if (# No starting/ending empty lines.
   110863         (eof || \$. == 1) && /^\\s*\$/
   110864         # No trailing space.  FIXME: not ready for \"maint\".
   110865         # || /\\s\$/
   110866         )' calc.cc
   110867 "
   110868 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683"
   110869 ( $at_check_trace; $PERL -ne '
   110870   chomp;
   110871   print "$.: {$_}\n"
   110872     if (# No starting/ending empty lines.
   110873         (eof || $. == 1) && /^\s*$/
   110874         # No trailing space.  FIXME: not ready for "maint".
   110875         # || /\s$/
   110876         )' calc.cc
   110877 
   110878 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110879 at_status=$? at_failed=false
   110880 $at_check_filter
   110881 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110882 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110883 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110884 $at_failed && at_fn_log_failure
   110885 $at_traceon; }
   110886 
   110887 { set +x
   110888 $as_echo "$at_srcdir/calc.at:683: \$PERL -ne '
   110889   chomp;
   110890   print \"\$.: {\$_}\\n\"
   110891     if (# No starting/ending empty lines.
   110892         (eof || \$. == 1) && /^\\s*\$/
   110893         # No trailing space.  FIXME: not ready for \"maint\".
   110894         # || /\\s\$/
   110895         )' calc.hh
   110896 "
   110897 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683"
   110898 ( $at_check_trace; $PERL -ne '
   110899   chomp;
   110900   print "$.: {$_}\n"
   110901     if (# No starting/ending empty lines.
   110902         (eof || $. == 1) && /^\s*$/
   110903         # No trailing space.  FIXME: not ready for "maint".
   110904         # || /\s$/
   110905         )' calc.hh
   110906 
   110907 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110908 at_status=$? at_failed=false
   110909 $at_check_filter
   110910 at_fn_diff_devnull "$at_stderr" || at_failed=:
   110911 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110912 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110913 $at_failed && at_fn_log_failure
   110914 $at_traceon; }
   110915 
   110916 
   110917 # Test the priorities.
   110918 cat >input <<'_ATEOF'
   110919 1 + 2 * 3 = 7
   110920 1 + 2 * -3 = -5
   110921 
   110922 -1^2 = -1
   110923 (-1)^2 = 1
   110924 
   110925 ---1 = -1
   110926 
   110927 1 - 2 - 3 = -4
   110928 1 - (2 - 3) = 2
   110929 
   110930 2^2^3 = 256
   110931 (2^2)^3 = 64
   110932 _ATEOF
   110933 
   110934 { set +x
   110935 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   110936 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   110937 ( $at_check_trace;  $PREPARSER ./calc input
   110938 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110939 at_status=$? at_failed=false
   110940 $at_check_filter
   110941 echo stderr:; tee stderr <"$at_stderr"
   110942 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110943 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110944 $at_failed && at_fn_log_failure
   110945 $at_traceon; }
   110946 
   110947 { set +x
   110948 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110949 at_fn_check_prepare_trace "calc.at:683"
   110950 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110951 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110952 at_status=$? at_failed=false
   110953 $at_check_filter
   110954 echo stderr:; tee stderr <"$at_stderr"
   110955 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110956 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110957 $at_failed && at_fn_log_failure
   110958 $at_traceon; }
   110959 
   110960 
   110961 
   110962 
   110963 # Some syntax errors.
   110964 cat >input <<'_ATEOF'
   110965 1 2
   110966 _ATEOF
   110967 
   110968 { set +x
   110969 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   110970 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   110971 ( $at_check_trace;  $PREPARSER ./calc input
   110972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110973 at_status=$? at_failed=false
   110974 $at_check_filter
   110975 echo stderr:; tee stderr <"$at_stderr"
   110976 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110977 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
   110978 $at_failed && at_fn_log_failure
   110979 $at_traceon; }
   110980 
   110981 { set +x
   110982 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   110983 at_fn_check_prepare_trace "calc.at:683"
   110984 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   110985 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   110986 at_status=$? at_failed=false
   110987 $at_check_filter
   110988 echo stderr:; tee stderr <"$at_stderr"
   110989 at_fn_diff_devnull "$at_stdout" || at_failed=:
   110990 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   110991 $at_failed && at_fn_log_failure
   110992 $at_traceon; }
   110993 
   110994 
   110995 
   110996 # Normalize the observed and expected error messages, depending upon the
   110997 # options.
   110998 # 1. Remove the traces from observed.
   110999 sed '/^Starting/d
   111000 /^Entering/d
   111001 /^Stack/d
   111002 /^Reading/d
   111003 /^Reducing/d
   111004 /^Return/d
   111005 /^Shifting/d
   111006 /^state/d
   111007 /^Cleanup:/d
   111008 /^Error:/d
   111009 /^Next/d
   111010 /^Now/d
   111011 /^Discarding/d
   111012 / \$[0-9$]* = /d
   111013 /^yydestructor:/d' stderr >at-stderr
   111014 mv at-stderr stderr
   111015 # 2. Create the reference error message.
   111016 cat >expout <<'_ATEOF'
   111017 1.3: syntax error, unexpected number
   111018 _ATEOF
   111019 
   111020 # 3. If locations are not used, remove them.
   111021 
   111022 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111023 
   111024 # 5. Check
   111025 { set +x
   111026 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111027 at_fn_check_prepare_trace "calc.at:683"
   111028 ( $at_check_trace; cat stderr
   111029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111030 at_status=$? at_failed=false
   111031 $at_check_filter
   111032 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111033 $at_diff expout "$at_stdout" || at_failed=:
   111034 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111035 $at_failed && at_fn_log_failure
   111036 $at_traceon; }
   111037 
   111038 
   111039 cat >input <<'_ATEOF'
   111040 1//2
   111041 _ATEOF
   111042 
   111043 { set +x
   111044 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111045 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111046 ( $at_check_trace;  $PREPARSER ./calc input
   111047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111048 at_status=$? at_failed=false
   111049 $at_check_filter
   111050 echo stderr:; tee stderr <"$at_stderr"
   111051 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111052 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
   111053 $at_failed && at_fn_log_failure
   111054 $at_traceon; }
   111055 
   111056 { set +x
   111057 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111058 at_fn_check_prepare_trace "calc.at:683"
   111059 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111060 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111061 at_status=$? at_failed=false
   111062 $at_check_filter
   111063 echo stderr:; tee stderr <"$at_stderr"
   111064 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111065 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111066 $at_failed && at_fn_log_failure
   111067 $at_traceon; }
   111068 
   111069 
   111070 
   111071 # Normalize the observed and expected error messages, depending upon the
   111072 # options.
   111073 # 1. Remove the traces from observed.
   111074 sed '/^Starting/d
   111075 /^Entering/d
   111076 /^Stack/d
   111077 /^Reading/d
   111078 /^Reducing/d
   111079 /^Return/d
   111080 /^Shifting/d
   111081 /^state/d
   111082 /^Cleanup:/d
   111083 /^Error:/d
   111084 /^Next/d
   111085 /^Now/d
   111086 /^Discarding/d
   111087 / \$[0-9$]* = /d
   111088 /^yydestructor:/d' stderr >at-stderr
   111089 mv at-stderr stderr
   111090 # 2. Create the reference error message.
   111091 cat >expout <<'_ATEOF'
   111092 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   111093 _ATEOF
   111094 
   111095 # 3. If locations are not used, remove them.
   111096 
   111097 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111098 
   111099 # 5. Check
   111100 { set +x
   111101 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111102 at_fn_check_prepare_trace "calc.at:683"
   111103 ( $at_check_trace; cat stderr
   111104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111105 at_status=$? at_failed=false
   111106 $at_check_filter
   111107 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111108 $at_diff expout "$at_stdout" || at_failed=:
   111109 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111110 $at_failed && at_fn_log_failure
   111111 $at_traceon; }
   111112 
   111113 
   111114 cat >input <<'_ATEOF'
   111115 error
   111116 _ATEOF
   111117 
   111118 { set +x
   111119 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111120 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111121 ( $at_check_trace;  $PREPARSER ./calc input
   111122 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111123 at_status=$? at_failed=false
   111124 $at_check_filter
   111125 echo stderr:; tee stderr <"$at_stderr"
   111126 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111127 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
   111128 $at_failed && at_fn_log_failure
   111129 $at_traceon; }
   111130 
   111131 { set +x
   111132 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111133 at_fn_check_prepare_trace "calc.at:683"
   111134 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111135 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111136 at_status=$? at_failed=false
   111137 $at_check_filter
   111138 echo stderr:; tee stderr <"$at_stderr"
   111139 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111140 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111141 $at_failed && at_fn_log_failure
   111142 $at_traceon; }
   111143 
   111144 
   111145 
   111146 # Normalize the observed and expected error messages, depending upon the
   111147 # options.
   111148 # 1. Remove the traces from observed.
   111149 sed '/^Starting/d
   111150 /^Entering/d
   111151 /^Stack/d
   111152 /^Reading/d
   111153 /^Reducing/d
   111154 /^Return/d
   111155 /^Shifting/d
   111156 /^state/d
   111157 /^Cleanup:/d
   111158 /^Error:/d
   111159 /^Next/d
   111160 /^Now/d
   111161 /^Discarding/d
   111162 / \$[0-9$]* = /d
   111163 /^yydestructor:/d' stderr >at-stderr
   111164 mv at-stderr stderr
   111165 # 2. Create the reference error message.
   111166 cat >expout <<'_ATEOF'
   111167 1.1: syntax error, unexpected $undefined
   111168 _ATEOF
   111169 
   111170 # 3. If locations are not used, remove them.
   111171 
   111172 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111173 
   111174 # 5. Check
   111175 { set +x
   111176 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111177 at_fn_check_prepare_trace "calc.at:683"
   111178 ( $at_check_trace; cat stderr
   111179 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111180 at_status=$? at_failed=false
   111181 $at_check_filter
   111182 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111183 $at_diff expout "$at_stdout" || at_failed=:
   111184 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111185 $at_failed && at_fn_log_failure
   111186 $at_traceon; }
   111187 
   111188 
   111189 cat >input <<'_ATEOF'
   111190 1 = 2 = 3
   111191 _ATEOF
   111192 
   111193 { set +x
   111194 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111195 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111196 ( $at_check_trace;  $PREPARSER ./calc input
   111197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111198 at_status=$? at_failed=false
   111199 $at_check_filter
   111200 echo stderr:; tee stderr <"$at_stderr"
   111201 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111202 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
   111203 $at_failed && at_fn_log_failure
   111204 $at_traceon; }
   111205 
   111206 { set +x
   111207 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111208 at_fn_check_prepare_trace "calc.at:683"
   111209 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111211 at_status=$? at_failed=false
   111212 $at_check_filter
   111213 echo stderr:; tee stderr <"$at_stderr"
   111214 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111215 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111216 $at_failed && at_fn_log_failure
   111217 $at_traceon; }
   111218 
   111219 
   111220 
   111221 # Normalize the observed and expected error messages, depending upon the
   111222 # options.
   111223 # 1. Remove the traces from observed.
   111224 sed '/^Starting/d
   111225 /^Entering/d
   111226 /^Stack/d
   111227 /^Reading/d
   111228 /^Reducing/d
   111229 /^Return/d
   111230 /^Shifting/d
   111231 /^state/d
   111232 /^Cleanup:/d
   111233 /^Error:/d
   111234 /^Next/d
   111235 /^Now/d
   111236 /^Discarding/d
   111237 / \$[0-9$]* = /d
   111238 /^yydestructor:/d' stderr >at-stderr
   111239 mv at-stderr stderr
   111240 # 2. Create the reference error message.
   111241 cat >expout <<'_ATEOF'
   111242 1.7: syntax error, unexpected '='
   111243 _ATEOF
   111244 
   111245 # 3. If locations are not used, remove them.
   111246 
   111247 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111248 
   111249 # 5. Check
   111250 { set +x
   111251 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111252 at_fn_check_prepare_trace "calc.at:683"
   111253 ( $at_check_trace; cat stderr
   111254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111255 at_status=$? at_failed=false
   111256 $at_check_filter
   111257 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111258 $at_diff expout "$at_stdout" || at_failed=:
   111259 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111260 $at_failed && at_fn_log_failure
   111261 $at_traceon; }
   111262 
   111263 
   111264 cat >input <<'_ATEOF'
   111265 
   111266 +1
   111267 _ATEOF
   111268 
   111269 { set +x
   111270 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111271 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111272 ( $at_check_trace;  $PREPARSER ./calc input
   111273 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111274 at_status=$? at_failed=false
   111275 $at_check_filter
   111276 echo stderr:; tee stderr <"$at_stderr"
   111277 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111278 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
   111279 $at_failed && at_fn_log_failure
   111280 $at_traceon; }
   111281 
   111282 { set +x
   111283 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111284 at_fn_check_prepare_trace "calc.at:683"
   111285 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111286 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111287 at_status=$? at_failed=false
   111288 $at_check_filter
   111289 echo stderr:; tee stderr <"$at_stderr"
   111290 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111291 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111292 $at_failed && at_fn_log_failure
   111293 $at_traceon; }
   111294 
   111295 
   111296 
   111297 # Normalize the observed and expected error messages, depending upon the
   111298 # options.
   111299 # 1. Remove the traces from observed.
   111300 sed '/^Starting/d
   111301 /^Entering/d
   111302 /^Stack/d
   111303 /^Reading/d
   111304 /^Reducing/d
   111305 /^Return/d
   111306 /^Shifting/d
   111307 /^state/d
   111308 /^Cleanup:/d
   111309 /^Error:/d
   111310 /^Next/d
   111311 /^Now/d
   111312 /^Discarding/d
   111313 / \$[0-9$]* = /d
   111314 /^yydestructor:/d' stderr >at-stderr
   111315 mv at-stderr stderr
   111316 # 2. Create the reference error message.
   111317 cat >expout <<'_ATEOF'
   111318 2.1: syntax error, unexpected '+'
   111319 _ATEOF
   111320 
   111321 # 3. If locations are not used, remove them.
   111322 
   111323 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111324 
   111325 # 5. Check
   111326 { set +x
   111327 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111328 at_fn_check_prepare_trace "calc.at:683"
   111329 ( $at_check_trace; cat stderr
   111330 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111331 at_status=$? at_failed=false
   111332 $at_check_filter
   111333 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111334 $at_diff expout "$at_stdout" || at_failed=:
   111335 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111336 $at_failed && at_fn_log_failure
   111337 $at_traceon; }
   111338 
   111339 
   111340 # Exercise error messages with EOF: work on an empty file.
   111341 { set +x
   111342 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc /dev/null"
   111343 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:683"
   111344 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   111345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111346 at_status=$? at_failed=false
   111347 $at_check_filter
   111348 echo stderr:; tee stderr <"$at_stderr"
   111349 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111350 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
   111351 $at_failed && at_fn_log_failure
   111352 $at_traceon; }
   111353 
   111354 { set +x
   111355 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111356 at_fn_check_prepare_trace "calc.at:683"
   111357 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111358 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111359 at_status=$? at_failed=false
   111360 $at_check_filter
   111361 echo stderr:; tee stderr <"$at_stderr"
   111362 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111363 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111364 $at_failed && at_fn_log_failure
   111365 $at_traceon; }
   111366 
   111367 
   111368 
   111369 # Normalize the observed and expected error messages, depending upon the
   111370 # options.
   111371 # 1. Remove the traces from observed.
   111372 sed '/^Starting/d
   111373 /^Entering/d
   111374 /^Stack/d
   111375 /^Reading/d
   111376 /^Reducing/d
   111377 /^Return/d
   111378 /^Shifting/d
   111379 /^state/d
   111380 /^Cleanup:/d
   111381 /^Error:/d
   111382 /^Next/d
   111383 /^Now/d
   111384 /^Discarding/d
   111385 / \$[0-9$]* = /d
   111386 /^yydestructor:/d' stderr >at-stderr
   111387 mv at-stderr stderr
   111388 # 2. Create the reference error message.
   111389 cat >expout <<'_ATEOF'
   111390 1.1: syntax error, unexpected end of input
   111391 _ATEOF
   111392 
   111393 # 3. If locations are not used, remove them.
   111394 
   111395 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111396 
   111397 # 5. Check
   111398 { set +x
   111399 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111400 at_fn_check_prepare_trace "calc.at:683"
   111401 ( $at_check_trace; cat stderr
   111402 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111403 at_status=$? at_failed=false
   111404 $at_check_filter
   111405 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111406 $at_diff expout "$at_stdout" || at_failed=:
   111407 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111408 $at_failed && at_fn_log_failure
   111409 $at_traceon; }
   111410 
   111411 
   111412 
   111413 # Exercise the error token: without it, we die at the first error,
   111414 # hence be sure to
   111415 #
   111416 # - have several errors which exercise different shift/discardings
   111417 #   - (): nothing to pop, nothing to discard
   111418 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   111419 #   - (* * *): nothing to pop, a lot to discard
   111420 #   - (1 + 2 * *): some to pop and discard
   111421 #
   111422 # - test the action associated to `error'
   111423 #
   111424 # - check the lookahead that triggers an error is not discarded
   111425 #   when we enter error recovery.  Below, the lookahead causing the
   111426 #   first error is ")", which is needed to recover from the error and
   111427 #   produce the "0" that triggers the "0 != 1" error.
   111428 #
   111429 cat >input <<'_ATEOF'
   111430 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   111431 _ATEOF
   111432 
   111433 { set +x
   111434 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111435 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111436 ( $at_check_trace;  $PREPARSER ./calc input
   111437 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111438 at_status=$? at_failed=false
   111439 $at_check_filter
   111440 echo stderr:; tee stderr <"$at_stderr"
   111441 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111442 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111443 $at_failed && at_fn_log_failure
   111444 $at_traceon; }
   111445 
   111446 { set +x
   111447 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111448 at_fn_check_prepare_trace "calc.at:683"
   111449 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111451 at_status=$? at_failed=false
   111452 $at_check_filter
   111453 echo stderr:; tee stderr <"$at_stderr"
   111454 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111455 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111456 $at_failed && at_fn_log_failure
   111457 $at_traceon; }
   111458 
   111459 
   111460 
   111461 # Normalize the observed and expected error messages, depending upon the
   111462 # options.
   111463 # 1. Remove the traces from observed.
   111464 sed '/^Starting/d
   111465 /^Entering/d
   111466 /^Stack/d
   111467 /^Reading/d
   111468 /^Reducing/d
   111469 /^Return/d
   111470 /^Shifting/d
   111471 /^state/d
   111472 /^Cleanup:/d
   111473 /^Error:/d
   111474 /^Next/d
   111475 /^Now/d
   111476 /^Discarding/d
   111477 / \$[0-9$]* = /d
   111478 /^yydestructor:/d' stderr >at-stderr
   111479 mv at-stderr stderr
   111480 # 2. Create the reference error message.
   111481 cat >expout <<'_ATEOF'
   111482 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   111483 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   111484 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   111485 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   111486 calc: error: 4444 != 1
   111487 _ATEOF
   111488 
   111489 # 3. If locations are not used, remove them.
   111490 
   111491 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111492 
   111493 # 5. Check
   111494 { set +x
   111495 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111496 at_fn_check_prepare_trace "calc.at:683"
   111497 ( $at_check_trace; cat stderr
   111498 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111499 at_status=$? at_failed=false
   111500 $at_check_filter
   111501 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111502 $at_diff expout "$at_stdout" || at_failed=:
   111503 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111504 $at_failed && at_fn_log_failure
   111505 $at_traceon; }
   111506 
   111507 
   111508 
   111509 # The same, but this time exercising explicitly triggered syntax errors.
   111510 # POSIX says the lookahead causing the error should not be discarded.
   111511 cat >input <<'_ATEOF'
   111512 (!) + (1 2) = 1
   111513 _ATEOF
   111514 
   111515 { set +x
   111516 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111517 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111518 ( $at_check_trace;  $PREPARSER ./calc input
   111519 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111520 at_status=$? at_failed=false
   111521 $at_check_filter
   111522 echo stderr:; tee stderr <"$at_stderr"
   111523 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111524 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111525 $at_failed && at_fn_log_failure
   111526 $at_traceon; }
   111527 
   111528 { set +x
   111529 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111530 at_fn_check_prepare_trace "calc.at:683"
   111531 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111533 at_status=$? at_failed=false
   111534 $at_check_filter
   111535 echo stderr:; tee stderr <"$at_stderr"
   111536 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111537 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111538 $at_failed && at_fn_log_failure
   111539 $at_traceon; }
   111540 
   111541 
   111542 
   111543 # Normalize the observed and expected error messages, depending upon the
   111544 # options.
   111545 # 1. Remove the traces from observed.
   111546 sed '/^Starting/d
   111547 /^Entering/d
   111548 /^Stack/d
   111549 /^Reading/d
   111550 /^Reducing/d
   111551 /^Return/d
   111552 /^Shifting/d
   111553 /^state/d
   111554 /^Cleanup:/d
   111555 /^Error:/d
   111556 /^Next/d
   111557 /^Now/d
   111558 /^Discarding/d
   111559 / \$[0-9$]* = /d
   111560 /^yydestructor:/d' stderr >at-stderr
   111561 mv at-stderr stderr
   111562 # 2. Create the reference error message.
   111563 cat >expout <<'_ATEOF'
   111564 1.10: syntax error, unexpected number
   111565 calc: error: 2222 != 1
   111566 _ATEOF
   111567 
   111568 # 3. If locations are not used, remove them.
   111569 
   111570 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111571 
   111572 # 5. Check
   111573 { set +x
   111574 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111575 at_fn_check_prepare_trace "calc.at:683"
   111576 ( $at_check_trace; cat stderr
   111577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111578 at_status=$? at_failed=false
   111579 $at_check_filter
   111580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111581 $at_diff expout "$at_stdout" || at_failed=:
   111582 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111583 $at_failed && at_fn_log_failure
   111584 $at_traceon; }
   111585 
   111586 
   111587 cat >input <<'_ATEOF'
   111588 (- *) + (1 2) = 1
   111589 _ATEOF
   111590 
   111591 { set +x
   111592 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111593 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111594 ( $at_check_trace;  $PREPARSER ./calc input
   111595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111596 at_status=$? at_failed=false
   111597 $at_check_filter
   111598 echo stderr:; tee stderr <"$at_stderr"
   111599 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111600 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111601 $at_failed && at_fn_log_failure
   111602 $at_traceon; }
   111603 
   111604 { set +x
   111605 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111606 at_fn_check_prepare_trace "calc.at:683"
   111607 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111609 at_status=$? at_failed=false
   111610 $at_check_filter
   111611 echo stderr:; tee stderr <"$at_stderr"
   111612 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111613 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111614 $at_failed && at_fn_log_failure
   111615 $at_traceon; }
   111616 
   111617 
   111618 
   111619 # Normalize the observed and expected error messages, depending upon the
   111620 # options.
   111621 # 1. Remove the traces from observed.
   111622 sed '/^Starting/d
   111623 /^Entering/d
   111624 /^Stack/d
   111625 /^Reading/d
   111626 /^Reducing/d
   111627 /^Return/d
   111628 /^Shifting/d
   111629 /^state/d
   111630 /^Cleanup:/d
   111631 /^Error:/d
   111632 /^Next/d
   111633 /^Now/d
   111634 /^Discarding/d
   111635 / \$[0-9$]* = /d
   111636 /^yydestructor:/d' stderr >at-stderr
   111637 mv at-stderr stderr
   111638 # 2. Create the reference error message.
   111639 cat >expout <<'_ATEOF'
   111640 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   111641 1.12: syntax error, unexpected number
   111642 calc: error: 2222 != 1
   111643 _ATEOF
   111644 
   111645 # 3. If locations are not used, remove them.
   111646 
   111647 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111648 
   111649 # 5. Check
   111650 { set +x
   111651 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111652 at_fn_check_prepare_trace "calc.at:683"
   111653 ( $at_check_trace; cat stderr
   111654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111655 at_status=$? at_failed=false
   111656 $at_check_filter
   111657 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111658 $at_diff expout "$at_stdout" || at_failed=:
   111659 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111660 $at_failed && at_fn_log_failure
   111661 $at_traceon; }
   111662 
   111663 
   111664 
   111665 # Check that yyerrok works properly: second error is not reported,
   111666 # third and fourth are.  Parse status is succesfull.
   111667 cat >input <<'_ATEOF'
   111668 (* *) + (*) + (*)
   111669 _ATEOF
   111670 
   111671 { set +x
   111672 $as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
   111673 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
   111674 ( $at_check_trace;  $PREPARSER ./calc input
   111675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111676 at_status=$? at_failed=false
   111677 $at_check_filter
   111678 echo stderr:; tee stderr <"$at_stderr"
   111679 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111680 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111681 $at_failed && at_fn_log_failure
   111682 $at_traceon; }
   111683 
   111684 { set +x
   111685 $as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   111686 at_fn_check_prepare_trace "calc.at:683"
   111687 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   111688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111689 at_status=$? at_failed=false
   111690 $at_check_filter
   111691 echo stderr:; tee stderr <"$at_stderr"
   111692 at_fn_diff_devnull "$at_stdout" || at_failed=:
   111693 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111694 $at_failed && at_fn_log_failure
   111695 $at_traceon; }
   111696 
   111697 
   111698 
   111699 # Normalize the observed and expected error messages, depending upon the
   111700 # options.
   111701 # 1. Remove the traces from observed.
   111702 sed '/^Starting/d
   111703 /^Entering/d
   111704 /^Stack/d
   111705 /^Reading/d
   111706 /^Reducing/d
   111707 /^Return/d
   111708 /^Shifting/d
   111709 /^state/d
   111710 /^Cleanup:/d
   111711 /^Error:/d
   111712 /^Next/d
   111713 /^Now/d
   111714 /^Discarding/d
   111715 / \$[0-9$]* = /d
   111716 /^yydestructor:/d' stderr >at-stderr
   111717 mv at-stderr stderr
   111718 # 2. Create the reference error message.
   111719 cat >expout <<'_ATEOF'
   111720 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   111721 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   111722 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   111723 _ATEOF
   111724 
   111725 # 3. If locations are not used, remove them.
   111726 
   111727 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   111728 
   111729 # 5. Check
   111730 { set +x
   111731 $as_echo "$at_srcdir/calc.at:683: cat stderr"
   111732 at_fn_check_prepare_trace "calc.at:683"
   111733 ( $at_check_trace; cat stderr
   111734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   111735 at_status=$? at_failed=false
   111736 $at_check_filter
   111737 at_fn_diff_devnull "$at_stderr" || at_failed=:
   111738 $at_diff expout "$at_stdout" || at_failed=:
   111739 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
   111740 $at_failed && at_fn_log_failure
   111741 $at_traceon; }
   111742 
   111743 
   111744 
   111745 
   111746 
   111747   set +x
   111748   $at_times_p && times >"$at_times_file"
   111749 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   111750 read at_status <"$at_status_file"
   111751 #AT_STOP_240
   111752 #AT_START_241
   111753 at_fn_group_banner 241 'calc.at:685' \
   111754   "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc" "" 13
   111755 at_xfail=no
   111756 (
   111757   $as_echo "241. $at_setup_line: testing $at_desc ..."
   111758   $at_traceon
   111759 
   111760 
   111761 
   111762 
   111763 
   111764 
   111765 
   111766 
   111767 
   111768 
   111769 cat >calc.y <<'_ATEOF'
   111770 %code top {
   111771 #include <config.h>
   111772 /* We don't need perfect functions for these tests. */
   111773 #undef malloc
   111774 #undef memcmp
   111775 #undef realloc
   111776 }
   111777 
   111778 /* Infix notation calculator--calc */
   111779 %language "C++" %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc
   111780 %define global_tokens_and_yystype
   111781 %code requires
   111782 {
   111783 
   111784   /* Exercise pre-prologue dependency to %union.  */
   111785   typedef int semantic_value;
   111786 }
   111787 
   111788 /* Exercise %union. */
   111789 %union
   111790 {
   111791   semantic_value ival;
   111792 };
   111793 %printer { yyoutput << $$; } <ival>;
   111794 
   111795 %code provides
   111796 {
   111797   #include <stdio.h>
   111798   /* The input.  */
   111799   extern FILE *input;
   111800   extern semantic_value global_result;
   111801   extern int global_count;
   111802 }
   111803 
   111804 %code
   111805 {
   111806 #include <assert.h>
   111807 #include <string.h>
   111808 #define USE(Var)
   111809 
   111810 FILE *input;
   111811 static int power (int base, int exponent);
   111812 
   111813 
   111814 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   111815 }
   111816 
   111817 
   111818 
   111819 /* Bison Declarations */
   111820 %token CALC_EOF 0 "end of input"
   111821 %token <ival> NUM "number"
   111822 %type  <ival> exp
   111823 
   111824 %nonassoc '=' /* comparison            */
   111825 %left '-' '+'
   111826 %left '*' '/'
   111827 %left NEG     /* negation--unary minus */
   111828 %right '^'    /* exponentiation        */
   111829 
   111830 /* Grammar follows */
   111831 %%
   111832 input:
   111833   line
   111834 | input line         {  }
   111835 ;
   111836 
   111837 line:
   111838   '\n'
   111839 | exp '\n'           { USE ($1); }
   111840 ;
   111841 
   111842 exp:
   111843   NUM                { $$ = $1;             }
   111844 | exp '=' exp
   111845   {
   111846     if ($1 != $3)
   111847       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   111848     $$ = $1;
   111849   }
   111850 | exp '+' exp        { $$ = $1 + $3;        }
   111851 | exp '-' exp        { $$ = $1 - $3;        }
   111852 | exp '*' exp        { $$ = $1 * $3;        }
   111853 | exp '/' exp        { $$ = $1 / $3;        }
   111854 | '-' exp  %prec NEG { $$ = -$2;            }
   111855 | exp '^' exp        { $$ = power ($1, $3); }
   111856 | '(' exp ')'        { $$ = $2;             }
   111857 | '(' error ')'      { $$ = 1111; yyerrok;  }
   111858 | '!'                { $$ = 0; YYERROR;     }
   111859 | '-' error          { $$ = 0; YYERROR;     }
   111860 ;
   111861 %%
   111862 
   111863 static int
   111864 power (int base, int exponent)
   111865 {
   111866   int res = 1;
   111867   assert (0 <= exponent);
   111868   for (/* Niente */; exponent; --exponent)
   111869     res *= base;
   111870   return res;
   111871 }
   111872 
   111873 
   111874 /* A C++ error reporting function.  */
   111875 void
   111876 calc::parser::error (const location_type& l, const std::string& m)
   111877 {
   111878   (void) l;
   111879   std::cerr << l << ": " << m << std::endl;
   111880 }
   111881 _ATEOF
   111882 
   111883 
   111884 
   111885 cat >calc-lex.cc <<'_ATEOF'
   111886 #include <config.h>
   111887 /* We don't need perfect functions for these tests. */
   111888 #undef malloc
   111889 #undef memcmp
   111890 #undef realloc
   111891 
   111892 #include "calc.hh"
   111893 
   111894 #include <ctype.h>
   111895 
   111896 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   111897 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   111898 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   111899 
   111900 
   111901 static calc::parser::location_type last_yylloc;
   111902 
   111903 static int
   111904 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   111905 {
   111906   int res = getc (input);
   111907   (void) lvalp;(void) llocp;
   111908 
   111909   last_yylloc = (*llocp);
   111910   if (res == '\n')
   111911     {
   111912       (*llocp).end.line++;
   111913       (*llocp).end.column = 1;
   111914     }
   111915   else
   111916     (*llocp).end.column++;
   111917 
   111918   return res;
   111919 }
   111920 
   111921 static void
   111922 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   111923 {
   111924   (void) lvalp;(void) llocp;
   111925 
   111926   /* Wrong when C == `\n'. */
   111927   (*llocp) = last_yylloc;
   111928 
   111929   ungetc (c, input);
   111930 }
   111931 
   111932 static int
   111933 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   111934 {
   111935   int c = get_char (lvalp, llocp);
   111936   int sign = 1;
   111937   int n = 0;
   111938 
   111939   (void) lvalp;(void) llocp;
   111940   if (c == '-')
   111941     {
   111942       c = get_char (lvalp, llocp);
   111943       sign = -1;
   111944     }
   111945 
   111946   while (isdigit (c))
   111947     {
   111948       n = 10 * n + (c - '0');
   111949       c = get_char (lvalp, llocp);
   111950     }
   111951 
   111952   unget_char (lvalp, llocp,  c);
   111953 
   111954   return sign * n;
   111955 }
   111956 
   111957 
   111958 /*---------------------------------------------------------------.
   111959 | Lexical analyzer returns an integer on the stack and the token |
   111960 | NUM, or the ASCII character read if not a number.  Skips all   |
   111961 | blanks and tabs, returns 0 for EOF.                            |
   111962 `---------------------------------------------------------------*/
   111963 
   111964 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   111965 {
   111966   int c;
   111967   /* Skip current token, then white spaces.  */
   111968   do
   111969     {
   111970      (*llocp).begin.column = (*llocp).end.column;
   111971       (*llocp).begin.line   = (*llocp).end.line;
   111972 
   111973     }
   111974   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   111975 
   111976   /* process numbers   */
   111977   if (c == '.' || isdigit (c))
   111978     {
   111979       unget_char (lvalp, llocp,  c);
   111980       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   111981       return NUM;
   111982     }
   111983 
   111984   /* Return end-of-file.  */
   111985   if (c == EOF)
   111986     return CALC_EOF;
   111987 
   111988   /* Return single chars. */
   111989   return c;
   111990 }
   111991 _ATEOF
   111992 
   111993 
   111994 cat >calc-main.cc <<'_ATEOF'
   111995 #include <config.h>
   111996 /* We don't need perfect functions for these tests. */
   111997 #undef malloc
   111998 #undef memcmp
   111999 #undef realloc
   112000 
   112001 #include "calc.hh"
   112002 
   112003 #include <assert.h>
   112004 #if HAVE_UNISTD_H
   112005 # include <unistd.h>
   112006 #else
   112007 # undef alarm
   112008 # define alarm(seconds) /* empty */
   112009 #endif
   112010 
   112011 
   112012 /* A C++ calcparse that simulates the C signature.  */
   112013 int
   112014 calcparse ()
   112015 {
   112016   calc::parser parser;
   112017 #if CALCDEBUG
   112018   parser.set_debug_level (1);
   112019 #endif
   112020   return parser.parse ();
   112021 }
   112022 
   112023 
   112024 semantic_value global_result = 0;
   112025 int global_count = 0;
   112026 
   112027 /* A C main function.  */
   112028 int
   112029 main (int argc, const char **argv)
   112030 {
   112031   semantic_value result = 0;
   112032   int count = 0;
   112033   int status;
   112034 
   112035   /* This used to be alarm (10), but that isn't enough time for
   112036      a July 1995 vintage DEC Alphastation 200 4/100 system,
   112037      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   112038   alarm (100);
   112039 
   112040   if (argc == 2)
   112041     input = fopen (argv[1], "r");
   112042   else
   112043     input = stdin;
   112044 
   112045   if (!input)
   112046     {
   112047       perror (argv[1]);
   112048       return 3;
   112049     }
   112050 
   112051 
   112052   status = calcparse ();
   112053   if (fclose (input))
   112054     perror ("fclose");
   112055   assert (global_result == result);
   112056   assert (global_count == count);
   112057   return status;
   112058 }
   112059 _ATEOF
   112060 
   112061 
   112062 
   112063 
   112064 
   112065 
   112066 
   112067 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   112068   at_save_special_files
   112069   mkdir xml-tests
   112070     # Don't combine these Bison invocations since we want to be sure that
   112071   # --report=all isn't required to get the full XML file.
   112072   { set +x
   112073 $as_echo "$at_srcdir/calc.at:685: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   112074                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   112075 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685"
   112076 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   112077                   --graph=xml-tests/test.dot -o calc.cc calc.y
   112078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112079 at_status=$? at_failed=false
   112080 $at_check_filter
   112081 echo stderr:; cat "$at_stderr"
   112082 echo stdout:; cat "$at_stdout"
   112083 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112084 $at_failed && at_fn_log_failure
   112085 $at_traceon; }
   112086 
   112087   { set +x
   112088 $as_echo "$at_srcdir/calc.at:685: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   112089 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:685"
   112090 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   112091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112092 at_status=$? at_failed=false
   112093 $at_check_filter
   112094 echo stderr:; cat "$at_stderr"
   112095 echo stdout:; cat "$at_stdout"
   112096 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112097 $at_failed && at_fn_log_failure
   112098 $at_traceon; }
   112099 
   112100     cp xml-tests/test.output expout
   112101   { set +x
   112102 $as_echo "$at_srcdir/calc.at:685: \$XSLTPROC \\
   112103              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   112104              xml-tests/test.xml"
   112105 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:685"
   112106 ( $at_check_trace; $XSLTPROC \
   112107              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   112108              xml-tests/test.xml
   112109 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112110 at_status=$? at_failed=false
   112111 $at_check_filter
   112112 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112113 $at_diff expout "$at_stdout" || at_failed=:
   112114 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112115 $at_failed && at_fn_log_failure
   112116 $at_traceon; }
   112117 
   112118   sort xml-tests/test.dot > expout
   112119   { set +x
   112120 $as_echo "$at_srcdir/calc.at:685: \$XSLTPROC \\
   112121              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   112122              xml-tests/test.xml | sort"
   112123 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:685"
   112124 ( $at_check_trace; $XSLTPROC \
   112125              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   112126              xml-tests/test.xml | sort
   112127 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112128 at_status=$? at_failed=false
   112129 $at_check_filter
   112130 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112131 $at_diff expout "$at_stdout" || at_failed=:
   112132 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112133 $at_failed && at_fn_log_failure
   112134 $at_traceon; }
   112135 
   112136   rm -rf xml-tests expout
   112137   at_restore_special_files
   112138 fi
   112139 { set +x
   112140 $as_echo "$at_srcdir/calc.at:685: bison -o calc.cc calc.y"
   112141 at_fn_check_prepare_trace "calc.at:685"
   112142 ( $at_check_trace; bison -o calc.cc calc.y
   112143 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112144 at_status=$? at_failed=false
   112145 $at_check_filter
   112146 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112147 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112148 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112149 $at_failed && at_fn_log_failure
   112150 $at_traceon; }
   112151 
   112152 
   112153 
   112154 { set +x
   112155 $as_echo "$at_srcdir/calc.at:685: \$BISON_CXX_WORKS"
   112156 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:685"
   112157 ( $at_check_trace; $BISON_CXX_WORKS
   112158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112159 at_status=$? at_failed=false
   112160 $at_check_filter
   112161 echo stderr:; cat "$at_stderr"
   112162 echo stdout:; cat "$at_stdout"
   112163 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112164 $at_failed && at_fn_log_failure
   112165 $at_traceon; }
   112166 
   112167 { set +x
   112168 $as_echo "$at_srcdir/calc.at:685: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   112169 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:685"
   112170 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   112171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112172 at_status=$? at_failed=false
   112173 $at_check_filter
   112174 echo stderr:; cat "$at_stderr"
   112175 echo stdout:; cat "$at_stdout"
   112176 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112177 $at_failed && at_fn_log_failure
   112178 $at_traceon; }
   112179 
   112180 
   112181 { set +x
   112182 $as_echo "$at_srcdir/calc.at:685: \$PERL -ne '
   112183   chomp;
   112184   print \"\$.: {\$_}\\n\"
   112185     if (# No starting/ending empty lines.
   112186         (eof || \$. == 1) && /^\\s*\$/
   112187         # No trailing space.  FIXME: not ready for \"maint\".
   112188         # || /\\s\$/
   112189         )' calc.cc
   112190 "
   112191 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685"
   112192 ( $at_check_trace; $PERL -ne '
   112193   chomp;
   112194   print "$.: {$_}\n"
   112195     if (# No starting/ending empty lines.
   112196         (eof || $. == 1) && /^\s*$/
   112197         # No trailing space.  FIXME: not ready for "maint".
   112198         # || /\s$/
   112199         )' calc.cc
   112200 
   112201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112202 at_status=$? at_failed=false
   112203 $at_check_filter
   112204 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112206 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112207 $at_failed && at_fn_log_failure
   112208 $at_traceon; }
   112209 
   112210 { set +x
   112211 $as_echo "$at_srcdir/calc.at:685: \$PERL -ne '
   112212   chomp;
   112213   print \"\$.: {\$_}\\n\"
   112214     if (# No starting/ending empty lines.
   112215         (eof || \$. == 1) && /^\\s*\$/
   112216         # No trailing space.  FIXME: not ready for \"maint\".
   112217         # || /\\s\$/
   112218         )' calc.hh
   112219 "
   112220 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685"
   112221 ( $at_check_trace; $PERL -ne '
   112222   chomp;
   112223   print "$.: {$_}\n"
   112224     if (# No starting/ending empty lines.
   112225         (eof || $. == 1) && /^\s*$/
   112226         # No trailing space.  FIXME: not ready for "maint".
   112227         # || /\s$/
   112228         )' calc.hh
   112229 
   112230 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112231 at_status=$? at_failed=false
   112232 $at_check_filter
   112233 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112234 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112235 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112236 $at_failed && at_fn_log_failure
   112237 $at_traceon; }
   112238 
   112239 
   112240 # Test the priorities.
   112241 cat >input <<'_ATEOF'
   112242 1 + 2 * 3 = 7
   112243 1 + 2 * -3 = -5
   112244 
   112245 -1^2 = -1
   112246 (-1)^2 = 1
   112247 
   112248 ---1 = -1
   112249 
   112250 1 - 2 - 3 = -4
   112251 1 - (2 - 3) = 2
   112252 
   112253 2^2^3 = 256
   112254 (2^2)^3 = 64
   112255 _ATEOF
   112256 
   112257 { set +x
   112258 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112259 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112260 ( $at_check_trace;  $PREPARSER ./calc input
   112261 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112262 at_status=$? at_failed=false
   112263 $at_check_filter
   112264 echo stderr:; tee stderr <"$at_stderr"
   112265 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112266 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112267 $at_failed && at_fn_log_failure
   112268 $at_traceon; }
   112269 
   112270 { set +x
   112271 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112272 at_fn_check_prepare_trace "calc.at:685"
   112273 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112274 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112275 at_status=$? at_failed=false
   112276 $at_check_filter
   112277 echo stderr:; tee stderr <"$at_stderr"
   112278 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112279 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112280 $at_failed && at_fn_log_failure
   112281 $at_traceon; }
   112282 
   112283 
   112284 
   112285 
   112286 # Some syntax errors.
   112287 cat >input <<'_ATEOF'
   112288 1 2
   112289 _ATEOF
   112290 
   112291 { set +x
   112292 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112293 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112294 ( $at_check_trace;  $PREPARSER ./calc input
   112295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112296 at_status=$? at_failed=false
   112297 $at_check_filter
   112298 echo stderr:; tee stderr <"$at_stderr"
   112299 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112300 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685"
   112301 $at_failed && at_fn_log_failure
   112302 $at_traceon; }
   112303 
   112304 { set +x
   112305 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112306 at_fn_check_prepare_trace "calc.at:685"
   112307 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112309 at_status=$? at_failed=false
   112310 $at_check_filter
   112311 echo stderr:; tee stderr <"$at_stderr"
   112312 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112313 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112314 $at_failed && at_fn_log_failure
   112315 $at_traceon; }
   112316 
   112317 
   112318 
   112319 # Normalize the observed and expected error messages, depending upon the
   112320 # options.
   112321 # 1. Remove the traces from observed.
   112322 sed '/^Starting/d
   112323 /^Entering/d
   112324 /^Stack/d
   112325 /^Reading/d
   112326 /^Reducing/d
   112327 /^Return/d
   112328 /^Shifting/d
   112329 /^state/d
   112330 /^Cleanup:/d
   112331 /^Error:/d
   112332 /^Next/d
   112333 /^Now/d
   112334 /^Discarding/d
   112335 / \$[0-9$]* = /d
   112336 /^yydestructor:/d' stderr >at-stderr
   112337 mv at-stderr stderr
   112338 # 2. Create the reference error message.
   112339 cat >expout <<'_ATEOF'
   112340 1.3: syntax error, unexpected number
   112341 _ATEOF
   112342 
   112343 # 3. If locations are not used, remove them.
   112344 
   112345 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112346 
   112347 # 5. Check
   112348 { set +x
   112349 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112350 at_fn_check_prepare_trace "calc.at:685"
   112351 ( $at_check_trace; cat stderr
   112352 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112353 at_status=$? at_failed=false
   112354 $at_check_filter
   112355 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112356 $at_diff expout "$at_stdout" || at_failed=:
   112357 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112358 $at_failed && at_fn_log_failure
   112359 $at_traceon; }
   112360 
   112361 
   112362 cat >input <<'_ATEOF'
   112363 1//2
   112364 _ATEOF
   112365 
   112366 { set +x
   112367 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112368 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112369 ( $at_check_trace;  $PREPARSER ./calc input
   112370 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112371 at_status=$? at_failed=false
   112372 $at_check_filter
   112373 echo stderr:; tee stderr <"$at_stderr"
   112374 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112375 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685"
   112376 $at_failed && at_fn_log_failure
   112377 $at_traceon; }
   112378 
   112379 { set +x
   112380 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112381 at_fn_check_prepare_trace "calc.at:685"
   112382 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112383 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112384 at_status=$? at_failed=false
   112385 $at_check_filter
   112386 echo stderr:; tee stderr <"$at_stderr"
   112387 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112388 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112389 $at_failed && at_fn_log_failure
   112390 $at_traceon; }
   112391 
   112392 
   112393 
   112394 # Normalize the observed and expected error messages, depending upon the
   112395 # options.
   112396 # 1. Remove the traces from observed.
   112397 sed '/^Starting/d
   112398 /^Entering/d
   112399 /^Stack/d
   112400 /^Reading/d
   112401 /^Reducing/d
   112402 /^Return/d
   112403 /^Shifting/d
   112404 /^state/d
   112405 /^Cleanup:/d
   112406 /^Error:/d
   112407 /^Next/d
   112408 /^Now/d
   112409 /^Discarding/d
   112410 / \$[0-9$]* = /d
   112411 /^yydestructor:/d' stderr >at-stderr
   112412 mv at-stderr stderr
   112413 # 2. Create the reference error message.
   112414 cat >expout <<'_ATEOF'
   112415 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   112416 _ATEOF
   112417 
   112418 # 3. If locations are not used, remove them.
   112419 
   112420 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112421 
   112422 # 5. Check
   112423 { set +x
   112424 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112425 at_fn_check_prepare_trace "calc.at:685"
   112426 ( $at_check_trace; cat stderr
   112427 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112428 at_status=$? at_failed=false
   112429 $at_check_filter
   112430 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112431 $at_diff expout "$at_stdout" || at_failed=:
   112432 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112433 $at_failed && at_fn_log_failure
   112434 $at_traceon; }
   112435 
   112436 
   112437 cat >input <<'_ATEOF'
   112438 error
   112439 _ATEOF
   112440 
   112441 { set +x
   112442 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112443 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112444 ( $at_check_trace;  $PREPARSER ./calc input
   112445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112446 at_status=$? at_failed=false
   112447 $at_check_filter
   112448 echo stderr:; tee stderr <"$at_stderr"
   112449 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112450 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685"
   112451 $at_failed && at_fn_log_failure
   112452 $at_traceon; }
   112453 
   112454 { set +x
   112455 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112456 at_fn_check_prepare_trace "calc.at:685"
   112457 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112459 at_status=$? at_failed=false
   112460 $at_check_filter
   112461 echo stderr:; tee stderr <"$at_stderr"
   112462 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112463 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112464 $at_failed && at_fn_log_failure
   112465 $at_traceon; }
   112466 
   112467 
   112468 
   112469 # Normalize the observed and expected error messages, depending upon the
   112470 # options.
   112471 # 1. Remove the traces from observed.
   112472 sed '/^Starting/d
   112473 /^Entering/d
   112474 /^Stack/d
   112475 /^Reading/d
   112476 /^Reducing/d
   112477 /^Return/d
   112478 /^Shifting/d
   112479 /^state/d
   112480 /^Cleanup:/d
   112481 /^Error:/d
   112482 /^Next/d
   112483 /^Now/d
   112484 /^Discarding/d
   112485 / \$[0-9$]* = /d
   112486 /^yydestructor:/d' stderr >at-stderr
   112487 mv at-stderr stderr
   112488 # 2. Create the reference error message.
   112489 cat >expout <<'_ATEOF'
   112490 1.1: syntax error, unexpected $undefined
   112491 _ATEOF
   112492 
   112493 # 3. If locations are not used, remove them.
   112494 
   112495 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112496 
   112497 # 5. Check
   112498 { set +x
   112499 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112500 at_fn_check_prepare_trace "calc.at:685"
   112501 ( $at_check_trace; cat stderr
   112502 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112503 at_status=$? at_failed=false
   112504 $at_check_filter
   112505 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112506 $at_diff expout "$at_stdout" || at_failed=:
   112507 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112508 $at_failed && at_fn_log_failure
   112509 $at_traceon; }
   112510 
   112511 
   112512 cat >input <<'_ATEOF'
   112513 1 = 2 = 3
   112514 _ATEOF
   112515 
   112516 { set +x
   112517 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112518 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112519 ( $at_check_trace;  $PREPARSER ./calc input
   112520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112521 at_status=$? at_failed=false
   112522 $at_check_filter
   112523 echo stderr:; tee stderr <"$at_stderr"
   112524 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112525 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685"
   112526 $at_failed && at_fn_log_failure
   112527 $at_traceon; }
   112528 
   112529 { set +x
   112530 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112531 at_fn_check_prepare_trace "calc.at:685"
   112532 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112534 at_status=$? at_failed=false
   112535 $at_check_filter
   112536 echo stderr:; tee stderr <"$at_stderr"
   112537 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112538 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112539 $at_failed && at_fn_log_failure
   112540 $at_traceon; }
   112541 
   112542 
   112543 
   112544 # Normalize the observed and expected error messages, depending upon the
   112545 # options.
   112546 # 1. Remove the traces from observed.
   112547 sed '/^Starting/d
   112548 /^Entering/d
   112549 /^Stack/d
   112550 /^Reading/d
   112551 /^Reducing/d
   112552 /^Return/d
   112553 /^Shifting/d
   112554 /^state/d
   112555 /^Cleanup:/d
   112556 /^Error:/d
   112557 /^Next/d
   112558 /^Now/d
   112559 /^Discarding/d
   112560 / \$[0-9$]* = /d
   112561 /^yydestructor:/d' stderr >at-stderr
   112562 mv at-stderr stderr
   112563 # 2. Create the reference error message.
   112564 cat >expout <<'_ATEOF'
   112565 1.7: syntax error, unexpected '='
   112566 _ATEOF
   112567 
   112568 # 3. If locations are not used, remove them.
   112569 
   112570 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112571 
   112572 # 5. Check
   112573 { set +x
   112574 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112575 at_fn_check_prepare_trace "calc.at:685"
   112576 ( $at_check_trace; cat stderr
   112577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112578 at_status=$? at_failed=false
   112579 $at_check_filter
   112580 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112581 $at_diff expout "$at_stdout" || at_failed=:
   112582 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112583 $at_failed && at_fn_log_failure
   112584 $at_traceon; }
   112585 
   112586 
   112587 cat >input <<'_ATEOF'
   112588 
   112589 +1
   112590 _ATEOF
   112591 
   112592 { set +x
   112593 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112594 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112595 ( $at_check_trace;  $PREPARSER ./calc input
   112596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112597 at_status=$? at_failed=false
   112598 $at_check_filter
   112599 echo stderr:; tee stderr <"$at_stderr"
   112600 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112601 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685"
   112602 $at_failed && at_fn_log_failure
   112603 $at_traceon; }
   112604 
   112605 { set +x
   112606 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112607 at_fn_check_prepare_trace "calc.at:685"
   112608 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112610 at_status=$? at_failed=false
   112611 $at_check_filter
   112612 echo stderr:; tee stderr <"$at_stderr"
   112613 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112614 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112615 $at_failed && at_fn_log_failure
   112616 $at_traceon; }
   112617 
   112618 
   112619 
   112620 # Normalize the observed and expected error messages, depending upon the
   112621 # options.
   112622 # 1. Remove the traces from observed.
   112623 sed '/^Starting/d
   112624 /^Entering/d
   112625 /^Stack/d
   112626 /^Reading/d
   112627 /^Reducing/d
   112628 /^Return/d
   112629 /^Shifting/d
   112630 /^state/d
   112631 /^Cleanup:/d
   112632 /^Error:/d
   112633 /^Next/d
   112634 /^Now/d
   112635 /^Discarding/d
   112636 / \$[0-9$]* = /d
   112637 /^yydestructor:/d' stderr >at-stderr
   112638 mv at-stderr stderr
   112639 # 2. Create the reference error message.
   112640 cat >expout <<'_ATEOF'
   112641 2.1: syntax error, unexpected '+'
   112642 _ATEOF
   112643 
   112644 # 3. If locations are not used, remove them.
   112645 
   112646 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112647 
   112648 # 5. Check
   112649 { set +x
   112650 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112651 at_fn_check_prepare_trace "calc.at:685"
   112652 ( $at_check_trace; cat stderr
   112653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112654 at_status=$? at_failed=false
   112655 $at_check_filter
   112656 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112657 $at_diff expout "$at_stdout" || at_failed=:
   112658 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112659 $at_failed && at_fn_log_failure
   112660 $at_traceon; }
   112661 
   112662 
   112663 # Exercise error messages with EOF: work on an empty file.
   112664 { set +x
   112665 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc /dev/null"
   112666 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:685"
   112667 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   112668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112669 at_status=$? at_failed=false
   112670 $at_check_filter
   112671 echo stderr:; tee stderr <"$at_stderr"
   112672 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112673 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685"
   112674 $at_failed && at_fn_log_failure
   112675 $at_traceon; }
   112676 
   112677 { set +x
   112678 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112679 at_fn_check_prepare_trace "calc.at:685"
   112680 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112681 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112682 at_status=$? at_failed=false
   112683 $at_check_filter
   112684 echo stderr:; tee stderr <"$at_stderr"
   112685 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112686 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112687 $at_failed && at_fn_log_failure
   112688 $at_traceon; }
   112689 
   112690 
   112691 
   112692 # Normalize the observed and expected error messages, depending upon the
   112693 # options.
   112694 # 1. Remove the traces from observed.
   112695 sed '/^Starting/d
   112696 /^Entering/d
   112697 /^Stack/d
   112698 /^Reading/d
   112699 /^Reducing/d
   112700 /^Return/d
   112701 /^Shifting/d
   112702 /^state/d
   112703 /^Cleanup:/d
   112704 /^Error:/d
   112705 /^Next/d
   112706 /^Now/d
   112707 /^Discarding/d
   112708 / \$[0-9$]* = /d
   112709 /^yydestructor:/d' stderr >at-stderr
   112710 mv at-stderr stderr
   112711 # 2. Create the reference error message.
   112712 cat >expout <<'_ATEOF'
   112713 1.1: syntax error, unexpected end of input
   112714 _ATEOF
   112715 
   112716 # 3. If locations are not used, remove them.
   112717 
   112718 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112719 
   112720 # 5. Check
   112721 { set +x
   112722 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112723 at_fn_check_prepare_trace "calc.at:685"
   112724 ( $at_check_trace; cat stderr
   112725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112726 at_status=$? at_failed=false
   112727 $at_check_filter
   112728 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112729 $at_diff expout "$at_stdout" || at_failed=:
   112730 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112731 $at_failed && at_fn_log_failure
   112732 $at_traceon; }
   112733 
   112734 
   112735 
   112736 # Exercise the error token: without it, we die at the first error,
   112737 # hence be sure to
   112738 #
   112739 # - have several errors which exercise different shift/discardings
   112740 #   - (): nothing to pop, nothing to discard
   112741 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   112742 #   - (* * *): nothing to pop, a lot to discard
   112743 #   - (1 + 2 * *): some to pop and discard
   112744 #
   112745 # - test the action associated to `error'
   112746 #
   112747 # - check the lookahead that triggers an error is not discarded
   112748 #   when we enter error recovery.  Below, the lookahead causing the
   112749 #   first error is ")", which is needed to recover from the error and
   112750 #   produce the "0" that triggers the "0 != 1" error.
   112751 #
   112752 cat >input <<'_ATEOF'
   112753 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   112754 _ATEOF
   112755 
   112756 { set +x
   112757 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112758 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112759 ( $at_check_trace;  $PREPARSER ./calc input
   112760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112761 at_status=$? at_failed=false
   112762 $at_check_filter
   112763 echo stderr:; tee stderr <"$at_stderr"
   112764 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112765 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112766 $at_failed && at_fn_log_failure
   112767 $at_traceon; }
   112768 
   112769 { set +x
   112770 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112771 at_fn_check_prepare_trace "calc.at:685"
   112772 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112774 at_status=$? at_failed=false
   112775 $at_check_filter
   112776 echo stderr:; tee stderr <"$at_stderr"
   112777 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112778 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112779 $at_failed && at_fn_log_failure
   112780 $at_traceon; }
   112781 
   112782 
   112783 
   112784 # Normalize the observed and expected error messages, depending upon the
   112785 # options.
   112786 # 1. Remove the traces from observed.
   112787 sed '/^Starting/d
   112788 /^Entering/d
   112789 /^Stack/d
   112790 /^Reading/d
   112791 /^Reducing/d
   112792 /^Return/d
   112793 /^Shifting/d
   112794 /^state/d
   112795 /^Cleanup:/d
   112796 /^Error:/d
   112797 /^Next/d
   112798 /^Now/d
   112799 /^Discarding/d
   112800 / \$[0-9$]* = /d
   112801 /^yydestructor:/d' stderr >at-stderr
   112802 mv at-stderr stderr
   112803 # 2. Create the reference error message.
   112804 cat >expout <<'_ATEOF'
   112805 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   112806 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   112807 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   112808 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   112809 calc: error: 4444 != 1
   112810 _ATEOF
   112811 
   112812 # 3. If locations are not used, remove them.
   112813 
   112814 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112815 
   112816 # 5. Check
   112817 { set +x
   112818 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112819 at_fn_check_prepare_trace "calc.at:685"
   112820 ( $at_check_trace; cat stderr
   112821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112822 at_status=$? at_failed=false
   112823 $at_check_filter
   112824 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112825 $at_diff expout "$at_stdout" || at_failed=:
   112826 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112827 $at_failed && at_fn_log_failure
   112828 $at_traceon; }
   112829 
   112830 
   112831 
   112832 # The same, but this time exercising explicitly triggered syntax errors.
   112833 # POSIX says the lookahead causing the error should not be discarded.
   112834 cat >input <<'_ATEOF'
   112835 (!) + (1 2) = 1
   112836 _ATEOF
   112837 
   112838 { set +x
   112839 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112840 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112841 ( $at_check_trace;  $PREPARSER ./calc input
   112842 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112843 at_status=$? at_failed=false
   112844 $at_check_filter
   112845 echo stderr:; tee stderr <"$at_stderr"
   112846 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112847 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112848 $at_failed && at_fn_log_failure
   112849 $at_traceon; }
   112850 
   112851 { set +x
   112852 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112853 at_fn_check_prepare_trace "calc.at:685"
   112854 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112855 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112856 at_status=$? at_failed=false
   112857 $at_check_filter
   112858 echo stderr:; tee stderr <"$at_stderr"
   112859 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112860 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112861 $at_failed && at_fn_log_failure
   112862 $at_traceon; }
   112863 
   112864 
   112865 
   112866 # Normalize the observed and expected error messages, depending upon the
   112867 # options.
   112868 # 1. Remove the traces from observed.
   112869 sed '/^Starting/d
   112870 /^Entering/d
   112871 /^Stack/d
   112872 /^Reading/d
   112873 /^Reducing/d
   112874 /^Return/d
   112875 /^Shifting/d
   112876 /^state/d
   112877 /^Cleanup:/d
   112878 /^Error:/d
   112879 /^Next/d
   112880 /^Now/d
   112881 /^Discarding/d
   112882 / \$[0-9$]* = /d
   112883 /^yydestructor:/d' stderr >at-stderr
   112884 mv at-stderr stderr
   112885 # 2. Create the reference error message.
   112886 cat >expout <<'_ATEOF'
   112887 1.10: syntax error, unexpected number
   112888 calc: error: 2222 != 1
   112889 _ATEOF
   112890 
   112891 # 3. If locations are not used, remove them.
   112892 
   112893 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112894 
   112895 # 5. Check
   112896 { set +x
   112897 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112898 at_fn_check_prepare_trace "calc.at:685"
   112899 ( $at_check_trace; cat stderr
   112900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112901 at_status=$? at_failed=false
   112902 $at_check_filter
   112903 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112904 $at_diff expout "$at_stdout" || at_failed=:
   112905 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112906 $at_failed && at_fn_log_failure
   112907 $at_traceon; }
   112908 
   112909 
   112910 cat >input <<'_ATEOF'
   112911 (- *) + (1 2) = 1
   112912 _ATEOF
   112913 
   112914 { set +x
   112915 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112916 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112917 ( $at_check_trace;  $PREPARSER ./calc input
   112918 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112919 at_status=$? at_failed=false
   112920 $at_check_filter
   112921 echo stderr:; tee stderr <"$at_stderr"
   112922 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112923 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112924 $at_failed && at_fn_log_failure
   112925 $at_traceon; }
   112926 
   112927 { set +x
   112928 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   112929 at_fn_check_prepare_trace "calc.at:685"
   112930 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   112931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112932 at_status=$? at_failed=false
   112933 $at_check_filter
   112934 echo stderr:; tee stderr <"$at_stderr"
   112935 at_fn_diff_devnull "$at_stdout" || at_failed=:
   112936 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112937 $at_failed && at_fn_log_failure
   112938 $at_traceon; }
   112939 
   112940 
   112941 
   112942 # Normalize the observed and expected error messages, depending upon the
   112943 # options.
   112944 # 1. Remove the traces from observed.
   112945 sed '/^Starting/d
   112946 /^Entering/d
   112947 /^Stack/d
   112948 /^Reading/d
   112949 /^Reducing/d
   112950 /^Return/d
   112951 /^Shifting/d
   112952 /^state/d
   112953 /^Cleanup:/d
   112954 /^Error:/d
   112955 /^Next/d
   112956 /^Now/d
   112957 /^Discarding/d
   112958 / \$[0-9$]* = /d
   112959 /^yydestructor:/d' stderr >at-stderr
   112960 mv at-stderr stderr
   112961 # 2. Create the reference error message.
   112962 cat >expout <<'_ATEOF'
   112963 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   112964 1.12: syntax error, unexpected number
   112965 calc: error: 2222 != 1
   112966 _ATEOF
   112967 
   112968 # 3. If locations are not used, remove them.
   112969 
   112970 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   112971 
   112972 # 5. Check
   112973 { set +x
   112974 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   112975 at_fn_check_prepare_trace "calc.at:685"
   112976 ( $at_check_trace; cat stderr
   112977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112978 at_status=$? at_failed=false
   112979 $at_check_filter
   112980 at_fn_diff_devnull "$at_stderr" || at_failed=:
   112981 $at_diff expout "$at_stdout" || at_failed=:
   112982 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   112983 $at_failed && at_fn_log_failure
   112984 $at_traceon; }
   112985 
   112986 
   112987 
   112988 # Check that yyerrok works properly: second error is not reported,
   112989 # third and fourth are.  Parse status is succesfull.
   112990 cat >input <<'_ATEOF'
   112991 (* *) + (*) + (*)
   112992 _ATEOF
   112993 
   112994 { set +x
   112995 $as_echo "$at_srcdir/calc.at:685:  \$PREPARSER ./calc input"
   112996 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685"
   112997 ( $at_check_trace;  $PREPARSER ./calc input
   112998 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   112999 at_status=$? at_failed=false
   113000 $at_check_filter
   113001 echo stderr:; tee stderr <"$at_stderr"
   113002 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113003 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   113004 $at_failed && at_fn_log_failure
   113005 $at_traceon; }
   113006 
   113007 { set +x
   113008 $as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113009 at_fn_check_prepare_trace "calc.at:685"
   113010 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113011 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113012 at_status=$? at_failed=false
   113013 $at_check_filter
   113014 echo stderr:; tee stderr <"$at_stderr"
   113015 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113016 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   113017 $at_failed && at_fn_log_failure
   113018 $at_traceon; }
   113019 
   113020 
   113021 
   113022 # Normalize the observed and expected error messages, depending upon the
   113023 # options.
   113024 # 1. Remove the traces from observed.
   113025 sed '/^Starting/d
   113026 /^Entering/d
   113027 /^Stack/d
   113028 /^Reading/d
   113029 /^Reducing/d
   113030 /^Return/d
   113031 /^Shifting/d
   113032 /^state/d
   113033 /^Cleanup:/d
   113034 /^Error:/d
   113035 /^Next/d
   113036 /^Now/d
   113037 /^Discarding/d
   113038 / \$[0-9$]* = /d
   113039 /^yydestructor:/d' stderr >at-stderr
   113040 mv at-stderr stderr
   113041 # 2. Create the reference error message.
   113042 cat >expout <<'_ATEOF'
   113043 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   113044 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   113045 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   113046 _ATEOF
   113047 
   113048 # 3. If locations are not used, remove them.
   113049 
   113050 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   113051 
   113052 # 5. Check
   113053 { set +x
   113054 $as_echo "$at_srcdir/calc.at:685: cat stderr"
   113055 at_fn_check_prepare_trace "calc.at:685"
   113056 ( $at_check_trace; cat stderr
   113057 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113058 at_status=$? at_failed=false
   113059 $at_check_filter
   113060 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113061 $at_diff expout "$at_stdout" || at_failed=:
   113062 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685"
   113063 $at_failed && at_fn_log_failure
   113064 $at_traceon; }
   113065 
   113066 
   113067 
   113068 
   113069 
   113070   set +x
   113071   $at_times_p && times >"$at_times_file"
   113072 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   113073 read at_status <"$at_status_file"
   113074 #AT_STOP_241
   113075 #AT_START_242
   113076 at_fn_group_banner 242 'calc.at:687' \
   113077   "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13
   113078 at_xfail=no
   113079 (
   113080   $as_echo "242. $at_setup_line: testing $at_desc ..."
   113081   $at_traceon
   113082 
   113083 
   113084 
   113085 
   113086 
   113087 
   113088 
   113089 
   113090 
   113091 
   113092 cat >calc.y <<'_ATEOF'
   113093 %code top {
   113094 #include <config.h>
   113095 /* We don't need perfect functions for these tests. */
   113096 #undef malloc
   113097 #undef memcmp
   113098 #undef realloc
   113099 }
   113100 
   113101 /* Infix notation calculator--calc */
   113102 %language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   113103 %define global_tokens_and_yystype
   113104 %code requires
   113105 {
   113106 
   113107   /* Exercise pre-prologue dependency to %union.  */
   113108   typedef int semantic_value;
   113109 }
   113110 
   113111 /* Exercise %union. */
   113112 %union
   113113 {
   113114   semantic_value ival;
   113115 };
   113116 %printer { yyoutput << $$; } <ival>;
   113117 
   113118 %code provides
   113119 {
   113120   #include <stdio.h>
   113121   /* The input.  */
   113122   extern FILE *input;
   113123   extern semantic_value global_result;
   113124   extern int global_count;
   113125 }
   113126 
   113127 %code
   113128 {
   113129 #include <assert.h>
   113130 #include <string.h>
   113131 #define USE(Var)
   113132 
   113133 FILE *input;
   113134 static int power (int base, int exponent);
   113135 
   113136 
   113137 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   113138 }
   113139 
   113140 
   113141 
   113142 /* Bison Declarations */
   113143 %token CALC_EOF 0 "end of input"
   113144 %token <ival> NUM "number"
   113145 %type  <ival> exp
   113146 
   113147 %nonassoc '=' /* comparison            */
   113148 %left '-' '+'
   113149 %left '*' '/'
   113150 %left NEG     /* negation--unary minus */
   113151 %right '^'    /* exponentiation        */
   113152 
   113153 /* Grammar follows */
   113154 %%
   113155 input:
   113156   line
   113157 | input line         { ++*count; ++global_count; }
   113158 ;
   113159 
   113160 line:
   113161   '\n'
   113162 | exp '\n'           { *result = global_result = $1; }
   113163 ;
   113164 
   113165 exp:
   113166   NUM                { $$ = $1;             }
   113167 | exp '=' exp
   113168   {
   113169     if ($1 != $3)
   113170       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   113171     $$ = $1;
   113172   }
   113173 | exp '+' exp        { $$ = $1 + $3;        }
   113174 | exp '-' exp        { $$ = $1 - $3;        }
   113175 | exp '*' exp        { $$ = $1 * $3;        }
   113176 | exp '/' exp        { $$ = $1 / $3;        }
   113177 | '-' exp  %prec NEG { $$ = -$2;            }
   113178 | exp '^' exp        { $$ = power ($1, $3); }
   113179 | '(' exp ')'        { $$ = $2;             }
   113180 | '(' error ')'      { $$ = 1111; yyerrok;  }
   113181 | '!'                { $$ = 0; YYERROR;     }
   113182 | '-' error          { $$ = 0; YYERROR;     }
   113183 ;
   113184 %%
   113185 
   113186 static int
   113187 power (int base, int exponent)
   113188 {
   113189   int res = 1;
   113190   assert (0 <= exponent);
   113191   for (/* Niente */; exponent; --exponent)
   113192     res *= base;
   113193   return res;
   113194 }
   113195 
   113196 
   113197 /* A C++ error reporting function.  */
   113198 void
   113199 calc::parser::error (const location_type& l, const std::string& m)
   113200 {
   113201   (void) l;
   113202   std::cerr << l << ": " << m << std::endl;
   113203 }
   113204 _ATEOF
   113205 
   113206 
   113207 
   113208 cat >calc-lex.cc <<'_ATEOF'
   113209 #include <config.h>
   113210 /* We don't need perfect functions for these tests. */
   113211 #undef malloc
   113212 #undef memcmp
   113213 #undef realloc
   113214 
   113215 #include "calc.hh"
   113216 
   113217 #include <ctype.h>
   113218 
   113219 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   113220 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   113221 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   113222 
   113223 
   113224 static calc::parser::location_type last_yylloc;
   113225 
   113226 static int
   113227 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   113228 {
   113229   int res = getc (input);
   113230   (void) lvalp;(void) llocp;
   113231 
   113232   last_yylloc = (*llocp);
   113233   if (res == '\n')
   113234     {
   113235       (*llocp).end.line++;
   113236       (*llocp).end.column = 1;
   113237     }
   113238   else
   113239     (*llocp).end.column++;
   113240 
   113241   return res;
   113242 }
   113243 
   113244 static void
   113245 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   113246 {
   113247   (void) lvalp;(void) llocp;
   113248 
   113249   /* Wrong when C == `\n'. */
   113250   (*llocp) = last_yylloc;
   113251 
   113252   ungetc (c, input);
   113253 }
   113254 
   113255 static int
   113256 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   113257 {
   113258   int c = get_char (lvalp, llocp);
   113259   int sign = 1;
   113260   int n = 0;
   113261 
   113262   (void) lvalp;(void) llocp;
   113263   if (c == '-')
   113264     {
   113265       c = get_char (lvalp, llocp);
   113266       sign = -1;
   113267     }
   113268 
   113269   while (isdigit (c))
   113270     {
   113271       n = 10 * n + (c - '0');
   113272       c = get_char (lvalp, llocp);
   113273     }
   113274 
   113275   unget_char (lvalp, llocp,  c);
   113276 
   113277   return sign * n;
   113278 }
   113279 
   113280 
   113281 /*---------------------------------------------------------------.
   113282 | Lexical analyzer returns an integer on the stack and the token |
   113283 | NUM, or the ASCII character read if not a number.  Skips all   |
   113284 | blanks and tabs, returns 0 for EOF.                            |
   113285 `---------------------------------------------------------------*/
   113286 
   113287 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   113288 {
   113289   int c;
   113290   /* Skip current token, then white spaces.  */
   113291   do
   113292     {
   113293      (*llocp).begin.column = (*llocp).end.column;
   113294       (*llocp).begin.line   = (*llocp).end.line;
   113295 
   113296     }
   113297   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   113298 
   113299   /* process numbers   */
   113300   if (c == '.' || isdigit (c))
   113301     {
   113302       unget_char (lvalp, llocp,  c);
   113303       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   113304       return NUM;
   113305     }
   113306 
   113307   /* Return end-of-file.  */
   113308   if (c == EOF)
   113309     return CALC_EOF;
   113310 
   113311   /* Return single chars. */
   113312   return c;
   113313 }
   113314 _ATEOF
   113315 
   113316 
   113317 cat >calc-main.cc <<'_ATEOF'
   113318 #include <config.h>
   113319 /* We don't need perfect functions for these tests. */
   113320 #undef malloc
   113321 #undef memcmp
   113322 #undef realloc
   113323 
   113324 #include "calc.hh"
   113325 
   113326 #include <assert.h>
   113327 #if HAVE_UNISTD_H
   113328 # include <unistd.h>
   113329 #else
   113330 # undef alarm
   113331 # define alarm(seconds) /* empty */
   113332 #endif
   113333 
   113334 
   113335 /* A C++ calcparse that simulates the C signature.  */
   113336 int
   113337 calcparse (semantic_value *result, int *count)
   113338 {
   113339   calc::parser parser (result, count);
   113340 #if YYDEBUG
   113341   parser.set_debug_level (1);
   113342 #endif
   113343   return parser.parse ();
   113344 }
   113345 
   113346 
   113347 semantic_value global_result = 0;
   113348 int global_count = 0;
   113349 
   113350 /* A C main function.  */
   113351 int
   113352 main (int argc, const char **argv)
   113353 {
   113354   semantic_value result = 0;
   113355   int count = 0;
   113356   int status;
   113357 
   113358   /* This used to be alarm (10), but that isn't enough time for
   113359      a July 1995 vintage DEC Alphastation 200 4/100 system,
   113360      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   113361   alarm (100);
   113362 
   113363   if (argc == 2)
   113364     input = fopen (argv[1], "r");
   113365   else
   113366     input = stdin;
   113367 
   113368   if (!input)
   113369     {
   113370       perror (argv[1]);
   113371       return 3;
   113372     }
   113373 
   113374 
   113375   status = calcparse (&result, &count);
   113376   if (fclose (input))
   113377     perror ("fclose");
   113378   assert (global_result == result);
   113379   assert (global_count == count);
   113380   return status;
   113381 }
   113382 _ATEOF
   113383 
   113384 
   113385 
   113386 
   113387 
   113388 
   113389 
   113390 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   113391   at_save_special_files
   113392   mkdir xml-tests
   113393     # Don't combine these Bison invocations since we want to be sure that
   113394   # --report=all isn't required to get the full XML file.
   113395   { set +x
   113396 $as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   113397                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   113398 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687"
   113399 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   113400                   --graph=xml-tests/test.dot -o calc.cc calc.y
   113401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113402 at_status=$? at_failed=false
   113403 $at_check_filter
   113404 echo stderr:; cat "$at_stderr"
   113405 echo stdout:; cat "$at_stdout"
   113406 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113407 $at_failed && at_fn_log_failure
   113408 $at_traceon; }
   113409 
   113410   { set +x
   113411 $as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   113412 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:687"
   113413 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   113414 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113415 at_status=$? at_failed=false
   113416 $at_check_filter
   113417 echo stderr:; cat "$at_stderr"
   113418 echo stdout:; cat "$at_stdout"
   113419 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113420 $at_failed && at_fn_log_failure
   113421 $at_traceon; }
   113422 
   113423     cp xml-tests/test.output expout
   113424   { set +x
   113425 $as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\
   113426              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   113427              xml-tests/test.xml"
   113428 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687"
   113429 ( $at_check_trace; $XSLTPROC \
   113430              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   113431              xml-tests/test.xml
   113432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113433 at_status=$? at_failed=false
   113434 $at_check_filter
   113435 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113436 $at_diff expout "$at_stdout" || at_failed=:
   113437 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113438 $at_failed && at_fn_log_failure
   113439 $at_traceon; }
   113440 
   113441   sort xml-tests/test.dot > expout
   113442   { set +x
   113443 $as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\
   113444              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   113445              xml-tests/test.xml | sort"
   113446 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687"
   113447 ( $at_check_trace; $XSLTPROC \
   113448              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   113449              xml-tests/test.xml | sort
   113450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113451 at_status=$? at_failed=false
   113452 $at_check_filter
   113453 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113454 $at_diff expout "$at_stdout" || at_failed=:
   113455 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113456 $at_failed && at_fn_log_failure
   113457 $at_traceon; }
   113458 
   113459   rm -rf xml-tests expout
   113460   at_restore_special_files
   113461 fi
   113462 { set +x
   113463 $as_echo "$at_srcdir/calc.at:687: bison -o calc.cc calc.y"
   113464 at_fn_check_prepare_trace "calc.at:687"
   113465 ( $at_check_trace; bison -o calc.cc calc.y
   113466 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113467 at_status=$? at_failed=false
   113468 $at_check_filter
   113469 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113470 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113471 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113472 $at_failed && at_fn_log_failure
   113473 $at_traceon; }
   113474 
   113475 
   113476 
   113477 { set +x
   113478 $as_echo "$at_srcdir/calc.at:687: \$BISON_CXX_WORKS"
   113479 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:687"
   113480 ( $at_check_trace; $BISON_CXX_WORKS
   113481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113482 at_status=$? at_failed=false
   113483 $at_check_filter
   113484 echo stderr:; cat "$at_stderr"
   113485 echo stdout:; cat "$at_stdout"
   113486 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113487 $at_failed && at_fn_log_failure
   113488 $at_traceon; }
   113489 
   113490 { set +x
   113491 $as_echo "$at_srcdir/calc.at:687: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   113492 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:687"
   113493 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   113494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113495 at_status=$? at_failed=false
   113496 $at_check_filter
   113497 echo stderr:; cat "$at_stderr"
   113498 echo stdout:; cat "$at_stdout"
   113499 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113500 $at_failed && at_fn_log_failure
   113501 $at_traceon; }
   113502 
   113503 
   113504 { set +x
   113505 $as_echo "$at_srcdir/calc.at:687: \$PERL -ne '
   113506   chomp;
   113507   print \"\$.: {\$_}\\n\"
   113508     if (# No starting/ending empty lines.
   113509         (eof || \$. == 1) && /^\\s*\$/
   113510         # No trailing space.  FIXME: not ready for \"maint\".
   113511         # || /\\s\$/
   113512         )' calc.cc
   113513 "
   113514 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687"
   113515 ( $at_check_trace; $PERL -ne '
   113516   chomp;
   113517   print "$.: {$_}\n"
   113518     if (# No starting/ending empty lines.
   113519         (eof || $. == 1) && /^\s*$/
   113520         # No trailing space.  FIXME: not ready for "maint".
   113521         # || /\s$/
   113522         )' calc.cc
   113523 
   113524 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113525 at_status=$? at_failed=false
   113526 $at_check_filter
   113527 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113528 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113529 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113530 $at_failed && at_fn_log_failure
   113531 $at_traceon; }
   113532 
   113533 { set +x
   113534 $as_echo "$at_srcdir/calc.at:687: \$PERL -ne '
   113535   chomp;
   113536   print \"\$.: {\$_}\\n\"
   113537     if (# No starting/ending empty lines.
   113538         (eof || \$. == 1) && /^\\s*\$/
   113539         # No trailing space.  FIXME: not ready for \"maint\".
   113540         # || /\\s\$/
   113541         )' calc.hh
   113542 "
   113543 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687"
   113544 ( $at_check_trace; $PERL -ne '
   113545   chomp;
   113546   print "$.: {$_}\n"
   113547     if (# No starting/ending empty lines.
   113548         (eof || $. == 1) && /^\s*$/
   113549         # No trailing space.  FIXME: not ready for "maint".
   113550         # || /\s$/
   113551         )' calc.hh
   113552 
   113553 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113554 at_status=$? at_failed=false
   113555 $at_check_filter
   113556 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113557 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113558 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113559 $at_failed && at_fn_log_failure
   113560 $at_traceon; }
   113561 
   113562 
   113563 # Test the priorities.
   113564 cat >input <<'_ATEOF'
   113565 1 + 2 * 3 = 7
   113566 1 + 2 * -3 = -5
   113567 
   113568 -1^2 = -1
   113569 (-1)^2 = 1
   113570 
   113571 ---1 = -1
   113572 
   113573 1 - 2 - 3 = -4
   113574 1 - (2 - 3) = 2
   113575 
   113576 2^2^3 = 256
   113577 (2^2)^3 = 64
   113578 _ATEOF
   113579 
   113580 { set +x
   113581 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   113582 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   113583 ( $at_check_trace;  $PREPARSER ./calc input
   113584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113585 at_status=$? at_failed=false
   113586 $at_check_filter
   113587 echo stderr:; tee stderr <"$at_stderr"
   113588 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113589 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113590 $at_failed && at_fn_log_failure
   113591 $at_traceon; }
   113592 
   113593 { set +x
   113594 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113595 at_fn_check_prepare_trace "calc.at:687"
   113596 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113598 at_status=$? at_failed=false
   113599 $at_check_filter
   113600 echo stderr:; tee stderr <"$at_stderr"
   113601 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113602 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113603 $at_failed && at_fn_log_failure
   113604 $at_traceon; }
   113605 
   113606 
   113607 
   113608 
   113609 # Some syntax errors.
   113610 cat >input <<'_ATEOF'
   113611 1 2
   113612 _ATEOF
   113613 
   113614 { set +x
   113615 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   113616 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   113617 ( $at_check_trace;  $PREPARSER ./calc input
   113618 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113619 at_status=$? at_failed=false
   113620 $at_check_filter
   113621 echo stderr:; tee stderr <"$at_stderr"
   113622 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113623 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
   113624 $at_failed && at_fn_log_failure
   113625 $at_traceon; }
   113626 
   113627 { set +x
   113628 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113629 at_fn_check_prepare_trace "calc.at:687"
   113630 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113631 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113632 at_status=$? at_failed=false
   113633 $at_check_filter
   113634 echo stderr:; tee stderr <"$at_stderr"
   113635 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113636 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113637 $at_failed && at_fn_log_failure
   113638 $at_traceon; }
   113639 
   113640 
   113641 
   113642 # Normalize the observed and expected error messages, depending upon the
   113643 # options.
   113644 # 1. Remove the traces from observed.
   113645 sed '/^Starting/d
   113646 /^Entering/d
   113647 /^Stack/d
   113648 /^Reading/d
   113649 /^Reducing/d
   113650 /^Return/d
   113651 /^Shifting/d
   113652 /^state/d
   113653 /^Cleanup:/d
   113654 /^Error:/d
   113655 /^Next/d
   113656 /^Now/d
   113657 /^Discarding/d
   113658 / \$[0-9$]* = /d
   113659 /^yydestructor:/d' stderr >at-stderr
   113660 mv at-stderr stderr
   113661 # 2. Create the reference error message.
   113662 cat >expout <<'_ATEOF'
   113663 1.3: syntax error, unexpected number
   113664 _ATEOF
   113665 
   113666 # 3. If locations are not used, remove them.
   113667 
   113668 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   113669 
   113670 # 5. Check
   113671 { set +x
   113672 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   113673 at_fn_check_prepare_trace "calc.at:687"
   113674 ( $at_check_trace; cat stderr
   113675 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113676 at_status=$? at_failed=false
   113677 $at_check_filter
   113678 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113679 $at_diff expout "$at_stdout" || at_failed=:
   113680 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113681 $at_failed && at_fn_log_failure
   113682 $at_traceon; }
   113683 
   113684 
   113685 cat >input <<'_ATEOF'
   113686 1//2
   113687 _ATEOF
   113688 
   113689 { set +x
   113690 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   113691 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   113692 ( $at_check_trace;  $PREPARSER ./calc input
   113693 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113694 at_status=$? at_failed=false
   113695 $at_check_filter
   113696 echo stderr:; tee stderr <"$at_stderr"
   113697 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113698 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
   113699 $at_failed && at_fn_log_failure
   113700 $at_traceon; }
   113701 
   113702 { set +x
   113703 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113704 at_fn_check_prepare_trace "calc.at:687"
   113705 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113707 at_status=$? at_failed=false
   113708 $at_check_filter
   113709 echo stderr:; tee stderr <"$at_stderr"
   113710 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113711 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113712 $at_failed && at_fn_log_failure
   113713 $at_traceon; }
   113714 
   113715 
   113716 
   113717 # Normalize the observed and expected error messages, depending upon the
   113718 # options.
   113719 # 1. Remove the traces from observed.
   113720 sed '/^Starting/d
   113721 /^Entering/d
   113722 /^Stack/d
   113723 /^Reading/d
   113724 /^Reducing/d
   113725 /^Return/d
   113726 /^Shifting/d
   113727 /^state/d
   113728 /^Cleanup:/d
   113729 /^Error:/d
   113730 /^Next/d
   113731 /^Now/d
   113732 /^Discarding/d
   113733 / \$[0-9$]* = /d
   113734 /^yydestructor:/d' stderr >at-stderr
   113735 mv at-stderr stderr
   113736 # 2. Create the reference error message.
   113737 cat >expout <<'_ATEOF'
   113738 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   113739 _ATEOF
   113740 
   113741 # 3. If locations are not used, remove them.
   113742 
   113743 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   113744 
   113745 # 5. Check
   113746 { set +x
   113747 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   113748 at_fn_check_prepare_trace "calc.at:687"
   113749 ( $at_check_trace; cat stderr
   113750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113751 at_status=$? at_failed=false
   113752 $at_check_filter
   113753 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113754 $at_diff expout "$at_stdout" || at_failed=:
   113755 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113756 $at_failed && at_fn_log_failure
   113757 $at_traceon; }
   113758 
   113759 
   113760 cat >input <<'_ATEOF'
   113761 error
   113762 _ATEOF
   113763 
   113764 { set +x
   113765 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   113766 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   113767 ( $at_check_trace;  $PREPARSER ./calc input
   113768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113769 at_status=$? at_failed=false
   113770 $at_check_filter
   113771 echo stderr:; tee stderr <"$at_stderr"
   113772 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113773 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
   113774 $at_failed && at_fn_log_failure
   113775 $at_traceon; }
   113776 
   113777 { set +x
   113778 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113779 at_fn_check_prepare_trace "calc.at:687"
   113780 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113782 at_status=$? at_failed=false
   113783 $at_check_filter
   113784 echo stderr:; tee stderr <"$at_stderr"
   113785 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113786 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113787 $at_failed && at_fn_log_failure
   113788 $at_traceon; }
   113789 
   113790 
   113791 
   113792 # Normalize the observed and expected error messages, depending upon the
   113793 # options.
   113794 # 1. Remove the traces from observed.
   113795 sed '/^Starting/d
   113796 /^Entering/d
   113797 /^Stack/d
   113798 /^Reading/d
   113799 /^Reducing/d
   113800 /^Return/d
   113801 /^Shifting/d
   113802 /^state/d
   113803 /^Cleanup:/d
   113804 /^Error:/d
   113805 /^Next/d
   113806 /^Now/d
   113807 /^Discarding/d
   113808 / \$[0-9$]* = /d
   113809 /^yydestructor:/d' stderr >at-stderr
   113810 mv at-stderr stderr
   113811 # 2. Create the reference error message.
   113812 cat >expout <<'_ATEOF'
   113813 1.1: syntax error, unexpected $undefined
   113814 _ATEOF
   113815 
   113816 # 3. If locations are not used, remove them.
   113817 
   113818 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   113819 
   113820 # 5. Check
   113821 { set +x
   113822 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   113823 at_fn_check_prepare_trace "calc.at:687"
   113824 ( $at_check_trace; cat stderr
   113825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113826 at_status=$? at_failed=false
   113827 $at_check_filter
   113828 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113829 $at_diff expout "$at_stdout" || at_failed=:
   113830 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113831 $at_failed && at_fn_log_failure
   113832 $at_traceon; }
   113833 
   113834 
   113835 cat >input <<'_ATEOF'
   113836 1 = 2 = 3
   113837 _ATEOF
   113838 
   113839 { set +x
   113840 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   113841 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   113842 ( $at_check_trace;  $PREPARSER ./calc input
   113843 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113844 at_status=$? at_failed=false
   113845 $at_check_filter
   113846 echo stderr:; tee stderr <"$at_stderr"
   113847 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113848 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
   113849 $at_failed && at_fn_log_failure
   113850 $at_traceon; }
   113851 
   113852 { set +x
   113853 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113854 at_fn_check_prepare_trace "calc.at:687"
   113855 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113856 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113857 at_status=$? at_failed=false
   113858 $at_check_filter
   113859 echo stderr:; tee stderr <"$at_stderr"
   113860 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113861 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113862 $at_failed && at_fn_log_failure
   113863 $at_traceon; }
   113864 
   113865 
   113866 
   113867 # Normalize the observed and expected error messages, depending upon the
   113868 # options.
   113869 # 1. Remove the traces from observed.
   113870 sed '/^Starting/d
   113871 /^Entering/d
   113872 /^Stack/d
   113873 /^Reading/d
   113874 /^Reducing/d
   113875 /^Return/d
   113876 /^Shifting/d
   113877 /^state/d
   113878 /^Cleanup:/d
   113879 /^Error:/d
   113880 /^Next/d
   113881 /^Now/d
   113882 /^Discarding/d
   113883 / \$[0-9$]* = /d
   113884 /^yydestructor:/d' stderr >at-stderr
   113885 mv at-stderr stderr
   113886 # 2. Create the reference error message.
   113887 cat >expout <<'_ATEOF'
   113888 1.7: syntax error, unexpected '='
   113889 _ATEOF
   113890 
   113891 # 3. If locations are not used, remove them.
   113892 
   113893 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   113894 
   113895 # 5. Check
   113896 { set +x
   113897 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   113898 at_fn_check_prepare_trace "calc.at:687"
   113899 ( $at_check_trace; cat stderr
   113900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113901 at_status=$? at_failed=false
   113902 $at_check_filter
   113903 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113904 $at_diff expout "$at_stdout" || at_failed=:
   113905 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113906 $at_failed && at_fn_log_failure
   113907 $at_traceon; }
   113908 
   113909 
   113910 cat >input <<'_ATEOF'
   113911 
   113912 +1
   113913 _ATEOF
   113914 
   113915 { set +x
   113916 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   113917 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   113918 ( $at_check_trace;  $PREPARSER ./calc input
   113919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113920 at_status=$? at_failed=false
   113921 $at_check_filter
   113922 echo stderr:; tee stderr <"$at_stderr"
   113923 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113924 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
   113925 $at_failed && at_fn_log_failure
   113926 $at_traceon; }
   113927 
   113928 { set +x
   113929 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   113930 at_fn_check_prepare_trace "calc.at:687"
   113931 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   113932 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113933 at_status=$? at_failed=false
   113934 $at_check_filter
   113935 echo stderr:; tee stderr <"$at_stderr"
   113936 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113937 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113938 $at_failed && at_fn_log_failure
   113939 $at_traceon; }
   113940 
   113941 
   113942 
   113943 # Normalize the observed and expected error messages, depending upon the
   113944 # options.
   113945 # 1. Remove the traces from observed.
   113946 sed '/^Starting/d
   113947 /^Entering/d
   113948 /^Stack/d
   113949 /^Reading/d
   113950 /^Reducing/d
   113951 /^Return/d
   113952 /^Shifting/d
   113953 /^state/d
   113954 /^Cleanup:/d
   113955 /^Error:/d
   113956 /^Next/d
   113957 /^Now/d
   113958 /^Discarding/d
   113959 / \$[0-9$]* = /d
   113960 /^yydestructor:/d' stderr >at-stderr
   113961 mv at-stderr stderr
   113962 # 2. Create the reference error message.
   113963 cat >expout <<'_ATEOF'
   113964 2.1: syntax error, unexpected '+'
   113965 _ATEOF
   113966 
   113967 # 3. If locations are not used, remove them.
   113968 
   113969 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   113970 
   113971 # 5. Check
   113972 { set +x
   113973 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   113974 at_fn_check_prepare_trace "calc.at:687"
   113975 ( $at_check_trace; cat stderr
   113976 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113977 at_status=$? at_failed=false
   113978 $at_check_filter
   113979 at_fn_diff_devnull "$at_stderr" || at_failed=:
   113980 $at_diff expout "$at_stdout" || at_failed=:
   113981 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   113982 $at_failed && at_fn_log_failure
   113983 $at_traceon; }
   113984 
   113985 
   113986 # Exercise error messages with EOF: work on an empty file.
   113987 { set +x
   113988 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc /dev/null"
   113989 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:687"
   113990 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   113991 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   113992 at_status=$? at_failed=false
   113993 $at_check_filter
   113994 echo stderr:; tee stderr <"$at_stderr"
   113995 at_fn_diff_devnull "$at_stdout" || at_failed=:
   113996 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
   113997 $at_failed && at_fn_log_failure
   113998 $at_traceon; }
   113999 
   114000 { set +x
   114001 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114002 at_fn_check_prepare_trace "calc.at:687"
   114003 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114004 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114005 at_status=$? at_failed=false
   114006 $at_check_filter
   114007 echo stderr:; tee stderr <"$at_stderr"
   114008 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114009 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114010 $at_failed && at_fn_log_failure
   114011 $at_traceon; }
   114012 
   114013 
   114014 
   114015 # Normalize the observed and expected error messages, depending upon the
   114016 # options.
   114017 # 1. Remove the traces from observed.
   114018 sed '/^Starting/d
   114019 /^Entering/d
   114020 /^Stack/d
   114021 /^Reading/d
   114022 /^Reducing/d
   114023 /^Return/d
   114024 /^Shifting/d
   114025 /^state/d
   114026 /^Cleanup:/d
   114027 /^Error:/d
   114028 /^Next/d
   114029 /^Now/d
   114030 /^Discarding/d
   114031 / \$[0-9$]* = /d
   114032 /^yydestructor:/d' stderr >at-stderr
   114033 mv at-stderr stderr
   114034 # 2. Create the reference error message.
   114035 cat >expout <<'_ATEOF'
   114036 1.1: syntax error, unexpected end of input
   114037 _ATEOF
   114038 
   114039 # 3. If locations are not used, remove them.
   114040 
   114041 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   114042 
   114043 # 5. Check
   114044 { set +x
   114045 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   114046 at_fn_check_prepare_trace "calc.at:687"
   114047 ( $at_check_trace; cat stderr
   114048 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114049 at_status=$? at_failed=false
   114050 $at_check_filter
   114051 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114052 $at_diff expout "$at_stdout" || at_failed=:
   114053 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114054 $at_failed && at_fn_log_failure
   114055 $at_traceon; }
   114056 
   114057 
   114058 
   114059 # Exercise the error token: without it, we die at the first error,
   114060 # hence be sure to
   114061 #
   114062 # - have several errors which exercise different shift/discardings
   114063 #   - (): nothing to pop, nothing to discard
   114064 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   114065 #   - (* * *): nothing to pop, a lot to discard
   114066 #   - (1 + 2 * *): some to pop and discard
   114067 #
   114068 # - test the action associated to `error'
   114069 #
   114070 # - check the lookahead that triggers an error is not discarded
   114071 #   when we enter error recovery.  Below, the lookahead causing the
   114072 #   first error is ")", which is needed to recover from the error and
   114073 #   produce the "0" that triggers the "0 != 1" error.
   114074 #
   114075 cat >input <<'_ATEOF'
   114076 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   114077 _ATEOF
   114078 
   114079 { set +x
   114080 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   114081 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   114082 ( $at_check_trace;  $PREPARSER ./calc input
   114083 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114084 at_status=$? at_failed=false
   114085 $at_check_filter
   114086 echo stderr:; tee stderr <"$at_stderr"
   114087 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114088 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114089 $at_failed && at_fn_log_failure
   114090 $at_traceon; }
   114091 
   114092 { set +x
   114093 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114094 at_fn_check_prepare_trace "calc.at:687"
   114095 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114097 at_status=$? at_failed=false
   114098 $at_check_filter
   114099 echo stderr:; tee stderr <"$at_stderr"
   114100 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114101 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114102 $at_failed && at_fn_log_failure
   114103 $at_traceon; }
   114104 
   114105 
   114106 
   114107 # Normalize the observed and expected error messages, depending upon the
   114108 # options.
   114109 # 1. Remove the traces from observed.
   114110 sed '/^Starting/d
   114111 /^Entering/d
   114112 /^Stack/d
   114113 /^Reading/d
   114114 /^Reducing/d
   114115 /^Return/d
   114116 /^Shifting/d
   114117 /^state/d
   114118 /^Cleanup:/d
   114119 /^Error:/d
   114120 /^Next/d
   114121 /^Now/d
   114122 /^Discarding/d
   114123 / \$[0-9$]* = /d
   114124 /^yydestructor:/d' stderr >at-stderr
   114125 mv at-stderr stderr
   114126 # 2. Create the reference error message.
   114127 cat >expout <<'_ATEOF'
   114128 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   114129 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   114130 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   114131 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   114132 calc: error: 4444 != 1
   114133 _ATEOF
   114134 
   114135 # 3. If locations are not used, remove them.
   114136 
   114137 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   114138 
   114139 # 5. Check
   114140 { set +x
   114141 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   114142 at_fn_check_prepare_trace "calc.at:687"
   114143 ( $at_check_trace; cat stderr
   114144 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114145 at_status=$? at_failed=false
   114146 $at_check_filter
   114147 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114148 $at_diff expout "$at_stdout" || at_failed=:
   114149 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114150 $at_failed && at_fn_log_failure
   114151 $at_traceon; }
   114152 
   114153 
   114154 
   114155 # The same, but this time exercising explicitly triggered syntax errors.
   114156 # POSIX says the lookahead causing the error should not be discarded.
   114157 cat >input <<'_ATEOF'
   114158 (!) + (1 2) = 1
   114159 _ATEOF
   114160 
   114161 { set +x
   114162 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   114163 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   114164 ( $at_check_trace;  $PREPARSER ./calc input
   114165 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114166 at_status=$? at_failed=false
   114167 $at_check_filter
   114168 echo stderr:; tee stderr <"$at_stderr"
   114169 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114170 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114171 $at_failed && at_fn_log_failure
   114172 $at_traceon; }
   114173 
   114174 { set +x
   114175 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114176 at_fn_check_prepare_trace "calc.at:687"
   114177 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114178 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114179 at_status=$? at_failed=false
   114180 $at_check_filter
   114181 echo stderr:; tee stderr <"$at_stderr"
   114182 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114183 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114184 $at_failed && at_fn_log_failure
   114185 $at_traceon; }
   114186 
   114187 
   114188 
   114189 # Normalize the observed and expected error messages, depending upon the
   114190 # options.
   114191 # 1. Remove the traces from observed.
   114192 sed '/^Starting/d
   114193 /^Entering/d
   114194 /^Stack/d
   114195 /^Reading/d
   114196 /^Reducing/d
   114197 /^Return/d
   114198 /^Shifting/d
   114199 /^state/d
   114200 /^Cleanup:/d
   114201 /^Error:/d
   114202 /^Next/d
   114203 /^Now/d
   114204 /^Discarding/d
   114205 / \$[0-9$]* = /d
   114206 /^yydestructor:/d' stderr >at-stderr
   114207 mv at-stderr stderr
   114208 # 2. Create the reference error message.
   114209 cat >expout <<'_ATEOF'
   114210 1.10: syntax error, unexpected number
   114211 calc: error: 2222 != 1
   114212 _ATEOF
   114213 
   114214 # 3. If locations are not used, remove them.
   114215 
   114216 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   114217 
   114218 # 5. Check
   114219 { set +x
   114220 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   114221 at_fn_check_prepare_trace "calc.at:687"
   114222 ( $at_check_trace; cat stderr
   114223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114224 at_status=$? at_failed=false
   114225 $at_check_filter
   114226 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114227 $at_diff expout "$at_stdout" || at_failed=:
   114228 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114229 $at_failed && at_fn_log_failure
   114230 $at_traceon; }
   114231 
   114232 
   114233 cat >input <<'_ATEOF'
   114234 (- *) + (1 2) = 1
   114235 _ATEOF
   114236 
   114237 { set +x
   114238 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   114239 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   114240 ( $at_check_trace;  $PREPARSER ./calc input
   114241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114242 at_status=$? at_failed=false
   114243 $at_check_filter
   114244 echo stderr:; tee stderr <"$at_stderr"
   114245 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114246 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114247 $at_failed && at_fn_log_failure
   114248 $at_traceon; }
   114249 
   114250 { set +x
   114251 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114252 at_fn_check_prepare_trace "calc.at:687"
   114253 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114255 at_status=$? at_failed=false
   114256 $at_check_filter
   114257 echo stderr:; tee stderr <"$at_stderr"
   114258 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114259 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114260 $at_failed && at_fn_log_failure
   114261 $at_traceon; }
   114262 
   114263 
   114264 
   114265 # Normalize the observed and expected error messages, depending upon the
   114266 # options.
   114267 # 1. Remove the traces from observed.
   114268 sed '/^Starting/d
   114269 /^Entering/d
   114270 /^Stack/d
   114271 /^Reading/d
   114272 /^Reducing/d
   114273 /^Return/d
   114274 /^Shifting/d
   114275 /^state/d
   114276 /^Cleanup:/d
   114277 /^Error:/d
   114278 /^Next/d
   114279 /^Now/d
   114280 /^Discarding/d
   114281 / \$[0-9$]* = /d
   114282 /^yydestructor:/d' stderr >at-stderr
   114283 mv at-stderr stderr
   114284 # 2. Create the reference error message.
   114285 cat >expout <<'_ATEOF'
   114286 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   114287 1.12: syntax error, unexpected number
   114288 calc: error: 2222 != 1
   114289 _ATEOF
   114290 
   114291 # 3. If locations are not used, remove them.
   114292 
   114293 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   114294 
   114295 # 5. Check
   114296 { set +x
   114297 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   114298 at_fn_check_prepare_trace "calc.at:687"
   114299 ( $at_check_trace; cat stderr
   114300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114301 at_status=$? at_failed=false
   114302 $at_check_filter
   114303 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114304 $at_diff expout "$at_stdout" || at_failed=:
   114305 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114306 $at_failed && at_fn_log_failure
   114307 $at_traceon; }
   114308 
   114309 
   114310 
   114311 # Check that yyerrok works properly: second error is not reported,
   114312 # third and fourth are.  Parse status is succesfull.
   114313 cat >input <<'_ATEOF'
   114314 (* *) + (*) + (*)
   114315 _ATEOF
   114316 
   114317 { set +x
   114318 $as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
   114319 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
   114320 ( $at_check_trace;  $PREPARSER ./calc input
   114321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114322 at_status=$? at_failed=false
   114323 $at_check_filter
   114324 echo stderr:; tee stderr <"$at_stderr"
   114325 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114326 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114327 $at_failed && at_fn_log_failure
   114328 $at_traceon; }
   114329 
   114330 { set +x
   114331 $as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114332 at_fn_check_prepare_trace "calc.at:687"
   114333 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114334 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114335 at_status=$? at_failed=false
   114336 $at_check_filter
   114337 echo stderr:; tee stderr <"$at_stderr"
   114338 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114339 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114340 $at_failed && at_fn_log_failure
   114341 $at_traceon; }
   114342 
   114343 
   114344 
   114345 # Normalize the observed and expected error messages, depending upon the
   114346 # options.
   114347 # 1. Remove the traces from observed.
   114348 sed '/^Starting/d
   114349 /^Entering/d
   114350 /^Stack/d
   114351 /^Reading/d
   114352 /^Reducing/d
   114353 /^Return/d
   114354 /^Shifting/d
   114355 /^state/d
   114356 /^Cleanup:/d
   114357 /^Error:/d
   114358 /^Next/d
   114359 /^Now/d
   114360 /^Discarding/d
   114361 / \$[0-9$]* = /d
   114362 /^yydestructor:/d' stderr >at-stderr
   114363 mv at-stderr stderr
   114364 # 2. Create the reference error message.
   114365 cat >expout <<'_ATEOF'
   114366 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   114367 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   114368 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   114369 _ATEOF
   114370 
   114371 # 3. If locations are not used, remove them.
   114372 
   114373 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   114374 
   114375 # 5. Check
   114376 { set +x
   114377 $as_echo "$at_srcdir/calc.at:687: cat stderr"
   114378 at_fn_check_prepare_trace "calc.at:687"
   114379 ( $at_check_trace; cat stderr
   114380 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114381 at_status=$? at_failed=false
   114382 $at_check_filter
   114383 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114384 $at_diff expout "$at_stdout" || at_failed=:
   114385 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
   114386 $at_failed && at_fn_log_failure
   114387 $at_traceon; }
   114388 
   114389 
   114390 
   114391 
   114392 
   114393   set +x
   114394   $at_times_p && times >"$at_times_file"
   114395 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   114396 read at_status <"$at_status_file"
   114397 #AT_STOP_242
   114398 #AT_START_243
   114399 at_fn_group_banner 243 'calc.at:688' \
   114400   "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13
   114401 at_xfail=no
   114402 (
   114403   $as_echo "243. $at_setup_line: testing $at_desc ..."
   114404   $at_traceon
   114405 
   114406 
   114407 
   114408 
   114409 
   114410 
   114411 
   114412 
   114413 
   114414 
   114415 cat >calc.y <<'_ATEOF'
   114416 %code top {
   114417 #include <config.h>
   114418 /* We don't need perfect functions for these tests. */
   114419 #undef malloc
   114420 #undef memcmp
   114421 #undef realloc
   114422 }
   114423 
   114424 /* Infix notation calculator--calc */
   114425 %language "C++" %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   114426 %define global_tokens_and_yystype
   114427 %code requires
   114428 {
   114429 
   114430   /* Exercise pre-prologue dependency to %union.  */
   114431   typedef int semantic_value;
   114432 }
   114433 
   114434 /* Exercise %union. */
   114435 %union
   114436 {
   114437   semantic_value ival;
   114438 };
   114439 %printer { yyoutput << $$; } <ival>;
   114440 
   114441 %code provides
   114442 {
   114443   #include <stdio.h>
   114444   /* The input.  */
   114445   extern FILE *input;
   114446   extern semantic_value global_result;
   114447   extern int global_count;
   114448 }
   114449 
   114450 %code
   114451 {
   114452 #include <assert.h>
   114453 #include <string.h>
   114454 #define USE(Var)
   114455 
   114456 FILE *input;
   114457 static int power (int base, int exponent);
   114458 
   114459 
   114460 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   114461 }
   114462 
   114463 
   114464 
   114465 /* Bison Declarations */
   114466 %token CALC_EOF 0 "end of input"
   114467 %token <ival> NUM "number"
   114468 %type  <ival> exp
   114469 
   114470 %nonassoc '=' /* comparison            */
   114471 %left '-' '+'
   114472 %left '*' '/'
   114473 %left NEG     /* negation--unary minus */
   114474 %right '^'    /* exponentiation        */
   114475 
   114476 /* Grammar follows */
   114477 %%
   114478 input:
   114479   line
   114480 | input line         { ++*count; ++global_count; }
   114481 ;
   114482 
   114483 line:
   114484   '\n'
   114485 | exp '\n'           { *result = global_result = $1; }
   114486 ;
   114487 
   114488 exp:
   114489   NUM                { $$ = $1;             }
   114490 | exp '=' exp
   114491   {
   114492     if ($1 != $3)
   114493       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   114494     $$ = $1;
   114495   }
   114496 | exp '+' exp        { $$ = $1 + $3;        }
   114497 | exp '-' exp        { $$ = $1 - $3;        }
   114498 | exp '*' exp        { $$ = $1 * $3;        }
   114499 | exp '/' exp        { $$ = $1 / $3;        }
   114500 | '-' exp  %prec NEG { $$ = -$2;            }
   114501 | exp '^' exp        { $$ = power ($1, $3); }
   114502 | '(' exp ')'        { $$ = $2;             }
   114503 | '(' error ')'      { $$ = 1111; yyerrok;  }
   114504 | '!'                { $$ = 0; YYERROR;     }
   114505 | '-' error          { $$ = 0; YYERROR;     }
   114506 ;
   114507 %%
   114508 
   114509 static int
   114510 power (int base, int exponent)
   114511 {
   114512   int res = 1;
   114513   assert (0 <= exponent);
   114514   for (/* Niente */; exponent; --exponent)
   114515     res *= base;
   114516   return res;
   114517 }
   114518 
   114519 
   114520 /* A C++ error reporting function.  */
   114521 void
   114522 calc::parser::error (const location_type& l, const std::string& m)
   114523 {
   114524   (void) l;
   114525   std::cerr << l << ": " << m << std::endl;
   114526 }
   114527 _ATEOF
   114528 
   114529 
   114530 
   114531 cat >calc-lex.cc <<'_ATEOF'
   114532 #include <config.h>
   114533 /* We don't need perfect functions for these tests. */
   114534 #undef malloc
   114535 #undef memcmp
   114536 #undef realloc
   114537 
   114538 #include "calc.hh"
   114539 
   114540 #include <ctype.h>
   114541 
   114542 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   114543 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   114544 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   114545 
   114546 
   114547 static calc::parser::location_type last_yylloc;
   114548 
   114549 static int
   114550 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   114551 {
   114552   int res = getc (input);
   114553   (void) lvalp;(void) llocp;
   114554 
   114555   last_yylloc = (*llocp);
   114556   if (res == '\n')
   114557     {
   114558       (*llocp).end.line++;
   114559       (*llocp).end.column = 1;
   114560     }
   114561   else
   114562     (*llocp).end.column++;
   114563 
   114564   return res;
   114565 }
   114566 
   114567 static void
   114568 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   114569 {
   114570   (void) lvalp;(void) llocp;
   114571 
   114572   /* Wrong when C == `\n'. */
   114573   (*llocp) = last_yylloc;
   114574 
   114575   ungetc (c, input);
   114576 }
   114577 
   114578 static int
   114579 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   114580 {
   114581   int c = get_char (lvalp, llocp);
   114582   int sign = 1;
   114583   int n = 0;
   114584 
   114585   (void) lvalp;(void) llocp;
   114586   if (c == '-')
   114587     {
   114588       c = get_char (lvalp, llocp);
   114589       sign = -1;
   114590     }
   114591 
   114592   while (isdigit (c))
   114593     {
   114594       n = 10 * n + (c - '0');
   114595       c = get_char (lvalp, llocp);
   114596     }
   114597 
   114598   unget_char (lvalp, llocp,  c);
   114599 
   114600   return sign * n;
   114601 }
   114602 
   114603 
   114604 /*---------------------------------------------------------------.
   114605 | Lexical analyzer returns an integer on the stack and the token |
   114606 | NUM, or the ASCII character read if not a number.  Skips all   |
   114607 | blanks and tabs, returns 0 for EOF.                            |
   114608 `---------------------------------------------------------------*/
   114609 
   114610 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   114611 {
   114612   int c;
   114613   /* Skip current token, then white spaces.  */
   114614   do
   114615     {
   114616      (*llocp).begin.column = (*llocp).end.column;
   114617       (*llocp).begin.line   = (*llocp).end.line;
   114618 
   114619     }
   114620   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   114621 
   114622   /* process numbers   */
   114623   if (c == '.' || isdigit (c))
   114624     {
   114625       unget_char (lvalp, llocp,  c);
   114626       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   114627       return NUM;
   114628     }
   114629 
   114630   /* Return end-of-file.  */
   114631   if (c == EOF)
   114632     return CALC_EOF;
   114633 
   114634   /* Return single chars. */
   114635   return c;
   114636 }
   114637 _ATEOF
   114638 
   114639 
   114640 cat >calc-main.cc <<'_ATEOF'
   114641 #include <config.h>
   114642 /* We don't need perfect functions for these tests. */
   114643 #undef malloc
   114644 #undef memcmp
   114645 #undef realloc
   114646 
   114647 #include "calc.hh"
   114648 
   114649 #include <assert.h>
   114650 #if HAVE_UNISTD_H
   114651 # include <unistd.h>
   114652 #else
   114653 # undef alarm
   114654 # define alarm(seconds) /* empty */
   114655 #endif
   114656 
   114657 
   114658 /* A C++ calcparse that simulates the C signature.  */
   114659 int
   114660 calcparse (semantic_value *result, int *count)
   114661 {
   114662   calc::parser parser (result, count);
   114663 #if CALCDEBUG
   114664   parser.set_debug_level (1);
   114665 #endif
   114666   return parser.parse ();
   114667 }
   114668 
   114669 
   114670 semantic_value global_result = 0;
   114671 int global_count = 0;
   114672 
   114673 /* A C main function.  */
   114674 int
   114675 main (int argc, const char **argv)
   114676 {
   114677   semantic_value result = 0;
   114678   int count = 0;
   114679   int status;
   114680 
   114681   /* This used to be alarm (10), but that isn't enough time for
   114682      a July 1995 vintage DEC Alphastation 200 4/100 system,
   114683      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   114684   alarm (100);
   114685 
   114686   if (argc == 2)
   114687     input = fopen (argv[1], "r");
   114688   else
   114689     input = stdin;
   114690 
   114691   if (!input)
   114692     {
   114693       perror (argv[1]);
   114694       return 3;
   114695     }
   114696 
   114697 
   114698   status = calcparse (&result, &count);
   114699   if (fclose (input))
   114700     perror ("fclose");
   114701   assert (global_result == result);
   114702   assert (global_count == count);
   114703   return status;
   114704 }
   114705 _ATEOF
   114706 
   114707 
   114708 
   114709 
   114710 
   114711 
   114712 
   114713 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   114714   at_save_special_files
   114715   mkdir xml-tests
   114716     # Don't combine these Bison invocations since we want to be sure that
   114717   # --report=all isn't required to get the full XML file.
   114718   { set +x
   114719 $as_echo "$at_srcdir/calc.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   114720                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   114721 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688"
   114722 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   114723                   --graph=xml-tests/test.dot -o calc.cc calc.y
   114724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114725 at_status=$? at_failed=false
   114726 $at_check_filter
   114727 echo stderr:; cat "$at_stderr"
   114728 echo stdout:; cat "$at_stdout"
   114729 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114730 $at_failed && at_fn_log_failure
   114731 $at_traceon; }
   114732 
   114733   { set +x
   114734 $as_echo "$at_srcdir/calc.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   114735 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:688"
   114736 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   114737 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114738 at_status=$? at_failed=false
   114739 $at_check_filter
   114740 echo stderr:; cat "$at_stderr"
   114741 echo stdout:; cat "$at_stdout"
   114742 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114743 $at_failed && at_fn_log_failure
   114744 $at_traceon; }
   114745 
   114746     cp xml-tests/test.output expout
   114747   { set +x
   114748 $as_echo "$at_srcdir/calc.at:688: \$XSLTPROC \\
   114749              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   114750              xml-tests/test.xml"
   114751 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:688"
   114752 ( $at_check_trace; $XSLTPROC \
   114753              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   114754              xml-tests/test.xml
   114755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114756 at_status=$? at_failed=false
   114757 $at_check_filter
   114758 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114759 $at_diff expout "$at_stdout" || at_failed=:
   114760 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114761 $at_failed && at_fn_log_failure
   114762 $at_traceon; }
   114763 
   114764   sort xml-tests/test.dot > expout
   114765   { set +x
   114766 $as_echo "$at_srcdir/calc.at:688: \$XSLTPROC \\
   114767              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   114768              xml-tests/test.xml | sort"
   114769 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:688"
   114770 ( $at_check_trace; $XSLTPROC \
   114771              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   114772              xml-tests/test.xml | sort
   114773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114774 at_status=$? at_failed=false
   114775 $at_check_filter
   114776 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114777 $at_diff expout "$at_stdout" || at_failed=:
   114778 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114779 $at_failed && at_fn_log_failure
   114780 $at_traceon; }
   114781 
   114782   rm -rf xml-tests expout
   114783   at_restore_special_files
   114784 fi
   114785 { set +x
   114786 $as_echo "$at_srcdir/calc.at:688: bison -o calc.cc calc.y"
   114787 at_fn_check_prepare_trace "calc.at:688"
   114788 ( $at_check_trace; bison -o calc.cc calc.y
   114789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114790 at_status=$? at_failed=false
   114791 $at_check_filter
   114792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114793 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114794 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114795 $at_failed && at_fn_log_failure
   114796 $at_traceon; }
   114797 
   114798 
   114799 
   114800 { set +x
   114801 $as_echo "$at_srcdir/calc.at:688: \$BISON_CXX_WORKS"
   114802 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:688"
   114803 ( $at_check_trace; $BISON_CXX_WORKS
   114804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114805 at_status=$? at_failed=false
   114806 $at_check_filter
   114807 echo stderr:; cat "$at_stderr"
   114808 echo stdout:; cat "$at_stdout"
   114809 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114810 $at_failed && at_fn_log_failure
   114811 $at_traceon; }
   114812 
   114813 { set +x
   114814 $as_echo "$at_srcdir/calc.at:688: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   114815 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:688"
   114816 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   114817 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114818 at_status=$? at_failed=false
   114819 $at_check_filter
   114820 echo stderr:; cat "$at_stderr"
   114821 echo stdout:; cat "$at_stdout"
   114822 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114823 $at_failed && at_fn_log_failure
   114824 $at_traceon; }
   114825 
   114826 
   114827 { set +x
   114828 $as_echo "$at_srcdir/calc.at:688: \$PERL -ne '
   114829   chomp;
   114830   print \"\$.: {\$_}\\n\"
   114831     if (# No starting/ending empty lines.
   114832         (eof || \$. == 1) && /^\\s*\$/
   114833         # No trailing space.  FIXME: not ready for \"maint\".
   114834         # || /\\s\$/
   114835         )' calc.cc
   114836 "
   114837 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688"
   114838 ( $at_check_trace; $PERL -ne '
   114839   chomp;
   114840   print "$.: {$_}\n"
   114841     if (# No starting/ending empty lines.
   114842         (eof || $. == 1) && /^\s*$/
   114843         # No trailing space.  FIXME: not ready for "maint".
   114844         # || /\s$/
   114845         )' calc.cc
   114846 
   114847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114848 at_status=$? at_failed=false
   114849 $at_check_filter
   114850 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114851 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114852 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114853 $at_failed && at_fn_log_failure
   114854 $at_traceon; }
   114855 
   114856 { set +x
   114857 $as_echo "$at_srcdir/calc.at:688: \$PERL -ne '
   114858   chomp;
   114859   print \"\$.: {\$_}\\n\"
   114860     if (# No starting/ending empty lines.
   114861         (eof || \$. == 1) && /^\\s*\$/
   114862         # No trailing space.  FIXME: not ready for \"maint\".
   114863         # || /\\s\$/
   114864         )' calc.hh
   114865 "
   114866 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688"
   114867 ( $at_check_trace; $PERL -ne '
   114868   chomp;
   114869   print "$.: {$_}\n"
   114870     if (# No starting/ending empty lines.
   114871         (eof || $. == 1) && /^\s*$/
   114872         # No trailing space.  FIXME: not ready for "maint".
   114873         # || /\s$/
   114874         )' calc.hh
   114875 
   114876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114877 at_status=$? at_failed=false
   114878 $at_check_filter
   114879 at_fn_diff_devnull "$at_stderr" || at_failed=:
   114880 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114881 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114882 $at_failed && at_fn_log_failure
   114883 $at_traceon; }
   114884 
   114885 
   114886 # Test the priorities.
   114887 cat >input <<'_ATEOF'
   114888 1 + 2 * 3 = 7
   114889 1 + 2 * -3 = -5
   114890 
   114891 -1^2 = -1
   114892 (-1)^2 = 1
   114893 
   114894 ---1 = -1
   114895 
   114896 1 - 2 - 3 = -4
   114897 1 - (2 - 3) = 2
   114898 
   114899 2^2^3 = 256
   114900 (2^2)^3 = 64
   114901 _ATEOF
   114902 
   114903 { set +x
   114904 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   114905 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   114906 ( $at_check_trace;  $PREPARSER ./calc input
   114907 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114908 at_status=$? at_failed=false
   114909 $at_check_filter
   114910 echo stderr:; tee stderr <"$at_stderr"
   114911 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114912 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114913 $at_failed && at_fn_log_failure
   114914 $at_traceon; }
   114915 
   114916 { set +x
   114917 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114918 at_fn_check_prepare_trace "calc.at:688"
   114919 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114920 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114921 at_status=$? at_failed=false
   114922 $at_check_filter
   114923 echo stderr:; tee stderr <"$at_stderr"
   114924 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114925 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114926 $at_failed && at_fn_log_failure
   114927 $at_traceon; }
   114928 
   114929 
   114930 
   114931 
   114932 # Some syntax errors.
   114933 cat >input <<'_ATEOF'
   114934 1 2
   114935 _ATEOF
   114936 
   114937 { set +x
   114938 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   114939 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   114940 ( $at_check_trace;  $PREPARSER ./calc input
   114941 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114942 at_status=$? at_failed=false
   114943 $at_check_filter
   114944 echo stderr:; tee stderr <"$at_stderr"
   114945 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114946 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688"
   114947 $at_failed && at_fn_log_failure
   114948 $at_traceon; }
   114949 
   114950 { set +x
   114951 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   114952 at_fn_check_prepare_trace "calc.at:688"
   114953 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   114954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114955 at_status=$? at_failed=false
   114956 $at_check_filter
   114957 echo stderr:; tee stderr <"$at_stderr"
   114958 at_fn_diff_devnull "$at_stdout" || at_failed=:
   114959 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   114960 $at_failed && at_fn_log_failure
   114961 $at_traceon; }
   114962 
   114963 
   114964 
   114965 # Normalize the observed and expected error messages, depending upon the
   114966 # options.
   114967 # 1. Remove the traces from observed.
   114968 sed '/^Starting/d
   114969 /^Entering/d
   114970 /^Stack/d
   114971 /^Reading/d
   114972 /^Reducing/d
   114973 /^Return/d
   114974 /^Shifting/d
   114975 /^state/d
   114976 /^Cleanup:/d
   114977 /^Error:/d
   114978 /^Next/d
   114979 /^Now/d
   114980 /^Discarding/d
   114981 / \$[0-9$]* = /d
   114982 /^yydestructor:/d' stderr >at-stderr
   114983 mv at-stderr stderr
   114984 # 2. Create the reference error message.
   114985 cat >expout <<'_ATEOF'
   114986 1.3: syntax error, unexpected number
   114987 _ATEOF
   114988 
   114989 # 3. If locations are not used, remove them.
   114990 
   114991 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   114992 
   114993 # 5. Check
   114994 { set +x
   114995 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   114996 at_fn_check_prepare_trace "calc.at:688"
   114997 ( $at_check_trace; cat stderr
   114998 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   114999 at_status=$? at_failed=false
   115000 $at_check_filter
   115001 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115002 $at_diff expout "$at_stdout" || at_failed=:
   115003 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115004 $at_failed && at_fn_log_failure
   115005 $at_traceon; }
   115006 
   115007 
   115008 cat >input <<'_ATEOF'
   115009 1//2
   115010 _ATEOF
   115011 
   115012 { set +x
   115013 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115014 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115015 ( $at_check_trace;  $PREPARSER ./calc input
   115016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115017 at_status=$? at_failed=false
   115018 $at_check_filter
   115019 echo stderr:; tee stderr <"$at_stderr"
   115020 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115021 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688"
   115022 $at_failed && at_fn_log_failure
   115023 $at_traceon; }
   115024 
   115025 { set +x
   115026 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115027 at_fn_check_prepare_trace "calc.at:688"
   115028 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115030 at_status=$? at_failed=false
   115031 $at_check_filter
   115032 echo stderr:; tee stderr <"$at_stderr"
   115033 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115034 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115035 $at_failed && at_fn_log_failure
   115036 $at_traceon; }
   115037 
   115038 
   115039 
   115040 # Normalize the observed and expected error messages, depending upon the
   115041 # options.
   115042 # 1. Remove the traces from observed.
   115043 sed '/^Starting/d
   115044 /^Entering/d
   115045 /^Stack/d
   115046 /^Reading/d
   115047 /^Reducing/d
   115048 /^Return/d
   115049 /^Shifting/d
   115050 /^state/d
   115051 /^Cleanup:/d
   115052 /^Error:/d
   115053 /^Next/d
   115054 /^Now/d
   115055 /^Discarding/d
   115056 / \$[0-9$]* = /d
   115057 /^yydestructor:/d' stderr >at-stderr
   115058 mv at-stderr stderr
   115059 # 2. Create the reference error message.
   115060 cat >expout <<'_ATEOF'
   115061 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   115062 _ATEOF
   115063 
   115064 # 3. If locations are not used, remove them.
   115065 
   115066 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115067 
   115068 # 5. Check
   115069 { set +x
   115070 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115071 at_fn_check_prepare_trace "calc.at:688"
   115072 ( $at_check_trace; cat stderr
   115073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115074 at_status=$? at_failed=false
   115075 $at_check_filter
   115076 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115077 $at_diff expout "$at_stdout" || at_failed=:
   115078 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115079 $at_failed && at_fn_log_failure
   115080 $at_traceon; }
   115081 
   115082 
   115083 cat >input <<'_ATEOF'
   115084 error
   115085 _ATEOF
   115086 
   115087 { set +x
   115088 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115089 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115090 ( $at_check_trace;  $PREPARSER ./calc input
   115091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115092 at_status=$? at_failed=false
   115093 $at_check_filter
   115094 echo stderr:; tee stderr <"$at_stderr"
   115095 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115096 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688"
   115097 $at_failed && at_fn_log_failure
   115098 $at_traceon; }
   115099 
   115100 { set +x
   115101 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115102 at_fn_check_prepare_trace "calc.at:688"
   115103 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115105 at_status=$? at_failed=false
   115106 $at_check_filter
   115107 echo stderr:; tee stderr <"$at_stderr"
   115108 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115109 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115110 $at_failed && at_fn_log_failure
   115111 $at_traceon; }
   115112 
   115113 
   115114 
   115115 # Normalize the observed and expected error messages, depending upon the
   115116 # options.
   115117 # 1. Remove the traces from observed.
   115118 sed '/^Starting/d
   115119 /^Entering/d
   115120 /^Stack/d
   115121 /^Reading/d
   115122 /^Reducing/d
   115123 /^Return/d
   115124 /^Shifting/d
   115125 /^state/d
   115126 /^Cleanup:/d
   115127 /^Error:/d
   115128 /^Next/d
   115129 /^Now/d
   115130 /^Discarding/d
   115131 / \$[0-9$]* = /d
   115132 /^yydestructor:/d' stderr >at-stderr
   115133 mv at-stderr stderr
   115134 # 2. Create the reference error message.
   115135 cat >expout <<'_ATEOF'
   115136 1.1: syntax error, unexpected $undefined
   115137 _ATEOF
   115138 
   115139 # 3. If locations are not used, remove them.
   115140 
   115141 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115142 
   115143 # 5. Check
   115144 { set +x
   115145 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115146 at_fn_check_prepare_trace "calc.at:688"
   115147 ( $at_check_trace; cat stderr
   115148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115149 at_status=$? at_failed=false
   115150 $at_check_filter
   115151 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115152 $at_diff expout "$at_stdout" || at_failed=:
   115153 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115154 $at_failed && at_fn_log_failure
   115155 $at_traceon; }
   115156 
   115157 
   115158 cat >input <<'_ATEOF'
   115159 1 = 2 = 3
   115160 _ATEOF
   115161 
   115162 { set +x
   115163 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115164 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115165 ( $at_check_trace;  $PREPARSER ./calc input
   115166 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115167 at_status=$? at_failed=false
   115168 $at_check_filter
   115169 echo stderr:; tee stderr <"$at_stderr"
   115170 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115171 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688"
   115172 $at_failed && at_fn_log_failure
   115173 $at_traceon; }
   115174 
   115175 { set +x
   115176 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115177 at_fn_check_prepare_trace "calc.at:688"
   115178 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115179 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115180 at_status=$? at_failed=false
   115181 $at_check_filter
   115182 echo stderr:; tee stderr <"$at_stderr"
   115183 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115184 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115185 $at_failed && at_fn_log_failure
   115186 $at_traceon; }
   115187 
   115188 
   115189 
   115190 # Normalize the observed and expected error messages, depending upon the
   115191 # options.
   115192 # 1. Remove the traces from observed.
   115193 sed '/^Starting/d
   115194 /^Entering/d
   115195 /^Stack/d
   115196 /^Reading/d
   115197 /^Reducing/d
   115198 /^Return/d
   115199 /^Shifting/d
   115200 /^state/d
   115201 /^Cleanup:/d
   115202 /^Error:/d
   115203 /^Next/d
   115204 /^Now/d
   115205 /^Discarding/d
   115206 / \$[0-9$]* = /d
   115207 /^yydestructor:/d' stderr >at-stderr
   115208 mv at-stderr stderr
   115209 # 2. Create the reference error message.
   115210 cat >expout <<'_ATEOF'
   115211 1.7: syntax error, unexpected '='
   115212 _ATEOF
   115213 
   115214 # 3. If locations are not used, remove them.
   115215 
   115216 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115217 
   115218 # 5. Check
   115219 { set +x
   115220 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115221 at_fn_check_prepare_trace "calc.at:688"
   115222 ( $at_check_trace; cat stderr
   115223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115224 at_status=$? at_failed=false
   115225 $at_check_filter
   115226 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115227 $at_diff expout "$at_stdout" || at_failed=:
   115228 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115229 $at_failed && at_fn_log_failure
   115230 $at_traceon; }
   115231 
   115232 
   115233 cat >input <<'_ATEOF'
   115234 
   115235 +1
   115236 _ATEOF
   115237 
   115238 { set +x
   115239 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115240 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115241 ( $at_check_trace;  $PREPARSER ./calc input
   115242 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115243 at_status=$? at_failed=false
   115244 $at_check_filter
   115245 echo stderr:; tee stderr <"$at_stderr"
   115246 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115247 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688"
   115248 $at_failed && at_fn_log_failure
   115249 $at_traceon; }
   115250 
   115251 { set +x
   115252 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115253 at_fn_check_prepare_trace "calc.at:688"
   115254 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115256 at_status=$? at_failed=false
   115257 $at_check_filter
   115258 echo stderr:; tee stderr <"$at_stderr"
   115259 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115260 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115261 $at_failed && at_fn_log_failure
   115262 $at_traceon; }
   115263 
   115264 
   115265 
   115266 # Normalize the observed and expected error messages, depending upon the
   115267 # options.
   115268 # 1. Remove the traces from observed.
   115269 sed '/^Starting/d
   115270 /^Entering/d
   115271 /^Stack/d
   115272 /^Reading/d
   115273 /^Reducing/d
   115274 /^Return/d
   115275 /^Shifting/d
   115276 /^state/d
   115277 /^Cleanup:/d
   115278 /^Error:/d
   115279 /^Next/d
   115280 /^Now/d
   115281 /^Discarding/d
   115282 / \$[0-9$]* = /d
   115283 /^yydestructor:/d' stderr >at-stderr
   115284 mv at-stderr stderr
   115285 # 2. Create the reference error message.
   115286 cat >expout <<'_ATEOF'
   115287 2.1: syntax error, unexpected '+'
   115288 _ATEOF
   115289 
   115290 # 3. If locations are not used, remove them.
   115291 
   115292 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115293 
   115294 # 5. Check
   115295 { set +x
   115296 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115297 at_fn_check_prepare_trace "calc.at:688"
   115298 ( $at_check_trace; cat stderr
   115299 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115300 at_status=$? at_failed=false
   115301 $at_check_filter
   115302 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115303 $at_diff expout "$at_stdout" || at_failed=:
   115304 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115305 $at_failed && at_fn_log_failure
   115306 $at_traceon; }
   115307 
   115308 
   115309 # Exercise error messages with EOF: work on an empty file.
   115310 { set +x
   115311 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc /dev/null"
   115312 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:688"
   115313 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   115314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115315 at_status=$? at_failed=false
   115316 $at_check_filter
   115317 echo stderr:; tee stderr <"$at_stderr"
   115318 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115319 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688"
   115320 $at_failed && at_fn_log_failure
   115321 $at_traceon; }
   115322 
   115323 { set +x
   115324 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115325 at_fn_check_prepare_trace "calc.at:688"
   115326 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115327 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115328 at_status=$? at_failed=false
   115329 $at_check_filter
   115330 echo stderr:; tee stderr <"$at_stderr"
   115331 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115332 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115333 $at_failed && at_fn_log_failure
   115334 $at_traceon; }
   115335 
   115336 
   115337 
   115338 # Normalize the observed and expected error messages, depending upon the
   115339 # options.
   115340 # 1. Remove the traces from observed.
   115341 sed '/^Starting/d
   115342 /^Entering/d
   115343 /^Stack/d
   115344 /^Reading/d
   115345 /^Reducing/d
   115346 /^Return/d
   115347 /^Shifting/d
   115348 /^state/d
   115349 /^Cleanup:/d
   115350 /^Error:/d
   115351 /^Next/d
   115352 /^Now/d
   115353 /^Discarding/d
   115354 / \$[0-9$]* = /d
   115355 /^yydestructor:/d' stderr >at-stderr
   115356 mv at-stderr stderr
   115357 # 2. Create the reference error message.
   115358 cat >expout <<'_ATEOF'
   115359 1.1: syntax error, unexpected end of input
   115360 _ATEOF
   115361 
   115362 # 3. If locations are not used, remove them.
   115363 
   115364 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115365 
   115366 # 5. Check
   115367 { set +x
   115368 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115369 at_fn_check_prepare_trace "calc.at:688"
   115370 ( $at_check_trace; cat stderr
   115371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115372 at_status=$? at_failed=false
   115373 $at_check_filter
   115374 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115375 $at_diff expout "$at_stdout" || at_failed=:
   115376 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115377 $at_failed && at_fn_log_failure
   115378 $at_traceon; }
   115379 
   115380 
   115381 
   115382 # Exercise the error token: without it, we die at the first error,
   115383 # hence be sure to
   115384 #
   115385 # - have several errors which exercise different shift/discardings
   115386 #   - (): nothing to pop, nothing to discard
   115387 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   115388 #   - (* * *): nothing to pop, a lot to discard
   115389 #   - (1 + 2 * *): some to pop and discard
   115390 #
   115391 # - test the action associated to `error'
   115392 #
   115393 # - check the lookahead that triggers an error is not discarded
   115394 #   when we enter error recovery.  Below, the lookahead causing the
   115395 #   first error is ")", which is needed to recover from the error and
   115396 #   produce the "0" that triggers the "0 != 1" error.
   115397 #
   115398 cat >input <<'_ATEOF'
   115399 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   115400 _ATEOF
   115401 
   115402 { set +x
   115403 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115404 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115405 ( $at_check_trace;  $PREPARSER ./calc input
   115406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115407 at_status=$? at_failed=false
   115408 $at_check_filter
   115409 echo stderr:; tee stderr <"$at_stderr"
   115410 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115411 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115412 $at_failed && at_fn_log_failure
   115413 $at_traceon; }
   115414 
   115415 { set +x
   115416 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115417 at_fn_check_prepare_trace "calc.at:688"
   115418 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115420 at_status=$? at_failed=false
   115421 $at_check_filter
   115422 echo stderr:; tee stderr <"$at_stderr"
   115423 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115424 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115425 $at_failed && at_fn_log_failure
   115426 $at_traceon; }
   115427 
   115428 
   115429 
   115430 # Normalize the observed and expected error messages, depending upon the
   115431 # options.
   115432 # 1. Remove the traces from observed.
   115433 sed '/^Starting/d
   115434 /^Entering/d
   115435 /^Stack/d
   115436 /^Reading/d
   115437 /^Reducing/d
   115438 /^Return/d
   115439 /^Shifting/d
   115440 /^state/d
   115441 /^Cleanup:/d
   115442 /^Error:/d
   115443 /^Next/d
   115444 /^Now/d
   115445 /^Discarding/d
   115446 / \$[0-9$]* = /d
   115447 /^yydestructor:/d' stderr >at-stderr
   115448 mv at-stderr stderr
   115449 # 2. Create the reference error message.
   115450 cat >expout <<'_ATEOF'
   115451 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   115452 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   115453 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   115454 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   115455 calc: error: 4444 != 1
   115456 _ATEOF
   115457 
   115458 # 3. If locations are not used, remove them.
   115459 
   115460 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115461 
   115462 # 5. Check
   115463 { set +x
   115464 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115465 at_fn_check_prepare_trace "calc.at:688"
   115466 ( $at_check_trace; cat stderr
   115467 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115468 at_status=$? at_failed=false
   115469 $at_check_filter
   115470 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115471 $at_diff expout "$at_stdout" || at_failed=:
   115472 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115473 $at_failed && at_fn_log_failure
   115474 $at_traceon; }
   115475 
   115476 
   115477 
   115478 # The same, but this time exercising explicitly triggered syntax errors.
   115479 # POSIX says the lookahead causing the error should not be discarded.
   115480 cat >input <<'_ATEOF'
   115481 (!) + (1 2) = 1
   115482 _ATEOF
   115483 
   115484 { set +x
   115485 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115486 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115487 ( $at_check_trace;  $PREPARSER ./calc input
   115488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115489 at_status=$? at_failed=false
   115490 $at_check_filter
   115491 echo stderr:; tee stderr <"$at_stderr"
   115492 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115493 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115494 $at_failed && at_fn_log_failure
   115495 $at_traceon; }
   115496 
   115497 { set +x
   115498 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115499 at_fn_check_prepare_trace "calc.at:688"
   115500 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115501 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115502 at_status=$? at_failed=false
   115503 $at_check_filter
   115504 echo stderr:; tee stderr <"$at_stderr"
   115505 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115506 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115507 $at_failed && at_fn_log_failure
   115508 $at_traceon; }
   115509 
   115510 
   115511 
   115512 # Normalize the observed and expected error messages, depending upon the
   115513 # options.
   115514 # 1. Remove the traces from observed.
   115515 sed '/^Starting/d
   115516 /^Entering/d
   115517 /^Stack/d
   115518 /^Reading/d
   115519 /^Reducing/d
   115520 /^Return/d
   115521 /^Shifting/d
   115522 /^state/d
   115523 /^Cleanup:/d
   115524 /^Error:/d
   115525 /^Next/d
   115526 /^Now/d
   115527 /^Discarding/d
   115528 / \$[0-9$]* = /d
   115529 /^yydestructor:/d' stderr >at-stderr
   115530 mv at-stderr stderr
   115531 # 2. Create the reference error message.
   115532 cat >expout <<'_ATEOF'
   115533 1.10: syntax error, unexpected number
   115534 calc: error: 2222 != 1
   115535 _ATEOF
   115536 
   115537 # 3. If locations are not used, remove them.
   115538 
   115539 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115540 
   115541 # 5. Check
   115542 { set +x
   115543 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115544 at_fn_check_prepare_trace "calc.at:688"
   115545 ( $at_check_trace; cat stderr
   115546 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115547 at_status=$? at_failed=false
   115548 $at_check_filter
   115549 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115550 $at_diff expout "$at_stdout" || at_failed=:
   115551 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115552 $at_failed && at_fn_log_failure
   115553 $at_traceon; }
   115554 
   115555 
   115556 cat >input <<'_ATEOF'
   115557 (- *) + (1 2) = 1
   115558 _ATEOF
   115559 
   115560 { set +x
   115561 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115562 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115563 ( $at_check_trace;  $PREPARSER ./calc input
   115564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115565 at_status=$? at_failed=false
   115566 $at_check_filter
   115567 echo stderr:; tee stderr <"$at_stderr"
   115568 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115569 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115570 $at_failed && at_fn_log_failure
   115571 $at_traceon; }
   115572 
   115573 { set +x
   115574 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115575 at_fn_check_prepare_trace "calc.at:688"
   115576 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115578 at_status=$? at_failed=false
   115579 $at_check_filter
   115580 echo stderr:; tee stderr <"$at_stderr"
   115581 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115582 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115583 $at_failed && at_fn_log_failure
   115584 $at_traceon; }
   115585 
   115586 
   115587 
   115588 # Normalize the observed and expected error messages, depending upon the
   115589 # options.
   115590 # 1. Remove the traces from observed.
   115591 sed '/^Starting/d
   115592 /^Entering/d
   115593 /^Stack/d
   115594 /^Reading/d
   115595 /^Reducing/d
   115596 /^Return/d
   115597 /^Shifting/d
   115598 /^state/d
   115599 /^Cleanup:/d
   115600 /^Error:/d
   115601 /^Next/d
   115602 /^Now/d
   115603 /^Discarding/d
   115604 / \$[0-9$]* = /d
   115605 /^yydestructor:/d' stderr >at-stderr
   115606 mv at-stderr stderr
   115607 # 2. Create the reference error message.
   115608 cat >expout <<'_ATEOF'
   115609 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   115610 1.12: syntax error, unexpected number
   115611 calc: error: 2222 != 1
   115612 _ATEOF
   115613 
   115614 # 3. If locations are not used, remove them.
   115615 
   115616 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115617 
   115618 # 5. Check
   115619 { set +x
   115620 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115621 at_fn_check_prepare_trace "calc.at:688"
   115622 ( $at_check_trace; cat stderr
   115623 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115624 at_status=$? at_failed=false
   115625 $at_check_filter
   115626 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115627 $at_diff expout "$at_stdout" || at_failed=:
   115628 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115629 $at_failed && at_fn_log_failure
   115630 $at_traceon; }
   115631 
   115632 
   115633 
   115634 # Check that yyerrok works properly: second error is not reported,
   115635 # third and fourth are.  Parse status is succesfull.
   115636 cat >input <<'_ATEOF'
   115637 (* *) + (*) + (*)
   115638 _ATEOF
   115639 
   115640 { set +x
   115641 $as_echo "$at_srcdir/calc.at:688:  \$PREPARSER ./calc input"
   115642 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688"
   115643 ( $at_check_trace;  $PREPARSER ./calc input
   115644 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115645 at_status=$? at_failed=false
   115646 $at_check_filter
   115647 echo stderr:; tee stderr <"$at_stderr"
   115648 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115649 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115650 $at_failed && at_fn_log_failure
   115651 $at_traceon; }
   115652 
   115653 { set +x
   115654 $as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   115655 at_fn_check_prepare_trace "calc.at:688"
   115656 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   115657 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115658 at_status=$? at_failed=false
   115659 $at_check_filter
   115660 echo stderr:; tee stderr <"$at_stderr"
   115661 at_fn_diff_devnull "$at_stdout" || at_failed=:
   115662 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115663 $at_failed && at_fn_log_failure
   115664 $at_traceon; }
   115665 
   115666 
   115667 
   115668 # Normalize the observed and expected error messages, depending upon the
   115669 # options.
   115670 # 1. Remove the traces from observed.
   115671 sed '/^Starting/d
   115672 /^Entering/d
   115673 /^Stack/d
   115674 /^Reading/d
   115675 /^Reducing/d
   115676 /^Return/d
   115677 /^Shifting/d
   115678 /^state/d
   115679 /^Cleanup:/d
   115680 /^Error:/d
   115681 /^Next/d
   115682 /^Now/d
   115683 /^Discarding/d
   115684 / \$[0-9$]* = /d
   115685 /^yydestructor:/d' stderr >at-stderr
   115686 mv at-stderr stderr
   115687 # 2. Create the reference error message.
   115688 cat >expout <<'_ATEOF'
   115689 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   115690 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   115691 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   115692 _ATEOF
   115693 
   115694 # 3. If locations are not used, remove them.
   115695 
   115696 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   115697 
   115698 # 5. Check
   115699 { set +x
   115700 $as_echo "$at_srcdir/calc.at:688: cat stderr"
   115701 at_fn_check_prepare_trace "calc.at:688"
   115702 ( $at_check_trace; cat stderr
   115703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   115704 at_status=$? at_failed=false
   115705 $at_check_filter
   115706 at_fn_diff_devnull "$at_stderr" || at_failed=:
   115707 $at_diff expout "$at_stdout" || at_failed=:
   115708 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688"
   115709 $at_failed && at_fn_log_failure
   115710 $at_traceon; }
   115711 
   115712 
   115713 
   115714 
   115715 
   115716   set +x
   115717   $at_times_p && times >"$at_times_file"
   115718 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   115719 read at_status <"$at_status_file"
   115720 #AT_STOP_243
   115721 #AT_START_244
   115722 at_fn_group_banner 244 'calc.at:699' \
   115723   "Calculator %skeleton \"glr.cc\" %defines %locations" "" 14
   115724 at_xfail=no
   115725 (
   115726   $as_echo "244. $at_setup_line: testing $at_desc ..."
   115727   $at_traceon
   115728 
   115729 
   115730 
   115731 
   115732 
   115733 
   115734 
   115735 
   115736 
   115737 
   115738 cat >calc.y <<'_ATEOF'
   115739 %code top {
   115740 #include <config.h>
   115741 /* We don't need perfect functions for these tests. */
   115742 #undef malloc
   115743 #undef memcmp
   115744 #undef realloc
   115745 }
   115746 
   115747 /* Infix notation calculator--calc */
   115748 %skeleton "glr.cc" %defines %locations
   115749 %define global_tokens_and_yystype
   115750 %code requires
   115751 {
   115752 
   115753   /* Exercise pre-prologue dependency to %union.  */
   115754   typedef int semantic_value;
   115755 }
   115756 
   115757 /* Exercise %union. */
   115758 %union
   115759 {
   115760   semantic_value ival;
   115761 };
   115762 %printer { yyoutput << $$; } <ival>;
   115763 
   115764 %code provides
   115765 {
   115766   #include <stdio.h>
   115767   /* The input.  */
   115768   extern FILE *input;
   115769   extern semantic_value global_result;
   115770   extern int global_count;
   115771 }
   115772 
   115773 %code
   115774 {
   115775 #include <assert.h>
   115776 #include <string.h>
   115777 #define USE(Var)
   115778 
   115779 FILE *input;
   115780 static int power (int base, int exponent);
   115781 
   115782 
   115783 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   115784 }
   115785 
   115786 
   115787 
   115788 /* Bison Declarations */
   115789 %token CALC_EOF 0 "end of input"
   115790 %token <ival> NUM "number"
   115791 %type  <ival> exp
   115792 
   115793 %nonassoc '=' /* comparison            */
   115794 %left '-' '+'
   115795 %left '*' '/'
   115796 %left NEG     /* negation--unary minus */
   115797 %right '^'    /* exponentiation        */
   115798 
   115799 /* Grammar follows */
   115800 %%
   115801 input:
   115802   line
   115803 | input line         {  }
   115804 ;
   115805 
   115806 line:
   115807   '\n'
   115808 | exp '\n'           { USE ($1); }
   115809 ;
   115810 
   115811 exp:
   115812   NUM                { $$ = $1;             }
   115813 | exp '=' exp
   115814   {
   115815     if ($1 != $3)
   115816       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   115817     $$ = $1;
   115818   }
   115819 | exp '+' exp        { $$ = $1 + $3;        }
   115820 | exp '-' exp        { $$ = $1 - $3;        }
   115821 | exp '*' exp        { $$ = $1 * $3;        }
   115822 | exp '/' exp        { $$ = $1 / $3;        }
   115823 | '-' exp  %prec NEG { $$ = -$2;            }
   115824 | exp '^' exp        { $$ = power ($1, $3); }
   115825 | '(' exp ')'        { $$ = $2;             }
   115826 | '(' error ')'      { $$ = 1111; yyerrok;  }
   115827 | '!'                { $$ = 0; YYERROR;     }
   115828 | '-' error          { $$ = 0; YYERROR;     }
   115829 ;
   115830 %%
   115831 
   115832 static int
   115833 power (int base, int exponent)
   115834 {
   115835   int res = 1;
   115836   assert (0 <= exponent);
   115837   for (/* Niente */; exponent; --exponent)
   115838     res *= base;
   115839   return res;
   115840 }
   115841 
   115842 
   115843 /* A C++ error reporting function.  */
   115844 void
   115845 yy::parser::error (const location_type& l, const std::string& m)
   115846 {
   115847   (void) l;
   115848   std::cerr << l << ": " << m << std::endl;
   115849 }
   115850 _ATEOF
   115851 
   115852 
   115853 
   115854 cat >calc-lex.cc <<'_ATEOF'
   115855 #include <config.h>
   115856 /* We don't need perfect functions for these tests. */
   115857 #undef malloc
   115858 #undef memcmp
   115859 #undef realloc
   115860 
   115861 #include "calc.hh"
   115862 
   115863 #include <ctype.h>
   115864 
   115865 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   115866 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   115867 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   115868 
   115869 
   115870 static yy::parser::location_type last_yylloc;
   115871 
   115872 static int
   115873 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   115874 {
   115875   int res = getc (input);
   115876   (void) lvalp;(void) llocp;
   115877 
   115878   last_yylloc = (*llocp);
   115879   if (res == '\n')
   115880     {
   115881       (*llocp).end.line++;
   115882       (*llocp).end.column = 1;
   115883     }
   115884   else
   115885     (*llocp).end.column++;
   115886 
   115887   return res;
   115888 }
   115889 
   115890 static void
   115891 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   115892 {
   115893   (void) lvalp;(void) llocp;
   115894 
   115895   /* Wrong when C == `\n'. */
   115896   (*llocp) = last_yylloc;
   115897 
   115898   ungetc (c, input);
   115899 }
   115900 
   115901 static int
   115902 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   115903 {
   115904   int c = get_char (lvalp, llocp);
   115905   int sign = 1;
   115906   int n = 0;
   115907 
   115908   (void) lvalp;(void) llocp;
   115909   if (c == '-')
   115910     {
   115911       c = get_char (lvalp, llocp);
   115912       sign = -1;
   115913     }
   115914 
   115915   while (isdigit (c))
   115916     {
   115917       n = 10 * n + (c - '0');
   115918       c = get_char (lvalp, llocp);
   115919     }
   115920 
   115921   unget_char (lvalp, llocp,  c);
   115922 
   115923   return sign * n;
   115924 }
   115925 
   115926 
   115927 /*---------------------------------------------------------------.
   115928 | Lexical analyzer returns an integer on the stack and the token |
   115929 | NUM, or the ASCII character read if not a number.  Skips all   |
   115930 | blanks and tabs, returns 0 for EOF.                            |
   115931 `---------------------------------------------------------------*/
   115932 
   115933 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   115934 {
   115935   int c;
   115936   /* Skip current token, then white spaces.  */
   115937   do
   115938     {
   115939      (*llocp).begin.column = (*llocp).end.column;
   115940       (*llocp).begin.line   = (*llocp).end.line;
   115941 
   115942     }
   115943   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   115944 
   115945   /* process numbers   */
   115946   if (c == '.' || isdigit (c))
   115947     {
   115948       unget_char (lvalp, llocp,  c);
   115949       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   115950       return NUM;
   115951     }
   115952 
   115953   /* Return end-of-file.  */
   115954   if (c == EOF)
   115955     return CALC_EOF;
   115956 
   115957   /* Return single chars. */
   115958   return c;
   115959 }
   115960 _ATEOF
   115961 
   115962 
   115963 cat >calc-main.cc <<'_ATEOF'
   115964 #include <config.h>
   115965 /* We don't need perfect functions for these tests. */
   115966 #undef malloc
   115967 #undef memcmp
   115968 #undef realloc
   115969 
   115970 #include "calc.hh"
   115971 
   115972 #include <assert.h>
   115973 #if HAVE_UNISTD_H
   115974 # include <unistd.h>
   115975 #else
   115976 # undef alarm
   115977 # define alarm(seconds) /* empty */
   115978 #endif
   115979 
   115980 
   115981 /* A C++ yyparse that simulates the C signature.  */
   115982 int
   115983 yyparse ()
   115984 {
   115985   yy::parser parser;
   115986 #if YYDEBUG
   115987   parser.set_debug_level (1);
   115988 #endif
   115989   return parser.parse ();
   115990 }
   115991 
   115992 
   115993 semantic_value global_result = 0;
   115994 int global_count = 0;
   115995 
   115996 /* A C main function.  */
   115997 int
   115998 main (int argc, const char **argv)
   115999 {
   116000   semantic_value result = 0;
   116001   int count = 0;
   116002   int status;
   116003 
   116004   /* This used to be alarm (10), but that isn't enough time for
   116005      a July 1995 vintage DEC Alphastation 200 4/100 system,
   116006      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   116007   alarm (100);
   116008 
   116009   if (argc == 2)
   116010     input = fopen (argv[1], "r");
   116011   else
   116012     input = stdin;
   116013 
   116014   if (!input)
   116015     {
   116016       perror (argv[1]);
   116017       return 3;
   116018     }
   116019 
   116020 
   116021   status = yyparse ();
   116022   if (fclose (input))
   116023     perror ("fclose");
   116024   assert (global_result == result);
   116025   assert (global_count == count);
   116026   return status;
   116027 }
   116028 _ATEOF
   116029 
   116030 
   116031 
   116032 
   116033 
   116034 
   116035 
   116036 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   116037   at_save_special_files
   116038   mkdir xml-tests
   116039     # Don't combine these Bison invocations since we want to be sure that
   116040   # --report=all isn't required to get the full XML file.
   116041   { set +x
   116042 $as_echo "$at_srcdir/calc.at:699: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   116043                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   116044 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699"
   116045 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   116046                   --graph=xml-tests/test.dot -o calc.cc calc.y
   116047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116048 at_status=$? at_failed=false
   116049 $at_check_filter
   116050 echo stderr:; cat "$at_stderr"
   116051 echo stdout:; cat "$at_stdout"
   116052 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116053 $at_failed && at_fn_log_failure
   116054 $at_traceon; }
   116055 
   116056   { set +x
   116057 $as_echo "$at_srcdir/calc.at:699: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   116058 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:699"
   116059 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   116060 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116061 at_status=$? at_failed=false
   116062 $at_check_filter
   116063 echo stderr:; cat "$at_stderr"
   116064 echo stdout:; cat "$at_stdout"
   116065 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116066 $at_failed && at_fn_log_failure
   116067 $at_traceon; }
   116068 
   116069     cp xml-tests/test.output expout
   116070   { set +x
   116071 $as_echo "$at_srcdir/calc.at:699: \$XSLTPROC \\
   116072              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   116073              xml-tests/test.xml"
   116074 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:699"
   116075 ( $at_check_trace; $XSLTPROC \
   116076              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   116077              xml-tests/test.xml
   116078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116079 at_status=$? at_failed=false
   116080 $at_check_filter
   116081 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116082 $at_diff expout "$at_stdout" || at_failed=:
   116083 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116084 $at_failed && at_fn_log_failure
   116085 $at_traceon; }
   116086 
   116087   sort xml-tests/test.dot > expout
   116088   { set +x
   116089 $as_echo "$at_srcdir/calc.at:699: \$XSLTPROC \\
   116090              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   116091              xml-tests/test.xml | sort"
   116092 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:699"
   116093 ( $at_check_trace; $XSLTPROC \
   116094              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   116095              xml-tests/test.xml | sort
   116096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116097 at_status=$? at_failed=false
   116098 $at_check_filter
   116099 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116100 $at_diff expout "$at_stdout" || at_failed=:
   116101 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116102 $at_failed && at_fn_log_failure
   116103 $at_traceon; }
   116104 
   116105   rm -rf xml-tests expout
   116106   at_restore_special_files
   116107 fi
   116108 { set +x
   116109 $as_echo "$at_srcdir/calc.at:699: bison -o calc.cc calc.y"
   116110 at_fn_check_prepare_trace "calc.at:699"
   116111 ( $at_check_trace; bison -o calc.cc calc.y
   116112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116113 at_status=$? at_failed=false
   116114 $at_check_filter
   116115 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116116 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116117 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116118 $at_failed && at_fn_log_failure
   116119 $at_traceon; }
   116120 
   116121 
   116122 
   116123 { set +x
   116124 $as_echo "$at_srcdir/calc.at:699: \$BISON_CXX_WORKS"
   116125 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:699"
   116126 ( $at_check_trace; $BISON_CXX_WORKS
   116127 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116128 at_status=$? at_failed=false
   116129 $at_check_filter
   116130 echo stderr:; cat "$at_stderr"
   116131 echo stdout:; cat "$at_stdout"
   116132 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116133 $at_failed && at_fn_log_failure
   116134 $at_traceon; }
   116135 
   116136 { set +x
   116137 $as_echo "$at_srcdir/calc.at:699: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   116138 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:699"
   116139 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   116140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116141 at_status=$? at_failed=false
   116142 $at_check_filter
   116143 echo stderr:; cat "$at_stderr"
   116144 echo stdout:; cat "$at_stdout"
   116145 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116146 $at_failed && at_fn_log_failure
   116147 $at_traceon; }
   116148 
   116149 
   116150 { set +x
   116151 $as_echo "$at_srcdir/calc.at:699: \$PERL -ne '
   116152   chomp;
   116153   print \"\$.: {\$_}\\n\"
   116154     if (# No starting/ending empty lines.
   116155         (eof || \$. == 1) && /^\\s*\$/
   116156         # No trailing space.  FIXME: not ready for \"maint\".
   116157         # || /\\s\$/
   116158         )' calc.cc
   116159 "
   116160 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699"
   116161 ( $at_check_trace; $PERL -ne '
   116162   chomp;
   116163   print "$.: {$_}\n"
   116164     if (# No starting/ending empty lines.
   116165         (eof || $. == 1) && /^\s*$/
   116166         # No trailing space.  FIXME: not ready for "maint".
   116167         # || /\s$/
   116168         )' calc.cc
   116169 
   116170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116171 at_status=$? at_failed=false
   116172 $at_check_filter
   116173 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116174 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116175 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116176 $at_failed && at_fn_log_failure
   116177 $at_traceon; }
   116178 
   116179 { set +x
   116180 $as_echo "$at_srcdir/calc.at:699: \$PERL -ne '
   116181   chomp;
   116182   print \"\$.: {\$_}\\n\"
   116183     if (# No starting/ending empty lines.
   116184         (eof || \$. == 1) && /^\\s*\$/
   116185         # No trailing space.  FIXME: not ready for \"maint\".
   116186         # || /\\s\$/
   116187         )' calc.hh
   116188 "
   116189 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699"
   116190 ( $at_check_trace; $PERL -ne '
   116191   chomp;
   116192   print "$.: {$_}\n"
   116193     if (# No starting/ending empty lines.
   116194         (eof || $. == 1) && /^\s*$/
   116195         # No trailing space.  FIXME: not ready for "maint".
   116196         # || /\s$/
   116197         )' calc.hh
   116198 
   116199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116200 at_status=$? at_failed=false
   116201 $at_check_filter
   116202 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116203 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116204 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116205 $at_failed && at_fn_log_failure
   116206 $at_traceon; }
   116207 
   116208 
   116209 # Test the priorities.
   116210 cat >input <<'_ATEOF'
   116211 1 + 2 * 3 = 7
   116212 1 + 2 * -3 = -5
   116213 
   116214 -1^2 = -1
   116215 (-1)^2 = 1
   116216 
   116217 ---1 = -1
   116218 
   116219 1 - 2 - 3 = -4
   116220 1 - (2 - 3) = 2
   116221 
   116222 2^2^3 = 256
   116223 (2^2)^3 = 64
   116224 _ATEOF
   116225 
   116226 { set +x
   116227 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116228 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116229 ( $at_check_trace;  $PREPARSER ./calc input
   116230 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116231 at_status=$? at_failed=false
   116232 $at_check_filter
   116233 echo stderr:; tee stderr <"$at_stderr"
   116234 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116235 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116236 $at_failed && at_fn_log_failure
   116237 $at_traceon; }
   116238 
   116239 { set +x
   116240 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116241 at_fn_check_prepare_trace "calc.at:699"
   116242 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116244 at_status=$? at_failed=false
   116245 $at_check_filter
   116246 echo stderr:; tee stderr <"$at_stderr"
   116247 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116248 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116249 $at_failed && at_fn_log_failure
   116250 $at_traceon; }
   116251 
   116252 
   116253 
   116254 
   116255 # Some syntax errors.
   116256 cat >input <<'_ATEOF'
   116257 1 2
   116258 _ATEOF
   116259 
   116260 { set +x
   116261 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116262 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116263 ( $at_check_trace;  $PREPARSER ./calc input
   116264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116265 at_status=$? at_failed=false
   116266 $at_check_filter
   116267 echo stderr:; tee stderr <"$at_stderr"
   116268 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116269 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699"
   116270 $at_failed && at_fn_log_failure
   116271 $at_traceon; }
   116272 
   116273 { set +x
   116274 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116275 at_fn_check_prepare_trace "calc.at:699"
   116276 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116277 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116278 at_status=$? at_failed=false
   116279 $at_check_filter
   116280 echo stderr:; tee stderr <"$at_stderr"
   116281 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116282 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116283 $at_failed && at_fn_log_failure
   116284 $at_traceon; }
   116285 
   116286 
   116287 
   116288 # Normalize the observed and expected error messages, depending upon the
   116289 # options.
   116290 # 1. Remove the traces from observed.
   116291 sed '/^Starting/d
   116292 /^Entering/d
   116293 /^Stack/d
   116294 /^Reading/d
   116295 /^Reducing/d
   116296 /^Return/d
   116297 /^Shifting/d
   116298 /^state/d
   116299 /^Cleanup:/d
   116300 /^Error:/d
   116301 /^Next/d
   116302 /^Now/d
   116303 /^Discarding/d
   116304 / \$[0-9$]* = /d
   116305 /^yydestructor:/d' stderr >at-stderr
   116306 mv at-stderr stderr
   116307 # 2. Create the reference error message.
   116308 cat >expout <<'_ATEOF'
   116309 1.3: syntax error, unexpected number
   116310 _ATEOF
   116311 
   116312 # 3. If locations are not used, remove them.
   116313 
   116314 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116315 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116316 mv at-expout expout
   116317 # 5. Check
   116318 { set +x
   116319 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116320 at_fn_check_prepare_trace "calc.at:699"
   116321 ( $at_check_trace; cat stderr
   116322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116323 at_status=$? at_failed=false
   116324 $at_check_filter
   116325 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116326 $at_diff expout "$at_stdout" || at_failed=:
   116327 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116328 $at_failed && at_fn_log_failure
   116329 $at_traceon; }
   116330 
   116331 
   116332 cat >input <<'_ATEOF'
   116333 1//2
   116334 _ATEOF
   116335 
   116336 { set +x
   116337 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116338 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116339 ( $at_check_trace;  $PREPARSER ./calc input
   116340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116341 at_status=$? at_failed=false
   116342 $at_check_filter
   116343 echo stderr:; tee stderr <"$at_stderr"
   116344 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116345 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699"
   116346 $at_failed && at_fn_log_failure
   116347 $at_traceon; }
   116348 
   116349 { set +x
   116350 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116351 at_fn_check_prepare_trace "calc.at:699"
   116352 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116354 at_status=$? at_failed=false
   116355 $at_check_filter
   116356 echo stderr:; tee stderr <"$at_stderr"
   116357 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116358 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116359 $at_failed && at_fn_log_failure
   116360 $at_traceon; }
   116361 
   116362 
   116363 
   116364 # Normalize the observed and expected error messages, depending upon the
   116365 # options.
   116366 # 1. Remove the traces from observed.
   116367 sed '/^Starting/d
   116368 /^Entering/d
   116369 /^Stack/d
   116370 /^Reading/d
   116371 /^Reducing/d
   116372 /^Return/d
   116373 /^Shifting/d
   116374 /^state/d
   116375 /^Cleanup:/d
   116376 /^Error:/d
   116377 /^Next/d
   116378 /^Now/d
   116379 /^Discarding/d
   116380 / \$[0-9$]* = /d
   116381 /^yydestructor:/d' stderr >at-stderr
   116382 mv at-stderr stderr
   116383 # 2. Create the reference error message.
   116384 cat >expout <<'_ATEOF'
   116385 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   116386 _ATEOF
   116387 
   116388 # 3. If locations are not used, remove them.
   116389 
   116390 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116391 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116392 mv at-expout expout
   116393 # 5. Check
   116394 { set +x
   116395 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116396 at_fn_check_prepare_trace "calc.at:699"
   116397 ( $at_check_trace; cat stderr
   116398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116399 at_status=$? at_failed=false
   116400 $at_check_filter
   116401 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116402 $at_diff expout "$at_stdout" || at_failed=:
   116403 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116404 $at_failed && at_fn_log_failure
   116405 $at_traceon; }
   116406 
   116407 
   116408 cat >input <<'_ATEOF'
   116409 error
   116410 _ATEOF
   116411 
   116412 { set +x
   116413 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116414 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116415 ( $at_check_trace;  $PREPARSER ./calc input
   116416 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116417 at_status=$? at_failed=false
   116418 $at_check_filter
   116419 echo stderr:; tee stderr <"$at_stderr"
   116420 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116421 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699"
   116422 $at_failed && at_fn_log_failure
   116423 $at_traceon; }
   116424 
   116425 { set +x
   116426 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116427 at_fn_check_prepare_trace "calc.at:699"
   116428 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116430 at_status=$? at_failed=false
   116431 $at_check_filter
   116432 echo stderr:; tee stderr <"$at_stderr"
   116433 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116434 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116435 $at_failed && at_fn_log_failure
   116436 $at_traceon; }
   116437 
   116438 
   116439 
   116440 # Normalize the observed and expected error messages, depending upon the
   116441 # options.
   116442 # 1. Remove the traces from observed.
   116443 sed '/^Starting/d
   116444 /^Entering/d
   116445 /^Stack/d
   116446 /^Reading/d
   116447 /^Reducing/d
   116448 /^Return/d
   116449 /^Shifting/d
   116450 /^state/d
   116451 /^Cleanup:/d
   116452 /^Error:/d
   116453 /^Next/d
   116454 /^Now/d
   116455 /^Discarding/d
   116456 / \$[0-9$]* = /d
   116457 /^yydestructor:/d' stderr >at-stderr
   116458 mv at-stderr stderr
   116459 # 2. Create the reference error message.
   116460 cat >expout <<'_ATEOF'
   116461 1.1: syntax error, unexpected $undefined
   116462 _ATEOF
   116463 
   116464 # 3. If locations are not used, remove them.
   116465 
   116466 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116467 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116468 mv at-expout expout
   116469 # 5. Check
   116470 { set +x
   116471 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116472 at_fn_check_prepare_trace "calc.at:699"
   116473 ( $at_check_trace; cat stderr
   116474 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116475 at_status=$? at_failed=false
   116476 $at_check_filter
   116477 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116478 $at_diff expout "$at_stdout" || at_failed=:
   116479 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116480 $at_failed && at_fn_log_failure
   116481 $at_traceon; }
   116482 
   116483 
   116484 cat >input <<'_ATEOF'
   116485 1 = 2 = 3
   116486 _ATEOF
   116487 
   116488 { set +x
   116489 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116490 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116491 ( $at_check_trace;  $PREPARSER ./calc input
   116492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116493 at_status=$? at_failed=false
   116494 $at_check_filter
   116495 echo stderr:; tee stderr <"$at_stderr"
   116496 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116497 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699"
   116498 $at_failed && at_fn_log_failure
   116499 $at_traceon; }
   116500 
   116501 { set +x
   116502 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116503 at_fn_check_prepare_trace "calc.at:699"
   116504 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116506 at_status=$? at_failed=false
   116507 $at_check_filter
   116508 echo stderr:; tee stderr <"$at_stderr"
   116509 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116510 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116511 $at_failed && at_fn_log_failure
   116512 $at_traceon; }
   116513 
   116514 
   116515 
   116516 # Normalize the observed and expected error messages, depending upon the
   116517 # options.
   116518 # 1. Remove the traces from observed.
   116519 sed '/^Starting/d
   116520 /^Entering/d
   116521 /^Stack/d
   116522 /^Reading/d
   116523 /^Reducing/d
   116524 /^Return/d
   116525 /^Shifting/d
   116526 /^state/d
   116527 /^Cleanup:/d
   116528 /^Error:/d
   116529 /^Next/d
   116530 /^Now/d
   116531 /^Discarding/d
   116532 / \$[0-9$]* = /d
   116533 /^yydestructor:/d' stderr >at-stderr
   116534 mv at-stderr stderr
   116535 # 2. Create the reference error message.
   116536 cat >expout <<'_ATEOF'
   116537 1.7: syntax error, unexpected '='
   116538 _ATEOF
   116539 
   116540 # 3. If locations are not used, remove them.
   116541 
   116542 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116543 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116544 mv at-expout expout
   116545 # 5. Check
   116546 { set +x
   116547 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116548 at_fn_check_prepare_trace "calc.at:699"
   116549 ( $at_check_trace; cat stderr
   116550 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116551 at_status=$? at_failed=false
   116552 $at_check_filter
   116553 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116554 $at_diff expout "$at_stdout" || at_failed=:
   116555 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116556 $at_failed && at_fn_log_failure
   116557 $at_traceon; }
   116558 
   116559 
   116560 cat >input <<'_ATEOF'
   116561 
   116562 +1
   116563 _ATEOF
   116564 
   116565 { set +x
   116566 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116567 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116568 ( $at_check_trace;  $PREPARSER ./calc input
   116569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116570 at_status=$? at_failed=false
   116571 $at_check_filter
   116572 echo stderr:; tee stderr <"$at_stderr"
   116573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116574 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699"
   116575 $at_failed && at_fn_log_failure
   116576 $at_traceon; }
   116577 
   116578 { set +x
   116579 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116580 at_fn_check_prepare_trace "calc.at:699"
   116581 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116583 at_status=$? at_failed=false
   116584 $at_check_filter
   116585 echo stderr:; tee stderr <"$at_stderr"
   116586 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116587 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116588 $at_failed && at_fn_log_failure
   116589 $at_traceon; }
   116590 
   116591 
   116592 
   116593 # Normalize the observed and expected error messages, depending upon the
   116594 # options.
   116595 # 1. Remove the traces from observed.
   116596 sed '/^Starting/d
   116597 /^Entering/d
   116598 /^Stack/d
   116599 /^Reading/d
   116600 /^Reducing/d
   116601 /^Return/d
   116602 /^Shifting/d
   116603 /^state/d
   116604 /^Cleanup:/d
   116605 /^Error:/d
   116606 /^Next/d
   116607 /^Now/d
   116608 /^Discarding/d
   116609 / \$[0-9$]* = /d
   116610 /^yydestructor:/d' stderr >at-stderr
   116611 mv at-stderr stderr
   116612 # 2. Create the reference error message.
   116613 cat >expout <<'_ATEOF'
   116614 2.1: syntax error, unexpected '+'
   116615 _ATEOF
   116616 
   116617 # 3. If locations are not used, remove them.
   116618 
   116619 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116620 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116621 mv at-expout expout
   116622 # 5. Check
   116623 { set +x
   116624 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116625 at_fn_check_prepare_trace "calc.at:699"
   116626 ( $at_check_trace; cat stderr
   116627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116628 at_status=$? at_failed=false
   116629 $at_check_filter
   116630 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116631 $at_diff expout "$at_stdout" || at_failed=:
   116632 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116633 $at_failed && at_fn_log_failure
   116634 $at_traceon; }
   116635 
   116636 
   116637 # Exercise error messages with EOF: work on an empty file.
   116638 { set +x
   116639 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc /dev/null"
   116640 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:699"
   116641 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   116642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116643 at_status=$? at_failed=false
   116644 $at_check_filter
   116645 echo stderr:; tee stderr <"$at_stderr"
   116646 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116647 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699"
   116648 $at_failed && at_fn_log_failure
   116649 $at_traceon; }
   116650 
   116651 { set +x
   116652 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116653 at_fn_check_prepare_trace "calc.at:699"
   116654 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116655 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116656 at_status=$? at_failed=false
   116657 $at_check_filter
   116658 echo stderr:; tee stderr <"$at_stderr"
   116659 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116660 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116661 $at_failed && at_fn_log_failure
   116662 $at_traceon; }
   116663 
   116664 
   116665 
   116666 # Normalize the observed and expected error messages, depending upon the
   116667 # options.
   116668 # 1. Remove the traces from observed.
   116669 sed '/^Starting/d
   116670 /^Entering/d
   116671 /^Stack/d
   116672 /^Reading/d
   116673 /^Reducing/d
   116674 /^Return/d
   116675 /^Shifting/d
   116676 /^state/d
   116677 /^Cleanup:/d
   116678 /^Error:/d
   116679 /^Next/d
   116680 /^Now/d
   116681 /^Discarding/d
   116682 / \$[0-9$]* = /d
   116683 /^yydestructor:/d' stderr >at-stderr
   116684 mv at-stderr stderr
   116685 # 2. Create the reference error message.
   116686 cat >expout <<'_ATEOF'
   116687 1.1: syntax error, unexpected end of input
   116688 _ATEOF
   116689 
   116690 # 3. If locations are not used, remove them.
   116691 
   116692 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116693 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116694 mv at-expout expout
   116695 # 5. Check
   116696 { set +x
   116697 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116698 at_fn_check_prepare_trace "calc.at:699"
   116699 ( $at_check_trace; cat stderr
   116700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116701 at_status=$? at_failed=false
   116702 $at_check_filter
   116703 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116704 $at_diff expout "$at_stdout" || at_failed=:
   116705 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116706 $at_failed && at_fn_log_failure
   116707 $at_traceon; }
   116708 
   116709 
   116710 
   116711 # Exercise the error token: without it, we die at the first error,
   116712 # hence be sure to
   116713 #
   116714 # - have several errors which exercise different shift/discardings
   116715 #   - (): nothing to pop, nothing to discard
   116716 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   116717 #   - (* * *): nothing to pop, a lot to discard
   116718 #   - (1 + 2 * *): some to pop and discard
   116719 #
   116720 # - test the action associated to `error'
   116721 #
   116722 # - check the lookahead that triggers an error is not discarded
   116723 #   when we enter error recovery.  Below, the lookahead causing the
   116724 #   first error is ")", which is needed to recover from the error and
   116725 #   produce the "0" that triggers the "0 != 1" error.
   116726 #
   116727 cat >input <<'_ATEOF'
   116728 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   116729 _ATEOF
   116730 
   116731 { set +x
   116732 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116733 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116734 ( $at_check_trace;  $PREPARSER ./calc input
   116735 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116736 at_status=$? at_failed=false
   116737 $at_check_filter
   116738 echo stderr:; tee stderr <"$at_stderr"
   116739 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116740 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116741 $at_failed && at_fn_log_failure
   116742 $at_traceon; }
   116743 
   116744 { set +x
   116745 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116746 at_fn_check_prepare_trace "calc.at:699"
   116747 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116748 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116749 at_status=$? at_failed=false
   116750 $at_check_filter
   116751 echo stderr:; tee stderr <"$at_stderr"
   116752 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116753 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116754 $at_failed && at_fn_log_failure
   116755 $at_traceon; }
   116756 
   116757 
   116758 
   116759 # Normalize the observed and expected error messages, depending upon the
   116760 # options.
   116761 # 1. Remove the traces from observed.
   116762 sed '/^Starting/d
   116763 /^Entering/d
   116764 /^Stack/d
   116765 /^Reading/d
   116766 /^Reducing/d
   116767 /^Return/d
   116768 /^Shifting/d
   116769 /^state/d
   116770 /^Cleanup:/d
   116771 /^Error:/d
   116772 /^Next/d
   116773 /^Now/d
   116774 /^Discarding/d
   116775 / \$[0-9$]* = /d
   116776 /^yydestructor:/d' stderr >at-stderr
   116777 mv at-stderr stderr
   116778 # 2. Create the reference error message.
   116779 cat >expout <<'_ATEOF'
   116780 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   116781 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   116782 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   116783 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   116784 calc: error: 4444 != 1
   116785 _ATEOF
   116786 
   116787 # 3. If locations are not used, remove them.
   116788 
   116789 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116790 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116791 mv at-expout expout
   116792 # 5. Check
   116793 { set +x
   116794 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116795 at_fn_check_prepare_trace "calc.at:699"
   116796 ( $at_check_trace; cat stderr
   116797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116798 at_status=$? at_failed=false
   116799 $at_check_filter
   116800 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116801 $at_diff expout "$at_stdout" || at_failed=:
   116802 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116803 $at_failed && at_fn_log_failure
   116804 $at_traceon; }
   116805 
   116806 
   116807 
   116808 # The same, but this time exercising explicitly triggered syntax errors.
   116809 # POSIX says the lookahead causing the error should not be discarded.
   116810 cat >input <<'_ATEOF'
   116811 (!) + (1 2) = 1
   116812 _ATEOF
   116813 
   116814 { set +x
   116815 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116816 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116817 ( $at_check_trace;  $PREPARSER ./calc input
   116818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116819 at_status=$? at_failed=false
   116820 $at_check_filter
   116821 echo stderr:; tee stderr <"$at_stderr"
   116822 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116823 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116824 $at_failed && at_fn_log_failure
   116825 $at_traceon; }
   116826 
   116827 { set +x
   116828 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116829 at_fn_check_prepare_trace "calc.at:699"
   116830 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116831 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116832 at_status=$? at_failed=false
   116833 $at_check_filter
   116834 echo stderr:; tee stderr <"$at_stderr"
   116835 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116836 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116837 $at_failed && at_fn_log_failure
   116838 $at_traceon; }
   116839 
   116840 
   116841 
   116842 # Normalize the observed and expected error messages, depending upon the
   116843 # options.
   116844 # 1. Remove the traces from observed.
   116845 sed '/^Starting/d
   116846 /^Entering/d
   116847 /^Stack/d
   116848 /^Reading/d
   116849 /^Reducing/d
   116850 /^Return/d
   116851 /^Shifting/d
   116852 /^state/d
   116853 /^Cleanup:/d
   116854 /^Error:/d
   116855 /^Next/d
   116856 /^Now/d
   116857 /^Discarding/d
   116858 / \$[0-9$]* = /d
   116859 /^yydestructor:/d' stderr >at-stderr
   116860 mv at-stderr stderr
   116861 # 2. Create the reference error message.
   116862 cat >expout <<'_ATEOF'
   116863 1.10: syntax error, unexpected number
   116864 calc: error: 2222 != 1
   116865 _ATEOF
   116866 
   116867 # 3. If locations are not used, remove them.
   116868 
   116869 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116870 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116871 mv at-expout expout
   116872 # 5. Check
   116873 { set +x
   116874 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116875 at_fn_check_prepare_trace "calc.at:699"
   116876 ( $at_check_trace; cat stderr
   116877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116878 at_status=$? at_failed=false
   116879 $at_check_filter
   116880 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116881 $at_diff expout "$at_stdout" || at_failed=:
   116882 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116883 $at_failed && at_fn_log_failure
   116884 $at_traceon; }
   116885 
   116886 
   116887 cat >input <<'_ATEOF'
   116888 (- *) + (1 2) = 1
   116889 _ATEOF
   116890 
   116891 { set +x
   116892 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116893 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116894 ( $at_check_trace;  $PREPARSER ./calc input
   116895 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116896 at_status=$? at_failed=false
   116897 $at_check_filter
   116898 echo stderr:; tee stderr <"$at_stderr"
   116899 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116900 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116901 $at_failed && at_fn_log_failure
   116902 $at_traceon; }
   116903 
   116904 { set +x
   116905 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116906 at_fn_check_prepare_trace "calc.at:699"
   116907 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116909 at_status=$? at_failed=false
   116910 $at_check_filter
   116911 echo stderr:; tee stderr <"$at_stderr"
   116912 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116913 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116914 $at_failed && at_fn_log_failure
   116915 $at_traceon; }
   116916 
   116917 
   116918 
   116919 # Normalize the observed and expected error messages, depending upon the
   116920 # options.
   116921 # 1. Remove the traces from observed.
   116922 sed '/^Starting/d
   116923 /^Entering/d
   116924 /^Stack/d
   116925 /^Reading/d
   116926 /^Reducing/d
   116927 /^Return/d
   116928 /^Shifting/d
   116929 /^state/d
   116930 /^Cleanup:/d
   116931 /^Error:/d
   116932 /^Next/d
   116933 /^Now/d
   116934 /^Discarding/d
   116935 / \$[0-9$]* = /d
   116936 /^yydestructor:/d' stderr >at-stderr
   116937 mv at-stderr stderr
   116938 # 2. Create the reference error message.
   116939 cat >expout <<'_ATEOF'
   116940 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   116941 1.12: syntax error, unexpected number
   116942 calc: error: 2222 != 1
   116943 _ATEOF
   116944 
   116945 # 3. If locations are not used, remove them.
   116946 
   116947 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   116948 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   116949 mv at-expout expout
   116950 # 5. Check
   116951 { set +x
   116952 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   116953 at_fn_check_prepare_trace "calc.at:699"
   116954 ( $at_check_trace; cat stderr
   116955 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116956 at_status=$? at_failed=false
   116957 $at_check_filter
   116958 at_fn_diff_devnull "$at_stderr" || at_failed=:
   116959 $at_diff expout "$at_stdout" || at_failed=:
   116960 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116961 $at_failed && at_fn_log_failure
   116962 $at_traceon; }
   116963 
   116964 
   116965 
   116966 # Check that yyerrok works properly: second error is not reported,
   116967 # third and fourth are.  Parse status is succesfull.
   116968 cat >input <<'_ATEOF'
   116969 (* *) + (*) + (*)
   116970 _ATEOF
   116971 
   116972 { set +x
   116973 $as_echo "$at_srcdir/calc.at:699:  \$PREPARSER ./calc input"
   116974 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699"
   116975 ( $at_check_trace;  $PREPARSER ./calc input
   116976 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116977 at_status=$? at_failed=false
   116978 $at_check_filter
   116979 echo stderr:; tee stderr <"$at_stderr"
   116980 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116981 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116982 $at_failed && at_fn_log_failure
   116983 $at_traceon; }
   116984 
   116985 { set +x
   116986 $as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   116987 at_fn_check_prepare_trace "calc.at:699"
   116988 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   116989 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   116990 at_status=$? at_failed=false
   116991 $at_check_filter
   116992 echo stderr:; tee stderr <"$at_stderr"
   116993 at_fn_diff_devnull "$at_stdout" || at_failed=:
   116994 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   116995 $at_failed && at_fn_log_failure
   116996 $at_traceon; }
   116997 
   116998 
   116999 
   117000 # Normalize the observed and expected error messages, depending upon the
   117001 # options.
   117002 # 1. Remove the traces from observed.
   117003 sed '/^Starting/d
   117004 /^Entering/d
   117005 /^Stack/d
   117006 /^Reading/d
   117007 /^Reducing/d
   117008 /^Return/d
   117009 /^Shifting/d
   117010 /^state/d
   117011 /^Cleanup:/d
   117012 /^Error:/d
   117013 /^Next/d
   117014 /^Now/d
   117015 /^Discarding/d
   117016 / \$[0-9$]* = /d
   117017 /^yydestructor:/d' stderr >at-stderr
   117018 mv at-stderr stderr
   117019 # 2. Create the reference error message.
   117020 cat >expout <<'_ATEOF'
   117021 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   117022 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   117023 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   117024 _ATEOF
   117025 
   117026 # 3. If locations are not used, remove them.
   117027 
   117028 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   117029 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   117030 mv at-expout expout
   117031 # 5. Check
   117032 { set +x
   117033 $as_echo "$at_srcdir/calc.at:699: cat stderr"
   117034 at_fn_check_prepare_trace "calc.at:699"
   117035 ( $at_check_trace; cat stderr
   117036 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117037 at_status=$? at_failed=false
   117038 $at_check_filter
   117039 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117040 $at_diff expout "$at_stdout" || at_failed=:
   117041 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699"
   117042 $at_failed && at_fn_log_failure
   117043 $at_traceon; }
   117044 
   117045 
   117046 
   117047 
   117048 
   117049   set +x
   117050   $at_times_p && times >"$at_times_file"
   117051 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   117052 read at_status <"$at_status_file"
   117053 #AT_STOP_244
   117054 #AT_START_245
   117055 at_fn_group_banner 245 'calc.at:708' \
   117056   "Calculator %language \"C++\" %glr-parser %defines %locations " "" 14
   117057 at_xfail=no
   117058 (
   117059   $as_echo "245. $at_setup_line: testing $at_desc ..."
   117060   $at_traceon
   117061 
   117062 
   117063 
   117064 
   117065 
   117066 
   117067 
   117068 
   117069 
   117070 
   117071 cat >calc.y <<'_ATEOF'
   117072 %code top {
   117073 #include <config.h>
   117074 /* We don't need perfect functions for these tests. */
   117075 #undef malloc
   117076 #undef memcmp
   117077 #undef realloc
   117078 }
   117079 
   117080 /* Infix notation calculator--calc */
   117081 %language "C++" %glr-parser %defines %locations
   117082 %define global_tokens_and_yystype
   117083 %code requires
   117084 {
   117085 
   117086   /* Exercise pre-prologue dependency to %union.  */
   117087   typedef int semantic_value;
   117088 }
   117089 
   117090 /* Exercise %union. */
   117091 %union
   117092 {
   117093   semantic_value ival;
   117094 };
   117095 %printer { yyoutput << $$; } <ival>;
   117096 
   117097 %code provides
   117098 {
   117099   #include <stdio.h>
   117100   /* The input.  */
   117101   extern FILE *input;
   117102   extern semantic_value global_result;
   117103   extern int global_count;
   117104 }
   117105 
   117106 %code
   117107 {
   117108 #include <assert.h>
   117109 #include <string.h>
   117110 #define USE(Var)
   117111 
   117112 FILE *input;
   117113 static int power (int base, int exponent);
   117114 
   117115 
   117116 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   117117 }
   117118 
   117119 
   117120 
   117121 /* Bison Declarations */
   117122 %token CALC_EOF 0 "end of input"
   117123 %token <ival> NUM "number"
   117124 %type  <ival> exp
   117125 
   117126 %nonassoc '=' /* comparison            */
   117127 %left '-' '+'
   117128 %left '*' '/'
   117129 %left NEG     /* negation--unary minus */
   117130 %right '^'    /* exponentiation        */
   117131 
   117132 /* Grammar follows */
   117133 %%
   117134 input:
   117135   line
   117136 | input line         {  }
   117137 ;
   117138 
   117139 line:
   117140   '\n'
   117141 | exp '\n'           { USE ($1); }
   117142 ;
   117143 
   117144 exp:
   117145   NUM                { $$ = $1;             }
   117146 | exp '=' exp
   117147   {
   117148     if ($1 != $3)
   117149       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   117150     $$ = $1;
   117151   }
   117152 | exp '+' exp        { $$ = $1 + $3;        }
   117153 | exp '-' exp        { $$ = $1 - $3;        }
   117154 | exp '*' exp        { $$ = $1 * $3;        }
   117155 | exp '/' exp        { $$ = $1 / $3;        }
   117156 | '-' exp  %prec NEG { $$ = -$2;            }
   117157 | exp '^' exp        { $$ = power ($1, $3); }
   117158 | '(' exp ')'        { $$ = $2;             }
   117159 | '(' error ')'      { $$ = 1111; yyerrok;  }
   117160 | '!'                { $$ = 0; YYERROR;     }
   117161 | '-' error          { $$ = 0; YYERROR;     }
   117162 ;
   117163 %%
   117164 
   117165 static int
   117166 power (int base, int exponent)
   117167 {
   117168   int res = 1;
   117169   assert (0 <= exponent);
   117170   for (/* Niente */; exponent; --exponent)
   117171     res *= base;
   117172   return res;
   117173 }
   117174 
   117175 
   117176 /* A C++ error reporting function.  */
   117177 void
   117178 yy::parser::error (const location_type& l, const std::string& m)
   117179 {
   117180   (void) l;
   117181   std::cerr << l << ": " << m << std::endl;
   117182 }
   117183 _ATEOF
   117184 
   117185 
   117186 
   117187 cat >calc-lex.cc <<'_ATEOF'
   117188 #include <config.h>
   117189 /* We don't need perfect functions for these tests. */
   117190 #undef malloc
   117191 #undef memcmp
   117192 #undef realloc
   117193 
   117194 #include "calc.hh"
   117195 
   117196 #include <ctype.h>
   117197 
   117198 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   117199 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   117200 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   117201 
   117202 
   117203 static yy::parser::location_type last_yylloc;
   117204 
   117205 static int
   117206 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   117207 {
   117208   int res = getc (input);
   117209   (void) lvalp;(void) llocp;
   117210 
   117211   last_yylloc = (*llocp);
   117212   if (res == '\n')
   117213     {
   117214       (*llocp).end.line++;
   117215       (*llocp).end.column = 1;
   117216     }
   117217   else
   117218     (*llocp).end.column++;
   117219 
   117220   return res;
   117221 }
   117222 
   117223 static void
   117224 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   117225 {
   117226   (void) lvalp;(void) llocp;
   117227 
   117228   /* Wrong when C == `\n'. */
   117229   (*llocp) = last_yylloc;
   117230 
   117231   ungetc (c, input);
   117232 }
   117233 
   117234 static int
   117235 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   117236 {
   117237   int c = get_char (lvalp, llocp);
   117238   int sign = 1;
   117239   int n = 0;
   117240 
   117241   (void) lvalp;(void) llocp;
   117242   if (c == '-')
   117243     {
   117244       c = get_char (lvalp, llocp);
   117245       sign = -1;
   117246     }
   117247 
   117248   while (isdigit (c))
   117249     {
   117250       n = 10 * n + (c - '0');
   117251       c = get_char (lvalp, llocp);
   117252     }
   117253 
   117254   unget_char (lvalp, llocp,  c);
   117255 
   117256   return sign * n;
   117257 }
   117258 
   117259 
   117260 /*---------------------------------------------------------------.
   117261 | Lexical analyzer returns an integer on the stack and the token |
   117262 | NUM, or the ASCII character read if not a number.  Skips all   |
   117263 | blanks and tabs, returns 0 for EOF.                            |
   117264 `---------------------------------------------------------------*/
   117265 
   117266 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   117267 {
   117268   int c;
   117269   /* Skip current token, then white spaces.  */
   117270   do
   117271     {
   117272      (*llocp).begin.column = (*llocp).end.column;
   117273       (*llocp).begin.line   = (*llocp).end.line;
   117274 
   117275     }
   117276   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   117277 
   117278   /* process numbers   */
   117279   if (c == '.' || isdigit (c))
   117280     {
   117281       unget_char (lvalp, llocp,  c);
   117282       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   117283       return NUM;
   117284     }
   117285 
   117286   /* Return end-of-file.  */
   117287   if (c == EOF)
   117288     return CALC_EOF;
   117289 
   117290   /* Return single chars. */
   117291   return c;
   117292 }
   117293 _ATEOF
   117294 
   117295 
   117296 cat >calc-main.cc <<'_ATEOF'
   117297 #include <config.h>
   117298 /* We don't need perfect functions for these tests. */
   117299 #undef malloc
   117300 #undef memcmp
   117301 #undef realloc
   117302 
   117303 #include "calc.hh"
   117304 
   117305 #include <assert.h>
   117306 #if HAVE_UNISTD_H
   117307 # include <unistd.h>
   117308 #else
   117309 # undef alarm
   117310 # define alarm(seconds) /* empty */
   117311 #endif
   117312 
   117313 
   117314 /* A C++ yyparse that simulates the C signature.  */
   117315 int
   117316 yyparse ()
   117317 {
   117318   yy::parser parser;
   117319 #if YYDEBUG
   117320   parser.set_debug_level (1);
   117321 #endif
   117322   return parser.parse ();
   117323 }
   117324 
   117325 
   117326 semantic_value global_result = 0;
   117327 int global_count = 0;
   117328 
   117329 /* A C main function.  */
   117330 int
   117331 main (int argc, const char **argv)
   117332 {
   117333   semantic_value result = 0;
   117334   int count = 0;
   117335   int status;
   117336 
   117337   /* This used to be alarm (10), but that isn't enough time for
   117338      a July 1995 vintage DEC Alphastation 200 4/100 system,
   117339      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   117340   alarm (100);
   117341 
   117342   if (argc == 2)
   117343     input = fopen (argv[1], "r");
   117344   else
   117345     input = stdin;
   117346 
   117347   if (!input)
   117348     {
   117349       perror (argv[1]);
   117350       return 3;
   117351     }
   117352 
   117353 
   117354   status = yyparse ();
   117355   if (fclose (input))
   117356     perror ("fclose");
   117357   assert (global_result == result);
   117358   assert (global_count == count);
   117359   return status;
   117360 }
   117361 _ATEOF
   117362 
   117363 
   117364 
   117365 
   117366 
   117367 
   117368 
   117369 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   117370   at_save_special_files
   117371   mkdir xml-tests
   117372     # Don't combine these Bison invocations since we want to be sure that
   117373   # --report=all isn't required to get the full XML file.
   117374   { set +x
   117375 $as_echo "$at_srcdir/calc.at:708: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   117376                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   117377 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708"
   117378 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   117379                   --graph=xml-tests/test.dot -o calc.cc calc.y
   117380 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117381 at_status=$? at_failed=false
   117382 $at_check_filter
   117383 echo stderr:; cat "$at_stderr"
   117384 echo stdout:; cat "$at_stdout"
   117385 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117386 $at_failed && at_fn_log_failure
   117387 $at_traceon; }
   117388 
   117389   { set +x
   117390 $as_echo "$at_srcdir/calc.at:708: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   117391 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:708"
   117392 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   117393 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117394 at_status=$? at_failed=false
   117395 $at_check_filter
   117396 echo stderr:; cat "$at_stderr"
   117397 echo stdout:; cat "$at_stdout"
   117398 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117399 $at_failed && at_fn_log_failure
   117400 $at_traceon; }
   117401 
   117402     cp xml-tests/test.output expout
   117403   { set +x
   117404 $as_echo "$at_srcdir/calc.at:708: \$XSLTPROC \\
   117405              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   117406              xml-tests/test.xml"
   117407 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:708"
   117408 ( $at_check_trace; $XSLTPROC \
   117409              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   117410              xml-tests/test.xml
   117411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117412 at_status=$? at_failed=false
   117413 $at_check_filter
   117414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117415 $at_diff expout "$at_stdout" || at_failed=:
   117416 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117417 $at_failed && at_fn_log_failure
   117418 $at_traceon; }
   117419 
   117420   sort xml-tests/test.dot > expout
   117421   { set +x
   117422 $as_echo "$at_srcdir/calc.at:708: \$XSLTPROC \\
   117423              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   117424              xml-tests/test.xml | sort"
   117425 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:708"
   117426 ( $at_check_trace; $XSLTPROC \
   117427              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   117428              xml-tests/test.xml | sort
   117429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117430 at_status=$? at_failed=false
   117431 $at_check_filter
   117432 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117433 $at_diff expout "$at_stdout" || at_failed=:
   117434 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117435 $at_failed && at_fn_log_failure
   117436 $at_traceon; }
   117437 
   117438   rm -rf xml-tests expout
   117439   at_restore_special_files
   117440 fi
   117441 { set +x
   117442 $as_echo "$at_srcdir/calc.at:708: bison -o calc.cc calc.y"
   117443 at_fn_check_prepare_trace "calc.at:708"
   117444 ( $at_check_trace; bison -o calc.cc calc.y
   117445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117446 at_status=$? at_failed=false
   117447 $at_check_filter
   117448 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117449 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117450 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117451 $at_failed && at_fn_log_failure
   117452 $at_traceon; }
   117453 
   117454 
   117455 
   117456 { set +x
   117457 $as_echo "$at_srcdir/calc.at:708: \$BISON_CXX_WORKS"
   117458 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:708"
   117459 ( $at_check_trace; $BISON_CXX_WORKS
   117460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117461 at_status=$? at_failed=false
   117462 $at_check_filter
   117463 echo stderr:; cat "$at_stderr"
   117464 echo stdout:; cat "$at_stdout"
   117465 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117466 $at_failed && at_fn_log_failure
   117467 $at_traceon; }
   117468 
   117469 { set +x
   117470 $as_echo "$at_srcdir/calc.at:708: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   117471 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:708"
   117472 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   117473 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117474 at_status=$? at_failed=false
   117475 $at_check_filter
   117476 echo stderr:; cat "$at_stderr"
   117477 echo stdout:; cat "$at_stdout"
   117478 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117479 $at_failed && at_fn_log_failure
   117480 $at_traceon; }
   117481 
   117482 
   117483 { set +x
   117484 $as_echo "$at_srcdir/calc.at:708: \$PERL -ne '
   117485   chomp;
   117486   print \"\$.: {\$_}\\n\"
   117487     if (# No starting/ending empty lines.
   117488         (eof || \$. == 1) && /^\\s*\$/
   117489         # No trailing space.  FIXME: not ready for \"maint\".
   117490         # || /\\s\$/
   117491         )' calc.cc
   117492 "
   117493 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708"
   117494 ( $at_check_trace; $PERL -ne '
   117495   chomp;
   117496   print "$.: {$_}\n"
   117497     if (# No starting/ending empty lines.
   117498         (eof || $. == 1) && /^\s*$/
   117499         # No trailing space.  FIXME: not ready for "maint".
   117500         # || /\s$/
   117501         )' calc.cc
   117502 
   117503 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117504 at_status=$? at_failed=false
   117505 $at_check_filter
   117506 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117507 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117508 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117509 $at_failed && at_fn_log_failure
   117510 $at_traceon; }
   117511 
   117512 { set +x
   117513 $as_echo "$at_srcdir/calc.at:708: \$PERL -ne '
   117514   chomp;
   117515   print \"\$.: {\$_}\\n\"
   117516     if (# No starting/ending empty lines.
   117517         (eof || \$. == 1) && /^\\s*\$/
   117518         # No trailing space.  FIXME: not ready for \"maint\".
   117519         # || /\\s\$/
   117520         )' calc.hh
   117521 "
   117522 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708"
   117523 ( $at_check_trace; $PERL -ne '
   117524   chomp;
   117525   print "$.: {$_}\n"
   117526     if (# No starting/ending empty lines.
   117527         (eof || $. == 1) && /^\s*$/
   117528         # No trailing space.  FIXME: not ready for "maint".
   117529         # || /\s$/
   117530         )' calc.hh
   117531 
   117532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117533 at_status=$? at_failed=false
   117534 $at_check_filter
   117535 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117536 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117537 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117538 $at_failed && at_fn_log_failure
   117539 $at_traceon; }
   117540 
   117541 
   117542 # Test the priorities.
   117543 cat >input <<'_ATEOF'
   117544 1 + 2 * 3 = 7
   117545 1 + 2 * -3 = -5
   117546 
   117547 -1^2 = -1
   117548 (-1)^2 = 1
   117549 
   117550 ---1 = -1
   117551 
   117552 1 - 2 - 3 = -4
   117553 1 - (2 - 3) = 2
   117554 
   117555 2^2^3 = 256
   117556 (2^2)^3 = 64
   117557 _ATEOF
   117558 
   117559 { set +x
   117560 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   117561 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   117562 ( $at_check_trace;  $PREPARSER ./calc input
   117563 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117564 at_status=$? at_failed=false
   117565 $at_check_filter
   117566 echo stderr:; tee stderr <"$at_stderr"
   117567 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117568 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117569 $at_failed && at_fn_log_failure
   117570 $at_traceon; }
   117571 
   117572 { set +x
   117573 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117574 at_fn_check_prepare_trace "calc.at:708"
   117575 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117577 at_status=$? at_failed=false
   117578 $at_check_filter
   117579 echo stderr:; tee stderr <"$at_stderr"
   117580 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117581 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117582 $at_failed && at_fn_log_failure
   117583 $at_traceon; }
   117584 
   117585 
   117586 
   117587 
   117588 # Some syntax errors.
   117589 cat >input <<'_ATEOF'
   117590 1 2
   117591 _ATEOF
   117592 
   117593 { set +x
   117594 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   117595 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   117596 ( $at_check_trace;  $PREPARSER ./calc input
   117597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117598 at_status=$? at_failed=false
   117599 $at_check_filter
   117600 echo stderr:; tee stderr <"$at_stderr"
   117601 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117602 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708"
   117603 $at_failed && at_fn_log_failure
   117604 $at_traceon; }
   117605 
   117606 { set +x
   117607 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117608 at_fn_check_prepare_trace "calc.at:708"
   117609 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117610 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117611 at_status=$? at_failed=false
   117612 $at_check_filter
   117613 echo stderr:; tee stderr <"$at_stderr"
   117614 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117615 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117616 $at_failed && at_fn_log_failure
   117617 $at_traceon; }
   117618 
   117619 
   117620 
   117621 # Normalize the observed and expected error messages, depending upon the
   117622 # options.
   117623 # 1. Remove the traces from observed.
   117624 sed '/^Starting/d
   117625 /^Entering/d
   117626 /^Stack/d
   117627 /^Reading/d
   117628 /^Reducing/d
   117629 /^Return/d
   117630 /^Shifting/d
   117631 /^state/d
   117632 /^Cleanup:/d
   117633 /^Error:/d
   117634 /^Next/d
   117635 /^Now/d
   117636 /^Discarding/d
   117637 / \$[0-9$]* = /d
   117638 /^yydestructor:/d' stderr >at-stderr
   117639 mv at-stderr stderr
   117640 # 2. Create the reference error message.
   117641 cat >expout <<'_ATEOF'
   117642 1.3: syntax error, unexpected number
   117643 _ATEOF
   117644 
   117645 # 3. If locations are not used, remove them.
   117646 
   117647 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   117648 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   117649 mv at-expout expout
   117650 # 5. Check
   117651 { set +x
   117652 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   117653 at_fn_check_prepare_trace "calc.at:708"
   117654 ( $at_check_trace; cat stderr
   117655 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117656 at_status=$? at_failed=false
   117657 $at_check_filter
   117658 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117659 $at_diff expout "$at_stdout" || at_failed=:
   117660 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117661 $at_failed && at_fn_log_failure
   117662 $at_traceon; }
   117663 
   117664 
   117665 cat >input <<'_ATEOF'
   117666 1//2
   117667 _ATEOF
   117668 
   117669 { set +x
   117670 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   117671 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   117672 ( $at_check_trace;  $PREPARSER ./calc input
   117673 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117674 at_status=$? at_failed=false
   117675 $at_check_filter
   117676 echo stderr:; tee stderr <"$at_stderr"
   117677 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117678 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708"
   117679 $at_failed && at_fn_log_failure
   117680 $at_traceon; }
   117681 
   117682 { set +x
   117683 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117684 at_fn_check_prepare_trace "calc.at:708"
   117685 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117687 at_status=$? at_failed=false
   117688 $at_check_filter
   117689 echo stderr:; tee stderr <"$at_stderr"
   117690 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117691 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117692 $at_failed && at_fn_log_failure
   117693 $at_traceon; }
   117694 
   117695 
   117696 
   117697 # Normalize the observed and expected error messages, depending upon the
   117698 # options.
   117699 # 1. Remove the traces from observed.
   117700 sed '/^Starting/d
   117701 /^Entering/d
   117702 /^Stack/d
   117703 /^Reading/d
   117704 /^Reducing/d
   117705 /^Return/d
   117706 /^Shifting/d
   117707 /^state/d
   117708 /^Cleanup:/d
   117709 /^Error:/d
   117710 /^Next/d
   117711 /^Now/d
   117712 /^Discarding/d
   117713 / \$[0-9$]* = /d
   117714 /^yydestructor:/d' stderr >at-stderr
   117715 mv at-stderr stderr
   117716 # 2. Create the reference error message.
   117717 cat >expout <<'_ATEOF'
   117718 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   117719 _ATEOF
   117720 
   117721 # 3. If locations are not used, remove them.
   117722 
   117723 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   117724 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   117725 mv at-expout expout
   117726 # 5. Check
   117727 { set +x
   117728 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   117729 at_fn_check_prepare_trace "calc.at:708"
   117730 ( $at_check_trace; cat stderr
   117731 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117732 at_status=$? at_failed=false
   117733 $at_check_filter
   117734 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117735 $at_diff expout "$at_stdout" || at_failed=:
   117736 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117737 $at_failed && at_fn_log_failure
   117738 $at_traceon; }
   117739 
   117740 
   117741 cat >input <<'_ATEOF'
   117742 error
   117743 _ATEOF
   117744 
   117745 { set +x
   117746 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   117747 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   117748 ( $at_check_trace;  $PREPARSER ./calc input
   117749 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117750 at_status=$? at_failed=false
   117751 $at_check_filter
   117752 echo stderr:; tee stderr <"$at_stderr"
   117753 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117754 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708"
   117755 $at_failed && at_fn_log_failure
   117756 $at_traceon; }
   117757 
   117758 { set +x
   117759 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117760 at_fn_check_prepare_trace "calc.at:708"
   117761 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117762 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117763 at_status=$? at_failed=false
   117764 $at_check_filter
   117765 echo stderr:; tee stderr <"$at_stderr"
   117766 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117767 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117768 $at_failed && at_fn_log_failure
   117769 $at_traceon; }
   117770 
   117771 
   117772 
   117773 # Normalize the observed and expected error messages, depending upon the
   117774 # options.
   117775 # 1. Remove the traces from observed.
   117776 sed '/^Starting/d
   117777 /^Entering/d
   117778 /^Stack/d
   117779 /^Reading/d
   117780 /^Reducing/d
   117781 /^Return/d
   117782 /^Shifting/d
   117783 /^state/d
   117784 /^Cleanup:/d
   117785 /^Error:/d
   117786 /^Next/d
   117787 /^Now/d
   117788 /^Discarding/d
   117789 / \$[0-9$]* = /d
   117790 /^yydestructor:/d' stderr >at-stderr
   117791 mv at-stderr stderr
   117792 # 2. Create the reference error message.
   117793 cat >expout <<'_ATEOF'
   117794 1.1: syntax error, unexpected $undefined
   117795 _ATEOF
   117796 
   117797 # 3. If locations are not used, remove them.
   117798 
   117799 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   117800 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   117801 mv at-expout expout
   117802 # 5. Check
   117803 { set +x
   117804 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   117805 at_fn_check_prepare_trace "calc.at:708"
   117806 ( $at_check_trace; cat stderr
   117807 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117808 at_status=$? at_failed=false
   117809 $at_check_filter
   117810 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117811 $at_diff expout "$at_stdout" || at_failed=:
   117812 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117813 $at_failed && at_fn_log_failure
   117814 $at_traceon; }
   117815 
   117816 
   117817 cat >input <<'_ATEOF'
   117818 1 = 2 = 3
   117819 _ATEOF
   117820 
   117821 { set +x
   117822 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   117823 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   117824 ( $at_check_trace;  $PREPARSER ./calc input
   117825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117826 at_status=$? at_failed=false
   117827 $at_check_filter
   117828 echo stderr:; tee stderr <"$at_stderr"
   117829 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117830 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708"
   117831 $at_failed && at_fn_log_failure
   117832 $at_traceon; }
   117833 
   117834 { set +x
   117835 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117836 at_fn_check_prepare_trace "calc.at:708"
   117837 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117839 at_status=$? at_failed=false
   117840 $at_check_filter
   117841 echo stderr:; tee stderr <"$at_stderr"
   117842 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117843 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117844 $at_failed && at_fn_log_failure
   117845 $at_traceon; }
   117846 
   117847 
   117848 
   117849 # Normalize the observed and expected error messages, depending upon the
   117850 # options.
   117851 # 1. Remove the traces from observed.
   117852 sed '/^Starting/d
   117853 /^Entering/d
   117854 /^Stack/d
   117855 /^Reading/d
   117856 /^Reducing/d
   117857 /^Return/d
   117858 /^Shifting/d
   117859 /^state/d
   117860 /^Cleanup:/d
   117861 /^Error:/d
   117862 /^Next/d
   117863 /^Now/d
   117864 /^Discarding/d
   117865 / \$[0-9$]* = /d
   117866 /^yydestructor:/d' stderr >at-stderr
   117867 mv at-stderr stderr
   117868 # 2. Create the reference error message.
   117869 cat >expout <<'_ATEOF'
   117870 1.7: syntax error, unexpected '='
   117871 _ATEOF
   117872 
   117873 # 3. If locations are not used, remove them.
   117874 
   117875 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   117876 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   117877 mv at-expout expout
   117878 # 5. Check
   117879 { set +x
   117880 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   117881 at_fn_check_prepare_trace "calc.at:708"
   117882 ( $at_check_trace; cat stderr
   117883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117884 at_status=$? at_failed=false
   117885 $at_check_filter
   117886 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117887 $at_diff expout "$at_stdout" || at_failed=:
   117888 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117889 $at_failed && at_fn_log_failure
   117890 $at_traceon; }
   117891 
   117892 
   117893 cat >input <<'_ATEOF'
   117894 
   117895 +1
   117896 _ATEOF
   117897 
   117898 { set +x
   117899 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   117900 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   117901 ( $at_check_trace;  $PREPARSER ./calc input
   117902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117903 at_status=$? at_failed=false
   117904 $at_check_filter
   117905 echo stderr:; tee stderr <"$at_stderr"
   117906 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117907 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708"
   117908 $at_failed && at_fn_log_failure
   117909 $at_traceon; }
   117910 
   117911 { set +x
   117912 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117913 at_fn_check_prepare_trace "calc.at:708"
   117914 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117916 at_status=$? at_failed=false
   117917 $at_check_filter
   117918 echo stderr:; tee stderr <"$at_stderr"
   117919 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117920 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117921 $at_failed && at_fn_log_failure
   117922 $at_traceon; }
   117923 
   117924 
   117925 
   117926 # Normalize the observed and expected error messages, depending upon the
   117927 # options.
   117928 # 1. Remove the traces from observed.
   117929 sed '/^Starting/d
   117930 /^Entering/d
   117931 /^Stack/d
   117932 /^Reading/d
   117933 /^Reducing/d
   117934 /^Return/d
   117935 /^Shifting/d
   117936 /^state/d
   117937 /^Cleanup:/d
   117938 /^Error:/d
   117939 /^Next/d
   117940 /^Now/d
   117941 /^Discarding/d
   117942 / \$[0-9$]* = /d
   117943 /^yydestructor:/d' stderr >at-stderr
   117944 mv at-stderr stderr
   117945 # 2. Create the reference error message.
   117946 cat >expout <<'_ATEOF'
   117947 2.1: syntax error, unexpected '+'
   117948 _ATEOF
   117949 
   117950 # 3. If locations are not used, remove them.
   117951 
   117952 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   117953 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   117954 mv at-expout expout
   117955 # 5. Check
   117956 { set +x
   117957 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   117958 at_fn_check_prepare_trace "calc.at:708"
   117959 ( $at_check_trace; cat stderr
   117960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117961 at_status=$? at_failed=false
   117962 $at_check_filter
   117963 at_fn_diff_devnull "$at_stderr" || at_failed=:
   117964 $at_diff expout "$at_stdout" || at_failed=:
   117965 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117966 $at_failed && at_fn_log_failure
   117967 $at_traceon; }
   117968 
   117969 
   117970 # Exercise error messages with EOF: work on an empty file.
   117971 { set +x
   117972 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc /dev/null"
   117973 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:708"
   117974 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   117975 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117976 at_status=$? at_failed=false
   117977 $at_check_filter
   117978 echo stderr:; tee stderr <"$at_stderr"
   117979 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117980 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708"
   117981 $at_failed && at_fn_log_failure
   117982 $at_traceon; }
   117983 
   117984 { set +x
   117985 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   117986 at_fn_check_prepare_trace "calc.at:708"
   117987 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   117988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   117989 at_status=$? at_failed=false
   117990 $at_check_filter
   117991 echo stderr:; tee stderr <"$at_stderr"
   117992 at_fn_diff_devnull "$at_stdout" || at_failed=:
   117993 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   117994 $at_failed && at_fn_log_failure
   117995 $at_traceon; }
   117996 
   117997 
   117998 
   117999 # Normalize the observed and expected error messages, depending upon the
   118000 # options.
   118001 # 1. Remove the traces from observed.
   118002 sed '/^Starting/d
   118003 /^Entering/d
   118004 /^Stack/d
   118005 /^Reading/d
   118006 /^Reducing/d
   118007 /^Return/d
   118008 /^Shifting/d
   118009 /^state/d
   118010 /^Cleanup:/d
   118011 /^Error:/d
   118012 /^Next/d
   118013 /^Now/d
   118014 /^Discarding/d
   118015 / \$[0-9$]* = /d
   118016 /^yydestructor:/d' stderr >at-stderr
   118017 mv at-stderr stderr
   118018 # 2. Create the reference error message.
   118019 cat >expout <<'_ATEOF'
   118020 1.1: syntax error, unexpected end of input
   118021 _ATEOF
   118022 
   118023 # 3. If locations are not used, remove them.
   118024 
   118025 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   118026 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   118027 mv at-expout expout
   118028 # 5. Check
   118029 { set +x
   118030 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   118031 at_fn_check_prepare_trace "calc.at:708"
   118032 ( $at_check_trace; cat stderr
   118033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118034 at_status=$? at_failed=false
   118035 $at_check_filter
   118036 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118037 $at_diff expout "$at_stdout" || at_failed=:
   118038 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118039 $at_failed && at_fn_log_failure
   118040 $at_traceon; }
   118041 
   118042 
   118043 
   118044 # Exercise the error token: without it, we die at the first error,
   118045 # hence be sure to
   118046 #
   118047 # - have several errors which exercise different shift/discardings
   118048 #   - (): nothing to pop, nothing to discard
   118049 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   118050 #   - (* * *): nothing to pop, a lot to discard
   118051 #   - (1 + 2 * *): some to pop and discard
   118052 #
   118053 # - test the action associated to `error'
   118054 #
   118055 # - check the lookahead that triggers an error is not discarded
   118056 #   when we enter error recovery.  Below, the lookahead causing the
   118057 #   first error is ")", which is needed to recover from the error and
   118058 #   produce the "0" that triggers the "0 != 1" error.
   118059 #
   118060 cat >input <<'_ATEOF'
   118061 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   118062 _ATEOF
   118063 
   118064 { set +x
   118065 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   118066 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   118067 ( $at_check_trace;  $PREPARSER ./calc input
   118068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118069 at_status=$? at_failed=false
   118070 $at_check_filter
   118071 echo stderr:; tee stderr <"$at_stderr"
   118072 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118073 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118074 $at_failed && at_fn_log_failure
   118075 $at_traceon; }
   118076 
   118077 { set +x
   118078 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   118079 at_fn_check_prepare_trace "calc.at:708"
   118080 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   118081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118082 at_status=$? at_failed=false
   118083 $at_check_filter
   118084 echo stderr:; tee stderr <"$at_stderr"
   118085 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118086 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118087 $at_failed && at_fn_log_failure
   118088 $at_traceon; }
   118089 
   118090 
   118091 
   118092 # Normalize the observed and expected error messages, depending upon the
   118093 # options.
   118094 # 1. Remove the traces from observed.
   118095 sed '/^Starting/d
   118096 /^Entering/d
   118097 /^Stack/d
   118098 /^Reading/d
   118099 /^Reducing/d
   118100 /^Return/d
   118101 /^Shifting/d
   118102 /^state/d
   118103 /^Cleanup:/d
   118104 /^Error:/d
   118105 /^Next/d
   118106 /^Now/d
   118107 /^Discarding/d
   118108 / \$[0-9$]* = /d
   118109 /^yydestructor:/d' stderr >at-stderr
   118110 mv at-stderr stderr
   118111 # 2. Create the reference error message.
   118112 cat >expout <<'_ATEOF'
   118113 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   118114 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   118115 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   118116 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   118117 calc: error: 4444 != 1
   118118 _ATEOF
   118119 
   118120 # 3. If locations are not used, remove them.
   118121 
   118122 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   118123 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   118124 mv at-expout expout
   118125 # 5. Check
   118126 { set +x
   118127 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   118128 at_fn_check_prepare_trace "calc.at:708"
   118129 ( $at_check_trace; cat stderr
   118130 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118131 at_status=$? at_failed=false
   118132 $at_check_filter
   118133 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118134 $at_diff expout "$at_stdout" || at_failed=:
   118135 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118136 $at_failed && at_fn_log_failure
   118137 $at_traceon; }
   118138 
   118139 
   118140 
   118141 # The same, but this time exercising explicitly triggered syntax errors.
   118142 # POSIX says the lookahead causing the error should not be discarded.
   118143 cat >input <<'_ATEOF'
   118144 (!) + (1 2) = 1
   118145 _ATEOF
   118146 
   118147 { set +x
   118148 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   118149 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   118150 ( $at_check_trace;  $PREPARSER ./calc input
   118151 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118152 at_status=$? at_failed=false
   118153 $at_check_filter
   118154 echo stderr:; tee stderr <"$at_stderr"
   118155 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118156 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118157 $at_failed && at_fn_log_failure
   118158 $at_traceon; }
   118159 
   118160 { set +x
   118161 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   118162 at_fn_check_prepare_trace "calc.at:708"
   118163 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   118164 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118165 at_status=$? at_failed=false
   118166 $at_check_filter
   118167 echo stderr:; tee stderr <"$at_stderr"
   118168 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118169 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118170 $at_failed && at_fn_log_failure
   118171 $at_traceon; }
   118172 
   118173 
   118174 
   118175 # Normalize the observed and expected error messages, depending upon the
   118176 # options.
   118177 # 1. Remove the traces from observed.
   118178 sed '/^Starting/d
   118179 /^Entering/d
   118180 /^Stack/d
   118181 /^Reading/d
   118182 /^Reducing/d
   118183 /^Return/d
   118184 /^Shifting/d
   118185 /^state/d
   118186 /^Cleanup:/d
   118187 /^Error:/d
   118188 /^Next/d
   118189 /^Now/d
   118190 /^Discarding/d
   118191 / \$[0-9$]* = /d
   118192 /^yydestructor:/d' stderr >at-stderr
   118193 mv at-stderr stderr
   118194 # 2. Create the reference error message.
   118195 cat >expout <<'_ATEOF'
   118196 1.10: syntax error, unexpected number
   118197 calc: error: 2222 != 1
   118198 _ATEOF
   118199 
   118200 # 3. If locations are not used, remove them.
   118201 
   118202 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   118203 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   118204 mv at-expout expout
   118205 # 5. Check
   118206 { set +x
   118207 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   118208 at_fn_check_prepare_trace "calc.at:708"
   118209 ( $at_check_trace; cat stderr
   118210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118211 at_status=$? at_failed=false
   118212 $at_check_filter
   118213 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118214 $at_diff expout "$at_stdout" || at_failed=:
   118215 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118216 $at_failed && at_fn_log_failure
   118217 $at_traceon; }
   118218 
   118219 
   118220 cat >input <<'_ATEOF'
   118221 (- *) + (1 2) = 1
   118222 _ATEOF
   118223 
   118224 { set +x
   118225 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   118226 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   118227 ( $at_check_trace;  $PREPARSER ./calc input
   118228 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118229 at_status=$? at_failed=false
   118230 $at_check_filter
   118231 echo stderr:; tee stderr <"$at_stderr"
   118232 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118233 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118234 $at_failed && at_fn_log_failure
   118235 $at_traceon; }
   118236 
   118237 { set +x
   118238 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   118239 at_fn_check_prepare_trace "calc.at:708"
   118240 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   118241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118242 at_status=$? at_failed=false
   118243 $at_check_filter
   118244 echo stderr:; tee stderr <"$at_stderr"
   118245 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118246 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118247 $at_failed && at_fn_log_failure
   118248 $at_traceon; }
   118249 
   118250 
   118251 
   118252 # Normalize the observed and expected error messages, depending upon the
   118253 # options.
   118254 # 1. Remove the traces from observed.
   118255 sed '/^Starting/d
   118256 /^Entering/d
   118257 /^Stack/d
   118258 /^Reading/d
   118259 /^Reducing/d
   118260 /^Return/d
   118261 /^Shifting/d
   118262 /^state/d
   118263 /^Cleanup:/d
   118264 /^Error:/d
   118265 /^Next/d
   118266 /^Now/d
   118267 /^Discarding/d
   118268 / \$[0-9$]* = /d
   118269 /^yydestructor:/d' stderr >at-stderr
   118270 mv at-stderr stderr
   118271 # 2. Create the reference error message.
   118272 cat >expout <<'_ATEOF'
   118273 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   118274 1.12: syntax error, unexpected number
   118275 calc: error: 2222 != 1
   118276 _ATEOF
   118277 
   118278 # 3. If locations are not used, remove them.
   118279 
   118280 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   118281 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   118282 mv at-expout expout
   118283 # 5. Check
   118284 { set +x
   118285 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   118286 at_fn_check_prepare_trace "calc.at:708"
   118287 ( $at_check_trace; cat stderr
   118288 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118289 at_status=$? at_failed=false
   118290 $at_check_filter
   118291 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118292 $at_diff expout "$at_stdout" || at_failed=:
   118293 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118294 $at_failed && at_fn_log_failure
   118295 $at_traceon; }
   118296 
   118297 
   118298 
   118299 # Check that yyerrok works properly: second error is not reported,
   118300 # third and fourth are.  Parse status is succesfull.
   118301 cat >input <<'_ATEOF'
   118302 (* *) + (*) + (*)
   118303 _ATEOF
   118304 
   118305 { set +x
   118306 $as_echo "$at_srcdir/calc.at:708:  \$PREPARSER ./calc input"
   118307 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708"
   118308 ( $at_check_trace;  $PREPARSER ./calc input
   118309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118310 at_status=$? at_failed=false
   118311 $at_check_filter
   118312 echo stderr:; tee stderr <"$at_stderr"
   118313 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118314 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118315 $at_failed && at_fn_log_failure
   118316 $at_traceon; }
   118317 
   118318 { set +x
   118319 $as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   118320 at_fn_check_prepare_trace "calc.at:708"
   118321 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   118322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118323 at_status=$? at_failed=false
   118324 $at_check_filter
   118325 echo stderr:; tee stderr <"$at_stderr"
   118326 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118327 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118328 $at_failed && at_fn_log_failure
   118329 $at_traceon; }
   118330 
   118331 
   118332 
   118333 # Normalize the observed and expected error messages, depending upon the
   118334 # options.
   118335 # 1. Remove the traces from observed.
   118336 sed '/^Starting/d
   118337 /^Entering/d
   118338 /^Stack/d
   118339 /^Reading/d
   118340 /^Reducing/d
   118341 /^Return/d
   118342 /^Shifting/d
   118343 /^state/d
   118344 /^Cleanup:/d
   118345 /^Error:/d
   118346 /^Next/d
   118347 /^Now/d
   118348 /^Discarding/d
   118349 / \$[0-9$]* = /d
   118350 /^yydestructor:/d' stderr >at-stderr
   118351 mv at-stderr stderr
   118352 # 2. Create the reference error message.
   118353 cat >expout <<'_ATEOF'
   118354 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   118355 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   118356 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   118357 _ATEOF
   118358 
   118359 # 3. If locations are not used, remove them.
   118360 
   118361 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   118362 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   118363 mv at-expout expout
   118364 # 5. Check
   118365 { set +x
   118366 $as_echo "$at_srcdir/calc.at:708: cat stderr"
   118367 at_fn_check_prepare_trace "calc.at:708"
   118368 ( $at_check_trace; cat stderr
   118369 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118370 at_status=$? at_failed=false
   118371 $at_check_filter
   118372 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118373 $at_diff expout "$at_stdout" || at_failed=:
   118374 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708"
   118375 $at_failed && at_fn_log_failure
   118376 $at_traceon; }
   118377 
   118378 
   118379 
   118380 
   118381 
   118382   set +x
   118383   $at_times_p && times >"$at_times_file"
   118384 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   118385 read at_status <"$at_status_file"
   118386 #AT_STOP_245
   118387 #AT_START_246
   118388 at_fn_group_banner 246 'calc.at:709' \
   118389   "Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span" "" 14
   118390 at_xfail=no
   118391 (
   118392   $as_echo "246. $at_setup_line: testing $at_desc ..."
   118393   $at_traceon
   118394 
   118395 
   118396 
   118397 
   118398 
   118399 
   118400 
   118401 
   118402 
   118403 
   118404 cat >calc.y <<'_ATEOF'
   118405 %code top {
   118406 #include <config.h>
   118407 /* We don't need perfect functions for these tests. */
   118408 #undef malloc
   118409 #undef memcmp
   118410 #undef realloc
   118411 }
   118412 
   118413 /* Infix notation calculator--calc */
   118414 %language "C++" %glr-parser %defines %locations %define api.location.type Span
   118415 %define global_tokens_and_yystype
   118416 %code requires
   118417 {
   118418 
   118419 # include <iostream>
   118420   struct Point
   118421   {
   118422     int l;
   118423     int c;
   118424   };
   118425 
   118426   struct Span
   118427   {
   118428     Point first;
   118429     Point last;
   118430   };
   118431 
   118432 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
   118433   do                                                                    \
   118434     if (N)                                                              \
   118435       {                                                                 \
   118436         (Current).first = YYRHSLOC (Rhs, 1).first;                      \
   118437         (Current).last  = YYRHSLOC (Rhs, N).last;                       \
   118438       }                                                                 \
   118439     else                                                                \
   118440       {                                                                 \
   118441         (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last;      \
   118442       }                                                                 \
   118443   while (false)
   118444 
   118445 
   118446   /* Exercise pre-prologue dependency to %union.  */
   118447   typedef int semantic_value;
   118448 }
   118449 
   118450 /* Exercise %union. */
   118451 %union
   118452 {
   118453   semantic_value ival;
   118454 };
   118455 %printer { yyoutput << $$; } <ival>;
   118456 
   118457 %code provides
   118458 {
   118459   #include <stdio.h>
   118460   /* The input.  */
   118461   extern FILE *input;
   118462   extern semantic_value global_result;
   118463   extern int global_count;
   118464 }
   118465 
   118466 %code
   118467 {
   118468 #include <assert.h>
   118469 #include <string.h>
   118470 #define USE(Var)
   118471 
   118472 FILE *input;
   118473 static int power (int base, int exponent);
   118474 
   118475 
   118476 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   118477 }
   118478 
   118479 
   118480 %initial-action
   118481 {
   118482   @$.first.l = @$.first.c = 1;
   118483   @$.last = @$.first;
   118484 }
   118485 
   118486 /* Bison Declarations */
   118487 %token CALC_EOF 0 "end of input"
   118488 %token <ival> NUM "number"
   118489 %type  <ival> exp
   118490 
   118491 %nonassoc '=' /* comparison            */
   118492 %left '-' '+'
   118493 %left '*' '/'
   118494 %left NEG     /* negation--unary minus */
   118495 %right '^'    /* exponentiation        */
   118496 
   118497 /* Grammar follows */
   118498 %%
   118499 input:
   118500   line
   118501 | input line         {  }
   118502 ;
   118503 
   118504 line:
   118505   '\n'
   118506 | exp '\n'           { USE ($1); }
   118507 ;
   118508 
   118509 exp:
   118510   NUM                { $$ = $1;             }
   118511 | exp '=' exp
   118512   {
   118513     if ($1 != $3)
   118514       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   118515     $$ = $1;
   118516   }
   118517 | exp '+' exp        { $$ = $1 + $3;        }
   118518 | exp '-' exp        { $$ = $1 - $3;        }
   118519 | exp '*' exp        { $$ = $1 * $3;        }
   118520 | exp '/' exp        { $$ = $1 / $3;        }
   118521 | '-' exp  %prec NEG { $$ = -$2;            }
   118522 | exp '^' exp        { $$ = power ($1, $3); }
   118523 | '(' exp ')'        { $$ = $2;             }
   118524 | '(' error ')'      { $$ = 1111; yyerrok;  }
   118525 | '!'                { $$ = 0; YYERROR;     }
   118526 | '-' error          { $$ = 0; YYERROR;     }
   118527 ;
   118528 %%
   118529 
   118530 static int
   118531 power (int base, int exponent)
   118532 {
   118533   int res = 1;
   118534   assert (0 <= exponent);
   118535   for (/* Niente */; exponent; --exponent)
   118536     res *= base;
   118537   return res;
   118538 }
   118539 
   118540 
   118541   std::ostream&
   118542   operator<< (std::ostream& o, const Span& s)
   118543   {
   118544     o << s.first.l << '.' << s.first.c;
   118545     if (s.first.l != s.last.l)
   118546       o << '-' << s.last.l << '.' << s.last.c - 1;
   118547     else if (s.first.c != s.last.c - 1)
   118548       o << '-' << s.last.c - 1;
   118549     return o;
   118550   }
   118551 
   118552 /* A C++ error reporting function.  */
   118553 void
   118554 yy::parser::error (const location_type& l, const std::string& m)
   118555 {
   118556   (void) l;
   118557   std::cerr << l << ": " << m << std::endl;
   118558 }
   118559 _ATEOF
   118560 
   118561 
   118562 
   118563 cat >calc-lex.cc <<'_ATEOF'
   118564 #include <config.h>
   118565 /* We don't need perfect functions for these tests. */
   118566 #undef malloc
   118567 #undef memcmp
   118568 #undef realloc
   118569 
   118570 #include "calc.hh"
   118571 
   118572 #include <ctype.h>
   118573 
   118574 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   118575 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   118576 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   118577 
   118578 
   118579 static yy::parser::location_type last_yylloc;
   118580 
   118581 static int
   118582 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   118583 {
   118584   int res = getc (input);
   118585   (void) lvalp;(void) llocp;
   118586 
   118587   last_yylloc = (*llocp);
   118588   if (res == '\n')
   118589     {
   118590       (*llocp).last.l++;
   118591       (*llocp).last.c = 1;
   118592     }
   118593   else
   118594     (*llocp).last.c++;
   118595 
   118596   return res;
   118597 }
   118598 
   118599 static void
   118600 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   118601 {
   118602   (void) lvalp;(void) llocp;
   118603 
   118604   /* Wrong when C == `\n'. */
   118605   (*llocp) = last_yylloc;
   118606 
   118607   ungetc (c, input);
   118608 }
   118609 
   118610 static int
   118611 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   118612 {
   118613   int c = get_char (lvalp, llocp);
   118614   int sign = 1;
   118615   int n = 0;
   118616 
   118617   (void) lvalp;(void) llocp;
   118618   if (c == '-')
   118619     {
   118620       c = get_char (lvalp, llocp);
   118621       sign = -1;
   118622     }
   118623 
   118624   while (isdigit (c))
   118625     {
   118626       n = 10 * n + (c - '0');
   118627       c = get_char (lvalp, llocp);
   118628     }
   118629 
   118630   unget_char (lvalp, llocp,  c);
   118631 
   118632   return sign * n;
   118633 }
   118634 
   118635 
   118636 /*---------------------------------------------------------------.
   118637 | Lexical analyzer returns an integer on the stack and the token |
   118638 | NUM, or the ASCII character read if not a number.  Skips all   |
   118639 | blanks and tabs, returns 0 for EOF.                            |
   118640 `---------------------------------------------------------------*/
   118641 
   118642 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   118643 {
   118644   int c;
   118645   /* Skip current token, then white spaces.  */
   118646   do
   118647     {
   118648      (*llocp).first.c = (*llocp).last.c;
   118649       (*llocp).first.l   = (*llocp).last.l;
   118650 
   118651     }
   118652   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   118653 
   118654   /* process numbers   */
   118655   if (c == '.' || isdigit (c))
   118656     {
   118657       unget_char (lvalp, llocp,  c);
   118658       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   118659       return NUM;
   118660     }
   118661 
   118662   /* Return end-of-file.  */
   118663   if (c == EOF)
   118664     return CALC_EOF;
   118665 
   118666   /* Return single chars. */
   118667   return c;
   118668 }
   118669 _ATEOF
   118670 
   118671 
   118672 cat >calc-main.cc <<'_ATEOF'
   118673 #include <config.h>
   118674 /* We don't need perfect functions for these tests. */
   118675 #undef malloc
   118676 #undef memcmp
   118677 #undef realloc
   118678 
   118679 #include "calc.hh"
   118680 
   118681 #include <assert.h>
   118682 #if HAVE_UNISTD_H
   118683 # include <unistd.h>
   118684 #else
   118685 # undef alarm
   118686 # define alarm(seconds) /* empty */
   118687 #endif
   118688 
   118689 
   118690 /* A C++ yyparse that simulates the C signature.  */
   118691 int
   118692 yyparse ()
   118693 {
   118694   yy::parser parser;
   118695 #if YYDEBUG
   118696   parser.set_debug_level (1);
   118697 #endif
   118698   return parser.parse ();
   118699 }
   118700 
   118701 
   118702 semantic_value global_result = 0;
   118703 int global_count = 0;
   118704 
   118705 /* A C main function.  */
   118706 int
   118707 main (int argc, const char **argv)
   118708 {
   118709   semantic_value result = 0;
   118710   int count = 0;
   118711   int status;
   118712 
   118713   /* This used to be alarm (10), but that isn't enough time for
   118714      a July 1995 vintage DEC Alphastation 200 4/100 system,
   118715      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   118716   alarm (100);
   118717 
   118718   if (argc == 2)
   118719     input = fopen (argv[1], "r");
   118720   else
   118721     input = stdin;
   118722 
   118723   if (!input)
   118724     {
   118725       perror (argv[1]);
   118726       return 3;
   118727     }
   118728 
   118729 
   118730   status = yyparse ();
   118731   if (fclose (input))
   118732     perror ("fclose");
   118733   assert (global_result == result);
   118734   assert (global_count == count);
   118735   return status;
   118736 }
   118737 _ATEOF
   118738 
   118739 
   118740 
   118741 
   118742 
   118743 
   118744 
   118745 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   118746   at_save_special_files
   118747   mkdir xml-tests
   118748     # Don't combine these Bison invocations since we want to be sure that
   118749   # --report=all isn't required to get the full XML file.
   118750   { set +x
   118751 $as_echo "$at_srcdir/calc.at:709: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   118752                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   118753 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709"
   118754 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   118755                   --graph=xml-tests/test.dot -o calc.cc calc.y
   118756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118757 at_status=$? at_failed=false
   118758 $at_check_filter
   118759 echo stderr:; cat "$at_stderr"
   118760 echo stdout:; cat "$at_stdout"
   118761 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118762 $at_failed && at_fn_log_failure
   118763 $at_traceon; }
   118764 
   118765   { set +x
   118766 $as_echo "$at_srcdir/calc.at:709: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   118767 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:709"
   118768 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   118769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118770 at_status=$? at_failed=false
   118771 $at_check_filter
   118772 echo stderr:; cat "$at_stderr"
   118773 echo stdout:; cat "$at_stdout"
   118774 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118775 $at_failed && at_fn_log_failure
   118776 $at_traceon; }
   118777 
   118778     cp xml-tests/test.output expout
   118779   { set +x
   118780 $as_echo "$at_srcdir/calc.at:709: \$XSLTPROC \\
   118781              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   118782              xml-tests/test.xml"
   118783 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:709"
   118784 ( $at_check_trace; $XSLTPROC \
   118785              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   118786              xml-tests/test.xml
   118787 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118788 at_status=$? at_failed=false
   118789 $at_check_filter
   118790 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118791 $at_diff expout "$at_stdout" || at_failed=:
   118792 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118793 $at_failed && at_fn_log_failure
   118794 $at_traceon; }
   118795 
   118796   sort xml-tests/test.dot > expout
   118797   { set +x
   118798 $as_echo "$at_srcdir/calc.at:709: \$XSLTPROC \\
   118799              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   118800              xml-tests/test.xml | sort"
   118801 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:709"
   118802 ( $at_check_trace; $XSLTPROC \
   118803              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   118804              xml-tests/test.xml | sort
   118805 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118806 at_status=$? at_failed=false
   118807 $at_check_filter
   118808 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118809 $at_diff expout "$at_stdout" || at_failed=:
   118810 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118811 $at_failed && at_fn_log_failure
   118812 $at_traceon; }
   118813 
   118814   rm -rf xml-tests expout
   118815   at_restore_special_files
   118816 fi
   118817 { set +x
   118818 $as_echo "$at_srcdir/calc.at:709: bison -o calc.cc calc.y"
   118819 at_fn_check_prepare_trace "calc.at:709"
   118820 ( $at_check_trace; bison -o calc.cc calc.y
   118821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118822 at_status=$? at_failed=false
   118823 $at_check_filter
   118824 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118825 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118826 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118827 $at_failed && at_fn_log_failure
   118828 $at_traceon; }
   118829 
   118830 
   118831 
   118832 { set +x
   118833 $as_echo "$at_srcdir/calc.at:709: \$BISON_CXX_WORKS"
   118834 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:709"
   118835 ( $at_check_trace; $BISON_CXX_WORKS
   118836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118837 at_status=$? at_failed=false
   118838 $at_check_filter
   118839 echo stderr:; cat "$at_stderr"
   118840 echo stdout:; cat "$at_stdout"
   118841 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118842 $at_failed && at_fn_log_failure
   118843 $at_traceon; }
   118844 
   118845 { set +x
   118846 $as_echo "$at_srcdir/calc.at:709: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   118847 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:709"
   118848 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   118849 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118850 at_status=$? at_failed=false
   118851 $at_check_filter
   118852 echo stderr:; cat "$at_stderr"
   118853 echo stdout:; cat "$at_stdout"
   118854 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118855 $at_failed && at_fn_log_failure
   118856 $at_traceon; }
   118857 
   118858 
   118859 { set +x
   118860 $as_echo "$at_srcdir/calc.at:709: \$PERL -ne '
   118861   chomp;
   118862   print \"\$.: {\$_}\\n\"
   118863     if (# No starting/ending empty lines.
   118864         (eof || \$. == 1) && /^\\s*\$/
   118865         # No trailing space.  FIXME: not ready for \"maint\".
   118866         # || /\\s\$/
   118867         )' calc.cc
   118868 "
   118869 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709"
   118870 ( $at_check_trace; $PERL -ne '
   118871   chomp;
   118872   print "$.: {$_}\n"
   118873     if (# No starting/ending empty lines.
   118874         (eof || $. == 1) && /^\s*$/
   118875         # No trailing space.  FIXME: not ready for "maint".
   118876         # || /\s$/
   118877         )' calc.cc
   118878 
   118879 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118880 at_status=$? at_failed=false
   118881 $at_check_filter
   118882 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118883 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118884 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118885 $at_failed && at_fn_log_failure
   118886 $at_traceon; }
   118887 
   118888 { set +x
   118889 $as_echo "$at_srcdir/calc.at:709: \$PERL -ne '
   118890   chomp;
   118891   print \"\$.: {\$_}\\n\"
   118892     if (# No starting/ending empty lines.
   118893         (eof || \$. == 1) && /^\\s*\$/
   118894         # No trailing space.  FIXME: not ready for \"maint\".
   118895         # || /\\s\$/
   118896         )' calc.hh
   118897 "
   118898 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709"
   118899 ( $at_check_trace; $PERL -ne '
   118900   chomp;
   118901   print "$.: {$_}\n"
   118902     if (# No starting/ending empty lines.
   118903         (eof || $. == 1) && /^\s*$/
   118904         # No trailing space.  FIXME: not ready for "maint".
   118905         # || /\s$/
   118906         )' calc.hh
   118907 
   118908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118909 at_status=$? at_failed=false
   118910 $at_check_filter
   118911 at_fn_diff_devnull "$at_stderr" || at_failed=:
   118912 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118913 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118914 $at_failed && at_fn_log_failure
   118915 $at_traceon; }
   118916 
   118917 
   118918 # Test the priorities.
   118919 cat >input <<'_ATEOF'
   118920 1 + 2 * 3 = 7
   118921 1 + 2 * -3 = -5
   118922 
   118923 -1^2 = -1
   118924 (-1)^2 = 1
   118925 
   118926 ---1 = -1
   118927 
   118928 1 - 2 - 3 = -4
   118929 1 - (2 - 3) = 2
   118930 
   118931 2^2^3 = 256
   118932 (2^2)^3 = 64
   118933 _ATEOF
   118934 
   118935 { set +x
   118936 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   118937 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   118938 ( $at_check_trace;  $PREPARSER ./calc input
   118939 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118940 at_status=$? at_failed=false
   118941 $at_check_filter
   118942 echo stderr:; tee stderr <"$at_stderr"
   118943 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118944 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118945 $at_failed && at_fn_log_failure
   118946 $at_traceon; }
   118947 
   118948 { set +x
   118949 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   118950 at_fn_check_prepare_trace "calc.at:709"
   118951 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   118952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118953 at_status=$? at_failed=false
   118954 $at_check_filter
   118955 echo stderr:; tee stderr <"$at_stderr"
   118956 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118957 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118958 $at_failed && at_fn_log_failure
   118959 $at_traceon; }
   118960 
   118961 
   118962 
   118963 
   118964 # Some syntax errors.
   118965 cat >input <<'_ATEOF'
   118966 1 2
   118967 _ATEOF
   118968 
   118969 { set +x
   118970 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   118971 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   118972 ( $at_check_trace;  $PREPARSER ./calc input
   118973 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118974 at_status=$? at_failed=false
   118975 $at_check_filter
   118976 echo stderr:; tee stderr <"$at_stderr"
   118977 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118978 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709"
   118979 $at_failed && at_fn_log_failure
   118980 $at_traceon; }
   118981 
   118982 { set +x
   118983 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   118984 at_fn_check_prepare_trace "calc.at:709"
   118985 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   118986 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   118987 at_status=$? at_failed=false
   118988 $at_check_filter
   118989 echo stderr:; tee stderr <"$at_stderr"
   118990 at_fn_diff_devnull "$at_stdout" || at_failed=:
   118991 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   118992 $at_failed && at_fn_log_failure
   118993 $at_traceon; }
   118994 
   118995 
   118996 
   118997 # Normalize the observed and expected error messages, depending upon the
   118998 # options.
   118999 # 1. Remove the traces from observed.
   119000 sed '/^Starting/d
   119001 /^Entering/d
   119002 /^Stack/d
   119003 /^Reading/d
   119004 /^Reducing/d
   119005 /^Return/d
   119006 /^Shifting/d
   119007 /^state/d
   119008 /^Cleanup:/d
   119009 /^Error:/d
   119010 /^Next/d
   119011 /^Now/d
   119012 /^Discarding/d
   119013 / \$[0-9$]* = /d
   119014 /^yydestructor:/d' stderr >at-stderr
   119015 mv at-stderr stderr
   119016 # 2. Create the reference error message.
   119017 cat >expout <<'_ATEOF'
   119018 1.3: syntax error, unexpected number
   119019 _ATEOF
   119020 
   119021 # 3. If locations are not used, remove them.
   119022 
   119023 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119024 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119025 mv at-expout expout
   119026 # 5. Check
   119027 { set +x
   119028 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119029 at_fn_check_prepare_trace "calc.at:709"
   119030 ( $at_check_trace; cat stderr
   119031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119032 at_status=$? at_failed=false
   119033 $at_check_filter
   119034 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119035 $at_diff expout "$at_stdout" || at_failed=:
   119036 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119037 $at_failed && at_fn_log_failure
   119038 $at_traceon; }
   119039 
   119040 
   119041 cat >input <<'_ATEOF'
   119042 1//2
   119043 _ATEOF
   119044 
   119045 { set +x
   119046 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119047 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119048 ( $at_check_trace;  $PREPARSER ./calc input
   119049 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119050 at_status=$? at_failed=false
   119051 $at_check_filter
   119052 echo stderr:; tee stderr <"$at_stderr"
   119053 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119054 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709"
   119055 $at_failed && at_fn_log_failure
   119056 $at_traceon; }
   119057 
   119058 { set +x
   119059 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119060 at_fn_check_prepare_trace "calc.at:709"
   119061 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119063 at_status=$? at_failed=false
   119064 $at_check_filter
   119065 echo stderr:; tee stderr <"$at_stderr"
   119066 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119067 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119068 $at_failed && at_fn_log_failure
   119069 $at_traceon; }
   119070 
   119071 
   119072 
   119073 # Normalize the observed and expected error messages, depending upon the
   119074 # options.
   119075 # 1. Remove the traces from observed.
   119076 sed '/^Starting/d
   119077 /^Entering/d
   119078 /^Stack/d
   119079 /^Reading/d
   119080 /^Reducing/d
   119081 /^Return/d
   119082 /^Shifting/d
   119083 /^state/d
   119084 /^Cleanup:/d
   119085 /^Error:/d
   119086 /^Next/d
   119087 /^Now/d
   119088 /^Discarding/d
   119089 / \$[0-9$]* = /d
   119090 /^yydestructor:/d' stderr >at-stderr
   119091 mv at-stderr stderr
   119092 # 2. Create the reference error message.
   119093 cat >expout <<'_ATEOF'
   119094 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   119095 _ATEOF
   119096 
   119097 # 3. If locations are not used, remove them.
   119098 
   119099 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119100 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119101 mv at-expout expout
   119102 # 5. Check
   119103 { set +x
   119104 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119105 at_fn_check_prepare_trace "calc.at:709"
   119106 ( $at_check_trace; cat stderr
   119107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119108 at_status=$? at_failed=false
   119109 $at_check_filter
   119110 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119111 $at_diff expout "$at_stdout" || at_failed=:
   119112 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119113 $at_failed && at_fn_log_failure
   119114 $at_traceon; }
   119115 
   119116 
   119117 cat >input <<'_ATEOF'
   119118 error
   119119 _ATEOF
   119120 
   119121 { set +x
   119122 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119123 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119124 ( $at_check_trace;  $PREPARSER ./calc input
   119125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119126 at_status=$? at_failed=false
   119127 $at_check_filter
   119128 echo stderr:; tee stderr <"$at_stderr"
   119129 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119130 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709"
   119131 $at_failed && at_fn_log_failure
   119132 $at_traceon; }
   119133 
   119134 { set +x
   119135 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119136 at_fn_check_prepare_trace "calc.at:709"
   119137 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119139 at_status=$? at_failed=false
   119140 $at_check_filter
   119141 echo stderr:; tee stderr <"$at_stderr"
   119142 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119143 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119144 $at_failed && at_fn_log_failure
   119145 $at_traceon; }
   119146 
   119147 
   119148 
   119149 # Normalize the observed and expected error messages, depending upon the
   119150 # options.
   119151 # 1. Remove the traces from observed.
   119152 sed '/^Starting/d
   119153 /^Entering/d
   119154 /^Stack/d
   119155 /^Reading/d
   119156 /^Reducing/d
   119157 /^Return/d
   119158 /^Shifting/d
   119159 /^state/d
   119160 /^Cleanup:/d
   119161 /^Error:/d
   119162 /^Next/d
   119163 /^Now/d
   119164 /^Discarding/d
   119165 / \$[0-9$]* = /d
   119166 /^yydestructor:/d' stderr >at-stderr
   119167 mv at-stderr stderr
   119168 # 2. Create the reference error message.
   119169 cat >expout <<'_ATEOF'
   119170 1.1: syntax error, unexpected $undefined
   119171 _ATEOF
   119172 
   119173 # 3. If locations are not used, remove them.
   119174 
   119175 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119176 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119177 mv at-expout expout
   119178 # 5. Check
   119179 { set +x
   119180 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119181 at_fn_check_prepare_trace "calc.at:709"
   119182 ( $at_check_trace; cat stderr
   119183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119184 at_status=$? at_failed=false
   119185 $at_check_filter
   119186 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119187 $at_diff expout "$at_stdout" || at_failed=:
   119188 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119189 $at_failed && at_fn_log_failure
   119190 $at_traceon; }
   119191 
   119192 
   119193 cat >input <<'_ATEOF'
   119194 1 = 2 = 3
   119195 _ATEOF
   119196 
   119197 { set +x
   119198 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119199 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119200 ( $at_check_trace;  $PREPARSER ./calc input
   119201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119202 at_status=$? at_failed=false
   119203 $at_check_filter
   119204 echo stderr:; tee stderr <"$at_stderr"
   119205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119206 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709"
   119207 $at_failed && at_fn_log_failure
   119208 $at_traceon; }
   119209 
   119210 { set +x
   119211 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119212 at_fn_check_prepare_trace "calc.at:709"
   119213 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119214 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119215 at_status=$? at_failed=false
   119216 $at_check_filter
   119217 echo stderr:; tee stderr <"$at_stderr"
   119218 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119219 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119220 $at_failed && at_fn_log_failure
   119221 $at_traceon; }
   119222 
   119223 
   119224 
   119225 # Normalize the observed and expected error messages, depending upon the
   119226 # options.
   119227 # 1. Remove the traces from observed.
   119228 sed '/^Starting/d
   119229 /^Entering/d
   119230 /^Stack/d
   119231 /^Reading/d
   119232 /^Reducing/d
   119233 /^Return/d
   119234 /^Shifting/d
   119235 /^state/d
   119236 /^Cleanup:/d
   119237 /^Error:/d
   119238 /^Next/d
   119239 /^Now/d
   119240 /^Discarding/d
   119241 / \$[0-9$]* = /d
   119242 /^yydestructor:/d' stderr >at-stderr
   119243 mv at-stderr stderr
   119244 # 2. Create the reference error message.
   119245 cat >expout <<'_ATEOF'
   119246 1.7: syntax error, unexpected '='
   119247 _ATEOF
   119248 
   119249 # 3. If locations are not used, remove them.
   119250 
   119251 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119252 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119253 mv at-expout expout
   119254 # 5. Check
   119255 { set +x
   119256 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119257 at_fn_check_prepare_trace "calc.at:709"
   119258 ( $at_check_trace; cat stderr
   119259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119260 at_status=$? at_failed=false
   119261 $at_check_filter
   119262 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119263 $at_diff expout "$at_stdout" || at_failed=:
   119264 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119265 $at_failed && at_fn_log_failure
   119266 $at_traceon; }
   119267 
   119268 
   119269 cat >input <<'_ATEOF'
   119270 
   119271 +1
   119272 _ATEOF
   119273 
   119274 { set +x
   119275 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119276 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119277 ( $at_check_trace;  $PREPARSER ./calc input
   119278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119279 at_status=$? at_failed=false
   119280 $at_check_filter
   119281 echo stderr:; tee stderr <"$at_stderr"
   119282 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119283 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709"
   119284 $at_failed && at_fn_log_failure
   119285 $at_traceon; }
   119286 
   119287 { set +x
   119288 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119289 at_fn_check_prepare_trace "calc.at:709"
   119290 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119292 at_status=$? at_failed=false
   119293 $at_check_filter
   119294 echo stderr:; tee stderr <"$at_stderr"
   119295 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119296 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119297 $at_failed && at_fn_log_failure
   119298 $at_traceon; }
   119299 
   119300 
   119301 
   119302 # Normalize the observed and expected error messages, depending upon the
   119303 # options.
   119304 # 1. Remove the traces from observed.
   119305 sed '/^Starting/d
   119306 /^Entering/d
   119307 /^Stack/d
   119308 /^Reading/d
   119309 /^Reducing/d
   119310 /^Return/d
   119311 /^Shifting/d
   119312 /^state/d
   119313 /^Cleanup:/d
   119314 /^Error:/d
   119315 /^Next/d
   119316 /^Now/d
   119317 /^Discarding/d
   119318 / \$[0-9$]* = /d
   119319 /^yydestructor:/d' stderr >at-stderr
   119320 mv at-stderr stderr
   119321 # 2. Create the reference error message.
   119322 cat >expout <<'_ATEOF'
   119323 2.1: syntax error, unexpected '+'
   119324 _ATEOF
   119325 
   119326 # 3. If locations are not used, remove them.
   119327 
   119328 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119329 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119330 mv at-expout expout
   119331 # 5. Check
   119332 { set +x
   119333 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119334 at_fn_check_prepare_trace "calc.at:709"
   119335 ( $at_check_trace; cat stderr
   119336 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119337 at_status=$? at_failed=false
   119338 $at_check_filter
   119339 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119340 $at_diff expout "$at_stdout" || at_failed=:
   119341 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119342 $at_failed && at_fn_log_failure
   119343 $at_traceon; }
   119344 
   119345 
   119346 # Exercise error messages with EOF: work on an empty file.
   119347 { set +x
   119348 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc /dev/null"
   119349 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:709"
   119350 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   119351 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119352 at_status=$? at_failed=false
   119353 $at_check_filter
   119354 echo stderr:; tee stderr <"$at_stderr"
   119355 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119356 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709"
   119357 $at_failed && at_fn_log_failure
   119358 $at_traceon; }
   119359 
   119360 { set +x
   119361 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119362 at_fn_check_prepare_trace "calc.at:709"
   119363 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119364 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119365 at_status=$? at_failed=false
   119366 $at_check_filter
   119367 echo stderr:; tee stderr <"$at_stderr"
   119368 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119369 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119370 $at_failed && at_fn_log_failure
   119371 $at_traceon; }
   119372 
   119373 
   119374 
   119375 # Normalize the observed and expected error messages, depending upon the
   119376 # options.
   119377 # 1. Remove the traces from observed.
   119378 sed '/^Starting/d
   119379 /^Entering/d
   119380 /^Stack/d
   119381 /^Reading/d
   119382 /^Reducing/d
   119383 /^Return/d
   119384 /^Shifting/d
   119385 /^state/d
   119386 /^Cleanup:/d
   119387 /^Error:/d
   119388 /^Next/d
   119389 /^Now/d
   119390 /^Discarding/d
   119391 / \$[0-9$]* = /d
   119392 /^yydestructor:/d' stderr >at-stderr
   119393 mv at-stderr stderr
   119394 # 2. Create the reference error message.
   119395 cat >expout <<'_ATEOF'
   119396 1.1: syntax error, unexpected end of input
   119397 _ATEOF
   119398 
   119399 # 3. If locations are not used, remove them.
   119400 
   119401 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119402 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119403 mv at-expout expout
   119404 # 5. Check
   119405 { set +x
   119406 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119407 at_fn_check_prepare_trace "calc.at:709"
   119408 ( $at_check_trace; cat stderr
   119409 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119410 at_status=$? at_failed=false
   119411 $at_check_filter
   119412 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119413 $at_diff expout "$at_stdout" || at_failed=:
   119414 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119415 $at_failed && at_fn_log_failure
   119416 $at_traceon; }
   119417 
   119418 
   119419 
   119420 # Exercise the error token: without it, we die at the first error,
   119421 # hence be sure to
   119422 #
   119423 # - have several errors which exercise different shift/discardings
   119424 #   - (): nothing to pop, nothing to discard
   119425 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   119426 #   - (* * *): nothing to pop, a lot to discard
   119427 #   - (1 + 2 * *): some to pop and discard
   119428 #
   119429 # - test the action associated to `error'
   119430 #
   119431 # - check the lookahead that triggers an error is not discarded
   119432 #   when we enter error recovery.  Below, the lookahead causing the
   119433 #   first error is ")", which is needed to recover from the error and
   119434 #   produce the "0" that triggers the "0 != 1" error.
   119435 #
   119436 cat >input <<'_ATEOF'
   119437 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   119438 _ATEOF
   119439 
   119440 { set +x
   119441 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119442 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119443 ( $at_check_trace;  $PREPARSER ./calc input
   119444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119445 at_status=$? at_failed=false
   119446 $at_check_filter
   119447 echo stderr:; tee stderr <"$at_stderr"
   119448 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119449 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119450 $at_failed && at_fn_log_failure
   119451 $at_traceon; }
   119452 
   119453 { set +x
   119454 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119455 at_fn_check_prepare_trace "calc.at:709"
   119456 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119457 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119458 at_status=$? at_failed=false
   119459 $at_check_filter
   119460 echo stderr:; tee stderr <"$at_stderr"
   119461 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119462 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119463 $at_failed && at_fn_log_failure
   119464 $at_traceon; }
   119465 
   119466 
   119467 
   119468 # Normalize the observed and expected error messages, depending upon the
   119469 # options.
   119470 # 1. Remove the traces from observed.
   119471 sed '/^Starting/d
   119472 /^Entering/d
   119473 /^Stack/d
   119474 /^Reading/d
   119475 /^Reducing/d
   119476 /^Return/d
   119477 /^Shifting/d
   119478 /^state/d
   119479 /^Cleanup:/d
   119480 /^Error:/d
   119481 /^Next/d
   119482 /^Now/d
   119483 /^Discarding/d
   119484 / \$[0-9$]* = /d
   119485 /^yydestructor:/d' stderr >at-stderr
   119486 mv at-stderr stderr
   119487 # 2. Create the reference error message.
   119488 cat >expout <<'_ATEOF'
   119489 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   119490 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   119491 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   119492 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   119493 calc: error: 4444 != 1
   119494 _ATEOF
   119495 
   119496 # 3. If locations are not used, remove them.
   119497 
   119498 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119499 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119500 mv at-expout expout
   119501 # 5. Check
   119502 { set +x
   119503 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119504 at_fn_check_prepare_trace "calc.at:709"
   119505 ( $at_check_trace; cat stderr
   119506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119507 at_status=$? at_failed=false
   119508 $at_check_filter
   119509 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119510 $at_diff expout "$at_stdout" || at_failed=:
   119511 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119512 $at_failed && at_fn_log_failure
   119513 $at_traceon; }
   119514 
   119515 
   119516 
   119517 # The same, but this time exercising explicitly triggered syntax errors.
   119518 # POSIX says the lookahead causing the error should not be discarded.
   119519 cat >input <<'_ATEOF'
   119520 (!) + (1 2) = 1
   119521 _ATEOF
   119522 
   119523 { set +x
   119524 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119525 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119526 ( $at_check_trace;  $PREPARSER ./calc input
   119527 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119528 at_status=$? at_failed=false
   119529 $at_check_filter
   119530 echo stderr:; tee stderr <"$at_stderr"
   119531 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119532 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119533 $at_failed && at_fn_log_failure
   119534 $at_traceon; }
   119535 
   119536 { set +x
   119537 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119538 at_fn_check_prepare_trace "calc.at:709"
   119539 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119541 at_status=$? at_failed=false
   119542 $at_check_filter
   119543 echo stderr:; tee stderr <"$at_stderr"
   119544 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119545 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119546 $at_failed && at_fn_log_failure
   119547 $at_traceon; }
   119548 
   119549 
   119550 
   119551 # Normalize the observed and expected error messages, depending upon the
   119552 # options.
   119553 # 1. Remove the traces from observed.
   119554 sed '/^Starting/d
   119555 /^Entering/d
   119556 /^Stack/d
   119557 /^Reading/d
   119558 /^Reducing/d
   119559 /^Return/d
   119560 /^Shifting/d
   119561 /^state/d
   119562 /^Cleanup:/d
   119563 /^Error:/d
   119564 /^Next/d
   119565 /^Now/d
   119566 /^Discarding/d
   119567 / \$[0-9$]* = /d
   119568 /^yydestructor:/d' stderr >at-stderr
   119569 mv at-stderr stderr
   119570 # 2. Create the reference error message.
   119571 cat >expout <<'_ATEOF'
   119572 1.10: syntax error, unexpected number
   119573 calc: error: 2222 != 1
   119574 _ATEOF
   119575 
   119576 # 3. If locations are not used, remove them.
   119577 
   119578 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119579 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119580 mv at-expout expout
   119581 # 5. Check
   119582 { set +x
   119583 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119584 at_fn_check_prepare_trace "calc.at:709"
   119585 ( $at_check_trace; cat stderr
   119586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119587 at_status=$? at_failed=false
   119588 $at_check_filter
   119589 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119590 $at_diff expout "$at_stdout" || at_failed=:
   119591 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119592 $at_failed && at_fn_log_failure
   119593 $at_traceon; }
   119594 
   119595 
   119596 cat >input <<'_ATEOF'
   119597 (- *) + (1 2) = 1
   119598 _ATEOF
   119599 
   119600 { set +x
   119601 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119602 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119603 ( $at_check_trace;  $PREPARSER ./calc input
   119604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119605 at_status=$? at_failed=false
   119606 $at_check_filter
   119607 echo stderr:; tee stderr <"$at_stderr"
   119608 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119609 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119610 $at_failed && at_fn_log_failure
   119611 $at_traceon; }
   119612 
   119613 { set +x
   119614 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119615 at_fn_check_prepare_trace "calc.at:709"
   119616 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119618 at_status=$? at_failed=false
   119619 $at_check_filter
   119620 echo stderr:; tee stderr <"$at_stderr"
   119621 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119622 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119623 $at_failed && at_fn_log_failure
   119624 $at_traceon; }
   119625 
   119626 
   119627 
   119628 # Normalize the observed and expected error messages, depending upon the
   119629 # options.
   119630 # 1. Remove the traces from observed.
   119631 sed '/^Starting/d
   119632 /^Entering/d
   119633 /^Stack/d
   119634 /^Reading/d
   119635 /^Reducing/d
   119636 /^Return/d
   119637 /^Shifting/d
   119638 /^state/d
   119639 /^Cleanup:/d
   119640 /^Error:/d
   119641 /^Next/d
   119642 /^Now/d
   119643 /^Discarding/d
   119644 / \$[0-9$]* = /d
   119645 /^yydestructor:/d' stderr >at-stderr
   119646 mv at-stderr stderr
   119647 # 2. Create the reference error message.
   119648 cat >expout <<'_ATEOF'
   119649 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   119650 1.12: syntax error, unexpected number
   119651 calc: error: 2222 != 1
   119652 _ATEOF
   119653 
   119654 # 3. If locations are not used, remove them.
   119655 
   119656 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119657 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119658 mv at-expout expout
   119659 # 5. Check
   119660 { set +x
   119661 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119662 at_fn_check_prepare_trace "calc.at:709"
   119663 ( $at_check_trace; cat stderr
   119664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119665 at_status=$? at_failed=false
   119666 $at_check_filter
   119667 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119668 $at_diff expout "$at_stdout" || at_failed=:
   119669 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119670 $at_failed && at_fn_log_failure
   119671 $at_traceon; }
   119672 
   119673 
   119674 
   119675 # Check that yyerrok works properly: second error is not reported,
   119676 # third and fourth are.  Parse status is succesfull.
   119677 cat >input <<'_ATEOF'
   119678 (* *) + (*) + (*)
   119679 _ATEOF
   119680 
   119681 { set +x
   119682 $as_echo "$at_srcdir/calc.at:709:  \$PREPARSER ./calc input"
   119683 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709"
   119684 ( $at_check_trace;  $PREPARSER ./calc input
   119685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119686 at_status=$? at_failed=false
   119687 $at_check_filter
   119688 echo stderr:; tee stderr <"$at_stderr"
   119689 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119690 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119691 $at_failed && at_fn_log_failure
   119692 $at_traceon; }
   119693 
   119694 { set +x
   119695 $as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   119696 at_fn_check_prepare_trace "calc.at:709"
   119697 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   119698 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119699 at_status=$? at_failed=false
   119700 $at_check_filter
   119701 echo stderr:; tee stderr <"$at_stderr"
   119702 at_fn_diff_devnull "$at_stdout" || at_failed=:
   119703 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119704 $at_failed && at_fn_log_failure
   119705 $at_traceon; }
   119706 
   119707 
   119708 
   119709 # Normalize the observed and expected error messages, depending upon the
   119710 # options.
   119711 # 1. Remove the traces from observed.
   119712 sed '/^Starting/d
   119713 /^Entering/d
   119714 /^Stack/d
   119715 /^Reading/d
   119716 /^Reducing/d
   119717 /^Return/d
   119718 /^Shifting/d
   119719 /^state/d
   119720 /^Cleanup:/d
   119721 /^Error:/d
   119722 /^Next/d
   119723 /^Now/d
   119724 /^Discarding/d
   119725 / \$[0-9$]* = /d
   119726 /^yydestructor:/d' stderr >at-stderr
   119727 mv at-stderr stderr
   119728 # 2. Create the reference error message.
   119729 cat >expout <<'_ATEOF'
   119730 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   119731 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   119732 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   119733 _ATEOF
   119734 
   119735 # 3. If locations are not used, remove them.
   119736 
   119737 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   119738 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   119739 mv at-expout expout
   119740 # 5. Check
   119741 { set +x
   119742 $as_echo "$at_srcdir/calc.at:709: cat stderr"
   119743 at_fn_check_prepare_trace "calc.at:709"
   119744 ( $at_check_trace; cat stderr
   119745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   119746 at_status=$? at_failed=false
   119747 $at_check_filter
   119748 at_fn_diff_devnull "$at_stderr" || at_failed=:
   119749 $at_diff expout "$at_stdout" || at_failed=:
   119750 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709"
   119751 $at_failed && at_fn_log_failure
   119752 $at_traceon; }
   119753 
   119754 
   119755 
   119756 
   119757 
   119758   set +x
   119759   $at_times_p && times >"$at_times_file"
   119760 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   119761 read at_status <"$at_status_file"
   119762 #AT_STOP_246
   119763 #AT_START_247
   119764 at_fn_group_banner 247 'calc.at:710' \
   119765   "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 14
   119766 at_xfail=no
   119767 (
   119768   $as_echo "247. $at_setup_line: testing $at_desc ..."
   119769   $at_traceon
   119770 
   119771 
   119772 
   119773 
   119774 
   119775 
   119776 
   119777 
   119778 
   119779 
   119780 cat >calc.y <<'_ATEOF'
   119781 %code top {
   119782 #include <config.h>
   119783 /* We don't need perfect functions for these tests. */
   119784 #undef malloc
   119785 #undef memcmp
   119786 #undef realloc
   119787 }
   119788 
   119789 /* Infix notation calculator--calc */
   119790 %language "C++" %glr-parser %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc
   119791 %define global_tokens_and_yystype
   119792 %code requires
   119793 {
   119794 
   119795   /* Exercise pre-prologue dependency to %union.  */
   119796   typedef int semantic_value;
   119797 }
   119798 
   119799 /* Exercise %union. */
   119800 %union
   119801 {
   119802   semantic_value ival;
   119803 };
   119804 %printer { yyoutput << $$; } <ival>;
   119805 
   119806 %code provides
   119807 {
   119808   #include <stdio.h>
   119809   /* The input.  */
   119810   extern FILE *input;
   119811   extern semantic_value global_result;
   119812   extern int global_count;
   119813 }
   119814 
   119815 %code
   119816 {
   119817 #include <assert.h>
   119818 #include <string.h>
   119819 #define USE(Var)
   119820 
   119821 FILE *input;
   119822 static int power (int base, int exponent);
   119823 
   119824 
   119825 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   119826 }
   119827 
   119828 
   119829 
   119830 /* Bison Declarations */
   119831 %token CALC_EOF 0 "end of input"
   119832 %token <ival> NUM "number"
   119833 %type  <ival> exp
   119834 
   119835 %nonassoc '=' /* comparison            */
   119836 %left '-' '+'
   119837 %left '*' '/'
   119838 %left NEG     /* negation--unary minus */
   119839 %right '^'    /* exponentiation        */
   119840 
   119841 /* Grammar follows */
   119842 %%
   119843 input:
   119844   line
   119845 | input line         {  }
   119846 ;
   119847 
   119848 line:
   119849   '\n'
   119850 | exp '\n'           { USE ($1); }
   119851 ;
   119852 
   119853 exp:
   119854   NUM                { $$ = $1;             }
   119855 | exp '=' exp
   119856   {
   119857     if ($1 != $3)
   119858       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   119859     $$ = $1;
   119860   }
   119861 | exp '+' exp        { $$ = $1 + $3;        }
   119862 | exp '-' exp        { $$ = $1 - $3;        }
   119863 | exp '*' exp        { $$ = $1 * $3;        }
   119864 | exp '/' exp        { $$ = $1 / $3;        }
   119865 | '-' exp  %prec NEG { $$ = -$2;            }
   119866 | exp '^' exp        { $$ = power ($1, $3); }
   119867 | '(' exp ')'        { $$ = $2;             }
   119868 | '(' error ')'      { $$ = 1111; yyerrok;  }
   119869 | '!'                { $$ = 0; YYERROR;     }
   119870 | '-' error          { $$ = 0; YYERROR;     }
   119871 ;
   119872 %%
   119873 
   119874 static int
   119875 power (int base, int exponent)
   119876 {
   119877   int res = 1;
   119878   assert (0 <= exponent);
   119879   for (/* Niente */; exponent; --exponent)
   119880     res *= base;
   119881   return res;
   119882 }
   119883 
   119884 
   119885 /* A C++ error reporting function.  */
   119886 void
   119887 calc::parser::error (const location_type& l, const std::string& m)
   119888 {
   119889   (void) l;
   119890   std::cerr << l << ": " << m << std::endl;
   119891 }
   119892 _ATEOF
   119893 
   119894 
   119895 
   119896 cat >calc-lex.cc <<'_ATEOF'
   119897 #include <config.h>
   119898 /* We don't need perfect functions for these tests. */
   119899 #undef malloc
   119900 #undef memcmp
   119901 #undef realloc
   119902 
   119903 #include "calc.hh"
   119904 
   119905 #include <ctype.h>
   119906 
   119907 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   119908 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   119909 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   119910 
   119911 
   119912 static calc::parser::location_type last_yylloc;
   119913 
   119914 static int
   119915 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   119916 {
   119917   int res = getc (input);
   119918   (void) lvalp;(void) llocp;
   119919 
   119920   last_yylloc = (*llocp);
   119921   if (res == '\n')
   119922     {
   119923       (*llocp).end.line++;
   119924       (*llocp).end.column = 1;
   119925     }
   119926   else
   119927     (*llocp).end.column++;
   119928 
   119929   return res;
   119930 }
   119931 
   119932 static void
   119933 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   119934 {
   119935   (void) lvalp;(void) llocp;
   119936 
   119937   /* Wrong when C == `\n'. */
   119938   (*llocp) = last_yylloc;
   119939 
   119940   ungetc (c, input);
   119941 }
   119942 
   119943 static int
   119944 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   119945 {
   119946   int c = get_char (lvalp, llocp);
   119947   int sign = 1;
   119948   int n = 0;
   119949 
   119950   (void) lvalp;(void) llocp;
   119951   if (c == '-')
   119952     {
   119953       c = get_char (lvalp, llocp);
   119954       sign = -1;
   119955     }
   119956 
   119957   while (isdigit (c))
   119958     {
   119959       n = 10 * n + (c - '0');
   119960       c = get_char (lvalp, llocp);
   119961     }
   119962 
   119963   unget_char (lvalp, llocp,  c);
   119964 
   119965   return sign * n;
   119966 }
   119967 
   119968 
   119969 /*---------------------------------------------------------------.
   119970 | Lexical analyzer returns an integer on the stack and the token |
   119971 | NUM, or the ASCII character read if not a number.  Skips all   |
   119972 | blanks and tabs, returns 0 for EOF.                            |
   119973 `---------------------------------------------------------------*/
   119974 
   119975 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   119976 {
   119977   int c;
   119978   /* Skip current token, then white spaces.  */
   119979   do
   119980     {
   119981      (*llocp).begin.column = (*llocp).end.column;
   119982       (*llocp).begin.line   = (*llocp).end.line;
   119983 
   119984     }
   119985   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   119986 
   119987   /* process numbers   */
   119988   if (c == '.' || isdigit (c))
   119989     {
   119990       unget_char (lvalp, llocp,  c);
   119991       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   119992       return NUM;
   119993     }
   119994 
   119995   /* Return end-of-file.  */
   119996   if (c == EOF)
   119997     return CALC_EOF;
   119998 
   119999   /* Return single chars. */
   120000   return c;
   120001 }
   120002 _ATEOF
   120003 
   120004 
   120005 cat >calc-main.cc <<'_ATEOF'
   120006 #include <config.h>
   120007 /* We don't need perfect functions for these tests. */
   120008 #undef malloc
   120009 #undef memcmp
   120010 #undef realloc
   120011 
   120012 #include "calc.hh"
   120013 
   120014 #include <assert.h>
   120015 #if HAVE_UNISTD_H
   120016 # include <unistd.h>
   120017 #else
   120018 # undef alarm
   120019 # define alarm(seconds) /* empty */
   120020 #endif
   120021 
   120022 
   120023 /* A C++ calcparse that simulates the C signature.  */
   120024 int
   120025 calcparse ()
   120026 {
   120027   calc::parser parser;
   120028 #if YYDEBUG
   120029   parser.set_debug_level (1);
   120030 #endif
   120031   return parser.parse ();
   120032 }
   120033 
   120034 
   120035 semantic_value global_result = 0;
   120036 int global_count = 0;
   120037 
   120038 /* A C main function.  */
   120039 int
   120040 main (int argc, const char **argv)
   120041 {
   120042   semantic_value result = 0;
   120043   int count = 0;
   120044   int status;
   120045 
   120046   /* This used to be alarm (10), but that isn't enough time for
   120047      a July 1995 vintage DEC Alphastation 200 4/100 system,
   120048      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   120049   alarm (100);
   120050 
   120051   if (argc == 2)
   120052     input = fopen (argv[1], "r");
   120053   else
   120054     input = stdin;
   120055 
   120056   if (!input)
   120057     {
   120058       perror (argv[1]);
   120059       return 3;
   120060     }
   120061 
   120062 
   120063   status = calcparse ();
   120064   if (fclose (input))
   120065     perror ("fclose");
   120066   assert (global_result == result);
   120067   assert (global_count == count);
   120068   return status;
   120069 }
   120070 _ATEOF
   120071 
   120072 
   120073 
   120074 
   120075 
   120076 
   120077 
   120078 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   120079   at_save_special_files
   120080   mkdir xml-tests
   120081     # Don't combine these Bison invocations since we want to be sure that
   120082   # --report=all isn't required to get the full XML file.
   120083   { set +x
   120084 $as_echo "$at_srcdir/calc.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   120085                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   120086 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710"
   120087 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   120088                   --graph=xml-tests/test.dot -o calc.cc calc.y
   120089 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120090 at_status=$? at_failed=false
   120091 $at_check_filter
   120092 echo stderr:; cat "$at_stderr"
   120093 echo stdout:; cat "$at_stdout"
   120094 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120095 $at_failed && at_fn_log_failure
   120096 $at_traceon; }
   120097 
   120098   { set +x
   120099 $as_echo "$at_srcdir/calc.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   120100 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:710"
   120101 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   120102 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120103 at_status=$? at_failed=false
   120104 $at_check_filter
   120105 echo stderr:; cat "$at_stderr"
   120106 echo stdout:; cat "$at_stdout"
   120107 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120108 $at_failed && at_fn_log_failure
   120109 $at_traceon; }
   120110 
   120111     cp xml-tests/test.output expout
   120112   { set +x
   120113 $as_echo "$at_srcdir/calc.at:710: \$XSLTPROC \\
   120114              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   120115              xml-tests/test.xml"
   120116 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:710"
   120117 ( $at_check_trace; $XSLTPROC \
   120118              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   120119              xml-tests/test.xml
   120120 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120121 at_status=$? at_failed=false
   120122 $at_check_filter
   120123 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120124 $at_diff expout "$at_stdout" || at_failed=:
   120125 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120126 $at_failed && at_fn_log_failure
   120127 $at_traceon; }
   120128 
   120129   sort xml-tests/test.dot > expout
   120130   { set +x
   120131 $as_echo "$at_srcdir/calc.at:710: \$XSLTPROC \\
   120132              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   120133              xml-tests/test.xml | sort"
   120134 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:710"
   120135 ( $at_check_trace; $XSLTPROC \
   120136              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   120137              xml-tests/test.xml | sort
   120138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120139 at_status=$? at_failed=false
   120140 $at_check_filter
   120141 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120142 $at_diff expout "$at_stdout" || at_failed=:
   120143 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120144 $at_failed && at_fn_log_failure
   120145 $at_traceon; }
   120146 
   120147   rm -rf xml-tests expout
   120148   at_restore_special_files
   120149 fi
   120150 { set +x
   120151 $as_echo "$at_srcdir/calc.at:710: bison -o calc.cc calc.y"
   120152 at_fn_check_prepare_trace "calc.at:710"
   120153 ( $at_check_trace; bison -o calc.cc calc.y
   120154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120155 at_status=$? at_failed=false
   120156 $at_check_filter
   120157 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120158 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120159 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120160 $at_failed && at_fn_log_failure
   120161 $at_traceon; }
   120162 
   120163 
   120164 
   120165 { set +x
   120166 $as_echo "$at_srcdir/calc.at:710: \$BISON_CXX_WORKS"
   120167 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:710"
   120168 ( $at_check_trace; $BISON_CXX_WORKS
   120169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120170 at_status=$? at_failed=false
   120171 $at_check_filter
   120172 echo stderr:; cat "$at_stderr"
   120173 echo stdout:; cat "$at_stdout"
   120174 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120175 $at_failed && at_fn_log_failure
   120176 $at_traceon; }
   120177 
   120178 { set +x
   120179 $as_echo "$at_srcdir/calc.at:710: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   120180 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:710"
   120181 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   120182 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120183 at_status=$? at_failed=false
   120184 $at_check_filter
   120185 echo stderr:; cat "$at_stderr"
   120186 echo stdout:; cat "$at_stdout"
   120187 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120188 $at_failed && at_fn_log_failure
   120189 $at_traceon; }
   120190 
   120191 
   120192 { set +x
   120193 $as_echo "$at_srcdir/calc.at:710: \$PERL -ne '
   120194   chomp;
   120195   print \"\$.: {\$_}\\n\"
   120196     if (# No starting/ending empty lines.
   120197         (eof || \$. == 1) && /^\\s*\$/
   120198         # No trailing space.  FIXME: not ready for \"maint\".
   120199         # || /\\s\$/
   120200         )' calc.cc
   120201 "
   120202 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710"
   120203 ( $at_check_trace; $PERL -ne '
   120204   chomp;
   120205   print "$.: {$_}\n"
   120206     if (# No starting/ending empty lines.
   120207         (eof || $. == 1) && /^\s*$/
   120208         # No trailing space.  FIXME: not ready for "maint".
   120209         # || /\s$/
   120210         )' calc.cc
   120211 
   120212 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120213 at_status=$? at_failed=false
   120214 $at_check_filter
   120215 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120216 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120217 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120218 $at_failed && at_fn_log_failure
   120219 $at_traceon; }
   120220 
   120221 { set +x
   120222 $as_echo "$at_srcdir/calc.at:710: \$PERL -ne '
   120223   chomp;
   120224   print \"\$.: {\$_}\\n\"
   120225     if (# No starting/ending empty lines.
   120226         (eof || \$. == 1) && /^\\s*\$/
   120227         # No trailing space.  FIXME: not ready for \"maint\".
   120228         # || /\\s\$/
   120229         )' calc.hh
   120230 "
   120231 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710"
   120232 ( $at_check_trace; $PERL -ne '
   120233   chomp;
   120234   print "$.: {$_}\n"
   120235     if (# No starting/ending empty lines.
   120236         (eof || $. == 1) && /^\s*$/
   120237         # No trailing space.  FIXME: not ready for "maint".
   120238         # || /\s$/
   120239         )' calc.hh
   120240 
   120241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120242 at_status=$? at_failed=false
   120243 $at_check_filter
   120244 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120245 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120246 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120247 $at_failed && at_fn_log_failure
   120248 $at_traceon; }
   120249 
   120250 
   120251 # Test the priorities.
   120252 cat >input <<'_ATEOF'
   120253 1 + 2 * 3 = 7
   120254 1 + 2 * -3 = -5
   120255 
   120256 -1^2 = -1
   120257 (-1)^2 = 1
   120258 
   120259 ---1 = -1
   120260 
   120261 1 - 2 - 3 = -4
   120262 1 - (2 - 3) = 2
   120263 
   120264 2^2^3 = 256
   120265 (2^2)^3 = 64
   120266 _ATEOF
   120267 
   120268 { set +x
   120269 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120270 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120271 ( $at_check_trace;  $PREPARSER ./calc input
   120272 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120273 at_status=$? at_failed=false
   120274 $at_check_filter
   120275 echo stderr:; tee stderr <"$at_stderr"
   120276 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120277 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120278 $at_failed && at_fn_log_failure
   120279 $at_traceon; }
   120280 
   120281 { set +x
   120282 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120283 at_fn_check_prepare_trace "calc.at:710"
   120284 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120286 at_status=$? at_failed=false
   120287 $at_check_filter
   120288 echo stderr:; tee stderr <"$at_stderr"
   120289 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120290 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120291 $at_failed && at_fn_log_failure
   120292 $at_traceon; }
   120293 
   120294 
   120295 
   120296 
   120297 # Some syntax errors.
   120298 cat >input <<'_ATEOF'
   120299 1 2
   120300 _ATEOF
   120301 
   120302 { set +x
   120303 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120304 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120305 ( $at_check_trace;  $PREPARSER ./calc input
   120306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120307 at_status=$? at_failed=false
   120308 $at_check_filter
   120309 echo stderr:; tee stderr <"$at_stderr"
   120310 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120311 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710"
   120312 $at_failed && at_fn_log_failure
   120313 $at_traceon; }
   120314 
   120315 { set +x
   120316 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120317 at_fn_check_prepare_trace "calc.at:710"
   120318 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120320 at_status=$? at_failed=false
   120321 $at_check_filter
   120322 echo stderr:; tee stderr <"$at_stderr"
   120323 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120324 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120325 $at_failed && at_fn_log_failure
   120326 $at_traceon; }
   120327 
   120328 
   120329 
   120330 # Normalize the observed and expected error messages, depending upon the
   120331 # options.
   120332 # 1. Remove the traces from observed.
   120333 sed '/^Starting/d
   120334 /^Entering/d
   120335 /^Stack/d
   120336 /^Reading/d
   120337 /^Reducing/d
   120338 /^Return/d
   120339 /^Shifting/d
   120340 /^state/d
   120341 /^Cleanup:/d
   120342 /^Error:/d
   120343 /^Next/d
   120344 /^Now/d
   120345 /^Discarding/d
   120346 / \$[0-9$]* = /d
   120347 /^yydestructor:/d' stderr >at-stderr
   120348 mv at-stderr stderr
   120349 # 2. Create the reference error message.
   120350 cat >expout <<'_ATEOF'
   120351 1.3: syntax error, unexpected number
   120352 _ATEOF
   120353 
   120354 # 3. If locations are not used, remove them.
   120355 
   120356 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120357 
   120358 # 5. Check
   120359 { set +x
   120360 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120361 at_fn_check_prepare_trace "calc.at:710"
   120362 ( $at_check_trace; cat stderr
   120363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120364 at_status=$? at_failed=false
   120365 $at_check_filter
   120366 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120367 $at_diff expout "$at_stdout" || at_failed=:
   120368 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120369 $at_failed && at_fn_log_failure
   120370 $at_traceon; }
   120371 
   120372 
   120373 cat >input <<'_ATEOF'
   120374 1//2
   120375 _ATEOF
   120376 
   120377 { set +x
   120378 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120379 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120380 ( $at_check_trace;  $PREPARSER ./calc input
   120381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120382 at_status=$? at_failed=false
   120383 $at_check_filter
   120384 echo stderr:; tee stderr <"$at_stderr"
   120385 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120386 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710"
   120387 $at_failed && at_fn_log_failure
   120388 $at_traceon; }
   120389 
   120390 { set +x
   120391 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120392 at_fn_check_prepare_trace "calc.at:710"
   120393 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120395 at_status=$? at_failed=false
   120396 $at_check_filter
   120397 echo stderr:; tee stderr <"$at_stderr"
   120398 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120399 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120400 $at_failed && at_fn_log_failure
   120401 $at_traceon; }
   120402 
   120403 
   120404 
   120405 # Normalize the observed and expected error messages, depending upon the
   120406 # options.
   120407 # 1. Remove the traces from observed.
   120408 sed '/^Starting/d
   120409 /^Entering/d
   120410 /^Stack/d
   120411 /^Reading/d
   120412 /^Reducing/d
   120413 /^Return/d
   120414 /^Shifting/d
   120415 /^state/d
   120416 /^Cleanup:/d
   120417 /^Error:/d
   120418 /^Next/d
   120419 /^Now/d
   120420 /^Discarding/d
   120421 / \$[0-9$]* = /d
   120422 /^yydestructor:/d' stderr >at-stderr
   120423 mv at-stderr stderr
   120424 # 2. Create the reference error message.
   120425 cat >expout <<'_ATEOF'
   120426 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   120427 _ATEOF
   120428 
   120429 # 3. If locations are not used, remove them.
   120430 
   120431 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120432 
   120433 # 5. Check
   120434 { set +x
   120435 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120436 at_fn_check_prepare_trace "calc.at:710"
   120437 ( $at_check_trace; cat stderr
   120438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120439 at_status=$? at_failed=false
   120440 $at_check_filter
   120441 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120442 $at_diff expout "$at_stdout" || at_failed=:
   120443 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120444 $at_failed && at_fn_log_failure
   120445 $at_traceon; }
   120446 
   120447 
   120448 cat >input <<'_ATEOF'
   120449 error
   120450 _ATEOF
   120451 
   120452 { set +x
   120453 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120454 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120455 ( $at_check_trace;  $PREPARSER ./calc input
   120456 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120457 at_status=$? at_failed=false
   120458 $at_check_filter
   120459 echo stderr:; tee stderr <"$at_stderr"
   120460 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120461 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710"
   120462 $at_failed && at_fn_log_failure
   120463 $at_traceon; }
   120464 
   120465 { set +x
   120466 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120467 at_fn_check_prepare_trace "calc.at:710"
   120468 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120469 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120470 at_status=$? at_failed=false
   120471 $at_check_filter
   120472 echo stderr:; tee stderr <"$at_stderr"
   120473 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120474 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120475 $at_failed && at_fn_log_failure
   120476 $at_traceon; }
   120477 
   120478 
   120479 
   120480 # Normalize the observed and expected error messages, depending upon the
   120481 # options.
   120482 # 1. Remove the traces from observed.
   120483 sed '/^Starting/d
   120484 /^Entering/d
   120485 /^Stack/d
   120486 /^Reading/d
   120487 /^Reducing/d
   120488 /^Return/d
   120489 /^Shifting/d
   120490 /^state/d
   120491 /^Cleanup:/d
   120492 /^Error:/d
   120493 /^Next/d
   120494 /^Now/d
   120495 /^Discarding/d
   120496 / \$[0-9$]* = /d
   120497 /^yydestructor:/d' stderr >at-stderr
   120498 mv at-stderr stderr
   120499 # 2. Create the reference error message.
   120500 cat >expout <<'_ATEOF'
   120501 1.1: syntax error, unexpected $undefined
   120502 _ATEOF
   120503 
   120504 # 3. If locations are not used, remove them.
   120505 
   120506 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120507 
   120508 # 5. Check
   120509 { set +x
   120510 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120511 at_fn_check_prepare_trace "calc.at:710"
   120512 ( $at_check_trace; cat stderr
   120513 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120514 at_status=$? at_failed=false
   120515 $at_check_filter
   120516 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120517 $at_diff expout "$at_stdout" || at_failed=:
   120518 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120519 $at_failed && at_fn_log_failure
   120520 $at_traceon; }
   120521 
   120522 
   120523 cat >input <<'_ATEOF'
   120524 1 = 2 = 3
   120525 _ATEOF
   120526 
   120527 { set +x
   120528 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120529 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120530 ( $at_check_trace;  $PREPARSER ./calc input
   120531 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120532 at_status=$? at_failed=false
   120533 $at_check_filter
   120534 echo stderr:; tee stderr <"$at_stderr"
   120535 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120536 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710"
   120537 $at_failed && at_fn_log_failure
   120538 $at_traceon; }
   120539 
   120540 { set +x
   120541 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120542 at_fn_check_prepare_trace "calc.at:710"
   120543 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120544 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120545 at_status=$? at_failed=false
   120546 $at_check_filter
   120547 echo stderr:; tee stderr <"$at_stderr"
   120548 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120549 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120550 $at_failed && at_fn_log_failure
   120551 $at_traceon; }
   120552 
   120553 
   120554 
   120555 # Normalize the observed and expected error messages, depending upon the
   120556 # options.
   120557 # 1. Remove the traces from observed.
   120558 sed '/^Starting/d
   120559 /^Entering/d
   120560 /^Stack/d
   120561 /^Reading/d
   120562 /^Reducing/d
   120563 /^Return/d
   120564 /^Shifting/d
   120565 /^state/d
   120566 /^Cleanup:/d
   120567 /^Error:/d
   120568 /^Next/d
   120569 /^Now/d
   120570 /^Discarding/d
   120571 / \$[0-9$]* = /d
   120572 /^yydestructor:/d' stderr >at-stderr
   120573 mv at-stderr stderr
   120574 # 2. Create the reference error message.
   120575 cat >expout <<'_ATEOF'
   120576 1.7: syntax error, unexpected '='
   120577 _ATEOF
   120578 
   120579 # 3. If locations are not used, remove them.
   120580 
   120581 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120582 
   120583 # 5. Check
   120584 { set +x
   120585 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120586 at_fn_check_prepare_trace "calc.at:710"
   120587 ( $at_check_trace; cat stderr
   120588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120589 at_status=$? at_failed=false
   120590 $at_check_filter
   120591 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120592 $at_diff expout "$at_stdout" || at_failed=:
   120593 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120594 $at_failed && at_fn_log_failure
   120595 $at_traceon; }
   120596 
   120597 
   120598 cat >input <<'_ATEOF'
   120599 
   120600 +1
   120601 _ATEOF
   120602 
   120603 { set +x
   120604 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120605 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120606 ( $at_check_trace;  $PREPARSER ./calc input
   120607 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120608 at_status=$? at_failed=false
   120609 $at_check_filter
   120610 echo stderr:; tee stderr <"$at_stderr"
   120611 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120612 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710"
   120613 $at_failed && at_fn_log_failure
   120614 $at_traceon; }
   120615 
   120616 { set +x
   120617 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120618 at_fn_check_prepare_trace "calc.at:710"
   120619 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120621 at_status=$? at_failed=false
   120622 $at_check_filter
   120623 echo stderr:; tee stderr <"$at_stderr"
   120624 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120625 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120626 $at_failed && at_fn_log_failure
   120627 $at_traceon; }
   120628 
   120629 
   120630 
   120631 # Normalize the observed and expected error messages, depending upon the
   120632 # options.
   120633 # 1. Remove the traces from observed.
   120634 sed '/^Starting/d
   120635 /^Entering/d
   120636 /^Stack/d
   120637 /^Reading/d
   120638 /^Reducing/d
   120639 /^Return/d
   120640 /^Shifting/d
   120641 /^state/d
   120642 /^Cleanup:/d
   120643 /^Error:/d
   120644 /^Next/d
   120645 /^Now/d
   120646 /^Discarding/d
   120647 / \$[0-9$]* = /d
   120648 /^yydestructor:/d' stderr >at-stderr
   120649 mv at-stderr stderr
   120650 # 2. Create the reference error message.
   120651 cat >expout <<'_ATEOF'
   120652 2.1: syntax error, unexpected '+'
   120653 _ATEOF
   120654 
   120655 # 3. If locations are not used, remove them.
   120656 
   120657 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120658 
   120659 # 5. Check
   120660 { set +x
   120661 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120662 at_fn_check_prepare_trace "calc.at:710"
   120663 ( $at_check_trace; cat stderr
   120664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120665 at_status=$? at_failed=false
   120666 $at_check_filter
   120667 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120668 $at_diff expout "$at_stdout" || at_failed=:
   120669 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120670 $at_failed && at_fn_log_failure
   120671 $at_traceon; }
   120672 
   120673 
   120674 # Exercise error messages with EOF: work on an empty file.
   120675 { set +x
   120676 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc /dev/null"
   120677 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:710"
   120678 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   120679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120680 at_status=$? at_failed=false
   120681 $at_check_filter
   120682 echo stderr:; tee stderr <"$at_stderr"
   120683 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120684 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710"
   120685 $at_failed && at_fn_log_failure
   120686 $at_traceon; }
   120687 
   120688 { set +x
   120689 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120690 at_fn_check_prepare_trace "calc.at:710"
   120691 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120693 at_status=$? at_failed=false
   120694 $at_check_filter
   120695 echo stderr:; tee stderr <"$at_stderr"
   120696 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120697 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120698 $at_failed && at_fn_log_failure
   120699 $at_traceon; }
   120700 
   120701 
   120702 
   120703 # Normalize the observed and expected error messages, depending upon the
   120704 # options.
   120705 # 1. Remove the traces from observed.
   120706 sed '/^Starting/d
   120707 /^Entering/d
   120708 /^Stack/d
   120709 /^Reading/d
   120710 /^Reducing/d
   120711 /^Return/d
   120712 /^Shifting/d
   120713 /^state/d
   120714 /^Cleanup:/d
   120715 /^Error:/d
   120716 /^Next/d
   120717 /^Now/d
   120718 /^Discarding/d
   120719 / \$[0-9$]* = /d
   120720 /^yydestructor:/d' stderr >at-stderr
   120721 mv at-stderr stderr
   120722 # 2. Create the reference error message.
   120723 cat >expout <<'_ATEOF'
   120724 1.1: syntax error, unexpected end of input
   120725 _ATEOF
   120726 
   120727 # 3. If locations are not used, remove them.
   120728 
   120729 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120730 
   120731 # 5. Check
   120732 { set +x
   120733 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120734 at_fn_check_prepare_trace "calc.at:710"
   120735 ( $at_check_trace; cat stderr
   120736 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120737 at_status=$? at_failed=false
   120738 $at_check_filter
   120739 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120740 $at_diff expout "$at_stdout" || at_failed=:
   120741 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120742 $at_failed && at_fn_log_failure
   120743 $at_traceon; }
   120744 
   120745 
   120746 
   120747 # Exercise the error token: without it, we die at the first error,
   120748 # hence be sure to
   120749 #
   120750 # - have several errors which exercise different shift/discardings
   120751 #   - (): nothing to pop, nothing to discard
   120752 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   120753 #   - (* * *): nothing to pop, a lot to discard
   120754 #   - (1 + 2 * *): some to pop and discard
   120755 #
   120756 # - test the action associated to `error'
   120757 #
   120758 # - check the lookahead that triggers an error is not discarded
   120759 #   when we enter error recovery.  Below, the lookahead causing the
   120760 #   first error is ")", which is needed to recover from the error and
   120761 #   produce the "0" that triggers the "0 != 1" error.
   120762 #
   120763 cat >input <<'_ATEOF'
   120764 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   120765 _ATEOF
   120766 
   120767 { set +x
   120768 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120769 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120770 ( $at_check_trace;  $PREPARSER ./calc input
   120771 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120772 at_status=$? at_failed=false
   120773 $at_check_filter
   120774 echo stderr:; tee stderr <"$at_stderr"
   120775 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120776 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120777 $at_failed && at_fn_log_failure
   120778 $at_traceon; }
   120779 
   120780 { set +x
   120781 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120782 at_fn_check_prepare_trace "calc.at:710"
   120783 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120785 at_status=$? at_failed=false
   120786 $at_check_filter
   120787 echo stderr:; tee stderr <"$at_stderr"
   120788 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120789 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120790 $at_failed && at_fn_log_failure
   120791 $at_traceon; }
   120792 
   120793 
   120794 
   120795 # Normalize the observed and expected error messages, depending upon the
   120796 # options.
   120797 # 1. Remove the traces from observed.
   120798 sed '/^Starting/d
   120799 /^Entering/d
   120800 /^Stack/d
   120801 /^Reading/d
   120802 /^Reducing/d
   120803 /^Return/d
   120804 /^Shifting/d
   120805 /^state/d
   120806 /^Cleanup:/d
   120807 /^Error:/d
   120808 /^Next/d
   120809 /^Now/d
   120810 /^Discarding/d
   120811 / \$[0-9$]* = /d
   120812 /^yydestructor:/d' stderr >at-stderr
   120813 mv at-stderr stderr
   120814 # 2. Create the reference error message.
   120815 cat >expout <<'_ATEOF'
   120816 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   120817 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   120818 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   120819 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   120820 calc: error: 4444 != 1
   120821 _ATEOF
   120822 
   120823 # 3. If locations are not used, remove them.
   120824 
   120825 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120826 
   120827 # 5. Check
   120828 { set +x
   120829 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120830 at_fn_check_prepare_trace "calc.at:710"
   120831 ( $at_check_trace; cat stderr
   120832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120833 at_status=$? at_failed=false
   120834 $at_check_filter
   120835 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120836 $at_diff expout "$at_stdout" || at_failed=:
   120837 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120838 $at_failed && at_fn_log_failure
   120839 $at_traceon; }
   120840 
   120841 
   120842 
   120843 # The same, but this time exercising explicitly triggered syntax errors.
   120844 # POSIX says the lookahead causing the error should not be discarded.
   120845 cat >input <<'_ATEOF'
   120846 (!) + (1 2) = 1
   120847 _ATEOF
   120848 
   120849 { set +x
   120850 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120851 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120852 ( $at_check_trace;  $PREPARSER ./calc input
   120853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120854 at_status=$? at_failed=false
   120855 $at_check_filter
   120856 echo stderr:; tee stderr <"$at_stderr"
   120857 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120858 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120859 $at_failed && at_fn_log_failure
   120860 $at_traceon; }
   120861 
   120862 { set +x
   120863 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120864 at_fn_check_prepare_trace "calc.at:710"
   120865 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120866 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120867 at_status=$? at_failed=false
   120868 $at_check_filter
   120869 echo stderr:; tee stderr <"$at_stderr"
   120870 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120871 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120872 $at_failed && at_fn_log_failure
   120873 $at_traceon; }
   120874 
   120875 
   120876 
   120877 # Normalize the observed and expected error messages, depending upon the
   120878 # options.
   120879 # 1. Remove the traces from observed.
   120880 sed '/^Starting/d
   120881 /^Entering/d
   120882 /^Stack/d
   120883 /^Reading/d
   120884 /^Reducing/d
   120885 /^Return/d
   120886 /^Shifting/d
   120887 /^state/d
   120888 /^Cleanup:/d
   120889 /^Error:/d
   120890 /^Next/d
   120891 /^Now/d
   120892 /^Discarding/d
   120893 / \$[0-9$]* = /d
   120894 /^yydestructor:/d' stderr >at-stderr
   120895 mv at-stderr stderr
   120896 # 2. Create the reference error message.
   120897 cat >expout <<'_ATEOF'
   120898 1.10: syntax error, unexpected number
   120899 calc: error: 2222 != 1
   120900 _ATEOF
   120901 
   120902 # 3. If locations are not used, remove them.
   120903 
   120904 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120905 
   120906 # 5. Check
   120907 { set +x
   120908 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120909 at_fn_check_prepare_trace "calc.at:710"
   120910 ( $at_check_trace; cat stderr
   120911 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120912 at_status=$? at_failed=false
   120913 $at_check_filter
   120914 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120915 $at_diff expout "$at_stdout" || at_failed=:
   120916 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120917 $at_failed && at_fn_log_failure
   120918 $at_traceon; }
   120919 
   120920 
   120921 cat >input <<'_ATEOF'
   120922 (- *) + (1 2) = 1
   120923 _ATEOF
   120924 
   120925 { set +x
   120926 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   120927 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   120928 ( $at_check_trace;  $PREPARSER ./calc input
   120929 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120930 at_status=$? at_failed=false
   120931 $at_check_filter
   120932 echo stderr:; tee stderr <"$at_stderr"
   120933 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120934 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120935 $at_failed && at_fn_log_failure
   120936 $at_traceon; }
   120937 
   120938 { set +x
   120939 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   120940 at_fn_check_prepare_trace "calc.at:710"
   120941 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   120942 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120943 at_status=$? at_failed=false
   120944 $at_check_filter
   120945 echo stderr:; tee stderr <"$at_stderr"
   120946 at_fn_diff_devnull "$at_stdout" || at_failed=:
   120947 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120948 $at_failed && at_fn_log_failure
   120949 $at_traceon; }
   120950 
   120951 
   120952 
   120953 # Normalize the observed and expected error messages, depending upon the
   120954 # options.
   120955 # 1. Remove the traces from observed.
   120956 sed '/^Starting/d
   120957 /^Entering/d
   120958 /^Stack/d
   120959 /^Reading/d
   120960 /^Reducing/d
   120961 /^Return/d
   120962 /^Shifting/d
   120963 /^state/d
   120964 /^Cleanup:/d
   120965 /^Error:/d
   120966 /^Next/d
   120967 /^Now/d
   120968 /^Discarding/d
   120969 / \$[0-9$]* = /d
   120970 /^yydestructor:/d' stderr >at-stderr
   120971 mv at-stderr stderr
   120972 # 2. Create the reference error message.
   120973 cat >expout <<'_ATEOF'
   120974 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   120975 1.12: syntax error, unexpected number
   120976 calc: error: 2222 != 1
   120977 _ATEOF
   120978 
   120979 # 3. If locations are not used, remove them.
   120980 
   120981 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   120982 
   120983 # 5. Check
   120984 { set +x
   120985 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   120986 at_fn_check_prepare_trace "calc.at:710"
   120987 ( $at_check_trace; cat stderr
   120988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   120989 at_status=$? at_failed=false
   120990 $at_check_filter
   120991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   120992 $at_diff expout "$at_stdout" || at_failed=:
   120993 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   120994 $at_failed && at_fn_log_failure
   120995 $at_traceon; }
   120996 
   120997 
   120998 
   120999 # Check that yyerrok works properly: second error is not reported,
   121000 # third and fourth are.  Parse status is succesfull.
   121001 cat >input <<'_ATEOF'
   121002 (* *) + (*) + (*)
   121003 _ATEOF
   121004 
   121005 { set +x
   121006 $as_echo "$at_srcdir/calc.at:710:  \$PREPARSER ./calc input"
   121007 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710"
   121008 ( $at_check_trace;  $PREPARSER ./calc input
   121009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121010 at_status=$? at_failed=false
   121011 $at_check_filter
   121012 echo stderr:; tee stderr <"$at_stderr"
   121013 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121014 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   121015 $at_failed && at_fn_log_failure
   121016 $at_traceon; }
   121017 
   121018 { set +x
   121019 $as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121020 at_fn_check_prepare_trace "calc.at:710"
   121021 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121023 at_status=$? at_failed=false
   121024 $at_check_filter
   121025 echo stderr:; tee stderr <"$at_stderr"
   121026 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121027 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   121028 $at_failed && at_fn_log_failure
   121029 $at_traceon; }
   121030 
   121031 
   121032 
   121033 # Normalize the observed and expected error messages, depending upon the
   121034 # options.
   121035 # 1. Remove the traces from observed.
   121036 sed '/^Starting/d
   121037 /^Entering/d
   121038 /^Stack/d
   121039 /^Reading/d
   121040 /^Reducing/d
   121041 /^Return/d
   121042 /^Shifting/d
   121043 /^state/d
   121044 /^Cleanup:/d
   121045 /^Error:/d
   121046 /^Next/d
   121047 /^Now/d
   121048 /^Discarding/d
   121049 / \$[0-9$]* = /d
   121050 /^yydestructor:/d' stderr >at-stderr
   121051 mv at-stderr stderr
   121052 # 2. Create the reference error message.
   121053 cat >expout <<'_ATEOF'
   121054 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   121055 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   121056 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   121057 _ATEOF
   121058 
   121059 # 3. If locations are not used, remove them.
   121060 
   121061 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   121062 
   121063 # 5. Check
   121064 { set +x
   121065 $as_echo "$at_srcdir/calc.at:710: cat stderr"
   121066 at_fn_check_prepare_trace "calc.at:710"
   121067 ( $at_check_trace; cat stderr
   121068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121069 at_status=$? at_failed=false
   121070 $at_check_filter
   121071 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121072 $at_diff expout "$at_stdout" || at_failed=:
   121073 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710"
   121074 $at_failed && at_fn_log_failure
   121075 $at_traceon; }
   121076 
   121077 
   121078 
   121079 
   121080 
   121081   set +x
   121082   $at_times_p && times >"$at_times_file"
   121083 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   121084 read at_status <"$at_status_file"
   121085 #AT_STOP_247
   121086 #AT_START_248
   121087 at_fn_group_banner 248 'calc.at:711' \
   121088   "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 14
   121089 at_xfail=no
   121090 (
   121091   $as_echo "248. $at_setup_line: testing $at_desc ..."
   121092   $at_traceon
   121093 
   121094 
   121095 
   121096 
   121097 
   121098 
   121099 
   121100 
   121101 
   121102 
   121103 cat >calc.y <<'_ATEOF'
   121104 %code top {
   121105 #include <config.h>
   121106 /* We don't need perfect functions for these tests. */
   121107 #undef malloc
   121108 #undef memcmp
   121109 #undef realloc
   121110 }
   121111 
   121112 /* Infix notation calculator--calc */
   121113 %language "C++" %glr-parser %defines %locations %error-verbose %define api.prefix "calc" %verbose %yacc
   121114 %define global_tokens_and_yystype
   121115 %code requires
   121116 {
   121117 
   121118   /* Exercise pre-prologue dependency to %union.  */
   121119   typedef int semantic_value;
   121120 }
   121121 
   121122 /* Exercise %union. */
   121123 %union
   121124 {
   121125   semantic_value ival;
   121126 };
   121127 %printer { yyoutput << $$; } <ival>;
   121128 
   121129 %code provides
   121130 {
   121131   #include <stdio.h>
   121132   /* The input.  */
   121133   extern FILE *input;
   121134   extern semantic_value global_result;
   121135   extern int global_count;
   121136 }
   121137 
   121138 %code
   121139 {
   121140 #include <assert.h>
   121141 #include <string.h>
   121142 #define USE(Var)
   121143 
   121144 FILE *input;
   121145 static int power (int base, int exponent);
   121146 
   121147 
   121148 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   121149 }
   121150 
   121151 
   121152 
   121153 /* Bison Declarations */
   121154 %token CALC_EOF 0 "end of input"
   121155 %token <ival> NUM "number"
   121156 %type  <ival> exp
   121157 
   121158 %nonassoc '=' /* comparison            */
   121159 %left '-' '+'
   121160 %left '*' '/'
   121161 %left NEG     /* negation--unary minus */
   121162 %right '^'    /* exponentiation        */
   121163 
   121164 /* Grammar follows */
   121165 %%
   121166 input:
   121167   line
   121168 | input line         {  }
   121169 ;
   121170 
   121171 line:
   121172   '\n'
   121173 | exp '\n'           { USE ($1); }
   121174 ;
   121175 
   121176 exp:
   121177   NUM                { $$ = $1;             }
   121178 | exp '=' exp
   121179   {
   121180     if ($1 != $3)
   121181       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   121182     $$ = $1;
   121183   }
   121184 | exp '+' exp        { $$ = $1 + $3;        }
   121185 | exp '-' exp        { $$ = $1 - $3;        }
   121186 | exp '*' exp        { $$ = $1 * $3;        }
   121187 | exp '/' exp        { $$ = $1 / $3;        }
   121188 | '-' exp  %prec NEG { $$ = -$2;            }
   121189 | exp '^' exp        { $$ = power ($1, $3); }
   121190 | '(' exp ')'        { $$ = $2;             }
   121191 | '(' error ')'      { $$ = 1111; yyerrok;  }
   121192 | '!'                { $$ = 0; YYERROR;     }
   121193 | '-' error          { $$ = 0; YYERROR;     }
   121194 ;
   121195 %%
   121196 
   121197 static int
   121198 power (int base, int exponent)
   121199 {
   121200   int res = 1;
   121201   assert (0 <= exponent);
   121202   for (/* Niente */; exponent; --exponent)
   121203     res *= base;
   121204   return res;
   121205 }
   121206 
   121207 
   121208 /* A C++ error reporting function.  */
   121209 void
   121210 calc::parser::error (const location_type& l, const std::string& m)
   121211 {
   121212   (void) l;
   121213   std::cerr << l << ": " << m << std::endl;
   121214 }
   121215 _ATEOF
   121216 
   121217 
   121218 
   121219 cat >calc-lex.cc <<'_ATEOF'
   121220 #include <config.h>
   121221 /* We don't need perfect functions for these tests. */
   121222 #undef malloc
   121223 #undef memcmp
   121224 #undef realloc
   121225 
   121226 #include "calc.hh"
   121227 
   121228 #include <ctype.h>
   121229 
   121230 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   121231 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   121232 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   121233 
   121234 
   121235 static calc::parser::location_type last_yylloc;
   121236 
   121237 static int
   121238 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   121239 {
   121240   int res = getc (input);
   121241   (void) lvalp;(void) llocp;
   121242 
   121243   last_yylloc = (*llocp);
   121244   if (res == '\n')
   121245     {
   121246       (*llocp).end.line++;
   121247       (*llocp).end.column = 1;
   121248     }
   121249   else
   121250     (*llocp).end.column++;
   121251 
   121252   return res;
   121253 }
   121254 
   121255 static void
   121256 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   121257 {
   121258   (void) lvalp;(void) llocp;
   121259 
   121260   /* Wrong when C == `\n'. */
   121261   (*llocp) = last_yylloc;
   121262 
   121263   ungetc (c, input);
   121264 }
   121265 
   121266 static int
   121267 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   121268 {
   121269   int c = get_char (lvalp, llocp);
   121270   int sign = 1;
   121271   int n = 0;
   121272 
   121273   (void) lvalp;(void) llocp;
   121274   if (c == '-')
   121275     {
   121276       c = get_char (lvalp, llocp);
   121277       sign = -1;
   121278     }
   121279 
   121280   while (isdigit (c))
   121281     {
   121282       n = 10 * n + (c - '0');
   121283       c = get_char (lvalp, llocp);
   121284     }
   121285 
   121286   unget_char (lvalp, llocp,  c);
   121287 
   121288   return sign * n;
   121289 }
   121290 
   121291 
   121292 /*---------------------------------------------------------------.
   121293 | Lexical analyzer returns an integer on the stack and the token |
   121294 | NUM, or the ASCII character read if not a number.  Skips all   |
   121295 | blanks and tabs, returns 0 for EOF.                            |
   121296 `---------------------------------------------------------------*/
   121297 
   121298 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   121299 {
   121300   int c;
   121301   /* Skip current token, then white spaces.  */
   121302   do
   121303     {
   121304      (*llocp).begin.column = (*llocp).end.column;
   121305       (*llocp).begin.line   = (*llocp).end.line;
   121306 
   121307     }
   121308   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   121309 
   121310   /* process numbers   */
   121311   if (c == '.' || isdigit (c))
   121312     {
   121313       unget_char (lvalp, llocp,  c);
   121314       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   121315       return NUM;
   121316     }
   121317 
   121318   /* Return end-of-file.  */
   121319   if (c == EOF)
   121320     return CALC_EOF;
   121321 
   121322   /* Return single chars. */
   121323   return c;
   121324 }
   121325 _ATEOF
   121326 
   121327 
   121328 cat >calc-main.cc <<'_ATEOF'
   121329 #include <config.h>
   121330 /* We don't need perfect functions for these tests. */
   121331 #undef malloc
   121332 #undef memcmp
   121333 #undef realloc
   121334 
   121335 #include "calc.hh"
   121336 
   121337 #include <assert.h>
   121338 #if HAVE_UNISTD_H
   121339 # include <unistd.h>
   121340 #else
   121341 # undef alarm
   121342 # define alarm(seconds) /* empty */
   121343 #endif
   121344 
   121345 
   121346 /* A C++ calcparse that simulates the C signature.  */
   121347 int
   121348 calcparse ()
   121349 {
   121350   calc::parser parser;
   121351 #if CALCDEBUG
   121352   parser.set_debug_level (1);
   121353 #endif
   121354   return parser.parse ();
   121355 }
   121356 
   121357 
   121358 semantic_value global_result = 0;
   121359 int global_count = 0;
   121360 
   121361 /* A C main function.  */
   121362 int
   121363 main (int argc, const char **argv)
   121364 {
   121365   semantic_value result = 0;
   121366   int count = 0;
   121367   int status;
   121368 
   121369   /* This used to be alarm (10), but that isn't enough time for
   121370      a July 1995 vintage DEC Alphastation 200 4/100 system,
   121371      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   121372   alarm (100);
   121373 
   121374   if (argc == 2)
   121375     input = fopen (argv[1], "r");
   121376   else
   121377     input = stdin;
   121378 
   121379   if (!input)
   121380     {
   121381       perror (argv[1]);
   121382       return 3;
   121383     }
   121384 
   121385 
   121386   status = calcparse ();
   121387   if (fclose (input))
   121388     perror ("fclose");
   121389   assert (global_result == result);
   121390   assert (global_count == count);
   121391   return status;
   121392 }
   121393 _ATEOF
   121394 
   121395 
   121396 
   121397 
   121398 
   121399 
   121400 
   121401 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   121402   at_save_special_files
   121403   mkdir xml-tests
   121404     # Don't combine these Bison invocations since we want to be sure that
   121405   # --report=all isn't required to get the full XML file.
   121406   { set +x
   121407 $as_echo "$at_srcdir/calc.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   121408                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   121409 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711"
   121410 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   121411                   --graph=xml-tests/test.dot -o calc.cc calc.y
   121412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121413 at_status=$? at_failed=false
   121414 $at_check_filter
   121415 echo stderr:; cat "$at_stderr"
   121416 echo stdout:; cat "$at_stdout"
   121417 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121418 $at_failed && at_fn_log_failure
   121419 $at_traceon; }
   121420 
   121421   { set +x
   121422 $as_echo "$at_srcdir/calc.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   121423 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:711"
   121424 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   121425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121426 at_status=$? at_failed=false
   121427 $at_check_filter
   121428 echo stderr:; cat "$at_stderr"
   121429 echo stdout:; cat "$at_stdout"
   121430 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121431 $at_failed && at_fn_log_failure
   121432 $at_traceon; }
   121433 
   121434     cp xml-tests/test.output expout
   121435   { set +x
   121436 $as_echo "$at_srcdir/calc.at:711: \$XSLTPROC \\
   121437              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   121438              xml-tests/test.xml"
   121439 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:711"
   121440 ( $at_check_trace; $XSLTPROC \
   121441              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   121442              xml-tests/test.xml
   121443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121444 at_status=$? at_failed=false
   121445 $at_check_filter
   121446 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121447 $at_diff expout "$at_stdout" || at_failed=:
   121448 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121449 $at_failed && at_fn_log_failure
   121450 $at_traceon; }
   121451 
   121452   sort xml-tests/test.dot > expout
   121453   { set +x
   121454 $as_echo "$at_srcdir/calc.at:711: \$XSLTPROC \\
   121455              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   121456              xml-tests/test.xml | sort"
   121457 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:711"
   121458 ( $at_check_trace; $XSLTPROC \
   121459              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   121460              xml-tests/test.xml | sort
   121461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121462 at_status=$? at_failed=false
   121463 $at_check_filter
   121464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121465 $at_diff expout "$at_stdout" || at_failed=:
   121466 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121467 $at_failed && at_fn_log_failure
   121468 $at_traceon; }
   121469 
   121470   rm -rf xml-tests expout
   121471   at_restore_special_files
   121472 fi
   121473 { set +x
   121474 $as_echo "$at_srcdir/calc.at:711: bison -o calc.cc calc.y"
   121475 at_fn_check_prepare_trace "calc.at:711"
   121476 ( $at_check_trace; bison -o calc.cc calc.y
   121477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121478 at_status=$? at_failed=false
   121479 $at_check_filter
   121480 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121482 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121483 $at_failed && at_fn_log_failure
   121484 $at_traceon; }
   121485 
   121486 
   121487 
   121488 { set +x
   121489 $as_echo "$at_srcdir/calc.at:711: \$BISON_CXX_WORKS"
   121490 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:711"
   121491 ( $at_check_trace; $BISON_CXX_WORKS
   121492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121493 at_status=$? at_failed=false
   121494 $at_check_filter
   121495 echo stderr:; cat "$at_stderr"
   121496 echo stdout:; cat "$at_stdout"
   121497 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121498 $at_failed && at_fn_log_failure
   121499 $at_traceon; }
   121500 
   121501 { set +x
   121502 $as_echo "$at_srcdir/calc.at:711: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   121503 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:711"
   121504 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   121505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121506 at_status=$? at_failed=false
   121507 $at_check_filter
   121508 echo stderr:; cat "$at_stderr"
   121509 echo stdout:; cat "$at_stdout"
   121510 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121511 $at_failed && at_fn_log_failure
   121512 $at_traceon; }
   121513 
   121514 
   121515 { set +x
   121516 $as_echo "$at_srcdir/calc.at:711: \$PERL -ne '
   121517   chomp;
   121518   print \"\$.: {\$_}\\n\"
   121519     if (# No starting/ending empty lines.
   121520         (eof || \$. == 1) && /^\\s*\$/
   121521         # No trailing space.  FIXME: not ready for \"maint\".
   121522         # || /\\s\$/
   121523         )' calc.cc
   121524 "
   121525 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711"
   121526 ( $at_check_trace; $PERL -ne '
   121527   chomp;
   121528   print "$.: {$_}\n"
   121529     if (# No starting/ending empty lines.
   121530         (eof || $. == 1) && /^\s*$/
   121531         # No trailing space.  FIXME: not ready for "maint".
   121532         # || /\s$/
   121533         )' calc.cc
   121534 
   121535 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121536 at_status=$? at_failed=false
   121537 $at_check_filter
   121538 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121539 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121540 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121541 $at_failed && at_fn_log_failure
   121542 $at_traceon; }
   121543 
   121544 { set +x
   121545 $as_echo "$at_srcdir/calc.at:711: \$PERL -ne '
   121546   chomp;
   121547   print \"\$.: {\$_}\\n\"
   121548     if (# No starting/ending empty lines.
   121549         (eof || \$. == 1) && /^\\s*\$/
   121550         # No trailing space.  FIXME: not ready for \"maint\".
   121551         # || /\\s\$/
   121552         )' calc.hh
   121553 "
   121554 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711"
   121555 ( $at_check_trace; $PERL -ne '
   121556   chomp;
   121557   print "$.: {$_}\n"
   121558     if (# No starting/ending empty lines.
   121559         (eof || $. == 1) && /^\s*$/
   121560         # No trailing space.  FIXME: not ready for "maint".
   121561         # || /\s$/
   121562         )' calc.hh
   121563 
   121564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121565 at_status=$? at_failed=false
   121566 $at_check_filter
   121567 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121568 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121569 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121570 $at_failed && at_fn_log_failure
   121571 $at_traceon; }
   121572 
   121573 
   121574 # Test the priorities.
   121575 cat >input <<'_ATEOF'
   121576 1 + 2 * 3 = 7
   121577 1 + 2 * -3 = -5
   121578 
   121579 -1^2 = -1
   121580 (-1)^2 = 1
   121581 
   121582 ---1 = -1
   121583 
   121584 1 - 2 - 3 = -4
   121585 1 - (2 - 3) = 2
   121586 
   121587 2^2^3 = 256
   121588 (2^2)^3 = 64
   121589 _ATEOF
   121590 
   121591 { set +x
   121592 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   121593 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   121594 ( $at_check_trace;  $PREPARSER ./calc input
   121595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121596 at_status=$? at_failed=false
   121597 $at_check_filter
   121598 echo stderr:; tee stderr <"$at_stderr"
   121599 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121600 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121601 $at_failed && at_fn_log_failure
   121602 $at_traceon; }
   121603 
   121604 { set +x
   121605 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121606 at_fn_check_prepare_trace "calc.at:711"
   121607 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121609 at_status=$? at_failed=false
   121610 $at_check_filter
   121611 echo stderr:; tee stderr <"$at_stderr"
   121612 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121613 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121614 $at_failed && at_fn_log_failure
   121615 $at_traceon; }
   121616 
   121617 
   121618 
   121619 
   121620 # Some syntax errors.
   121621 cat >input <<'_ATEOF'
   121622 1 2
   121623 _ATEOF
   121624 
   121625 { set +x
   121626 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   121627 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   121628 ( $at_check_trace;  $PREPARSER ./calc input
   121629 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121630 at_status=$? at_failed=false
   121631 $at_check_filter
   121632 echo stderr:; tee stderr <"$at_stderr"
   121633 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121634 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711"
   121635 $at_failed && at_fn_log_failure
   121636 $at_traceon; }
   121637 
   121638 { set +x
   121639 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121640 at_fn_check_prepare_trace "calc.at:711"
   121641 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121643 at_status=$? at_failed=false
   121644 $at_check_filter
   121645 echo stderr:; tee stderr <"$at_stderr"
   121646 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121647 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121648 $at_failed && at_fn_log_failure
   121649 $at_traceon; }
   121650 
   121651 
   121652 
   121653 # Normalize the observed and expected error messages, depending upon the
   121654 # options.
   121655 # 1. Remove the traces from observed.
   121656 sed '/^Starting/d
   121657 /^Entering/d
   121658 /^Stack/d
   121659 /^Reading/d
   121660 /^Reducing/d
   121661 /^Return/d
   121662 /^Shifting/d
   121663 /^state/d
   121664 /^Cleanup:/d
   121665 /^Error:/d
   121666 /^Next/d
   121667 /^Now/d
   121668 /^Discarding/d
   121669 / \$[0-9$]* = /d
   121670 /^yydestructor:/d' stderr >at-stderr
   121671 mv at-stderr stderr
   121672 # 2. Create the reference error message.
   121673 cat >expout <<'_ATEOF'
   121674 1.3: syntax error, unexpected number
   121675 _ATEOF
   121676 
   121677 # 3. If locations are not used, remove them.
   121678 
   121679 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   121680 
   121681 # 5. Check
   121682 { set +x
   121683 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   121684 at_fn_check_prepare_trace "calc.at:711"
   121685 ( $at_check_trace; cat stderr
   121686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121687 at_status=$? at_failed=false
   121688 $at_check_filter
   121689 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121690 $at_diff expout "$at_stdout" || at_failed=:
   121691 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121692 $at_failed && at_fn_log_failure
   121693 $at_traceon; }
   121694 
   121695 
   121696 cat >input <<'_ATEOF'
   121697 1//2
   121698 _ATEOF
   121699 
   121700 { set +x
   121701 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   121702 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   121703 ( $at_check_trace;  $PREPARSER ./calc input
   121704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121705 at_status=$? at_failed=false
   121706 $at_check_filter
   121707 echo stderr:; tee stderr <"$at_stderr"
   121708 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121709 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711"
   121710 $at_failed && at_fn_log_failure
   121711 $at_traceon; }
   121712 
   121713 { set +x
   121714 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121715 at_fn_check_prepare_trace "calc.at:711"
   121716 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121718 at_status=$? at_failed=false
   121719 $at_check_filter
   121720 echo stderr:; tee stderr <"$at_stderr"
   121721 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121722 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121723 $at_failed && at_fn_log_failure
   121724 $at_traceon; }
   121725 
   121726 
   121727 
   121728 # Normalize the observed and expected error messages, depending upon the
   121729 # options.
   121730 # 1. Remove the traces from observed.
   121731 sed '/^Starting/d
   121732 /^Entering/d
   121733 /^Stack/d
   121734 /^Reading/d
   121735 /^Reducing/d
   121736 /^Return/d
   121737 /^Shifting/d
   121738 /^state/d
   121739 /^Cleanup:/d
   121740 /^Error:/d
   121741 /^Next/d
   121742 /^Now/d
   121743 /^Discarding/d
   121744 / \$[0-9$]* = /d
   121745 /^yydestructor:/d' stderr >at-stderr
   121746 mv at-stderr stderr
   121747 # 2. Create the reference error message.
   121748 cat >expout <<'_ATEOF'
   121749 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   121750 _ATEOF
   121751 
   121752 # 3. If locations are not used, remove them.
   121753 
   121754 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   121755 
   121756 # 5. Check
   121757 { set +x
   121758 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   121759 at_fn_check_prepare_trace "calc.at:711"
   121760 ( $at_check_trace; cat stderr
   121761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121762 at_status=$? at_failed=false
   121763 $at_check_filter
   121764 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121765 $at_diff expout "$at_stdout" || at_failed=:
   121766 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121767 $at_failed && at_fn_log_failure
   121768 $at_traceon; }
   121769 
   121770 
   121771 cat >input <<'_ATEOF'
   121772 error
   121773 _ATEOF
   121774 
   121775 { set +x
   121776 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   121777 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   121778 ( $at_check_trace;  $PREPARSER ./calc input
   121779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121780 at_status=$? at_failed=false
   121781 $at_check_filter
   121782 echo stderr:; tee stderr <"$at_stderr"
   121783 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121784 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711"
   121785 $at_failed && at_fn_log_failure
   121786 $at_traceon; }
   121787 
   121788 { set +x
   121789 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121790 at_fn_check_prepare_trace "calc.at:711"
   121791 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121792 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121793 at_status=$? at_failed=false
   121794 $at_check_filter
   121795 echo stderr:; tee stderr <"$at_stderr"
   121796 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121797 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121798 $at_failed && at_fn_log_failure
   121799 $at_traceon; }
   121800 
   121801 
   121802 
   121803 # Normalize the observed and expected error messages, depending upon the
   121804 # options.
   121805 # 1. Remove the traces from observed.
   121806 sed '/^Starting/d
   121807 /^Entering/d
   121808 /^Stack/d
   121809 /^Reading/d
   121810 /^Reducing/d
   121811 /^Return/d
   121812 /^Shifting/d
   121813 /^state/d
   121814 /^Cleanup:/d
   121815 /^Error:/d
   121816 /^Next/d
   121817 /^Now/d
   121818 /^Discarding/d
   121819 / \$[0-9$]* = /d
   121820 /^yydestructor:/d' stderr >at-stderr
   121821 mv at-stderr stderr
   121822 # 2. Create the reference error message.
   121823 cat >expout <<'_ATEOF'
   121824 1.1: syntax error, unexpected $undefined
   121825 _ATEOF
   121826 
   121827 # 3. If locations are not used, remove them.
   121828 
   121829 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   121830 
   121831 # 5. Check
   121832 { set +x
   121833 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   121834 at_fn_check_prepare_trace "calc.at:711"
   121835 ( $at_check_trace; cat stderr
   121836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121837 at_status=$? at_failed=false
   121838 $at_check_filter
   121839 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121840 $at_diff expout "$at_stdout" || at_failed=:
   121841 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121842 $at_failed && at_fn_log_failure
   121843 $at_traceon; }
   121844 
   121845 
   121846 cat >input <<'_ATEOF'
   121847 1 = 2 = 3
   121848 _ATEOF
   121849 
   121850 { set +x
   121851 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   121852 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   121853 ( $at_check_trace;  $PREPARSER ./calc input
   121854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121855 at_status=$? at_failed=false
   121856 $at_check_filter
   121857 echo stderr:; tee stderr <"$at_stderr"
   121858 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121859 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711"
   121860 $at_failed && at_fn_log_failure
   121861 $at_traceon; }
   121862 
   121863 { set +x
   121864 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121865 at_fn_check_prepare_trace "calc.at:711"
   121866 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121868 at_status=$? at_failed=false
   121869 $at_check_filter
   121870 echo stderr:; tee stderr <"$at_stderr"
   121871 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121872 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121873 $at_failed && at_fn_log_failure
   121874 $at_traceon; }
   121875 
   121876 
   121877 
   121878 # Normalize the observed and expected error messages, depending upon the
   121879 # options.
   121880 # 1. Remove the traces from observed.
   121881 sed '/^Starting/d
   121882 /^Entering/d
   121883 /^Stack/d
   121884 /^Reading/d
   121885 /^Reducing/d
   121886 /^Return/d
   121887 /^Shifting/d
   121888 /^state/d
   121889 /^Cleanup:/d
   121890 /^Error:/d
   121891 /^Next/d
   121892 /^Now/d
   121893 /^Discarding/d
   121894 / \$[0-9$]* = /d
   121895 /^yydestructor:/d' stderr >at-stderr
   121896 mv at-stderr stderr
   121897 # 2. Create the reference error message.
   121898 cat >expout <<'_ATEOF'
   121899 1.7: syntax error, unexpected '='
   121900 _ATEOF
   121901 
   121902 # 3. If locations are not used, remove them.
   121903 
   121904 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   121905 
   121906 # 5. Check
   121907 { set +x
   121908 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   121909 at_fn_check_prepare_trace "calc.at:711"
   121910 ( $at_check_trace; cat stderr
   121911 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121912 at_status=$? at_failed=false
   121913 $at_check_filter
   121914 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121915 $at_diff expout "$at_stdout" || at_failed=:
   121916 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121917 $at_failed && at_fn_log_failure
   121918 $at_traceon; }
   121919 
   121920 
   121921 cat >input <<'_ATEOF'
   121922 
   121923 +1
   121924 _ATEOF
   121925 
   121926 { set +x
   121927 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   121928 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   121929 ( $at_check_trace;  $PREPARSER ./calc input
   121930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121931 at_status=$? at_failed=false
   121932 $at_check_filter
   121933 echo stderr:; tee stderr <"$at_stderr"
   121934 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121935 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711"
   121936 $at_failed && at_fn_log_failure
   121937 $at_traceon; }
   121938 
   121939 { set +x
   121940 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   121941 at_fn_check_prepare_trace "calc.at:711"
   121942 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   121943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121944 at_status=$? at_failed=false
   121945 $at_check_filter
   121946 echo stderr:; tee stderr <"$at_stderr"
   121947 at_fn_diff_devnull "$at_stdout" || at_failed=:
   121948 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121949 $at_failed && at_fn_log_failure
   121950 $at_traceon; }
   121951 
   121952 
   121953 
   121954 # Normalize the observed and expected error messages, depending upon the
   121955 # options.
   121956 # 1. Remove the traces from observed.
   121957 sed '/^Starting/d
   121958 /^Entering/d
   121959 /^Stack/d
   121960 /^Reading/d
   121961 /^Reducing/d
   121962 /^Return/d
   121963 /^Shifting/d
   121964 /^state/d
   121965 /^Cleanup:/d
   121966 /^Error:/d
   121967 /^Next/d
   121968 /^Now/d
   121969 /^Discarding/d
   121970 / \$[0-9$]* = /d
   121971 /^yydestructor:/d' stderr >at-stderr
   121972 mv at-stderr stderr
   121973 # 2. Create the reference error message.
   121974 cat >expout <<'_ATEOF'
   121975 2.1: syntax error, unexpected '+'
   121976 _ATEOF
   121977 
   121978 # 3. If locations are not used, remove them.
   121979 
   121980 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   121981 
   121982 # 5. Check
   121983 { set +x
   121984 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   121985 at_fn_check_prepare_trace "calc.at:711"
   121986 ( $at_check_trace; cat stderr
   121987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   121988 at_status=$? at_failed=false
   121989 $at_check_filter
   121990 at_fn_diff_devnull "$at_stderr" || at_failed=:
   121991 $at_diff expout "$at_stdout" || at_failed=:
   121992 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   121993 $at_failed && at_fn_log_failure
   121994 $at_traceon; }
   121995 
   121996 
   121997 # Exercise error messages with EOF: work on an empty file.
   121998 { set +x
   121999 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc /dev/null"
   122000 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:711"
   122001 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   122002 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122003 at_status=$? at_failed=false
   122004 $at_check_filter
   122005 echo stderr:; tee stderr <"$at_stderr"
   122006 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122007 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711"
   122008 $at_failed && at_fn_log_failure
   122009 $at_traceon; }
   122010 
   122011 { set +x
   122012 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122013 at_fn_check_prepare_trace "calc.at:711"
   122014 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122015 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122016 at_status=$? at_failed=false
   122017 $at_check_filter
   122018 echo stderr:; tee stderr <"$at_stderr"
   122019 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122020 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122021 $at_failed && at_fn_log_failure
   122022 $at_traceon; }
   122023 
   122024 
   122025 
   122026 # Normalize the observed and expected error messages, depending upon the
   122027 # options.
   122028 # 1. Remove the traces from observed.
   122029 sed '/^Starting/d
   122030 /^Entering/d
   122031 /^Stack/d
   122032 /^Reading/d
   122033 /^Reducing/d
   122034 /^Return/d
   122035 /^Shifting/d
   122036 /^state/d
   122037 /^Cleanup:/d
   122038 /^Error:/d
   122039 /^Next/d
   122040 /^Now/d
   122041 /^Discarding/d
   122042 / \$[0-9$]* = /d
   122043 /^yydestructor:/d' stderr >at-stderr
   122044 mv at-stderr stderr
   122045 # 2. Create the reference error message.
   122046 cat >expout <<'_ATEOF'
   122047 1.1: syntax error, unexpected end of input
   122048 _ATEOF
   122049 
   122050 # 3. If locations are not used, remove them.
   122051 
   122052 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   122053 
   122054 # 5. Check
   122055 { set +x
   122056 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   122057 at_fn_check_prepare_trace "calc.at:711"
   122058 ( $at_check_trace; cat stderr
   122059 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122060 at_status=$? at_failed=false
   122061 $at_check_filter
   122062 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122063 $at_diff expout "$at_stdout" || at_failed=:
   122064 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122065 $at_failed && at_fn_log_failure
   122066 $at_traceon; }
   122067 
   122068 
   122069 
   122070 # Exercise the error token: without it, we die at the first error,
   122071 # hence be sure to
   122072 #
   122073 # - have several errors which exercise different shift/discardings
   122074 #   - (): nothing to pop, nothing to discard
   122075 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   122076 #   - (* * *): nothing to pop, a lot to discard
   122077 #   - (1 + 2 * *): some to pop and discard
   122078 #
   122079 # - test the action associated to `error'
   122080 #
   122081 # - check the lookahead that triggers an error is not discarded
   122082 #   when we enter error recovery.  Below, the lookahead causing the
   122083 #   first error is ")", which is needed to recover from the error and
   122084 #   produce the "0" that triggers the "0 != 1" error.
   122085 #
   122086 cat >input <<'_ATEOF'
   122087 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   122088 _ATEOF
   122089 
   122090 { set +x
   122091 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   122092 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   122093 ( $at_check_trace;  $PREPARSER ./calc input
   122094 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122095 at_status=$? at_failed=false
   122096 $at_check_filter
   122097 echo stderr:; tee stderr <"$at_stderr"
   122098 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122099 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122100 $at_failed && at_fn_log_failure
   122101 $at_traceon; }
   122102 
   122103 { set +x
   122104 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122105 at_fn_check_prepare_trace "calc.at:711"
   122106 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122108 at_status=$? at_failed=false
   122109 $at_check_filter
   122110 echo stderr:; tee stderr <"$at_stderr"
   122111 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122112 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122113 $at_failed && at_fn_log_failure
   122114 $at_traceon; }
   122115 
   122116 
   122117 
   122118 # Normalize the observed and expected error messages, depending upon the
   122119 # options.
   122120 # 1. Remove the traces from observed.
   122121 sed '/^Starting/d
   122122 /^Entering/d
   122123 /^Stack/d
   122124 /^Reading/d
   122125 /^Reducing/d
   122126 /^Return/d
   122127 /^Shifting/d
   122128 /^state/d
   122129 /^Cleanup:/d
   122130 /^Error:/d
   122131 /^Next/d
   122132 /^Now/d
   122133 /^Discarding/d
   122134 / \$[0-9$]* = /d
   122135 /^yydestructor:/d' stderr >at-stderr
   122136 mv at-stderr stderr
   122137 # 2. Create the reference error message.
   122138 cat >expout <<'_ATEOF'
   122139 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   122140 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   122141 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   122142 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   122143 calc: error: 4444 != 1
   122144 _ATEOF
   122145 
   122146 # 3. If locations are not used, remove them.
   122147 
   122148 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   122149 
   122150 # 5. Check
   122151 { set +x
   122152 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   122153 at_fn_check_prepare_trace "calc.at:711"
   122154 ( $at_check_trace; cat stderr
   122155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122156 at_status=$? at_failed=false
   122157 $at_check_filter
   122158 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122159 $at_diff expout "$at_stdout" || at_failed=:
   122160 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122161 $at_failed && at_fn_log_failure
   122162 $at_traceon; }
   122163 
   122164 
   122165 
   122166 # The same, but this time exercising explicitly triggered syntax errors.
   122167 # POSIX says the lookahead causing the error should not be discarded.
   122168 cat >input <<'_ATEOF'
   122169 (!) + (1 2) = 1
   122170 _ATEOF
   122171 
   122172 { set +x
   122173 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   122174 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   122175 ( $at_check_trace;  $PREPARSER ./calc input
   122176 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122177 at_status=$? at_failed=false
   122178 $at_check_filter
   122179 echo stderr:; tee stderr <"$at_stderr"
   122180 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122181 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122182 $at_failed && at_fn_log_failure
   122183 $at_traceon; }
   122184 
   122185 { set +x
   122186 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122187 at_fn_check_prepare_trace "calc.at:711"
   122188 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122190 at_status=$? at_failed=false
   122191 $at_check_filter
   122192 echo stderr:; tee stderr <"$at_stderr"
   122193 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122194 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122195 $at_failed && at_fn_log_failure
   122196 $at_traceon; }
   122197 
   122198 
   122199 
   122200 # Normalize the observed and expected error messages, depending upon the
   122201 # options.
   122202 # 1. Remove the traces from observed.
   122203 sed '/^Starting/d
   122204 /^Entering/d
   122205 /^Stack/d
   122206 /^Reading/d
   122207 /^Reducing/d
   122208 /^Return/d
   122209 /^Shifting/d
   122210 /^state/d
   122211 /^Cleanup:/d
   122212 /^Error:/d
   122213 /^Next/d
   122214 /^Now/d
   122215 /^Discarding/d
   122216 / \$[0-9$]* = /d
   122217 /^yydestructor:/d' stderr >at-stderr
   122218 mv at-stderr stderr
   122219 # 2. Create the reference error message.
   122220 cat >expout <<'_ATEOF'
   122221 1.10: syntax error, unexpected number
   122222 calc: error: 2222 != 1
   122223 _ATEOF
   122224 
   122225 # 3. If locations are not used, remove them.
   122226 
   122227 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   122228 
   122229 # 5. Check
   122230 { set +x
   122231 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   122232 at_fn_check_prepare_trace "calc.at:711"
   122233 ( $at_check_trace; cat stderr
   122234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122235 at_status=$? at_failed=false
   122236 $at_check_filter
   122237 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122238 $at_diff expout "$at_stdout" || at_failed=:
   122239 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122240 $at_failed && at_fn_log_failure
   122241 $at_traceon; }
   122242 
   122243 
   122244 cat >input <<'_ATEOF'
   122245 (- *) + (1 2) = 1
   122246 _ATEOF
   122247 
   122248 { set +x
   122249 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   122250 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   122251 ( $at_check_trace;  $PREPARSER ./calc input
   122252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122253 at_status=$? at_failed=false
   122254 $at_check_filter
   122255 echo stderr:; tee stderr <"$at_stderr"
   122256 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122257 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122258 $at_failed && at_fn_log_failure
   122259 $at_traceon; }
   122260 
   122261 { set +x
   122262 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122263 at_fn_check_prepare_trace "calc.at:711"
   122264 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122266 at_status=$? at_failed=false
   122267 $at_check_filter
   122268 echo stderr:; tee stderr <"$at_stderr"
   122269 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122270 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122271 $at_failed && at_fn_log_failure
   122272 $at_traceon; }
   122273 
   122274 
   122275 
   122276 # Normalize the observed and expected error messages, depending upon the
   122277 # options.
   122278 # 1. Remove the traces from observed.
   122279 sed '/^Starting/d
   122280 /^Entering/d
   122281 /^Stack/d
   122282 /^Reading/d
   122283 /^Reducing/d
   122284 /^Return/d
   122285 /^Shifting/d
   122286 /^state/d
   122287 /^Cleanup:/d
   122288 /^Error:/d
   122289 /^Next/d
   122290 /^Now/d
   122291 /^Discarding/d
   122292 / \$[0-9$]* = /d
   122293 /^yydestructor:/d' stderr >at-stderr
   122294 mv at-stderr stderr
   122295 # 2. Create the reference error message.
   122296 cat >expout <<'_ATEOF'
   122297 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   122298 1.12: syntax error, unexpected number
   122299 calc: error: 2222 != 1
   122300 _ATEOF
   122301 
   122302 # 3. If locations are not used, remove them.
   122303 
   122304 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   122305 
   122306 # 5. Check
   122307 { set +x
   122308 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   122309 at_fn_check_prepare_trace "calc.at:711"
   122310 ( $at_check_trace; cat stderr
   122311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122312 at_status=$? at_failed=false
   122313 $at_check_filter
   122314 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122315 $at_diff expout "$at_stdout" || at_failed=:
   122316 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122317 $at_failed && at_fn_log_failure
   122318 $at_traceon; }
   122319 
   122320 
   122321 
   122322 # Check that yyerrok works properly: second error is not reported,
   122323 # third and fourth are.  Parse status is succesfull.
   122324 cat >input <<'_ATEOF'
   122325 (* *) + (*) + (*)
   122326 _ATEOF
   122327 
   122328 { set +x
   122329 $as_echo "$at_srcdir/calc.at:711:  \$PREPARSER ./calc input"
   122330 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711"
   122331 ( $at_check_trace;  $PREPARSER ./calc input
   122332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122333 at_status=$? at_failed=false
   122334 $at_check_filter
   122335 echo stderr:; tee stderr <"$at_stderr"
   122336 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122337 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122338 $at_failed && at_fn_log_failure
   122339 $at_traceon; }
   122340 
   122341 { set +x
   122342 $as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122343 at_fn_check_prepare_trace "calc.at:711"
   122344 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122346 at_status=$? at_failed=false
   122347 $at_check_filter
   122348 echo stderr:; tee stderr <"$at_stderr"
   122349 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122350 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122351 $at_failed && at_fn_log_failure
   122352 $at_traceon; }
   122353 
   122354 
   122355 
   122356 # Normalize the observed and expected error messages, depending upon the
   122357 # options.
   122358 # 1. Remove the traces from observed.
   122359 sed '/^Starting/d
   122360 /^Entering/d
   122361 /^Stack/d
   122362 /^Reading/d
   122363 /^Reducing/d
   122364 /^Return/d
   122365 /^Shifting/d
   122366 /^state/d
   122367 /^Cleanup:/d
   122368 /^Error:/d
   122369 /^Next/d
   122370 /^Now/d
   122371 /^Discarding/d
   122372 / \$[0-9$]* = /d
   122373 /^yydestructor:/d' stderr >at-stderr
   122374 mv at-stderr stderr
   122375 # 2. Create the reference error message.
   122376 cat >expout <<'_ATEOF'
   122377 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   122378 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   122379 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   122380 _ATEOF
   122381 
   122382 # 3. If locations are not used, remove them.
   122383 
   122384 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   122385 
   122386 # 5. Check
   122387 { set +x
   122388 $as_echo "$at_srcdir/calc.at:711: cat stderr"
   122389 at_fn_check_prepare_trace "calc.at:711"
   122390 ( $at_check_trace; cat stderr
   122391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122392 at_status=$? at_failed=false
   122393 $at_check_filter
   122394 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122395 $at_diff expout "$at_stdout" || at_failed=:
   122396 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711"
   122397 $at_failed && at_fn_log_failure
   122398 $at_traceon; }
   122399 
   122400 
   122401 
   122402 
   122403 
   122404   set +x
   122405   $at_times_p && times >"$at_times_file"
   122406 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   122407 read at_status <"$at_status_file"
   122408 #AT_STOP_248
   122409 #AT_START_249
   122410 at_fn_group_banner 249 'calc.at:713' \
   122411   "Calculator %language \"C++\" %glr-parser %defines %locations %debug" "" 14
   122412 at_xfail=no
   122413 (
   122414   $as_echo "249. $at_setup_line: testing $at_desc ..."
   122415   $at_traceon
   122416 
   122417 
   122418 
   122419 
   122420 
   122421 
   122422 
   122423 
   122424 
   122425 
   122426 cat >calc.y <<'_ATEOF'
   122427 %code top {
   122428 #include <config.h>
   122429 /* We don't need perfect functions for these tests. */
   122430 #undef malloc
   122431 #undef memcmp
   122432 #undef realloc
   122433 }
   122434 
   122435 /* Infix notation calculator--calc */
   122436 %language "C++" %glr-parser %defines %locations %debug
   122437 %define global_tokens_and_yystype
   122438 %code requires
   122439 {
   122440 
   122441   /* Exercise pre-prologue dependency to %union.  */
   122442   typedef int semantic_value;
   122443 }
   122444 
   122445 /* Exercise %union. */
   122446 %union
   122447 {
   122448   semantic_value ival;
   122449 };
   122450 %printer { yyoutput << $$; } <ival>;
   122451 
   122452 %code provides
   122453 {
   122454   #include <stdio.h>
   122455   /* The input.  */
   122456   extern FILE *input;
   122457   extern semantic_value global_result;
   122458   extern int global_count;
   122459 }
   122460 
   122461 %code
   122462 {
   122463 #include <assert.h>
   122464 #include <string.h>
   122465 #define USE(Var)
   122466 
   122467 FILE *input;
   122468 static int power (int base, int exponent);
   122469 
   122470 
   122471 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   122472 }
   122473 
   122474 
   122475 
   122476 /* Bison Declarations */
   122477 %token CALC_EOF 0 "end of input"
   122478 %token <ival> NUM "number"
   122479 %type  <ival> exp
   122480 
   122481 %nonassoc '=' /* comparison            */
   122482 %left '-' '+'
   122483 %left '*' '/'
   122484 %left NEG     /* negation--unary minus */
   122485 %right '^'    /* exponentiation        */
   122486 
   122487 /* Grammar follows */
   122488 %%
   122489 input:
   122490   line
   122491 | input line         {  }
   122492 ;
   122493 
   122494 line:
   122495   '\n'
   122496 | exp '\n'           { USE ($1); }
   122497 ;
   122498 
   122499 exp:
   122500   NUM                { $$ = $1;             }
   122501 | exp '=' exp
   122502   {
   122503     if ($1 != $3)
   122504       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   122505     $$ = $1;
   122506   }
   122507 | exp '+' exp        { $$ = $1 + $3;        }
   122508 | exp '-' exp        { $$ = $1 - $3;        }
   122509 | exp '*' exp        { $$ = $1 * $3;        }
   122510 | exp '/' exp        { $$ = $1 / $3;        }
   122511 | '-' exp  %prec NEG { $$ = -$2;            }
   122512 | exp '^' exp        { $$ = power ($1, $3); }
   122513 | '(' exp ')'        { $$ = $2;             }
   122514 | '(' error ')'      { $$ = 1111; yyerrok;  }
   122515 | '!'                { $$ = 0; YYERROR;     }
   122516 | '-' error          { $$ = 0; YYERROR;     }
   122517 ;
   122518 %%
   122519 
   122520 static int
   122521 power (int base, int exponent)
   122522 {
   122523   int res = 1;
   122524   assert (0 <= exponent);
   122525   for (/* Niente */; exponent; --exponent)
   122526     res *= base;
   122527   return res;
   122528 }
   122529 
   122530 
   122531 /* A C++ error reporting function.  */
   122532 void
   122533 yy::parser::error (const location_type& l, const std::string& m)
   122534 {
   122535   (void) l;
   122536   std::cerr << l << ": " << m << std::endl;
   122537 }
   122538 _ATEOF
   122539 
   122540 
   122541 
   122542 cat >calc-lex.cc <<'_ATEOF'
   122543 #include <config.h>
   122544 /* We don't need perfect functions for these tests. */
   122545 #undef malloc
   122546 #undef memcmp
   122547 #undef realloc
   122548 
   122549 #include "calc.hh"
   122550 
   122551 #include <ctype.h>
   122552 
   122553 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   122554 static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   122555 static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);
   122556 
   122557 
   122558 static yy::parser::location_type last_yylloc;
   122559 
   122560 static int
   122561 get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   122562 {
   122563   int res = getc (input);
   122564   (void) lvalp;(void) llocp;
   122565 
   122566   last_yylloc = (*llocp);
   122567   if (res == '\n')
   122568     {
   122569       (*llocp).end.line++;
   122570       (*llocp).end.column = 1;
   122571     }
   122572   else
   122573     (*llocp).end.column++;
   122574 
   122575   return res;
   122576 }
   122577 
   122578 static void
   122579 unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c)
   122580 {
   122581   (void) lvalp;(void) llocp;
   122582 
   122583   /* Wrong when C == `\n'. */
   122584   (*llocp) = last_yylloc;
   122585 
   122586   ungetc (c, input);
   122587 }
   122588 
   122589 static int
   122590 read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   122591 {
   122592   int c = get_char (lvalp, llocp);
   122593   int sign = 1;
   122594   int n = 0;
   122595 
   122596   (void) lvalp;(void) llocp;
   122597   if (c == '-')
   122598     {
   122599       c = get_char (lvalp, llocp);
   122600       sign = -1;
   122601     }
   122602 
   122603   while (isdigit (c))
   122604     {
   122605       n = 10 * n + (c - '0');
   122606       c = get_char (lvalp, llocp);
   122607     }
   122608 
   122609   unget_char (lvalp, llocp,  c);
   122610 
   122611   return sign * n;
   122612 }
   122613 
   122614 
   122615 /*---------------------------------------------------------------.
   122616 | Lexical analyzer returns an integer on the stack and the token |
   122617 | NUM, or the ASCII character read if not a number.  Skips all   |
   122618 | blanks and tabs, returns 0 for EOF.                            |
   122619 `---------------------------------------------------------------*/
   122620 
   122621 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   122622 {
   122623   int c;
   122624   /* Skip current token, then white spaces.  */
   122625   do
   122626     {
   122627      (*llocp).begin.column = (*llocp).end.column;
   122628       (*llocp).begin.line   = (*llocp).end.line;
   122629 
   122630     }
   122631   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   122632 
   122633   /* process numbers   */
   122634   if (c == '.' || isdigit (c))
   122635     {
   122636       unget_char (lvalp, llocp,  c);
   122637       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   122638       return NUM;
   122639     }
   122640 
   122641   /* Return end-of-file.  */
   122642   if (c == EOF)
   122643     return CALC_EOF;
   122644 
   122645   /* Return single chars. */
   122646   return c;
   122647 }
   122648 _ATEOF
   122649 
   122650 
   122651 cat >calc-main.cc <<'_ATEOF'
   122652 #include <config.h>
   122653 /* We don't need perfect functions for these tests. */
   122654 #undef malloc
   122655 #undef memcmp
   122656 #undef realloc
   122657 
   122658 #include "calc.hh"
   122659 
   122660 #include <assert.h>
   122661 #if HAVE_UNISTD_H
   122662 # include <unistd.h>
   122663 #else
   122664 # undef alarm
   122665 # define alarm(seconds) /* empty */
   122666 #endif
   122667 
   122668 
   122669 /* A C++ yyparse that simulates the C signature.  */
   122670 int
   122671 yyparse ()
   122672 {
   122673   yy::parser parser;
   122674 #if YYDEBUG
   122675   parser.set_debug_level (1);
   122676 #endif
   122677   return parser.parse ();
   122678 }
   122679 
   122680 
   122681 semantic_value global_result = 0;
   122682 int global_count = 0;
   122683 
   122684 /* A C main function.  */
   122685 int
   122686 main (int argc, const char **argv)
   122687 {
   122688   semantic_value result = 0;
   122689   int count = 0;
   122690   int status;
   122691 
   122692   /* This used to be alarm (10), but that isn't enough time for
   122693      a July 1995 vintage DEC Alphastation 200 4/100 system,
   122694      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   122695   alarm (100);
   122696 
   122697   if (argc == 2)
   122698     input = fopen (argv[1], "r");
   122699   else
   122700     input = stdin;
   122701 
   122702   if (!input)
   122703     {
   122704       perror (argv[1]);
   122705       return 3;
   122706     }
   122707 
   122708 
   122709   status = yyparse ();
   122710   if (fclose (input))
   122711     perror ("fclose");
   122712   assert (global_result == result);
   122713   assert (global_count == count);
   122714   return status;
   122715 }
   122716 _ATEOF
   122717 
   122718 
   122719 
   122720 
   122721 
   122722 
   122723 
   122724 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   122725   at_save_special_files
   122726   mkdir xml-tests
   122727     # Don't combine these Bison invocations since we want to be sure that
   122728   # --report=all isn't required to get the full XML file.
   122729   { set +x
   122730 $as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   122731                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   122732 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713"
   122733 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   122734                   --graph=xml-tests/test.dot -o calc.cc calc.y
   122735 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122736 at_status=$? at_failed=false
   122737 $at_check_filter
   122738 echo stderr:; cat "$at_stderr"
   122739 echo stdout:; cat "$at_stdout"
   122740 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122741 $at_failed && at_fn_log_failure
   122742 $at_traceon; }
   122743 
   122744   { set +x
   122745 $as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   122746 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:713"
   122747 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   122748 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122749 at_status=$? at_failed=false
   122750 $at_check_filter
   122751 echo stderr:; cat "$at_stderr"
   122752 echo stdout:; cat "$at_stdout"
   122753 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122754 $at_failed && at_fn_log_failure
   122755 $at_traceon; }
   122756 
   122757     cp xml-tests/test.output expout
   122758   { set +x
   122759 $as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\
   122760              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   122761              xml-tests/test.xml"
   122762 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:713"
   122763 ( $at_check_trace; $XSLTPROC \
   122764              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   122765              xml-tests/test.xml
   122766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122767 at_status=$? at_failed=false
   122768 $at_check_filter
   122769 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122770 $at_diff expout "$at_stdout" || at_failed=:
   122771 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122772 $at_failed && at_fn_log_failure
   122773 $at_traceon; }
   122774 
   122775   sort xml-tests/test.dot > expout
   122776   { set +x
   122777 $as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\
   122778              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   122779              xml-tests/test.xml | sort"
   122780 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:713"
   122781 ( $at_check_trace; $XSLTPROC \
   122782              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   122783              xml-tests/test.xml | sort
   122784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122785 at_status=$? at_failed=false
   122786 $at_check_filter
   122787 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122788 $at_diff expout "$at_stdout" || at_failed=:
   122789 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122790 $at_failed && at_fn_log_failure
   122791 $at_traceon; }
   122792 
   122793   rm -rf xml-tests expout
   122794   at_restore_special_files
   122795 fi
   122796 { set +x
   122797 $as_echo "$at_srcdir/calc.at:713: bison -o calc.cc calc.y"
   122798 at_fn_check_prepare_trace "calc.at:713"
   122799 ( $at_check_trace; bison -o calc.cc calc.y
   122800 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122801 at_status=$? at_failed=false
   122802 $at_check_filter
   122803 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122804 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122805 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122806 $at_failed && at_fn_log_failure
   122807 $at_traceon; }
   122808 
   122809 
   122810 
   122811 { set +x
   122812 $as_echo "$at_srcdir/calc.at:713: \$BISON_CXX_WORKS"
   122813 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:713"
   122814 ( $at_check_trace; $BISON_CXX_WORKS
   122815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122816 at_status=$? at_failed=false
   122817 $at_check_filter
   122818 echo stderr:; cat "$at_stderr"
   122819 echo stdout:; cat "$at_stdout"
   122820 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122821 $at_failed && at_fn_log_failure
   122822 $at_traceon; }
   122823 
   122824 { set +x
   122825 $as_echo "$at_srcdir/calc.at:713: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   122826 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:713"
   122827 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   122828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122829 at_status=$? at_failed=false
   122830 $at_check_filter
   122831 echo stderr:; cat "$at_stderr"
   122832 echo stdout:; cat "$at_stdout"
   122833 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122834 $at_failed && at_fn_log_failure
   122835 $at_traceon; }
   122836 
   122837 
   122838 { set +x
   122839 $as_echo "$at_srcdir/calc.at:713: \$PERL -ne '
   122840   chomp;
   122841   print \"\$.: {\$_}\\n\"
   122842     if (# No starting/ending empty lines.
   122843         (eof || \$. == 1) && /^\\s*\$/
   122844         # No trailing space.  FIXME: not ready for \"maint\".
   122845         # || /\\s\$/
   122846         )' calc.cc
   122847 "
   122848 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713"
   122849 ( $at_check_trace; $PERL -ne '
   122850   chomp;
   122851   print "$.: {$_}\n"
   122852     if (# No starting/ending empty lines.
   122853         (eof || $. == 1) && /^\s*$/
   122854         # No trailing space.  FIXME: not ready for "maint".
   122855         # || /\s$/
   122856         )' calc.cc
   122857 
   122858 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122859 at_status=$? at_failed=false
   122860 $at_check_filter
   122861 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122862 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122863 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122864 $at_failed && at_fn_log_failure
   122865 $at_traceon; }
   122866 
   122867 { set +x
   122868 $as_echo "$at_srcdir/calc.at:713: \$PERL -ne '
   122869   chomp;
   122870   print \"\$.: {\$_}\\n\"
   122871     if (# No starting/ending empty lines.
   122872         (eof || \$. == 1) && /^\\s*\$/
   122873         # No trailing space.  FIXME: not ready for \"maint\".
   122874         # || /\\s\$/
   122875         )' calc.hh
   122876 "
   122877 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713"
   122878 ( $at_check_trace; $PERL -ne '
   122879   chomp;
   122880   print "$.: {$_}\n"
   122881     if (# No starting/ending empty lines.
   122882         (eof || $. == 1) && /^\s*$/
   122883         # No trailing space.  FIXME: not ready for "maint".
   122884         # || /\s$/
   122885         )' calc.hh
   122886 
   122887 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122888 at_status=$? at_failed=false
   122889 $at_check_filter
   122890 at_fn_diff_devnull "$at_stderr" || at_failed=:
   122891 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122892 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122893 $at_failed && at_fn_log_failure
   122894 $at_traceon; }
   122895 
   122896 
   122897 # Test the priorities.
   122898 cat >input <<'_ATEOF'
   122899 1 + 2 * 3 = 7
   122900 1 + 2 * -3 = -5
   122901 
   122902 -1^2 = -1
   122903 (-1)^2 = 1
   122904 
   122905 ---1 = -1
   122906 
   122907 1 - 2 - 3 = -4
   122908 1 - (2 - 3) = 2
   122909 
   122910 2^2^3 = 256
   122911 (2^2)^3 = 64
   122912 _ATEOF
   122913 
   122914 { set +x
   122915 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   122916 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   122917 ( $at_check_trace;  $PREPARSER ./calc input
   122918 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122919 at_status=$? at_failed=false
   122920 $at_check_filter
   122921 echo stderr:; tee stderr <"$at_stderr"
   122922 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122923 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122924 $at_failed && at_fn_log_failure
   122925 $at_traceon; }
   122926 
   122927 { set +x
   122928 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122929 at_fn_check_prepare_trace "calc.at:713"
   122930 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122932 at_status=$? at_failed=false
   122933 $at_check_filter
   122934 echo stderr:; tee stderr <"$at_stderr"
   122935 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122936 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122937 $at_failed && at_fn_log_failure
   122938 $at_traceon; }
   122939 
   122940 
   122941 
   122942 
   122943 # Some syntax errors.
   122944 cat >input <<'_ATEOF'
   122945 1 2
   122946 _ATEOF
   122947 
   122948 { set +x
   122949 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   122950 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   122951 ( $at_check_trace;  $PREPARSER ./calc input
   122952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122953 at_status=$? at_failed=false
   122954 $at_check_filter
   122955 echo stderr:; tee stderr <"$at_stderr"
   122956 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122957 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
   122958 $at_failed && at_fn_log_failure
   122959 $at_traceon; }
   122960 
   122961 { set +x
   122962 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   122963 at_fn_check_prepare_trace "calc.at:713"
   122964 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   122965 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   122966 at_status=$? at_failed=false
   122967 $at_check_filter
   122968 echo stderr:; tee stderr <"$at_stderr"
   122969 at_fn_diff_devnull "$at_stdout" || at_failed=:
   122970 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   122971 $at_failed && at_fn_log_failure
   122972 $at_traceon; }
   122973 
   122974 
   122975 
   122976 # Normalize the observed and expected error messages, depending upon the
   122977 # options.
   122978 # 1. Remove the traces from observed.
   122979 sed '/^Starting/d
   122980 /^Entering/d
   122981 /^Stack/d
   122982 /^Reading/d
   122983 /^Reducing/d
   122984 /^Return/d
   122985 /^Shifting/d
   122986 /^state/d
   122987 /^Cleanup:/d
   122988 /^Error:/d
   122989 /^Next/d
   122990 /^Now/d
   122991 /^Discarding/d
   122992 / \$[0-9$]* = /d
   122993 /^yydestructor:/d' stderr >at-stderr
   122994 mv at-stderr stderr
   122995 # 2. Create the reference error message.
   122996 cat >expout <<'_ATEOF'
   122997 1.3: syntax error, unexpected number
   122998 _ATEOF
   122999 
   123000 # 3. If locations are not used, remove them.
   123001 
   123002 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123003 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123004 mv at-expout expout
   123005 # 5. Check
   123006 { set +x
   123007 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123008 at_fn_check_prepare_trace "calc.at:713"
   123009 ( $at_check_trace; cat stderr
   123010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123011 at_status=$? at_failed=false
   123012 $at_check_filter
   123013 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123014 $at_diff expout "$at_stdout" || at_failed=:
   123015 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123016 $at_failed && at_fn_log_failure
   123017 $at_traceon; }
   123018 
   123019 
   123020 cat >input <<'_ATEOF'
   123021 1//2
   123022 _ATEOF
   123023 
   123024 { set +x
   123025 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123026 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123027 ( $at_check_trace;  $PREPARSER ./calc input
   123028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123029 at_status=$? at_failed=false
   123030 $at_check_filter
   123031 echo stderr:; tee stderr <"$at_stderr"
   123032 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123033 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
   123034 $at_failed && at_fn_log_failure
   123035 $at_traceon; }
   123036 
   123037 { set +x
   123038 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123039 at_fn_check_prepare_trace "calc.at:713"
   123040 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123041 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123042 at_status=$? at_failed=false
   123043 $at_check_filter
   123044 echo stderr:; tee stderr <"$at_stderr"
   123045 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123046 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123047 $at_failed && at_fn_log_failure
   123048 $at_traceon; }
   123049 
   123050 
   123051 
   123052 # Normalize the observed and expected error messages, depending upon the
   123053 # options.
   123054 # 1. Remove the traces from observed.
   123055 sed '/^Starting/d
   123056 /^Entering/d
   123057 /^Stack/d
   123058 /^Reading/d
   123059 /^Reducing/d
   123060 /^Return/d
   123061 /^Shifting/d
   123062 /^state/d
   123063 /^Cleanup:/d
   123064 /^Error:/d
   123065 /^Next/d
   123066 /^Now/d
   123067 /^Discarding/d
   123068 / \$[0-9$]* = /d
   123069 /^yydestructor:/d' stderr >at-stderr
   123070 mv at-stderr stderr
   123071 # 2. Create the reference error message.
   123072 cat >expout <<'_ATEOF'
   123073 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   123074 _ATEOF
   123075 
   123076 # 3. If locations are not used, remove them.
   123077 
   123078 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123079 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123080 mv at-expout expout
   123081 # 5. Check
   123082 { set +x
   123083 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123084 at_fn_check_prepare_trace "calc.at:713"
   123085 ( $at_check_trace; cat stderr
   123086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123087 at_status=$? at_failed=false
   123088 $at_check_filter
   123089 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123090 $at_diff expout "$at_stdout" || at_failed=:
   123091 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123092 $at_failed && at_fn_log_failure
   123093 $at_traceon; }
   123094 
   123095 
   123096 cat >input <<'_ATEOF'
   123097 error
   123098 _ATEOF
   123099 
   123100 { set +x
   123101 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123102 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123103 ( $at_check_trace;  $PREPARSER ./calc input
   123104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123105 at_status=$? at_failed=false
   123106 $at_check_filter
   123107 echo stderr:; tee stderr <"$at_stderr"
   123108 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123109 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
   123110 $at_failed && at_fn_log_failure
   123111 $at_traceon; }
   123112 
   123113 { set +x
   123114 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123115 at_fn_check_prepare_trace "calc.at:713"
   123116 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123118 at_status=$? at_failed=false
   123119 $at_check_filter
   123120 echo stderr:; tee stderr <"$at_stderr"
   123121 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123122 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123123 $at_failed && at_fn_log_failure
   123124 $at_traceon; }
   123125 
   123126 
   123127 
   123128 # Normalize the observed and expected error messages, depending upon the
   123129 # options.
   123130 # 1. Remove the traces from observed.
   123131 sed '/^Starting/d
   123132 /^Entering/d
   123133 /^Stack/d
   123134 /^Reading/d
   123135 /^Reducing/d
   123136 /^Return/d
   123137 /^Shifting/d
   123138 /^state/d
   123139 /^Cleanup:/d
   123140 /^Error:/d
   123141 /^Next/d
   123142 /^Now/d
   123143 /^Discarding/d
   123144 / \$[0-9$]* = /d
   123145 /^yydestructor:/d' stderr >at-stderr
   123146 mv at-stderr stderr
   123147 # 2. Create the reference error message.
   123148 cat >expout <<'_ATEOF'
   123149 1.1: syntax error, unexpected $undefined
   123150 _ATEOF
   123151 
   123152 # 3. If locations are not used, remove them.
   123153 
   123154 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123155 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123156 mv at-expout expout
   123157 # 5. Check
   123158 { set +x
   123159 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123160 at_fn_check_prepare_trace "calc.at:713"
   123161 ( $at_check_trace; cat stderr
   123162 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123163 at_status=$? at_failed=false
   123164 $at_check_filter
   123165 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123166 $at_diff expout "$at_stdout" || at_failed=:
   123167 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123168 $at_failed && at_fn_log_failure
   123169 $at_traceon; }
   123170 
   123171 
   123172 cat >input <<'_ATEOF'
   123173 1 = 2 = 3
   123174 _ATEOF
   123175 
   123176 { set +x
   123177 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123178 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123179 ( $at_check_trace;  $PREPARSER ./calc input
   123180 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123181 at_status=$? at_failed=false
   123182 $at_check_filter
   123183 echo stderr:; tee stderr <"$at_stderr"
   123184 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123185 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
   123186 $at_failed && at_fn_log_failure
   123187 $at_traceon; }
   123188 
   123189 { set +x
   123190 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123191 at_fn_check_prepare_trace "calc.at:713"
   123192 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123193 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123194 at_status=$? at_failed=false
   123195 $at_check_filter
   123196 echo stderr:; tee stderr <"$at_stderr"
   123197 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123198 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123199 $at_failed && at_fn_log_failure
   123200 $at_traceon; }
   123201 
   123202 
   123203 
   123204 # Normalize the observed and expected error messages, depending upon the
   123205 # options.
   123206 # 1. Remove the traces from observed.
   123207 sed '/^Starting/d
   123208 /^Entering/d
   123209 /^Stack/d
   123210 /^Reading/d
   123211 /^Reducing/d
   123212 /^Return/d
   123213 /^Shifting/d
   123214 /^state/d
   123215 /^Cleanup:/d
   123216 /^Error:/d
   123217 /^Next/d
   123218 /^Now/d
   123219 /^Discarding/d
   123220 / \$[0-9$]* = /d
   123221 /^yydestructor:/d' stderr >at-stderr
   123222 mv at-stderr stderr
   123223 # 2. Create the reference error message.
   123224 cat >expout <<'_ATEOF'
   123225 1.7: syntax error, unexpected '='
   123226 _ATEOF
   123227 
   123228 # 3. If locations are not used, remove them.
   123229 
   123230 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123231 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123232 mv at-expout expout
   123233 # 5. Check
   123234 { set +x
   123235 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123236 at_fn_check_prepare_trace "calc.at:713"
   123237 ( $at_check_trace; cat stderr
   123238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123239 at_status=$? at_failed=false
   123240 $at_check_filter
   123241 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123242 $at_diff expout "$at_stdout" || at_failed=:
   123243 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123244 $at_failed && at_fn_log_failure
   123245 $at_traceon; }
   123246 
   123247 
   123248 cat >input <<'_ATEOF'
   123249 
   123250 +1
   123251 _ATEOF
   123252 
   123253 { set +x
   123254 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123255 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123256 ( $at_check_trace;  $PREPARSER ./calc input
   123257 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123258 at_status=$? at_failed=false
   123259 $at_check_filter
   123260 echo stderr:; tee stderr <"$at_stderr"
   123261 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123262 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
   123263 $at_failed && at_fn_log_failure
   123264 $at_traceon; }
   123265 
   123266 { set +x
   123267 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123268 at_fn_check_prepare_trace "calc.at:713"
   123269 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123271 at_status=$? at_failed=false
   123272 $at_check_filter
   123273 echo stderr:; tee stderr <"$at_stderr"
   123274 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123275 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123276 $at_failed && at_fn_log_failure
   123277 $at_traceon; }
   123278 
   123279 
   123280 
   123281 # Normalize the observed and expected error messages, depending upon the
   123282 # options.
   123283 # 1. Remove the traces from observed.
   123284 sed '/^Starting/d
   123285 /^Entering/d
   123286 /^Stack/d
   123287 /^Reading/d
   123288 /^Reducing/d
   123289 /^Return/d
   123290 /^Shifting/d
   123291 /^state/d
   123292 /^Cleanup:/d
   123293 /^Error:/d
   123294 /^Next/d
   123295 /^Now/d
   123296 /^Discarding/d
   123297 / \$[0-9$]* = /d
   123298 /^yydestructor:/d' stderr >at-stderr
   123299 mv at-stderr stderr
   123300 # 2. Create the reference error message.
   123301 cat >expout <<'_ATEOF'
   123302 2.1: syntax error, unexpected '+'
   123303 _ATEOF
   123304 
   123305 # 3. If locations are not used, remove them.
   123306 
   123307 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123308 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123309 mv at-expout expout
   123310 # 5. Check
   123311 { set +x
   123312 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123313 at_fn_check_prepare_trace "calc.at:713"
   123314 ( $at_check_trace; cat stderr
   123315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123316 at_status=$? at_failed=false
   123317 $at_check_filter
   123318 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123319 $at_diff expout "$at_stdout" || at_failed=:
   123320 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123321 $at_failed && at_fn_log_failure
   123322 $at_traceon; }
   123323 
   123324 
   123325 # Exercise error messages with EOF: work on an empty file.
   123326 { set +x
   123327 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc /dev/null"
   123328 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:713"
   123329 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   123330 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123331 at_status=$? at_failed=false
   123332 $at_check_filter
   123333 echo stderr:; tee stderr <"$at_stderr"
   123334 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123335 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
   123336 $at_failed && at_fn_log_failure
   123337 $at_traceon; }
   123338 
   123339 { set +x
   123340 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123341 at_fn_check_prepare_trace "calc.at:713"
   123342 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123343 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123344 at_status=$? at_failed=false
   123345 $at_check_filter
   123346 echo stderr:; tee stderr <"$at_stderr"
   123347 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123348 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123349 $at_failed && at_fn_log_failure
   123350 $at_traceon; }
   123351 
   123352 
   123353 
   123354 # Normalize the observed and expected error messages, depending upon the
   123355 # options.
   123356 # 1. Remove the traces from observed.
   123357 sed '/^Starting/d
   123358 /^Entering/d
   123359 /^Stack/d
   123360 /^Reading/d
   123361 /^Reducing/d
   123362 /^Return/d
   123363 /^Shifting/d
   123364 /^state/d
   123365 /^Cleanup:/d
   123366 /^Error:/d
   123367 /^Next/d
   123368 /^Now/d
   123369 /^Discarding/d
   123370 / \$[0-9$]* = /d
   123371 /^yydestructor:/d' stderr >at-stderr
   123372 mv at-stderr stderr
   123373 # 2. Create the reference error message.
   123374 cat >expout <<'_ATEOF'
   123375 1.1: syntax error, unexpected end of input
   123376 _ATEOF
   123377 
   123378 # 3. If locations are not used, remove them.
   123379 
   123380 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123381 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123382 mv at-expout expout
   123383 # 5. Check
   123384 { set +x
   123385 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123386 at_fn_check_prepare_trace "calc.at:713"
   123387 ( $at_check_trace; cat stderr
   123388 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123389 at_status=$? at_failed=false
   123390 $at_check_filter
   123391 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123392 $at_diff expout "$at_stdout" || at_failed=:
   123393 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123394 $at_failed && at_fn_log_failure
   123395 $at_traceon; }
   123396 
   123397 
   123398 
   123399 # Exercise the error token: without it, we die at the first error,
   123400 # hence be sure to
   123401 #
   123402 # - have several errors which exercise different shift/discardings
   123403 #   - (): nothing to pop, nothing to discard
   123404 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   123405 #   - (* * *): nothing to pop, a lot to discard
   123406 #   - (1 + 2 * *): some to pop and discard
   123407 #
   123408 # - test the action associated to `error'
   123409 #
   123410 # - check the lookahead that triggers an error is not discarded
   123411 #   when we enter error recovery.  Below, the lookahead causing the
   123412 #   first error is ")", which is needed to recover from the error and
   123413 #   produce the "0" that triggers the "0 != 1" error.
   123414 #
   123415 cat >input <<'_ATEOF'
   123416 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   123417 _ATEOF
   123418 
   123419 { set +x
   123420 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123421 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123422 ( $at_check_trace;  $PREPARSER ./calc input
   123423 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123424 at_status=$? at_failed=false
   123425 $at_check_filter
   123426 echo stderr:; tee stderr <"$at_stderr"
   123427 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123428 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123429 $at_failed && at_fn_log_failure
   123430 $at_traceon; }
   123431 
   123432 { set +x
   123433 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123434 at_fn_check_prepare_trace "calc.at:713"
   123435 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123436 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123437 at_status=$? at_failed=false
   123438 $at_check_filter
   123439 echo stderr:; tee stderr <"$at_stderr"
   123440 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123441 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123442 $at_failed && at_fn_log_failure
   123443 $at_traceon; }
   123444 
   123445 
   123446 
   123447 # Normalize the observed and expected error messages, depending upon the
   123448 # options.
   123449 # 1. Remove the traces from observed.
   123450 sed '/^Starting/d
   123451 /^Entering/d
   123452 /^Stack/d
   123453 /^Reading/d
   123454 /^Reducing/d
   123455 /^Return/d
   123456 /^Shifting/d
   123457 /^state/d
   123458 /^Cleanup:/d
   123459 /^Error:/d
   123460 /^Next/d
   123461 /^Now/d
   123462 /^Discarding/d
   123463 / \$[0-9$]* = /d
   123464 /^yydestructor:/d' stderr >at-stderr
   123465 mv at-stderr stderr
   123466 # 2. Create the reference error message.
   123467 cat >expout <<'_ATEOF'
   123468 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   123469 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   123470 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   123471 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   123472 calc: error: 4444 != 1
   123473 _ATEOF
   123474 
   123475 # 3. If locations are not used, remove them.
   123476 
   123477 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123478 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123479 mv at-expout expout
   123480 # 5. Check
   123481 { set +x
   123482 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123483 at_fn_check_prepare_trace "calc.at:713"
   123484 ( $at_check_trace; cat stderr
   123485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123486 at_status=$? at_failed=false
   123487 $at_check_filter
   123488 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123489 $at_diff expout "$at_stdout" || at_failed=:
   123490 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123491 $at_failed && at_fn_log_failure
   123492 $at_traceon; }
   123493 
   123494 
   123495 
   123496 # The same, but this time exercising explicitly triggered syntax errors.
   123497 # POSIX says the lookahead causing the error should not be discarded.
   123498 cat >input <<'_ATEOF'
   123499 (!) + (1 2) = 1
   123500 _ATEOF
   123501 
   123502 { set +x
   123503 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123504 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123505 ( $at_check_trace;  $PREPARSER ./calc input
   123506 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123507 at_status=$? at_failed=false
   123508 $at_check_filter
   123509 echo stderr:; tee stderr <"$at_stderr"
   123510 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123511 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123512 $at_failed && at_fn_log_failure
   123513 $at_traceon; }
   123514 
   123515 { set +x
   123516 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123517 at_fn_check_prepare_trace "calc.at:713"
   123518 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123519 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123520 at_status=$? at_failed=false
   123521 $at_check_filter
   123522 echo stderr:; tee stderr <"$at_stderr"
   123523 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123524 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123525 $at_failed && at_fn_log_failure
   123526 $at_traceon; }
   123527 
   123528 
   123529 
   123530 # Normalize the observed and expected error messages, depending upon the
   123531 # options.
   123532 # 1. Remove the traces from observed.
   123533 sed '/^Starting/d
   123534 /^Entering/d
   123535 /^Stack/d
   123536 /^Reading/d
   123537 /^Reducing/d
   123538 /^Return/d
   123539 /^Shifting/d
   123540 /^state/d
   123541 /^Cleanup:/d
   123542 /^Error:/d
   123543 /^Next/d
   123544 /^Now/d
   123545 /^Discarding/d
   123546 / \$[0-9$]* = /d
   123547 /^yydestructor:/d' stderr >at-stderr
   123548 mv at-stderr stderr
   123549 # 2. Create the reference error message.
   123550 cat >expout <<'_ATEOF'
   123551 1.10: syntax error, unexpected number
   123552 calc: error: 2222 != 1
   123553 _ATEOF
   123554 
   123555 # 3. If locations are not used, remove them.
   123556 
   123557 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123558 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123559 mv at-expout expout
   123560 # 5. Check
   123561 { set +x
   123562 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123563 at_fn_check_prepare_trace "calc.at:713"
   123564 ( $at_check_trace; cat stderr
   123565 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123566 at_status=$? at_failed=false
   123567 $at_check_filter
   123568 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123569 $at_diff expout "$at_stdout" || at_failed=:
   123570 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123571 $at_failed && at_fn_log_failure
   123572 $at_traceon; }
   123573 
   123574 
   123575 cat >input <<'_ATEOF'
   123576 (- *) + (1 2) = 1
   123577 _ATEOF
   123578 
   123579 { set +x
   123580 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123581 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123582 ( $at_check_trace;  $PREPARSER ./calc input
   123583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123584 at_status=$? at_failed=false
   123585 $at_check_filter
   123586 echo stderr:; tee stderr <"$at_stderr"
   123587 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123588 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123589 $at_failed && at_fn_log_failure
   123590 $at_traceon; }
   123591 
   123592 { set +x
   123593 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123594 at_fn_check_prepare_trace "calc.at:713"
   123595 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123597 at_status=$? at_failed=false
   123598 $at_check_filter
   123599 echo stderr:; tee stderr <"$at_stderr"
   123600 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123601 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123602 $at_failed && at_fn_log_failure
   123603 $at_traceon; }
   123604 
   123605 
   123606 
   123607 # Normalize the observed and expected error messages, depending upon the
   123608 # options.
   123609 # 1. Remove the traces from observed.
   123610 sed '/^Starting/d
   123611 /^Entering/d
   123612 /^Stack/d
   123613 /^Reading/d
   123614 /^Reducing/d
   123615 /^Return/d
   123616 /^Shifting/d
   123617 /^state/d
   123618 /^Cleanup:/d
   123619 /^Error:/d
   123620 /^Next/d
   123621 /^Now/d
   123622 /^Discarding/d
   123623 / \$[0-9$]* = /d
   123624 /^yydestructor:/d' stderr >at-stderr
   123625 mv at-stderr stderr
   123626 # 2. Create the reference error message.
   123627 cat >expout <<'_ATEOF'
   123628 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   123629 1.12: syntax error, unexpected number
   123630 calc: error: 2222 != 1
   123631 _ATEOF
   123632 
   123633 # 3. If locations are not used, remove them.
   123634 
   123635 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123636 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123637 mv at-expout expout
   123638 # 5. Check
   123639 { set +x
   123640 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123641 at_fn_check_prepare_trace "calc.at:713"
   123642 ( $at_check_trace; cat stderr
   123643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123644 at_status=$? at_failed=false
   123645 $at_check_filter
   123646 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123647 $at_diff expout "$at_stdout" || at_failed=:
   123648 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123649 $at_failed && at_fn_log_failure
   123650 $at_traceon; }
   123651 
   123652 
   123653 
   123654 # Check that yyerrok works properly: second error is not reported,
   123655 # third and fourth are.  Parse status is succesfull.
   123656 cat >input <<'_ATEOF'
   123657 (* *) + (*) + (*)
   123658 _ATEOF
   123659 
   123660 { set +x
   123661 $as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
   123662 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
   123663 ( $at_check_trace;  $PREPARSER ./calc input
   123664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123665 at_status=$? at_failed=false
   123666 $at_check_filter
   123667 echo stderr:; tee stderr <"$at_stderr"
   123668 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123669 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123670 $at_failed && at_fn_log_failure
   123671 $at_traceon; }
   123672 
   123673 { set +x
   123674 $as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   123675 at_fn_check_prepare_trace "calc.at:713"
   123676 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   123677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123678 at_status=$? at_failed=false
   123679 $at_check_filter
   123680 echo stderr:; tee stderr <"$at_stderr"
   123681 at_fn_diff_devnull "$at_stdout" || at_failed=:
   123682 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123683 $at_failed && at_fn_log_failure
   123684 $at_traceon; }
   123685 
   123686 
   123687 
   123688 # Normalize the observed and expected error messages, depending upon the
   123689 # options.
   123690 # 1. Remove the traces from observed.
   123691 sed '/^Starting/d
   123692 /^Entering/d
   123693 /^Stack/d
   123694 /^Reading/d
   123695 /^Reducing/d
   123696 /^Return/d
   123697 /^Shifting/d
   123698 /^state/d
   123699 /^Cleanup:/d
   123700 /^Error:/d
   123701 /^Next/d
   123702 /^Now/d
   123703 /^Discarding/d
   123704 / \$[0-9$]* = /d
   123705 /^yydestructor:/d' stderr >at-stderr
   123706 mv at-stderr stderr
   123707 # 2. Create the reference error message.
   123708 cat >expout <<'_ATEOF'
   123709 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   123710 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   123711 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   123712 _ATEOF
   123713 
   123714 # 3. If locations are not used, remove them.
   123715 
   123716 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   123717 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   123718 mv at-expout expout
   123719 # 5. Check
   123720 { set +x
   123721 $as_echo "$at_srcdir/calc.at:713: cat stderr"
   123722 at_fn_check_prepare_trace "calc.at:713"
   123723 ( $at_check_trace; cat stderr
   123724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   123725 at_status=$? at_failed=false
   123726 $at_check_filter
   123727 at_fn_diff_devnull "$at_stderr" || at_failed=:
   123728 $at_diff expout "$at_stdout" || at_failed=:
   123729 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
   123730 $at_failed && at_fn_log_failure
   123731 $at_traceon; }
   123732 
   123733 
   123734 
   123735 
   123736 
   123737   set +x
   123738   $at_times_p && times >"$at_times_file"
   123739 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   123740 read at_status <"$at_status_file"
   123741 #AT_STOP_249
   123742 #AT_START_250
   123743 at_fn_group_banner 250 'calc.at:714' \
   123744   "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14
   123745 at_xfail=no
   123746 (
   123747   $as_echo "250. $at_setup_line: testing $at_desc ..."
   123748   $at_traceon
   123749 
   123750 
   123751 
   123752 
   123753 
   123754 
   123755 
   123756 
   123757 
   123758 
   123759 cat >calc.y <<'_ATEOF'
   123760 %code top {
   123761 #include <config.h>
   123762 /* We don't need perfect functions for these tests. */
   123763 #undef malloc
   123764 #undef memcmp
   123765 #undef realloc
   123766 }
   123767 
   123768 /* Infix notation calculator--calc */
   123769 %language "C++" %glr-parser %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc
   123770 %define global_tokens_and_yystype
   123771 %code requires
   123772 {
   123773 
   123774   /* Exercise pre-prologue dependency to %union.  */
   123775   typedef int semantic_value;
   123776 }
   123777 
   123778 /* Exercise %union. */
   123779 %union
   123780 {
   123781   semantic_value ival;
   123782 };
   123783 %printer { yyoutput << $$; } <ival>;
   123784 
   123785 %code provides
   123786 {
   123787   #include <stdio.h>
   123788   /* The input.  */
   123789   extern FILE *input;
   123790   extern semantic_value global_result;
   123791   extern int global_count;
   123792 }
   123793 
   123794 %code
   123795 {
   123796 #include <assert.h>
   123797 #include <string.h>
   123798 #define USE(Var)
   123799 
   123800 FILE *input;
   123801 static int power (int base, int exponent);
   123802 
   123803 
   123804 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   123805 }
   123806 
   123807 
   123808 
   123809 /* Bison Declarations */
   123810 %token CALC_EOF 0 "end of input"
   123811 %token <ival> NUM "number"
   123812 %type  <ival> exp
   123813 
   123814 %nonassoc '=' /* comparison            */
   123815 %left '-' '+'
   123816 %left '*' '/'
   123817 %left NEG     /* negation--unary minus */
   123818 %right '^'    /* exponentiation        */
   123819 
   123820 /* Grammar follows */
   123821 %%
   123822 input:
   123823   line
   123824 | input line         {  }
   123825 ;
   123826 
   123827 line:
   123828   '\n'
   123829 | exp '\n'           { USE ($1); }
   123830 ;
   123831 
   123832 exp:
   123833   NUM                { $$ = $1;             }
   123834 | exp '=' exp
   123835   {
   123836     if ($1 != $3)
   123837       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   123838     $$ = $1;
   123839   }
   123840 | exp '+' exp        { $$ = $1 + $3;        }
   123841 | exp '-' exp        { $$ = $1 - $3;        }
   123842 | exp '*' exp        { $$ = $1 * $3;        }
   123843 | exp '/' exp        { $$ = $1 / $3;        }
   123844 | '-' exp  %prec NEG { $$ = -$2;            }
   123845 | exp '^' exp        { $$ = power ($1, $3); }
   123846 | '(' exp ')'        { $$ = $2;             }
   123847 | '(' error ')'      { $$ = 1111; yyerrok;  }
   123848 | '!'                { $$ = 0; YYERROR;     }
   123849 | '-' error          { $$ = 0; YYERROR;     }
   123850 ;
   123851 %%
   123852 
   123853 static int
   123854 power (int base, int exponent)
   123855 {
   123856   int res = 1;
   123857   assert (0 <= exponent);
   123858   for (/* Niente */; exponent; --exponent)
   123859     res *= base;
   123860   return res;
   123861 }
   123862 
   123863 
   123864 /* A C++ error reporting function.  */
   123865 void
   123866 calc::parser::error (const location_type& l, const std::string& m)
   123867 {
   123868   (void) l;
   123869   std::cerr << l << ": " << m << std::endl;
   123870 }
   123871 _ATEOF
   123872 
   123873 
   123874 
   123875 cat >calc-lex.cc <<'_ATEOF'
   123876 #include <config.h>
   123877 /* We don't need perfect functions for these tests. */
   123878 #undef malloc
   123879 #undef memcmp
   123880 #undef realloc
   123881 
   123882 #include "calc.hh"
   123883 
   123884 #include <ctype.h>
   123885 
   123886 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   123887 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   123888 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   123889 
   123890 
   123891 static calc::parser::location_type last_yylloc;
   123892 
   123893 static int
   123894 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   123895 {
   123896   int res = getc (input);
   123897   (void) lvalp;(void) llocp;
   123898 
   123899   last_yylloc = (*llocp);
   123900   if (res == '\n')
   123901     {
   123902       (*llocp).end.line++;
   123903       (*llocp).end.column = 1;
   123904     }
   123905   else
   123906     (*llocp).end.column++;
   123907 
   123908   return res;
   123909 }
   123910 
   123911 static void
   123912 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   123913 {
   123914   (void) lvalp;(void) llocp;
   123915 
   123916   /* Wrong when C == `\n'. */
   123917   (*llocp) = last_yylloc;
   123918 
   123919   ungetc (c, input);
   123920 }
   123921 
   123922 static int
   123923 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   123924 {
   123925   int c = get_char (lvalp, llocp);
   123926   int sign = 1;
   123927   int n = 0;
   123928 
   123929   (void) lvalp;(void) llocp;
   123930   if (c == '-')
   123931     {
   123932       c = get_char (lvalp, llocp);
   123933       sign = -1;
   123934     }
   123935 
   123936   while (isdigit (c))
   123937     {
   123938       n = 10 * n + (c - '0');
   123939       c = get_char (lvalp, llocp);
   123940     }
   123941 
   123942   unget_char (lvalp, llocp,  c);
   123943 
   123944   return sign * n;
   123945 }
   123946 
   123947 
   123948 /*---------------------------------------------------------------.
   123949 | Lexical analyzer returns an integer on the stack and the token |
   123950 | NUM, or the ASCII character read if not a number.  Skips all   |
   123951 | blanks and tabs, returns 0 for EOF.                            |
   123952 `---------------------------------------------------------------*/
   123953 
   123954 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   123955 {
   123956   int c;
   123957   /* Skip current token, then white spaces.  */
   123958   do
   123959     {
   123960      (*llocp).begin.column = (*llocp).end.column;
   123961       (*llocp).begin.line   = (*llocp).end.line;
   123962 
   123963     }
   123964   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   123965 
   123966   /* process numbers   */
   123967   if (c == '.' || isdigit (c))
   123968     {
   123969       unget_char (lvalp, llocp,  c);
   123970       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   123971       return NUM;
   123972     }
   123973 
   123974   /* Return end-of-file.  */
   123975   if (c == EOF)
   123976     return CALC_EOF;
   123977 
   123978   /* Return single chars. */
   123979   return c;
   123980 }
   123981 _ATEOF
   123982 
   123983 
   123984 cat >calc-main.cc <<'_ATEOF'
   123985 #include <config.h>
   123986 /* We don't need perfect functions for these tests. */
   123987 #undef malloc
   123988 #undef memcmp
   123989 #undef realloc
   123990 
   123991 #include "calc.hh"
   123992 
   123993 #include <assert.h>
   123994 #if HAVE_UNISTD_H
   123995 # include <unistd.h>
   123996 #else
   123997 # undef alarm
   123998 # define alarm(seconds) /* empty */
   123999 #endif
   124000 
   124001 
   124002 /* A C++ calcparse that simulates the C signature.  */
   124003 int
   124004 calcparse ()
   124005 {
   124006   calc::parser parser;
   124007 #if YYDEBUG
   124008   parser.set_debug_level (1);
   124009 #endif
   124010   return parser.parse ();
   124011 }
   124012 
   124013 
   124014 semantic_value global_result = 0;
   124015 int global_count = 0;
   124016 
   124017 /* A C main function.  */
   124018 int
   124019 main (int argc, const char **argv)
   124020 {
   124021   semantic_value result = 0;
   124022   int count = 0;
   124023   int status;
   124024 
   124025   /* This used to be alarm (10), but that isn't enough time for
   124026      a July 1995 vintage DEC Alphastation 200 4/100 system,
   124027      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   124028   alarm (100);
   124029 
   124030   if (argc == 2)
   124031     input = fopen (argv[1], "r");
   124032   else
   124033     input = stdin;
   124034 
   124035   if (!input)
   124036     {
   124037       perror (argv[1]);
   124038       return 3;
   124039     }
   124040 
   124041 
   124042   status = calcparse ();
   124043   if (fclose (input))
   124044     perror ("fclose");
   124045   assert (global_result == result);
   124046   assert (global_count == count);
   124047   return status;
   124048 }
   124049 _ATEOF
   124050 
   124051 
   124052 
   124053 
   124054 
   124055 
   124056 
   124057 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   124058   at_save_special_files
   124059   mkdir xml-tests
   124060     # Don't combine these Bison invocations since we want to be sure that
   124061   # --report=all isn't required to get the full XML file.
   124062   { set +x
   124063 $as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   124064                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   124065 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714"
   124066 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   124067                   --graph=xml-tests/test.dot -o calc.cc calc.y
   124068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124069 at_status=$? at_failed=false
   124070 $at_check_filter
   124071 echo stderr:; cat "$at_stderr"
   124072 echo stdout:; cat "$at_stdout"
   124073 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124074 $at_failed && at_fn_log_failure
   124075 $at_traceon; }
   124076 
   124077   { set +x
   124078 $as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   124079 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:714"
   124080 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   124081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124082 at_status=$? at_failed=false
   124083 $at_check_filter
   124084 echo stderr:; cat "$at_stderr"
   124085 echo stdout:; cat "$at_stdout"
   124086 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124087 $at_failed && at_fn_log_failure
   124088 $at_traceon; }
   124089 
   124090     cp xml-tests/test.output expout
   124091   { set +x
   124092 $as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\
   124093              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   124094              xml-tests/test.xml"
   124095 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714"
   124096 ( $at_check_trace; $XSLTPROC \
   124097              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   124098              xml-tests/test.xml
   124099 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124100 at_status=$? at_failed=false
   124101 $at_check_filter
   124102 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124103 $at_diff expout "$at_stdout" || at_failed=:
   124104 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124105 $at_failed && at_fn_log_failure
   124106 $at_traceon; }
   124107 
   124108   sort xml-tests/test.dot > expout
   124109   { set +x
   124110 $as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\
   124111              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   124112              xml-tests/test.xml | sort"
   124113 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714"
   124114 ( $at_check_trace; $XSLTPROC \
   124115              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   124116              xml-tests/test.xml | sort
   124117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124118 at_status=$? at_failed=false
   124119 $at_check_filter
   124120 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124121 $at_diff expout "$at_stdout" || at_failed=:
   124122 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124123 $at_failed && at_fn_log_failure
   124124 $at_traceon; }
   124125 
   124126   rm -rf xml-tests expout
   124127   at_restore_special_files
   124128 fi
   124129 { set +x
   124130 $as_echo "$at_srcdir/calc.at:714: bison -o calc.cc calc.y"
   124131 at_fn_check_prepare_trace "calc.at:714"
   124132 ( $at_check_trace; bison -o calc.cc calc.y
   124133 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124134 at_status=$? at_failed=false
   124135 $at_check_filter
   124136 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124137 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124138 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124139 $at_failed && at_fn_log_failure
   124140 $at_traceon; }
   124141 
   124142 
   124143 
   124144 { set +x
   124145 $as_echo "$at_srcdir/calc.at:714: \$BISON_CXX_WORKS"
   124146 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:714"
   124147 ( $at_check_trace; $BISON_CXX_WORKS
   124148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124149 at_status=$? at_failed=false
   124150 $at_check_filter
   124151 echo stderr:; cat "$at_stderr"
   124152 echo stdout:; cat "$at_stdout"
   124153 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124154 $at_failed && at_fn_log_failure
   124155 $at_traceon; }
   124156 
   124157 { set +x
   124158 $as_echo "$at_srcdir/calc.at:714: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   124159 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:714"
   124160 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   124161 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124162 at_status=$? at_failed=false
   124163 $at_check_filter
   124164 echo stderr:; cat "$at_stderr"
   124165 echo stdout:; cat "$at_stdout"
   124166 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124167 $at_failed && at_fn_log_failure
   124168 $at_traceon; }
   124169 
   124170 
   124171 { set +x
   124172 $as_echo "$at_srcdir/calc.at:714: \$PERL -ne '
   124173   chomp;
   124174   print \"\$.: {\$_}\\n\"
   124175     if (# No starting/ending empty lines.
   124176         (eof || \$. == 1) && /^\\s*\$/
   124177         # No trailing space.  FIXME: not ready for \"maint\".
   124178         # || /\\s\$/
   124179         )' calc.cc
   124180 "
   124181 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714"
   124182 ( $at_check_trace; $PERL -ne '
   124183   chomp;
   124184   print "$.: {$_}\n"
   124185     if (# No starting/ending empty lines.
   124186         (eof || $. == 1) && /^\s*$/
   124187         # No trailing space.  FIXME: not ready for "maint".
   124188         # || /\s$/
   124189         )' calc.cc
   124190 
   124191 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124192 at_status=$? at_failed=false
   124193 $at_check_filter
   124194 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124195 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124196 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124197 $at_failed && at_fn_log_failure
   124198 $at_traceon; }
   124199 
   124200 { set +x
   124201 $as_echo "$at_srcdir/calc.at:714: \$PERL -ne '
   124202   chomp;
   124203   print \"\$.: {\$_}\\n\"
   124204     if (# No starting/ending empty lines.
   124205         (eof || \$. == 1) && /^\\s*\$/
   124206         # No trailing space.  FIXME: not ready for \"maint\".
   124207         # || /\\s\$/
   124208         )' calc.hh
   124209 "
   124210 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714"
   124211 ( $at_check_trace; $PERL -ne '
   124212   chomp;
   124213   print "$.: {$_}\n"
   124214     if (# No starting/ending empty lines.
   124215         (eof || $. == 1) && /^\s*$/
   124216         # No trailing space.  FIXME: not ready for "maint".
   124217         # || /\s$/
   124218         )' calc.hh
   124219 
   124220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124221 at_status=$? at_failed=false
   124222 $at_check_filter
   124223 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124224 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124225 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124226 $at_failed && at_fn_log_failure
   124227 $at_traceon; }
   124228 
   124229 
   124230 # Test the priorities.
   124231 cat >input <<'_ATEOF'
   124232 1 + 2 * 3 = 7
   124233 1 + 2 * -3 = -5
   124234 
   124235 -1^2 = -1
   124236 (-1)^2 = 1
   124237 
   124238 ---1 = -1
   124239 
   124240 1 - 2 - 3 = -4
   124241 1 - (2 - 3) = 2
   124242 
   124243 2^2^3 = 256
   124244 (2^2)^3 = 64
   124245 _ATEOF
   124246 
   124247 { set +x
   124248 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124249 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124250 ( $at_check_trace;  $PREPARSER ./calc input
   124251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124252 at_status=$? at_failed=false
   124253 $at_check_filter
   124254 echo stderr:; tee stderr <"$at_stderr"
   124255 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124256 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124257 $at_failed && at_fn_log_failure
   124258 $at_traceon; }
   124259 
   124260 { set +x
   124261 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124262 at_fn_check_prepare_trace "calc.at:714"
   124263 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124265 at_status=$? at_failed=false
   124266 $at_check_filter
   124267 echo stderr:; tee stderr <"$at_stderr"
   124268 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124269 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124270 $at_failed && at_fn_log_failure
   124271 $at_traceon; }
   124272 
   124273 
   124274 
   124275 
   124276 # Some syntax errors.
   124277 cat >input <<'_ATEOF'
   124278 1 2
   124279 _ATEOF
   124280 
   124281 { set +x
   124282 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124283 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124284 ( $at_check_trace;  $PREPARSER ./calc input
   124285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124286 at_status=$? at_failed=false
   124287 $at_check_filter
   124288 echo stderr:; tee stderr <"$at_stderr"
   124289 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124290 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
   124291 $at_failed && at_fn_log_failure
   124292 $at_traceon; }
   124293 
   124294 { set +x
   124295 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124296 at_fn_check_prepare_trace "calc.at:714"
   124297 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124298 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124299 at_status=$? at_failed=false
   124300 $at_check_filter
   124301 echo stderr:; tee stderr <"$at_stderr"
   124302 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124303 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124304 $at_failed && at_fn_log_failure
   124305 $at_traceon; }
   124306 
   124307 
   124308 
   124309 # Normalize the observed and expected error messages, depending upon the
   124310 # options.
   124311 # 1. Remove the traces from observed.
   124312 sed '/^Starting/d
   124313 /^Entering/d
   124314 /^Stack/d
   124315 /^Reading/d
   124316 /^Reducing/d
   124317 /^Return/d
   124318 /^Shifting/d
   124319 /^state/d
   124320 /^Cleanup:/d
   124321 /^Error:/d
   124322 /^Next/d
   124323 /^Now/d
   124324 /^Discarding/d
   124325 / \$[0-9$]* = /d
   124326 /^yydestructor:/d' stderr >at-stderr
   124327 mv at-stderr stderr
   124328 # 2. Create the reference error message.
   124329 cat >expout <<'_ATEOF'
   124330 1.3: syntax error, unexpected number
   124331 _ATEOF
   124332 
   124333 # 3. If locations are not used, remove them.
   124334 
   124335 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124336 
   124337 # 5. Check
   124338 { set +x
   124339 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124340 at_fn_check_prepare_trace "calc.at:714"
   124341 ( $at_check_trace; cat stderr
   124342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124343 at_status=$? at_failed=false
   124344 $at_check_filter
   124345 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124346 $at_diff expout "$at_stdout" || at_failed=:
   124347 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124348 $at_failed && at_fn_log_failure
   124349 $at_traceon; }
   124350 
   124351 
   124352 cat >input <<'_ATEOF'
   124353 1//2
   124354 _ATEOF
   124355 
   124356 { set +x
   124357 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124358 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124359 ( $at_check_trace;  $PREPARSER ./calc input
   124360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124361 at_status=$? at_failed=false
   124362 $at_check_filter
   124363 echo stderr:; tee stderr <"$at_stderr"
   124364 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124365 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
   124366 $at_failed && at_fn_log_failure
   124367 $at_traceon; }
   124368 
   124369 { set +x
   124370 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124371 at_fn_check_prepare_trace "calc.at:714"
   124372 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124374 at_status=$? at_failed=false
   124375 $at_check_filter
   124376 echo stderr:; tee stderr <"$at_stderr"
   124377 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124378 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124379 $at_failed && at_fn_log_failure
   124380 $at_traceon; }
   124381 
   124382 
   124383 
   124384 # Normalize the observed and expected error messages, depending upon the
   124385 # options.
   124386 # 1. Remove the traces from observed.
   124387 sed '/^Starting/d
   124388 /^Entering/d
   124389 /^Stack/d
   124390 /^Reading/d
   124391 /^Reducing/d
   124392 /^Return/d
   124393 /^Shifting/d
   124394 /^state/d
   124395 /^Cleanup:/d
   124396 /^Error:/d
   124397 /^Next/d
   124398 /^Now/d
   124399 /^Discarding/d
   124400 / \$[0-9$]* = /d
   124401 /^yydestructor:/d' stderr >at-stderr
   124402 mv at-stderr stderr
   124403 # 2. Create the reference error message.
   124404 cat >expout <<'_ATEOF'
   124405 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   124406 _ATEOF
   124407 
   124408 # 3. If locations are not used, remove them.
   124409 
   124410 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124411 
   124412 # 5. Check
   124413 { set +x
   124414 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124415 at_fn_check_prepare_trace "calc.at:714"
   124416 ( $at_check_trace; cat stderr
   124417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124418 at_status=$? at_failed=false
   124419 $at_check_filter
   124420 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124421 $at_diff expout "$at_stdout" || at_failed=:
   124422 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124423 $at_failed && at_fn_log_failure
   124424 $at_traceon; }
   124425 
   124426 
   124427 cat >input <<'_ATEOF'
   124428 error
   124429 _ATEOF
   124430 
   124431 { set +x
   124432 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124433 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124434 ( $at_check_trace;  $PREPARSER ./calc input
   124435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124436 at_status=$? at_failed=false
   124437 $at_check_filter
   124438 echo stderr:; tee stderr <"$at_stderr"
   124439 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124440 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
   124441 $at_failed && at_fn_log_failure
   124442 $at_traceon; }
   124443 
   124444 { set +x
   124445 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124446 at_fn_check_prepare_trace "calc.at:714"
   124447 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124448 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124449 at_status=$? at_failed=false
   124450 $at_check_filter
   124451 echo stderr:; tee stderr <"$at_stderr"
   124452 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124453 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124454 $at_failed && at_fn_log_failure
   124455 $at_traceon; }
   124456 
   124457 
   124458 
   124459 # Normalize the observed and expected error messages, depending upon the
   124460 # options.
   124461 # 1. Remove the traces from observed.
   124462 sed '/^Starting/d
   124463 /^Entering/d
   124464 /^Stack/d
   124465 /^Reading/d
   124466 /^Reducing/d
   124467 /^Return/d
   124468 /^Shifting/d
   124469 /^state/d
   124470 /^Cleanup:/d
   124471 /^Error:/d
   124472 /^Next/d
   124473 /^Now/d
   124474 /^Discarding/d
   124475 / \$[0-9$]* = /d
   124476 /^yydestructor:/d' stderr >at-stderr
   124477 mv at-stderr stderr
   124478 # 2. Create the reference error message.
   124479 cat >expout <<'_ATEOF'
   124480 1.1: syntax error, unexpected $undefined
   124481 _ATEOF
   124482 
   124483 # 3. If locations are not used, remove them.
   124484 
   124485 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124486 
   124487 # 5. Check
   124488 { set +x
   124489 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124490 at_fn_check_prepare_trace "calc.at:714"
   124491 ( $at_check_trace; cat stderr
   124492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124493 at_status=$? at_failed=false
   124494 $at_check_filter
   124495 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124496 $at_diff expout "$at_stdout" || at_failed=:
   124497 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124498 $at_failed && at_fn_log_failure
   124499 $at_traceon; }
   124500 
   124501 
   124502 cat >input <<'_ATEOF'
   124503 1 = 2 = 3
   124504 _ATEOF
   124505 
   124506 { set +x
   124507 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124508 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124509 ( $at_check_trace;  $PREPARSER ./calc input
   124510 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124511 at_status=$? at_failed=false
   124512 $at_check_filter
   124513 echo stderr:; tee stderr <"$at_stderr"
   124514 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124515 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
   124516 $at_failed && at_fn_log_failure
   124517 $at_traceon; }
   124518 
   124519 { set +x
   124520 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124521 at_fn_check_prepare_trace "calc.at:714"
   124522 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124523 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124524 at_status=$? at_failed=false
   124525 $at_check_filter
   124526 echo stderr:; tee stderr <"$at_stderr"
   124527 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124528 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124529 $at_failed && at_fn_log_failure
   124530 $at_traceon; }
   124531 
   124532 
   124533 
   124534 # Normalize the observed and expected error messages, depending upon the
   124535 # options.
   124536 # 1. Remove the traces from observed.
   124537 sed '/^Starting/d
   124538 /^Entering/d
   124539 /^Stack/d
   124540 /^Reading/d
   124541 /^Reducing/d
   124542 /^Return/d
   124543 /^Shifting/d
   124544 /^state/d
   124545 /^Cleanup:/d
   124546 /^Error:/d
   124547 /^Next/d
   124548 /^Now/d
   124549 /^Discarding/d
   124550 / \$[0-9$]* = /d
   124551 /^yydestructor:/d' stderr >at-stderr
   124552 mv at-stderr stderr
   124553 # 2. Create the reference error message.
   124554 cat >expout <<'_ATEOF'
   124555 1.7: syntax error, unexpected '='
   124556 _ATEOF
   124557 
   124558 # 3. If locations are not used, remove them.
   124559 
   124560 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124561 
   124562 # 5. Check
   124563 { set +x
   124564 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124565 at_fn_check_prepare_trace "calc.at:714"
   124566 ( $at_check_trace; cat stderr
   124567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124568 at_status=$? at_failed=false
   124569 $at_check_filter
   124570 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124571 $at_diff expout "$at_stdout" || at_failed=:
   124572 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124573 $at_failed && at_fn_log_failure
   124574 $at_traceon; }
   124575 
   124576 
   124577 cat >input <<'_ATEOF'
   124578 
   124579 +1
   124580 _ATEOF
   124581 
   124582 { set +x
   124583 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124584 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124585 ( $at_check_trace;  $PREPARSER ./calc input
   124586 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124587 at_status=$? at_failed=false
   124588 $at_check_filter
   124589 echo stderr:; tee stderr <"$at_stderr"
   124590 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124591 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
   124592 $at_failed && at_fn_log_failure
   124593 $at_traceon; }
   124594 
   124595 { set +x
   124596 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124597 at_fn_check_prepare_trace "calc.at:714"
   124598 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124600 at_status=$? at_failed=false
   124601 $at_check_filter
   124602 echo stderr:; tee stderr <"$at_stderr"
   124603 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124604 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124605 $at_failed && at_fn_log_failure
   124606 $at_traceon; }
   124607 
   124608 
   124609 
   124610 # Normalize the observed and expected error messages, depending upon the
   124611 # options.
   124612 # 1. Remove the traces from observed.
   124613 sed '/^Starting/d
   124614 /^Entering/d
   124615 /^Stack/d
   124616 /^Reading/d
   124617 /^Reducing/d
   124618 /^Return/d
   124619 /^Shifting/d
   124620 /^state/d
   124621 /^Cleanup:/d
   124622 /^Error:/d
   124623 /^Next/d
   124624 /^Now/d
   124625 /^Discarding/d
   124626 / \$[0-9$]* = /d
   124627 /^yydestructor:/d' stderr >at-stderr
   124628 mv at-stderr stderr
   124629 # 2. Create the reference error message.
   124630 cat >expout <<'_ATEOF'
   124631 2.1: syntax error, unexpected '+'
   124632 _ATEOF
   124633 
   124634 # 3. If locations are not used, remove them.
   124635 
   124636 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124637 
   124638 # 5. Check
   124639 { set +x
   124640 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124641 at_fn_check_prepare_trace "calc.at:714"
   124642 ( $at_check_trace; cat stderr
   124643 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124644 at_status=$? at_failed=false
   124645 $at_check_filter
   124646 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124647 $at_diff expout "$at_stdout" || at_failed=:
   124648 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124649 $at_failed && at_fn_log_failure
   124650 $at_traceon; }
   124651 
   124652 
   124653 # Exercise error messages with EOF: work on an empty file.
   124654 { set +x
   124655 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc /dev/null"
   124656 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:714"
   124657 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   124658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124659 at_status=$? at_failed=false
   124660 $at_check_filter
   124661 echo stderr:; tee stderr <"$at_stderr"
   124662 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124663 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
   124664 $at_failed && at_fn_log_failure
   124665 $at_traceon; }
   124666 
   124667 { set +x
   124668 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124669 at_fn_check_prepare_trace "calc.at:714"
   124670 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124672 at_status=$? at_failed=false
   124673 $at_check_filter
   124674 echo stderr:; tee stderr <"$at_stderr"
   124675 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124676 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124677 $at_failed && at_fn_log_failure
   124678 $at_traceon; }
   124679 
   124680 
   124681 
   124682 # Normalize the observed and expected error messages, depending upon the
   124683 # options.
   124684 # 1. Remove the traces from observed.
   124685 sed '/^Starting/d
   124686 /^Entering/d
   124687 /^Stack/d
   124688 /^Reading/d
   124689 /^Reducing/d
   124690 /^Return/d
   124691 /^Shifting/d
   124692 /^state/d
   124693 /^Cleanup:/d
   124694 /^Error:/d
   124695 /^Next/d
   124696 /^Now/d
   124697 /^Discarding/d
   124698 / \$[0-9$]* = /d
   124699 /^yydestructor:/d' stderr >at-stderr
   124700 mv at-stderr stderr
   124701 # 2. Create the reference error message.
   124702 cat >expout <<'_ATEOF'
   124703 1.1: syntax error, unexpected end of input
   124704 _ATEOF
   124705 
   124706 # 3. If locations are not used, remove them.
   124707 
   124708 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124709 
   124710 # 5. Check
   124711 { set +x
   124712 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124713 at_fn_check_prepare_trace "calc.at:714"
   124714 ( $at_check_trace; cat stderr
   124715 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124716 at_status=$? at_failed=false
   124717 $at_check_filter
   124718 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124719 $at_diff expout "$at_stdout" || at_failed=:
   124720 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124721 $at_failed && at_fn_log_failure
   124722 $at_traceon; }
   124723 
   124724 
   124725 
   124726 # Exercise the error token: without it, we die at the first error,
   124727 # hence be sure to
   124728 #
   124729 # - have several errors which exercise different shift/discardings
   124730 #   - (): nothing to pop, nothing to discard
   124731 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   124732 #   - (* * *): nothing to pop, a lot to discard
   124733 #   - (1 + 2 * *): some to pop and discard
   124734 #
   124735 # - test the action associated to `error'
   124736 #
   124737 # - check the lookahead that triggers an error is not discarded
   124738 #   when we enter error recovery.  Below, the lookahead causing the
   124739 #   first error is ")", which is needed to recover from the error and
   124740 #   produce the "0" that triggers the "0 != 1" error.
   124741 #
   124742 cat >input <<'_ATEOF'
   124743 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   124744 _ATEOF
   124745 
   124746 { set +x
   124747 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124748 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124749 ( $at_check_trace;  $PREPARSER ./calc input
   124750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124751 at_status=$? at_failed=false
   124752 $at_check_filter
   124753 echo stderr:; tee stderr <"$at_stderr"
   124754 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124755 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124756 $at_failed && at_fn_log_failure
   124757 $at_traceon; }
   124758 
   124759 { set +x
   124760 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124761 at_fn_check_prepare_trace "calc.at:714"
   124762 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124764 at_status=$? at_failed=false
   124765 $at_check_filter
   124766 echo stderr:; tee stderr <"$at_stderr"
   124767 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124768 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124769 $at_failed && at_fn_log_failure
   124770 $at_traceon; }
   124771 
   124772 
   124773 
   124774 # Normalize the observed and expected error messages, depending upon the
   124775 # options.
   124776 # 1. Remove the traces from observed.
   124777 sed '/^Starting/d
   124778 /^Entering/d
   124779 /^Stack/d
   124780 /^Reading/d
   124781 /^Reducing/d
   124782 /^Return/d
   124783 /^Shifting/d
   124784 /^state/d
   124785 /^Cleanup:/d
   124786 /^Error:/d
   124787 /^Next/d
   124788 /^Now/d
   124789 /^Discarding/d
   124790 / \$[0-9$]* = /d
   124791 /^yydestructor:/d' stderr >at-stderr
   124792 mv at-stderr stderr
   124793 # 2. Create the reference error message.
   124794 cat >expout <<'_ATEOF'
   124795 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   124796 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   124797 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   124798 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   124799 calc: error: 4444 != 1
   124800 _ATEOF
   124801 
   124802 # 3. If locations are not used, remove them.
   124803 
   124804 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124805 
   124806 # 5. Check
   124807 { set +x
   124808 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124809 at_fn_check_prepare_trace "calc.at:714"
   124810 ( $at_check_trace; cat stderr
   124811 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124812 at_status=$? at_failed=false
   124813 $at_check_filter
   124814 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124815 $at_diff expout "$at_stdout" || at_failed=:
   124816 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124817 $at_failed && at_fn_log_failure
   124818 $at_traceon; }
   124819 
   124820 
   124821 
   124822 # The same, but this time exercising explicitly triggered syntax errors.
   124823 # POSIX says the lookahead causing the error should not be discarded.
   124824 cat >input <<'_ATEOF'
   124825 (!) + (1 2) = 1
   124826 _ATEOF
   124827 
   124828 { set +x
   124829 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124830 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124831 ( $at_check_trace;  $PREPARSER ./calc input
   124832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124833 at_status=$? at_failed=false
   124834 $at_check_filter
   124835 echo stderr:; tee stderr <"$at_stderr"
   124836 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124837 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124838 $at_failed && at_fn_log_failure
   124839 $at_traceon; }
   124840 
   124841 { set +x
   124842 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124843 at_fn_check_prepare_trace "calc.at:714"
   124844 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124845 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124846 at_status=$? at_failed=false
   124847 $at_check_filter
   124848 echo stderr:; tee stderr <"$at_stderr"
   124849 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124850 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124851 $at_failed && at_fn_log_failure
   124852 $at_traceon; }
   124853 
   124854 
   124855 
   124856 # Normalize the observed and expected error messages, depending upon the
   124857 # options.
   124858 # 1. Remove the traces from observed.
   124859 sed '/^Starting/d
   124860 /^Entering/d
   124861 /^Stack/d
   124862 /^Reading/d
   124863 /^Reducing/d
   124864 /^Return/d
   124865 /^Shifting/d
   124866 /^state/d
   124867 /^Cleanup:/d
   124868 /^Error:/d
   124869 /^Next/d
   124870 /^Now/d
   124871 /^Discarding/d
   124872 / \$[0-9$]* = /d
   124873 /^yydestructor:/d' stderr >at-stderr
   124874 mv at-stderr stderr
   124875 # 2. Create the reference error message.
   124876 cat >expout <<'_ATEOF'
   124877 1.10: syntax error, unexpected number
   124878 calc: error: 2222 != 1
   124879 _ATEOF
   124880 
   124881 # 3. If locations are not used, remove them.
   124882 
   124883 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124884 
   124885 # 5. Check
   124886 { set +x
   124887 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124888 at_fn_check_prepare_trace "calc.at:714"
   124889 ( $at_check_trace; cat stderr
   124890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124891 at_status=$? at_failed=false
   124892 $at_check_filter
   124893 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124894 $at_diff expout "$at_stdout" || at_failed=:
   124895 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124896 $at_failed && at_fn_log_failure
   124897 $at_traceon; }
   124898 
   124899 
   124900 cat >input <<'_ATEOF'
   124901 (- *) + (1 2) = 1
   124902 _ATEOF
   124903 
   124904 { set +x
   124905 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124906 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124907 ( $at_check_trace;  $PREPARSER ./calc input
   124908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124909 at_status=$? at_failed=false
   124910 $at_check_filter
   124911 echo stderr:; tee stderr <"$at_stderr"
   124912 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124913 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124914 $at_failed && at_fn_log_failure
   124915 $at_traceon; }
   124916 
   124917 { set +x
   124918 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124919 at_fn_check_prepare_trace "calc.at:714"
   124920 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   124921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124922 at_status=$? at_failed=false
   124923 $at_check_filter
   124924 echo stderr:; tee stderr <"$at_stderr"
   124925 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124926 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124927 $at_failed && at_fn_log_failure
   124928 $at_traceon; }
   124929 
   124930 
   124931 
   124932 # Normalize the observed and expected error messages, depending upon the
   124933 # options.
   124934 # 1. Remove the traces from observed.
   124935 sed '/^Starting/d
   124936 /^Entering/d
   124937 /^Stack/d
   124938 /^Reading/d
   124939 /^Reducing/d
   124940 /^Return/d
   124941 /^Shifting/d
   124942 /^state/d
   124943 /^Cleanup:/d
   124944 /^Error:/d
   124945 /^Next/d
   124946 /^Now/d
   124947 /^Discarding/d
   124948 / \$[0-9$]* = /d
   124949 /^yydestructor:/d' stderr >at-stderr
   124950 mv at-stderr stderr
   124951 # 2. Create the reference error message.
   124952 cat >expout <<'_ATEOF'
   124953 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   124954 1.12: syntax error, unexpected number
   124955 calc: error: 2222 != 1
   124956 _ATEOF
   124957 
   124958 # 3. If locations are not used, remove them.
   124959 
   124960 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   124961 
   124962 # 5. Check
   124963 { set +x
   124964 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   124965 at_fn_check_prepare_trace "calc.at:714"
   124966 ( $at_check_trace; cat stderr
   124967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124968 at_status=$? at_failed=false
   124969 $at_check_filter
   124970 at_fn_diff_devnull "$at_stderr" || at_failed=:
   124971 $at_diff expout "$at_stdout" || at_failed=:
   124972 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124973 $at_failed && at_fn_log_failure
   124974 $at_traceon; }
   124975 
   124976 
   124977 
   124978 # Check that yyerrok works properly: second error is not reported,
   124979 # third and fourth are.  Parse status is succesfull.
   124980 cat >input <<'_ATEOF'
   124981 (* *) + (*) + (*)
   124982 _ATEOF
   124983 
   124984 { set +x
   124985 $as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
   124986 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
   124987 ( $at_check_trace;  $PREPARSER ./calc input
   124988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   124989 at_status=$? at_failed=false
   124990 $at_check_filter
   124991 echo stderr:; tee stderr <"$at_stderr"
   124992 at_fn_diff_devnull "$at_stdout" || at_failed=:
   124993 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   124994 $at_failed && at_fn_log_failure
   124995 $at_traceon; }
   124996 
   124997 { set +x
   124998 $as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   124999 at_fn_check_prepare_trace "calc.at:714"
   125000 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125001 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125002 at_status=$? at_failed=false
   125003 $at_check_filter
   125004 echo stderr:; tee stderr <"$at_stderr"
   125005 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125006 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   125007 $at_failed && at_fn_log_failure
   125008 $at_traceon; }
   125009 
   125010 
   125011 
   125012 # Normalize the observed and expected error messages, depending upon the
   125013 # options.
   125014 # 1. Remove the traces from observed.
   125015 sed '/^Starting/d
   125016 /^Entering/d
   125017 /^Stack/d
   125018 /^Reading/d
   125019 /^Reducing/d
   125020 /^Return/d
   125021 /^Shifting/d
   125022 /^state/d
   125023 /^Cleanup:/d
   125024 /^Error:/d
   125025 /^Next/d
   125026 /^Now/d
   125027 /^Discarding/d
   125028 / \$[0-9$]* = /d
   125029 /^yydestructor:/d' stderr >at-stderr
   125030 mv at-stderr stderr
   125031 # 2. Create the reference error message.
   125032 cat >expout <<'_ATEOF'
   125033 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   125034 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   125035 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   125036 _ATEOF
   125037 
   125038 # 3. If locations are not used, remove them.
   125039 
   125040 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   125041 
   125042 # 5. Check
   125043 { set +x
   125044 $as_echo "$at_srcdir/calc.at:714: cat stderr"
   125045 at_fn_check_prepare_trace "calc.at:714"
   125046 ( $at_check_trace; cat stderr
   125047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125048 at_status=$? at_failed=false
   125049 $at_check_filter
   125050 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125051 $at_diff expout "$at_stdout" || at_failed=:
   125052 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
   125053 $at_failed && at_fn_log_failure
   125054 $at_traceon; }
   125055 
   125056 
   125057 
   125058 
   125059 
   125060   set +x
   125061   $at_times_p && times >"$at_times_file"
   125062 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   125063 read at_status <"$at_status_file"
   125064 #AT_STOP_250
   125065 #AT_START_251
   125066 at_fn_group_banner 251 'calc.at:716' \
   125067   "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14
   125068 at_xfail=no
   125069 (
   125070   $as_echo "251. $at_setup_line: testing $at_desc ..."
   125071   $at_traceon
   125072 
   125073 
   125074 
   125075 
   125076 
   125077 
   125078 
   125079 
   125080 
   125081 
   125082 cat >calc.y <<'_ATEOF'
   125083 %code top {
   125084 #include <config.h>
   125085 /* We don't need perfect functions for these tests. */
   125086 #undef malloc
   125087 #undef memcmp
   125088 #undef realloc
   125089 }
   125090 
   125091 /* Infix notation calculator--calc */
   125092 %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc
   125093 %define global_tokens_and_yystype
   125094 %code requires
   125095 {
   125096 
   125097   /* Exercise pre-prologue dependency to %union.  */
   125098   typedef int semantic_value;
   125099 }
   125100 
   125101 /* Exercise %union. */
   125102 %union
   125103 {
   125104   semantic_value ival;
   125105 };
   125106 %printer { yyoutput << $$; } <ival>;
   125107 
   125108 %code provides
   125109 {
   125110   #include <stdio.h>
   125111   /* The input.  */
   125112   extern FILE *input;
   125113   extern semantic_value global_result;
   125114   extern int global_count;
   125115 }
   125116 
   125117 %code
   125118 {
   125119 #include <assert.h>
   125120 #include <string.h>
   125121 #define USE(Var)
   125122 
   125123 FILE *input;
   125124 static int power (int base, int exponent);
   125125 
   125126 
   125127 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   125128 }
   125129 
   125130 
   125131 
   125132 /* Bison Declarations */
   125133 %token CALC_EOF 0 "end of input"
   125134 %token <ival> NUM "number"
   125135 %type  <ival> exp
   125136 
   125137 %nonassoc '=' /* comparison            */
   125138 %left '-' '+'
   125139 %left '*' '/'
   125140 %left NEG     /* negation--unary minus */
   125141 %right '^'    /* exponentiation        */
   125142 
   125143 /* Grammar follows */
   125144 %%
   125145 input:
   125146   line
   125147 | input line         {  }
   125148 ;
   125149 
   125150 line:
   125151   '\n'
   125152 | exp '\n'           { USE ($1); }
   125153 ;
   125154 
   125155 exp:
   125156   NUM                { $$ = $1;             }
   125157 | exp '=' exp
   125158   {
   125159     if ($1 != $3)
   125160       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   125161     $$ = $1;
   125162   }
   125163 | exp '+' exp        { $$ = $1 + $3;        }
   125164 | exp '-' exp        { $$ = $1 - $3;        }
   125165 | exp '*' exp        { $$ = $1 * $3;        }
   125166 | exp '/' exp        { $$ = $1 / $3;        }
   125167 | '-' exp  %prec NEG { $$ = -$2;            }
   125168 | exp '^' exp        { $$ = power ($1, $3); }
   125169 | '(' exp ')'        { $$ = $2;             }
   125170 | '(' error ')'      { $$ = 1111; yyerrok;  }
   125171 | '!'                { $$ = 0; YYERROR;     }
   125172 | '-' error          { $$ = 0; YYERROR;     }
   125173 ;
   125174 %%
   125175 
   125176 static int
   125177 power (int base, int exponent)
   125178 {
   125179   int res = 1;
   125180   assert (0 <= exponent);
   125181   for (/* Niente */; exponent; --exponent)
   125182     res *= base;
   125183   return res;
   125184 }
   125185 
   125186 
   125187 /* A C++ error reporting function.  */
   125188 void
   125189 calc::parser::error (const location_type& l, const std::string& m)
   125190 {
   125191   (void) l;
   125192   std::cerr << l << ": " << m << std::endl;
   125193 }
   125194 _ATEOF
   125195 
   125196 
   125197 
   125198 cat >calc-lex.cc <<'_ATEOF'
   125199 #include <config.h>
   125200 /* We don't need perfect functions for these tests. */
   125201 #undef malloc
   125202 #undef memcmp
   125203 #undef realloc
   125204 
   125205 #include "calc.hh"
   125206 
   125207 #include <ctype.h>
   125208 
   125209 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   125210 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   125211 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   125212 
   125213 
   125214 static calc::parser::location_type last_yylloc;
   125215 
   125216 static int
   125217 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   125218 {
   125219   int res = getc (input);
   125220   (void) lvalp;(void) llocp;
   125221 
   125222   last_yylloc = (*llocp);
   125223   if (res == '\n')
   125224     {
   125225       (*llocp).end.line++;
   125226       (*llocp).end.column = 1;
   125227     }
   125228   else
   125229     (*llocp).end.column++;
   125230 
   125231   return res;
   125232 }
   125233 
   125234 static void
   125235 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   125236 {
   125237   (void) lvalp;(void) llocp;
   125238 
   125239   /* Wrong when C == `\n'. */
   125240   (*llocp) = last_yylloc;
   125241 
   125242   ungetc (c, input);
   125243 }
   125244 
   125245 static int
   125246 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   125247 {
   125248   int c = get_char (lvalp, llocp);
   125249   int sign = 1;
   125250   int n = 0;
   125251 
   125252   (void) lvalp;(void) llocp;
   125253   if (c == '-')
   125254     {
   125255       c = get_char (lvalp, llocp);
   125256       sign = -1;
   125257     }
   125258 
   125259   while (isdigit (c))
   125260     {
   125261       n = 10 * n + (c - '0');
   125262       c = get_char (lvalp, llocp);
   125263     }
   125264 
   125265   unget_char (lvalp, llocp,  c);
   125266 
   125267   return sign * n;
   125268 }
   125269 
   125270 
   125271 /*---------------------------------------------------------------.
   125272 | Lexical analyzer returns an integer on the stack and the token |
   125273 | NUM, or the ASCII character read if not a number.  Skips all   |
   125274 | blanks and tabs, returns 0 for EOF.                            |
   125275 `---------------------------------------------------------------*/
   125276 
   125277 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   125278 {
   125279   int c;
   125280   /* Skip current token, then white spaces.  */
   125281   do
   125282     {
   125283      (*llocp).begin.column = (*llocp).end.column;
   125284       (*llocp).begin.line   = (*llocp).end.line;
   125285 
   125286     }
   125287   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   125288 
   125289   /* process numbers   */
   125290   if (c == '.' || isdigit (c))
   125291     {
   125292       unget_char (lvalp, llocp,  c);
   125293       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   125294       return NUM;
   125295     }
   125296 
   125297   /* Return end-of-file.  */
   125298   if (c == EOF)
   125299     return CALC_EOF;
   125300 
   125301   /* Return single chars. */
   125302   return c;
   125303 }
   125304 _ATEOF
   125305 
   125306 
   125307 cat >calc-main.cc <<'_ATEOF'
   125308 #include <config.h>
   125309 /* We don't need perfect functions for these tests. */
   125310 #undef malloc
   125311 #undef memcmp
   125312 #undef realloc
   125313 
   125314 #include "calc.hh"
   125315 
   125316 #include <assert.h>
   125317 #if HAVE_UNISTD_H
   125318 # include <unistd.h>
   125319 #else
   125320 # undef alarm
   125321 # define alarm(seconds) /* empty */
   125322 #endif
   125323 
   125324 
   125325 /* A C++ calcparse that simulates the C signature.  */
   125326 int
   125327 calcparse ()
   125328 {
   125329   calc::parser parser;
   125330 #if YYDEBUG
   125331   parser.set_debug_level (1);
   125332 #endif
   125333   return parser.parse ();
   125334 }
   125335 
   125336 
   125337 semantic_value global_result = 0;
   125338 int global_count = 0;
   125339 
   125340 /* A C main function.  */
   125341 int
   125342 main (int argc, const char **argv)
   125343 {
   125344   semantic_value result = 0;
   125345   int count = 0;
   125346   int status;
   125347 
   125348   /* This used to be alarm (10), but that isn't enough time for
   125349      a July 1995 vintage DEC Alphastation 200 4/100 system,
   125350      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   125351   alarm (100);
   125352 
   125353   if (argc == 2)
   125354     input = fopen (argv[1], "r");
   125355   else
   125356     input = stdin;
   125357 
   125358   if (!input)
   125359     {
   125360       perror (argv[1]);
   125361       return 3;
   125362     }
   125363 
   125364 
   125365   status = calcparse ();
   125366   if (fclose (input))
   125367     perror ("fclose");
   125368   assert (global_result == result);
   125369   assert (global_count == count);
   125370   return status;
   125371 }
   125372 _ATEOF
   125373 
   125374 
   125375 
   125376 
   125377 
   125378 
   125379 
   125380 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   125381   at_save_special_files
   125382   mkdir xml-tests
   125383     # Don't combine these Bison invocations since we want to be sure that
   125384   # --report=all isn't required to get the full XML file.
   125385   { set +x
   125386 $as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   125387                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   125388 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716"
   125389 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   125390                   --graph=xml-tests/test.dot -o calc.cc calc.y
   125391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125392 at_status=$? at_failed=false
   125393 $at_check_filter
   125394 echo stderr:; cat "$at_stderr"
   125395 echo stdout:; cat "$at_stdout"
   125396 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125397 $at_failed && at_fn_log_failure
   125398 $at_traceon; }
   125399 
   125400   { set +x
   125401 $as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   125402 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:716"
   125403 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   125404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125405 at_status=$? at_failed=false
   125406 $at_check_filter
   125407 echo stderr:; cat "$at_stderr"
   125408 echo stdout:; cat "$at_stdout"
   125409 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125410 $at_failed && at_fn_log_failure
   125411 $at_traceon; }
   125412 
   125413     cp xml-tests/test.output expout
   125414   { set +x
   125415 $as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\
   125416              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   125417              xml-tests/test.xml"
   125418 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716"
   125419 ( $at_check_trace; $XSLTPROC \
   125420              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   125421              xml-tests/test.xml
   125422 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125423 at_status=$? at_failed=false
   125424 $at_check_filter
   125425 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125426 $at_diff expout "$at_stdout" || at_failed=:
   125427 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125428 $at_failed && at_fn_log_failure
   125429 $at_traceon; }
   125430 
   125431   sort xml-tests/test.dot > expout
   125432   { set +x
   125433 $as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\
   125434              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   125435              xml-tests/test.xml | sort"
   125436 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716"
   125437 ( $at_check_trace; $XSLTPROC \
   125438              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   125439              xml-tests/test.xml | sort
   125440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125441 at_status=$? at_failed=false
   125442 $at_check_filter
   125443 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125444 $at_diff expout "$at_stdout" || at_failed=:
   125445 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125446 $at_failed && at_fn_log_failure
   125447 $at_traceon; }
   125448 
   125449   rm -rf xml-tests expout
   125450   at_restore_special_files
   125451 fi
   125452 { set +x
   125453 $as_echo "$at_srcdir/calc.at:716: bison -o calc.cc calc.y"
   125454 at_fn_check_prepare_trace "calc.at:716"
   125455 ( $at_check_trace; bison -o calc.cc calc.y
   125456 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125457 at_status=$? at_failed=false
   125458 $at_check_filter
   125459 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125460 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125461 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125462 $at_failed && at_fn_log_failure
   125463 $at_traceon; }
   125464 
   125465 
   125466 
   125467 { set +x
   125468 $as_echo "$at_srcdir/calc.at:716: \$BISON_CXX_WORKS"
   125469 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:716"
   125470 ( $at_check_trace; $BISON_CXX_WORKS
   125471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125472 at_status=$? at_failed=false
   125473 $at_check_filter
   125474 echo stderr:; cat "$at_stderr"
   125475 echo stdout:; cat "$at_stdout"
   125476 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125477 $at_failed && at_fn_log_failure
   125478 $at_traceon; }
   125479 
   125480 { set +x
   125481 $as_echo "$at_srcdir/calc.at:716: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   125482 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:716"
   125483 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   125484 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125485 at_status=$? at_failed=false
   125486 $at_check_filter
   125487 echo stderr:; cat "$at_stderr"
   125488 echo stdout:; cat "$at_stdout"
   125489 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125490 $at_failed && at_fn_log_failure
   125491 $at_traceon; }
   125492 
   125493 
   125494 { set +x
   125495 $as_echo "$at_srcdir/calc.at:716: \$PERL -ne '
   125496   chomp;
   125497   print \"\$.: {\$_}\\n\"
   125498     if (# No starting/ending empty lines.
   125499         (eof || \$. == 1) && /^\\s*\$/
   125500         # No trailing space.  FIXME: not ready for \"maint\".
   125501         # || /\\s\$/
   125502         )' calc.cc
   125503 "
   125504 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716"
   125505 ( $at_check_trace; $PERL -ne '
   125506   chomp;
   125507   print "$.: {$_}\n"
   125508     if (# No starting/ending empty lines.
   125509         (eof || $. == 1) && /^\s*$/
   125510         # No trailing space.  FIXME: not ready for "maint".
   125511         # || /\s$/
   125512         )' calc.cc
   125513 
   125514 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125515 at_status=$? at_failed=false
   125516 $at_check_filter
   125517 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125518 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125519 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125520 $at_failed && at_fn_log_failure
   125521 $at_traceon; }
   125522 
   125523 { set +x
   125524 $as_echo "$at_srcdir/calc.at:716: \$PERL -ne '
   125525   chomp;
   125526   print \"\$.: {\$_}\\n\"
   125527     if (# No starting/ending empty lines.
   125528         (eof || \$. == 1) && /^\\s*\$/
   125529         # No trailing space.  FIXME: not ready for \"maint\".
   125530         # || /\\s\$/
   125531         )' calc.hh
   125532 "
   125533 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716"
   125534 ( $at_check_trace; $PERL -ne '
   125535   chomp;
   125536   print "$.: {$_}\n"
   125537     if (# No starting/ending empty lines.
   125538         (eof || $. == 1) && /^\s*$/
   125539         # No trailing space.  FIXME: not ready for "maint".
   125540         # || /\s$/
   125541         )' calc.hh
   125542 
   125543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125544 at_status=$? at_failed=false
   125545 $at_check_filter
   125546 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125547 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125548 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125549 $at_failed && at_fn_log_failure
   125550 $at_traceon; }
   125551 
   125552 
   125553 # Test the priorities.
   125554 cat >input <<'_ATEOF'
   125555 1 + 2 * 3 = 7
   125556 1 + 2 * -3 = -5
   125557 
   125558 -1^2 = -1
   125559 (-1)^2 = 1
   125560 
   125561 ---1 = -1
   125562 
   125563 1 - 2 - 3 = -4
   125564 1 - (2 - 3) = 2
   125565 
   125566 2^2^3 = 256
   125567 (2^2)^3 = 64
   125568 _ATEOF
   125569 
   125570 { set +x
   125571 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   125572 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   125573 ( $at_check_trace;  $PREPARSER ./calc input
   125574 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125575 at_status=$? at_failed=false
   125576 $at_check_filter
   125577 echo stderr:; tee stderr <"$at_stderr"
   125578 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125579 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125580 $at_failed && at_fn_log_failure
   125581 $at_traceon; }
   125582 
   125583 { set +x
   125584 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125585 at_fn_check_prepare_trace "calc.at:716"
   125586 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125587 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125588 at_status=$? at_failed=false
   125589 $at_check_filter
   125590 echo stderr:; tee stderr <"$at_stderr"
   125591 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125592 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125593 $at_failed && at_fn_log_failure
   125594 $at_traceon; }
   125595 
   125596 
   125597 
   125598 
   125599 # Some syntax errors.
   125600 cat >input <<'_ATEOF'
   125601 1 2
   125602 _ATEOF
   125603 
   125604 { set +x
   125605 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   125606 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   125607 ( $at_check_trace;  $PREPARSER ./calc input
   125608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125609 at_status=$? at_failed=false
   125610 $at_check_filter
   125611 echo stderr:; tee stderr <"$at_stderr"
   125612 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125613 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
   125614 $at_failed && at_fn_log_failure
   125615 $at_traceon; }
   125616 
   125617 { set +x
   125618 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125619 at_fn_check_prepare_trace "calc.at:716"
   125620 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125621 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125622 at_status=$? at_failed=false
   125623 $at_check_filter
   125624 echo stderr:; tee stderr <"$at_stderr"
   125625 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125626 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125627 $at_failed && at_fn_log_failure
   125628 $at_traceon; }
   125629 
   125630 
   125631 
   125632 # Normalize the observed and expected error messages, depending upon the
   125633 # options.
   125634 # 1. Remove the traces from observed.
   125635 sed '/^Starting/d
   125636 /^Entering/d
   125637 /^Stack/d
   125638 /^Reading/d
   125639 /^Reducing/d
   125640 /^Return/d
   125641 /^Shifting/d
   125642 /^state/d
   125643 /^Cleanup:/d
   125644 /^Error:/d
   125645 /^Next/d
   125646 /^Now/d
   125647 /^Discarding/d
   125648 / \$[0-9$]* = /d
   125649 /^yydestructor:/d' stderr >at-stderr
   125650 mv at-stderr stderr
   125651 # 2. Create the reference error message.
   125652 cat >expout <<'_ATEOF'
   125653 1.3: syntax error, unexpected number
   125654 _ATEOF
   125655 
   125656 # 3. If locations are not used, remove them.
   125657 
   125658 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   125659 
   125660 # 5. Check
   125661 { set +x
   125662 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   125663 at_fn_check_prepare_trace "calc.at:716"
   125664 ( $at_check_trace; cat stderr
   125665 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125666 at_status=$? at_failed=false
   125667 $at_check_filter
   125668 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125669 $at_diff expout "$at_stdout" || at_failed=:
   125670 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125671 $at_failed && at_fn_log_failure
   125672 $at_traceon; }
   125673 
   125674 
   125675 cat >input <<'_ATEOF'
   125676 1//2
   125677 _ATEOF
   125678 
   125679 { set +x
   125680 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   125681 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   125682 ( $at_check_trace;  $PREPARSER ./calc input
   125683 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125684 at_status=$? at_failed=false
   125685 $at_check_filter
   125686 echo stderr:; tee stderr <"$at_stderr"
   125687 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125688 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
   125689 $at_failed && at_fn_log_failure
   125690 $at_traceon; }
   125691 
   125692 { set +x
   125693 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125694 at_fn_check_prepare_trace "calc.at:716"
   125695 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125696 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125697 at_status=$? at_failed=false
   125698 $at_check_filter
   125699 echo stderr:; tee stderr <"$at_stderr"
   125700 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125701 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125702 $at_failed && at_fn_log_failure
   125703 $at_traceon; }
   125704 
   125705 
   125706 
   125707 # Normalize the observed and expected error messages, depending upon the
   125708 # options.
   125709 # 1. Remove the traces from observed.
   125710 sed '/^Starting/d
   125711 /^Entering/d
   125712 /^Stack/d
   125713 /^Reading/d
   125714 /^Reducing/d
   125715 /^Return/d
   125716 /^Shifting/d
   125717 /^state/d
   125718 /^Cleanup:/d
   125719 /^Error:/d
   125720 /^Next/d
   125721 /^Now/d
   125722 /^Discarding/d
   125723 / \$[0-9$]* = /d
   125724 /^yydestructor:/d' stderr >at-stderr
   125725 mv at-stderr stderr
   125726 # 2. Create the reference error message.
   125727 cat >expout <<'_ATEOF'
   125728 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   125729 _ATEOF
   125730 
   125731 # 3. If locations are not used, remove them.
   125732 
   125733 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   125734 
   125735 # 5. Check
   125736 { set +x
   125737 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   125738 at_fn_check_prepare_trace "calc.at:716"
   125739 ( $at_check_trace; cat stderr
   125740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125741 at_status=$? at_failed=false
   125742 $at_check_filter
   125743 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125744 $at_diff expout "$at_stdout" || at_failed=:
   125745 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125746 $at_failed && at_fn_log_failure
   125747 $at_traceon; }
   125748 
   125749 
   125750 cat >input <<'_ATEOF'
   125751 error
   125752 _ATEOF
   125753 
   125754 { set +x
   125755 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   125756 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   125757 ( $at_check_trace;  $PREPARSER ./calc input
   125758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125759 at_status=$? at_failed=false
   125760 $at_check_filter
   125761 echo stderr:; tee stderr <"$at_stderr"
   125762 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125763 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
   125764 $at_failed && at_fn_log_failure
   125765 $at_traceon; }
   125766 
   125767 { set +x
   125768 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125769 at_fn_check_prepare_trace "calc.at:716"
   125770 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125771 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125772 at_status=$? at_failed=false
   125773 $at_check_filter
   125774 echo stderr:; tee stderr <"$at_stderr"
   125775 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125776 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125777 $at_failed && at_fn_log_failure
   125778 $at_traceon; }
   125779 
   125780 
   125781 
   125782 # Normalize the observed and expected error messages, depending upon the
   125783 # options.
   125784 # 1. Remove the traces from observed.
   125785 sed '/^Starting/d
   125786 /^Entering/d
   125787 /^Stack/d
   125788 /^Reading/d
   125789 /^Reducing/d
   125790 /^Return/d
   125791 /^Shifting/d
   125792 /^state/d
   125793 /^Cleanup:/d
   125794 /^Error:/d
   125795 /^Next/d
   125796 /^Now/d
   125797 /^Discarding/d
   125798 / \$[0-9$]* = /d
   125799 /^yydestructor:/d' stderr >at-stderr
   125800 mv at-stderr stderr
   125801 # 2. Create the reference error message.
   125802 cat >expout <<'_ATEOF'
   125803 1.1: syntax error, unexpected $undefined
   125804 _ATEOF
   125805 
   125806 # 3. If locations are not used, remove them.
   125807 
   125808 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   125809 
   125810 # 5. Check
   125811 { set +x
   125812 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   125813 at_fn_check_prepare_trace "calc.at:716"
   125814 ( $at_check_trace; cat stderr
   125815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125816 at_status=$? at_failed=false
   125817 $at_check_filter
   125818 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125819 $at_diff expout "$at_stdout" || at_failed=:
   125820 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125821 $at_failed && at_fn_log_failure
   125822 $at_traceon; }
   125823 
   125824 
   125825 cat >input <<'_ATEOF'
   125826 1 = 2 = 3
   125827 _ATEOF
   125828 
   125829 { set +x
   125830 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   125831 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   125832 ( $at_check_trace;  $PREPARSER ./calc input
   125833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125834 at_status=$? at_failed=false
   125835 $at_check_filter
   125836 echo stderr:; tee stderr <"$at_stderr"
   125837 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125838 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
   125839 $at_failed && at_fn_log_failure
   125840 $at_traceon; }
   125841 
   125842 { set +x
   125843 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125844 at_fn_check_prepare_trace "calc.at:716"
   125845 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125846 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125847 at_status=$? at_failed=false
   125848 $at_check_filter
   125849 echo stderr:; tee stderr <"$at_stderr"
   125850 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125851 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125852 $at_failed && at_fn_log_failure
   125853 $at_traceon; }
   125854 
   125855 
   125856 
   125857 # Normalize the observed and expected error messages, depending upon the
   125858 # options.
   125859 # 1. Remove the traces from observed.
   125860 sed '/^Starting/d
   125861 /^Entering/d
   125862 /^Stack/d
   125863 /^Reading/d
   125864 /^Reducing/d
   125865 /^Return/d
   125866 /^Shifting/d
   125867 /^state/d
   125868 /^Cleanup:/d
   125869 /^Error:/d
   125870 /^Next/d
   125871 /^Now/d
   125872 /^Discarding/d
   125873 / \$[0-9$]* = /d
   125874 /^yydestructor:/d' stderr >at-stderr
   125875 mv at-stderr stderr
   125876 # 2. Create the reference error message.
   125877 cat >expout <<'_ATEOF'
   125878 1.7: syntax error, unexpected '='
   125879 _ATEOF
   125880 
   125881 # 3. If locations are not used, remove them.
   125882 
   125883 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   125884 
   125885 # 5. Check
   125886 { set +x
   125887 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   125888 at_fn_check_prepare_trace "calc.at:716"
   125889 ( $at_check_trace; cat stderr
   125890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125891 at_status=$? at_failed=false
   125892 $at_check_filter
   125893 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125894 $at_diff expout "$at_stdout" || at_failed=:
   125895 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125896 $at_failed && at_fn_log_failure
   125897 $at_traceon; }
   125898 
   125899 
   125900 cat >input <<'_ATEOF'
   125901 
   125902 +1
   125903 _ATEOF
   125904 
   125905 { set +x
   125906 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   125907 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   125908 ( $at_check_trace;  $PREPARSER ./calc input
   125909 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125910 at_status=$? at_failed=false
   125911 $at_check_filter
   125912 echo stderr:; tee stderr <"$at_stderr"
   125913 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125914 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
   125915 $at_failed && at_fn_log_failure
   125916 $at_traceon; }
   125917 
   125918 { set +x
   125919 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125920 at_fn_check_prepare_trace "calc.at:716"
   125921 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125922 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125923 at_status=$? at_failed=false
   125924 $at_check_filter
   125925 echo stderr:; tee stderr <"$at_stderr"
   125926 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125927 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125928 $at_failed && at_fn_log_failure
   125929 $at_traceon; }
   125930 
   125931 
   125932 
   125933 # Normalize the observed and expected error messages, depending upon the
   125934 # options.
   125935 # 1. Remove the traces from observed.
   125936 sed '/^Starting/d
   125937 /^Entering/d
   125938 /^Stack/d
   125939 /^Reading/d
   125940 /^Reducing/d
   125941 /^Return/d
   125942 /^Shifting/d
   125943 /^state/d
   125944 /^Cleanup:/d
   125945 /^Error:/d
   125946 /^Next/d
   125947 /^Now/d
   125948 /^Discarding/d
   125949 / \$[0-9$]* = /d
   125950 /^yydestructor:/d' stderr >at-stderr
   125951 mv at-stderr stderr
   125952 # 2. Create the reference error message.
   125953 cat >expout <<'_ATEOF'
   125954 2.1: syntax error, unexpected '+'
   125955 _ATEOF
   125956 
   125957 # 3. If locations are not used, remove them.
   125958 
   125959 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   125960 
   125961 # 5. Check
   125962 { set +x
   125963 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   125964 at_fn_check_prepare_trace "calc.at:716"
   125965 ( $at_check_trace; cat stderr
   125966 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125967 at_status=$? at_failed=false
   125968 $at_check_filter
   125969 at_fn_diff_devnull "$at_stderr" || at_failed=:
   125970 $at_diff expout "$at_stdout" || at_failed=:
   125971 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   125972 $at_failed && at_fn_log_failure
   125973 $at_traceon; }
   125974 
   125975 
   125976 # Exercise error messages with EOF: work on an empty file.
   125977 { set +x
   125978 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc /dev/null"
   125979 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:716"
   125980 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   125981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125982 at_status=$? at_failed=false
   125983 $at_check_filter
   125984 echo stderr:; tee stderr <"$at_stderr"
   125985 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125986 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
   125987 $at_failed && at_fn_log_failure
   125988 $at_traceon; }
   125989 
   125990 { set +x
   125991 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   125992 at_fn_check_prepare_trace "calc.at:716"
   125993 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   125994 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   125995 at_status=$? at_failed=false
   125996 $at_check_filter
   125997 echo stderr:; tee stderr <"$at_stderr"
   125998 at_fn_diff_devnull "$at_stdout" || at_failed=:
   125999 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126000 $at_failed && at_fn_log_failure
   126001 $at_traceon; }
   126002 
   126003 
   126004 
   126005 # Normalize the observed and expected error messages, depending upon the
   126006 # options.
   126007 # 1. Remove the traces from observed.
   126008 sed '/^Starting/d
   126009 /^Entering/d
   126010 /^Stack/d
   126011 /^Reading/d
   126012 /^Reducing/d
   126013 /^Return/d
   126014 /^Shifting/d
   126015 /^state/d
   126016 /^Cleanup:/d
   126017 /^Error:/d
   126018 /^Next/d
   126019 /^Now/d
   126020 /^Discarding/d
   126021 / \$[0-9$]* = /d
   126022 /^yydestructor:/d' stderr >at-stderr
   126023 mv at-stderr stderr
   126024 # 2. Create the reference error message.
   126025 cat >expout <<'_ATEOF'
   126026 1.1: syntax error, unexpected end of input
   126027 _ATEOF
   126028 
   126029 # 3. If locations are not used, remove them.
   126030 
   126031 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   126032 
   126033 # 5. Check
   126034 { set +x
   126035 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   126036 at_fn_check_prepare_trace "calc.at:716"
   126037 ( $at_check_trace; cat stderr
   126038 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126039 at_status=$? at_failed=false
   126040 $at_check_filter
   126041 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126042 $at_diff expout "$at_stdout" || at_failed=:
   126043 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126044 $at_failed && at_fn_log_failure
   126045 $at_traceon; }
   126046 
   126047 
   126048 
   126049 # Exercise the error token: without it, we die at the first error,
   126050 # hence be sure to
   126051 #
   126052 # - have several errors which exercise different shift/discardings
   126053 #   - (): nothing to pop, nothing to discard
   126054 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   126055 #   - (* * *): nothing to pop, a lot to discard
   126056 #   - (1 + 2 * *): some to pop and discard
   126057 #
   126058 # - test the action associated to `error'
   126059 #
   126060 # - check the lookahead that triggers an error is not discarded
   126061 #   when we enter error recovery.  Below, the lookahead causing the
   126062 #   first error is ")", which is needed to recover from the error and
   126063 #   produce the "0" that triggers the "0 != 1" error.
   126064 #
   126065 cat >input <<'_ATEOF'
   126066 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   126067 _ATEOF
   126068 
   126069 { set +x
   126070 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   126071 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   126072 ( $at_check_trace;  $PREPARSER ./calc input
   126073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126074 at_status=$? at_failed=false
   126075 $at_check_filter
   126076 echo stderr:; tee stderr <"$at_stderr"
   126077 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126078 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126079 $at_failed && at_fn_log_failure
   126080 $at_traceon; }
   126081 
   126082 { set +x
   126083 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   126084 at_fn_check_prepare_trace "calc.at:716"
   126085 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   126086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126087 at_status=$? at_failed=false
   126088 $at_check_filter
   126089 echo stderr:; tee stderr <"$at_stderr"
   126090 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126091 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126092 $at_failed && at_fn_log_failure
   126093 $at_traceon; }
   126094 
   126095 
   126096 
   126097 # Normalize the observed and expected error messages, depending upon the
   126098 # options.
   126099 # 1. Remove the traces from observed.
   126100 sed '/^Starting/d
   126101 /^Entering/d
   126102 /^Stack/d
   126103 /^Reading/d
   126104 /^Reducing/d
   126105 /^Return/d
   126106 /^Shifting/d
   126107 /^state/d
   126108 /^Cleanup:/d
   126109 /^Error:/d
   126110 /^Next/d
   126111 /^Now/d
   126112 /^Discarding/d
   126113 / \$[0-9$]* = /d
   126114 /^yydestructor:/d' stderr >at-stderr
   126115 mv at-stderr stderr
   126116 # 2. Create the reference error message.
   126117 cat >expout <<'_ATEOF'
   126118 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   126119 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   126120 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   126121 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   126122 calc: error: 4444 != 1
   126123 _ATEOF
   126124 
   126125 # 3. If locations are not used, remove them.
   126126 
   126127 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   126128 
   126129 # 5. Check
   126130 { set +x
   126131 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   126132 at_fn_check_prepare_trace "calc.at:716"
   126133 ( $at_check_trace; cat stderr
   126134 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126135 at_status=$? at_failed=false
   126136 $at_check_filter
   126137 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126138 $at_diff expout "$at_stdout" || at_failed=:
   126139 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126140 $at_failed && at_fn_log_failure
   126141 $at_traceon; }
   126142 
   126143 
   126144 
   126145 # The same, but this time exercising explicitly triggered syntax errors.
   126146 # POSIX says the lookahead causing the error should not be discarded.
   126147 cat >input <<'_ATEOF'
   126148 (!) + (1 2) = 1
   126149 _ATEOF
   126150 
   126151 { set +x
   126152 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   126153 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   126154 ( $at_check_trace;  $PREPARSER ./calc input
   126155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126156 at_status=$? at_failed=false
   126157 $at_check_filter
   126158 echo stderr:; tee stderr <"$at_stderr"
   126159 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126160 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126161 $at_failed && at_fn_log_failure
   126162 $at_traceon; }
   126163 
   126164 { set +x
   126165 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   126166 at_fn_check_prepare_trace "calc.at:716"
   126167 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   126168 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126169 at_status=$? at_failed=false
   126170 $at_check_filter
   126171 echo stderr:; tee stderr <"$at_stderr"
   126172 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126173 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126174 $at_failed && at_fn_log_failure
   126175 $at_traceon; }
   126176 
   126177 
   126178 
   126179 # Normalize the observed and expected error messages, depending upon the
   126180 # options.
   126181 # 1. Remove the traces from observed.
   126182 sed '/^Starting/d
   126183 /^Entering/d
   126184 /^Stack/d
   126185 /^Reading/d
   126186 /^Reducing/d
   126187 /^Return/d
   126188 /^Shifting/d
   126189 /^state/d
   126190 /^Cleanup:/d
   126191 /^Error:/d
   126192 /^Next/d
   126193 /^Now/d
   126194 /^Discarding/d
   126195 / \$[0-9$]* = /d
   126196 /^yydestructor:/d' stderr >at-stderr
   126197 mv at-stderr stderr
   126198 # 2. Create the reference error message.
   126199 cat >expout <<'_ATEOF'
   126200 1.10: syntax error, unexpected number
   126201 calc: error: 2222 != 1
   126202 _ATEOF
   126203 
   126204 # 3. If locations are not used, remove them.
   126205 
   126206 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   126207 
   126208 # 5. Check
   126209 { set +x
   126210 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   126211 at_fn_check_prepare_trace "calc.at:716"
   126212 ( $at_check_trace; cat stderr
   126213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126214 at_status=$? at_failed=false
   126215 $at_check_filter
   126216 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126217 $at_diff expout "$at_stdout" || at_failed=:
   126218 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126219 $at_failed && at_fn_log_failure
   126220 $at_traceon; }
   126221 
   126222 
   126223 cat >input <<'_ATEOF'
   126224 (- *) + (1 2) = 1
   126225 _ATEOF
   126226 
   126227 { set +x
   126228 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   126229 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   126230 ( $at_check_trace;  $PREPARSER ./calc input
   126231 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126232 at_status=$? at_failed=false
   126233 $at_check_filter
   126234 echo stderr:; tee stderr <"$at_stderr"
   126235 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126236 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126237 $at_failed && at_fn_log_failure
   126238 $at_traceon; }
   126239 
   126240 { set +x
   126241 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   126242 at_fn_check_prepare_trace "calc.at:716"
   126243 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   126244 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126245 at_status=$? at_failed=false
   126246 $at_check_filter
   126247 echo stderr:; tee stderr <"$at_stderr"
   126248 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126249 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126250 $at_failed && at_fn_log_failure
   126251 $at_traceon; }
   126252 
   126253 
   126254 
   126255 # Normalize the observed and expected error messages, depending upon the
   126256 # options.
   126257 # 1. Remove the traces from observed.
   126258 sed '/^Starting/d
   126259 /^Entering/d
   126260 /^Stack/d
   126261 /^Reading/d
   126262 /^Reducing/d
   126263 /^Return/d
   126264 /^Shifting/d
   126265 /^state/d
   126266 /^Cleanup:/d
   126267 /^Error:/d
   126268 /^Next/d
   126269 /^Now/d
   126270 /^Discarding/d
   126271 / \$[0-9$]* = /d
   126272 /^yydestructor:/d' stderr >at-stderr
   126273 mv at-stderr stderr
   126274 # 2. Create the reference error message.
   126275 cat >expout <<'_ATEOF'
   126276 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   126277 1.12: syntax error, unexpected number
   126278 calc: error: 2222 != 1
   126279 _ATEOF
   126280 
   126281 # 3. If locations are not used, remove them.
   126282 
   126283 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   126284 
   126285 # 5. Check
   126286 { set +x
   126287 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   126288 at_fn_check_prepare_trace "calc.at:716"
   126289 ( $at_check_trace; cat stderr
   126290 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126291 at_status=$? at_failed=false
   126292 $at_check_filter
   126293 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126294 $at_diff expout "$at_stdout" || at_failed=:
   126295 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126296 $at_failed && at_fn_log_failure
   126297 $at_traceon; }
   126298 
   126299 
   126300 
   126301 # Check that yyerrok works properly: second error is not reported,
   126302 # third and fourth are.  Parse status is succesfull.
   126303 cat >input <<'_ATEOF'
   126304 (* *) + (*) + (*)
   126305 _ATEOF
   126306 
   126307 { set +x
   126308 $as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
   126309 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
   126310 ( $at_check_trace;  $PREPARSER ./calc input
   126311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126312 at_status=$? at_failed=false
   126313 $at_check_filter
   126314 echo stderr:; tee stderr <"$at_stderr"
   126315 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126316 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126317 $at_failed && at_fn_log_failure
   126318 $at_traceon; }
   126319 
   126320 { set +x
   126321 $as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   126322 at_fn_check_prepare_trace "calc.at:716"
   126323 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   126324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126325 at_status=$? at_failed=false
   126326 $at_check_filter
   126327 echo stderr:; tee stderr <"$at_stderr"
   126328 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126329 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126330 $at_failed && at_fn_log_failure
   126331 $at_traceon; }
   126332 
   126333 
   126334 
   126335 # Normalize the observed and expected error messages, depending upon the
   126336 # options.
   126337 # 1. Remove the traces from observed.
   126338 sed '/^Starting/d
   126339 /^Entering/d
   126340 /^Stack/d
   126341 /^Reading/d
   126342 /^Reducing/d
   126343 /^Return/d
   126344 /^Shifting/d
   126345 /^state/d
   126346 /^Cleanup:/d
   126347 /^Error:/d
   126348 /^Next/d
   126349 /^Now/d
   126350 /^Discarding/d
   126351 / \$[0-9$]* = /d
   126352 /^yydestructor:/d' stderr >at-stderr
   126353 mv at-stderr stderr
   126354 # 2. Create the reference error message.
   126355 cat >expout <<'_ATEOF'
   126356 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   126357 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   126358 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   126359 _ATEOF
   126360 
   126361 # 3. If locations are not used, remove them.
   126362 
   126363 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   126364 
   126365 # 5. Check
   126366 { set +x
   126367 $as_echo "$at_srcdir/calc.at:716: cat stderr"
   126368 at_fn_check_prepare_trace "calc.at:716"
   126369 ( $at_check_trace; cat stderr
   126370 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126371 at_status=$? at_failed=false
   126372 $at_check_filter
   126373 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126374 $at_diff expout "$at_stdout" || at_failed=:
   126375 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
   126376 $at_failed && at_fn_log_failure
   126377 $at_traceon; }
   126378 
   126379 
   126380 
   126381 
   126382 
   126383   set +x
   126384   $at_times_p && times >"$at_times_file"
   126385 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   126386 read at_status <"$at_status_file"
   126387 #AT_STOP_251
   126388 #AT_START_252
   126389 at_fn_group_banner 252 'calc.at:718' \
   126390   "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14
   126391 at_xfail=no
   126392 (
   126393   $as_echo "252. $at_setup_line: testing $at_desc ..."
   126394   $at_traceon
   126395 
   126396 
   126397 
   126398 
   126399 
   126400 
   126401 
   126402 
   126403 
   126404 
   126405 cat >calc.y <<'_ATEOF'
   126406 %code top {
   126407 #include <config.h>
   126408 /* We don't need perfect functions for these tests. */
   126409 #undef malloc
   126410 #undef memcmp
   126411 #undef realloc
   126412 }
   126413 
   126414 /* Infix notation calculator--calc */
   126415 %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   126416 %define global_tokens_and_yystype
   126417 %code requires
   126418 {
   126419 
   126420   /* Exercise pre-prologue dependency to %union.  */
   126421   typedef int semantic_value;
   126422 }
   126423 
   126424 /* Exercise %union. */
   126425 %union
   126426 {
   126427   semantic_value ival;
   126428 };
   126429 %printer { yyoutput << $$; } <ival>;
   126430 
   126431 %code provides
   126432 {
   126433   #include <stdio.h>
   126434   /* The input.  */
   126435   extern FILE *input;
   126436   extern semantic_value global_result;
   126437   extern int global_count;
   126438 }
   126439 
   126440 %code
   126441 {
   126442 #include <assert.h>
   126443 #include <string.h>
   126444 #define USE(Var)
   126445 
   126446 FILE *input;
   126447 static int power (int base, int exponent);
   126448 
   126449 
   126450 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   126451 }
   126452 
   126453 
   126454 
   126455 /* Bison Declarations */
   126456 %token CALC_EOF 0 "end of input"
   126457 %token <ival> NUM "number"
   126458 %type  <ival> exp
   126459 
   126460 %nonassoc '=' /* comparison            */
   126461 %left '-' '+'
   126462 %left '*' '/'
   126463 %left NEG     /* negation--unary minus */
   126464 %right '^'    /* exponentiation        */
   126465 
   126466 /* Grammar follows */
   126467 %%
   126468 input:
   126469   line
   126470 | input line         { ++*count; ++global_count; }
   126471 ;
   126472 
   126473 line:
   126474   '\n'
   126475 | exp '\n'           { *result = global_result = $1; }
   126476 ;
   126477 
   126478 exp:
   126479   NUM                { $$ = $1;             }
   126480 | exp '=' exp
   126481   {
   126482     if ($1 != $3)
   126483       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   126484     $$ = $1;
   126485   }
   126486 | exp '+' exp        { $$ = $1 + $3;        }
   126487 | exp '-' exp        { $$ = $1 - $3;        }
   126488 | exp '*' exp        { $$ = $1 * $3;        }
   126489 | exp '/' exp        { $$ = $1 / $3;        }
   126490 | '-' exp  %prec NEG { $$ = -$2;            }
   126491 | exp '^' exp        { $$ = power ($1, $3); }
   126492 | '(' exp ')'        { $$ = $2;             }
   126493 | '(' error ')'      { $$ = 1111; yyerrok;  }
   126494 | '!'                { $$ = 0; YYERROR;     }
   126495 | '-' error          { $$ = 0; YYERROR;     }
   126496 ;
   126497 %%
   126498 
   126499 static int
   126500 power (int base, int exponent)
   126501 {
   126502   int res = 1;
   126503   assert (0 <= exponent);
   126504   for (/* Niente */; exponent; --exponent)
   126505     res *= base;
   126506   return res;
   126507 }
   126508 
   126509 
   126510 /* A C++ error reporting function.  */
   126511 void
   126512 calc::parser::error (const location_type& l, const std::string& m)
   126513 {
   126514   (void) l;
   126515   std::cerr << l << ": " << m << std::endl;
   126516 }
   126517 _ATEOF
   126518 
   126519 
   126520 
   126521 cat >calc-lex.cc <<'_ATEOF'
   126522 #include <config.h>
   126523 /* We don't need perfect functions for these tests. */
   126524 #undef malloc
   126525 #undef memcmp
   126526 #undef realloc
   126527 
   126528 #include "calc.hh"
   126529 
   126530 #include <ctype.h>
   126531 
   126532 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   126533 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   126534 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   126535 
   126536 
   126537 static calc::parser::location_type last_yylloc;
   126538 
   126539 static int
   126540 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   126541 {
   126542   int res = getc (input);
   126543   (void) lvalp;(void) llocp;
   126544 
   126545   last_yylloc = (*llocp);
   126546   if (res == '\n')
   126547     {
   126548       (*llocp).end.line++;
   126549       (*llocp).end.column = 1;
   126550     }
   126551   else
   126552     (*llocp).end.column++;
   126553 
   126554   return res;
   126555 }
   126556 
   126557 static void
   126558 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   126559 {
   126560   (void) lvalp;(void) llocp;
   126561 
   126562   /* Wrong when C == `\n'. */
   126563   (*llocp) = last_yylloc;
   126564 
   126565   ungetc (c, input);
   126566 }
   126567 
   126568 static int
   126569 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   126570 {
   126571   int c = get_char (lvalp, llocp);
   126572   int sign = 1;
   126573   int n = 0;
   126574 
   126575   (void) lvalp;(void) llocp;
   126576   if (c == '-')
   126577     {
   126578       c = get_char (lvalp, llocp);
   126579       sign = -1;
   126580     }
   126581 
   126582   while (isdigit (c))
   126583     {
   126584       n = 10 * n + (c - '0');
   126585       c = get_char (lvalp, llocp);
   126586     }
   126587 
   126588   unget_char (lvalp, llocp,  c);
   126589 
   126590   return sign * n;
   126591 }
   126592 
   126593 
   126594 /*---------------------------------------------------------------.
   126595 | Lexical analyzer returns an integer on the stack and the token |
   126596 | NUM, or the ASCII character read if not a number.  Skips all   |
   126597 | blanks and tabs, returns 0 for EOF.                            |
   126598 `---------------------------------------------------------------*/
   126599 
   126600 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   126601 {
   126602   int c;
   126603   /* Skip current token, then white spaces.  */
   126604   do
   126605     {
   126606      (*llocp).begin.column = (*llocp).end.column;
   126607       (*llocp).begin.line   = (*llocp).end.line;
   126608 
   126609     }
   126610   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   126611 
   126612   /* process numbers   */
   126613   if (c == '.' || isdigit (c))
   126614     {
   126615       unget_char (lvalp, llocp,  c);
   126616       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   126617       return NUM;
   126618     }
   126619 
   126620   /* Return end-of-file.  */
   126621   if (c == EOF)
   126622     return CALC_EOF;
   126623 
   126624   /* Return single chars. */
   126625   return c;
   126626 }
   126627 _ATEOF
   126628 
   126629 
   126630 cat >calc-main.cc <<'_ATEOF'
   126631 #include <config.h>
   126632 /* We don't need perfect functions for these tests. */
   126633 #undef malloc
   126634 #undef memcmp
   126635 #undef realloc
   126636 
   126637 #include "calc.hh"
   126638 
   126639 #include <assert.h>
   126640 #if HAVE_UNISTD_H
   126641 # include <unistd.h>
   126642 #else
   126643 # undef alarm
   126644 # define alarm(seconds) /* empty */
   126645 #endif
   126646 
   126647 
   126648 /* A C++ calcparse that simulates the C signature.  */
   126649 int
   126650 calcparse (semantic_value *result, int *count)
   126651 {
   126652   calc::parser parser (result, count);
   126653 #if YYDEBUG
   126654   parser.set_debug_level (1);
   126655 #endif
   126656   return parser.parse ();
   126657 }
   126658 
   126659 
   126660 semantic_value global_result = 0;
   126661 int global_count = 0;
   126662 
   126663 /* A C main function.  */
   126664 int
   126665 main (int argc, const char **argv)
   126666 {
   126667   semantic_value result = 0;
   126668   int count = 0;
   126669   int status;
   126670 
   126671   /* This used to be alarm (10), but that isn't enough time for
   126672      a July 1995 vintage DEC Alphastation 200 4/100 system,
   126673      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   126674   alarm (100);
   126675 
   126676   if (argc == 2)
   126677     input = fopen (argv[1], "r");
   126678   else
   126679     input = stdin;
   126680 
   126681   if (!input)
   126682     {
   126683       perror (argv[1]);
   126684       return 3;
   126685     }
   126686 
   126687 
   126688   status = calcparse (&result, &count);
   126689   if (fclose (input))
   126690     perror ("fclose");
   126691   assert (global_result == result);
   126692   assert (global_count == count);
   126693   return status;
   126694 }
   126695 _ATEOF
   126696 
   126697 
   126698 
   126699 
   126700 
   126701 
   126702 
   126703 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   126704   at_save_special_files
   126705   mkdir xml-tests
   126706     # Don't combine these Bison invocations since we want to be sure that
   126707   # --report=all isn't required to get the full XML file.
   126708   { set +x
   126709 $as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   126710                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   126711 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718"
   126712 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   126713                   --graph=xml-tests/test.dot -o calc.cc calc.y
   126714 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126715 at_status=$? at_failed=false
   126716 $at_check_filter
   126717 echo stderr:; cat "$at_stderr"
   126718 echo stdout:; cat "$at_stdout"
   126719 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126720 $at_failed && at_fn_log_failure
   126721 $at_traceon; }
   126722 
   126723   { set +x
   126724 $as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   126725 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:718"
   126726 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   126727 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126728 at_status=$? at_failed=false
   126729 $at_check_filter
   126730 echo stderr:; cat "$at_stderr"
   126731 echo stdout:; cat "$at_stdout"
   126732 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126733 $at_failed && at_fn_log_failure
   126734 $at_traceon; }
   126735 
   126736     cp xml-tests/test.output expout
   126737   { set +x
   126738 $as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\
   126739              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   126740              xml-tests/test.xml"
   126741 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718"
   126742 ( $at_check_trace; $XSLTPROC \
   126743              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   126744              xml-tests/test.xml
   126745 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126746 at_status=$? at_failed=false
   126747 $at_check_filter
   126748 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126749 $at_diff expout "$at_stdout" || at_failed=:
   126750 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126751 $at_failed && at_fn_log_failure
   126752 $at_traceon; }
   126753 
   126754   sort xml-tests/test.dot > expout
   126755   { set +x
   126756 $as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\
   126757              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   126758              xml-tests/test.xml | sort"
   126759 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718"
   126760 ( $at_check_trace; $XSLTPROC \
   126761              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   126762              xml-tests/test.xml | sort
   126763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126764 at_status=$? at_failed=false
   126765 $at_check_filter
   126766 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126767 $at_diff expout "$at_stdout" || at_failed=:
   126768 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126769 $at_failed && at_fn_log_failure
   126770 $at_traceon; }
   126771 
   126772   rm -rf xml-tests expout
   126773   at_restore_special_files
   126774 fi
   126775 { set +x
   126776 $as_echo "$at_srcdir/calc.at:718: bison -o calc.cc calc.y"
   126777 at_fn_check_prepare_trace "calc.at:718"
   126778 ( $at_check_trace; bison -o calc.cc calc.y
   126779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126780 at_status=$? at_failed=false
   126781 $at_check_filter
   126782 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126783 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126784 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126785 $at_failed && at_fn_log_failure
   126786 $at_traceon; }
   126787 
   126788 
   126789 
   126790 { set +x
   126791 $as_echo "$at_srcdir/calc.at:718: \$BISON_CXX_WORKS"
   126792 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:718"
   126793 ( $at_check_trace; $BISON_CXX_WORKS
   126794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126795 at_status=$? at_failed=false
   126796 $at_check_filter
   126797 echo stderr:; cat "$at_stderr"
   126798 echo stdout:; cat "$at_stdout"
   126799 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126800 $at_failed && at_fn_log_failure
   126801 $at_traceon; }
   126802 
   126803 { set +x
   126804 $as_echo "$at_srcdir/calc.at:718: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   126805 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:718"
   126806 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   126807 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126808 at_status=$? at_failed=false
   126809 $at_check_filter
   126810 echo stderr:; cat "$at_stderr"
   126811 echo stdout:; cat "$at_stdout"
   126812 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126813 $at_failed && at_fn_log_failure
   126814 $at_traceon; }
   126815 
   126816 
   126817 { set +x
   126818 $as_echo "$at_srcdir/calc.at:718: \$PERL -ne '
   126819   chomp;
   126820   print \"\$.: {\$_}\\n\"
   126821     if (# No starting/ending empty lines.
   126822         (eof || \$. == 1) && /^\\s*\$/
   126823         # No trailing space.  FIXME: not ready for \"maint\".
   126824         # || /\\s\$/
   126825         )' calc.cc
   126826 "
   126827 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718"
   126828 ( $at_check_trace; $PERL -ne '
   126829   chomp;
   126830   print "$.: {$_}\n"
   126831     if (# No starting/ending empty lines.
   126832         (eof || $. == 1) && /^\s*$/
   126833         # No trailing space.  FIXME: not ready for "maint".
   126834         # || /\s$/
   126835         )' calc.cc
   126836 
   126837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126838 at_status=$? at_failed=false
   126839 $at_check_filter
   126840 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126841 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126842 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126843 $at_failed && at_fn_log_failure
   126844 $at_traceon; }
   126845 
   126846 { set +x
   126847 $as_echo "$at_srcdir/calc.at:718: \$PERL -ne '
   126848   chomp;
   126849   print \"\$.: {\$_}\\n\"
   126850     if (# No starting/ending empty lines.
   126851         (eof || \$. == 1) && /^\\s*\$/
   126852         # No trailing space.  FIXME: not ready for \"maint\".
   126853         # || /\\s\$/
   126854         )' calc.hh
   126855 "
   126856 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718"
   126857 ( $at_check_trace; $PERL -ne '
   126858   chomp;
   126859   print "$.: {$_}\n"
   126860     if (# No starting/ending empty lines.
   126861         (eof || $. == 1) && /^\s*$/
   126862         # No trailing space.  FIXME: not ready for "maint".
   126863         # || /\s$/
   126864         )' calc.hh
   126865 
   126866 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126867 at_status=$? at_failed=false
   126868 $at_check_filter
   126869 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126870 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126871 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126872 $at_failed && at_fn_log_failure
   126873 $at_traceon; }
   126874 
   126875 
   126876 # Test the priorities.
   126877 cat >input <<'_ATEOF'
   126878 1 + 2 * 3 = 7
   126879 1 + 2 * -3 = -5
   126880 
   126881 -1^2 = -1
   126882 (-1)^2 = 1
   126883 
   126884 ---1 = -1
   126885 
   126886 1 - 2 - 3 = -4
   126887 1 - (2 - 3) = 2
   126888 
   126889 2^2^3 = 256
   126890 (2^2)^3 = 64
   126891 _ATEOF
   126892 
   126893 { set +x
   126894 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   126895 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   126896 ( $at_check_trace;  $PREPARSER ./calc input
   126897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126898 at_status=$? at_failed=false
   126899 $at_check_filter
   126900 echo stderr:; tee stderr <"$at_stderr"
   126901 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126902 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126903 $at_failed && at_fn_log_failure
   126904 $at_traceon; }
   126905 
   126906 { set +x
   126907 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   126908 at_fn_check_prepare_trace "calc.at:718"
   126909 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   126910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126911 at_status=$? at_failed=false
   126912 $at_check_filter
   126913 echo stderr:; tee stderr <"$at_stderr"
   126914 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126915 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126916 $at_failed && at_fn_log_failure
   126917 $at_traceon; }
   126918 
   126919 
   126920 
   126921 
   126922 # Some syntax errors.
   126923 cat >input <<'_ATEOF'
   126924 1 2
   126925 _ATEOF
   126926 
   126927 { set +x
   126928 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   126929 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   126930 ( $at_check_trace;  $PREPARSER ./calc input
   126931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126932 at_status=$? at_failed=false
   126933 $at_check_filter
   126934 echo stderr:; tee stderr <"$at_stderr"
   126935 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126936 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
   126937 $at_failed && at_fn_log_failure
   126938 $at_traceon; }
   126939 
   126940 { set +x
   126941 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   126942 at_fn_check_prepare_trace "calc.at:718"
   126943 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   126944 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126945 at_status=$? at_failed=false
   126946 $at_check_filter
   126947 echo stderr:; tee stderr <"$at_stderr"
   126948 at_fn_diff_devnull "$at_stdout" || at_failed=:
   126949 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126950 $at_failed && at_fn_log_failure
   126951 $at_traceon; }
   126952 
   126953 
   126954 
   126955 # Normalize the observed and expected error messages, depending upon the
   126956 # options.
   126957 # 1. Remove the traces from observed.
   126958 sed '/^Starting/d
   126959 /^Entering/d
   126960 /^Stack/d
   126961 /^Reading/d
   126962 /^Reducing/d
   126963 /^Return/d
   126964 /^Shifting/d
   126965 /^state/d
   126966 /^Cleanup:/d
   126967 /^Error:/d
   126968 /^Next/d
   126969 /^Now/d
   126970 /^Discarding/d
   126971 / \$[0-9$]* = /d
   126972 /^yydestructor:/d' stderr >at-stderr
   126973 mv at-stderr stderr
   126974 # 2. Create the reference error message.
   126975 cat >expout <<'_ATEOF'
   126976 1.3: syntax error, unexpected number
   126977 _ATEOF
   126978 
   126979 # 3. If locations are not used, remove them.
   126980 
   126981 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   126982 
   126983 # 5. Check
   126984 { set +x
   126985 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   126986 at_fn_check_prepare_trace "calc.at:718"
   126987 ( $at_check_trace; cat stderr
   126988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   126989 at_status=$? at_failed=false
   126990 $at_check_filter
   126991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   126992 $at_diff expout "$at_stdout" || at_failed=:
   126993 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   126994 $at_failed && at_fn_log_failure
   126995 $at_traceon; }
   126996 
   126997 
   126998 cat >input <<'_ATEOF'
   126999 1//2
   127000 _ATEOF
   127001 
   127002 { set +x
   127003 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127004 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127005 ( $at_check_trace;  $PREPARSER ./calc input
   127006 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127007 at_status=$? at_failed=false
   127008 $at_check_filter
   127009 echo stderr:; tee stderr <"$at_stderr"
   127010 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127011 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
   127012 $at_failed && at_fn_log_failure
   127013 $at_traceon; }
   127014 
   127015 { set +x
   127016 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127017 at_fn_check_prepare_trace "calc.at:718"
   127018 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127020 at_status=$? at_failed=false
   127021 $at_check_filter
   127022 echo stderr:; tee stderr <"$at_stderr"
   127023 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127024 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127025 $at_failed && at_fn_log_failure
   127026 $at_traceon; }
   127027 
   127028 
   127029 
   127030 # Normalize the observed and expected error messages, depending upon the
   127031 # options.
   127032 # 1. Remove the traces from observed.
   127033 sed '/^Starting/d
   127034 /^Entering/d
   127035 /^Stack/d
   127036 /^Reading/d
   127037 /^Reducing/d
   127038 /^Return/d
   127039 /^Shifting/d
   127040 /^state/d
   127041 /^Cleanup:/d
   127042 /^Error:/d
   127043 /^Next/d
   127044 /^Now/d
   127045 /^Discarding/d
   127046 / \$[0-9$]* = /d
   127047 /^yydestructor:/d' stderr >at-stderr
   127048 mv at-stderr stderr
   127049 # 2. Create the reference error message.
   127050 cat >expout <<'_ATEOF'
   127051 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   127052 _ATEOF
   127053 
   127054 # 3. If locations are not used, remove them.
   127055 
   127056 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127057 
   127058 # 5. Check
   127059 { set +x
   127060 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127061 at_fn_check_prepare_trace "calc.at:718"
   127062 ( $at_check_trace; cat stderr
   127063 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127064 at_status=$? at_failed=false
   127065 $at_check_filter
   127066 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127067 $at_diff expout "$at_stdout" || at_failed=:
   127068 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127069 $at_failed && at_fn_log_failure
   127070 $at_traceon; }
   127071 
   127072 
   127073 cat >input <<'_ATEOF'
   127074 error
   127075 _ATEOF
   127076 
   127077 { set +x
   127078 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127079 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127080 ( $at_check_trace;  $PREPARSER ./calc input
   127081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127082 at_status=$? at_failed=false
   127083 $at_check_filter
   127084 echo stderr:; tee stderr <"$at_stderr"
   127085 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127086 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
   127087 $at_failed && at_fn_log_failure
   127088 $at_traceon; }
   127089 
   127090 { set +x
   127091 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127092 at_fn_check_prepare_trace "calc.at:718"
   127093 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127094 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127095 at_status=$? at_failed=false
   127096 $at_check_filter
   127097 echo stderr:; tee stderr <"$at_stderr"
   127098 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127099 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127100 $at_failed && at_fn_log_failure
   127101 $at_traceon; }
   127102 
   127103 
   127104 
   127105 # Normalize the observed and expected error messages, depending upon the
   127106 # options.
   127107 # 1. Remove the traces from observed.
   127108 sed '/^Starting/d
   127109 /^Entering/d
   127110 /^Stack/d
   127111 /^Reading/d
   127112 /^Reducing/d
   127113 /^Return/d
   127114 /^Shifting/d
   127115 /^state/d
   127116 /^Cleanup:/d
   127117 /^Error:/d
   127118 /^Next/d
   127119 /^Now/d
   127120 /^Discarding/d
   127121 / \$[0-9$]* = /d
   127122 /^yydestructor:/d' stderr >at-stderr
   127123 mv at-stderr stderr
   127124 # 2. Create the reference error message.
   127125 cat >expout <<'_ATEOF'
   127126 1.1: syntax error, unexpected $undefined
   127127 _ATEOF
   127128 
   127129 # 3. If locations are not used, remove them.
   127130 
   127131 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127132 
   127133 # 5. Check
   127134 { set +x
   127135 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127136 at_fn_check_prepare_trace "calc.at:718"
   127137 ( $at_check_trace; cat stderr
   127138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127139 at_status=$? at_failed=false
   127140 $at_check_filter
   127141 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127142 $at_diff expout "$at_stdout" || at_failed=:
   127143 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127144 $at_failed && at_fn_log_failure
   127145 $at_traceon; }
   127146 
   127147 
   127148 cat >input <<'_ATEOF'
   127149 1 = 2 = 3
   127150 _ATEOF
   127151 
   127152 { set +x
   127153 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127154 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127155 ( $at_check_trace;  $PREPARSER ./calc input
   127156 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127157 at_status=$? at_failed=false
   127158 $at_check_filter
   127159 echo stderr:; tee stderr <"$at_stderr"
   127160 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127161 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
   127162 $at_failed && at_fn_log_failure
   127163 $at_traceon; }
   127164 
   127165 { set +x
   127166 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127167 at_fn_check_prepare_trace "calc.at:718"
   127168 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127170 at_status=$? at_failed=false
   127171 $at_check_filter
   127172 echo stderr:; tee stderr <"$at_stderr"
   127173 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127174 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127175 $at_failed && at_fn_log_failure
   127176 $at_traceon; }
   127177 
   127178 
   127179 
   127180 # Normalize the observed and expected error messages, depending upon the
   127181 # options.
   127182 # 1. Remove the traces from observed.
   127183 sed '/^Starting/d
   127184 /^Entering/d
   127185 /^Stack/d
   127186 /^Reading/d
   127187 /^Reducing/d
   127188 /^Return/d
   127189 /^Shifting/d
   127190 /^state/d
   127191 /^Cleanup:/d
   127192 /^Error:/d
   127193 /^Next/d
   127194 /^Now/d
   127195 /^Discarding/d
   127196 / \$[0-9$]* = /d
   127197 /^yydestructor:/d' stderr >at-stderr
   127198 mv at-stderr stderr
   127199 # 2. Create the reference error message.
   127200 cat >expout <<'_ATEOF'
   127201 1.7: syntax error, unexpected '='
   127202 _ATEOF
   127203 
   127204 # 3. If locations are not used, remove them.
   127205 
   127206 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127207 
   127208 # 5. Check
   127209 { set +x
   127210 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127211 at_fn_check_prepare_trace "calc.at:718"
   127212 ( $at_check_trace; cat stderr
   127213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127214 at_status=$? at_failed=false
   127215 $at_check_filter
   127216 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127217 $at_diff expout "$at_stdout" || at_failed=:
   127218 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127219 $at_failed && at_fn_log_failure
   127220 $at_traceon; }
   127221 
   127222 
   127223 cat >input <<'_ATEOF'
   127224 
   127225 +1
   127226 _ATEOF
   127227 
   127228 { set +x
   127229 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127230 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127231 ( $at_check_trace;  $PREPARSER ./calc input
   127232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127233 at_status=$? at_failed=false
   127234 $at_check_filter
   127235 echo stderr:; tee stderr <"$at_stderr"
   127236 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127237 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
   127238 $at_failed && at_fn_log_failure
   127239 $at_traceon; }
   127240 
   127241 { set +x
   127242 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127243 at_fn_check_prepare_trace "calc.at:718"
   127244 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127245 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127246 at_status=$? at_failed=false
   127247 $at_check_filter
   127248 echo stderr:; tee stderr <"$at_stderr"
   127249 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127250 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127251 $at_failed && at_fn_log_failure
   127252 $at_traceon; }
   127253 
   127254 
   127255 
   127256 # Normalize the observed and expected error messages, depending upon the
   127257 # options.
   127258 # 1. Remove the traces from observed.
   127259 sed '/^Starting/d
   127260 /^Entering/d
   127261 /^Stack/d
   127262 /^Reading/d
   127263 /^Reducing/d
   127264 /^Return/d
   127265 /^Shifting/d
   127266 /^state/d
   127267 /^Cleanup:/d
   127268 /^Error:/d
   127269 /^Next/d
   127270 /^Now/d
   127271 /^Discarding/d
   127272 / \$[0-9$]* = /d
   127273 /^yydestructor:/d' stderr >at-stderr
   127274 mv at-stderr stderr
   127275 # 2. Create the reference error message.
   127276 cat >expout <<'_ATEOF'
   127277 2.1: syntax error, unexpected '+'
   127278 _ATEOF
   127279 
   127280 # 3. If locations are not used, remove them.
   127281 
   127282 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127283 
   127284 # 5. Check
   127285 { set +x
   127286 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127287 at_fn_check_prepare_trace "calc.at:718"
   127288 ( $at_check_trace; cat stderr
   127289 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127290 at_status=$? at_failed=false
   127291 $at_check_filter
   127292 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127293 $at_diff expout "$at_stdout" || at_failed=:
   127294 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127295 $at_failed && at_fn_log_failure
   127296 $at_traceon; }
   127297 
   127298 
   127299 # Exercise error messages with EOF: work on an empty file.
   127300 { set +x
   127301 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc /dev/null"
   127302 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:718"
   127303 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   127304 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127305 at_status=$? at_failed=false
   127306 $at_check_filter
   127307 echo stderr:; tee stderr <"$at_stderr"
   127308 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127309 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
   127310 $at_failed && at_fn_log_failure
   127311 $at_traceon; }
   127312 
   127313 { set +x
   127314 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127315 at_fn_check_prepare_trace "calc.at:718"
   127316 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127317 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127318 at_status=$? at_failed=false
   127319 $at_check_filter
   127320 echo stderr:; tee stderr <"$at_stderr"
   127321 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127322 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127323 $at_failed && at_fn_log_failure
   127324 $at_traceon; }
   127325 
   127326 
   127327 
   127328 # Normalize the observed and expected error messages, depending upon the
   127329 # options.
   127330 # 1. Remove the traces from observed.
   127331 sed '/^Starting/d
   127332 /^Entering/d
   127333 /^Stack/d
   127334 /^Reading/d
   127335 /^Reducing/d
   127336 /^Return/d
   127337 /^Shifting/d
   127338 /^state/d
   127339 /^Cleanup:/d
   127340 /^Error:/d
   127341 /^Next/d
   127342 /^Now/d
   127343 /^Discarding/d
   127344 / \$[0-9$]* = /d
   127345 /^yydestructor:/d' stderr >at-stderr
   127346 mv at-stderr stderr
   127347 # 2. Create the reference error message.
   127348 cat >expout <<'_ATEOF'
   127349 1.1: syntax error, unexpected end of input
   127350 _ATEOF
   127351 
   127352 # 3. If locations are not used, remove them.
   127353 
   127354 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127355 
   127356 # 5. Check
   127357 { set +x
   127358 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127359 at_fn_check_prepare_trace "calc.at:718"
   127360 ( $at_check_trace; cat stderr
   127361 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127362 at_status=$? at_failed=false
   127363 $at_check_filter
   127364 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127365 $at_diff expout "$at_stdout" || at_failed=:
   127366 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127367 $at_failed && at_fn_log_failure
   127368 $at_traceon; }
   127369 
   127370 
   127371 
   127372 # Exercise the error token: without it, we die at the first error,
   127373 # hence be sure to
   127374 #
   127375 # - have several errors which exercise different shift/discardings
   127376 #   - (): nothing to pop, nothing to discard
   127377 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   127378 #   - (* * *): nothing to pop, a lot to discard
   127379 #   - (1 + 2 * *): some to pop and discard
   127380 #
   127381 # - test the action associated to `error'
   127382 #
   127383 # - check the lookahead that triggers an error is not discarded
   127384 #   when we enter error recovery.  Below, the lookahead causing the
   127385 #   first error is ")", which is needed to recover from the error and
   127386 #   produce the "0" that triggers the "0 != 1" error.
   127387 #
   127388 cat >input <<'_ATEOF'
   127389 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   127390 _ATEOF
   127391 
   127392 { set +x
   127393 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127394 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127395 ( $at_check_trace;  $PREPARSER ./calc input
   127396 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127397 at_status=$? at_failed=false
   127398 $at_check_filter
   127399 echo stderr:; tee stderr <"$at_stderr"
   127400 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127401 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127402 $at_failed && at_fn_log_failure
   127403 $at_traceon; }
   127404 
   127405 { set +x
   127406 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127407 at_fn_check_prepare_trace "calc.at:718"
   127408 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127409 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127410 at_status=$? at_failed=false
   127411 $at_check_filter
   127412 echo stderr:; tee stderr <"$at_stderr"
   127413 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127414 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127415 $at_failed && at_fn_log_failure
   127416 $at_traceon; }
   127417 
   127418 
   127419 
   127420 # Normalize the observed and expected error messages, depending upon the
   127421 # options.
   127422 # 1. Remove the traces from observed.
   127423 sed '/^Starting/d
   127424 /^Entering/d
   127425 /^Stack/d
   127426 /^Reading/d
   127427 /^Reducing/d
   127428 /^Return/d
   127429 /^Shifting/d
   127430 /^state/d
   127431 /^Cleanup:/d
   127432 /^Error:/d
   127433 /^Next/d
   127434 /^Now/d
   127435 /^Discarding/d
   127436 / \$[0-9$]* = /d
   127437 /^yydestructor:/d' stderr >at-stderr
   127438 mv at-stderr stderr
   127439 # 2. Create the reference error message.
   127440 cat >expout <<'_ATEOF'
   127441 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   127442 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   127443 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   127444 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   127445 calc: error: 4444 != 1
   127446 _ATEOF
   127447 
   127448 # 3. If locations are not used, remove them.
   127449 
   127450 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127451 
   127452 # 5. Check
   127453 { set +x
   127454 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127455 at_fn_check_prepare_trace "calc.at:718"
   127456 ( $at_check_trace; cat stderr
   127457 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127458 at_status=$? at_failed=false
   127459 $at_check_filter
   127460 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127461 $at_diff expout "$at_stdout" || at_failed=:
   127462 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127463 $at_failed && at_fn_log_failure
   127464 $at_traceon; }
   127465 
   127466 
   127467 
   127468 # The same, but this time exercising explicitly triggered syntax errors.
   127469 # POSIX says the lookahead causing the error should not be discarded.
   127470 cat >input <<'_ATEOF'
   127471 (!) + (1 2) = 1
   127472 _ATEOF
   127473 
   127474 { set +x
   127475 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127476 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127477 ( $at_check_trace;  $PREPARSER ./calc input
   127478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127479 at_status=$? at_failed=false
   127480 $at_check_filter
   127481 echo stderr:; tee stderr <"$at_stderr"
   127482 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127483 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127484 $at_failed && at_fn_log_failure
   127485 $at_traceon; }
   127486 
   127487 { set +x
   127488 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127489 at_fn_check_prepare_trace "calc.at:718"
   127490 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127491 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127492 at_status=$? at_failed=false
   127493 $at_check_filter
   127494 echo stderr:; tee stderr <"$at_stderr"
   127495 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127496 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127497 $at_failed && at_fn_log_failure
   127498 $at_traceon; }
   127499 
   127500 
   127501 
   127502 # Normalize the observed and expected error messages, depending upon the
   127503 # options.
   127504 # 1. Remove the traces from observed.
   127505 sed '/^Starting/d
   127506 /^Entering/d
   127507 /^Stack/d
   127508 /^Reading/d
   127509 /^Reducing/d
   127510 /^Return/d
   127511 /^Shifting/d
   127512 /^state/d
   127513 /^Cleanup:/d
   127514 /^Error:/d
   127515 /^Next/d
   127516 /^Now/d
   127517 /^Discarding/d
   127518 / \$[0-9$]* = /d
   127519 /^yydestructor:/d' stderr >at-stderr
   127520 mv at-stderr stderr
   127521 # 2. Create the reference error message.
   127522 cat >expout <<'_ATEOF'
   127523 1.10: syntax error, unexpected number
   127524 calc: error: 2222 != 1
   127525 _ATEOF
   127526 
   127527 # 3. If locations are not used, remove them.
   127528 
   127529 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127530 
   127531 # 5. Check
   127532 { set +x
   127533 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127534 at_fn_check_prepare_trace "calc.at:718"
   127535 ( $at_check_trace; cat stderr
   127536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127537 at_status=$? at_failed=false
   127538 $at_check_filter
   127539 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127540 $at_diff expout "$at_stdout" || at_failed=:
   127541 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127542 $at_failed && at_fn_log_failure
   127543 $at_traceon; }
   127544 
   127545 
   127546 cat >input <<'_ATEOF'
   127547 (- *) + (1 2) = 1
   127548 _ATEOF
   127549 
   127550 { set +x
   127551 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127552 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127553 ( $at_check_trace;  $PREPARSER ./calc input
   127554 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127555 at_status=$? at_failed=false
   127556 $at_check_filter
   127557 echo stderr:; tee stderr <"$at_stderr"
   127558 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127559 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127560 $at_failed && at_fn_log_failure
   127561 $at_traceon; }
   127562 
   127563 { set +x
   127564 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127565 at_fn_check_prepare_trace "calc.at:718"
   127566 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127568 at_status=$? at_failed=false
   127569 $at_check_filter
   127570 echo stderr:; tee stderr <"$at_stderr"
   127571 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127572 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127573 $at_failed && at_fn_log_failure
   127574 $at_traceon; }
   127575 
   127576 
   127577 
   127578 # Normalize the observed and expected error messages, depending upon the
   127579 # options.
   127580 # 1. Remove the traces from observed.
   127581 sed '/^Starting/d
   127582 /^Entering/d
   127583 /^Stack/d
   127584 /^Reading/d
   127585 /^Reducing/d
   127586 /^Return/d
   127587 /^Shifting/d
   127588 /^state/d
   127589 /^Cleanup:/d
   127590 /^Error:/d
   127591 /^Next/d
   127592 /^Now/d
   127593 /^Discarding/d
   127594 / \$[0-9$]* = /d
   127595 /^yydestructor:/d' stderr >at-stderr
   127596 mv at-stderr stderr
   127597 # 2. Create the reference error message.
   127598 cat >expout <<'_ATEOF'
   127599 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   127600 1.12: syntax error, unexpected number
   127601 calc: error: 2222 != 1
   127602 _ATEOF
   127603 
   127604 # 3. If locations are not used, remove them.
   127605 
   127606 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127607 
   127608 # 5. Check
   127609 { set +x
   127610 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127611 at_fn_check_prepare_trace "calc.at:718"
   127612 ( $at_check_trace; cat stderr
   127613 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127614 at_status=$? at_failed=false
   127615 $at_check_filter
   127616 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127617 $at_diff expout "$at_stdout" || at_failed=:
   127618 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127619 $at_failed && at_fn_log_failure
   127620 $at_traceon; }
   127621 
   127622 
   127623 
   127624 # Check that yyerrok works properly: second error is not reported,
   127625 # third and fourth are.  Parse status is succesfull.
   127626 cat >input <<'_ATEOF'
   127627 (* *) + (*) + (*)
   127628 _ATEOF
   127629 
   127630 { set +x
   127631 $as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
   127632 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
   127633 ( $at_check_trace;  $PREPARSER ./calc input
   127634 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127635 at_status=$? at_failed=false
   127636 $at_check_filter
   127637 echo stderr:; tee stderr <"$at_stderr"
   127638 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127639 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127640 $at_failed && at_fn_log_failure
   127641 $at_traceon; }
   127642 
   127643 { set +x
   127644 $as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   127645 at_fn_check_prepare_trace "calc.at:718"
   127646 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   127647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127648 at_status=$? at_failed=false
   127649 $at_check_filter
   127650 echo stderr:; tee stderr <"$at_stderr"
   127651 at_fn_diff_devnull "$at_stdout" || at_failed=:
   127652 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127653 $at_failed && at_fn_log_failure
   127654 $at_traceon; }
   127655 
   127656 
   127657 
   127658 # Normalize the observed and expected error messages, depending upon the
   127659 # options.
   127660 # 1. Remove the traces from observed.
   127661 sed '/^Starting/d
   127662 /^Entering/d
   127663 /^Stack/d
   127664 /^Reading/d
   127665 /^Reducing/d
   127666 /^Return/d
   127667 /^Shifting/d
   127668 /^state/d
   127669 /^Cleanup:/d
   127670 /^Error:/d
   127671 /^Next/d
   127672 /^Now/d
   127673 /^Discarding/d
   127674 / \$[0-9$]* = /d
   127675 /^yydestructor:/d' stderr >at-stderr
   127676 mv at-stderr stderr
   127677 # 2. Create the reference error message.
   127678 cat >expout <<'_ATEOF'
   127679 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   127680 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   127681 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   127682 _ATEOF
   127683 
   127684 # 3. If locations are not used, remove them.
   127685 
   127686 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   127687 
   127688 # 5. Check
   127689 { set +x
   127690 $as_echo "$at_srcdir/calc.at:718: cat stderr"
   127691 at_fn_check_prepare_trace "calc.at:718"
   127692 ( $at_check_trace; cat stderr
   127693 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   127694 at_status=$? at_failed=false
   127695 $at_check_filter
   127696 at_fn_diff_devnull "$at_stderr" || at_failed=:
   127697 $at_diff expout "$at_stdout" || at_failed=:
   127698 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
   127699 $at_failed && at_fn_log_failure
   127700 $at_traceon; }
   127701 
   127702 
   127703 
   127704 
   127705 
   127706   set +x
   127707   $at_times_p && times >"$at_times_file"
   127708 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   127709 read at_status <"$at_status_file"
   127710 #AT_STOP_252
   127711 #AT_START_253
   127712 at_fn_group_banner 253 'calc.at:719' \
   127713   "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14
   127714 at_xfail=no
   127715 (
   127716   $as_echo "253. $at_setup_line: testing $at_desc ..."
   127717   $at_traceon
   127718 
   127719 
   127720 
   127721 
   127722 
   127723 
   127724 
   127725 
   127726 
   127727 
   127728 cat >calc.y <<'_ATEOF'
   127729 %code top {
   127730 #include <config.h>
   127731 /* We don't need perfect functions for these tests. */
   127732 #undef malloc
   127733 #undef memcmp
   127734 #undef realloc
   127735 }
   127736 
   127737 /* Infix notation calculator--calc */
   127738 %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
   127739 %define global_tokens_and_yystype
   127740 %code requires
   127741 {
   127742 
   127743   /* Exercise pre-prologue dependency to %union.  */
   127744   typedef int semantic_value;
   127745 }
   127746 
   127747 /* Exercise %union. */
   127748 %union
   127749 {
   127750   semantic_value ival;
   127751 };
   127752 %printer { yyoutput << $$; } <ival>;
   127753 
   127754 %code provides
   127755 {
   127756   #include <stdio.h>
   127757   /* The input.  */
   127758   extern FILE *input;
   127759   extern semantic_value global_result;
   127760   extern int global_count;
   127761 }
   127762 
   127763 %code
   127764 {
   127765 #include <assert.h>
   127766 #include <string.h>
   127767 #define USE(Var)
   127768 
   127769 FILE *input;
   127770 static int power (int base, int exponent);
   127771 
   127772 
   127773 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   127774 }
   127775 
   127776 
   127777 
   127778 /* Bison Declarations */
   127779 %token CALC_EOF 0 "end of input"
   127780 %token <ival> NUM "number"
   127781 %type  <ival> exp
   127782 
   127783 %nonassoc '=' /* comparison            */
   127784 %left '-' '+'
   127785 %left '*' '/'
   127786 %left NEG     /* negation--unary minus */
   127787 %right '^'    /* exponentiation        */
   127788 
   127789 /* Grammar follows */
   127790 %%
   127791 input:
   127792   line
   127793 | input line         { ++*count; ++global_count; }
   127794 ;
   127795 
   127796 line:
   127797   '\n'
   127798 | exp '\n'           { *result = global_result = $1; }
   127799 ;
   127800 
   127801 exp:
   127802   NUM                { $$ = $1;             }
   127803 | exp '=' exp
   127804   {
   127805     if ($1 != $3)
   127806       fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
   127807     $$ = $1;
   127808   }
   127809 | exp '+' exp        { $$ = $1 + $3;        }
   127810 | exp '-' exp        { $$ = $1 - $3;        }
   127811 | exp '*' exp        { $$ = $1 * $3;        }
   127812 | exp '/' exp        { $$ = $1 / $3;        }
   127813 | '-' exp  %prec NEG { $$ = -$2;            }
   127814 | exp '^' exp        { $$ = power ($1, $3); }
   127815 | '(' exp ')'        { $$ = $2;             }
   127816 | '(' error ')'      { $$ = 1111; yyerrok;  }
   127817 | '!'                { $$ = 0; YYERROR;     }
   127818 | '-' error          { $$ = 0; YYERROR;     }
   127819 ;
   127820 %%
   127821 
   127822 static int
   127823 power (int base, int exponent)
   127824 {
   127825   int res = 1;
   127826   assert (0 <= exponent);
   127827   for (/* Niente */; exponent; --exponent)
   127828     res *= base;
   127829   return res;
   127830 }
   127831 
   127832 
   127833 /* A C++ error reporting function.  */
   127834 void
   127835 calc::parser::error (const location_type& l, const std::string& m)
   127836 {
   127837   (void) l;
   127838   std::cerr << l << ": " << m << std::endl;
   127839 }
   127840 _ATEOF
   127841 
   127842 
   127843 
   127844 cat >calc-lex.cc <<'_ATEOF'
   127845 #include <config.h>
   127846 /* We don't need perfect functions for these tests. */
   127847 #undef malloc
   127848 #undef memcmp
   127849 #undef realloc
   127850 
   127851 #include "calc.hh"
   127852 
   127853 #include <ctype.h>
   127854 
   127855 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   127856 static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
   127857 static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);
   127858 
   127859 
   127860 static calc::parser::location_type last_yylloc;
   127861 
   127862 static int
   127863 get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   127864 {
   127865   int res = getc (input);
   127866   (void) lvalp;(void) llocp;
   127867 
   127868   last_yylloc = (*llocp);
   127869   if (res == '\n')
   127870     {
   127871       (*llocp).end.line++;
   127872       (*llocp).end.column = 1;
   127873     }
   127874   else
   127875     (*llocp).end.column++;
   127876 
   127877   return res;
   127878 }
   127879 
   127880 static void
   127881 unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
   127882 {
   127883   (void) lvalp;(void) llocp;
   127884 
   127885   /* Wrong when C == `\n'. */
   127886   (*llocp) = last_yylloc;
   127887 
   127888   ungetc (c, input);
   127889 }
   127890 
   127891 static int
   127892 read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   127893 {
   127894   int c = get_char (lvalp, llocp);
   127895   int sign = 1;
   127896   int n = 0;
   127897 
   127898   (void) lvalp;(void) llocp;
   127899   if (c == '-')
   127900     {
   127901       c = get_char (lvalp, llocp);
   127902       sign = -1;
   127903     }
   127904 
   127905   while (isdigit (c))
   127906     {
   127907       n = 10 * n + (c - '0');
   127908       c = get_char (lvalp, llocp);
   127909     }
   127910 
   127911   unget_char (lvalp, llocp,  c);
   127912 
   127913   return sign * n;
   127914 }
   127915 
   127916 
   127917 /*---------------------------------------------------------------.
   127918 | Lexical analyzer returns an integer on the stack and the token |
   127919 | NUM, or the ASCII character read if not a number.  Skips all   |
   127920 | blanks and tabs, returns 0 for EOF.                            |
   127921 `---------------------------------------------------------------*/
   127922 
   127923 int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
   127924 {
   127925   int c;
   127926   /* Skip current token, then white spaces.  */
   127927   do
   127928     {
   127929      (*llocp).begin.column = (*llocp).end.column;
   127930       (*llocp).begin.line   = (*llocp).end.line;
   127931 
   127932     }
   127933   while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');
   127934 
   127935   /* process numbers   */
   127936   if (c == '.' || isdigit (c))
   127937     {
   127938       unget_char (lvalp, llocp,  c);
   127939       (*lvalp).ival = read_signed_integer (lvalp, llocp);
   127940       return NUM;
   127941     }
   127942 
   127943   /* Return end-of-file.  */
   127944   if (c == EOF)
   127945     return CALC_EOF;
   127946 
   127947   /* Return single chars. */
   127948   return c;
   127949 }
   127950 _ATEOF
   127951 
   127952 
   127953 cat >calc-main.cc <<'_ATEOF'
   127954 #include <config.h>
   127955 /* We don't need perfect functions for these tests. */
   127956 #undef malloc
   127957 #undef memcmp
   127958 #undef realloc
   127959 
   127960 #include "calc.hh"
   127961 
   127962 #include <assert.h>
   127963 #if HAVE_UNISTD_H
   127964 # include <unistd.h>
   127965 #else
   127966 # undef alarm
   127967 # define alarm(seconds) /* empty */
   127968 #endif
   127969 
   127970 
   127971 /* A C++ calcparse that simulates the C signature.  */
   127972 int
   127973 calcparse (semantic_value *result, int *count)
   127974 {
   127975   calc::parser parser (result, count);
   127976 #if CALCDEBUG
   127977   parser.set_debug_level (1);
   127978 #endif
   127979   return parser.parse ();
   127980 }
   127981 
   127982 
   127983 semantic_value global_result = 0;
   127984 int global_count = 0;
   127985 
   127986 /* A C main function.  */
   127987 int
   127988 main (int argc, const char **argv)
   127989 {
   127990   semantic_value result = 0;
   127991   int count = 0;
   127992   int status;
   127993 
   127994   /* This used to be alarm (10), but that isn't enough time for
   127995      a July 1995 vintage DEC Alphastation 200 4/100 system,
   127996      according to Nelson H. F. Beebe.  100 seconds is enough.  */
   127997   alarm (100);
   127998 
   127999   if (argc == 2)
   128000     input = fopen (argv[1], "r");
   128001   else
   128002     input = stdin;
   128003 
   128004   if (!input)
   128005     {
   128006       perror (argv[1]);
   128007       return 3;
   128008     }
   128009 
   128010 
   128011   status = calcparse (&result, &count);
   128012   if (fclose (input))
   128013     perror ("fclose");
   128014   assert (global_result == result);
   128015   assert (global_count == count);
   128016   return status;
   128017 }
   128018 _ATEOF
   128019 
   128020 
   128021 
   128022 
   128023 
   128024 
   128025 
   128026 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   128027   at_save_special_files
   128028   mkdir xml-tests
   128029     # Don't combine these Bison invocations since we want to be sure that
   128030   # --report=all isn't required to get the full XML file.
   128031   { set +x
   128032 $as_echo "$at_srcdir/calc.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   128033                   --graph=xml-tests/test.dot -o calc.cc calc.y"
   128034 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719"
   128035 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   128036                   --graph=xml-tests/test.dot -o calc.cc calc.y
   128037 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128038 at_status=$? at_failed=false
   128039 $at_check_filter
   128040 echo stderr:; cat "$at_stderr"
   128041 echo stdout:; cat "$at_stdout"
   128042 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128043 $at_failed && at_fn_log_failure
   128044 $at_traceon; }
   128045 
   128046   { set +x
   128047 $as_echo "$at_srcdir/calc.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y"
   128048 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:719"
   128049 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y
   128050 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128051 at_status=$? at_failed=false
   128052 $at_check_filter
   128053 echo stderr:; cat "$at_stderr"
   128054 echo stdout:; cat "$at_stdout"
   128055 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128056 $at_failed && at_fn_log_failure
   128057 $at_traceon; }
   128058 
   128059     cp xml-tests/test.output expout
   128060   { set +x
   128061 $as_echo "$at_srcdir/calc.at:719: \$XSLTPROC \\
   128062              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   128063              xml-tests/test.xml"
   128064 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:719"
   128065 ( $at_check_trace; $XSLTPROC \
   128066              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   128067              xml-tests/test.xml
   128068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128069 at_status=$? at_failed=false
   128070 $at_check_filter
   128071 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128072 $at_diff expout "$at_stdout" || at_failed=:
   128073 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128074 $at_failed && at_fn_log_failure
   128075 $at_traceon; }
   128076 
   128077   sort xml-tests/test.dot > expout
   128078   { set +x
   128079 $as_echo "$at_srcdir/calc.at:719: \$XSLTPROC \\
   128080              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   128081              xml-tests/test.xml | sort"
   128082 at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:719"
   128083 ( $at_check_trace; $XSLTPROC \
   128084              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   128085              xml-tests/test.xml | sort
   128086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128087 at_status=$? at_failed=false
   128088 $at_check_filter
   128089 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128090 $at_diff expout "$at_stdout" || at_failed=:
   128091 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128092 $at_failed && at_fn_log_failure
   128093 $at_traceon; }
   128094 
   128095   rm -rf xml-tests expout
   128096   at_restore_special_files
   128097 fi
   128098 { set +x
   128099 $as_echo "$at_srcdir/calc.at:719: bison -o calc.cc calc.y"
   128100 at_fn_check_prepare_trace "calc.at:719"
   128101 ( $at_check_trace; bison -o calc.cc calc.y
   128102 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128103 at_status=$? at_failed=false
   128104 $at_check_filter
   128105 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128106 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128107 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128108 $at_failed && at_fn_log_failure
   128109 $at_traceon; }
   128110 
   128111 
   128112 
   128113 { set +x
   128114 $as_echo "$at_srcdir/calc.at:719: \$BISON_CXX_WORKS"
   128115 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:719"
   128116 ( $at_check_trace; $BISON_CXX_WORKS
   128117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128118 at_status=$? at_failed=false
   128119 $at_check_filter
   128120 echo stderr:; cat "$at_stderr"
   128121 echo stdout:; cat "$at_stdout"
   128122 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128123 $at_failed && at_fn_log_failure
   128124 $at_traceon; }
   128125 
   128126 { set +x
   128127 $as_echo "$at_srcdir/calc.at:719: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
   128128 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:719"
   128129 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
   128130 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128131 at_status=$? at_failed=false
   128132 $at_check_filter
   128133 echo stderr:; cat "$at_stderr"
   128134 echo stdout:; cat "$at_stdout"
   128135 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128136 $at_failed && at_fn_log_failure
   128137 $at_traceon; }
   128138 
   128139 
   128140 { set +x
   128141 $as_echo "$at_srcdir/calc.at:719: \$PERL -ne '
   128142   chomp;
   128143   print \"\$.: {\$_}\\n\"
   128144     if (# No starting/ending empty lines.
   128145         (eof || \$. == 1) && /^\\s*\$/
   128146         # No trailing space.  FIXME: not ready for \"maint\".
   128147         # || /\\s\$/
   128148         )' calc.cc
   128149 "
   128150 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719"
   128151 ( $at_check_trace; $PERL -ne '
   128152   chomp;
   128153   print "$.: {$_}\n"
   128154     if (# No starting/ending empty lines.
   128155         (eof || $. == 1) && /^\s*$/
   128156         # No trailing space.  FIXME: not ready for "maint".
   128157         # || /\s$/
   128158         )' calc.cc
   128159 
   128160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128161 at_status=$? at_failed=false
   128162 $at_check_filter
   128163 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128164 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128165 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128166 $at_failed && at_fn_log_failure
   128167 $at_traceon; }
   128168 
   128169 { set +x
   128170 $as_echo "$at_srcdir/calc.at:719: \$PERL -ne '
   128171   chomp;
   128172   print \"\$.: {\$_}\\n\"
   128173     if (# No starting/ending empty lines.
   128174         (eof || \$. == 1) && /^\\s*\$/
   128175         # No trailing space.  FIXME: not ready for \"maint\".
   128176         # || /\\s\$/
   128177         )' calc.hh
   128178 "
   128179 at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719"
   128180 ( $at_check_trace; $PERL -ne '
   128181   chomp;
   128182   print "$.: {$_}\n"
   128183     if (# No starting/ending empty lines.
   128184         (eof || $. == 1) && /^\s*$/
   128185         # No trailing space.  FIXME: not ready for "maint".
   128186         # || /\s$/
   128187         )' calc.hh
   128188 
   128189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128190 at_status=$? at_failed=false
   128191 $at_check_filter
   128192 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128193 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128194 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128195 $at_failed && at_fn_log_failure
   128196 $at_traceon; }
   128197 
   128198 
   128199 # Test the priorities.
   128200 cat >input <<'_ATEOF'
   128201 1 + 2 * 3 = 7
   128202 1 + 2 * -3 = -5
   128203 
   128204 -1^2 = -1
   128205 (-1)^2 = 1
   128206 
   128207 ---1 = -1
   128208 
   128209 1 - 2 - 3 = -4
   128210 1 - (2 - 3) = 2
   128211 
   128212 2^2^3 = 256
   128213 (2^2)^3 = 64
   128214 _ATEOF
   128215 
   128216 { set +x
   128217 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128218 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128219 ( $at_check_trace;  $PREPARSER ./calc input
   128220 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128221 at_status=$? at_failed=false
   128222 $at_check_filter
   128223 echo stderr:; tee stderr <"$at_stderr"
   128224 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128225 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128226 $at_failed && at_fn_log_failure
   128227 $at_traceon; }
   128228 
   128229 { set +x
   128230 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128231 at_fn_check_prepare_trace "calc.at:719"
   128232 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128233 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128234 at_status=$? at_failed=false
   128235 $at_check_filter
   128236 echo stderr:; tee stderr <"$at_stderr"
   128237 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128238 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128239 $at_failed && at_fn_log_failure
   128240 $at_traceon; }
   128241 
   128242 
   128243 
   128244 
   128245 # Some syntax errors.
   128246 cat >input <<'_ATEOF'
   128247 1 2
   128248 _ATEOF
   128249 
   128250 { set +x
   128251 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128252 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128253 ( $at_check_trace;  $PREPARSER ./calc input
   128254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128255 at_status=$? at_failed=false
   128256 $at_check_filter
   128257 echo stderr:; tee stderr <"$at_stderr"
   128258 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128259 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719"
   128260 $at_failed && at_fn_log_failure
   128261 $at_traceon; }
   128262 
   128263 { set +x
   128264 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128265 at_fn_check_prepare_trace "calc.at:719"
   128266 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128267 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128268 at_status=$? at_failed=false
   128269 $at_check_filter
   128270 echo stderr:; tee stderr <"$at_stderr"
   128271 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128272 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128273 $at_failed && at_fn_log_failure
   128274 $at_traceon; }
   128275 
   128276 
   128277 
   128278 # Normalize the observed and expected error messages, depending upon the
   128279 # options.
   128280 # 1. Remove the traces from observed.
   128281 sed '/^Starting/d
   128282 /^Entering/d
   128283 /^Stack/d
   128284 /^Reading/d
   128285 /^Reducing/d
   128286 /^Return/d
   128287 /^Shifting/d
   128288 /^state/d
   128289 /^Cleanup:/d
   128290 /^Error:/d
   128291 /^Next/d
   128292 /^Now/d
   128293 /^Discarding/d
   128294 / \$[0-9$]* = /d
   128295 /^yydestructor:/d' stderr >at-stderr
   128296 mv at-stderr stderr
   128297 # 2. Create the reference error message.
   128298 cat >expout <<'_ATEOF'
   128299 1.3: syntax error, unexpected number
   128300 _ATEOF
   128301 
   128302 # 3. If locations are not used, remove them.
   128303 
   128304 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128305 
   128306 # 5. Check
   128307 { set +x
   128308 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128309 at_fn_check_prepare_trace "calc.at:719"
   128310 ( $at_check_trace; cat stderr
   128311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128312 at_status=$? at_failed=false
   128313 $at_check_filter
   128314 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128315 $at_diff expout "$at_stdout" || at_failed=:
   128316 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128317 $at_failed && at_fn_log_failure
   128318 $at_traceon; }
   128319 
   128320 
   128321 cat >input <<'_ATEOF'
   128322 1//2
   128323 _ATEOF
   128324 
   128325 { set +x
   128326 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128327 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128328 ( $at_check_trace;  $PREPARSER ./calc input
   128329 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128330 at_status=$? at_failed=false
   128331 $at_check_filter
   128332 echo stderr:; tee stderr <"$at_stderr"
   128333 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128334 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719"
   128335 $at_failed && at_fn_log_failure
   128336 $at_traceon; }
   128337 
   128338 { set +x
   128339 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128340 at_fn_check_prepare_trace "calc.at:719"
   128341 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128343 at_status=$? at_failed=false
   128344 $at_check_filter
   128345 echo stderr:; tee stderr <"$at_stderr"
   128346 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128347 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128348 $at_failed && at_fn_log_failure
   128349 $at_traceon; }
   128350 
   128351 
   128352 
   128353 # Normalize the observed and expected error messages, depending upon the
   128354 # options.
   128355 # 1. Remove the traces from observed.
   128356 sed '/^Starting/d
   128357 /^Entering/d
   128358 /^Stack/d
   128359 /^Reading/d
   128360 /^Reducing/d
   128361 /^Return/d
   128362 /^Shifting/d
   128363 /^state/d
   128364 /^Cleanup:/d
   128365 /^Error:/d
   128366 /^Next/d
   128367 /^Now/d
   128368 /^Discarding/d
   128369 / \$[0-9$]* = /d
   128370 /^yydestructor:/d' stderr >at-stderr
   128371 mv at-stderr stderr
   128372 # 2. Create the reference error message.
   128373 cat >expout <<'_ATEOF'
   128374 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   128375 _ATEOF
   128376 
   128377 # 3. If locations are not used, remove them.
   128378 
   128379 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128380 
   128381 # 5. Check
   128382 { set +x
   128383 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128384 at_fn_check_prepare_trace "calc.at:719"
   128385 ( $at_check_trace; cat stderr
   128386 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128387 at_status=$? at_failed=false
   128388 $at_check_filter
   128389 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128390 $at_diff expout "$at_stdout" || at_failed=:
   128391 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128392 $at_failed && at_fn_log_failure
   128393 $at_traceon; }
   128394 
   128395 
   128396 cat >input <<'_ATEOF'
   128397 error
   128398 _ATEOF
   128399 
   128400 { set +x
   128401 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128402 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128403 ( $at_check_trace;  $PREPARSER ./calc input
   128404 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128405 at_status=$? at_failed=false
   128406 $at_check_filter
   128407 echo stderr:; tee stderr <"$at_stderr"
   128408 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128409 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719"
   128410 $at_failed && at_fn_log_failure
   128411 $at_traceon; }
   128412 
   128413 { set +x
   128414 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128415 at_fn_check_prepare_trace "calc.at:719"
   128416 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128418 at_status=$? at_failed=false
   128419 $at_check_filter
   128420 echo stderr:; tee stderr <"$at_stderr"
   128421 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128422 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128423 $at_failed && at_fn_log_failure
   128424 $at_traceon; }
   128425 
   128426 
   128427 
   128428 # Normalize the observed and expected error messages, depending upon the
   128429 # options.
   128430 # 1. Remove the traces from observed.
   128431 sed '/^Starting/d
   128432 /^Entering/d
   128433 /^Stack/d
   128434 /^Reading/d
   128435 /^Reducing/d
   128436 /^Return/d
   128437 /^Shifting/d
   128438 /^state/d
   128439 /^Cleanup:/d
   128440 /^Error:/d
   128441 /^Next/d
   128442 /^Now/d
   128443 /^Discarding/d
   128444 / \$[0-9$]* = /d
   128445 /^yydestructor:/d' stderr >at-stderr
   128446 mv at-stderr stderr
   128447 # 2. Create the reference error message.
   128448 cat >expout <<'_ATEOF'
   128449 1.1: syntax error, unexpected $undefined
   128450 _ATEOF
   128451 
   128452 # 3. If locations are not used, remove them.
   128453 
   128454 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128455 
   128456 # 5. Check
   128457 { set +x
   128458 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128459 at_fn_check_prepare_trace "calc.at:719"
   128460 ( $at_check_trace; cat stderr
   128461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128462 at_status=$? at_failed=false
   128463 $at_check_filter
   128464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128465 $at_diff expout "$at_stdout" || at_failed=:
   128466 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128467 $at_failed && at_fn_log_failure
   128468 $at_traceon; }
   128469 
   128470 
   128471 cat >input <<'_ATEOF'
   128472 1 = 2 = 3
   128473 _ATEOF
   128474 
   128475 { set +x
   128476 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128477 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128478 ( $at_check_trace;  $PREPARSER ./calc input
   128479 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128480 at_status=$? at_failed=false
   128481 $at_check_filter
   128482 echo stderr:; tee stderr <"$at_stderr"
   128483 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128484 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719"
   128485 $at_failed && at_fn_log_failure
   128486 $at_traceon; }
   128487 
   128488 { set +x
   128489 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128490 at_fn_check_prepare_trace "calc.at:719"
   128491 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128493 at_status=$? at_failed=false
   128494 $at_check_filter
   128495 echo stderr:; tee stderr <"$at_stderr"
   128496 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128497 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128498 $at_failed && at_fn_log_failure
   128499 $at_traceon; }
   128500 
   128501 
   128502 
   128503 # Normalize the observed and expected error messages, depending upon the
   128504 # options.
   128505 # 1. Remove the traces from observed.
   128506 sed '/^Starting/d
   128507 /^Entering/d
   128508 /^Stack/d
   128509 /^Reading/d
   128510 /^Reducing/d
   128511 /^Return/d
   128512 /^Shifting/d
   128513 /^state/d
   128514 /^Cleanup:/d
   128515 /^Error:/d
   128516 /^Next/d
   128517 /^Now/d
   128518 /^Discarding/d
   128519 / \$[0-9$]* = /d
   128520 /^yydestructor:/d' stderr >at-stderr
   128521 mv at-stderr stderr
   128522 # 2. Create the reference error message.
   128523 cat >expout <<'_ATEOF'
   128524 1.7: syntax error, unexpected '='
   128525 _ATEOF
   128526 
   128527 # 3. If locations are not used, remove them.
   128528 
   128529 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128530 
   128531 # 5. Check
   128532 { set +x
   128533 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128534 at_fn_check_prepare_trace "calc.at:719"
   128535 ( $at_check_trace; cat stderr
   128536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128537 at_status=$? at_failed=false
   128538 $at_check_filter
   128539 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128540 $at_diff expout "$at_stdout" || at_failed=:
   128541 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128542 $at_failed && at_fn_log_failure
   128543 $at_traceon; }
   128544 
   128545 
   128546 cat >input <<'_ATEOF'
   128547 
   128548 +1
   128549 _ATEOF
   128550 
   128551 { set +x
   128552 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128553 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128554 ( $at_check_trace;  $PREPARSER ./calc input
   128555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128556 at_status=$? at_failed=false
   128557 $at_check_filter
   128558 echo stderr:; tee stderr <"$at_stderr"
   128559 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128560 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719"
   128561 $at_failed && at_fn_log_failure
   128562 $at_traceon; }
   128563 
   128564 { set +x
   128565 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128566 at_fn_check_prepare_trace "calc.at:719"
   128567 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128569 at_status=$? at_failed=false
   128570 $at_check_filter
   128571 echo stderr:; tee stderr <"$at_stderr"
   128572 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128573 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128574 $at_failed && at_fn_log_failure
   128575 $at_traceon; }
   128576 
   128577 
   128578 
   128579 # Normalize the observed and expected error messages, depending upon the
   128580 # options.
   128581 # 1. Remove the traces from observed.
   128582 sed '/^Starting/d
   128583 /^Entering/d
   128584 /^Stack/d
   128585 /^Reading/d
   128586 /^Reducing/d
   128587 /^Return/d
   128588 /^Shifting/d
   128589 /^state/d
   128590 /^Cleanup:/d
   128591 /^Error:/d
   128592 /^Next/d
   128593 /^Now/d
   128594 /^Discarding/d
   128595 / \$[0-9$]* = /d
   128596 /^yydestructor:/d' stderr >at-stderr
   128597 mv at-stderr stderr
   128598 # 2. Create the reference error message.
   128599 cat >expout <<'_ATEOF'
   128600 2.1: syntax error, unexpected '+'
   128601 _ATEOF
   128602 
   128603 # 3. If locations are not used, remove them.
   128604 
   128605 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128606 
   128607 # 5. Check
   128608 { set +x
   128609 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128610 at_fn_check_prepare_trace "calc.at:719"
   128611 ( $at_check_trace; cat stderr
   128612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128613 at_status=$? at_failed=false
   128614 $at_check_filter
   128615 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128616 $at_diff expout "$at_stdout" || at_failed=:
   128617 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128618 $at_failed && at_fn_log_failure
   128619 $at_traceon; }
   128620 
   128621 
   128622 # Exercise error messages with EOF: work on an empty file.
   128623 { set +x
   128624 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc /dev/null"
   128625 at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:719"
   128626 ( $at_check_trace;  $PREPARSER ./calc /dev/null
   128627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128628 at_status=$? at_failed=false
   128629 $at_check_filter
   128630 echo stderr:; tee stderr <"$at_stderr"
   128631 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128632 at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719"
   128633 $at_failed && at_fn_log_failure
   128634 $at_traceon; }
   128635 
   128636 { set +x
   128637 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128638 at_fn_check_prepare_trace "calc.at:719"
   128639 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128641 at_status=$? at_failed=false
   128642 $at_check_filter
   128643 echo stderr:; tee stderr <"$at_stderr"
   128644 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128645 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128646 $at_failed && at_fn_log_failure
   128647 $at_traceon; }
   128648 
   128649 
   128650 
   128651 # Normalize the observed and expected error messages, depending upon the
   128652 # options.
   128653 # 1. Remove the traces from observed.
   128654 sed '/^Starting/d
   128655 /^Entering/d
   128656 /^Stack/d
   128657 /^Reading/d
   128658 /^Reducing/d
   128659 /^Return/d
   128660 /^Shifting/d
   128661 /^state/d
   128662 /^Cleanup:/d
   128663 /^Error:/d
   128664 /^Next/d
   128665 /^Now/d
   128666 /^Discarding/d
   128667 / \$[0-9$]* = /d
   128668 /^yydestructor:/d' stderr >at-stderr
   128669 mv at-stderr stderr
   128670 # 2. Create the reference error message.
   128671 cat >expout <<'_ATEOF'
   128672 1.1: syntax error, unexpected end of input
   128673 _ATEOF
   128674 
   128675 # 3. If locations are not used, remove them.
   128676 
   128677 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128678 
   128679 # 5. Check
   128680 { set +x
   128681 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128682 at_fn_check_prepare_trace "calc.at:719"
   128683 ( $at_check_trace; cat stderr
   128684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128685 at_status=$? at_failed=false
   128686 $at_check_filter
   128687 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128688 $at_diff expout "$at_stdout" || at_failed=:
   128689 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128690 $at_failed && at_fn_log_failure
   128691 $at_traceon; }
   128692 
   128693 
   128694 
   128695 # Exercise the error token: without it, we die at the first error,
   128696 # hence be sure to
   128697 #
   128698 # - have several errors which exercise different shift/discardings
   128699 #   - (): nothing to pop, nothing to discard
   128700 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   128701 #   - (* * *): nothing to pop, a lot to discard
   128702 #   - (1 + 2 * *): some to pop and discard
   128703 #
   128704 # - test the action associated to `error'
   128705 #
   128706 # - check the lookahead that triggers an error is not discarded
   128707 #   when we enter error recovery.  Below, the lookahead causing the
   128708 #   first error is ")", which is needed to recover from the error and
   128709 #   produce the "0" that triggers the "0 != 1" error.
   128710 #
   128711 cat >input <<'_ATEOF'
   128712 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   128713 _ATEOF
   128714 
   128715 { set +x
   128716 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128717 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128718 ( $at_check_trace;  $PREPARSER ./calc input
   128719 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128720 at_status=$? at_failed=false
   128721 $at_check_filter
   128722 echo stderr:; tee stderr <"$at_stderr"
   128723 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128724 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128725 $at_failed && at_fn_log_failure
   128726 $at_traceon; }
   128727 
   128728 { set +x
   128729 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128730 at_fn_check_prepare_trace "calc.at:719"
   128731 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128732 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128733 at_status=$? at_failed=false
   128734 $at_check_filter
   128735 echo stderr:; tee stderr <"$at_stderr"
   128736 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128737 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128738 $at_failed && at_fn_log_failure
   128739 $at_traceon; }
   128740 
   128741 
   128742 
   128743 # Normalize the observed and expected error messages, depending upon the
   128744 # options.
   128745 # 1. Remove the traces from observed.
   128746 sed '/^Starting/d
   128747 /^Entering/d
   128748 /^Stack/d
   128749 /^Reading/d
   128750 /^Reducing/d
   128751 /^Return/d
   128752 /^Shifting/d
   128753 /^state/d
   128754 /^Cleanup:/d
   128755 /^Error:/d
   128756 /^Next/d
   128757 /^Now/d
   128758 /^Discarding/d
   128759 / \$[0-9$]* = /d
   128760 /^yydestructor:/d' stderr >at-stderr
   128761 mv at-stderr stderr
   128762 # 2. Create the reference error message.
   128763 cat >expout <<'_ATEOF'
   128764 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   128765 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   128766 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   128767 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   128768 calc: error: 4444 != 1
   128769 _ATEOF
   128770 
   128771 # 3. If locations are not used, remove them.
   128772 
   128773 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128774 
   128775 # 5. Check
   128776 { set +x
   128777 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128778 at_fn_check_prepare_trace "calc.at:719"
   128779 ( $at_check_trace; cat stderr
   128780 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128781 at_status=$? at_failed=false
   128782 $at_check_filter
   128783 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128784 $at_diff expout "$at_stdout" || at_failed=:
   128785 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128786 $at_failed && at_fn_log_failure
   128787 $at_traceon; }
   128788 
   128789 
   128790 
   128791 # The same, but this time exercising explicitly triggered syntax errors.
   128792 # POSIX says the lookahead causing the error should not be discarded.
   128793 cat >input <<'_ATEOF'
   128794 (!) + (1 2) = 1
   128795 _ATEOF
   128796 
   128797 { set +x
   128798 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128799 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128800 ( $at_check_trace;  $PREPARSER ./calc input
   128801 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128802 at_status=$? at_failed=false
   128803 $at_check_filter
   128804 echo stderr:; tee stderr <"$at_stderr"
   128805 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128806 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128807 $at_failed && at_fn_log_failure
   128808 $at_traceon; }
   128809 
   128810 { set +x
   128811 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128812 at_fn_check_prepare_trace "calc.at:719"
   128813 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128814 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128815 at_status=$? at_failed=false
   128816 $at_check_filter
   128817 echo stderr:; tee stderr <"$at_stderr"
   128818 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128819 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128820 $at_failed && at_fn_log_failure
   128821 $at_traceon; }
   128822 
   128823 
   128824 
   128825 # Normalize the observed and expected error messages, depending upon the
   128826 # options.
   128827 # 1. Remove the traces from observed.
   128828 sed '/^Starting/d
   128829 /^Entering/d
   128830 /^Stack/d
   128831 /^Reading/d
   128832 /^Reducing/d
   128833 /^Return/d
   128834 /^Shifting/d
   128835 /^state/d
   128836 /^Cleanup:/d
   128837 /^Error:/d
   128838 /^Next/d
   128839 /^Now/d
   128840 /^Discarding/d
   128841 / \$[0-9$]* = /d
   128842 /^yydestructor:/d' stderr >at-stderr
   128843 mv at-stderr stderr
   128844 # 2. Create the reference error message.
   128845 cat >expout <<'_ATEOF'
   128846 1.10: syntax error, unexpected number
   128847 calc: error: 2222 != 1
   128848 _ATEOF
   128849 
   128850 # 3. If locations are not used, remove them.
   128851 
   128852 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128853 
   128854 # 5. Check
   128855 { set +x
   128856 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128857 at_fn_check_prepare_trace "calc.at:719"
   128858 ( $at_check_trace; cat stderr
   128859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128860 at_status=$? at_failed=false
   128861 $at_check_filter
   128862 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128863 $at_diff expout "$at_stdout" || at_failed=:
   128864 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128865 $at_failed && at_fn_log_failure
   128866 $at_traceon; }
   128867 
   128868 
   128869 cat >input <<'_ATEOF'
   128870 (- *) + (1 2) = 1
   128871 _ATEOF
   128872 
   128873 { set +x
   128874 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128875 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128876 ( $at_check_trace;  $PREPARSER ./calc input
   128877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128878 at_status=$? at_failed=false
   128879 $at_check_filter
   128880 echo stderr:; tee stderr <"$at_stderr"
   128881 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128882 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128883 $at_failed && at_fn_log_failure
   128884 $at_traceon; }
   128885 
   128886 { set +x
   128887 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128888 at_fn_check_prepare_trace "calc.at:719"
   128889 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128891 at_status=$? at_failed=false
   128892 $at_check_filter
   128893 echo stderr:; tee stderr <"$at_stderr"
   128894 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128895 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128896 $at_failed && at_fn_log_failure
   128897 $at_traceon; }
   128898 
   128899 
   128900 
   128901 # Normalize the observed and expected error messages, depending upon the
   128902 # options.
   128903 # 1. Remove the traces from observed.
   128904 sed '/^Starting/d
   128905 /^Entering/d
   128906 /^Stack/d
   128907 /^Reading/d
   128908 /^Reducing/d
   128909 /^Return/d
   128910 /^Shifting/d
   128911 /^state/d
   128912 /^Cleanup:/d
   128913 /^Error:/d
   128914 /^Next/d
   128915 /^Now/d
   128916 /^Discarding/d
   128917 / \$[0-9$]* = /d
   128918 /^yydestructor:/d' stderr >at-stderr
   128919 mv at-stderr stderr
   128920 # 2. Create the reference error message.
   128921 cat >expout <<'_ATEOF'
   128922 1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   128923 1.12: syntax error, unexpected number
   128924 calc: error: 2222 != 1
   128925 _ATEOF
   128926 
   128927 # 3. If locations are not used, remove them.
   128928 
   128929 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   128930 
   128931 # 5. Check
   128932 { set +x
   128933 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   128934 at_fn_check_prepare_trace "calc.at:719"
   128935 ( $at_check_trace; cat stderr
   128936 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128937 at_status=$? at_failed=false
   128938 $at_check_filter
   128939 at_fn_diff_devnull "$at_stderr" || at_failed=:
   128940 $at_diff expout "$at_stdout" || at_failed=:
   128941 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128942 $at_failed && at_fn_log_failure
   128943 $at_traceon; }
   128944 
   128945 
   128946 
   128947 # Check that yyerrok works properly: second error is not reported,
   128948 # third and fourth are.  Parse status is succesfull.
   128949 cat >input <<'_ATEOF'
   128950 (* *) + (*) + (*)
   128951 _ATEOF
   128952 
   128953 { set +x
   128954 $as_echo "$at_srcdir/calc.at:719:  \$PREPARSER ./calc input"
   128955 at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719"
   128956 ( $at_check_trace;  $PREPARSER ./calc input
   128957 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128958 at_status=$? at_failed=false
   128959 $at_check_filter
   128960 echo stderr:; tee stderr <"$at_stderr"
   128961 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128962 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128963 $at_failed && at_fn_log_failure
   128964 $at_traceon; }
   128965 
   128966 { set +x
   128967 $as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   128968 at_fn_check_prepare_trace "calc.at:719"
   128969 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   128970 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   128971 at_status=$? at_failed=false
   128972 $at_check_filter
   128973 echo stderr:; tee stderr <"$at_stderr"
   128974 at_fn_diff_devnull "$at_stdout" || at_failed=:
   128975 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   128976 $at_failed && at_fn_log_failure
   128977 $at_traceon; }
   128978 
   128979 
   128980 
   128981 # Normalize the observed and expected error messages, depending upon the
   128982 # options.
   128983 # 1. Remove the traces from observed.
   128984 sed '/^Starting/d
   128985 /^Entering/d
   128986 /^Stack/d
   128987 /^Reading/d
   128988 /^Reducing/d
   128989 /^Return/d
   128990 /^Shifting/d
   128991 /^state/d
   128992 /^Cleanup:/d
   128993 /^Error:/d
   128994 /^Next/d
   128995 /^Now/d
   128996 /^Discarding/d
   128997 / \$[0-9$]* = /d
   128998 /^yydestructor:/d' stderr >at-stderr
   128999 mv at-stderr stderr
   129000 # 2. Create the reference error message.
   129001 cat >expout <<'_ATEOF'
   129002 1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   129003 1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   129004 1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   129005 _ATEOF
   129006 
   129007 # 3. If locations are not used, remove them.
   129008 
   129009 # 4. If error-verbose is not used, strip the`, unexpected....' part.
   129010 
   129011 # 5. Check
   129012 { set +x
   129013 $as_echo "$at_srcdir/calc.at:719: cat stderr"
   129014 at_fn_check_prepare_trace "calc.at:719"
   129015 ( $at_check_trace; cat stderr
   129016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129017 at_status=$? at_failed=false
   129018 $at_check_filter
   129019 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129020 $at_diff expout "$at_stdout" || at_failed=:
   129021 at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719"
   129022 $at_failed && at_fn_log_failure
   129023 $at_traceon; }
   129024 
   129025 
   129026 
   129027 
   129028 
   129029   set +x
   129030   $at_times_p && times >"$at_times_file"
   129031 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   129032 read at_status <"$at_status_file"
   129033 #AT_STOP_253
   129034 #AT_START_254
   129035 at_fn_group_banner 254 'torture.at:137' \
   129036   "Big triangle" "                                   " 15
   129037 at_xfail=no
   129038 (
   129039   $as_echo "254. $at_setup_line: testing $at_desc ..."
   129040   $at_traceon
   129041 
   129042 
   129043 # I have been able to go up to 2000 on my machine.
   129044 # I tried 3000, a 29Mb grammar file, but then my system killed bison.
   129045 # With 500 and the new parser, which consume far too much memory,
   129046 # it gets killed too.  Of course the parser is to be cleaned.
   129047 
   129048 cat >gengram.pl <<'_ATEOF'
   129049 #! /usr/bin/perl -w
   129050 
   129051 use strict;
   129052 my $max = $ARGV[0] || 10;
   129053 
   129054 print <<EOF;
   129055 %code top {
   129056 #include <config.h>
   129057 /* We don't need perfect functions for these tests. */
   129058 #undef malloc
   129059 #undef memcmp
   129060 #undef realloc
   129061 }
   129062 
   129063 %error-verbose
   129064 %debug
   129065 %{
   129066 #include <stdio.h>
   129067 #include <stdlib.h>
   129068 #include <assert.h>
   129069 #define MAX $max
   129070 static int yylex (void);
   129071 static void yyerror ( const char *msg);
   129072 %}
   129073 %union
   129074 {
   129075   int val;
   129076 };
   129077 
   129078 %token END "end"
   129079 %type <val> exp input
   129080 EOF
   129081 
   129082 for my $size (1 .. $max)
   129083   {
   129084     print "%token t$size $size \"$size\"\n";
   129085   };
   129086 
   129087 print <<EOF;
   129088 %%
   129089 input:
   129090   exp        { assert (\$1 == 0); \$\$ = \$1; }
   129091 | input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
   129092 ;
   129093 
   129094 exp:
   129095   END
   129096     { \$\$ = 0; }
   129097 EOF
   129098 
   129099 for my $size (1 .. $max)
   129100   {
   129101     use Text::Wrap;
   129102     print wrap ("| ", "   ",
   129103 		(map { "\"$_\"" } (1 .. $size)),
   129104 		" END \n"),
   129105 		  "    { \$\$ = $size; }\n";
   129106   };
   129107 print ";\n";
   129108 
   129109 print <<\EOF;
   129110 %%
   129111 #include <stdio.h>
   129112 /* A C error reporting function.  */
   129113 static
   129114 void yyerror ( const char *msg)
   129115 {
   129116   fprintf (stderr, "%s\n", msg);
   129117 }
   129118 static int
   129119 yylex (void)
   129120 {
   129121   static int inner = 1;
   129122   static int outer = 0;
   129123   if (outer > MAX)
   129124     return 0;
   129125   else if (inner > outer)
   129126     {
   129127       inner = 1;
   129128       ++outer;
   129129       return END;
   129130     }
   129131   return inner++;
   129132 }
   129133 int
   129134 main (void)
   129135 {
   129136   yydebug = !!getenv ("YYDEBUG");
   129137   return yyparse ();
   129138 }
   129139 EOF
   129140 _ATEOF
   129141 
   129142 
   129143 
   129144 { set +x
   129145 $as_echo "$at_srcdir/torture.at:143: \$PERL -w ./gengram.pl 200 || exit 77"
   129146 at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 200 || exit 77" "torture.at:143"
   129147 ( $at_check_trace; $PERL -w ./gengram.pl 200 || exit 77
   129148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129149 at_status=$? at_failed=false
   129150 $at_check_filter
   129151 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129152 echo stdout:; tee stdout <"$at_stdout"
   129153 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:143"
   129154 $at_failed && at_fn_log_failure
   129155 $at_traceon; }
   129156 
   129157 mv stdout input.y
   129158 
   129159 { set +x
   129160 $as_echo "$at_srcdir/torture.at:144: bison -v -o input.c input.y"
   129161 at_fn_check_prepare_trace "torture.at:144"
   129162 ( $at_check_trace; bison -v -o input.c input.y
   129163 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129164 at_status=$? at_failed=false
   129165 $at_check_filter
   129166 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129167 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129168 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:144"
   129169 $at_failed && at_fn_log_failure
   129170 $at_traceon; }
   129171 
   129172 
   129173 { set +x
   129174 $as_echo "$at_srcdir/torture.at:145: \$BISON_C_WORKS"
   129175 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:145"
   129176 ( $at_check_trace; $BISON_C_WORKS
   129177 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129178 at_status=$? at_failed=false
   129179 $at_check_filter
   129180 echo stderr:; cat "$at_stderr"
   129181 echo stdout:; cat "$at_stdout"
   129182 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:145"
   129183 $at_failed && at_fn_log_failure
   129184 $at_traceon; }
   129185 
   129186 { set +x
   129187 $as_echo "$at_srcdir/torture.at:145: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   129188 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:145"
   129189 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   129190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129191 at_status=$? at_failed=false
   129192 $at_check_filter
   129193 echo stderr:; cat "$at_stderr"
   129194 echo stdout:; cat "$at_stdout"
   129195 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:145"
   129196 $at_failed && at_fn_log_failure
   129197 $at_traceon; }
   129198 
   129199 { set +x
   129200 $as_echo "$at_srcdir/torture.at:146:  \$PREPARSER ./input"
   129201 at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:146"
   129202 ( $at_check_trace;  $PREPARSER ./input
   129203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129204 at_status=$? at_failed=false
   129205 $at_check_filter
   129206 echo stderr:; tee stderr <"$at_stderr"
   129207 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129208 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:146"
   129209 $at_failed && at_fn_log_failure
   129210 $at_traceon; }
   129211 
   129212 { set +x
   129213 $as_echo "$at_srcdir/torture.at:146: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   129214 at_fn_check_prepare_trace "torture.at:146"
   129215 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   129216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129217 at_status=$? at_failed=false
   129218 $at_check_filter
   129219 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129220 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129221 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:146"
   129222 $at_failed && at_fn_log_failure
   129223 $at_traceon; }
   129224 
   129225 
   129226 
   129227   set +x
   129228   $at_times_p && times >"$at_times_file"
   129229 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   129230 read at_status <"$at_status_file"
   129231 #AT_STOP_254
   129232 #AT_START_255
   129233 at_fn_group_banner 255 'torture.at:227' \
   129234   "Big horizontal" "                                 " 15
   129235 at_xfail=no
   129236 (
   129237   $as_echo "255. $at_setup_line: testing $at_desc ..."
   129238   $at_traceon
   129239 
   129240 
   129241 # I have been able to go up to 10000 on my machine, but I had to
   129242 # increase the maximum stack size (* 100).  It gave:
   129243 #
   129244 # input.y      263k
   129245 # input.tab.c  1.3M
   129246 # input        453k
   129247 #
   129248 # gengram.pl 10000                 0.70s user 0.01s sys  99% cpu    0.711 total
   129249 # bison input.y                  730.56s user 0.53s sys  99% cpu 12:12.34 total
   129250 # gcc -Wall input.tab.c -o input   5.81s user 0.20s sys 100% cpu     6.01 total
   129251 # ./input                          0.00s user 0.01s sys 108% cpu     0.01 total
   129252 #
   129253 
   129254 cat >gengram.pl <<'_ATEOF'
   129255 #! /usr/bin/perl -w
   129256 
   129257 use strict;
   129258 my $max = $ARGV[0] || 10;
   129259 
   129260 print <<EOF;
   129261 %code top {
   129262 #include <config.h>
   129263 /* We don't need perfect functions for these tests. */
   129264 #undef malloc
   129265 #undef memcmp
   129266 #undef realloc
   129267 }
   129268 
   129269 %error-verbose
   129270 %debug
   129271 %{
   129272 #include <stdio.h>
   129273 #include <stdlib.h>
   129274 #define MAX $max
   129275 static int yylex (void);
   129276 static void yyerror ( const char *msg);
   129277 %}
   129278 
   129279 %token
   129280 EOF
   129281 for my $size (1 .. $max)
   129282   {
   129283     print "    t$size $size \"$size\"\n";
   129284   };
   129285 
   129286 print <<EOF;
   129287 
   129288 %%
   129289 EOF
   129290 
   129291 use Text::Wrap;
   129292 print
   129293   wrap ("exp: ", "  ",
   129294 	(map { "\"$_\"" } (1 .. $max)), ";"),
   129295   "\n";
   129296 
   129297 print <<\EOF;
   129298 %%
   129299 #include <assert.h>
   129300 #include <stdio.h>
   129301 /* A C error reporting function.  */
   129302 static
   129303 void yyerror ( const char *msg)
   129304 {
   129305   fprintf (stderr, "%s\n", msg);
   129306 }
   129307 static int
   129308 yylex (void)
   129309 {
   129310   static int counter = 1;
   129311   if (counter <= MAX)
   129312     return counter++;
   129313   assert (counter++ == MAX + 1);
   129314   return 0;
   129315 }
   129316 
   129317 int
   129318 main (void)
   129319 {
   129320   yydebug = !!getenv ("YYDEBUG");
   129321   return yyparse ();
   129322 }
   129323 EOF
   129324 _ATEOF
   129325 
   129326 
   129327 { set +x
   129328 $as_echo "$at_srcdir/torture.at:241: \$PERL -w ./gengram.pl 1000 || exit 77"
   129329 at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:241"
   129330 ( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77
   129331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129332 at_status=$? at_failed=false
   129333 $at_check_filter
   129334 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129335 echo stdout:; tee stdout <"$at_stdout"
   129336 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:241"
   129337 $at_failed && at_fn_log_failure
   129338 $at_traceon; }
   129339 
   129340 mv stdout input.y
   129341 
   129342 
   129343 
   129344 # GNU m4 requires about 70 MiB for this test on a 32-bit host.
   129345 # Ask for 200 MiB, which should be plenty even on a 64-bit host.
   129346 data_limit=`(ulimit -S -d) 2>/dev/null`
   129347 case $data_limit in
   129348 [0-9]*)
   129349   if test "$data_limit" -lt 204000; then
   129350     { set +x
   129351 $as_echo "$at_srcdir/torture.at:245: ulimit -S -d 204000 || exit 77"
   129352 at_fn_check_prepare_trace "torture.at:245"
   129353 ( $at_check_trace; ulimit -S -d 204000 || exit 77
   129354 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129355 at_status=$? at_failed=false
   129356 $at_check_filter
   129357 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129358 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129359 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:245"
   129360 $at_failed && at_fn_log_failure
   129361 $at_traceon; }
   129362 
   129363     ulimit -S -d 204000
   129364   fi
   129365 esac
   129366 
   129367 { set +x
   129368 $as_echo "$at_srcdir/torture.at:247: bison -v -o input.c input.y"
   129369 at_fn_check_prepare_trace "torture.at:247"
   129370 ( $at_check_trace; bison -v -o input.c input.y
   129371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129372 at_status=$? at_failed=false
   129373 $at_check_filter
   129374 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129375 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129376 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:247"
   129377 $at_failed && at_fn_log_failure
   129378 $at_traceon; }
   129379 
   129380 
   129381 { set +x
   129382 $as_echo "$at_srcdir/torture.at:248: \$BISON_C_WORKS"
   129383 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:248"
   129384 ( $at_check_trace; $BISON_C_WORKS
   129385 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129386 at_status=$? at_failed=false
   129387 $at_check_filter
   129388 echo stderr:; cat "$at_stderr"
   129389 echo stdout:; cat "$at_stdout"
   129390 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:248"
   129391 $at_failed && at_fn_log_failure
   129392 $at_traceon; }
   129393 
   129394 { set +x
   129395 $as_echo "$at_srcdir/torture.at:248: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   129396 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:248"
   129397 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   129398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129399 at_status=$? at_failed=false
   129400 $at_check_filter
   129401 echo stderr:; cat "$at_stderr"
   129402 echo stdout:; cat "$at_stdout"
   129403 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:248"
   129404 $at_failed && at_fn_log_failure
   129405 $at_traceon; }
   129406 
   129407 { set +x
   129408 $as_echo "$at_srcdir/torture.at:249:  \$PREPARSER ./input"
   129409 at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:249"
   129410 ( $at_check_trace;  $PREPARSER ./input
   129411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129412 at_status=$? at_failed=false
   129413 $at_check_filter
   129414 echo stderr:; tee stderr <"$at_stderr"
   129415 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129416 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:249"
   129417 $at_failed && at_fn_log_failure
   129418 $at_traceon; }
   129419 
   129420 { set +x
   129421 $as_echo "$at_srcdir/torture.at:249: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   129422 at_fn_check_prepare_trace "torture.at:249"
   129423 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   129424 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129425 at_status=$? at_failed=false
   129426 $at_check_filter
   129427 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129428 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129429 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:249"
   129430 $at_failed && at_fn_log_failure
   129431 $at_traceon; }
   129432 
   129433 
   129434 
   129435   set +x
   129436   $at_times_p && times >"$at_times_file"
   129437 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   129438 read at_status <"$at_status_file"
   129439 #AT_STOP_255
   129440 #AT_START_256
   129441 at_fn_group_banner 256 'torture.at:364' \
   129442   "Many lookahead tokens" "                          " 15
   129443 at_xfail=no
   129444 (
   129445   $as_echo "256. $at_setup_line: testing $at_desc ..."
   129446   $at_traceon
   129447 
   129448 
   129449 
   129450 cat >gengram.pl <<'_ATEOF'
   129451 #! /usr/bin/perl -w
   129452 
   129453 use strict;
   129454 use Text::Wrap;
   129455 my $max = $ARGV[0] || 10;
   129456 
   129457 print <<EOF;
   129458 %error-verbose
   129459 %debug
   129460 %{
   129461 #include <config.h>
   129462 /* We don't need perfect functions for these tests. */
   129463 #undef malloc
   129464 #undef memcmp
   129465 #undef realloc
   129466 
   129467 # include <stdio.h>
   129468 # include <stdlib.h>
   129469 # include <assert.h>
   129470 # define MAX $max
   129471 static int yylex (void);
   129472 static void yyerror ( const char *msg);
   129473 %}
   129474 %union
   129475 {
   129476   int val;
   129477 };
   129478 
   129479 %type <val> input exp
   129480 %token token
   129481 EOF
   129482 
   129483 print
   129484   wrap ("%type <val> ",
   129485 	"            ",
   129486 	map { "n$_" } (1 .. $max)),
   129487   "\n";
   129488 
   129489 print "%token\n";
   129490 for my $count (1 .. $max)
   129491   {
   129492     print "    t$count $count \"$count\"\n";
   129493   };
   129494 
   129495 print <<EOF;
   129496 %%
   129497 input:
   129498   exp        { assert (\$1 == 1); \$\$ = \$1; }
   129499 | input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
   129500 ;
   129501 
   129502 exp:
   129503   n1 "1" { assert (\$1 == 1); \$\$ = \$1; }
   129504 EOF
   129505 
   129506 for my $count (2 .. $max)
   129507   {
   129508     print "| n$count \"$count\" { assert (\$1 == $count); \$\$ = \$1; }\n";
   129509   };
   129510 print ";\n";
   129511 
   129512 for my $count (1 .. $max)
   129513   {
   129514     print "n$count: token { \$\$ = $count; };\n";
   129515   };
   129516 
   129517 print <<\EOF;
   129518 %%
   129519 #include <stdio.h>
   129520 /* A C error reporting function.  */
   129521 static
   129522 void yyerror ( const char *msg)
   129523 {
   129524   fprintf (stderr, "%s\n", msg);
   129525 }
   129526 static int
   129527 yylex (void)
   129528 {
   129529   static int return_token = 1;
   129530   static int counter = 1;
   129531   if (counter > MAX)
   129532     {
   129533       assert (counter++ == MAX + 1);
   129534       return 0;
   129535     }
   129536   if (return_token)
   129537     {
   129538       return_token = 0;
   129539       return token;
   129540     }
   129541   return_token = 1;
   129542   return counter++;
   129543 }
   129544 
   129545 int
   129546 main (void)
   129547 {
   129548   yydebug = !!getenv ("YYDEBUG");
   129549   return yyparse ();
   129550 }
   129551 EOF
   129552 _ATEOF
   129553 
   129554 
   129555 { set +x
   129556 $as_echo "$at_srcdir/torture.at:366: \$PERL -w ./gengram.pl 1000 || exit 77"
   129557 at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:366"
   129558 ( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77
   129559 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129560 at_status=$? at_failed=false
   129561 $at_check_filter
   129562 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129563 echo stdout:; tee stdout <"$at_stdout"
   129564 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:366"
   129565 $at_failed && at_fn_log_failure
   129566 $at_traceon; }
   129567 
   129568 mv stdout input.y
   129569 
   129570 
   129571 
   129572 # GNU m4 requires about 70 MiB for this test on a 32-bit host.
   129573 # Ask for 200 MiB, which should be plenty even on a 64-bit host.
   129574 data_limit=`(ulimit -S -d) 2>/dev/null`
   129575 case $data_limit in
   129576 [0-9]*)
   129577   if test "$data_limit" -lt 204000; then
   129578     { set +x
   129579 $as_echo "$at_srcdir/torture.at:370: ulimit -S -d 204000 || exit 77"
   129580 at_fn_check_prepare_trace "torture.at:370"
   129581 ( $at_check_trace; ulimit -S -d 204000 || exit 77
   129582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129583 at_status=$? at_failed=false
   129584 $at_check_filter
   129585 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129586 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129587 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:370"
   129588 $at_failed && at_fn_log_failure
   129589 $at_traceon; }
   129590 
   129591     ulimit -S -d 204000
   129592   fi
   129593 esac
   129594 
   129595 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   129596   at_save_special_files
   129597   mkdir xml-tests
   129598     # Don't combine these Bison invocations since we want to be sure that
   129599   # --report=all isn't required to get the full XML file.
   129600   { set +x
   129601 $as_echo "$at_srcdir/torture.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   129602                   --graph=xml-tests/test.dot -v -o input.c input.y"
   129603 at_fn_check_prepare_notrace 'an embedded newline' "torture.at:372"
   129604 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   129605                   --graph=xml-tests/test.dot -v -o input.c input.y
   129606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129607 at_status=$? at_failed=false
   129608 $at_check_filter
   129609 echo stderr:; cat "$at_stderr"
   129610 echo stdout:; cat "$at_stdout"
   129611 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372"
   129612 $at_failed && at_fn_log_failure
   129613 $at_traceon; }
   129614 
   129615   { set +x
   129616 $as_echo "$at_srcdir/torture.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y"
   129617 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "torture.at:372"
   129618 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y
   129619 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129620 at_status=$? at_failed=false
   129621 $at_check_filter
   129622 echo stderr:; cat "$at_stderr"
   129623 echo stdout:; cat "$at_stdout"
   129624 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372"
   129625 $at_failed && at_fn_log_failure
   129626 $at_traceon; }
   129627 
   129628     cp xml-tests/test.output expout
   129629   { set +x
   129630 $as_echo "$at_srcdir/torture.at:372: \$XSLTPROC \\
   129631              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   129632              xml-tests/test.xml"
   129633 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:372"
   129634 ( $at_check_trace; $XSLTPROC \
   129635              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   129636              xml-tests/test.xml
   129637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129638 at_status=$? at_failed=false
   129639 $at_check_filter
   129640 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129641 $at_diff expout "$at_stdout" || at_failed=:
   129642 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372"
   129643 $at_failed && at_fn_log_failure
   129644 $at_traceon; }
   129645 
   129646   sort xml-tests/test.dot > expout
   129647   { set +x
   129648 $as_echo "$at_srcdir/torture.at:372: \$XSLTPROC \\
   129649              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   129650              xml-tests/test.xml | sort"
   129651 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:372"
   129652 ( $at_check_trace; $XSLTPROC \
   129653              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   129654              xml-tests/test.xml | sort
   129655 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129656 at_status=$? at_failed=false
   129657 $at_check_filter
   129658 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129659 $at_diff expout "$at_stdout" || at_failed=:
   129660 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372"
   129661 $at_failed && at_fn_log_failure
   129662 $at_traceon; }
   129663 
   129664   rm -rf xml-tests expout
   129665   at_restore_special_files
   129666 fi
   129667 { set +x
   129668 $as_echo "$at_srcdir/torture.at:372: bison -v -o input.c input.y"
   129669 at_fn_check_prepare_trace "torture.at:372"
   129670 ( $at_check_trace; bison -v -o input.c input.y
   129671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129672 at_status=$? at_failed=false
   129673 $at_check_filter
   129674 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129675 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129676 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:372"
   129677 $at_failed && at_fn_log_failure
   129678 $at_traceon; }
   129679 
   129680 
   129681 { set +x
   129682 $as_echo "$at_srcdir/torture.at:373: \$BISON_C_WORKS"
   129683 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:373"
   129684 ( $at_check_trace; $BISON_C_WORKS
   129685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129686 at_status=$? at_failed=false
   129687 $at_check_filter
   129688 echo stderr:; cat "$at_stderr"
   129689 echo stdout:; cat "$at_stdout"
   129690 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:373"
   129691 $at_failed && at_fn_log_failure
   129692 $at_traceon; }
   129693 
   129694 { set +x
   129695 $as_echo "$at_srcdir/torture.at:373: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   129696 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:373"
   129697 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   129698 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129699 at_status=$? at_failed=false
   129700 $at_check_filter
   129701 echo stderr:; cat "$at_stderr"
   129702 echo stdout:; cat "$at_stdout"
   129703 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:373"
   129704 $at_failed && at_fn_log_failure
   129705 $at_traceon; }
   129706 
   129707 { set +x
   129708 $as_echo "$at_srcdir/torture.at:374:  \$PREPARSER ./input"
   129709 at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:374"
   129710 ( $at_check_trace;  $PREPARSER ./input
   129711 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129712 at_status=$? at_failed=false
   129713 $at_check_filter
   129714 echo stderr:; tee stderr <"$at_stderr"
   129715 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129716 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:374"
   129717 $at_failed && at_fn_log_failure
   129718 $at_traceon; }
   129719 
   129720 { set +x
   129721 $as_echo "$at_srcdir/torture.at:374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   129722 at_fn_check_prepare_trace "torture.at:374"
   129723 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   129724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129725 at_status=$? at_failed=false
   129726 $at_check_filter
   129727 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129728 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129729 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:374"
   129730 $at_failed && at_fn_log_failure
   129731 $at_traceon; }
   129732 
   129733 
   129734 
   129735   set +x
   129736   $at_times_p && times >"$at_times_file"
   129737 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   129738 read at_status <"$at_status_file"
   129739 #AT_STOP_256
   129740 #AT_START_257
   129741 at_fn_group_banner 257 'torture.at:466' \
   129742   "Exploding the Stack Size with Alloca" "           " 15
   129743 at_xfail=no
   129744 (
   129745   $as_echo "257. $at_setup_line: testing $at_desc ..."
   129746   $at_traceon
   129747 
   129748 
   129749 
   129750 
   129751 
   129752 # A grammar of parens growing the stack thanks to right recursion.
   129753 # exp:
   129754 cat >input.y <<'_ATEOF'
   129755 %code top {
   129756 #include <config.h>
   129757 /* We don't need perfect functions for these tests. */
   129758 #undef malloc
   129759 #undef memcmp
   129760 #undef realloc
   129761 }
   129762 
   129763 %{
   129764 #include <errno.h>
   129765 #include <limits.h>
   129766 #include <stdio.h>
   129767 #include <stdlib.h>
   129768 
   129769 #if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \
   129770      || defined _AIX || defined _MSC_VER || defined _ALLOCA_H)
   129771 # define YYSTACK_USE_ALLOCA 1
   129772 #endif
   129773 
   129774   static int yylex (void);
   129775   static void yyerror ( const char *msg);
   129776 %}
   129777 
   129778 %error-verbose
   129779 %debug
   129780 %token WAIT_FOR_EOF
   129781 %%
   129782 exp: WAIT_FOR_EOF exp | ;
   129783 %%
   129784 #include <stdio.h>
   129785 /* A C error reporting function.  */
   129786 static
   129787 void yyerror ( const char *msg)
   129788 {
   129789   fprintf (stderr, "%s\n", msg);
   129790 }
   129791 #include <assert.h>
   129792 static int
   129793 yylex (void)
   129794 {
   129795   assert (0 <= yylval);
   129796   if (yylval--)
   129797     return WAIT_FOR_EOF;
   129798   else
   129799     return EOF;
   129800 }
   129801 
   129802 /* Return argv[1] as an int. */
   129803 static int
   129804 get_args (int argc, const char **argv)
   129805 {
   129806   int res;
   129807   char *endp;
   129808   assert (argc == 2);
   129809   res = strtol (argv[1], &endp, 10);
   129810   assert (argv[1] != endp);
   129811   assert (0 <= res);
   129812   assert (res <= INT_MAX);
   129813   assert (errno != ERANGE);
   129814   return res;
   129815 }
   129816 
   129817 int
   129818 main (int argc, const char **argv)
   129819 {
   129820   YYSTYPE yylval_init = get_args (argc, argv);
   129821   int status = 0;
   129822   int count;
   129823   yydebug = 1;
   129824   for (count = 0; count < 2; ++count)
   129825     {
   129826       int new_status;
   129827       yylval = yylval_init;
   129828       new_status = yyparse ();
   129829       if (count == 0)
   129830         status = new_status;
   129831       else
   129832         assert (new_status == status);
   129833     }
   129834   return status;
   129835 }
   129836 _ATEOF
   129837 
   129838 
   129839 
   129840 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   129841   at_save_special_files
   129842   mkdir xml-tests
   129843     # Don't combine these Bison invocations since we want to be sure that
   129844   # --report=all isn't required to get the full XML file.
   129845   { set +x
   129846 $as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   129847                   --graph=xml-tests/test.dot -o input.c input.y"
   129848 at_fn_check_prepare_notrace 'an embedded newline' "torture.at:475"
   129849 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   129850                   --graph=xml-tests/test.dot -o input.c input.y
   129851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129852 at_status=$? at_failed=false
   129853 $at_check_filter
   129854 echo stderr:; cat "$at_stderr"
   129855 echo stdout:; cat "$at_stdout"
   129856 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129857 $at_failed && at_fn_log_failure
   129858 $at_traceon; }
   129859 
   129860   { set +x
   129861 $as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   129862 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:475"
   129863 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   129864 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129865 at_status=$? at_failed=false
   129866 $at_check_filter
   129867 echo stderr:; cat "$at_stderr"
   129868 echo stdout:; cat "$at_stdout"
   129869 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129870 $at_failed && at_fn_log_failure
   129871 $at_traceon; }
   129872 
   129873     cp xml-tests/test.output expout
   129874   { set +x
   129875 $as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\
   129876              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   129877              xml-tests/test.xml"
   129878 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475"
   129879 ( $at_check_trace; $XSLTPROC \
   129880              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   129881              xml-tests/test.xml
   129882 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129883 at_status=$? at_failed=false
   129884 $at_check_filter
   129885 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129886 $at_diff expout "$at_stdout" || at_failed=:
   129887 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129888 $at_failed && at_fn_log_failure
   129889 $at_traceon; }
   129890 
   129891   sort xml-tests/test.dot > expout
   129892   { set +x
   129893 $as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\
   129894              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   129895              xml-tests/test.xml | sort"
   129896 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475"
   129897 ( $at_check_trace; $XSLTPROC \
   129898              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   129899              xml-tests/test.xml | sort
   129900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129901 at_status=$? at_failed=false
   129902 $at_check_filter
   129903 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129904 $at_diff expout "$at_stdout" || at_failed=:
   129905 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129906 $at_failed && at_fn_log_failure
   129907 $at_traceon; }
   129908 
   129909   rm -rf xml-tests expout
   129910   at_restore_special_files
   129911 fi
   129912 { set +x
   129913 $as_echo "$at_srcdir/torture.at:475: bison -o input.c input.y"
   129914 at_fn_check_prepare_trace "torture.at:475"
   129915 ( $at_check_trace; bison -o input.c input.y
   129916 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129917 at_status=$? at_failed=false
   129918 $at_check_filter
   129919 at_fn_diff_devnull "$at_stderr" || at_failed=:
   129920 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129921 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129922 $at_failed && at_fn_log_failure
   129923 $at_traceon; }
   129924 
   129925 
   129926 { set +x
   129927 $as_echo "$at_srcdir/torture.at:475: \$BISON_C_WORKS"
   129928 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:475"
   129929 ( $at_check_trace; $BISON_C_WORKS
   129930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129931 at_status=$? at_failed=false
   129932 $at_check_filter
   129933 echo stderr:; cat "$at_stderr"
   129934 echo stdout:; cat "$at_stdout"
   129935 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129936 $at_failed && at_fn_log_failure
   129937 $at_traceon; }
   129938 
   129939 { set +x
   129940 $as_echo "$at_srcdir/torture.at:475: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   129941 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:475"
   129942 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   129943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129944 at_status=$? at_failed=false
   129945 $at_check_filter
   129946 echo stderr:; cat "$at_stderr"
   129947 echo stdout:; cat "$at_stdout"
   129948 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
   129949 $at_failed && at_fn_log_failure
   129950 $at_traceon; }
   129951 
   129952 
   129953 
   129954 # Below the limit of 200.
   129955 { set +x
   129956 $as_echo "$at_srcdir/torture.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
   129957 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:478"
   129958 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
   129959 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129960 at_status=$? at_failed=false
   129961 $at_check_filter
   129962 echo stderr:; tee stderr <"$at_stderr"
   129963 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129964 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478"
   129965 $at_failed && at_fn_log_failure
   129966 $at_traceon; }
   129967 
   129968 { set +x
   129969 $as_echo "$at_srcdir/torture.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   129970 at_fn_check_prepare_trace "torture.at:478"
   129971 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   129972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129973 at_status=$? at_failed=false
   129974 $at_check_filter
   129975 echo stderr:; cat "$at_stderr"
   129976 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129977 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478"
   129978 $at_failed && at_fn_log_failure
   129979 $at_traceon; }
   129980 
   129981 
   129982 # Two enlargements: 2 * 2 * 200.
   129983 { set +x
   129984 $as_echo "$at_srcdir/torture.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
   129985 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:481"
   129986 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
   129987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   129988 at_status=$? at_failed=false
   129989 $at_check_filter
   129990 echo stderr:; tee stderr <"$at_stderr"
   129991 at_fn_diff_devnull "$at_stdout" || at_failed=:
   129992 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481"
   129993 $at_failed && at_fn_log_failure
   129994 $at_traceon; }
   129995 
   129996 { set +x
   129997 $as_echo "$at_srcdir/torture.at:481: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   129998 at_fn_check_prepare_trace "torture.at:481"
   129999 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130001 at_status=$? at_failed=false
   130002 $at_check_filter
   130003 echo stderr:; cat "$at_stderr"
   130004 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130005 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481"
   130006 $at_failed && at_fn_log_failure
   130007 $at_traceon; }
   130008 
   130009 
   130010 # Fails: beyond the limit of 10,000 (which we don't reach anyway since we
   130011 # multiply by two starting at 200 => 5120 is the last possible).
   130012 { set +x
   130013 $as_echo "$at_srcdir/torture.at:485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
   130014 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:485"
   130015 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
   130016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130017 at_status=$? at_failed=false
   130018 $at_check_filter
   130019 echo stderr:; tee stderr <"$at_stderr"
   130020 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130021 at_fn_check_status 2 $at_status "$at_srcdir/torture.at:485"
   130022 $at_failed && at_fn_log_failure
   130023 $at_traceon; }
   130024 
   130025 { set +x
   130026 $as_echo "$at_srcdir/torture.at:485: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130027 at_fn_check_prepare_trace "torture.at:485"
   130028 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130030 at_status=$? at_failed=false
   130031 $at_check_filter
   130032 echo stderr:; cat "$at_stderr"
   130033 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130034 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:485"
   130035 $at_failed && at_fn_log_failure
   130036 $at_traceon; }
   130037 
   130038 
   130039 
   130040 # The push parser can't use alloca since the stacks can't be locals.  This test
   130041 # just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
   130042 # push parsers.
   130043 
   130044 # A grammar of parens growing the stack thanks to right recursion.
   130045 # exp:
   130046 cat >input.y <<'_ATEOF'
   130047 %code top {
   130048 #include <config.h>
   130049 /* We don't need perfect functions for these tests. */
   130050 #undef malloc
   130051 #undef memcmp
   130052 #undef realloc
   130053 }
   130054 
   130055 %{
   130056 #include <errno.h>
   130057 #include <limits.h>
   130058 #include <stdio.h>
   130059 #include <stdlib.h>
   130060 
   130061 #if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \
   130062      || defined _AIX || defined _MSC_VER || defined _ALLOCA_H)
   130063 # define YYSTACK_USE_ALLOCA 1
   130064 #endif
   130065 
   130066   static int yylex (void);
   130067   static void yyerror ( const char *msg);
   130068 %}
   130069 %define api.push-pull both
   130070 
   130071 %error-verbose
   130072 %debug
   130073 %token WAIT_FOR_EOF
   130074 %%
   130075 exp: WAIT_FOR_EOF exp | ;
   130076 %%
   130077 #include <stdio.h>
   130078 /* A C error reporting function.  */
   130079 static
   130080 void yyerror ( const char *msg)
   130081 {
   130082   fprintf (stderr, "%s\n", msg);
   130083 }
   130084 #include <assert.h>
   130085 static int
   130086 yylex (void)
   130087 {
   130088   assert (0 <= yylval);
   130089   if (yylval--)
   130090     return WAIT_FOR_EOF;
   130091   else
   130092     return EOF;
   130093 }
   130094 
   130095 /* Return argv[1] as an int. */
   130096 static int
   130097 get_args (int argc, const char **argv)
   130098 {
   130099   int res;
   130100   char *endp;
   130101   assert (argc == 2);
   130102   res = strtol (argv[1], &endp, 10);
   130103   assert (argv[1] != endp);
   130104   assert (0 <= res);
   130105   assert (res <= INT_MAX);
   130106   assert (errno != ERANGE);
   130107   return res;
   130108 }
   130109 
   130110 int
   130111 main (int argc, const char **argv)
   130112 {
   130113   YYSTYPE yylval_init = get_args (argc, argv);
   130114   int status = 0;
   130115   int count;
   130116   yypstate *ps = yypstate_new ();
   130117   yydebug = 1;
   130118   for (count = 0; count < 2; ++count)
   130119     {
   130120       int new_status;
   130121       yylval = yylval_init;
   130122       new_status = yypull_parse (ps);
   130123       if (count == 0)
   130124         status = new_status;
   130125       else
   130126         assert (new_status == status);
   130127     }
   130128   yypstate_delete (ps);
   130129   return status;
   130130 }
   130131 _ATEOF
   130132 
   130133 
   130134 
   130135 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   130136   at_save_special_files
   130137   mkdir xml-tests
   130138     # Don't combine these Bison invocations since we want to be sure that
   130139   # --report=all isn't required to get the full XML file.
   130140   { set +x
   130141 $as_echo "$at_srcdir/torture.at:491: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   130142                   --graph=xml-tests/test.dot -o input.c input.y"
   130143 at_fn_check_prepare_notrace 'an embedded newline' "torture.at:491"
   130144 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   130145                   --graph=xml-tests/test.dot -o input.c input.y
   130146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130147 at_status=$? at_failed=false
   130148 $at_check_filter
   130149 echo stderr:; cat "$at_stderr"
   130150 echo stdout:; cat "$at_stdout"
   130151 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130152 $at_failed && at_fn_log_failure
   130153 $at_traceon; }
   130154 
   130155   { set +x
   130156 $as_echo "$at_srcdir/torture.at:491: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   130157 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:491"
   130158 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   130159 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130160 at_status=$? at_failed=false
   130161 $at_check_filter
   130162 echo stderr:; cat "$at_stderr"
   130163 echo stdout:; cat "$at_stdout"
   130164 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130165 $at_failed && at_fn_log_failure
   130166 $at_traceon; }
   130167 
   130168     cp xml-tests/test.output expout
   130169   { set +x
   130170 $as_echo "$at_srcdir/torture.at:491: \$XSLTPROC \\
   130171              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   130172              xml-tests/test.xml"
   130173 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:491"
   130174 ( $at_check_trace; $XSLTPROC \
   130175              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   130176              xml-tests/test.xml
   130177 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130178 at_status=$? at_failed=false
   130179 $at_check_filter
   130180 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130181 $at_diff expout "$at_stdout" || at_failed=:
   130182 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130183 $at_failed && at_fn_log_failure
   130184 $at_traceon; }
   130185 
   130186   sort xml-tests/test.dot > expout
   130187   { set +x
   130188 $as_echo "$at_srcdir/torture.at:491: \$XSLTPROC \\
   130189              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   130190              xml-tests/test.xml | sort"
   130191 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:491"
   130192 ( $at_check_trace; $XSLTPROC \
   130193              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   130194              xml-tests/test.xml | sort
   130195 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130196 at_status=$? at_failed=false
   130197 $at_check_filter
   130198 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130199 $at_diff expout "$at_stdout" || at_failed=:
   130200 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130201 $at_failed && at_fn_log_failure
   130202 $at_traceon; }
   130203 
   130204   rm -rf xml-tests expout
   130205   at_restore_special_files
   130206 fi
   130207 { set +x
   130208 $as_echo "$at_srcdir/torture.at:491: bison -o input.c input.y"
   130209 at_fn_check_prepare_trace "torture.at:491"
   130210 ( $at_check_trace; bison -o input.c input.y
   130211 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130212 at_status=$? at_failed=false
   130213 $at_check_filter
   130214 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130215 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130216 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130217 $at_failed && at_fn_log_failure
   130218 $at_traceon; }
   130219 
   130220 
   130221 { set +x
   130222 $as_echo "$at_srcdir/torture.at:491: \$BISON_C_WORKS"
   130223 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:491"
   130224 ( $at_check_trace; $BISON_C_WORKS
   130225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130226 at_status=$? at_failed=false
   130227 $at_check_filter
   130228 echo stderr:; cat "$at_stderr"
   130229 echo stdout:; cat "$at_stdout"
   130230 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130231 $at_failed && at_fn_log_failure
   130232 $at_traceon; }
   130233 
   130234 { set +x
   130235 $as_echo "$at_srcdir/torture.at:491: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   130236 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:491"
   130237 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   130238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130239 at_status=$? at_failed=false
   130240 $at_check_filter
   130241 echo stderr:; cat "$at_stderr"
   130242 echo stdout:; cat "$at_stdout"
   130243 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491"
   130244 $at_failed && at_fn_log_failure
   130245 $at_traceon; }
   130246 
   130247 
   130248 { set +x
   130249 $as_echo "$at_srcdir/torture.at:494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
   130250 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:494"
   130251 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
   130252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130253 at_status=$? at_failed=false
   130254 $at_check_filter
   130255 echo stderr:; tee stderr <"$at_stderr"
   130256 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130257 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:494"
   130258 $at_failed && at_fn_log_failure
   130259 $at_traceon; }
   130260 
   130261 { set +x
   130262 $as_echo "$at_srcdir/torture.at:494: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130263 at_fn_check_prepare_trace "torture.at:494"
   130264 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130266 at_status=$? at_failed=false
   130267 $at_check_filter
   130268 echo stderr:; cat "$at_stderr"
   130269 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130270 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:494"
   130271 $at_failed && at_fn_log_failure
   130272 $at_traceon; }
   130273 
   130274 
   130275 { set +x
   130276 $as_echo "$at_srcdir/torture.at:496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
   130277 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:496"
   130278 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
   130279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130280 at_status=$? at_failed=false
   130281 $at_check_filter
   130282 echo stderr:; tee stderr <"$at_stderr"
   130283 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130284 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496"
   130285 $at_failed && at_fn_log_failure
   130286 $at_traceon; }
   130287 
   130288 { set +x
   130289 $as_echo "$at_srcdir/torture.at:496: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130290 at_fn_check_prepare_trace "torture.at:496"
   130291 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130292 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130293 at_status=$? at_failed=false
   130294 $at_check_filter
   130295 echo stderr:; cat "$at_stderr"
   130296 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130297 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496"
   130298 $at_failed && at_fn_log_failure
   130299 $at_traceon; }
   130300 
   130301 
   130302 { set +x
   130303 $as_echo "$at_srcdir/torture.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
   130304 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:498"
   130305 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
   130306 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130307 at_status=$? at_failed=false
   130308 $at_check_filter
   130309 echo stderr:; tee stderr <"$at_stderr"
   130310 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130311 at_fn_check_status 2 $at_status "$at_srcdir/torture.at:498"
   130312 $at_failed && at_fn_log_failure
   130313 $at_traceon; }
   130314 
   130315 { set +x
   130316 $as_echo "$at_srcdir/torture.at:498: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130317 at_fn_check_prepare_trace "torture.at:498"
   130318 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130320 at_status=$? at_failed=false
   130321 $at_check_filter
   130322 echo stderr:; cat "$at_stderr"
   130323 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130324 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
   130325 $at_failed && at_fn_log_failure
   130326 $at_traceon; }
   130327 
   130328 
   130329 
   130330 
   130331 
   130332   set +x
   130333   $at_times_p && times >"$at_times_file"
   130334 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   130335 read at_status <"$at_status_file"
   130336 #AT_STOP_257
   130337 #AT_START_258
   130338 at_fn_group_banner 258 'torture.at:512' \
   130339   "Exploding the Stack Size with Malloc" "           " 15
   130340 at_xfail=no
   130341 (
   130342   $as_echo "258. $at_setup_line: testing $at_desc ..."
   130343   $at_traceon
   130344 
   130345 
   130346 
   130347 
   130348 
   130349 # A grammar of parens growing the stack thanks to right recursion.
   130350 # exp:
   130351 cat >input.y <<'_ATEOF'
   130352 %code top {
   130353 #include <config.h>
   130354 /* We don't need perfect functions for these tests. */
   130355 #undef malloc
   130356 #undef memcmp
   130357 #undef realloc
   130358 }
   130359 
   130360 %{
   130361 #include <errno.h>
   130362 #include <limits.h>
   130363 #include <stdio.h>
   130364 #include <stdlib.h>
   130365 #define YYSTACK_USE_ALLOCA 0
   130366   static int yylex (void);
   130367   static void yyerror ( const char *msg);
   130368 %}
   130369 
   130370 %error-verbose
   130371 %debug
   130372 %token WAIT_FOR_EOF
   130373 %%
   130374 exp: WAIT_FOR_EOF exp | ;
   130375 %%
   130376 #include <stdio.h>
   130377 /* A C error reporting function.  */
   130378 static
   130379 void yyerror ( const char *msg)
   130380 {
   130381   fprintf (stderr, "%s\n", msg);
   130382 }
   130383 #include <assert.h>
   130384 static int
   130385 yylex (void)
   130386 {
   130387   assert (0 <= yylval);
   130388   if (yylval--)
   130389     return WAIT_FOR_EOF;
   130390   else
   130391     return EOF;
   130392 }
   130393 
   130394 /* Return argv[1] as an int. */
   130395 static int
   130396 get_args (int argc, const char **argv)
   130397 {
   130398   int res;
   130399   char *endp;
   130400   assert (argc == 2);
   130401   res = strtol (argv[1], &endp, 10);
   130402   assert (argv[1] != endp);
   130403   assert (0 <= res);
   130404   assert (res <= INT_MAX);
   130405   assert (errno != ERANGE);
   130406   return res;
   130407 }
   130408 
   130409 int
   130410 main (int argc, const char **argv)
   130411 {
   130412   YYSTYPE yylval_init = get_args (argc, argv);
   130413   int status = 0;
   130414   int count;
   130415   yydebug = 1;
   130416   for (count = 0; count < 2; ++count)
   130417     {
   130418       int new_status;
   130419       yylval = yylval_init;
   130420       new_status = yyparse ();
   130421       if (count == 0)
   130422         status = new_status;
   130423       else
   130424         assert (new_status == status);
   130425     }
   130426   return status;
   130427 }
   130428 _ATEOF
   130429 
   130430 
   130431 
   130432 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   130433   at_save_special_files
   130434   mkdir xml-tests
   130435     # Don't combine these Bison invocations since we want to be sure that
   130436   # --report=all isn't required to get the full XML file.
   130437   { set +x
   130438 $as_echo "$at_srcdir/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   130439                   --graph=xml-tests/test.dot -o input.c input.y"
   130440 at_fn_check_prepare_notrace 'an embedded newline' "torture.at:516"
   130441 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   130442                   --graph=xml-tests/test.dot -o input.c input.y
   130443 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130444 at_status=$? at_failed=false
   130445 $at_check_filter
   130446 echo stderr:; cat "$at_stderr"
   130447 echo stdout:; cat "$at_stdout"
   130448 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130449 $at_failed && at_fn_log_failure
   130450 $at_traceon; }
   130451 
   130452   { set +x
   130453 $as_echo "$at_srcdir/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   130454 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:516"
   130455 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   130456 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130457 at_status=$? at_failed=false
   130458 $at_check_filter
   130459 echo stderr:; cat "$at_stderr"
   130460 echo stdout:; cat "$at_stdout"
   130461 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130462 $at_failed && at_fn_log_failure
   130463 $at_traceon; }
   130464 
   130465     cp xml-tests/test.output expout
   130466   { set +x
   130467 $as_echo "$at_srcdir/torture.at:516: \$XSLTPROC \\
   130468              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   130469              xml-tests/test.xml"
   130470 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:516"
   130471 ( $at_check_trace; $XSLTPROC \
   130472              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   130473              xml-tests/test.xml
   130474 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130475 at_status=$? at_failed=false
   130476 $at_check_filter
   130477 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130478 $at_diff expout "$at_stdout" || at_failed=:
   130479 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130480 $at_failed && at_fn_log_failure
   130481 $at_traceon; }
   130482 
   130483   sort xml-tests/test.dot > expout
   130484   { set +x
   130485 $as_echo "$at_srcdir/torture.at:516: \$XSLTPROC \\
   130486              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   130487              xml-tests/test.xml | sort"
   130488 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:516"
   130489 ( $at_check_trace; $XSLTPROC \
   130490              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   130491              xml-tests/test.xml | sort
   130492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130493 at_status=$? at_failed=false
   130494 $at_check_filter
   130495 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130496 $at_diff expout "$at_stdout" || at_failed=:
   130497 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130498 $at_failed && at_fn_log_failure
   130499 $at_traceon; }
   130500 
   130501   rm -rf xml-tests expout
   130502   at_restore_special_files
   130503 fi
   130504 { set +x
   130505 $as_echo "$at_srcdir/torture.at:516: bison -o input.c input.y"
   130506 at_fn_check_prepare_trace "torture.at:516"
   130507 ( $at_check_trace; bison -o input.c input.y
   130508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130509 at_status=$? at_failed=false
   130510 $at_check_filter
   130511 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130512 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130513 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130514 $at_failed && at_fn_log_failure
   130515 $at_traceon; }
   130516 
   130517 
   130518 { set +x
   130519 $as_echo "$at_srcdir/torture.at:516: \$BISON_C_WORKS"
   130520 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:516"
   130521 ( $at_check_trace; $BISON_C_WORKS
   130522 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130523 at_status=$? at_failed=false
   130524 $at_check_filter
   130525 echo stderr:; cat "$at_stderr"
   130526 echo stdout:; cat "$at_stdout"
   130527 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130528 $at_failed && at_fn_log_failure
   130529 $at_traceon; }
   130530 
   130531 { set +x
   130532 $as_echo "$at_srcdir/torture.at:516: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   130533 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:516"
   130534 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   130535 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130536 at_status=$? at_failed=false
   130537 $at_check_filter
   130538 echo stderr:; cat "$at_stderr"
   130539 echo stdout:; cat "$at_stdout"
   130540 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
   130541 $at_failed && at_fn_log_failure
   130542 $at_traceon; }
   130543 
   130544 
   130545 
   130546 # Below the limit of 200.
   130547 { set +x
   130548 $as_echo "$at_srcdir/torture.at:519: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
   130549 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:519"
   130550 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
   130551 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130552 at_status=$? at_failed=false
   130553 $at_check_filter
   130554 echo stderr:; tee stderr <"$at_stderr"
   130555 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130556 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:519"
   130557 $at_failed && at_fn_log_failure
   130558 $at_traceon; }
   130559 
   130560 { set +x
   130561 $as_echo "$at_srcdir/torture.at:519: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130562 at_fn_check_prepare_trace "torture.at:519"
   130563 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130565 at_status=$? at_failed=false
   130566 $at_check_filter
   130567 echo stderr:; cat "$at_stderr"
   130568 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130569 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:519"
   130570 $at_failed && at_fn_log_failure
   130571 $at_traceon; }
   130572 
   130573 
   130574 # Two enlargements: 2 * 2 * 200.
   130575 { set +x
   130576 $as_echo "$at_srcdir/torture.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
   130577 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:522"
   130578 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
   130579 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130580 at_status=$? at_failed=false
   130581 $at_check_filter
   130582 echo stderr:; tee stderr <"$at_stderr"
   130583 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130584 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:522"
   130585 $at_failed && at_fn_log_failure
   130586 $at_traceon; }
   130587 
   130588 { set +x
   130589 $as_echo "$at_srcdir/torture.at:522: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130590 at_fn_check_prepare_trace "torture.at:522"
   130591 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130592 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130593 at_status=$? at_failed=false
   130594 $at_check_filter
   130595 echo stderr:; cat "$at_stderr"
   130596 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130597 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:522"
   130598 $at_failed && at_fn_log_failure
   130599 $at_traceon; }
   130600 
   130601 
   130602 # Fails: beyond the limit of 10,000 (which we don't reach anyway since we
   130603 # multiply by two starting at 200 => 5120 is the possible).
   130604 { set +x
   130605 $as_echo "$at_srcdir/torture.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
   130606 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:526"
   130607 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
   130608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130609 at_status=$? at_failed=false
   130610 $at_check_filter
   130611 echo stderr:; tee stderr <"$at_stderr"
   130612 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130613 at_fn_check_status 2 $at_status "$at_srcdir/torture.at:526"
   130614 $at_failed && at_fn_log_failure
   130615 $at_traceon; }
   130616 
   130617 { set +x
   130618 $as_echo "$at_srcdir/torture.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130619 at_fn_check_prepare_trace "torture.at:526"
   130620 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130621 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130622 at_status=$? at_failed=false
   130623 $at_check_filter
   130624 echo stderr:; cat "$at_stderr"
   130625 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130626 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:526"
   130627 $at_failed && at_fn_log_failure
   130628 $at_traceon; }
   130629 
   130630 
   130631 
   130632 
   130633 # A grammar of parens growing the stack thanks to right recursion.
   130634 # exp:
   130635 cat >input.y <<'_ATEOF'
   130636 %code top {
   130637 #include <config.h>
   130638 /* We don't need perfect functions for these tests. */
   130639 #undef malloc
   130640 #undef memcmp
   130641 #undef realloc
   130642 }
   130643 
   130644 %{
   130645 #include <errno.h>
   130646 #include <limits.h>
   130647 #include <stdio.h>
   130648 #include <stdlib.h>
   130649 #define YYSTACK_USE_ALLOCA 0
   130650   static int yylex (void);
   130651   static void yyerror ( const char *msg);
   130652 %}
   130653 %define api.push-pull both
   130654 
   130655 %error-verbose
   130656 %debug
   130657 %token WAIT_FOR_EOF
   130658 %%
   130659 exp: WAIT_FOR_EOF exp | ;
   130660 %%
   130661 #include <stdio.h>
   130662 /* A C error reporting function.  */
   130663 static
   130664 void yyerror ( const char *msg)
   130665 {
   130666   fprintf (stderr, "%s\n", msg);
   130667 }
   130668 #include <assert.h>
   130669 static int
   130670 yylex (void)
   130671 {
   130672   assert (0 <= yylval);
   130673   if (yylval--)
   130674     return WAIT_FOR_EOF;
   130675   else
   130676     return EOF;
   130677 }
   130678 
   130679 /* Return argv[1] as an int. */
   130680 static int
   130681 get_args (int argc, const char **argv)
   130682 {
   130683   int res;
   130684   char *endp;
   130685   assert (argc == 2);
   130686   res = strtol (argv[1], &endp, 10);
   130687   assert (argv[1] != endp);
   130688   assert (0 <= res);
   130689   assert (res <= INT_MAX);
   130690   assert (errno != ERANGE);
   130691   return res;
   130692 }
   130693 
   130694 int
   130695 main (int argc, const char **argv)
   130696 {
   130697   YYSTYPE yylval_init = get_args (argc, argv);
   130698   int status = 0;
   130699   int count;
   130700   yypstate *ps = yypstate_new ();
   130701   yydebug = 1;
   130702   for (count = 0; count < 2; ++count)
   130703     {
   130704       int new_status;
   130705       yylval = yylval_init;
   130706       new_status = yypull_parse (ps);
   130707       if (count == 0)
   130708         status = new_status;
   130709       else
   130710         assert (new_status == status);
   130711     }
   130712   yypstate_delete (ps);
   130713   return status;
   130714 }
   130715 _ATEOF
   130716 
   130717 
   130718 
   130719 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   130720   at_save_special_files
   130721   mkdir xml-tests
   130722     # Don't combine these Bison invocations since we want to be sure that
   130723   # --report=all isn't required to get the full XML file.
   130724   { set +x
   130725 $as_echo "$at_srcdir/torture.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   130726                   --graph=xml-tests/test.dot -o input.c input.y"
   130727 at_fn_check_prepare_notrace 'an embedded newline' "torture.at:529"
   130728 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   130729                   --graph=xml-tests/test.dot -o input.c input.y
   130730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130731 at_status=$? at_failed=false
   130732 $at_check_filter
   130733 echo stderr:; cat "$at_stderr"
   130734 echo stdout:; cat "$at_stdout"
   130735 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130736 $at_failed && at_fn_log_failure
   130737 $at_traceon; }
   130738 
   130739   { set +x
   130740 $as_echo "$at_srcdir/torture.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   130741 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:529"
   130742 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   130743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130744 at_status=$? at_failed=false
   130745 $at_check_filter
   130746 echo stderr:; cat "$at_stderr"
   130747 echo stdout:; cat "$at_stdout"
   130748 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130749 $at_failed && at_fn_log_failure
   130750 $at_traceon; }
   130751 
   130752     cp xml-tests/test.output expout
   130753   { set +x
   130754 $as_echo "$at_srcdir/torture.at:529: \$XSLTPROC \\
   130755              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   130756              xml-tests/test.xml"
   130757 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:529"
   130758 ( $at_check_trace; $XSLTPROC \
   130759              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   130760              xml-tests/test.xml
   130761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130762 at_status=$? at_failed=false
   130763 $at_check_filter
   130764 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130765 $at_diff expout "$at_stdout" || at_failed=:
   130766 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130767 $at_failed && at_fn_log_failure
   130768 $at_traceon; }
   130769 
   130770   sort xml-tests/test.dot > expout
   130771   { set +x
   130772 $as_echo "$at_srcdir/torture.at:529: \$XSLTPROC \\
   130773              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   130774              xml-tests/test.xml | sort"
   130775 at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:529"
   130776 ( $at_check_trace; $XSLTPROC \
   130777              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   130778              xml-tests/test.xml | sort
   130779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130780 at_status=$? at_failed=false
   130781 $at_check_filter
   130782 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130783 $at_diff expout "$at_stdout" || at_failed=:
   130784 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130785 $at_failed && at_fn_log_failure
   130786 $at_traceon; }
   130787 
   130788   rm -rf xml-tests expout
   130789   at_restore_special_files
   130790 fi
   130791 { set +x
   130792 $as_echo "$at_srcdir/torture.at:529: bison -o input.c input.y"
   130793 at_fn_check_prepare_trace "torture.at:529"
   130794 ( $at_check_trace; bison -o input.c input.y
   130795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130796 at_status=$? at_failed=false
   130797 $at_check_filter
   130798 at_fn_diff_devnull "$at_stderr" || at_failed=:
   130799 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130800 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130801 $at_failed && at_fn_log_failure
   130802 $at_traceon; }
   130803 
   130804 
   130805 { set +x
   130806 $as_echo "$at_srcdir/torture.at:529: \$BISON_C_WORKS"
   130807 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:529"
   130808 ( $at_check_trace; $BISON_C_WORKS
   130809 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130810 at_status=$? at_failed=false
   130811 $at_check_filter
   130812 echo stderr:; cat "$at_stderr"
   130813 echo stdout:; cat "$at_stdout"
   130814 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130815 $at_failed && at_fn_log_failure
   130816 $at_traceon; }
   130817 
   130818 { set +x
   130819 $as_echo "$at_srcdir/torture.at:529: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   130820 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:529"
   130821 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   130822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130823 at_status=$? at_failed=false
   130824 $at_check_filter
   130825 echo stderr:; cat "$at_stderr"
   130826 echo stdout:; cat "$at_stdout"
   130827 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
   130828 $at_failed && at_fn_log_failure
   130829 $at_traceon; }
   130830 
   130831 
   130832 { set +x
   130833 $as_echo "$at_srcdir/torture.at:532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
   130834 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:532"
   130835 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
   130836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130837 at_status=$? at_failed=false
   130838 $at_check_filter
   130839 echo stderr:; tee stderr <"$at_stderr"
   130840 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130841 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:532"
   130842 $at_failed && at_fn_log_failure
   130843 $at_traceon; }
   130844 
   130845 { set +x
   130846 $as_echo "$at_srcdir/torture.at:532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130847 at_fn_check_prepare_trace "torture.at:532"
   130848 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130849 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130850 at_status=$? at_failed=false
   130851 $at_check_filter
   130852 echo stderr:; cat "$at_stderr"
   130853 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130854 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:532"
   130855 $at_failed && at_fn_log_failure
   130856 $at_traceon; }
   130857 
   130858 
   130859 { set +x
   130860 $as_echo "$at_srcdir/torture.at:534: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
   130861 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:534"
   130862 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
   130863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130864 at_status=$? at_failed=false
   130865 $at_check_filter
   130866 echo stderr:; tee stderr <"$at_stderr"
   130867 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130868 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:534"
   130869 $at_failed && at_fn_log_failure
   130870 $at_traceon; }
   130871 
   130872 { set +x
   130873 $as_echo "$at_srcdir/torture.at:534: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130874 at_fn_check_prepare_trace "torture.at:534"
   130875 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130877 at_status=$? at_failed=false
   130878 $at_check_filter
   130879 echo stderr:; cat "$at_stderr"
   130880 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130881 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:534"
   130882 $at_failed && at_fn_log_failure
   130883 $at_traceon; }
   130884 
   130885 
   130886 { set +x
   130887 $as_echo "$at_srcdir/torture.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
   130888 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:536"
   130889 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
   130890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130891 at_status=$? at_failed=false
   130892 $at_check_filter
   130893 echo stderr:; tee stderr <"$at_stderr"
   130894 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130895 at_fn_check_status 2 $at_status "$at_srcdir/torture.at:536"
   130896 $at_failed && at_fn_log_failure
   130897 $at_traceon; }
   130898 
   130899 { set +x
   130900 $as_echo "$at_srcdir/torture.at:536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   130901 at_fn_check_prepare_trace "torture.at:536"
   130902 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   130903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   130904 at_status=$? at_failed=false
   130905 $at_check_filter
   130906 echo stderr:; cat "$at_stderr"
   130907 at_fn_diff_devnull "$at_stdout" || at_failed=:
   130908 at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
   130909 $at_failed && at_fn_log_failure
   130910 $at_traceon; }
   130911 
   130912 
   130913 
   130914 
   130915 
   130916   set +x
   130917   $at_times_p && times >"$at_times_file"
   130918 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   130919 read at_status <"$at_status_file"
   130920 #AT_STOP_258
   130921 #AT_START_259
   130922 at_fn_group_banner 259 'existing.at:79' \
   130923   "GNU AWK 3.1.0 Grammar: LALR(1)" "                 " 16
   130924 at_xfail=no
   130925 (
   130926   $as_echo "259. $at_setup_line: testing $at_desc ..."
   130927   $at_traceon
   130928 
   130929 
   130930 cat >input.y <<'_ATEOF'
   130931 %code top {
   130932 #include <config.h>
   130933 /* We don't need perfect functions for these tests. */
   130934 #undef malloc
   130935 #undef memcmp
   130936 #undef realloc
   130937 }
   130938 
   130939 %code {
   130940   #include <stdio.h>
   130941   static void yyerror ( const char *msg);
   130942   static int yylex (void);
   130943 }
   130944 
   130945 %define lr.type lalr
   130946 %error-verbose
   130947 
   130948 %token FUNC_CALL NAME REGEXP
   130949 %token ERROR
   130950 %token YNUMBER YSTRING
   130951 %token RELOP APPEND_OP
   130952 %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
   130953 %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
   130954 %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
   130955 %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
   130956 %token LEX_GETLINE LEX_NEXTFILE
   130957 %token LEX_IN
   130958 %token LEX_AND LEX_OR INCREMENT DECREMENT
   130959 %token LEX_BUILTIN LEX_LENGTH
   130960 
   130961 /* Lowest to highest */
   130962 %right ASSIGNOP
   130963 %right '?' ':'
   130964 %left LEX_OR
   130965 %left LEX_AND
   130966 %left LEX_GETLINE
   130967 %nonassoc LEX_IN
   130968 %left FUNC_CALL LEX_BUILTIN LEX_LENGTH
   130969 %nonassoc ','
   130970 %nonassoc MATCHOP
   130971 %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
   130972 %left CONCAT_OP
   130973 %left YSTRING YNUMBER
   130974 %left '+' '-'
   130975 %left '*' '/' '%'
   130976 %right '!' UNARY
   130977 %right '^'
   130978 %left INCREMENT DECREMENT
   130979 %left '$'
   130980 %left '(' ')'
   130981 
   130982 
   130983 %%
   130984 
   130985 
   130986 start
   130987 	: opt_nls program opt_nls
   130988 	;
   130989 
   130990 program
   130991 	: rule
   130992 	| program rule
   130993 	| error
   130994 	| program error
   130995 	| /* empty */
   130996 	;
   130997 
   130998 rule
   130999 	: LEX_BEGIN {} action
   131000 	| LEX_END {}   action
   131001 	| LEX_BEGIN statement_term
   131002 	| LEX_END statement_term
   131003 	| pattern action
   131004 	| action
   131005 	| pattern statement_term
   131006 	| function_prologue function_body
   131007 	;
   131008 
   131009 func_name
   131010 	: NAME
   131011 	| FUNC_CALL
   131012 	| lex_builtin
   131013 	;
   131014 
   131015 lex_builtin
   131016 	: LEX_BUILTIN
   131017 	| LEX_LENGTH
   131018 	;
   131019 
   131020 function_prologue
   131021 	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
   131022 	;
   131023 
   131024 function_body
   131025 	: l_brace statements r_brace opt_semi opt_nls
   131026 	| l_brace r_brace opt_semi opt_nls
   131027 	;
   131028 
   131029 pattern
   131030 	: exp
   131031 	| exp ',' exp
   131032 	;
   131033 
   131034 regexp
   131035 	/*
   131036 	 * In this rule, want_regexp tells yylex that the next thing
   131037 	 * is a regexp so it should read up to the closing slash.
   131038 	 */
   131039 	: '/' {} REGEXP '/'
   131040 	;
   131041 
   131042 action
   131043 	: l_brace statements r_brace opt_semi opt_nls
   131044 	| l_brace r_brace opt_semi opt_nls
   131045 	;
   131046 
   131047 statements
   131048 	: statement
   131049 	| statements statement
   131050 	| error
   131051 	| statements error
   131052 	;
   131053 
   131054 statement_term
   131055 	: nls
   131056 	| semi opt_nls
   131057 	;
   131058 
   131059 statement
   131060 	: semi opt_nls
   131061 	| l_brace r_brace
   131062 	| l_brace statements r_brace
   131063 	| if_statement
   131064 	| LEX_WHILE '(' exp r_paren opt_nls statement
   131065 	| LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
   131066 	| LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
   131067 	| LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
   131068 	| LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
   131069 	| LEX_BREAK statement_term
   131070 	| LEX_CONTINUE statement_term
   131071 	| print '(' expression_list r_paren output_redir statement_term
   131072 	| print opt_rexpression_list output_redir statement_term
   131073 	| LEX_NEXT statement_term
   131074 	| LEX_NEXTFILE statement_term
   131075 	| LEX_EXIT opt_exp statement_term
   131076 	| LEX_RETURN {} opt_exp statement_term
   131077 	| LEX_DELETE NAME '[' expression_list ']' statement_term
   131078 	| LEX_DELETE NAME  statement_term
   131079 	| exp statement_term
   131080 	;
   131081 
   131082 print
   131083 	: LEX_PRINT
   131084 	| LEX_PRINTF
   131085 	;
   131086 
   131087 if_statement
   131088 	: LEX_IF '(' exp r_paren opt_nls statement
   131089 	| LEX_IF '(' exp r_paren opt_nls statement
   131090 	     LEX_ELSE opt_nls statement
   131091 	;
   131092 
   131093 nls
   131094 	: NEWLINE
   131095 	| nls NEWLINE
   131096 	;
   131097 
   131098 opt_nls
   131099 	: /* empty */
   131100 	| nls
   131101 	;
   131102 
   131103 input_redir
   131104 	: /* empty */
   131105 	| '<' simp_exp
   131106 	;
   131107 
   131108 output_redir
   131109 	: /* empty */
   131110 	| '>' exp
   131111 	| APPEND_OP exp
   131112 	| '|' exp
   131113 	| TWOWAYIO exp
   131114 	;
   131115 
   131116 opt_param_list
   131117 	: /* empty */
   131118 	| param_list
   131119 	;
   131120 
   131121 param_list
   131122 	: NAME
   131123 	| param_list comma NAME
   131124 	| error
   131125 	| param_list error
   131126 	| param_list comma error
   131127 	;
   131128 
   131129 /* optional expression, as in for loop */
   131130 opt_exp
   131131 	: /* empty */
   131132 	| exp
   131133 	;
   131134 
   131135 opt_rexpression_list
   131136 	: /* empty */
   131137 	| rexpression_list
   131138 	;
   131139 
   131140 rexpression_list
   131141 	: rexp
   131142 	| rexpression_list comma rexp
   131143 	| error
   131144 	| rexpression_list error
   131145 	| rexpression_list error rexp
   131146 	| rexpression_list comma error
   131147 	;
   131148 
   131149 opt_expression_list
   131150 	: /* empty */
   131151 	| expression_list
   131152 	;
   131153 
   131154 expression_list
   131155 	: exp
   131156 	| expression_list comma exp
   131157 	| error
   131158 	| expression_list error
   131159 	| expression_list error exp
   131160 	| expression_list comma error
   131161 	;
   131162 
   131163 /* Expressions, not including the comma operator.  */
   131164 exp	: variable ASSIGNOP {} exp
   131165 	| '(' expression_list r_paren LEX_IN NAME
   131166 	| exp '|' LEX_GETLINE opt_variable
   131167 	| exp TWOWAYIO LEX_GETLINE opt_variable
   131168 	| LEX_GETLINE opt_variable input_redir
   131169 	| exp LEX_AND exp
   131170 	| exp LEX_OR exp
   131171 	| exp MATCHOP exp
   131172 	| regexp
   131173 	| '!' regexp %prec UNARY
   131174 	| exp LEX_IN NAME
   131175 	| exp RELOP exp
   131176 	| exp '<' exp
   131177 	| exp '>' exp
   131178 	| exp '?' exp ':' exp
   131179 	| simp_exp
   131180 	| exp simp_exp %prec CONCAT_OP
   131181 	;
   131182 
   131183 rexp
   131184 	: variable ASSIGNOP {} rexp
   131185 	| rexp LEX_AND rexp
   131186 	| rexp LEX_OR rexp
   131187 	| LEX_GETLINE opt_variable input_redir
   131188 	| regexp
   131189 	| '!' regexp %prec UNARY
   131190 	| rexp MATCHOP rexp
   131191 	| rexp LEX_IN NAME
   131192 	| rexp RELOP rexp
   131193 	| rexp '?' rexp ':' rexp
   131194 	| simp_exp
   131195 	| rexp simp_exp %prec CONCAT_OP
   131196 	;
   131197 
   131198 simp_exp
   131199 	: non_post_simp_exp
   131200 	/* Binary operators in order of decreasing precedence.  */
   131201 	| simp_exp '^' simp_exp
   131202 	| simp_exp '*' simp_exp
   131203 	| simp_exp '/' simp_exp
   131204 	| simp_exp '%' simp_exp
   131205 	| simp_exp '+' simp_exp
   131206 	| simp_exp '-' simp_exp
   131207 	| variable INCREMENT
   131208 	| variable DECREMENT
   131209 	;
   131210 
   131211 non_post_simp_exp
   131212 	: '!' simp_exp %prec UNARY
   131213 	| '(' exp r_paren
   131214 	| LEX_BUILTIN
   131215 	  '(' opt_expression_list r_paren
   131216 	| LEX_LENGTH '(' opt_expression_list r_paren
   131217 	| LEX_LENGTH
   131218 	| FUNC_CALL '(' opt_expression_list r_paren
   131219 	| variable
   131220 	| INCREMENT variable
   131221 	| DECREMENT variable
   131222 	| YNUMBER
   131223 	| YSTRING
   131224 	| '-' simp_exp    %prec UNARY
   131225 	| '+' simp_exp    %prec UNARY
   131226 	;
   131227 
   131228 opt_variable
   131229 	: /* empty */
   131230 	| variable
   131231 	;
   131232 
   131233 variable
   131234 	: NAME
   131235 	| NAME '[' expression_list ']'
   131236 	| '$' non_post_simp_exp
   131237 	;
   131238 
   131239 l_brace
   131240 	: '{' opt_nls
   131241 	;
   131242 
   131243 r_brace
   131244 	: '}' opt_nls
   131245 	;
   131246 
   131247 r_paren
   131248 	: ')'
   131249 	;
   131250 
   131251 opt_semi
   131252 	: /* empty */
   131253 	| semi
   131254 	;
   131255 
   131256 semi
   131257 	: ';'
   131258 	;
   131259 
   131260 comma	: ',' opt_nls
   131261 	;
   131262 
   131263 
   131264 %%
   131265 #include <stdio.h>
   131266 /* A C error reporting function.  */
   131267 static
   131268 void yyerror ( const char *msg)
   131269 {
   131270   fprintf (stderr, "%s\n", msg);
   131271 }
   131272 static int
   131273 yylex (void)
   131274 {
   131275   static int const input[] = {
   131276     LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0
   131277   };
   131278   static int const *inputp = input;
   131279   return *inputp++;
   131280 }
   131281 
   131282 int
   131283 main (void)
   131284 {
   131285   return yyparse ();
   131286 }
   131287 _ATEOF
   131288 
   131289 
   131290 
   131291 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   131292 # expanding macros, so it corrupts some special characters in the
   131293 # macros.  To avoid this, expand now and pass it the result with proper
   131294 # string quotation.  Assume args 7 through 12 expand to properly quoted
   131295 # strings.
   131296 
   131297 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   131298   at_save_special_files
   131299   mkdir xml-tests
   131300     # Don't combine these Bison invocations since we want to be sure that
   131301   # --report=all isn't required to get the full XML file.
   131302   { set +x
   131303 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   131304                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   131305 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
   131306 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   131307                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   131308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131309 at_status=$? at_failed=false
   131310 $at_check_filter
   131311 echo stderr:; cat "$at_stderr"
   131312 echo stdout:; cat "$at_stdout"
   131313 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131314 $at_failed && at_fn_log_failure
   131315 $at_traceon; }
   131316 
   131317   { set +x
   131318 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   131319 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:79"
   131320 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   131321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131322 at_status=$? at_failed=false
   131323 $at_check_filter
   131324 echo stderr:; cat "$at_stderr"
   131325 echo stdout:; cat "$at_stdout"
   131326 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131327 $at_failed && at_fn_log_failure
   131328 $at_traceon; }
   131329 
   131330     cp xml-tests/test.output expout
   131331   { set +x
   131332 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   131333              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   131334              xml-tests/test.xml"
   131335 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   131336 ( $at_check_trace; $XSLTPROC \
   131337              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   131338              xml-tests/test.xml
   131339 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131340 at_status=$? at_failed=false
   131341 $at_check_filter
   131342 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131343 $at_diff expout "$at_stdout" || at_failed=:
   131344 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131345 $at_failed && at_fn_log_failure
   131346 $at_traceon; }
   131347 
   131348   sort xml-tests/test.dot > expout
   131349   { set +x
   131350 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   131351              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   131352              xml-tests/test.xml | sort"
   131353 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   131354 ( $at_check_trace; $XSLTPROC \
   131355              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   131356              xml-tests/test.xml | sort
   131357 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131358 at_status=$? at_failed=false
   131359 $at_check_filter
   131360 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131361 $at_diff expout "$at_stdout" || at_failed=:
   131362 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131363 $at_failed && at_fn_log_failure
   131364 $at_traceon; }
   131365 
   131366   rm -rf xml-tests expout
   131367   at_restore_special_files
   131368 fi
   131369 { set +x
   131370 $as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y"
   131371 at_fn_check_prepare_trace "existing.at:79"
   131372 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   131373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131374 at_status=$? at_failed=false
   131375 $at_check_filter
   131376 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce
   131377 " | \
   131378   $at_diff - "$at_stderr" || at_failed=:
   131379 at_fn_diff_devnull "$at_stdout" || at_failed=:
   131380 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131381 $at_failed && at_fn_log_failure
   131382 $at_traceon; }
   131383 
   131384 
   131385 
   131386 { set +x
   131387 $as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1"
   131388 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79"
   131389 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   131390 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131391 at_status=$? at_failed=false
   131392 $at_check_filter
   131393 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131394 echo >>"$at_stdout"; $as_echo "319
   131395 " | \
   131396   $at_diff - "$at_stdout" || at_failed=:
   131397 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131398 $at_failed && at_fn_log_failure
   131399 $at_traceon; }
   131400 
   131401 
   131402 { set +x
   131403 $as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77"
   131404 at_fn_check_prepare_trace "existing.at:79"
   131405 ( $at_check_trace; diff -u /dev/null /dev/null || exit 77
   131406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131407 at_status=$? at_failed=false
   131408 $at_check_filter
   131409 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131410 echo stdout:; cat "$at_stdout"
   131411 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131412 $at_failed && at_fn_log_failure
   131413 $at_traceon; }
   131414 
   131415 
   131416 { set +x
   131417 $as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
   131418 at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79"
   131419 ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
   131420 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131421 at_status=$? at_failed=false
   131422 $at_check_filter
   131423 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131424 at_fn_diff_devnull "$at_stdout" || at_failed=:
   131425 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131426 $at_failed && at_fn_log_failure
   131427 $at_traceon; }
   131428 
   131429 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   131430   at_save_special_files
   131431   mkdir xml-tests
   131432     # Don't combine these Bison invocations since we want to be sure that
   131433   # --report=all isn't required to get the full XML file.
   131434   { set +x
   131435 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   131436                   --graph=xml-tests/test.dot --report=all input-lalr.y"
   131437 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
   131438 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   131439                   --graph=xml-tests/test.dot --report=all input-lalr.y
   131440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131441 at_status=$? at_failed=false
   131442 $at_check_filter
   131443 echo stderr:; cat "$at_stderr"
   131444 echo stdout:; cat "$at_stdout"
   131445 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131446 $at_failed && at_fn_log_failure
   131447 $at_traceon; }
   131448 
   131449   { set +x
   131450 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y"
   131451 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79"
   131452 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y
   131453 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131454 at_status=$? at_failed=false
   131455 $at_check_filter
   131456 echo stderr:; cat "$at_stderr"
   131457 echo stdout:; cat "$at_stdout"
   131458 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131459 $at_failed && at_fn_log_failure
   131460 $at_traceon; }
   131461 
   131462     cp xml-tests/test.output expout
   131463   { set +x
   131464 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   131465              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   131466              xml-tests/test.xml"
   131467 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   131468 ( $at_check_trace; $XSLTPROC \
   131469              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   131470              xml-tests/test.xml
   131471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131472 at_status=$? at_failed=false
   131473 $at_check_filter
   131474 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131475 $at_diff expout "$at_stdout" || at_failed=:
   131476 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131477 $at_failed && at_fn_log_failure
   131478 $at_traceon; }
   131479 
   131480   sort xml-tests/test.dot > expout
   131481   { set +x
   131482 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   131483              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   131484              xml-tests/test.xml | sort"
   131485 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   131486 ( $at_check_trace; $XSLTPROC \
   131487              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   131488              xml-tests/test.xml | sort
   131489 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131490 at_status=$? at_failed=false
   131491 $at_check_filter
   131492 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131493 $at_diff expout "$at_stdout" || at_failed=:
   131494 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131495 $at_failed && at_fn_log_failure
   131496 $at_traceon; }
   131497 
   131498   rm -rf xml-tests expout
   131499   at_restore_special_files
   131500 fi
   131501 { set +x
   131502 $as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y"
   131503 at_fn_check_prepare_trace "existing.at:79"
   131504 ( $at_check_trace; bison --report=all input-lalr.y
   131505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131506 at_status=$? at_failed=false
   131507 $at_check_filter
   131508 echo stderr:; cat "$at_stderr"
   131509 echo stdout:; cat "$at_stdout"
   131510 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131511 $at_failed && at_fn_log_failure
   131512 $at_traceon; }
   131513 
   131514 
   131515 { set +x
   131516 $as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\
   131517            | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
   131518 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
   131519 ( $at_check_trace; diff -u input-lalr.output input.output \
   131520            | sed -n '/^@@/,$p' | sed 's/^ $//'
   131521 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131522 at_status=$? at_failed=false
   131523 $at_check_filter
   131524 at_fn_diff_devnull "$at_stderr" || at_failed=:
   131525 at_fn_diff_devnull "$at_stdout" || at_failed=:
   131526 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131527 $at_failed && at_fn_log_failure
   131528 $at_traceon; }
   131529 
   131530 
   131531 # Canonical LR generates very large tables, resulting in very long
   131532 # files with #line directives that may overflow what the standards
   131533 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   131534 # will issue an error.
   131535 #
   131536 # There is no "" around `wc` since some indent the result.
   131537 
   131538 { set +x
   131539 $as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
   131540 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
   131541 ( $at_check_trace; $BISON_C_WORKS
   131542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131543 at_status=$? at_failed=false
   131544 $at_check_filter
   131545 echo stderr:; cat "$at_stderr"
   131546 echo stdout:; cat "$at_stdout"
   131547 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131548 $at_failed && at_fn_log_failure
   131549 $at_traceon; }
   131550 
   131551 { set +x
   131552 $as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   131553 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79"
   131554 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   131555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131556 at_status=$? at_failed=false
   131557 $at_check_filter
   131558 echo stderr:; cat "$at_stderr"
   131559 echo stdout:; cat "$at_stdout"
   131560 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131561 $at_failed && at_fn_log_failure
   131562 $at_traceon; }
   131563 
   131564 
   131565 { set +x
   131566 $as_echo "$at_srcdir/existing.at:79:  \$PREPARSER ./input"
   131567 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
   131568 ( $at_check_trace;  $PREPARSER ./input
   131569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131570 at_status=$? at_failed=false
   131571 $at_check_filter
   131572 echo stderr:; tee stderr <"$at_stderr"
   131573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   131574 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131575 $at_failed && at_fn_log_failure
   131576 $at_traceon; }
   131577 
   131578 { set +x
   131579 $as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   131580 at_fn_check_prepare_trace "existing.at:79"
   131581 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   131582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131583 at_status=$? at_failed=false
   131584 $at_check_filter
   131585 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '*', expecting NEWLINE or '{' or ';'
   131586 " | \
   131587   $at_diff - "$at_stderr" || at_failed=:
   131588 at_fn_diff_devnull "$at_stdout" || at_failed=:
   131589 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131590 $at_failed && at_fn_log_failure
   131591 $at_traceon; }
   131592 
   131593 
   131594 
   131595 
   131596   set +x
   131597   $at_times_p && times >"$at_times_file"
   131598 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   131599 read at_status <"$at_status_file"
   131600 #AT_STOP_259
   131601 #AT_START_260
   131602 at_fn_group_banner 260 'existing.at:79' \
   131603   "GNU AWK 3.1.0 Grammar: IELR(1)" "                 " 16
   131604 at_xfail=no
   131605 (
   131606   $as_echo "260. $at_setup_line: testing $at_desc ..."
   131607   $at_traceon
   131608 
   131609 
   131610 cat >input.y <<'_ATEOF'
   131611 %code top {
   131612 #include <config.h>
   131613 /* We don't need perfect functions for these tests. */
   131614 #undef malloc
   131615 #undef memcmp
   131616 #undef realloc
   131617 }
   131618 
   131619 %code {
   131620   #include <stdio.h>
   131621   static void yyerror ( const char *msg);
   131622   static int yylex (void);
   131623 }
   131624 
   131625 %define lr.type ielr
   131626 %error-verbose
   131627 
   131628 %token FUNC_CALL NAME REGEXP
   131629 %token ERROR
   131630 %token YNUMBER YSTRING
   131631 %token RELOP APPEND_OP
   131632 %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
   131633 %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
   131634 %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
   131635 %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
   131636 %token LEX_GETLINE LEX_NEXTFILE
   131637 %token LEX_IN
   131638 %token LEX_AND LEX_OR INCREMENT DECREMENT
   131639 %token LEX_BUILTIN LEX_LENGTH
   131640 
   131641 /* Lowest to highest */
   131642 %right ASSIGNOP
   131643 %right '?' ':'
   131644 %left LEX_OR
   131645 %left LEX_AND
   131646 %left LEX_GETLINE
   131647 %nonassoc LEX_IN
   131648 %left FUNC_CALL LEX_BUILTIN LEX_LENGTH
   131649 %nonassoc ','
   131650 %nonassoc MATCHOP
   131651 %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
   131652 %left CONCAT_OP
   131653 %left YSTRING YNUMBER
   131654 %left '+' '-'
   131655 %left '*' '/' '%'
   131656 %right '!' UNARY
   131657 %right '^'
   131658 %left INCREMENT DECREMENT
   131659 %left '$'
   131660 %left '(' ')'
   131661 
   131662 
   131663 %%
   131664 
   131665 
   131666 start
   131667 	: opt_nls program opt_nls
   131668 	;
   131669 
   131670 program
   131671 	: rule
   131672 	| program rule
   131673 	| error
   131674 	| program error
   131675 	| /* empty */
   131676 	;
   131677 
   131678 rule
   131679 	: LEX_BEGIN {} action
   131680 	| LEX_END {}   action
   131681 	| LEX_BEGIN statement_term
   131682 	| LEX_END statement_term
   131683 	| pattern action
   131684 	| action
   131685 	| pattern statement_term
   131686 	| function_prologue function_body
   131687 	;
   131688 
   131689 func_name
   131690 	: NAME
   131691 	| FUNC_CALL
   131692 	| lex_builtin
   131693 	;
   131694 
   131695 lex_builtin
   131696 	: LEX_BUILTIN
   131697 	| LEX_LENGTH
   131698 	;
   131699 
   131700 function_prologue
   131701 	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
   131702 	;
   131703 
   131704 function_body
   131705 	: l_brace statements r_brace opt_semi opt_nls
   131706 	| l_brace r_brace opt_semi opt_nls
   131707 	;
   131708 
   131709 pattern
   131710 	: exp
   131711 	| exp ',' exp
   131712 	;
   131713 
   131714 regexp
   131715 	/*
   131716 	 * In this rule, want_regexp tells yylex that the next thing
   131717 	 * is a regexp so it should read up to the closing slash.
   131718 	 */
   131719 	: '/' {} REGEXP '/'
   131720 	;
   131721 
   131722 action
   131723 	: l_brace statements r_brace opt_semi opt_nls
   131724 	| l_brace r_brace opt_semi opt_nls
   131725 	;
   131726 
   131727 statements
   131728 	: statement
   131729 	| statements statement
   131730 	| error
   131731 	| statements error
   131732 	;
   131733 
   131734 statement_term
   131735 	: nls
   131736 	| semi opt_nls
   131737 	;
   131738 
   131739 statement
   131740 	: semi opt_nls
   131741 	| l_brace r_brace
   131742 	| l_brace statements r_brace
   131743 	| if_statement
   131744 	| LEX_WHILE '(' exp r_paren opt_nls statement
   131745 	| LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
   131746 	| LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
   131747 	| LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
   131748 	| LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
   131749 	| LEX_BREAK statement_term
   131750 	| LEX_CONTINUE statement_term
   131751 	| print '(' expression_list r_paren output_redir statement_term
   131752 	| print opt_rexpression_list output_redir statement_term
   131753 	| LEX_NEXT statement_term
   131754 	| LEX_NEXTFILE statement_term
   131755 	| LEX_EXIT opt_exp statement_term
   131756 	| LEX_RETURN {} opt_exp statement_term
   131757 	| LEX_DELETE NAME '[' expression_list ']' statement_term
   131758 	| LEX_DELETE NAME  statement_term
   131759 	| exp statement_term
   131760 	;
   131761 
   131762 print
   131763 	: LEX_PRINT
   131764 	| LEX_PRINTF
   131765 	;
   131766 
   131767 if_statement
   131768 	: LEX_IF '(' exp r_paren opt_nls statement
   131769 	| LEX_IF '(' exp r_paren opt_nls statement
   131770 	     LEX_ELSE opt_nls statement
   131771 	;
   131772 
   131773 nls
   131774 	: NEWLINE
   131775 	| nls NEWLINE
   131776 	;
   131777 
   131778 opt_nls
   131779 	: /* empty */
   131780 	| nls
   131781 	;
   131782 
   131783 input_redir
   131784 	: /* empty */
   131785 	| '<' simp_exp
   131786 	;
   131787 
   131788 output_redir
   131789 	: /* empty */
   131790 	| '>' exp
   131791 	| APPEND_OP exp
   131792 	| '|' exp
   131793 	| TWOWAYIO exp
   131794 	;
   131795 
   131796 opt_param_list
   131797 	: /* empty */
   131798 	| param_list
   131799 	;
   131800 
   131801 param_list
   131802 	: NAME
   131803 	| param_list comma NAME
   131804 	| error
   131805 	| param_list error
   131806 	| param_list comma error
   131807 	;
   131808 
   131809 /* optional expression, as in for loop */
   131810 opt_exp
   131811 	: /* empty */
   131812 	| exp
   131813 	;
   131814 
   131815 opt_rexpression_list
   131816 	: /* empty */
   131817 	| rexpression_list
   131818 	;
   131819 
   131820 rexpression_list
   131821 	: rexp
   131822 	| rexpression_list comma rexp
   131823 	| error
   131824 	| rexpression_list error
   131825 	| rexpression_list error rexp
   131826 	| rexpression_list comma error
   131827 	;
   131828 
   131829 opt_expression_list
   131830 	: /* empty */
   131831 	| expression_list
   131832 	;
   131833 
   131834 expression_list
   131835 	: exp
   131836 	| expression_list comma exp
   131837 	| error
   131838 	| expression_list error
   131839 	| expression_list error exp
   131840 	| expression_list comma error
   131841 	;
   131842 
   131843 /* Expressions, not including the comma operator.  */
   131844 exp	: variable ASSIGNOP {} exp
   131845 	| '(' expression_list r_paren LEX_IN NAME
   131846 	| exp '|' LEX_GETLINE opt_variable
   131847 	| exp TWOWAYIO LEX_GETLINE opt_variable
   131848 	| LEX_GETLINE opt_variable input_redir
   131849 	| exp LEX_AND exp
   131850 	| exp LEX_OR exp
   131851 	| exp MATCHOP exp
   131852 	| regexp
   131853 	| '!' regexp %prec UNARY
   131854 	| exp LEX_IN NAME
   131855 	| exp RELOP exp
   131856 	| exp '<' exp
   131857 	| exp '>' exp
   131858 	| exp '?' exp ':' exp
   131859 	| simp_exp
   131860 	| exp simp_exp %prec CONCAT_OP
   131861 	;
   131862 
   131863 rexp
   131864 	: variable ASSIGNOP {} rexp
   131865 	| rexp LEX_AND rexp
   131866 	| rexp LEX_OR rexp
   131867 	| LEX_GETLINE opt_variable input_redir
   131868 	| regexp
   131869 	| '!' regexp %prec UNARY
   131870 	| rexp MATCHOP rexp
   131871 	| rexp LEX_IN NAME
   131872 	| rexp RELOP rexp
   131873 	| rexp '?' rexp ':' rexp
   131874 	| simp_exp
   131875 	| rexp simp_exp %prec CONCAT_OP
   131876 	;
   131877 
   131878 simp_exp
   131879 	: non_post_simp_exp
   131880 	/* Binary operators in order of decreasing precedence.  */
   131881 	| simp_exp '^' simp_exp
   131882 	| simp_exp '*' simp_exp
   131883 	| simp_exp '/' simp_exp
   131884 	| simp_exp '%' simp_exp
   131885 	| simp_exp '+' simp_exp
   131886 	| simp_exp '-' simp_exp
   131887 	| variable INCREMENT
   131888 	| variable DECREMENT
   131889 	;
   131890 
   131891 non_post_simp_exp
   131892 	: '!' simp_exp %prec UNARY
   131893 	| '(' exp r_paren
   131894 	| LEX_BUILTIN
   131895 	  '(' opt_expression_list r_paren
   131896 	| LEX_LENGTH '(' opt_expression_list r_paren
   131897 	| LEX_LENGTH
   131898 	| FUNC_CALL '(' opt_expression_list r_paren
   131899 	| variable
   131900 	| INCREMENT variable
   131901 	| DECREMENT variable
   131902 	| YNUMBER
   131903 	| YSTRING
   131904 	| '-' simp_exp    %prec UNARY
   131905 	| '+' simp_exp    %prec UNARY
   131906 	;
   131907 
   131908 opt_variable
   131909 	: /* empty */
   131910 	| variable
   131911 	;
   131912 
   131913 variable
   131914 	: NAME
   131915 	| NAME '[' expression_list ']'
   131916 	| '$' non_post_simp_exp
   131917 	;
   131918 
   131919 l_brace
   131920 	: '{' opt_nls
   131921 	;
   131922 
   131923 r_brace
   131924 	: '}' opt_nls
   131925 	;
   131926 
   131927 r_paren
   131928 	: ')'
   131929 	;
   131930 
   131931 opt_semi
   131932 	: /* empty */
   131933 	| semi
   131934 	;
   131935 
   131936 semi
   131937 	: ';'
   131938 	;
   131939 
   131940 comma	: ',' opt_nls
   131941 	;
   131942 
   131943 
   131944 %%
   131945 #include <stdio.h>
   131946 /* A C error reporting function.  */
   131947 static
   131948 void yyerror ( const char *msg)
   131949 {
   131950   fprintf (stderr, "%s\n", msg);
   131951 }
   131952 static int
   131953 yylex (void)
   131954 {
   131955   static int const input[] = {
   131956     LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0
   131957   };
   131958   static int const *inputp = input;
   131959   return *inputp++;
   131960 }
   131961 
   131962 int
   131963 main (void)
   131964 {
   131965   return yyparse ();
   131966 }
   131967 _ATEOF
   131968 
   131969 
   131970 
   131971 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   131972 # expanding macros, so it corrupts some special characters in the
   131973 # macros.  To avoid this, expand now and pass it the result with proper
   131974 # string quotation.  Assume args 7 through 12 expand to properly quoted
   131975 # strings.
   131976 
   131977 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   131978   at_save_special_files
   131979   mkdir xml-tests
   131980     # Don't combine these Bison invocations since we want to be sure that
   131981   # --report=all isn't required to get the full XML file.
   131982   { set +x
   131983 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   131984                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   131985 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
   131986 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   131987                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   131988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   131989 at_status=$? at_failed=false
   131990 $at_check_filter
   131991 echo stderr:; cat "$at_stderr"
   131992 echo stdout:; cat "$at_stdout"
   131993 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   131994 $at_failed && at_fn_log_failure
   131995 $at_traceon; }
   131996 
   131997   { set +x
   131998 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   131999 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:79"
   132000 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   132001 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132002 at_status=$? at_failed=false
   132003 $at_check_filter
   132004 echo stderr:; cat "$at_stderr"
   132005 echo stdout:; cat "$at_stdout"
   132006 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132007 $at_failed && at_fn_log_failure
   132008 $at_traceon; }
   132009 
   132010     cp xml-tests/test.output expout
   132011   { set +x
   132012 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   132013              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   132014              xml-tests/test.xml"
   132015 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   132016 ( $at_check_trace; $XSLTPROC \
   132017              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   132018              xml-tests/test.xml
   132019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132020 at_status=$? at_failed=false
   132021 $at_check_filter
   132022 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132023 $at_diff expout "$at_stdout" || at_failed=:
   132024 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132025 $at_failed && at_fn_log_failure
   132026 $at_traceon; }
   132027 
   132028   sort xml-tests/test.dot > expout
   132029   { set +x
   132030 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   132031              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   132032              xml-tests/test.xml | sort"
   132033 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   132034 ( $at_check_trace; $XSLTPROC \
   132035              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   132036              xml-tests/test.xml | sort
   132037 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132038 at_status=$? at_failed=false
   132039 $at_check_filter
   132040 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132041 $at_diff expout "$at_stdout" || at_failed=:
   132042 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132043 $at_failed && at_fn_log_failure
   132044 $at_traceon; }
   132045 
   132046   rm -rf xml-tests expout
   132047   at_restore_special_files
   132048 fi
   132049 { set +x
   132050 $as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y"
   132051 at_fn_check_prepare_trace "existing.at:79"
   132052 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   132053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132054 at_status=$? at_failed=false
   132055 $at_check_filter
   132056 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce
   132057 " | \
   132058   $at_diff - "$at_stderr" || at_failed=:
   132059 at_fn_diff_devnull "$at_stdout" || at_failed=:
   132060 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132061 $at_failed && at_fn_log_failure
   132062 $at_traceon; }
   132063 
   132064 
   132065 
   132066 { set +x
   132067 $as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1"
   132068 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79"
   132069 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   132070 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132071 at_status=$? at_failed=false
   132072 $at_check_filter
   132073 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132074 echo >>"$at_stdout"; $as_echo "328
   132075 " | \
   132076   $at_diff - "$at_stdout" || at_failed=:
   132077 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132078 $at_failed && at_fn_log_failure
   132079 $at_traceon; }
   132080 
   132081 
   132082 { set +x
   132083 $as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77"
   132084 at_fn_check_prepare_trace "existing.at:79"
   132085 ( $at_check_trace; diff -u /dev/null /dev/null || exit 77
   132086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132087 at_status=$? at_failed=false
   132088 $at_check_filter
   132089 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132090 echo stdout:; cat "$at_stdout"
   132091 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132092 $at_failed && at_fn_log_failure
   132093 $at_traceon; }
   132094 
   132095 
   132096 { set +x
   132097 $as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
   132098 at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79"
   132099 ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
   132100 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132101 at_status=$? at_failed=false
   132102 $at_check_filter
   132103 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132104 at_fn_diff_devnull "$at_stdout" || at_failed=:
   132105 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132106 $at_failed && at_fn_log_failure
   132107 $at_traceon; }
   132108 
   132109 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   132110   at_save_special_files
   132111   mkdir xml-tests
   132112     # Don't combine these Bison invocations since we want to be sure that
   132113   # --report=all isn't required to get the full XML file.
   132114   { set +x
   132115 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   132116                   --graph=xml-tests/test.dot --report=all input-lalr.y"
   132117 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
   132118 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   132119                   --graph=xml-tests/test.dot --report=all input-lalr.y
   132120 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132121 at_status=$? at_failed=false
   132122 $at_check_filter
   132123 echo stderr:; cat "$at_stderr"
   132124 echo stdout:; cat "$at_stdout"
   132125 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132126 $at_failed && at_fn_log_failure
   132127 $at_traceon; }
   132128 
   132129   { set +x
   132130 $as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y"
   132131 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79"
   132132 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y
   132133 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132134 at_status=$? at_failed=false
   132135 $at_check_filter
   132136 echo stderr:; cat "$at_stderr"
   132137 echo stdout:; cat "$at_stdout"
   132138 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132139 $at_failed && at_fn_log_failure
   132140 $at_traceon; }
   132141 
   132142     cp xml-tests/test.output expout
   132143   { set +x
   132144 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   132145              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   132146              xml-tests/test.xml"
   132147 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   132148 ( $at_check_trace; $XSLTPROC \
   132149              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   132150              xml-tests/test.xml
   132151 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132152 at_status=$? at_failed=false
   132153 $at_check_filter
   132154 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132155 $at_diff expout "$at_stdout" || at_failed=:
   132156 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132157 $at_failed && at_fn_log_failure
   132158 $at_traceon; }
   132159 
   132160   sort xml-tests/test.dot > expout
   132161   { set +x
   132162 $as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
   132163              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   132164              xml-tests/test.xml | sort"
   132165 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
   132166 ( $at_check_trace; $XSLTPROC \
   132167              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   132168              xml-tests/test.xml | sort
   132169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132170 at_status=$? at_failed=false
   132171 $at_check_filter
   132172 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132173 $at_diff expout "$at_stdout" || at_failed=:
   132174 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132175 $at_failed && at_fn_log_failure
   132176 $at_traceon; }
   132177 
   132178   rm -rf xml-tests expout
   132179   at_restore_special_files
   132180 fi
   132181 { set +x
   132182 $as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y"
   132183 at_fn_check_prepare_trace "existing.at:79"
   132184 ( $at_check_trace; bison --report=all input-lalr.y
   132185 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132186 at_status=$? at_failed=false
   132187 $at_check_filter
   132188 echo stderr:; cat "$at_stderr"
   132189 echo stdout:; cat "$at_stdout"
   132190 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132191 $at_failed && at_fn_log_failure
   132192 $at_traceon; }
   132193 
   132194 
   132195 { set +x
   132196 $as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\
   132197            | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
   132198 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
   132199 ( $at_check_trace; diff -u input-lalr.output input.output \
   132200            | sed -n '/^@@/,$p' | sed 's/^ $//'
   132201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132202 at_status=$? at_failed=false
   132203 $at_check_filter
   132204 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132205 echo >>"$at_stdout"; $as_echo "@@ -712,7 +712,7 @@
   132206    156         | . '\$' non_post_simp_exp
   132207 
   132208      NAME  shift, and go to state 9
   132209 -    '\$'   shift, and go to state 24
   132210 +    '\$'   shift, and go to state 320
   132211 
   132212      NAME      [reduce using rule 152 (opt_variable)]
   132213      '\$'       [reduce using rule 152 (opt_variable)]
   132214 @@ -5379,7 +5379,7 @@
   132215    156         | . '\$' non_post_simp_exp
   132216 
   132217      NAME  shift, and go to state 9
   132218 -    '\$'   shift, and go to state 24
   132219 +    '\$'   shift, and go to state 320
   132220 
   132221      NAME      [reduce using rule 152 (opt_variable)]
   132222      '\$'       [reduce using rule 152 (opt_variable)]
   132223 @@ -5399,7 +5399,7 @@
   132224    156         | . '\$' non_post_simp_exp
   132225 
   132226      NAME  shift, and go to state 9
   132227 -    '\$'   shift, and go to state 24
   132228 +    '\$'   shift, and go to state 320
   132229 
   132230      NAME      [reduce using rule 152 (opt_variable)]
   132231      '\$'       [reduce using rule 152 (opt_variable)]
   132232 @@ -6214,7 +6214,7 @@
   132233    156         | . '\$' non_post_simp_exp
   132234 
   132235      NAME  shift, and go to state 9
   132236 -    '\$'   shift, and go to state 24
   132237 +    '\$'   shift, and go to state 320
   132238 
   132239      NAME      [reduce using rule 152 (opt_variable)]
   132240      '\$'       [reduce using rule 152 (opt_variable)]
   132241 @@ -11099,3 +11099,274 @@
   132242     45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement .
   132243 
   132244      \$default  reduce using rule 45 (statement)
   132245 +
   132246 +
   132247 +State 320
   132248 +
   132249 +  139 non_post_simp_exp: . '!' simp_exp
   132250 +  140                  | . '(' exp r_paren
   132251 +  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
   132252 +  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
   132253 +  143                  | . LEX_LENGTH
   132254 +  144                  | . FUNC_CALL '(' opt_expression_list r_paren
   132255 +  145                  | . variable
   132256 +  146                  | . INCREMENT variable
   132257 +  147                  | . DECREMENT variable
   132258 +  148                  | . YNUMBER
   132259 +  149                  | . YSTRING
   132260 +  150                  | . '-' simp_exp
   132261 +  151                  | . '+' simp_exp
   132262 +  154 variable: . NAME
   132263 +  155         | . NAME '[' expression_list ']'
   132264 +  156         | . '\$' non_post_simp_exp
   132265 +  156         | '\$' . non_post_simp_exp
   132266 +
   132267 +    FUNC_CALL    shift, and go to state 8
   132268 +    NAME         shift, and go to state 9
   132269 +    YNUMBER      shift, and go to state 10
   132270 +    YSTRING      shift, and go to state 11
   132271 +    INCREMENT    shift, and go to state 321
   132272 +    DECREMENT    shift, and go to state 322
   132273 +    LEX_BUILTIN  shift, and go to state 18
   132274 +    LEX_LENGTH   shift, and go to state 19
   132275 +    '+'          shift, and go to state 323
   132276 +    '-'          shift, and go to state 324
   132277 +    '!'          shift, and go to state 325
   132278 +    '\$'          shift, and go to state 320
   132279 +    '('          shift, and go to state 55
   132280 +
   132281 +    non_post_simp_exp  go to state 62
   132282 +    variable           go to state 63
   132283 +
   132284 +
   132285 +State 321
   132286 +
   132287 +  146 non_post_simp_exp: INCREMENT . variable
   132288 +  154 variable: . NAME
   132289 +  155         | . NAME '[' expression_list ']'
   132290 +  156         | . '\$' non_post_simp_exp
   132291 +
   132292 +    NAME  shift, and go to state 9
   132293 +    '\$'   shift, and go to state 320
   132294 +
   132295 +    variable  go to state 50
   132296 +
   132297 +
   132298 +State 322
   132299 +
   132300 +  147 non_post_simp_exp: DECREMENT . variable
   132301 +  154 variable: . NAME
   132302 +  155         | . NAME '[' expression_list ']'
   132303 +  156         | . '\$' non_post_simp_exp
   132304 +
   132305 +    NAME  shift, and go to state 9
   132306 +    '\$'   shift, and go to state 320
   132307 +
   132308 +    variable  go to state 51
   132309 +
   132310 +
   132311 +State 323
   132312 +
   132313 +  130 simp_exp: . non_post_simp_exp
   132314 +  131         | . simp_exp '^' simp_exp
   132315 +  132         | . simp_exp '*' simp_exp
   132316 +  133         | . simp_exp '/' simp_exp
   132317 +  134         | . simp_exp '%' simp_exp
   132318 +  135         | . simp_exp '+' simp_exp
   132319 +  136         | . simp_exp '-' simp_exp
   132320 +  137         | . variable INCREMENT
   132321 +  138         | . variable DECREMENT
   132322 +  139 non_post_simp_exp: . '!' simp_exp
   132323 +  140                  | . '(' exp r_paren
   132324 +  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
   132325 +  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
   132326 +  143                  | . LEX_LENGTH
   132327 +  144                  | . FUNC_CALL '(' opt_expression_list r_paren
   132328 +  145                  | . variable
   132329 +  146                  | . INCREMENT variable
   132330 +  147                  | . DECREMENT variable
   132331 +  148                  | . YNUMBER
   132332 +  149                  | . YSTRING
   132333 +  150                  | . '-' simp_exp
   132334 +  151                  | . '+' simp_exp
   132335 +  151                  | '+' . simp_exp
   132336 +  154 variable: . NAME
   132337 +  155         | . NAME '[' expression_list ']'
   132338 +  156         | . '\$' non_post_simp_exp
   132339 +
   132340 +    FUNC_CALL    shift, and go to state 8
   132341 +    NAME         shift, and go to state 9
   132342 +    YNUMBER      shift, and go to state 10
   132343 +    YSTRING      shift, and go to state 11
   132344 +    INCREMENT    shift, and go to state 16
   132345 +    DECREMENT    shift, and go to state 17
   132346 +    LEX_BUILTIN  shift, and go to state 18
   132347 +    LEX_LENGTH   shift, and go to state 19
   132348 +    '+'          shift, and go to state 20
   132349 +    '-'          shift, and go to state 21
   132350 +    '!'          shift, and go to state 54
   132351 +    '\$'          shift, and go to state 24
   132352 +    '('          shift, and go to state 55
   132353 +
   132354 +    simp_exp           go to state 326
   132355 +    non_post_simp_exp  go to state 35
   132356 +    variable           go to state 57
   132357 +
   132358 +
   132359 +State 324
   132360 +
   132361 +  130 simp_exp: . non_post_simp_exp
   132362 +  131         | . simp_exp '^' simp_exp
   132363 +  132         | . simp_exp '*' simp_exp
   132364 +  133         | . simp_exp '/' simp_exp
   132365 +  134         | . simp_exp '%' simp_exp
   132366 +  135         | . simp_exp '+' simp_exp
   132367 +  136         | . simp_exp '-' simp_exp
   132368 +  137         | . variable INCREMENT
   132369 +  138         | . variable DECREMENT
   132370 +  139 non_post_simp_exp: . '!' simp_exp
   132371 +  140                  | . '(' exp r_paren
   132372 +  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
   132373 +  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
   132374 +  143                  | . LEX_LENGTH
   132375 +  144                  | . FUNC_CALL '(' opt_expression_list r_paren
   132376 +  145                  | . variable
   132377 +  146                  | . INCREMENT variable
   132378 +  147                  | . DECREMENT variable
   132379 +  148                  | . YNUMBER
   132380 +  149                  | . YSTRING
   132381 +  150                  | . '-' simp_exp
   132382 +  150                  | '-' . simp_exp
   132383 +  151                  | . '+' simp_exp
   132384 +  154 variable: . NAME
   132385 +  155         | . NAME '[' expression_list ']'
   132386 +  156         | . '\$' non_post_simp_exp
   132387 +
   132388 +    FUNC_CALL    shift, and go to state 8
   132389 +    NAME         shift, and go to state 9
   132390 +    YNUMBER      shift, and go to state 10
   132391 +    YSTRING      shift, and go to state 11
   132392 +    INCREMENT    shift, and go to state 16
   132393 +    DECREMENT    shift, and go to state 17
   132394 +    LEX_BUILTIN  shift, and go to state 18
   132395 +    LEX_LENGTH   shift, and go to state 19
   132396 +    '+'          shift, and go to state 20
   132397 +    '-'          shift, and go to state 21
   132398 +    '!'          shift, and go to state 54
   132399 +    '\$'          shift, and go to state 24
   132400 +    '('          shift, and go to state 55
   132401 +
   132402 +    simp_exp           go to state 327
   132403 +    non_post_simp_exp  go to state 35
   132404 +    variable           go to state 57
   132405 +
   132406 +
   132407 +State 325
   132408 +
   132409 +  130 simp_exp: . non_post_simp_exp
   132410 +  131         | . simp_exp '^' simp_exp
   132411 +  132         | . simp_exp '*' simp_exp
   132412 +  133         | . simp_exp '/' simp_exp
   132413 +  134         | . simp_exp '%' simp_exp
   132414 +  135         | . simp_exp '+' simp_exp
   132415 +  136         | . simp_exp '-' simp_exp
   132416 +  137         | . variable INCREMENT
   132417 +  138         | . variable DECREMENT
   132418 +  139 non_post_simp_exp: . '!' simp_exp
   132419 +  139                  | '!' . simp_exp
   132420 +  140                  | . '(' exp r_paren
   132421 +  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
   132422 +  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
   132423 +  143                  | . LEX_LENGTH
   132424 +  144                  | . FUNC_CALL '(' opt_expression_list r_paren
   132425 +  145                  | . variable
   132426 +  146                  | . INCREMENT variable
   132427 +  147                  | . DECREMENT variable
   132428 +  148                  | . YNUMBER
   132429 +  149                  | . YSTRING
   132430 +  150                  | . '-' simp_exp
   132431 +  151                  | . '+' simp_exp
   132432 +  154 variable: . NAME
   132433 +  155         | . NAME '[' expression_list ']'
   132434 +  156         | . '\$' non_post_simp_exp
   132435 +
   132436 +    FUNC_CALL    shift, and go to state 8
   132437 +    NAME         shift, and go to state 9
   132438 +    YNUMBER      shift, and go to state 10
   132439 +    YSTRING      shift, and go to state 11
   132440 +    INCREMENT    shift, and go to state 16
   132441 +    DECREMENT    shift, and go to state 17
   132442 +    LEX_BUILTIN  shift, and go to state 18
   132443 +    LEX_LENGTH   shift, and go to state 19
   132444 +    '+'          shift, and go to state 20
   132445 +    '-'          shift, and go to state 21
   132446 +    '!'          shift, and go to state 54
   132447 +    '\$'          shift, and go to state 24
   132448 +    '('          shift, and go to state 55
   132449 +
   132450 +    simp_exp           go to state 328
   132451 +    non_post_simp_exp  go to state 35
   132452 +    variable           go to state 57
   132453 +
   132454 +
   132455 +State 326
   132456 +
   132457 +  131 simp_exp: simp_exp . '^' simp_exp
   132458 +  132         | simp_exp . '*' simp_exp
   132459 +  133         | simp_exp . '/' simp_exp
   132460 +  134         | simp_exp . '%' simp_exp
   132461 +  135         | simp_exp . '+' simp_exp
   132462 +  136         | simp_exp . '-' simp_exp
   132463 +  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, '+', '-', '!', '\$', '(', ')', ']', '{', ';']
   132464 +
   132465 +    '*'  shift, and go to state 89
   132466 +    '/'  shift, and go to state 90
   132467 +    '%'  shift, and go to state 91
   132468 +    '^'  shift, and go to state 92
   132469 +
   132470 +    \$default  reduce using rule 151 (non_post_simp_exp)
   132471 +
   132472 +    Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY).
   132473 +    Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY).
   132474 +
   132475 +
   132476 +State 327
   132477 +
   132478 +  131 simp_exp: simp_exp . '^' simp_exp
   132479 +  132         | simp_exp . '*' simp_exp
   132480 +  133         | simp_exp . '/' simp_exp
   132481 +  134         | simp_exp . '%' simp_exp
   132482 +  135         | simp_exp . '+' simp_exp
   132483 +  136         | simp_exp . '-' simp_exp
   132484 +  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, '+', '-', '!', '\$', '(', ')', ']', '{', ';']
   132485 +
   132486 +    '*'  shift, and go to state 89
   132487 +    '/'  shift, and go to state 90
   132488 +    '%'  shift, and go to state 91
   132489 +    '^'  shift, and go to state 92
   132490 +
   132491 +    \$default  reduce using rule 150 (non_post_simp_exp)
   132492 +
   132493 +    Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY).
   132494 +    Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY).
   132495 +
   132496 +
   132497 +State 328
   132498 +
   132499 +  131 simp_exp: simp_exp . '^' simp_exp
   132500 +  132         | simp_exp . '*' simp_exp
   132501 +  133         | simp_exp . '/' simp_exp
   132502 +  134         | simp_exp . '%' simp_exp
   132503 +  135         | simp_exp . '+' simp_exp
   132504 +  136         | simp_exp . '-' simp_exp
   132505 +  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, '+', '-', '!', '\$', '(', ')', ']', '{', ';']
   132506 +
   132507 +    '*'  shift, and go to state 89
   132508 +    '/'  shift, and go to state 90
   132509 +    '%'  shift, and go to state 91
   132510 +    '^'  shift, and go to state 92
   132511 +
   132512 +    \$default  reduce using rule 139 (non_post_simp_exp)
   132513 +
   132514 +    Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY).
   132515 +    Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY).
   132516 " | \
   132517   $at_diff - "$at_stdout" || at_failed=:
   132518 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132519 $at_failed && at_fn_log_failure
   132520 $at_traceon; }
   132521 
   132522 
   132523 # Canonical LR generates very large tables, resulting in very long
   132524 # files with #line directives that may overflow what the standards
   132525 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   132526 # will issue an error.
   132527 #
   132528 # There is no "" around `wc` since some indent the result.
   132529 
   132530 { set +x
   132531 $as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
   132532 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
   132533 ( $at_check_trace; $BISON_C_WORKS
   132534 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132535 at_status=$? at_failed=false
   132536 $at_check_filter
   132537 echo stderr:; cat "$at_stderr"
   132538 echo stdout:; cat "$at_stdout"
   132539 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132540 $at_failed && at_fn_log_failure
   132541 $at_traceon; }
   132542 
   132543 { set +x
   132544 $as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   132545 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79"
   132546 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   132547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132548 at_status=$? at_failed=false
   132549 $at_check_filter
   132550 echo stderr:; cat "$at_stderr"
   132551 echo stdout:; cat "$at_stdout"
   132552 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132553 $at_failed && at_fn_log_failure
   132554 $at_traceon; }
   132555 
   132556 
   132557 { set +x
   132558 $as_echo "$at_srcdir/existing.at:79:  \$PREPARSER ./input"
   132559 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
   132560 ( $at_check_trace;  $PREPARSER ./input
   132561 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132562 at_status=$? at_failed=false
   132563 $at_check_filter
   132564 echo stderr:; tee stderr <"$at_stderr"
   132565 at_fn_diff_devnull "$at_stdout" || at_failed=:
   132566 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132567 $at_failed && at_fn_log_failure
   132568 $at_traceon; }
   132569 
   132570 { set +x
   132571 $as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   132572 at_fn_check_prepare_trace "existing.at:79"
   132573 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   132574 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132575 at_status=$? at_failed=false
   132576 $at_check_filter
   132577 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132578 at_fn_diff_devnull "$at_stdout" || at_failed=:
   132579 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132580 $at_failed && at_fn_log_failure
   132581 $at_traceon; }
   132582 
   132583 
   132584 
   132585 
   132586   set +x
   132587   $at_times_p && times >"$at_times_file"
   132588 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   132589 read at_status <"$at_status_file"
   132590 #AT_STOP_260
   132591 #AT_START_261
   132592 at_fn_group_banner 261 'existing.at:79' \
   132593   "GNU AWK 3.1.0 Grammar: Canonical LR(1)" "         " 16
   132594 at_xfail=no
   132595 (
   132596   $as_echo "261. $at_setup_line: testing $at_desc ..."
   132597   $at_traceon
   132598 
   132599 
   132600 cat >input.y <<'_ATEOF'
   132601 %code top {
   132602 #include <config.h>
   132603 /* We don't need perfect functions for these tests. */
   132604 #undef malloc
   132605 #undef memcmp
   132606 #undef realloc
   132607 }
   132608 
   132609 %code {
   132610   #include <stdio.h>
   132611   static void yyerror ( const char *msg);
   132612   static int yylex (void);
   132613 }
   132614 
   132615 %define lr.type canonical-lr
   132616 %error-verbose
   132617 
   132618 %token FUNC_CALL NAME REGEXP
   132619 %token ERROR
   132620 %token YNUMBER YSTRING
   132621 %token RELOP APPEND_OP
   132622 %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
   132623 %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
   132624 %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
   132625 %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
   132626 %token LEX_GETLINE LEX_NEXTFILE
   132627 %token LEX_IN
   132628 %token LEX_AND LEX_OR INCREMENT DECREMENT
   132629 %token LEX_BUILTIN LEX_LENGTH
   132630 
   132631 /* Lowest to highest */
   132632 %right ASSIGNOP
   132633 %right '?' ':'
   132634 %left LEX_OR
   132635 %left LEX_AND
   132636 %left LEX_GETLINE
   132637 %nonassoc LEX_IN
   132638 %left FUNC_CALL LEX_BUILTIN LEX_LENGTH
   132639 %nonassoc ','
   132640 %nonassoc MATCHOP
   132641 %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
   132642 %left CONCAT_OP
   132643 %left YSTRING YNUMBER
   132644 %left '+' '-'
   132645 %left '*' '/' '%'
   132646 %right '!' UNARY
   132647 %right '^'
   132648 %left INCREMENT DECREMENT
   132649 %left '$'
   132650 %left '(' ')'
   132651 
   132652 
   132653 %%
   132654 
   132655 
   132656 start
   132657 	: opt_nls program opt_nls
   132658 	;
   132659 
   132660 program
   132661 	: rule
   132662 	| program rule
   132663 	| error
   132664 	| program error
   132665 	| /* empty */
   132666 	;
   132667 
   132668 rule
   132669 	: LEX_BEGIN {} action
   132670 	| LEX_END {}   action
   132671 	| LEX_BEGIN statement_term
   132672 	| LEX_END statement_term
   132673 	| pattern action
   132674 	| action
   132675 	| pattern statement_term
   132676 	| function_prologue function_body
   132677 	;
   132678 
   132679 func_name
   132680 	: NAME
   132681 	| FUNC_CALL
   132682 	| lex_builtin
   132683 	;
   132684 
   132685 lex_builtin
   132686 	: LEX_BUILTIN
   132687 	| LEX_LENGTH
   132688 	;
   132689 
   132690 function_prologue
   132691 	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
   132692 	;
   132693 
   132694 function_body
   132695 	: l_brace statements r_brace opt_semi opt_nls
   132696 	| l_brace r_brace opt_semi opt_nls
   132697 	;
   132698 
   132699 pattern
   132700 	: exp
   132701 	| exp ',' exp
   132702 	;
   132703 
   132704 regexp
   132705 	/*
   132706 	 * In this rule, want_regexp tells yylex that the next thing
   132707 	 * is a regexp so it should read up to the closing slash.
   132708 	 */
   132709 	: '/' {} REGEXP '/'
   132710 	;
   132711 
   132712 action
   132713 	: l_brace statements r_brace opt_semi opt_nls
   132714 	| l_brace r_brace opt_semi opt_nls
   132715 	;
   132716 
   132717 statements
   132718 	: statement
   132719 	| statements statement
   132720 	| error
   132721 	| statements error
   132722 	;
   132723 
   132724 statement_term
   132725 	: nls
   132726 	| semi opt_nls
   132727 	;
   132728 
   132729 statement
   132730 	: semi opt_nls
   132731 	| l_brace r_brace
   132732 	| l_brace statements r_brace
   132733 	| if_statement
   132734 	| LEX_WHILE '(' exp r_paren opt_nls statement
   132735 	| LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
   132736 	| LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
   132737 	| LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
   132738 	| LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
   132739 	| LEX_BREAK statement_term
   132740 	| LEX_CONTINUE statement_term
   132741 	| print '(' expression_list r_paren output_redir statement_term
   132742 	| print opt_rexpression_list output_redir statement_term
   132743 	| LEX_NEXT statement_term
   132744 	| LEX_NEXTFILE statement_term
   132745 	| LEX_EXIT opt_exp statement_term
   132746 	| LEX_RETURN {} opt_exp statement_term
   132747 	| LEX_DELETE NAME '[' expression_list ']' statement_term
   132748 	| LEX_DELETE NAME  statement_term
   132749 	| exp statement_term
   132750 	;
   132751 
   132752 print
   132753 	: LEX_PRINT
   132754 	| LEX_PRINTF
   132755 	;
   132756 
   132757 if_statement
   132758 	: LEX_IF '(' exp r_paren opt_nls statement
   132759 	| LEX_IF '(' exp r_paren opt_nls statement
   132760 	     LEX_ELSE opt_nls statement
   132761 	;
   132762 
   132763 nls
   132764 	: NEWLINE
   132765 	| nls NEWLINE
   132766 	;
   132767 
   132768 opt_nls
   132769 	: /* empty */
   132770 	| nls
   132771 	;
   132772 
   132773 input_redir
   132774 	: /* empty */
   132775 	| '<' simp_exp
   132776 	;
   132777 
   132778 output_redir
   132779 	: /* empty */
   132780 	| '>' exp
   132781 	| APPEND_OP exp
   132782 	| '|' exp
   132783 	| TWOWAYIO exp
   132784 	;
   132785 
   132786 opt_param_list
   132787 	: /* empty */
   132788 	| param_list
   132789 	;
   132790 
   132791 param_list
   132792 	: NAME
   132793 	| param_list comma NAME
   132794 	| error
   132795 	| param_list error
   132796 	| param_list comma error
   132797 	;
   132798 
   132799 /* optional expression, as in for loop */
   132800 opt_exp
   132801 	: /* empty */
   132802 	| exp
   132803 	;
   132804 
   132805 opt_rexpression_list
   132806 	: /* empty */
   132807 	| rexpression_list
   132808 	;
   132809 
   132810 rexpression_list
   132811 	: rexp
   132812 	| rexpression_list comma rexp
   132813 	| error
   132814 	| rexpression_list error
   132815 	| rexpression_list error rexp
   132816 	| rexpression_list comma error
   132817 	;
   132818 
   132819 opt_expression_list
   132820 	: /* empty */
   132821 	| expression_list
   132822 	;
   132823 
   132824 expression_list
   132825 	: exp
   132826 	| expression_list comma exp
   132827 	| error
   132828 	| expression_list error
   132829 	| expression_list error exp
   132830 	| expression_list comma error
   132831 	;
   132832 
   132833 /* Expressions, not including the comma operator.  */
   132834 exp	: variable ASSIGNOP {} exp
   132835 	| '(' expression_list r_paren LEX_IN NAME
   132836 	| exp '|' LEX_GETLINE opt_variable
   132837 	| exp TWOWAYIO LEX_GETLINE opt_variable
   132838 	| LEX_GETLINE opt_variable input_redir
   132839 	| exp LEX_AND exp
   132840 	| exp LEX_OR exp
   132841 	| exp MATCHOP exp
   132842 	| regexp
   132843 	| '!' regexp %prec UNARY
   132844 	| exp LEX_IN NAME
   132845 	| exp RELOP exp
   132846 	| exp '<' exp
   132847 	| exp '>' exp
   132848 	| exp '?' exp ':' exp
   132849 	| simp_exp
   132850 	| exp simp_exp %prec CONCAT_OP
   132851 	;
   132852 
   132853 rexp
   132854 	: variable ASSIGNOP {} rexp
   132855 	| rexp LEX_AND rexp
   132856 	| rexp LEX_OR rexp
   132857 	| LEX_GETLINE opt_variable input_redir
   132858 	| regexp
   132859 	| '!' regexp %prec UNARY
   132860 	| rexp MATCHOP rexp
   132861 	| rexp LEX_IN NAME
   132862 	| rexp RELOP rexp
   132863 	| rexp '?' rexp ':' rexp
   132864 	| simp_exp
   132865 	| rexp simp_exp %prec CONCAT_OP
   132866 	;
   132867 
   132868 simp_exp
   132869 	: non_post_simp_exp
   132870 	/* Binary operators in order of decreasing precedence.  */
   132871 	| simp_exp '^' simp_exp
   132872 	| simp_exp '*' simp_exp
   132873 	| simp_exp '/' simp_exp
   132874 	| simp_exp '%' simp_exp
   132875 	| simp_exp '+' simp_exp
   132876 	| simp_exp '-' simp_exp
   132877 	| variable INCREMENT
   132878 	| variable DECREMENT
   132879 	;
   132880 
   132881 non_post_simp_exp
   132882 	: '!' simp_exp %prec UNARY
   132883 	| '(' exp r_paren
   132884 	| LEX_BUILTIN
   132885 	  '(' opt_expression_list r_paren
   132886 	| LEX_LENGTH '(' opt_expression_list r_paren
   132887 	| LEX_LENGTH
   132888 	| FUNC_CALL '(' opt_expression_list r_paren
   132889 	| variable
   132890 	| INCREMENT variable
   132891 	| DECREMENT variable
   132892 	| YNUMBER
   132893 	| YSTRING
   132894 	| '-' simp_exp    %prec UNARY
   132895 	| '+' simp_exp    %prec UNARY
   132896 	;
   132897 
   132898 opt_variable
   132899 	: /* empty */
   132900 	| variable
   132901 	;
   132902 
   132903 variable
   132904 	: NAME
   132905 	| NAME '[' expression_list ']'
   132906 	| '$' non_post_simp_exp
   132907 	;
   132908 
   132909 l_brace
   132910 	: '{' opt_nls
   132911 	;
   132912 
   132913 r_brace
   132914 	: '}' opt_nls
   132915 	;
   132916 
   132917 r_paren
   132918 	: ')'
   132919 	;
   132920 
   132921 opt_semi
   132922 	: /* empty */
   132923 	| semi
   132924 	;
   132925 
   132926 semi
   132927 	: ';'
   132928 	;
   132929 
   132930 comma	: ',' opt_nls
   132931 	;
   132932 
   132933 
   132934 %%
   132935 #include <stdio.h>
   132936 /* A C error reporting function.  */
   132937 static
   132938 void yyerror ( const char *msg)
   132939 {
   132940   fprintf (stderr, "%s\n", msg);
   132941 }
   132942 static int
   132943 yylex (void)
   132944 {
   132945   static int const input[] = {
   132946     LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0
   132947   };
   132948   static int const *inputp = input;
   132949   return *inputp++;
   132950 }
   132951 
   132952 int
   132953 main (void)
   132954 {
   132955   return yyparse ();
   132956 }
   132957 _ATEOF
   132958 
   132959 
   132960 
   132961 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   132962 # expanding macros, so it corrupts some special characters in the
   132963 # macros.  To avoid this, expand now and pass it the result with proper
   132964 # string quotation.  Assume args 7 through 12 expand to properly quoted
   132965 # strings.
   132966 
   132967 { set +x
   132968 $as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y"
   132969 at_fn_check_prepare_trace "existing.at:79"
   132970 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   132971 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132972 at_status=$? at_failed=false
   132973 $at_check_filter
   132974 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 265 shift/reduce
   132975 " | \
   132976   $at_diff - "$at_stderr" || at_failed=:
   132977 at_fn_diff_devnull "$at_stdout" || at_failed=:
   132978 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132979 $at_failed && at_fn_log_failure
   132980 $at_traceon; }
   132981 
   132982 
   132983 
   132984 { set +x
   132985 $as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1"
   132986 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79"
   132987 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   132988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   132989 at_status=$? at_failed=false
   132990 $at_check_filter
   132991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   132992 echo >>"$at_stdout"; $as_echo "2358
   132993 " | \
   132994   $at_diff - "$at_stdout" || at_failed=:
   132995 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   132996 $at_failed && at_fn_log_failure
   132997 $at_traceon; }
   132998 
   132999 
   133000 
   133001 
   133002 # Canonical LR generates very large tables, resulting in very long
   133003 # files with #line directives that may overflow what the standards
   133004 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   133005 # will issue an error.
   133006 #
   133007 # There is no "" around `wc` since some indent the result.
   133008 if test 32767 -lt `wc -l < input.c`; then
   133009   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   133010   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   133011 fi
   133012 { set +x
   133013 $as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
   133014 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
   133015 ( $at_check_trace; $BISON_C_WORKS
   133016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133017 at_status=$? at_failed=false
   133018 $at_check_filter
   133019 echo stderr:; cat "$at_stderr"
   133020 echo stdout:; cat "$at_stdout"
   133021 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   133022 $at_failed && at_fn_log_failure
   133023 $at_traceon; }
   133024 
   133025 { set +x
   133026 $as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   133027 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79"
   133028 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   133029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133030 at_status=$? at_failed=false
   133031 $at_check_filter
   133032 echo stderr:; cat "$at_stderr"
   133033 echo stdout:; cat "$at_stdout"
   133034 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   133035 $at_failed && at_fn_log_failure
   133036 $at_traceon; }
   133037 
   133038 
   133039 { set +x
   133040 $as_echo "$at_srcdir/existing.at:79:  \$PREPARSER ./input"
   133041 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
   133042 ( $at_check_trace;  $PREPARSER ./input
   133043 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133044 at_status=$? at_failed=false
   133045 $at_check_filter
   133046 echo stderr:; tee stderr <"$at_stderr"
   133047 at_fn_diff_devnull "$at_stdout" || at_failed=:
   133048 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   133049 $at_failed && at_fn_log_failure
   133050 $at_traceon; }
   133051 
   133052 { set +x
   133053 $as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   133054 at_fn_check_prepare_trace "existing.at:79"
   133055 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   133056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133057 at_status=$? at_failed=false
   133058 $at_check_filter
   133059 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133060 at_fn_diff_devnull "$at_stdout" || at_failed=:
   133061 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
   133062 $at_failed && at_fn_log_failure
   133063 $at_traceon; }
   133064 
   133065 
   133066 
   133067 
   133068   set +x
   133069   $at_times_p && times >"$at_times_file"
   133070 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   133071 read at_status <"$at_status_file"
   133072 #AT_STOP_261
   133073 #AT_START_262
   133074 at_fn_group_banner 262 'existing.at:783' \
   133075   "GNU Cim Grammar: LALR(1)" "                       " 16
   133076 at_xfail=no
   133077 (
   133078   $as_echo "262. $at_setup_line: testing $at_desc ..."
   133079   $at_traceon
   133080 
   133081 
   133082 cat >input.y <<'_ATEOF'
   133083 %code top {
   133084 #include <config.h>
   133085 /* We don't need perfect functions for these tests. */
   133086 #undef malloc
   133087 #undef memcmp
   133088 #undef realloc
   133089 }
   133090 
   133091 %code {
   133092   #include <stdio.h>
   133093   static void yyerror ( const char *msg);
   133094   static int yylex (void);
   133095 }
   133096 
   133097 %define lr.type lalr
   133098 
   133099 %token
   133100 	HACTIVATE HAFTER /*HAND*/ HARRAY HAT
   133101 	HBEFORE HBEGIN HBOOLEAN
   133102 	HCHARACTER HCLASS /*HCOMMENT*/ HCONC
   133103 	HDELAY HDO
   133104 	HELSE HEND HEQ /*HEQV*/ HEXTERNAL
   133105 	HFOR
   133106 	HGE HGO HGOTO HGT
   133107 	HHIDDEN
   133108 	HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
   133109 	HLABEL HLE HLONG HLT
   133110 	HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
   133111 	/*HOR*/ HOTHERWISE
   133112 	HPRIOR HPROCEDURE HPROTECTED
   133113 	HQUA
   133114 	HREACTIVATE HREAL HREF
   133115 	HSHORT HSTEP HSWITCH
   133116 	HTEXT HTHEN HTHIS HTO
   133117 	HUNTIL
   133118 	HVALUE HVAR HVIRTUAL
   133119 	HWHEN HWHILE
   133120 
   133121 	HASSIGNVALUE HASSIGNREF
   133122 	/*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
   133123 	HBEGPAR HENDPAR
   133124 	HEQR HNER
   133125 	HADD HSUB HMUL HDIV HINTDIV HEXP
   133126 	HDOTDOTDOT
   133127 
   133128 %token HIDENTIFIER
   133129 %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
   133130 %token HREALKONST
   133131 %token HTEXTKONST
   133132 
   133133 
   133134 %right HASSIGN
   133135 %left   HORELSE
   133136 %left   HANDTHEN
   133137 %left   HEQV
   133138 %left   HIMP
   133139 %left   HOR
   133140 %left   HAND
   133141 
   133142 %left   HNOT
   133143 
   133144 %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR
   133145 
   133146 %left	HCONC
   133147 
   133148 %left HTERMOPERATOR
   133149 %left UNEAR
   133150 %left HFACTOROPERATOR
   133151 %left         HPRIMARYOPERATOR
   133152 
   133153 %left   HQUA
   133154 
   133155 %left   HDOT
   133156 
   133157 %start  MAIN_MODULE
   133158 
   133159 
   133160 %%
   133161 
   133162 
   133163 /* GRAMATIKK FOR PROGRAM MODULES */
   133164 MAIN_MODULE     :       {}
   133165 			MODULS
   133166 		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
   133167 		;
   133168 EXT_DECLARATION	:	HEXTERNAL
   133169 			MBEE_TYPE
   133170 			HPROCEDURE
   133171 				{}
   133172 			EXT_LIST
   133173 		|
   133174 			HEXTERNAL
   133175 			HIDENTIFIER
   133176 			HPROCEDURE
   133177 				{}
   133178 			HIDENTIFIER {}
   133179 			EXTERNAL_KIND_ITEM
   133180 		|	HEXTERNAL
   133181 			HCLASS
   133182 				{}
   133183 			EXT_LIST
   133184 
   133185 		;
   133186 EXTERNAL_KIND_ITEM:	EXT_IDENT
   133187 			HOBJRELOPERATOR
   133188 				{}
   133189 			MBEE_TYPE HPROCEDURE
   133190 			HIDENTIFIER
   133191 				{}
   133192 			HEADING EMPTY_BLOCK
   133193 				{}
   133194 /*		|
   133195 			EXT_IDENT
   133196 				{}
   133197 			MBEE_REST_EXT_LIST
   133198 		;
   133199 MBEE_REST_EXT_LIST:	/* EMPTY
   133200 		|	HPAREXPSEPARATOR EXT_KIND_LIST
   133201 		;
   133202 EXT_KIND_LIST	:	EXT_KIND_ITEM
   133203 		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
   133204 		;
   133205 EXT_KIND_ITEM	:	HIDENTIFIER
   133206 			EXT_IDENT
   133207 				{}*/
   133208 		;
   133209 EMPTY_BLOCK	:	/*EMPT*/
   133210 		|	HBEGIN HEND
   133211 		;
   133212 EXT_LIST	:	EXT_ITEM
   133213 		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
   133214 		;
   133215 EXT_ITEM	:	HIDENTIFIER
   133216 			EXT_IDENT
   133217 		;
   133218 EXT_IDENT	:	/* EMPTY */
   133219 		|	HVALRELOPERATOR {}
   133220 			HTEXTKONST
   133221 		;
   133222 /* GRAMATIKK FOR TYPER */
   133223 NO_TYPE         :       /*EMPT*/
   133224 		;
   133225 MBEE_TYPE       :       NO_TYPE
   133226 		|       TYPE
   133227 		;
   133228 TYPE            :       HREF HBEGPAR
   133229 			HIDENTIFIER
   133230 				{}
   133231 			HENDPAR
   133232 		|       HTEXT
   133233 		|       HBOOLEAN
   133234 		|       HCHARACTER
   133235 		|       HSHORT HINTEGER
   133236 		|       HINTEGER
   133237 		|       HREAL
   133238 		|       HLONG HREAL
   133239 		;
   133240 
   133241 /* GRAMATIKK FOR DEL AV SETNINGER */
   133242 MBEE_ELSE_PART  :       /*EMPT*/
   133243 /*		|	HELSE
   133244 			HIF
   133245 			EXPRESSION
   133246 			HTHEN   {}
   133247 			BLOCK   {}
   133248 			MBEE_ELSE_PART          {}*/
   133249 		|       HELSE   {}
   133250 			BLOCK
   133251 		;
   133252 FOR_LIST        :       FOR_LIST_ELEMENT
   133253 		|       FOR_LIST_ELEMENT
   133254 			HPAREXPSEPARATOR
   133255 			FOR_LIST
   133256 		;
   133257 FOR_LIST_ELEMENT:       EXPRESSION
   133258 			MBEE_F_L_EL_R_PT
   133259 		;
   133260 MBEE_F_L_EL_R_PT:       /*EMPT*/
   133261 		|       HWHILE
   133262 			EXPRESSION
   133263 		|       HSTEP
   133264 			EXPRESSION
   133265 			HUNTIL
   133266 			EXPRESSION
   133267 		;
   133268 GOTO            :       HGO
   133269 			HTO
   133270 		|       HGOTO
   133271 		;
   133272 CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
   133273 		|       HDO   {}
   133274 			BLOCK
   133275 		;
   133276 WHEN_CLAUSE_LIST:       HWHEN
   133277 			HIDENTIFIER
   133278 			HDO    {}
   133279 			BLOCK
   133280 		|       WHEN_CLAUSE_LIST
   133281 			HWHEN
   133282 			HIDENTIFIER
   133283 			HDO    {}
   133284 			BLOCK
   133285 		;
   133286 MBEE_OTWI_CLAUS :       /*EMPT*/
   133287 		|       HOTHERWISE {}
   133288 
   133289 			BLOCK
   133290 		;
   133291 ACTIVATOR	:	HACTIVATE
   133292 		|	HREACTIVATE
   133293 		;
   133294 SCHEDULE	:	/*EMPT*/
   133295 		|	ATDELAY EXPRESSION	{}
   133296 			PRIOR
   133297 		|	BEFOREAFTER		{}
   133298 			EXPRESSION
   133299 		;
   133300 ATDELAY		:	HAT
   133301 		|	HDELAY
   133302 		;
   133303 BEFOREAFTER	:	HBEFORE
   133304 		|	HAFTER
   133305 		;
   133306 PRIOR		:	/*EMPT*/
   133307 		|	HPRIOR
   133308 		;
   133309 /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
   133310 MODULSTATEMENT  :       HWHILE
   133311 			EXPRESSION
   133312 			HDO     {}
   133313 			BLOCK
   133314 		|       HIF
   133315 			EXPRESSION
   133316 			HTHEN   {}
   133317 			BLOCK   {}
   133318 			MBEE_ELSE_PART
   133319 		|       HFOR
   133320 			HIDENTIFIER
   133321 			HASSIGN {}
   133322 			FOR_LIST
   133323 			HDO     {}
   133324 			BLOCK
   133325 		|       GOTO
   133326 			EXPRESSION
   133327 		|       HINSPECT
   133328 			EXPRESSION              {}
   133329 			CONN_STATE_R_PT
   133330 				{}
   133331 			MBEE_OTWI_CLAUS
   133332 		|       HINNER
   133333 		|       HIDENTIFIER
   133334 			HLABELSEPARATOR
   133335 				{}
   133336 			DECLSTATEMENT
   133337 		|       EXPRESSION_SIMP
   133338 			HBEGIN
   133339 				{}
   133340 			IMPORT_SPEC_MODULE
   133341 				{}
   133342 			MBEE_DECLSTMS
   133343 			HEND
   133344 		|	EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
   133345 			MBEE_DECLSTMS HEND
   133346 		|	EXPRESSION_SIMP HBEGIN error HEND
   133347 		|       EXPRESSION_SIMP
   133348 		|	ACTIVATOR EXPRESSION SCHEDULE
   133349 		|       HBEGIN
   133350 				{}
   133351 			MBEE_DECLSTMS
   133352 			HEND
   133353 		|       MBEE_TYPE HPROCEDURE
   133354 			HIDENTIFIER
   133355 				{}
   133356 			HEADING BLOCK
   133357 		|       HIDENTIFIER
   133358 			HCLASS
   133359 			NO_TYPE
   133360 				{}
   133361 			IMPORT_SPEC_MODULE
   133362 			HIDENTIFIER
   133363 				{}
   133364 			HEADING
   133365 			BLOCK
   133366 		|       HCLASS
   133367 			NO_TYPE
   133368 			HIDENTIFIER
   133369 				{}
   133370 			HEADING
   133371 			BLOCK
   133372 		|       EXT_DECLARATION
   133373 		|       /*EMPT*/
   133374 		;
   133375 IMPORT_SPEC_MODULE:
   133376 		;
   133377 DECLSTATEMENT	:	MODULSTATEMENT
   133378 		|       TYPE
   133379 			HIDENTIFIER
   133380 			MBEE_CONSTANT
   133381 			HPAREXPSEPARATOR
   133382 				{}
   133383 			IDENTIFIER_LISTC
   133384 		|       TYPE
   133385 			HIDENTIFIER
   133386 			MBEE_CONSTANT
   133387 		|       MBEE_TYPE
   133388 			HARRAY  {}
   133389 			ARR_SEGMENT_LIST
   133390 		|       HSWITCH
   133391 			HIDENTIFIER
   133392 			HASSIGN {}
   133393 			SWITCH_LIST
   133394 		;
   133395 BLOCK           :       DECLSTATEMENT
   133396 		|       HBEGIN MBEE_DECLSTMS HEND
   133397 		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
   133398 		|	HBEGIN error HEND
   133399 		;
   133400 MBEE_DECLSTMS   :       MBEE_DECLSTMSU
   133401 		;
   133402 MBEE_DECLSTMSU  :       DECLSTATEMENT
   133403 		|       MBEE_DECLSTMSU
   133404 			HSTATEMENTSEPARATOR
   133405 			DECLSTATEMENT
   133406 		;
   133407 MODULS		:	MODULSTATEMENT
   133408 		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
   133409 		;
   133410 /* GRAMATIKK FOR DEL AV DEKLARASJONER */
   133411 ARR_SEGMENT_LIST:       ARR_SEGMENT
   133412 		|       ARR_SEGMENT_LIST
   133413 			HPAREXPSEPARATOR
   133414 			ARR_SEGMENT
   133415 		;
   133416 ARR_SEGMENT	:       ARRAY_SEGMENT
   133417 			HBEGPAR
   133418 			BAUND_PAIR_LIST HENDPAR
   133419 		;
   133420 ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
   133421 
   133422 		|       ARRAY_SEGMENT_EL
   133423 			HPAREXPSEPARATOR
   133424 			ARRAY_SEGMENT
   133425 		;
   133426 ARRAY_SEGMENT_EL:       HIDENTIFIER
   133427 		;
   133428 BAUND_PAIR_LIST :       BAUND_PAIR
   133429 		|       BAUND_PAIR
   133430 			HPAREXPSEPARATOR
   133431 			BAUND_PAIR_LIST
   133432 		;
   133433 BAUND_PAIR      :       EXPRESSION
   133434 			HLABELSEPARATOR
   133435 			EXPRESSION
   133436 		;
   133437 SWITCH_LIST     :       EXPRESSION
   133438 		|       EXPRESSION
   133439 			HPAREXPSEPARATOR
   133440 			SWITCH_LIST
   133441 		;
   133442 HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
   133443 			MBEE_MODE_PART  {}
   133444 			MBEE_SPEC_PART  {}
   133445 			MBEE_PROT_PART  {}
   133446 			MBEE_VIRT_PART
   133447 		;
   133448 MBEE_FMAL_PAR_P :       /*EMPT*/
   133449 		|       FMAL_PAR_PART
   133450 		;
   133451 FMAL_PAR_PART   :       HBEGPAR NO_TYPE
   133452 			MBEE_LISTV HENDPAR
   133453 		;
   133454 MBEE_LISTV      :       /*EMPT*/
   133455 		|       LISTV
   133456 		;
   133457 LISTV           :       HIDENTIFIER
   133458 		|	FPP_CATEG HDOTDOTDOT
   133459 		|       HIDENTIFIER     {}
   133460 			HPAREXPSEPARATOR LISTV
   133461 		|       FPP_SPEC
   133462 		|       FPP_SPEC
   133463 			HPAREXPSEPARATOR LISTV
   133464 		;
   133465 FPP_HEADING     :       HBEGPAR NO_TYPE
   133466 			FPP_MBEE_LISTV HENDPAR
   133467 		;
   133468 FPP_MBEE_LISTV  :       /*EMPT*/
   133469 		|       FPP_LISTV
   133470 		;
   133471 FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
   133472 		|       FPP_SPEC
   133473 		|       FPP_SPEC
   133474 			HPAREXPSEPARATOR LISTV
   133475 		;
   133476 FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
   133477 		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
   133478 		;
   133479 FPP_CATEG       :       HNAME HLABELSEPARATOR
   133480 		|       HVALUE HLABELSEPARATOR
   133481 		|       HVAR HLABELSEPARATOR
   133482 		|       /*EMPT*/
   133483 		;
   133484 FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
   133485 			HIDENTIFIER
   133486 					{}
   133487 			FPP_HEADING {} { /* Yes, two "final" actions. */ }
   133488 		;
   133489 IDENTIFIER_LISTV:       HIDENTIFIER
   133490 		|	HDOTDOTDOT
   133491 		|       HIDENTIFIER     {}
   133492 			HPAREXPSEPARATOR IDENTIFIER_LISTV
   133493 		;
   133494 MBEE_MODE_PART  :       /*EMPT*/
   133495 		|       MODE_PART
   133496 		;
   133497 MODE_PART       :       NAME_PART
   133498 		|       VALUE_PART
   133499 		|       VAR_PART
   133500 		|       NAME_PART VALUE_PART
   133501 		|       VALUE_PART NAME_PART
   133502 		|       NAME_PART VAR_PART
   133503 		|       VAR_PART NAME_PART
   133504 		|       VALUE_PART VAR_PART
   133505 		|       VAR_PART VALUE_PART
   133506 		|       VAR_PART NAME_PART VALUE_PART
   133507 		|       NAME_PART VAR_PART VALUE_PART
   133508 		|       NAME_PART VALUE_PART VAR_PART
   133509 		|       VAR_PART VALUE_PART NAME_PART
   133510 		|       VALUE_PART VAR_PART NAME_PART
   133511 		|       VALUE_PART NAME_PART VAR_PART
   133512 		;
   133513 NAME_PART       :       HNAME           {}
   133514 			IDENTIFIER_LISTV
   133515 			HSTATEMENTSEPARATOR
   133516 		;
   133517 VAR_PART        :       HVAR            {}
   133518 			IDENTIFIER_LISTV
   133519 			HSTATEMENTSEPARATOR
   133520 		;
   133521 VALUE_PART      :       HVALUE          {}
   133522 			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
   133523 		;
   133524 MBEE_SPEC_PART  :       /*EMPT*/
   133525 		|       SPEC_PART
   133526 		;
   133527 SPEC_PART       :       ONE_SPEC
   133528 		|       SPEC_PART ONE_SPEC
   133529 		;
   133530 ONE_SPEC	:	SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
   133531 		|	NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
   133532 			  {}
   133533 			PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
   133534 		|       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
   133535 		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
   133536 		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
   133537 			IDENTIFIER_LIST HSTATEMENTSEPARATOR
   133538 		;
   133539 SPECIFIER       :       TYPE
   133540 		|       MBEE_TYPE
   133541 			HARRAY
   133542 		|       HLABEL
   133543 		|       HSWITCH
   133544 		;
   133545 PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
   133546 			HIDENTIFIER
   133547 					{}
   133548 			HEADING
   133549 					{}
   133550 			MBEE_BEGIN_END
   133551 		;
   133552 MBEE_BEGIN_END	:	/* EMPTY */
   133553 		|	HBEGIN HEND
   133554 		;
   133555 MBEE_PROT_PART  :       /*EMPT*/
   133556 		|       PROTECTION_PART
   133557 		;
   133558 PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
   133559 			HSTATEMENTSEPARATOR
   133560 		|       PROTECTION_PART  PROT_SPECIFIER
   133561 			IDENTIFIER_LIST HSTATEMENTSEPARATOR
   133562 		;
   133563 PROT_SPECIFIER  :       HHIDDEN
   133564 		|       HPROTECTED
   133565 		|       HHIDDEN
   133566 			HPROTECTED
   133567 		|       HPROTECTED
   133568 			HHIDDEN
   133569 		;
   133570 MBEE_VIRT_PART  :       /*EMPT*/
   133571 		|       VIRTUAL_PART
   133572 		;
   133573 VIRTUAL_PART    :       HVIRTUAL
   133574 			HLABELSEPARATOR
   133575 			MBEE_SPEC_PART
   133576 		;
   133577 IDENTIFIER_LIST :       HIDENTIFIER
   133578 		|       IDENTIFIER_LIST HPAREXPSEPARATOR
   133579 			HIDENTIFIER
   133580 		;
   133581 IDENTIFIER_LISTC:       HIDENTIFIER
   133582 			MBEE_CONSTANT
   133583 		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
   133584 			HIDENTIFIER
   133585 			MBEE_CONSTANT
   133586 		;
   133587 MBEE_CONSTANT	:	/* EMPTY */
   133588 		|	HVALRELOPERATOR
   133589 				{}
   133590 			EXPRESSION
   133591 		;
   133592 
   133593 /* GRAMATIKK FOR UTTRYKK */
   133594 EXPRESSION      :       EXPRESSION_SIMP
   133595 		|       HIF
   133596 			EXPRESSION
   133597 			HTHEN
   133598 			EXPRESSION
   133599 			HELSE
   133600 			EXPRESSION
   133601 		;
   133602 EXPRESSION_SIMP :	EXPRESSION_SIMP
   133603 			HASSIGN
   133604 			EXPRESSION
   133605 		|
   133606 
   133607 			EXPRESSION_SIMP
   133608 			HCONC
   133609 			EXPRESSION_SIMP
   133610 		|       EXPRESSION_SIMP HOR
   133611 			HELSE
   133612 			EXPRESSION_SIMP
   133613 			%prec HORELSE
   133614 		|       EXPRESSION_SIMP HAND
   133615 			HTHEN
   133616 			EXPRESSION_SIMP
   133617 			%prec HANDTHEN
   133618 		|       EXPRESSION_SIMP
   133619 			HEQV EXPRESSION_SIMP
   133620 		|       EXPRESSION_SIMP
   133621 			HIMP EXPRESSION_SIMP
   133622 		|       EXPRESSION_SIMP
   133623 			HOR EXPRESSION_SIMP
   133624 		|       EXPRESSION_SIMP
   133625 			HAND EXPRESSION_SIMP
   133626 		|       HNOT EXPRESSION_SIMP
   133627 		|       EXPRESSION_SIMP
   133628 			HVALRELOPERATOR
   133629 			EXPRESSION_SIMP
   133630 		|       EXPRESSION_SIMP
   133631 			HREFRELOPERATOR
   133632 			EXPRESSION_SIMP
   133633 		|       EXPRESSION_SIMP
   133634 			HOBJRELOPERATOR
   133635 			EXPRESSION_SIMP
   133636 		|       HTERMOPERATOR
   133637 			EXPRESSION_SIMP %prec UNEAR
   133638 		|       EXPRESSION_SIMP
   133639 			HTERMOPERATOR
   133640 			EXPRESSION_SIMP
   133641 		|       EXPRESSION_SIMP
   133642 			HFACTOROPERATOR
   133643 			EXPRESSION_SIMP
   133644 		|       EXPRESSION_SIMP
   133645 			HPRIMARYOPERATOR
   133646 			EXPRESSION_SIMP
   133647 		|       HBEGPAR
   133648 			EXPRESSION HENDPAR
   133649 		|       HTEXTKONST
   133650 		|       HCHARACTERKONST
   133651 		|       HREALKONST
   133652 		|       HINTEGERKONST
   133653 		|       HBOOLEANKONST
   133654 		|       HNONE
   133655 		|       HIDENTIFIER
   133656 				{}
   133657 			MBEE_ARG_R_PT
   133658 		|       HTHIS HIDENTIFIER
   133659 		|       HNEW
   133660 			HIDENTIFIER
   133661 			ARG_R_PT
   133662 		|       EXPRESSION_SIMP
   133663 			HDOT
   133664 			EXPRESSION_SIMP
   133665 		|       EXPRESSION_SIMP
   133666 			HQUA HIDENTIFIER
   133667 		;
   133668 ARG_R_PT        :       /*EMPTY*/
   133669 		|       HBEGPAR
   133670 			ARGUMENT_LIST HENDPAR
   133671 		;
   133672 MBEE_ARG_R_PT   :       /*EMPTY*/
   133673 		|       HBEGPAR
   133674 			ARGUMENT_LIST HENDPAR
   133675 		;
   133676 ARGUMENT_LIST   :       EXPRESSION
   133677 		|       EXPRESSION
   133678 			HPAREXPSEPARATOR
   133679 			ARGUMENT_LIST
   133680 		;
   133681 
   133682 
   133683 %%
   133684 #include <stdio.h>
   133685 /* A C error reporting function.  */
   133686 static
   133687 void yyerror ( const char *msg)
   133688 {
   133689   fprintf (stderr, "%s\n", msg);
   133690 }
   133691 static int
   133692 yylex (void)
   133693 {
   133694   static int const input[] = {
   133695     0
   133696   };
   133697   static int const *inputp = input;
   133698   return *inputp++;
   133699 }
   133700 
   133701 int
   133702 main (void)
   133703 {
   133704   return yyparse ();
   133705 }
   133706 _ATEOF
   133707 
   133708 
   133709 
   133710 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   133711 # expanding macros, so it corrupts some special characters in the
   133712 # macros.  To avoid this, expand now and pass it the result with proper
   133713 # string quotation.  Assume args 7 through 12 expand to properly quoted
   133714 # strings.
   133715 
   133716 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   133717   at_save_special_files
   133718   mkdir xml-tests
   133719     # Don't combine these Bison invocations since we want to be sure that
   133720   # --report=all isn't required to get the full XML file.
   133721   { set +x
   133722 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   133723                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   133724 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783"
   133725 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   133726                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   133727 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133728 at_status=$? at_failed=false
   133729 $at_check_filter
   133730 echo stderr:; cat "$at_stderr"
   133731 echo stdout:; cat "$at_stdout"
   133732 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133733 $at_failed && at_fn_log_failure
   133734 $at_traceon; }
   133735 
   133736   { set +x
   133737 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   133738 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:783"
   133739 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   133740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133741 at_status=$? at_failed=false
   133742 $at_check_filter
   133743 echo stderr:; cat "$at_stderr"
   133744 echo stdout:; cat "$at_stdout"
   133745 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133746 $at_failed && at_fn_log_failure
   133747 $at_traceon; }
   133748 
   133749     cp xml-tests/test.output expout
   133750   { set +x
   133751 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   133752              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   133753              xml-tests/test.xml"
   133754 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   133755 ( $at_check_trace; $XSLTPROC \
   133756              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   133757              xml-tests/test.xml
   133758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133759 at_status=$? at_failed=false
   133760 $at_check_filter
   133761 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133762 $at_diff expout "$at_stdout" || at_failed=:
   133763 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133764 $at_failed && at_fn_log_failure
   133765 $at_traceon; }
   133766 
   133767   sort xml-tests/test.dot > expout
   133768   { set +x
   133769 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   133770              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   133771              xml-tests/test.xml | sort"
   133772 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   133773 ( $at_check_trace; $XSLTPROC \
   133774              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   133775              xml-tests/test.xml | sort
   133776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133777 at_status=$? at_failed=false
   133778 $at_check_filter
   133779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133780 $at_diff expout "$at_stdout" || at_failed=:
   133781 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133782 $at_failed && at_fn_log_failure
   133783 $at_traceon; }
   133784 
   133785   rm -rf xml-tests expout
   133786   at_restore_special_files
   133787 fi
   133788 { set +x
   133789 $as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y"
   133790 at_fn_check_prepare_trace "existing.at:783"
   133791 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   133792 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133793 at_status=$? at_failed=false
   133794 $at_check_filter
   133795 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce
   133796 " | \
   133797   $at_diff - "$at_stderr" || at_failed=:
   133798 at_fn_diff_devnull "$at_stdout" || at_failed=:
   133799 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133800 $at_failed && at_fn_log_failure
   133801 $at_traceon; }
   133802 
   133803 
   133804 
   133805 { set +x
   133806 $as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1"
   133807 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783"
   133808 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   133809 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133810 at_status=$? at_failed=false
   133811 $at_check_filter
   133812 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133813 echo >>"$at_stdout"; $as_echo "442
   133814 " | \
   133815   $at_diff - "$at_stdout" || at_failed=:
   133816 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133817 $at_failed && at_fn_log_failure
   133818 $at_traceon; }
   133819 
   133820 
   133821 { set +x
   133822 $as_echo "$at_srcdir/existing.at:783: diff -u /dev/null /dev/null || exit 77"
   133823 at_fn_check_prepare_trace "existing.at:783"
   133824 ( $at_check_trace; diff -u /dev/null /dev/null || exit 77
   133825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133826 at_status=$? at_failed=false
   133827 $at_check_filter
   133828 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133829 echo stdout:; cat "$at_stdout"
   133830 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133831 $at_failed && at_fn_log_failure
   133832 $at_traceon; }
   133833 
   133834 
   133835 { set +x
   133836 $as_echo "$at_srcdir/existing.at:783: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
   133837 at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:783"
   133838 ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
   133839 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133840 at_status=$? at_failed=false
   133841 $at_check_filter
   133842 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133843 at_fn_diff_devnull "$at_stdout" || at_failed=:
   133844 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133845 $at_failed && at_fn_log_failure
   133846 $at_traceon; }
   133847 
   133848 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   133849   at_save_special_files
   133850   mkdir xml-tests
   133851     # Don't combine these Bison invocations since we want to be sure that
   133852   # --report=all isn't required to get the full XML file.
   133853   { set +x
   133854 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   133855                   --graph=xml-tests/test.dot --report=all input-lalr.y"
   133856 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783"
   133857 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   133858                   --graph=xml-tests/test.dot --report=all input-lalr.y
   133859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133860 at_status=$? at_failed=false
   133861 $at_check_filter
   133862 echo stderr:; cat "$at_stderr"
   133863 echo stdout:; cat "$at_stdout"
   133864 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133865 $at_failed && at_fn_log_failure
   133866 $at_traceon; }
   133867 
   133868   { set +x
   133869 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y"
   133870 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:783"
   133871 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y
   133872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133873 at_status=$? at_failed=false
   133874 $at_check_filter
   133875 echo stderr:; cat "$at_stderr"
   133876 echo stdout:; cat "$at_stdout"
   133877 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133878 $at_failed && at_fn_log_failure
   133879 $at_traceon; }
   133880 
   133881     cp xml-tests/test.output expout
   133882   { set +x
   133883 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   133884              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   133885              xml-tests/test.xml"
   133886 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   133887 ( $at_check_trace; $XSLTPROC \
   133888              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   133889              xml-tests/test.xml
   133890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133891 at_status=$? at_failed=false
   133892 $at_check_filter
   133893 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133894 $at_diff expout "$at_stdout" || at_failed=:
   133895 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133896 $at_failed && at_fn_log_failure
   133897 $at_traceon; }
   133898 
   133899   sort xml-tests/test.dot > expout
   133900   { set +x
   133901 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   133902              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   133903              xml-tests/test.xml | sort"
   133904 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   133905 ( $at_check_trace; $XSLTPROC \
   133906              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   133907              xml-tests/test.xml | sort
   133908 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133909 at_status=$? at_failed=false
   133910 $at_check_filter
   133911 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133912 $at_diff expout "$at_stdout" || at_failed=:
   133913 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133914 $at_failed && at_fn_log_failure
   133915 $at_traceon; }
   133916 
   133917   rm -rf xml-tests expout
   133918   at_restore_special_files
   133919 fi
   133920 { set +x
   133921 $as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y"
   133922 at_fn_check_prepare_trace "existing.at:783"
   133923 ( $at_check_trace; bison --report=all input-lalr.y
   133924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133925 at_status=$? at_failed=false
   133926 $at_check_filter
   133927 echo stderr:; cat "$at_stderr"
   133928 echo stdout:; cat "$at_stdout"
   133929 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133930 $at_failed && at_fn_log_failure
   133931 $at_traceon; }
   133932 
   133933 
   133934 { set +x
   133935 $as_echo "$at_srcdir/existing.at:783: diff -u input-lalr.output input.output \\
   133936            | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
   133937 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783"
   133938 ( $at_check_trace; diff -u input-lalr.output input.output \
   133939            | sed -n '/^@@/,$p' | sed 's/^ $//'
   133940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133941 at_status=$? at_failed=false
   133942 $at_check_filter
   133943 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133944 at_fn_diff_devnull "$at_stdout" || at_failed=:
   133945 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133946 $at_failed && at_fn_log_failure
   133947 $at_traceon; }
   133948 { set +x
   133949 $as_echo "$at_srcdir/existing.at:783: grep '^State.*conflicts:' input.output"
   133950 at_fn_check_prepare_trace "existing.at:783"
   133951 ( $at_check_trace; grep '^State.*conflicts:' input.output
   133952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133953 at_status=$? at_failed=false
   133954 $at_check_filter
   133955 at_fn_diff_devnull "$at_stderr" || at_failed=:
   133956 echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce
   133957 State 164 conflicts: 1 shift/reduce
   133958 State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
   133959 State 206 conflicts: 1 shift/reduce
   133960 State 240 conflicts: 1 shift/reduce
   133961 State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
   133962 State 356 conflicts: 1 shift/reduce
   133963 State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
   133964 State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
   133965 " | \
   133966   $at_diff - "$at_stdout" || at_failed=:
   133967 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133968 $at_failed && at_fn_log_failure
   133969 $at_traceon; }
   133970 
   133971 
   133972 # Canonical LR generates very large tables, resulting in very long
   133973 # files with #line directives that may overflow what the standards
   133974 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   133975 # will issue an error.
   133976 #
   133977 # There is no "" around `wc` since some indent the result.
   133978 
   133979 { set +x
   133980 $as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS"
   133981 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783"
   133982 ( $at_check_trace; $BISON_C_WORKS
   133983 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133984 at_status=$? at_failed=false
   133985 $at_check_filter
   133986 echo stderr:; cat "$at_stderr"
   133987 echo stdout:; cat "$at_stdout"
   133988 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   133989 $at_failed && at_fn_log_failure
   133990 $at_traceon; }
   133991 
   133992 { set +x
   133993 $as_echo "$at_srcdir/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   133994 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783"
   133995 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   133996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   133997 at_status=$? at_failed=false
   133998 $at_check_filter
   133999 echo stderr:; cat "$at_stderr"
   134000 echo stdout:; cat "$at_stdout"
   134001 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134002 $at_failed && at_fn_log_failure
   134003 $at_traceon; }
   134004 
   134005 
   134006 { set +x
   134007 $as_echo "$at_srcdir/existing.at:783:  \$PREPARSER ./input"
   134008 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783"
   134009 ( $at_check_trace;  $PREPARSER ./input
   134010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134011 at_status=$? at_failed=false
   134012 $at_check_filter
   134013 echo stderr:; tee stderr <"$at_stderr"
   134014 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134015 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134016 $at_failed && at_fn_log_failure
   134017 $at_traceon; }
   134018 
   134019 { set +x
   134020 $as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   134021 at_fn_check_prepare_trace "existing.at:783"
   134022 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   134023 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134024 at_status=$? at_failed=false
   134025 $at_check_filter
   134026 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134027 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134028 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134029 $at_failed && at_fn_log_failure
   134030 $at_traceon; }
   134031 
   134032 
   134033 
   134034 
   134035   set +x
   134036   $at_times_p && times >"$at_times_file"
   134037 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   134038 read at_status <"$at_status_file"
   134039 #AT_STOP_262
   134040 #AT_START_263
   134041 at_fn_group_banner 263 'existing.at:783' \
   134042   "GNU Cim Grammar: IELR(1)" "                       " 16
   134043 at_xfail=no
   134044 (
   134045   $as_echo "263. $at_setup_line: testing $at_desc ..."
   134046   $at_traceon
   134047 
   134048 
   134049 cat >input.y <<'_ATEOF'
   134050 %code top {
   134051 #include <config.h>
   134052 /* We don't need perfect functions for these tests. */
   134053 #undef malloc
   134054 #undef memcmp
   134055 #undef realloc
   134056 }
   134057 
   134058 %code {
   134059   #include <stdio.h>
   134060   static void yyerror ( const char *msg);
   134061   static int yylex (void);
   134062 }
   134063 
   134064 %define lr.type ielr
   134065 
   134066 %token
   134067 	HACTIVATE HAFTER /*HAND*/ HARRAY HAT
   134068 	HBEFORE HBEGIN HBOOLEAN
   134069 	HCHARACTER HCLASS /*HCOMMENT*/ HCONC
   134070 	HDELAY HDO
   134071 	HELSE HEND HEQ /*HEQV*/ HEXTERNAL
   134072 	HFOR
   134073 	HGE HGO HGOTO HGT
   134074 	HHIDDEN
   134075 	HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
   134076 	HLABEL HLE HLONG HLT
   134077 	HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
   134078 	/*HOR*/ HOTHERWISE
   134079 	HPRIOR HPROCEDURE HPROTECTED
   134080 	HQUA
   134081 	HREACTIVATE HREAL HREF
   134082 	HSHORT HSTEP HSWITCH
   134083 	HTEXT HTHEN HTHIS HTO
   134084 	HUNTIL
   134085 	HVALUE HVAR HVIRTUAL
   134086 	HWHEN HWHILE
   134087 
   134088 	HASSIGNVALUE HASSIGNREF
   134089 	/*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
   134090 	HBEGPAR HENDPAR
   134091 	HEQR HNER
   134092 	HADD HSUB HMUL HDIV HINTDIV HEXP
   134093 	HDOTDOTDOT
   134094 
   134095 %token HIDENTIFIER
   134096 %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
   134097 %token HREALKONST
   134098 %token HTEXTKONST
   134099 
   134100 
   134101 %right HASSIGN
   134102 %left   HORELSE
   134103 %left   HANDTHEN
   134104 %left   HEQV
   134105 %left   HIMP
   134106 %left   HOR
   134107 %left   HAND
   134108 
   134109 %left   HNOT
   134110 
   134111 %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR
   134112 
   134113 %left	HCONC
   134114 
   134115 %left HTERMOPERATOR
   134116 %left UNEAR
   134117 %left HFACTOROPERATOR
   134118 %left         HPRIMARYOPERATOR
   134119 
   134120 %left   HQUA
   134121 
   134122 %left   HDOT
   134123 
   134124 %start  MAIN_MODULE
   134125 
   134126 
   134127 %%
   134128 
   134129 
   134130 /* GRAMATIKK FOR PROGRAM MODULES */
   134131 MAIN_MODULE     :       {}
   134132 			MODULS
   134133 		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
   134134 		;
   134135 EXT_DECLARATION	:	HEXTERNAL
   134136 			MBEE_TYPE
   134137 			HPROCEDURE
   134138 				{}
   134139 			EXT_LIST
   134140 		|
   134141 			HEXTERNAL
   134142 			HIDENTIFIER
   134143 			HPROCEDURE
   134144 				{}
   134145 			HIDENTIFIER {}
   134146 			EXTERNAL_KIND_ITEM
   134147 		|	HEXTERNAL
   134148 			HCLASS
   134149 				{}
   134150 			EXT_LIST
   134151 
   134152 		;
   134153 EXTERNAL_KIND_ITEM:	EXT_IDENT
   134154 			HOBJRELOPERATOR
   134155 				{}
   134156 			MBEE_TYPE HPROCEDURE
   134157 			HIDENTIFIER
   134158 				{}
   134159 			HEADING EMPTY_BLOCK
   134160 				{}
   134161 /*		|
   134162 			EXT_IDENT
   134163 				{}
   134164 			MBEE_REST_EXT_LIST
   134165 		;
   134166 MBEE_REST_EXT_LIST:	/* EMPTY
   134167 		|	HPAREXPSEPARATOR EXT_KIND_LIST
   134168 		;
   134169 EXT_KIND_LIST	:	EXT_KIND_ITEM
   134170 		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
   134171 		;
   134172 EXT_KIND_ITEM	:	HIDENTIFIER
   134173 			EXT_IDENT
   134174 				{}*/
   134175 		;
   134176 EMPTY_BLOCK	:	/*EMPT*/
   134177 		|	HBEGIN HEND
   134178 		;
   134179 EXT_LIST	:	EXT_ITEM
   134180 		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
   134181 		;
   134182 EXT_ITEM	:	HIDENTIFIER
   134183 			EXT_IDENT
   134184 		;
   134185 EXT_IDENT	:	/* EMPTY */
   134186 		|	HVALRELOPERATOR {}
   134187 			HTEXTKONST
   134188 		;
   134189 /* GRAMATIKK FOR TYPER */
   134190 NO_TYPE         :       /*EMPT*/
   134191 		;
   134192 MBEE_TYPE       :       NO_TYPE
   134193 		|       TYPE
   134194 		;
   134195 TYPE            :       HREF HBEGPAR
   134196 			HIDENTIFIER
   134197 				{}
   134198 			HENDPAR
   134199 		|       HTEXT
   134200 		|       HBOOLEAN
   134201 		|       HCHARACTER
   134202 		|       HSHORT HINTEGER
   134203 		|       HINTEGER
   134204 		|       HREAL
   134205 		|       HLONG HREAL
   134206 		;
   134207 
   134208 /* GRAMATIKK FOR DEL AV SETNINGER */
   134209 MBEE_ELSE_PART  :       /*EMPT*/
   134210 /*		|	HELSE
   134211 			HIF
   134212 			EXPRESSION
   134213 			HTHEN   {}
   134214 			BLOCK   {}
   134215 			MBEE_ELSE_PART          {}*/
   134216 		|       HELSE   {}
   134217 			BLOCK
   134218 		;
   134219 FOR_LIST        :       FOR_LIST_ELEMENT
   134220 		|       FOR_LIST_ELEMENT
   134221 			HPAREXPSEPARATOR
   134222 			FOR_LIST
   134223 		;
   134224 FOR_LIST_ELEMENT:       EXPRESSION
   134225 			MBEE_F_L_EL_R_PT
   134226 		;
   134227 MBEE_F_L_EL_R_PT:       /*EMPT*/
   134228 		|       HWHILE
   134229 			EXPRESSION
   134230 		|       HSTEP
   134231 			EXPRESSION
   134232 			HUNTIL
   134233 			EXPRESSION
   134234 		;
   134235 GOTO            :       HGO
   134236 			HTO
   134237 		|       HGOTO
   134238 		;
   134239 CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
   134240 		|       HDO   {}
   134241 			BLOCK
   134242 		;
   134243 WHEN_CLAUSE_LIST:       HWHEN
   134244 			HIDENTIFIER
   134245 			HDO    {}
   134246 			BLOCK
   134247 		|       WHEN_CLAUSE_LIST
   134248 			HWHEN
   134249 			HIDENTIFIER
   134250 			HDO    {}
   134251 			BLOCK
   134252 		;
   134253 MBEE_OTWI_CLAUS :       /*EMPT*/
   134254 		|       HOTHERWISE {}
   134255 
   134256 			BLOCK
   134257 		;
   134258 ACTIVATOR	:	HACTIVATE
   134259 		|	HREACTIVATE
   134260 		;
   134261 SCHEDULE	:	/*EMPT*/
   134262 		|	ATDELAY EXPRESSION	{}
   134263 			PRIOR
   134264 		|	BEFOREAFTER		{}
   134265 			EXPRESSION
   134266 		;
   134267 ATDELAY		:	HAT
   134268 		|	HDELAY
   134269 		;
   134270 BEFOREAFTER	:	HBEFORE
   134271 		|	HAFTER
   134272 		;
   134273 PRIOR		:	/*EMPT*/
   134274 		|	HPRIOR
   134275 		;
   134276 /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
   134277 MODULSTATEMENT  :       HWHILE
   134278 			EXPRESSION
   134279 			HDO     {}
   134280 			BLOCK
   134281 		|       HIF
   134282 			EXPRESSION
   134283 			HTHEN   {}
   134284 			BLOCK   {}
   134285 			MBEE_ELSE_PART
   134286 		|       HFOR
   134287 			HIDENTIFIER
   134288 			HASSIGN {}
   134289 			FOR_LIST
   134290 			HDO     {}
   134291 			BLOCK
   134292 		|       GOTO
   134293 			EXPRESSION
   134294 		|       HINSPECT
   134295 			EXPRESSION              {}
   134296 			CONN_STATE_R_PT
   134297 				{}
   134298 			MBEE_OTWI_CLAUS
   134299 		|       HINNER
   134300 		|       HIDENTIFIER
   134301 			HLABELSEPARATOR
   134302 				{}
   134303 			DECLSTATEMENT
   134304 		|       EXPRESSION_SIMP
   134305 			HBEGIN
   134306 				{}
   134307 			IMPORT_SPEC_MODULE
   134308 				{}
   134309 			MBEE_DECLSTMS
   134310 			HEND
   134311 		|	EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
   134312 			MBEE_DECLSTMS HEND
   134313 		|	EXPRESSION_SIMP HBEGIN error HEND
   134314 		|       EXPRESSION_SIMP
   134315 		|	ACTIVATOR EXPRESSION SCHEDULE
   134316 		|       HBEGIN
   134317 				{}
   134318 			MBEE_DECLSTMS
   134319 			HEND
   134320 		|       MBEE_TYPE HPROCEDURE
   134321 			HIDENTIFIER
   134322 				{}
   134323 			HEADING BLOCK
   134324 		|       HIDENTIFIER
   134325 			HCLASS
   134326 			NO_TYPE
   134327 				{}
   134328 			IMPORT_SPEC_MODULE
   134329 			HIDENTIFIER
   134330 				{}
   134331 			HEADING
   134332 			BLOCK
   134333 		|       HCLASS
   134334 			NO_TYPE
   134335 			HIDENTIFIER
   134336 				{}
   134337 			HEADING
   134338 			BLOCK
   134339 		|       EXT_DECLARATION
   134340 		|       /*EMPT*/
   134341 		;
   134342 IMPORT_SPEC_MODULE:
   134343 		;
   134344 DECLSTATEMENT	:	MODULSTATEMENT
   134345 		|       TYPE
   134346 			HIDENTIFIER
   134347 			MBEE_CONSTANT
   134348 			HPAREXPSEPARATOR
   134349 				{}
   134350 			IDENTIFIER_LISTC
   134351 		|       TYPE
   134352 			HIDENTIFIER
   134353 			MBEE_CONSTANT
   134354 		|       MBEE_TYPE
   134355 			HARRAY  {}
   134356 			ARR_SEGMENT_LIST
   134357 		|       HSWITCH
   134358 			HIDENTIFIER
   134359 			HASSIGN {}
   134360 			SWITCH_LIST
   134361 		;
   134362 BLOCK           :       DECLSTATEMENT
   134363 		|       HBEGIN MBEE_DECLSTMS HEND
   134364 		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
   134365 		|	HBEGIN error HEND
   134366 		;
   134367 MBEE_DECLSTMS   :       MBEE_DECLSTMSU
   134368 		;
   134369 MBEE_DECLSTMSU  :       DECLSTATEMENT
   134370 		|       MBEE_DECLSTMSU
   134371 			HSTATEMENTSEPARATOR
   134372 			DECLSTATEMENT
   134373 		;
   134374 MODULS		:	MODULSTATEMENT
   134375 		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
   134376 		;
   134377 /* GRAMATIKK FOR DEL AV DEKLARASJONER */
   134378 ARR_SEGMENT_LIST:       ARR_SEGMENT
   134379 		|       ARR_SEGMENT_LIST
   134380 			HPAREXPSEPARATOR
   134381 			ARR_SEGMENT
   134382 		;
   134383 ARR_SEGMENT	:       ARRAY_SEGMENT
   134384 			HBEGPAR
   134385 			BAUND_PAIR_LIST HENDPAR
   134386 		;
   134387 ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
   134388 
   134389 		|       ARRAY_SEGMENT_EL
   134390 			HPAREXPSEPARATOR
   134391 			ARRAY_SEGMENT
   134392 		;
   134393 ARRAY_SEGMENT_EL:       HIDENTIFIER
   134394 		;
   134395 BAUND_PAIR_LIST :       BAUND_PAIR
   134396 		|       BAUND_PAIR
   134397 			HPAREXPSEPARATOR
   134398 			BAUND_PAIR_LIST
   134399 		;
   134400 BAUND_PAIR      :       EXPRESSION
   134401 			HLABELSEPARATOR
   134402 			EXPRESSION
   134403 		;
   134404 SWITCH_LIST     :       EXPRESSION
   134405 		|       EXPRESSION
   134406 			HPAREXPSEPARATOR
   134407 			SWITCH_LIST
   134408 		;
   134409 HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
   134410 			MBEE_MODE_PART  {}
   134411 			MBEE_SPEC_PART  {}
   134412 			MBEE_PROT_PART  {}
   134413 			MBEE_VIRT_PART
   134414 		;
   134415 MBEE_FMAL_PAR_P :       /*EMPT*/
   134416 		|       FMAL_PAR_PART
   134417 		;
   134418 FMAL_PAR_PART   :       HBEGPAR NO_TYPE
   134419 			MBEE_LISTV HENDPAR
   134420 		;
   134421 MBEE_LISTV      :       /*EMPT*/
   134422 		|       LISTV
   134423 		;
   134424 LISTV           :       HIDENTIFIER
   134425 		|	FPP_CATEG HDOTDOTDOT
   134426 		|       HIDENTIFIER     {}
   134427 			HPAREXPSEPARATOR LISTV
   134428 		|       FPP_SPEC
   134429 		|       FPP_SPEC
   134430 			HPAREXPSEPARATOR LISTV
   134431 		;
   134432 FPP_HEADING     :       HBEGPAR NO_TYPE
   134433 			FPP_MBEE_LISTV HENDPAR
   134434 		;
   134435 FPP_MBEE_LISTV  :       /*EMPT*/
   134436 		|       FPP_LISTV
   134437 		;
   134438 FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
   134439 		|       FPP_SPEC
   134440 		|       FPP_SPEC
   134441 			HPAREXPSEPARATOR LISTV
   134442 		;
   134443 FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
   134444 		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
   134445 		;
   134446 FPP_CATEG       :       HNAME HLABELSEPARATOR
   134447 		|       HVALUE HLABELSEPARATOR
   134448 		|       HVAR HLABELSEPARATOR
   134449 		|       /*EMPT*/
   134450 		;
   134451 FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
   134452 			HIDENTIFIER
   134453 					{}
   134454 			FPP_HEADING {} { /* Yes, two "final" actions. */ }
   134455 		;
   134456 IDENTIFIER_LISTV:       HIDENTIFIER
   134457 		|	HDOTDOTDOT
   134458 		|       HIDENTIFIER     {}
   134459 			HPAREXPSEPARATOR IDENTIFIER_LISTV
   134460 		;
   134461 MBEE_MODE_PART  :       /*EMPT*/
   134462 		|       MODE_PART
   134463 		;
   134464 MODE_PART       :       NAME_PART
   134465 		|       VALUE_PART
   134466 		|       VAR_PART
   134467 		|       NAME_PART VALUE_PART
   134468 		|       VALUE_PART NAME_PART
   134469 		|       NAME_PART VAR_PART
   134470 		|       VAR_PART NAME_PART
   134471 		|       VALUE_PART VAR_PART
   134472 		|       VAR_PART VALUE_PART
   134473 		|       VAR_PART NAME_PART VALUE_PART
   134474 		|       NAME_PART VAR_PART VALUE_PART
   134475 		|       NAME_PART VALUE_PART VAR_PART
   134476 		|       VAR_PART VALUE_PART NAME_PART
   134477 		|       VALUE_PART VAR_PART NAME_PART
   134478 		|       VALUE_PART NAME_PART VAR_PART
   134479 		;
   134480 NAME_PART       :       HNAME           {}
   134481 			IDENTIFIER_LISTV
   134482 			HSTATEMENTSEPARATOR
   134483 		;
   134484 VAR_PART        :       HVAR            {}
   134485 			IDENTIFIER_LISTV
   134486 			HSTATEMENTSEPARATOR
   134487 		;
   134488 VALUE_PART      :       HVALUE          {}
   134489 			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
   134490 		;
   134491 MBEE_SPEC_PART  :       /*EMPT*/
   134492 		|       SPEC_PART
   134493 		;
   134494 SPEC_PART       :       ONE_SPEC
   134495 		|       SPEC_PART ONE_SPEC
   134496 		;
   134497 ONE_SPEC	:	SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
   134498 		|	NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
   134499 			  {}
   134500 			PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
   134501 		|       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
   134502 		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
   134503 		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
   134504 			IDENTIFIER_LIST HSTATEMENTSEPARATOR
   134505 		;
   134506 SPECIFIER       :       TYPE
   134507 		|       MBEE_TYPE
   134508 			HARRAY
   134509 		|       HLABEL
   134510 		|       HSWITCH
   134511 		;
   134512 PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
   134513 			HIDENTIFIER
   134514 					{}
   134515 			HEADING
   134516 					{}
   134517 			MBEE_BEGIN_END
   134518 		;
   134519 MBEE_BEGIN_END	:	/* EMPTY */
   134520 		|	HBEGIN HEND
   134521 		;
   134522 MBEE_PROT_PART  :       /*EMPT*/
   134523 		|       PROTECTION_PART
   134524 		;
   134525 PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
   134526 			HSTATEMENTSEPARATOR
   134527 		|       PROTECTION_PART  PROT_SPECIFIER
   134528 			IDENTIFIER_LIST HSTATEMENTSEPARATOR
   134529 		;
   134530 PROT_SPECIFIER  :       HHIDDEN
   134531 		|       HPROTECTED
   134532 		|       HHIDDEN
   134533 			HPROTECTED
   134534 		|       HPROTECTED
   134535 			HHIDDEN
   134536 		;
   134537 MBEE_VIRT_PART  :       /*EMPT*/
   134538 		|       VIRTUAL_PART
   134539 		;
   134540 VIRTUAL_PART    :       HVIRTUAL
   134541 			HLABELSEPARATOR
   134542 			MBEE_SPEC_PART
   134543 		;
   134544 IDENTIFIER_LIST :       HIDENTIFIER
   134545 		|       IDENTIFIER_LIST HPAREXPSEPARATOR
   134546 			HIDENTIFIER
   134547 		;
   134548 IDENTIFIER_LISTC:       HIDENTIFIER
   134549 			MBEE_CONSTANT
   134550 		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
   134551 			HIDENTIFIER
   134552 			MBEE_CONSTANT
   134553 		;
   134554 MBEE_CONSTANT	:	/* EMPTY */
   134555 		|	HVALRELOPERATOR
   134556 				{}
   134557 			EXPRESSION
   134558 		;
   134559 
   134560 /* GRAMATIKK FOR UTTRYKK */
   134561 EXPRESSION      :       EXPRESSION_SIMP
   134562 		|       HIF
   134563 			EXPRESSION
   134564 			HTHEN
   134565 			EXPRESSION
   134566 			HELSE
   134567 			EXPRESSION
   134568 		;
   134569 EXPRESSION_SIMP :	EXPRESSION_SIMP
   134570 			HASSIGN
   134571 			EXPRESSION
   134572 		|
   134573 
   134574 			EXPRESSION_SIMP
   134575 			HCONC
   134576 			EXPRESSION_SIMP
   134577 		|       EXPRESSION_SIMP HOR
   134578 			HELSE
   134579 			EXPRESSION_SIMP
   134580 			%prec HORELSE
   134581 		|       EXPRESSION_SIMP HAND
   134582 			HTHEN
   134583 			EXPRESSION_SIMP
   134584 			%prec HANDTHEN
   134585 		|       EXPRESSION_SIMP
   134586 			HEQV EXPRESSION_SIMP
   134587 		|       EXPRESSION_SIMP
   134588 			HIMP EXPRESSION_SIMP
   134589 		|       EXPRESSION_SIMP
   134590 			HOR EXPRESSION_SIMP
   134591 		|       EXPRESSION_SIMP
   134592 			HAND EXPRESSION_SIMP
   134593 		|       HNOT EXPRESSION_SIMP
   134594 		|       EXPRESSION_SIMP
   134595 			HVALRELOPERATOR
   134596 			EXPRESSION_SIMP
   134597 		|       EXPRESSION_SIMP
   134598 			HREFRELOPERATOR
   134599 			EXPRESSION_SIMP
   134600 		|       EXPRESSION_SIMP
   134601 			HOBJRELOPERATOR
   134602 			EXPRESSION_SIMP
   134603 		|       HTERMOPERATOR
   134604 			EXPRESSION_SIMP %prec UNEAR
   134605 		|       EXPRESSION_SIMP
   134606 			HTERMOPERATOR
   134607 			EXPRESSION_SIMP
   134608 		|       EXPRESSION_SIMP
   134609 			HFACTOROPERATOR
   134610 			EXPRESSION_SIMP
   134611 		|       EXPRESSION_SIMP
   134612 			HPRIMARYOPERATOR
   134613 			EXPRESSION_SIMP
   134614 		|       HBEGPAR
   134615 			EXPRESSION HENDPAR
   134616 		|       HTEXTKONST
   134617 		|       HCHARACTERKONST
   134618 		|       HREALKONST
   134619 		|       HINTEGERKONST
   134620 		|       HBOOLEANKONST
   134621 		|       HNONE
   134622 		|       HIDENTIFIER
   134623 				{}
   134624 			MBEE_ARG_R_PT
   134625 		|       HTHIS HIDENTIFIER
   134626 		|       HNEW
   134627 			HIDENTIFIER
   134628 			ARG_R_PT
   134629 		|       EXPRESSION_SIMP
   134630 			HDOT
   134631 			EXPRESSION_SIMP
   134632 		|       EXPRESSION_SIMP
   134633 			HQUA HIDENTIFIER
   134634 		;
   134635 ARG_R_PT        :       /*EMPTY*/
   134636 		|       HBEGPAR
   134637 			ARGUMENT_LIST HENDPAR
   134638 		;
   134639 MBEE_ARG_R_PT   :       /*EMPTY*/
   134640 		|       HBEGPAR
   134641 			ARGUMENT_LIST HENDPAR
   134642 		;
   134643 ARGUMENT_LIST   :       EXPRESSION
   134644 		|       EXPRESSION
   134645 			HPAREXPSEPARATOR
   134646 			ARGUMENT_LIST
   134647 		;
   134648 
   134649 
   134650 %%
   134651 #include <stdio.h>
   134652 /* A C error reporting function.  */
   134653 static
   134654 void yyerror ( const char *msg)
   134655 {
   134656   fprintf (stderr, "%s\n", msg);
   134657 }
   134658 static int
   134659 yylex (void)
   134660 {
   134661   static int const input[] = {
   134662     0
   134663   };
   134664   static int const *inputp = input;
   134665   return *inputp++;
   134666 }
   134667 
   134668 int
   134669 main (void)
   134670 {
   134671   return yyparse ();
   134672 }
   134673 _ATEOF
   134674 
   134675 
   134676 
   134677 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   134678 # expanding macros, so it corrupts some special characters in the
   134679 # macros.  To avoid this, expand now and pass it the result with proper
   134680 # string quotation.  Assume args 7 through 12 expand to properly quoted
   134681 # strings.
   134682 
   134683 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   134684   at_save_special_files
   134685   mkdir xml-tests
   134686     # Don't combine these Bison invocations since we want to be sure that
   134687   # --report=all isn't required to get the full XML file.
   134688   { set +x
   134689 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   134690                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   134691 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783"
   134692 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   134693                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   134694 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134695 at_status=$? at_failed=false
   134696 $at_check_filter
   134697 echo stderr:; cat "$at_stderr"
   134698 echo stdout:; cat "$at_stdout"
   134699 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134700 $at_failed && at_fn_log_failure
   134701 $at_traceon; }
   134702 
   134703   { set +x
   134704 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   134705 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:783"
   134706 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   134707 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134708 at_status=$? at_failed=false
   134709 $at_check_filter
   134710 echo stderr:; cat "$at_stderr"
   134711 echo stdout:; cat "$at_stdout"
   134712 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134713 $at_failed && at_fn_log_failure
   134714 $at_traceon; }
   134715 
   134716     cp xml-tests/test.output expout
   134717   { set +x
   134718 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   134719              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   134720              xml-tests/test.xml"
   134721 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   134722 ( $at_check_trace; $XSLTPROC \
   134723              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   134724              xml-tests/test.xml
   134725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134726 at_status=$? at_failed=false
   134727 $at_check_filter
   134728 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134729 $at_diff expout "$at_stdout" || at_failed=:
   134730 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134731 $at_failed && at_fn_log_failure
   134732 $at_traceon; }
   134733 
   134734   sort xml-tests/test.dot > expout
   134735   { set +x
   134736 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   134737              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   134738              xml-tests/test.xml | sort"
   134739 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   134740 ( $at_check_trace; $XSLTPROC \
   134741              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   134742              xml-tests/test.xml | sort
   134743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134744 at_status=$? at_failed=false
   134745 $at_check_filter
   134746 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134747 $at_diff expout "$at_stdout" || at_failed=:
   134748 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134749 $at_failed && at_fn_log_failure
   134750 $at_traceon; }
   134751 
   134752   rm -rf xml-tests expout
   134753   at_restore_special_files
   134754 fi
   134755 { set +x
   134756 $as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y"
   134757 at_fn_check_prepare_trace "existing.at:783"
   134758 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   134759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134760 at_status=$? at_failed=false
   134761 $at_check_filter
   134762 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce
   134763 " | \
   134764   $at_diff - "$at_stderr" || at_failed=:
   134765 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134766 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134767 $at_failed && at_fn_log_failure
   134768 $at_traceon; }
   134769 
   134770 
   134771 
   134772 { set +x
   134773 $as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1"
   134774 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783"
   134775 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   134776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134777 at_status=$? at_failed=false
   134778 $at_check_filter
   134779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134780 echo >>"$at_stdout"; $as_echo "442
   134781 " | \
   134782   $at_diff - "$at_stdout" || at_failed=:
   134783 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134784 $at_failed && at_fn_log_failure
   134785 $at_traceon; }
   134786 
   134787 
   134788 { set +x
   134789 $as_echo "$at_srcdir/existing.at:783: diff -u /dev/null /dev/null || exit 77"
   134790 at_fn_check_prepare_trace "existing.at:783"
   134791 ( $at_check_trace; diff -u /dev/null /dev/null || exit 77
   134792 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134793 at_status=$? at_failed=false
   134794 $at_check_filter
   134795 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134796 echo stdout:; cat "$at_stdout"
   134797 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134798 $at_failed && at_fn_log_failure
   134799 $at_traceon; }
   134800 
   134801 
   134802 { set +x
   134803 $as_echo "$at_srcdir/existing.at:783: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
   134804 at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:783"
   134805 ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
   134806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134807 at_status=$? at_failed=false
   134808 $at_check_filter
   134809 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134810 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134811 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134812 $at_failed && at_fn_log_failure
   134813 $at_traceon; }
   134814 
   134815 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   134816   at_save_special_files
   134817   mkdir xml-tests
   134818     # Don't combine these Bison invocations since we want to be sure that
   134819   # --report=all isn't required to get the full XML file.
   134820   { set +x
   134821 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   134822                   --graph=xml-tests/test.dot --report=all input-lalr.y"
   134823 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783"
   134824 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   134825                   --graph=xml-tests/test.dot --report=all input-lalr.y
   134826 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134827 at_status=$? at_failed=false
   134828 $at_check_filter
   134829 echo stderr:; cat "$at_stderr"
   134830 echo stdout:; cat "$at_stdout"
   134831 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134832 $at_failed && at_fn_log_failure
   134833 $at_traceon; }
   134834 
   134835   { set +x
   134836 $as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y"
   134837 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:783"
   134838 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y
   134839 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134840 at_status=$? at_failed=false
   134841 $at_check_filter
   134842 echo stderr:; cat "$at_stderr"
   134843 echo stdout:; cat "$at_stdout"
   134844 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134845 $at_failed && at_fn_log_failure
   134846 $at_traceon; }
   134847 
   134848     cp xml-tests/test.output expout
   134849   { set +x
   134850 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   134851              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   134852              xml-tests/test.xml"
   134853 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   134854 ( $at_check_trace; $XSLTPROC \
   134855              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   134856              xml-tests/test.xml
   134857 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134858 at_status=$? at_failed=false
   134859 $at_check_filter
   134860 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134861 $at_diff expout "$at_stdout" || at_failed=:
   134862 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134863 $at_failed && at_fn_log_failure
   134864 $at_traceon; }
   134865 
   134866   sort xml-tests/test.dot > expout
   134867   { set +x
   134868 $as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\
   134869              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   134870              xml-tests/test.xml | sort"
   134871 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783"
   134872 ( $at_check_trace; $XSLTPROC \
   134873              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   134874              xml-tests/test.xml | sort
   134875 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134876 at_status=$? at_failed=false
   134877 $at_check_filter
   134878 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134879 $at_diff expout "$at_stdout" || at_failed=:
   134880 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134881 $at_failed && at_fn_log_failure
   134882 $at_traceon; }
   134883 
   134884   rm -rf xml-tests expout
   134885   at_restore_special_files
   134886 fi
   134887 { set +x
   134888 $as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y"
   134889 at_fn_check_prepare_trace "existing.at:783"
   134890 ( $at_check_trace; bison --report=all input-lalr.y
   134891 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134892 at_status=$? at_failed=false
   134893 $at_check_filter
   134894 echo stderr:; cat "$at_stderr"
   134895 echo stdout:; cat "$at_stdout"
   134896 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134897 $at_failed && at_fn_log_failure
   134898 $at_traceon; }
   134899 
   134900 
   134901 { set +x
   134902 $as_echo "$at_srcdir/existing.at:783: diff -u input-lalr.output input.output \\
   134903            | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
   134904 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783"
   134905 ( $at_check_trace; diff -u input-lalr.output input.output \
   134906            | sed -n '/^@@/,$p' | sed 's/^ $//'
   134907 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134908 at_status=$? at_failed=false
   134909 $at_check_filter
   134910 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134911 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134912 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134913 $at_failed && at_fn_log_failure
   134914 $at_traceon; }
   134915 { set +x
   134916 $as_echo "$at_srcdir/existing.at:783: grep '^State.*conflicts:' input.output"
   134917 at_fn_check_prepare_trace "existing.at:783"
   134918 ( $at_check_trace; grep '^State.*conflicts:' input.output
   134919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134920 at_status=$? at_failed=false
   134921 $at_check_filter
   134922 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134923 echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce
   134924 State 164 conflicts: 1 shift/reduce
   134925 State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
   134926 State 206 conflicts: 1 shift/reduce
   134927 State 240 conflicts: 1 shift/reduce
   134928 State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
   134929 State 356 conflicts: 1 shift/reduce
   134930 State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
   134931 State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
   134932 " | \
   134933   $at_diff - "$at_stdout" || at_failed=:
   134934 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134935 $at_failed && at_fn_log_failure
   134936 $at_traceon; }
   134937 
   134938 
   134939 # Canonical LR generates very large tables, resulting in very long
   134940 # files with #line directives that may overflow what the standards
   134941 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   134942 # will issue an error.
   134943 #
   134944 # There is no "" around `wc` since some indent the result.
   134945 
   134946 { set +x
   134947 $as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS"
   134948 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783"
   134949 ( $at_check_trace; $BISON_C_WORKS
   134950 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134951 at_status=$? at_failed=false
   134952 $at_check_filter
   134953 echo stderr:; cat "$at_stderr"
   134954 echo stdout:; cat "$at_stdout"
   134955 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134956 $at_failed && at_fn_log_failure
   134957 $at_traceon; }
   134958 
   134959 { set +x
   134960 $as_echo "$at_srcdir/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   134961 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783"
   134962 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   134963 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134964 at_status=$? at_failed=false
   134965 $at_check_filter
   134966 echo stderr:; cat "$at_stderr"
   134967 echo stdout:; cat "$at_stdout"
   134968 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134969 $at_failed && at_fn_log_failure
   134970 $at_traceon; }
   134971 
   134972 
   134973 { set +x
   134974 $as_echo "$at_srcdir/existing.at:783:  \$PREPARSER ./input"
   134975 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783"
   134976 ( $at_check_trace;  $PREPARSER ./input
   134977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134978 at_status=$? at_failed=false
   134979 $at_check_filter
   134980 echo stderr:; tee stderr <"$at_stderr"
   134981 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134982 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134983 $at_failed && at_fn_log_failure
   134984 $at_traceon; }
   134985 
   134986 { set +x
   134987 $as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   134988 at_fn_check_prepare_trace "existing.at:783"
   134989 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   134990 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   134991 at_status=$? at_failed=false
   134992 $at_check_filter
   134993 at_fn_diff_devnull "$at_stderr" || at_failed=:
   134994 at_fn_diff_devnull "$at_stdout" || at_failed=:
   134995 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   134996 $at_failed && at_fn_log_failure
   134997 $at_traceon; }
   134998 
   134999 
   135000 
   135001 
   135002   set +x
   135003   $at_times_p && times >"$at_times_file"
   135004 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   135005 read at_status <"$at_status_file"
   135006 #AT_STOP_263
   135007 #AT_START_264
   135008 at_fn_group_banner 264 'existing.at:783' \
   135009   "GNU Cim Grammar: Canonical LR(1)" "               " 16
   135010 at_xfail=no
   135011 (
   135012   $as_echo "264. $at_setup_line: testing $at_desc ..."
   135013   $at_traceon
   135014 
   135015 
   135016 cat >input.y <<'_ATEOF'
   135017 %code top {
   135018 #include <config.h>
   135019 /* We don't need perfect functions for these tests. */
   135020 #undef malloc
   135021 #undef memcmp
   135022 #undef realloc
   135023 }
   135024 
   135025 %code {
   135026   #include <stdio.h>
   135027   static void yyerror ( const char *msg);
   135028   static int yylex (void);
   135029 }
   135030 
   135031 %define lr.type canonical-lr
   135032 
   135033 %token
   135034 	HACTIVATE HAFTER /*HAND*/ HARRAY HAT
   135035 	HBEFORE HBEGIN HBOOLEAN
   135036 	HCHARACTER HCLASS /*HCOMMENT*/ HCONC
   135037 	HDELAY HDO
   135038 	HELSE HEND HEQ /*HEQV*/ HEXTERNAL
   135039 	HFOR
   135040 	HGE HGO HGOTO HGT
   135041 	HHIDDEN
   135042 	HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
   135043 	HLABEL HLE HLONG HLT
   135044 	HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
   135045 	/*HOR*/ HOTHERWISE
   135046 	HPRIOR HPROCEDURE HPROTECTED
   135047 	HQUA
   135048 	HREACTIVATE HREAL HREF
   135049 	HSHORT HSTEP HSWITCH
   135050 	HTEXT HTHEN HTHIS HTO
   135051 	HUNTIL
   135052 	HVALUE HVAR HVIRTUAL
   135053 	HWHEN HWHILE
   135054 
   135055 	HASSIGNVALUE HASSIGNREF
   135056 	/*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
   135057 	HBEGPAR HENDPAR
   135058 	HEQR HNER
   135059 	HADD HSUB HMUL HDIV HINTDIV HEXP
   135060 	HDOTDOTDOT
   135061 
   135062 %token HIDENTIFIER
   135063 %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
   135064 %token HREALKONST
   135065 %token HTEXTKONST
   135066 
   135067 
   135068 %right HASSIGN
   135069 %left   HORELSE
   135070 %left   HANDTHEN
   135071 %left   HEQV
   135072 %left   HIMP
   135073 %left   HOR
   135074 %left   HAND
   135075 
   135076 %left   HNOT
   135077 
   135078 %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR
   135079 
   135080 %left	HCONC
   135081 
   135082 %left HTERMOPERATOR
   135083 %left UNEAR
   135084 %left HFACTOROPERATOR
   135085 %left         HPRIMARYOPERATOR
   135086 
   135087 %left   HQUA
   135088 
   135089 %left   HDOT
   135090 
   135091 %start  MAIN_MODULE
   135092 
   135093 
   135094 %%
   135095 
   135096 
   135097 /* GRAMATIKK FOR PROGRAM MODULES */
   135098 MAIN_MODULE     :       {}
   135099 			MODULS
   135100 		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
   135101 		;
   135102 EXT_DECLARATION	:	HEXTERNAL
   135103 			MBEE_TYPE
   135104 			HPROCEDURE
   135105 				{}
   135106 			EXT_LIST
   135107 		|
   135108 			HEXTERNAL
   135109 			HIDENTIFIER
   135110 			HPROCEDURE
   135111 				{}
   135112 			HIDENTIFIER {}
   135113 			EXTERNAL_KIND_ITEM
   135114 		|	HEXTERNAL
   135115 			HCLASS
   135116 				{}
   135117 			EXT_LIST
   135118 
   135119 		;
   135120 EXTERNAL_KIND_ITEM:	EXT_IDENT
   135121 			HOBJRELOPERATOR
   135122 				{}
   135123 			MBEE_TYPE HPROCEDURE
   135124 			HIDENTIFIER
   135125 				{}
   135126 			HEADING EMPTY_BLOCK
   135127 				{}
   135128 /*		|
   135129 			EXT_IDENT
   135130 				{}
   135131 			MBEE_REST_EXT_LIST
   135132 		;
   135133 MBEE_REST_EXT_LIST:	/* EMPTY
   135134 		|	HPAREXPSEPARATOR EXT_KIND_LIST
   135135 		;
   135136 EXT_KIND_LIST	:	EXT_KIND_ITEM
   135137 		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
   135138 		;
   135139 EXT_KIND_ITEM	:	HIDENTIFIER
   135140 			EXT_IDENT
   135141 				{}*/
   135142 		;
   135143 EMPTY_BLOCK	:	/*EMPT*/
   135144 		|	HBEGIN HEND
   135145 		;
   135146 EXT_LIST	:	EXT_ITEM
   135147 		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
   135148 		;
   135149 EXT_ITEM	:	HIDENTIFIER
   135150 			EXT_IDENT
   135151 		;
   135152 EXT_IDENT	:	/* EMPTY */
   135153 		|	HVALRELOPERATOR {}
   135154 			HTEXTKONST
   135155 		;
   135156 /* GRAMATIKK FOR TYPER */
   135157 NO_TYPE         :       /*EMPT*/
   135158 		;
   135159 MBEE_TYPE       :       NO_TYPE
   135160 		|       TYPE
   135161 		;
   135162 TYPE            :       HREF HBEGPAR
   135163 			HIDENTIFIER
   135164 				{}
   135165 			HENDPAR
   135166 		|       HTEXT
   135167 		|       HBOOLEAN
   135168 		|       HCHARACTER
   135169 		|       HSHORT HINTEGER
   135170 		|       HINTEGER
   135171 		|       HREAL
   135172 		|       HLONG HREAL
   135173 		;
   135174 
   135175 /* GRAMATIKK FOR DEL AV SETNINGER */
   135176 MBEE_ELSE_PART  :       /*EMPT*/
   135177 /*		|	HELSE
   135178 			HIF
   135179 			EXPRESSION
   135180 			HTHEN   {}
   135181 			BLOCK   {}
   135182 			MBEE_ELSE_PART          {}*/
   135183 		|       HELSE   {}
   135184 			BLOCK
   135185 		;
   135186 FOR_LIST        :       FOR_LIST_ELEMENT
   135187 		|       FOR_LIST_ELEMENT
   135188 			HPAREXPSEPARATOR
   135189 			FOR_LIST
   135190 		;
   135191 FOR_LIST_ELEMENT:       EXPRESSION
   135192 			MBEE_F_L_EL_R_PT
   135193 		;
   135194 MBEE_F_L_EL_R_PT:       /*EMPT*/
   135195 		|       HWHILE
   135196 			EXPRESSION
   135197 		|       HSTEP
   135198 			EXPRESSION
   135199 			HUNTIL
   135200 			EXPRESSION
   135201 		;
   135202 GOTO            :       HGO
   135203 			HTO
   135204 		|       HGOTO
   135205 		;
   135206 CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
   135207 		|       HDO   {}
   135208 			BLOCK
   135209 		;
   135210 WHEN_CLAUSE_LIST:       HWHEN
   135211 			HIDENTIFIER
   135212 			HDO    {}
   135213 			BLOCK
   135214 		|       WHEN_CLAUSE_LIST
   135215 			HWHEN
   135216 			HIDENTIFIER
   135217 			HDO    {}
   135218 			BLOCK
   135219 		;
   135220 MBEE_OTWI_CLAUS :       /*EMPT*/
   135221 		|       HOTHERWISE {}
   135222 
   135223 			BLOCK
   135224 		;
   135225 ACTIVATOR	:	HACTIVATE
   135226 		|	HREACTIVATE
   135227 		;
   135228 SCHEDULE	:	/*EMPT*/
   135229 		|	ATDELAY EXPRESSION	{}
   135230 			PRIOR
   135231 		|	BEFOREAFTER		{}
   135232 			EXPRESSION
   135233 		;
   135234 ATDELAY		:	HAT
   135235 		|	HDELAY
   135236 		;
   135237 BEFOREAFTER	:	HBEFORE
   135238 		|	HAFTER
   135239 		;
   135240 PRIOR		:	/*EMPT*/
   135241 		|	HPRIOR
   135242 		;
   135243 /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
   135244 MODULSTATEMENT  :       HWHILE
   135245 			EXPRESSION
   135246 			HDO     {}
   135247 			BLOCK
   135248 		|       HIF
   135249 			EXPRESSION
   135250 			HTHEN   {}
   135251 			BLOCK   {}
   135252 			MBEE_ELSE_PART
   135253 		|       HFOR
   135254 			HIDENTIFIER
   135255 			HASSIGN {}
   135256 			FOR_LIST
   135257 			HDO     {}
   135258 			BLOCK
   135259 		|       GOTO
   135260 			EXPRESSION
   135261 		|       HINSPECT
   135262 			EXPRESSION              {}
   135263 			CONN_STATE_R_PT
   135264 				{}
   135265 			MBEE_OTWI_CLAUS
   135266 		|       HINNER
   135267 		|       HIDENTIFIER
   135268 			HLABELSEPARATOR
   135269 				{}
   135270 			DECLSTATEMENT
   135271 		|       EXPRESSION_SIMP
   135272 			HBEGIN
   135273 				{}
   135274 			IMPORT_SPEC_MODULE
   135275 				{}
   135276 			MBEE_DECLSTMS
   135277 			HEND
   135278 		|	EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
   135279 			MBEE_DECLSTMS HEND
   135280 		|	EXPRESSION_SIMP HBEGIN error HEND
   135281 		|       EXPRESSION_SIMP
   135282 		|	ACTIVATOR EXPRESSION SCHEDULE
   135283 		|       HBEGIN
   135284 				{}
   135285 			MBEE_DECLSTMS
   135286 			HEND
   135287 		|       MBEE_TYPE HPROCEDURE
   135288 			HIDENTIFIER
   135289 				{}
   135290 			HEADING BLOCK
   135291 		|       HIDENTIFIER
   135292 			HCLASS
   135293 			NO_TYPE
   135294 				{}
   135295 			IMPORT_SPEC_MODULE
   135296 			HIDENTIFIER
   135297 				{}
   135298 			HEADING
   135299 			BLOCK
   135300 		|       HCLASS
   135301 			NO_TYPE
   135302 			HIDENTIFIER
   135303 				{}
   135304 			HEADING
   135305 			BLOCK
   135306 		|       EXT_DECLARATION
   135307 		|       /*EMPT*/
   135308 		;
   135309 IMPORT_SPEC_MODULE:
   135310 		;
   135311 DECLSTATEMENT	:	MODULSTATEMENT
   135312 		|       TYPE
   135313 			HIDENTIFIER
   135314 			MBEE_CONSTANT
   135315 			HPAREXPSEPARATOR
   135316 				{}
   135317 			IDENTIFIER_LISTC
   135318 		|       TYPE
   135319 			HIDENTIFIER
   135320 			MBEE_CONSTANT
   135321 		|       MBEE_TYPE
   135322 			HARRAY  {}
   135323 			ARR_SEGMENT_LIST
   135324 		|       HSWITCH
   135325 			HIDENTIFIER
   135326 			HASSIGN {}
   135327 			SWITCH_LIST
   135328 		;
   135329 BLOCK           :       DECLSTATEMENT
   135330 		|       HBEGIN MBEE_DECLSTMS HEND
   135331 		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
   135332 		|	HBEGIN error HEND
   135333 		;
   135334 MBEE_DECLSTMS   :       MBEE_DECLSTMSU
   135335 		;
   135336 MBEE_DECLSTMSU  :       DECLSTATEMENT
   135337 		|       MBEE_DECLSTMSU
   135338 			HSTATEMENTSEPARATOR
   135339 			DECLSTATEMENT
   135340 		;
   135341 MODULS		:	MODULSTATEMENT
   135342 		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
   135343 		;
   135344 /* GRAMATIKK FOR DEL AV DEKLARASJONER */
   135345 ARR_SEGMENT_LIST:       ARR_SEGMENT
   135346 		|       ARR_SEGMENT_LIST
   135347 			HPAREXPSEPARATOR
   135348 			ARR_SEGMENT
   135349 		;
   135350 ARR_SEGMENT	:       ARRAY_SEGMENT
   135351 			HBEGPAR
   135352 			BAUND_PAIR_LIST HENDPAR
   135353 		;
   135354 ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
   135355 
   135356 		|       ARRAY_SEGMENT_EL
   135357 			HPAREXPSEPARATOR
   135358 			ARRAY_SEGMENT
   135359 		;
   135360 ARRAY_SEGMENT_EL:       HIDENTIFIER
   135361 		;
   135362 BAUND_PAIR_LIST :       BAUND_PAIR
   135363 		|       BAUND_PAIR
   135364 			HPAREXPSEPARATOR
   135365 			BAUND_PAIR_LIST
   135366 		;
   135367 BAUND_PAIR      :       EXPRESSION
   135368 			HLABELSEPARATOR
   135369 			EXPRESSION
   135370 		;
   135371 SWITCH_LIST     :       EXPRESSION
   135372 		|       EXPRESSION
   135373 			HPAREXPSEPARATOR
   135374 			SWITCH_LIST
   135375 		;
   135376 HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
   135377 			MBEE_MODE_PART  {}
   135378 			MBEE_SPEC_PART  {}
   135379 			MBEE_PROT_PART  {}
   135380 			MBEE_VIRT_PART
   135381 		;
   135382 MBEE_FMAL_PAR_P :       /*EMPT*/
   135383 		|       FMAL_PAR_PART
   135384 		;
   135385 FMAL_PAR_PART   :       HBEGPAR NO_TYPE
   135386 			MBEE_LISTV HENDPAR
   135387 		;
   135388 MBEE_LISTV      :       /*EMPT*/
   135389 		|       LISTV
   135390 		;
   135391 LISTV           :       HIDENTIFIER
   135392 		|	FPP_CATEG HDOTDOTDOT
   135393 		|       HIDENTIFIER     {}
   135394 			HPAREXPSEPARATOR LISTV
   135395 		|       FPP_SPEC
   135396 		|       FPP_SPEC
   135397 			HPAREXPSEPARATOR LISTV
   135398 		;
   135399 FPP_HEADING     :       HBEGPAR NO_TYPE
   135400 			FPP_MBEE_LISTV HENDPAR
   135401 		;
   135402 FPP_MBEE_LISTV  :       /*EMPT*/
   135403 		|       FPP_LISTV
   135404 		;
   135405 FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
   135406 		|       FPP_SPEC
   135407 		|       FPP_SPEC
   135408 			HPAREXPSEPARATOR LISTV
   135409 		;
   135410 FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
   135411 		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
   135412 		;
   135413 FPP_CATEG       :       HNAME HLABELSEPARATOR
   135414 		|       HVALUE HLABELSEPARATOR
   135415 		|       HVAR HLABELSEPARATOR
   135416 		|       /*EMPT*/
   135417 		;
   135418 FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
   135419 			HIDENTIFIER
   135420 					{}
   135421 			FPP_HEADING {} { /* Yes, two "final" actions. */ }
   135422 		;
   135423 IDENTIFIER_LISTV:       HIDENTIFIER
   135424 		|	HDOTDOTDOT
   135425 		|       HIDENTIFIER     {}
   135426 			HPAREXPSEPARATOR IDENTIFIER_LISTV
   135427 		;
   135428 MBEE_MODE_PART  :       /*EMPT*/
   135429 		|       MODE_PART
   135430 		;
   135431 MODE_PART       :       NAME_PART
   135432 		|       VALUE_PART
   135433 		|       VAR_PART
   135434 		|       NAME_PART VALUE_PART
   135435 		|       VALUE_PART NAME_PART
   135436 		|       NAME_PART VAR_PART
   135437 		|       VAR_PART NAME_PART
   135438 		|       VALUE_PART VAR_PART
   135439 		|       VAR_PART VALUE_PART
   135440 		|       VAR_PART NAME_PART VALUE_PART
   135441 		|       NAME_PART VAR_PART VALUE_PART
   135442 		|       NAME_PART VALUE_PART VAR_PART
   135443 		|       VAR_PART VALUE_PART NAME_PART
   135444 		|       VALUE_PART VAR_PART NAME_PART
   135445 		|       VALUE_PART NAME_PART VAR_PART
   135446 		;
   135447 NAME_PART       :       HNAME           {}
   135448 			IDENTIFIER_LISTV
   135449 			HSTATEMENTSEPARATOR
   135450 		;
   135451 VAR_PART        :       HVAR            {}
   135452 			IDENTIFIER_LISTV
   135453 			HSTATEMENTSEPARATOR
   135454 		;
   135455 VALUE_PART      :       HVALUE          {}
   135456 			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
   135457 		;
   135458 MBEE_SPEC_PART  :       /*EMPT*/
   135459 		|       SPEC_PART
   135460 		;
   135461 SPEC_PART       :       ONE_SPEC
   135462 		|       SPEC_PART ONE_SPEC
   135463 		;
   135464 ONE_SPEC	:	SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
   135465 		|	NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
   135466 			  {}
   135467 			PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
   135468 		|       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
   135469 		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
   135470 		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
   135471 			IDENTIFIER_LIST HSTATEMENTSEPARATOR
   135472 		;
   135473 SPECIFIER       :       TYPE
   135474 		|       MBEE_TYPE
   135475 			HARRAY
   135476 		|       HLABEL
   135477 		|       HSWITCH
   135478 		;
   135479 PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
   135480 			HIDENTIFIER
   135481 					{}
   135482 			HEADING
   135483 					{}
   135484 			MBEE_BEGIN_END
   135485 		;
   135486 MBEE_BEGIN_END	:	/* EMPTY */
   135487 		|	HBEGIN HEND
   135488 		;
   135489 MBEE_PROT_PART  :       /*EMPT*/
   135490 		|       PROTECTION_PART
   135491 		;
   135492 PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
   135493 			HSTATEMENTSEPARATOR
   135494 		|       PROTECTION_PART  PROT_SPECIFIER
   135495 			IDENTIFIER_LIST HSTATEMENTSEPARATOR
   135496 		;
   135497 PROT_SPECIFIER  :       HHIDDEN
   135498 		|       HPROTECTED
   135499 		|       HHIDDEN
   135500 			HPROTECTED
   135501 		|       HPROTECTED
   135502 			HHIDDEN
   135503 		;
   135504 MBEE_VIRT_PART  :       /*EMPT*/
   135505 		|       VIRTUAL_PART
   135506 		;
   135507 VIRTUAL_PART    :       HVIRTUAL
   135508 			HLABELSEPARATOR
   135509 			MBEE_SPEC_PART
   135510 		;
   135511 IDENTIFIER_LIST :       HIDENTIFIER
   135512 		|       IDENTIFIER_LIST HPAREXPSEPARATOR
   135513 			HIDENTIFIER
   135514 		;
   135515 IDENTIFIER_LISTC:       HIDENTIFIER
   135516 			MBEE_CONSTANT
   135517 		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
   135518 			HIDENTIFIER
   135519 			MBEE_CONSTANT
   135520 		;
   135521 MBEE_CONSTANT	:	/* EMPTY */
   135522 		|	HVALRELOPERATOR
   135523 				{}
   135524 			EXPRESSION
   135525 		;
   135526 
   135527 /* GRAMATIKK FOR UTTRYKK */
   135528 EXPRESSION      :       EXPRESSION_SIMP
   135529 		|       HIF
   135530 			EXPRESSION
   135531 			HTHEN
   135532 			EXPRESSION
   135533 			HELSE
   135534 			EXPRESSION
   135535 		;
   135536 EXPRESSION_SIMP :	EXPRESSION_SIMP
   135537 			HASSIGN
   135538 			EXPRESSION
   135539 		|
   135540 
   135541 			EXPRESSION_SIMP
   135542 			HCONC
   135543 			EXPRESSION_SIMP
   135544 		|       EXPRESSION_SIMP HOR
   135545 			HELSE
   135546 			EXPRESSION_SIMP
   135547 			%prec HORELSE
   135548 		|       EXPRESSION_SIMP HAND
   135549 			HTHEN
   135550 			EXPRESSION_SIMP
   135551 			%prec HANDTHEN
   135552 		|       EXPRESSION_SIMP
   135553 			HEQV EXPRESSION_SIMP
   135554 		|       EXPRESSION_SIMP
   135555 			HIMP EXPRESSION_SIMP
   135556 		|       EXPRESSION_SIMP
   135557 			HOR EXPRESSION_SIMP
   135558 		|       EXPRESSION_SIMP
   135559 			HAND EXPRESSION_SIMP
   135560 		|       HNOT EXPRESSION_SIMP
   135561 		|       EXPRESSION_SIMP
   135562 			HVALRELOPERATOR
   135563 			EXPRESSION_SIMP
   135564 		|       EXPRESSION_SIMP
   135565 			HREFRELOPERATOR
   135566 			EXPRESSION_SIMP
   135567 		|       EXPRESSION_SIMP
   135568 			HOBJRELOPERATOR
   135569 			EXPRESSION_SIMP
   135570 		|       HTERMOPERATOR
   135571 			EXPRESSION_SIMP %prec UNEAR
   135572 		|       EXPRESSION_SIMP
   135573 			HTERMOPERATOR
   135574 			EXPRESSION_SIMP
   135575 		|       EXPRESSION_SIMP
   135576 			HFACTOROPERATOR
   135577 			EXPRESSION_SIMP
   135578 		|       EXPRESSION_SIMP
   135579 			HPRIMARYOPERATOR
   135580 			EXPRESSION_SIMP
   135581 		|       HBEGPAR
   135582 			EXPRESSION HENDPAR
   135583 		|       HTEXTKONST
   135584 		|       HCHARACTERKONST
   135585 		|       HREALKONST
   135586 		|       HINTEGERKONST
   135587 		|       HBOOLEANKONST
   135588 		|       HNONE
   135589 		|       HIDENTIFIER
   135590 				{}
   135591 			MBEE_ARG_R_PT
   135592 		|       HTHIS HIDENTIFIER
   135593 		|       HNEW
   135594 			HIDENTIFIER
   135595 			ARG_R_PT
   135596 		|       EXPRESSION_SIMP
   135597 			HDOT
   135598 			EXPRESSION_SIMP
   135599 		|       EXPRESSION_SIMP
   135600 			HQUA HIDENTIFIER
   135601 		;
   135602 ARG_R_PT        :       /*EMPTY*/
   135603 		|       HBEGPAR
   135604 			ARGUMENT_LIST HENDPAR
   135605 		;
   135606 MBEE_ARG_R_PT   :       /*EMPTY*/
   135607 		|       HBEGPAR
   135608 			ARGUMENT_LIST HENDPAR
   135609 		;
   135610 ARGUMENT_LIST   :       EXPRESSION
   135611 		|       EXPRESSION
   135612 			HPAREXPSEPARATOR
   135613 			ARGUMENT_LIST
   135614 		;
   135615 
   135616 
   135617 %%
   135618 #include <stdio.h>
   135619 /* A C error reporting function.  */
   135620 static
   135621 void yyerror ( const char *msg)
   135622 {
   135623   fprintf (stderr, "%s\n", msg);
   135624 }
   135625 static int
   135626 yylex (void)
   135627 {
   135628   static int const input[] = {
   135629     0
   135630   };
   135631   static int const *inputp = input;
   135632   return *inputp++;
   135633 }
   135634 
   135635 int
   135636 main (void)
   135637 {
   135638   return yyparse ();
   135639 }
   135640 _ATEOF
   135641 
   135642 
   135643 
   135644 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   135645 # expanding macros, so it corrupts some special characters in the
   135646 # macros.  To avoid this, expand now and pass it the result with proper
   135647 # string quotation.  Assume args 7 through 12 expand to properly quoted
   135648 # strings.
   135649 
   135650 { set +x
   135651 $as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y"
   135652 at_fn_check_prepare_trace "existing.at:783"
   135653 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   135654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   135655 at_status=$? at_failed=false
   135656 $at_check_filter
   135657 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1876 shift/reduce, 144 reduce/reduce
   135658 " | \
   135659   $at_diff - "$at_stderr" || at_failed=:
   135660 at_fn_diff_devnull "$at_stdout" || at_failed=:
   135661 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   135662 $at_failed && at_fn_log_failure
   135663 $at_traceon; }
   135664 
   135665 
   135666 
   135667 { set +x
   135668 $as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1"
   135669 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783"
   135670 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   135671 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   135672 at_status=$? at_failed=false
   135673 $at_check_filter
   135674 at_fn_diff_devnull "$at_stderr" || at_failed=:
   135675 echo >>"$at_stdout"; $as_echo "10425
   135676 " | \
   135677   $at_diff - "$at_stdout" || at_failed=:
   135678 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   135679 $at_failed && at_fn_log_failure
   135680 $at_traceon; }
   135681 
   135682 
   135683 
   135684 
   135685 # Canonical LR generates very large tables, resulting in very long
   135686 # files with #line directives that may overflow what the standards
   135687 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   135688 # will issue an error.
   135689 #
   135690 # There is no "" around `wc` since some indent the result.
   135691 if test 32767 -lt `wc -l < input.c`; then
   135692   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   135693   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   135694 fi
   135695 { set +x
   135696 $as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS"
   135697 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783"
   135698 ( $at_check_trace; $BISON_C_WORKS
   135699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   135700 at_status=$? at_failed=false
   135701 $at_check_filter
   135702 echo stderr:; cat "$at_stderr"
   135703 echo stdout:; cat "$at_stdout"
   135704 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   135705 $at_failed && at_fn_log_failure
   135706 $at_traceon; }
   135707 
   135708 { set +x
   135709 $as_echo "$at_srcdir/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   135710 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783"
   135711 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   135712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   135713 at_status=$? at_failed=false
   135714 $at_check_filter
   135715 echo stderr:; cat "$at_stderr"
   135716 echo stdout:; cat "$at_stdout"
   135717 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   135718 $at_failed && at_fn_log_failure
   135719 $at_traceon; }
   135720 
   135721 
   135722 { set +x
   135723 $as_echo "$at_srcdir/existing.at:783:  \$PREPARSER ./input"
   135724 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783"
   135725 ( $at_check_trace;  $PREPARSER ./input
   135726 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   135727 at_status=$? at_failed=false
   135728 $at_check_filter
   135729 echo stderr:; tee stderr <"$at_stderr"
   135730 at_fn_diff_devnull "$at_stdout" || at_failed=:
   135731 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   135732 $at_failed && at_fn_log_failure
   135733 $at_traceon; }
   135734 
   135735 { set +x
   135736 $as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   135737 at_fn_check_prepare_trace "existing.at:783"
   135738 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   135739 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   135740 at_status=$? at_failed=false
   135741 $at_check_filter
   135742 at_fn_diff_devnull "$at_stderr" || at_failed=:
   135743 at_fn_diff_devnull "$at_stdout" || at_failed=:
   135744 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783"
   135745 $at_failed && at_fn_log_failure
   135746 $at_traceon; }
   135747 
   135748 
   135749 
   135750 
   135751   set +x
   135752   $at_times_p && times >"$at_times_file"
   135753 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   135754 read at_status <"$at_status_file"
   135755 #AT_STOP_264
   135756 #AT_START_265
   135757 at_fn_group_banner 265 'existing.at:1403' \
   135758   "GNU pic (Groff 1.18.1) Grammar: LALR(1)" "        " 16
   135759 at_xfail=no
   135760 (
   135761   $as_echo "265. $at_setup_line: testing $at_desc ..."
   135762   $at_traceon
   135763 
   135764 
   135765 cat >input.y <<'_ATEOF'
   135766 %code top {
   135767 #include <config.h>
   135768 /* We don't need perfect functions for these tests. */
   135769 #undef malloc
   135770 #undef memcmp
   135771 #undef realloc
   135772 }
   135773 
   135774 %code {
   135775   #include <stdio.h>
   135776   static void yyerror ( const char *msg);
   135777   static int yylex (void);
   135778 }
   135779 
   135780 %define lr.type lalr
   135781 %error-verbose
   135782 
   135783 %token LABEL
   135784 %token VARIABLE
   135785 %token NUMBER
   135786 %token TEXT
   135787 %token COMMAND_LINE
   135788 %token DELIMITED
   135789 %token ORDINAL
   135790 %token TH
   135791 %token LEFT_ARROW_HEAD
   135792 %token RIGHT_ARROW_HEAD
   135793 %token DOUBLE_ARROW_HEAD
   135794 %token LAST
   135795 %token UP
   135796 %token DOWN
   135797 %token LEFT
   135798 %token RIGHT
   135799 %token BOX
   135800 %token CIRCLE
   135801 %token ELLIPSE
   135802 %token ARC
   135803 %token LINE
   135804 %token ARROW
   135805 %token MOVE
   135806 %token SPLINE
   135807 %token HEIGHT
   135808 %token RADIUS
   135809 %token WIDTH
   135810 %token DIAMETER
   135811 %token FROM
   135812 %token TO
   135813 %token AT
   135814 %token WITH
   135815 %token BY
   135816 %token THEN
   135817 %token SOLID
   135818 %token DOTTED
   135819 %token DASHED
   135820 %token CHOP
   135821 %token SAME
   135822 %token INVISIBLE
   135823 %token LJUST
   135824 %token RJUST
   135825 %token ABOVE
   135826 %token BELOW
   135827 %token OF
   135828 %token THE
   135829 %token WAY
   135830 %token BETWEEN
   135831 %token AND
   135832 %token HERE
   135833 %token DOT_N
   135834 %token DOT_E
   135835 %token DOT_W
   135836 %token DOT_S
   135837 %token DOT_NE
   135838 %token DOT_SE
   135839 %token DOT_NW
   135840 %token DOT_SW
   135841 %token DOT_C
   135842 %token DOT_START
   135843 %token DOT_END
   135844 %token DOT_X
   135845 %token DOT_Y
   135846 %token DOT_HT
   135847 %token DOT_WID
   135848 %token DOT_RAD
   135849 %token SIN
   135850 %token COS
   135851 %token ATAN2
   135852 %token LOG
   135853 %token EXP
   135854 %token SQRT
   135855 %token K_MAX
   135856 %token K_MIN
   135857 %token INT
   135858 %token RAND
   135859 %token SRAND
   135860 %token COPY
   135861 %token THROUGH
   135862 %token TOP
   135863 %token BOTTOM
   135864 %token UPPER
   135865 %token LOWER
   135866 %token SH
   135867 %token PRINT
   135868 %token CW
   135869 %token CCW
   135870 %token FOR
   135871 %token DO
   135872 %token IF
   135873 %token ELSE
   135874 %token ANDAND
   135875 %token OROR
   135876 %token NOTEQUAL
   135877 %token EQUALEQUAL
   135878 %token LESSEQUAL
   135879 %token GREATEREQUAL
   135880 %token LEFT_CORNER
   135881 %token RIGHT_CORNER
   135882 %token NORTH
   135883 %token SOUTH
   135884 %token EAST
   135885 %token WEST
   135886 %token CENTER
   135887 %token END
   135888 %token START
   135889 %token RESET
   135890 %token UNTIL
   135891 %token PLOT
   135892 %token THICKNESS
   135893 %token FILL
   135894 %token COLORED
   135895 %token OUTLINED
   135896 %token SHADED
   135897 %token ALIGNED
   135898 %token SPRINTF
   135899 %token COMMAND
   135900 
   135901 %left '.'
   135902 
   135903 /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
   135904 %left PLOT
   135905 %left TEXT SPRINTF
   135906 
   135907 /* give text adjustments higher precedence than TEXT, so that
   135908 box "foo" above ljust == box ("foo" above ljust)
   135909 */
   135910 
   135911 %left LJUST RJUST ABOVE BELOW
   135912 
   135913 %left LEFT RIGHT
   135914 /* Give attributes that take an optional expression a higher
   135915 precedence than left and right, so that eg `line chop left'
   135916 parses properly. */
   135917 %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
   135918 %left LABEL
   135919 
   135920 %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
   135921 %left ORDINAL HERE '`'
   135922 
   135923 %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */
   135924 
   135925 /* these need to be lower than '-' */
   135926 %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS
   135927 
   135928 /* these must have higher precedence than CHOP so that `label %prec CHOP'
   135929 works */
   135930 %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
   135931 %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
   135932 %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END
   135933 
   135934 %left ','
   135935 %left OROR
   135936 %left ANDAND
   135937 %left EQUALEQUAL NOTEQUAL
   135938 %left '<' '>' LESSEQUAL GREATEREQUAL
   135939 
   135940 %left BETWEEN OF
   135941 %left AND
   135942 
   135943 %left '+' '-'
   135944 %left '*' '/' '%'
   135945 %right '!'
   135946 %right '^'
   135947 
   135948 
   135949 %%
   135950 
   135951 
   135952 top:
   135953 	optional_separator
   135954 	| element_list
   135955 	;
   135956 
   135957 element_list:
   135958 	optional_separator middle_element_list optional_separator
   135959 	;
   135960 
   135961 middle_element_list:
   135962 	element
   135963 	| middle_element_list separator element
   135964 	;
   135965 
   135966 optional_separator:
   135967 	/* empty */
   135968 	| separator
   135969 	;
   135970 
   135971 separator:
   135972 	';'
   135973 	| separator ';'
   135974 	;
   135975 
   135976 placeless_element:
   135977 	VARIABLE '=' any_expr
   135978 	| VARIABLE ':' '=' any_expr
   135979 	| UP
   135980 	| DOWN
   135981 	| LEFT
   135982 	| RIGHT
   135983 	| COMMAND_LINE
   135984 	| COMMAND print_args
   135985 	| PRINT print_args
   135986 	| SH
   135987 		{}
   135988 	  DELIMITED
   135989 	| COPY TEXT
   135990 	| COPY TEXT THROUGH
   135991 		{}
   135992 	  DELIMITED
   135993 		{}
   135994 	  until
   135995 	| COPY THROUGH
   135996 		{}
   135997 	  DELIMITED
   135998 		{}
   135999 	  until
   136000 	| FOR VARIABLE '=' expr TO expr optional_by DO
   136001 		{}
   136002 	  DELIMITED
   136003 	| simple_if
   136004 	| simple_if ELSE
   136005 		{}
   136006 	  DELIMITED
   136007 	| reset_variables
   136008 	| RESET
   136009 	;
   136010 
   136011 reset_variables:
   136012 	RESET VARIABLE
   136013 	| reset_variables VARIABLE
   136014 	| reset_variables ',' VARIABLE
   136015 	;
   136016 
   136017 print_args:
   136018 	print_arg
   136019 	| print_args print_arg
   136020 	;
   136021 
   136022 print_arg:
   136023 	expr							%prec ','
   136024 	| text
   136025 	| position						%prec ','
   136026 	;
   136027 
   136028 simple_if:
   136029 	IF any_expr THEN
   136030 		{}
   136031 	DELIMITED
   136032 	;
   136033 
   136034 until:
   136035 	/* empty */
   136036 	| UNTIL TEXT
   136037 	;
   136038 
   136039 any_expr:
   136040 	expr
   136041 	| text_expr
   136042 	;
   136043 
   136044 text_expr:
   136045 	text EQUALEQUAL text
   136046 	| text NOTEQUAL text
   136047 	| text_expr ANDAND text_expr
   136048 	| text_expr ANDAND expr
   136049 	| expr ANDAND text_expr
   136050 	| text_expr OROR text_expr
   136051 	| text_expr OROR expr
   136052 	| expr OROR text_expr
   136053 	| '!' text_expr
   136054 	;
   136055 
   136056 optional_by:
   136057 	/* empty */
   136058 	| BY expr
   136059 	| BY '*' expr
   136060 	;
   136061 
   136062 element:
   136063 	object_spec
   136064 	| LABEL ':' optional_separator element
   136065 	| LABEL ':' optional_separator position_not_place
   136066 	| LABEL ':' optional_separator place
   136067 	| '{' {} element_list '}'
   136068 		{}
   136069 	  optional_element
   136070 	| placeless_element
   136071 	;
   136072 
   136073 optional_element:
   136074 	/* empty */
   136075 	| element
   136076 	;
   136077 
   136078 object_spec:
   136079 	BOX
   136080 	| CIRCLE
   136081 	| ELLIPSE
   136082 	| ARC
   136083 	| LINE
   136084 	| ARROW
   136085 	| MOVE
   136086 	| SPLINE
   136087 	| text							%prec TEXT
   136088 	| PLOT expr
   136089 	| PLOT expr text
   136090 	| '['
   136091 		{}
   136092 	  element_list ']'
   136093 	| object_spec HEIGHT expr
   136094 	| object_spec RADIUS expr
   136095 	| object_spec WIDTH expr
   136096 	| object_spec DIAMETER expr
   136097 	| object_spec expr					%prec HEIGHT
   136098 	| object_spec UP
   136099 	| object_spec UP expr
   136100 	| object_spec DOWN
   136101 	| object_spec DOWN expr
   136102 	| object_spec RIGHT
   136103 	| object_spec RIGHT expr
   136104 	| object_spec LEFT
   136105 	| object_spec LEFT expr
   136106 	| object_spec FROM position
   136107 	| object_spec TO position
   136108 	| object_spec AT position
   136109 	| object_spec WITH path
   136110 	| object_spec WITH position				%prec ','
   136111 	| object_spec BY expr_pair
   136112 	| object_spec THEN
   136113 	| object_spec SOLID
   136114 	| object_spec DOTTED
   136115 	| object_spec DOTTED expr
   136116 	| object_spec DASHED
   136117 	| object_spec DASHED expr
   136118 	| object_spec FILL
   136119 	| object_spec FILL expr
   136120 	| object_spec SHADED text
   136121 	| object_spec COLORED text
   136122 	| object_spec OUTLINED text
   136123 	| object_spec CHOP
   136124 	| object_spec CHOP expr
   136125 	| object_spec SAME
   136126 	| object_spec INVISIBLE
   136127 	| object_spec LEFT_ARROW_HEAD
   136128 	| object_spec RIGHT_ARROW_HEAD
   136129 	| object_spec DOUBLE_ARROW_HEAD
   136130 	| object_spec CW
   136131 	| object_spec CCW
   136132 	| object_spec text					%prec TEXT
   136133 	| object_spec LJUST
   136134 	| object_spec RJUST
   136135 	| object_spec ABOVE
   136136 	| object_spec BELOW
   136137 	| object_spec THICKNESS expr
   136138 	| object_spec ALIGNED
   136139 	;
   136140 
   136141 text:
   136142 	TEXT
   136143 	| SPRINTF '(' TEXT sprintf_args ')'
   136144 	;
   136145 
   136146 sprintf_args:
   136147 	/* empty */
   136148 	| sprintf_args ',' expr
   136149 	;
   136150 
   136151 position:
   136152 	position_not_place
   136153 	| place
   136154 	;
   136155 
   136156 position_not_place:
   136157 	expr_pair
   136158 	| position '+' expr_pair
   136159 	| position '-' expr_pair
   136160 	| '(' position ',' position ')'
   136161 	| expr between position AND position
   136162 	| expr '<' position ',' position '>'
   136163 	;
   136164 
   136165 between:
   136166 	BETWEEN
   136167 	| OF THE WAY BETWEEN
   136168 	;
   136169 
   136170 expr_pair:
   136171 	expr ',' expr
   136172 	| '(' expr_pair ')'
   136173 	;
   136174 
   136175 place:
   136176 	/* line at A left == line (at A) left */
   136177 	label							%prec CHOP
   136178 	| label corner
   136179 	| corner label
   136180 	| corner OF label
   136181 	| HERE
   136182 	;
   136183 
   136184 label:
   136185 	LABEL
   136186 	| nth_primitive
   136187 	| label '.' LABEL
   136188 	;
   136189 
   136190 ordinal:
   136191 	ORDINAL
   136192 	| '`' any_expr TH
   136193 	;
   136194 
   136195 optional_ordinal_last:
   136196 	LAST
   136197 	| ordinal LAST
   136198 	;
   136199 
   136200 nth_primitive:
   136201 	ordinal object_type
   136202 	| optional_ordinal_last object_type
   136203 	;
   136204 
   136205 object_type:
   136206 	BOX
   136207 	| CIRCLE
   136208 	| ELLIPSE
   136209 	| ARC
   136210 	| LINE
   136211 	| ARROW
   136212 	| SPLINE
   136213 	| '[' ']'
   136214 	| TEXT
   136215 	;
   136216 
   136217 label_path:
   136218 	'.' LABEL
   136219 	| label_path '.' LABEL
   136220 	;
   136221 
   136222 relative_path:
   136223 	corner							%prec CHOP
   136224 	/* give this a lower precedence than LEFT and RIGHT so that
   136225 	   [A: box] with .A left == [A: box] with (.A left) */
   136226 	| label_path						%prec TEXT
   136227 	| label_path corner
   136228 	;
   136229 
   136230 path:
   136231 	relative_path
   136232 	| '(' relative_path ',' relative_path ')'
   136233 		{}
   136234 	/* The rest of these rules are a compatibility sop. */
   136235 	| ORDINAL LAST object_type relative_path
   136236 	| LAST object_type relative_path
   136237 	| ORDINAL object_type relative_path
   136238 	| LABEL relative_path
   136239 	;
   136240 
   136241 corner:
   136242 	DOT_N
   136243 	| DOT_E
   136244 	| DOT_W
   136245 	| DOT_S
   136246 	| DOT_NE
   136247 	| DOT_SE
   136248 	| DOT_NW
   136249 	| DOT_SW
   136250 	| DOT_C
   136251 	| DOT_START
   136252 	| DOT_END
   136253 	| TOP
   136254 	| BOTTOM
   136255 	| LEFT
   136256 	| RIGHT
   136257 	| UPPER LEFT
   136258 	| LOWER LEFT
   136259 	| UPPER RIGHT
   136260 	| LOWER RIGHT
   136261 	| LEFT_CORNER
   136262 	| RIGHT_CORNER
   136263 	| UPPER LEFT_CORNER
   136264 	| LOWER LEFT_CORNER
   136265 	| UPPER RIGHT_CORNER
   136266 	| LOWER RIGHT_CORNER
   136267 	| NORTH
   136268 	| SOUTH
   136269 	| EAST
   136270 	| WEST
   136271 	| CENTER
   136272 	| START
   136273 	| END
   136274 	;
   136275 
   136276 expr:
   136277 	VARIABLE
   136278 	| NUMBER
   136279 	| place DOT_X
   136280 	| place DOT_Y
   136281 	| place DOT_HT
   136282 	| place DOT_WID
   136283 	| place DOT_RAD
   136284 	| expr '+' expr
   136285 	| expr '-' expr
   136286 	| expr '*' expr
   136287 	| expr '/' expr
   136288 	| expr '%' expr
   136289 	| expr '^' expr
   136290 	| '-' expr						%prec '!'
   136291 	| '(' any_expr ')'
   136292 	| SIN '(' any_expr ')'
   136293 	| COS '(' any_expr ')'
   136294 	| ATAN2 '(' any_expr ',' any_expr ')'
   136295 	| LOG '(' any_expr ')'
   136296 	| EXP '(' any_expr ')'
   136297 	| SQRT '(' any_expr ')'
   136298 	| K_MAX '(' any_expr ',' any_expr ')'
   136299 	| K_MIN '(' any_expr ',' any_expr ')'
   136300 	| INT '(' any_expr ')'
   136301 	| RAND '(' any_expr ')'
   136302 	| RAND '(' ')'
   136303 	| SRAND '(' any_expr ')'
   136304 	| expr '<' expr
   136305 	| expr LESSEQUAL expr
   136306 	| expr '>' expr
   136307 	| expr GREATEREQUAL expr
   136308 	| expr EQUALEQUAL expr
   136309 	| expr NOTEQUAL expr
   136310 	| expr ANDAND expr
   136311 	| expr OROR expr
   136312 	| '!' expr
   136313 	;
   136314 
   136315 
   136316 %%
   136317 #include <stdio.h>
   136318 /* A C error reporting function.  */
   136319 static
   136320 void yyerror ( const char *msg)
   136321 {
   136322   fprintf (stderr, "%s\n", msg);
   136323 }
   136324 static int
   136325 yylex (void)
   136326 {
   136327   static int const input[] = {
   136328     VARIABLE, '=', LABEL, LEFT, DOT_X, 0
   136329   };
   136330   static int const *inputp = input;
   136331   return *inputp++;
   136332 }
   136333 
   136334 int
   136335 main (void)
   136336 {
   136337   return yyparse ();
   136338 }
   136339 _ATEOF
   136340 
   136341 
   136342 
   136343 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   136344 # expanding macros, so it corrupts some special characters in the
   136345 # macros.  To avoid this, expand now and pass it the result with proper
   136346 # string quotation.  Assume args 7 through 12 expand to properly quoted
   136347 # strings.
   136348 
   136349 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   136350   at_save_special_files
   136351   mkdir xml-tests
   136352     # Don't combine these Bison invocations since we want to be sure that
   136353   # --report=all isn't required to get the full XML file.
   136354   { set +x
   136355 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   136356                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   136357 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   136358 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   136359                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   136360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136361 at_status=$? at_failed=false
   136362 $at_check_filter
   136363 echo stderr:; cat "$at_stderr"
   136364 echo stdout:; cat "$at_stdout"
   136365 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136366 $at_failed && at_fn_log_failure
   136367 $at_traceon; }
   136368 
   136369   { set +x
   136370 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   136371 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:1403"
   136372 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   136373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136374 at_status=$? at_failed=false
   136375 $at_check_filter
   136376 echo stderr:; cat "$at_stderr"
   136377 echo stdout:; cat "$at_stdout"
   136378 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136379 $at_failed && at_fn_log_failure
   136380 $at_traceon; }
   136381 
   136382     cp xml-tests/test.output expout
   136383   { set +x
   136384 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   136385              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   136386              xml-tests/test.xml"
   136387 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   136388 ( $at_check_trace; $XSLTPROC \
   136389              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   136390              xml-tests/test.xml
   136391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136392 at_status=$? at_failed=false
   136393 $at_check_filter
   136394 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136395 $at_diff expout "$at_stdout" || at_failed=:
   136396 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136397 $at_failed && at_fn_log_failure
   136398 $at_traceon; }
   136399 
   136400   sort xml-tests/test.dot > expout
   136401   { set +x
   136402 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   136403              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   136404              xml-tests/test.xml | sort"
   136405 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   136406 ( $at_check_trace; $XSLTPROC \
   136407              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   136408              xml-tests/test.xml | sort
   136409 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136410 at_status=$? at_failed=false
   136411 $at_check_filter
   136412 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136413 $at_diff expout "$at_stdout" || at_failed=:
   136414 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136415 $at_failed && at_fn_log_failure
   136416 $at_traceon; }
   136417 
   136418   rm -rf xml-tests expout
   136419   at_restore_special_files
   136420 fi
   136421 { set +x
   136422 $as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y"
   136423 at_fn_check_prepare_trace "existing.at:1403"
   136424 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   136425 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136426 at_status=$? at_failed=false
   136427 $at_check_filter
   136428 echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
   136429 " | \
   136430   $at_diff - "$at_stderr" || at_failed=:
   136431 at_fn_diff_devnull "$at_stdout" || at_failed=:
   136432 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136433 $at_failed && at_fn_log_failure
   136434 $at_traceon; }
   136435 
   136436 # Defining POSIXLY_CORRECT causes bison to complain if options are
   136437 # added after the grammar file name, so skip these checks in that
   136438 # case.
   136439 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   136440   at_save_special_files
   136441 
   136442   # To avoid expanding it repeatedly, store specified stdout.
   136443   : >expout
   136444 
   136445   # Run with -Werror.
   136446   { set +x
   136447 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror"
   136448 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403"
   136449 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror
   136450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136451 at_status=$? at_failed=false
   136452 $at_check_filter
   136453 echo stderr:; tee stderr <"$at_stderr"
   136454 $at_diff expout "$at_stdout" || at_failed=:
   136455 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   136456 $at_failed && at_fn_log_failure
   136457 $at_traceon; }
   136458 
   136459 
   136460   # Build expected stderr up to and including the "warnings being
   136461   # treated as errors" message.
   136462   cat >at-bison-check-warnings <<'_ATEOF'
   136463 input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
   136464 _ATEOF
   136465 
   136466   at_bison_check_first=`sed -n \
   136467     '/: warning: /{=;q;}' at-bison-check-warnings`
   136468   : ${at_bison_check_first:=1}
   136469   at_bison_check_first_tmp=`sed -n \
   136470     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   136471   : ${at_bison_check_first_tmp:=1}
   136472   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   136473     at_bison_check_first=$at_bison_check_first_tmp
   136474   fi
   136475   if test $at_bison_check_first -gt 1; then
   136476     sed -n "1,`expr $at_bison_check_first - 1`"p \
   136477       at-bison-check-warnings > experr
   136478   fi
   136479   echo 'bison: warnings being treated as errors' >> experr
   136480 
   136481   # Finish building expected stderr and check.  Unlike warnings,
   136482   # complaints cause bison to exit early.  Thus, with -Werror, bison
   136483   # does not necessarily report all warnings that it does without
   136484   # -Werror, but it at least reports one.
   136485   at_bison_check_last=`sed -n '$=' stderr`
   136486   : ${at_bison_check_last:=1}
   136487   at_bison_check_last=`expr $at_bison_check_last - 1`
   136488   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   136489     at-bison-check-warnings >> experr
   136490   { set +x
   136491 $as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   136492               stderr 1>&2"
   136493 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   136494 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   136495               stderr 1>&2
   136496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136497 at_status=$? at_failed=false
   136498 $at_check_filter
   136499 $at_diff experr "$at_stderr" || at_failed=:
   136500 at_fn_diff_devnull "$at_stdout" || at_failed=:
   136501 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136502 $at_failed && at_fn_log_failure
   136503 $at_traceon; }
   136504 
   136505 
   136506   # Now check --warnings=error.
   136507   cp stderr experr
   136508   { set +x
   136509 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error"
   136510 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403"
   136511 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error
   136512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136513 at_status=$? at_failed=false
   136514 $at_check_filter
   136515 $at_diff experr "$at_stderr" || at_failed=:
   136516 $at_diff expout "$at_stdout" || at_failed=:
   136517 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   136518 $at_failed && at_fn_log_failure
   136519 $at_traceon; }
   136520 
   136521 
   136522   # Now check -Wnone and --warnings=none by making sure that
   136523   # -Werror doesn't change the exit status when -Wnone or
   136524   # --warnings=none is specified.
   136525   { set +x
   136526 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror"
   136527 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403"
   136528 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror
   136529 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136530 at_status=$? at_failed=false
   136531 $at_check_filter
   136532 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136533 $at_diff expout "$at_stdout" || at_failed=:
   136534 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136535 $at_failed && at_fn_log_failure
   136536 $at_traceon; }
   136537 
   136538   { set +x
   136539 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror"
   136540 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403"
   136541 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror
   136542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136543 at_status=$? at_failed=false
   136544 $at_check_filter
   136545 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136546 $at_diff expout "$at_stdout" || at_failed=:
   136547 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136548 $at_failed && at_fn_log_failure
   136549 $at_traceon; }
   136550 
   136551 
   136552   at_restore_special_files
   136553 fi
   136554 
   136555 { set +x
   136556 $as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1"
   136557 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403"
   136558 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   136559 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136560 at_status=$? at_failed=false
   136561 $at_check_filter
   136562 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136563 echo >>"$at_stdout"; $as_echo "422
   136564 " | \
   136565   $at_diff - "$at_stdout" || at_failed=:
   136566 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136567 $at_failed && at_fn_log_failure
   136568 $at_traceon; }
   136569 
   136570 
   136571 { set +x
   136572 $as_echo "$at_srcdir/existing.at:1403: diff -u /dev/null /dev/null || exit 77"
   136573 at_fn_check_prepare_trace "existing.at:1403"
   136574 ( $at_check_trace; diff -u /dev/null /dev/null || exit 77
   136575 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136576 at_status=$? at_failed=false
   136577 $at_check_filter
   136578 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136579 echo stdout:; cat "$at_stdout"
   136580 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136581 $at_failed && at_fn_log_failure
   136582 $at_traceon; }
   136583 
   136584 
   136585 { set +x
   136586 $as_echo "$at_srcdir/existing.at:1403: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
   136587 at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1403"
   136588 ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
   136589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136590 at_status=$? at_failed=false
   136591 $at_check_filter
   136592 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136593 at_fn_diff_devnull "$at_stdout" || at_failed=:
   136594 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136595 $at_failed && at_fn_log_failure
   136596 $at_traceon; }
   136597 
   136598 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   136599   at_save_special_files
   136600   mkdir xml-tests
   136601     # Don't combine these Bison invocations since we want to be sure that
   136602   # --report=all isn't required to get the full XML file.
   136603   { set +x
   136604 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   136605                   --graph=xml-tests/test.dot --report=all input-lalr.y"
   136606 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   136607 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   136608                   --graph=xml-tests/test.dot --report=all input-lalr.y
   136609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136610 at_status=$? at_failed=false
   136611 $at_check_filter
   136612 echo stderr:; cat "$at_stderr"
   136613 echo stdout:; cat "$at_stdout"
   136614 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136615 $at_failed && at_fn_log_failure
   136616 $at_traceon; }
   136617 
   136618   { set +x
   136619 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y"
   136620 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1403"
   136621 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y
   136622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136623 at_status=$? at_failed=false
   136624 $at_check_filter
   136625 echo stderr:; cat "$at_stderr"
   136626 echo stdout:; cat "$at_stdout"
   136627 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136628 $at_failed && at_fn_log_failure
   136629 $at_traceon; }
   136630 
   136631     cp xml-tests/test.output expout
   136632   { set +x
   136633 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   136634              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   136635              xml-tests/test.xml"
   136636 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   136637 ( $at_check_trace; $XSLTPROC \
   136638              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   136639              xml-tests/test.xml
   136640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136641 at_status=$? at_failed=false
   136642 $at_check_filter
   136643 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136644 $at_diff expout "$at_stdout" || at_failed=:
   136645 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136646 $at_failed && at_fn_log_failure
   136647 $at_traceon; }
   136648 
   136649   sort xml-tests/test.dot > expout
   136650   { set +x
   136651 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   136652              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   136653              xml-tests/test.xml | sort"
   136654 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   136655 ( $at_check_trace; $XSLTPROC \
   136656              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   136657              xml-tests/test.xml | sort
   136658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136659 at_status=$? at_failed=false
   136660 $at_check_filter
   136661 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136662 $at_diff expout "$at_stdout" || at_failed=:
   136663 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136664 $at_failed && at_fn_log_failure
   136665 $at_traceon; }
   136666 
   136667   rm -rf xml-tests expout
   136668   at_restore_special_files
   136669 fi
   136670 { set +x
   136671 $as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y"
   136672 at_fn_check_prepare_trace "existing.at:1403"
   136673 ( $at_check_trace; bison --report=all input-lalr.y
   136674 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136675 at_status=$? at_failed=false
   136676 $at_check_filter
   136677 echo stderr:; cat "$at_stderr"
   136678 echo stdout:; cat "$at_stdout"
   136679 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136680 $at_failed && at_fn_log_failure
   136681 $at_traceon; }
   136682 
   136683 
   136684 { set +x
   136685 $as_echo "$at_srcdir/existing.at:1403: diff -u input-lalr.output input.output \\
   136686            | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
   136687 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   136688 ( $at_check_trace; diff -u input-lalr.output input.output \
   136689            | sed -n '/^@@/,$p' | sed 's/^ $//'
   136690 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136691 at_status=$? at_failed=false
   136692 $at_check_filter
   136693 at_fn_diff_devnull "$at_stderr" || at_failed=:
   136694 at_fn_diff_devnull "$at_stdout" || at_failed=:
   136695 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136696 $at_failed && at_fn_log_failure
   136697 $at_traceon; }
   136698 
   136699 
   136700 # Canonical LR generates very large tables, resulting in very long
   136701 # files with #line directives that may overflow what the standards
   136702 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   136703 # will issue an error.
   136704 #
   136705 # There is no "" around `wc` since some indent the result.
   136706 
   136707 { set +x
   136708 $as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS"
   136709 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403"
   136710 ( $at_check_trace; $BISON_C_WORKS
   136711 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136712 at_status=$? at_failed=false
   136713 $at_check_filter
   136714 echo stderr:; cat "$at_stderr"
   136715 echo stdout:; cat "$at_stdout"
   136716 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136717 $at_failed && at_fn_log_failure
   136718 $at_traceon; }
   136719 
   136720 { set +x
   136721 $as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   136722 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403"
   136723 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   136724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136725 at_status=$? at_failed=false
   136726 $at_check_filter
   136727 echo stderr:; cat "$at_stderr"
   136728 echo stdout:; cat "$at_stdout"
   136729 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136730 $at_failed && at_fn_log_failure
   136731 $at_traceon; }
   136732 
   136733 
   136734 { set +x
   136735 $as_echo "$at_srcdir/existing.at:1403:  \$PREPARSER ./input"
   136736 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403"
   136737 ( $at_check_trace;  $PREPARSER ./input
   136738 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136739 at_status=$? at_failed=false
   136740 $at_check_filter
   136741 echo stderr:; tee stderr <"$at_stderr"
   136742 at_fn_diff_devnull "$at_stdout" || at_failed=:
   136743 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   136744 $at_failed && at_fn_log_failure
   136745 $at_traceon; }
   136746 
   136747 { set +x
   136748 $as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   136749 at_fn_check_prepare_trace "existing.at:1403"
   136750 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   136751 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   136752 at_status=$? at_failed=false
   136753 $at_check_filter
   136754 echo >>"$at_stderr"; $as_echo "syntax error, unexpected LEFT
   136755 " | \
   136756   $at_diff - "$at_stderr" || at_failed=:
   136757 at_fn_diff_devnull "$at_stdout" || at_failed=:
   136758 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   136759 $at_failed && at_fn_log_failure
   136760 $at_traceon; }
   136761 
   136762 
   136763 
   136764 
   136765   set +x
   136766   $at_times_p && times >"$at_times_file"
   136767 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   136768 read at_status <"$at_status_file"
   136769 #AT_STOP_265
   136770 #AT_START_266
   136771 at_fn_group_banner 266 'existing.at:1403' \
   136772   "GNU pic (Groff 1.18.1) Grammar: IELR(1)" "        " 16
   136773 at_xfail=no
   136774 (
   136775   $as_echo "266. $at_setup_line: testing $at_desc ..."
   136776   $at_traceon
   136777 
   136778 
   136779 cat >input.y <<'_ATEOF'
   136780 %code top {
   136781 #include <config.h>
   136782 /* We don't need perfect functions for these tests. */
   136783 #undef malloc
   136784 #undef memcmp
   136785 #undef realloc
   136786 }
   136787 
   136788 %code {
   136789   #include <stdio.h>
   136790   static void yyerror ( const char *msg);
   136791   static int yylex (void);
   136792 }
   136793 
   136794 %define lr.type ielr
   136795 %error-verbose
   136796 
   136797 %token LABEL
   136798 %token VARIABLE
   136799 %token NUMBER
   136800 %token TEXT
   136801 %token COMMAND_LINE
   136802 %token DELIMITED
   136803 %token ORDINAL
   136804 %token TH
   136805 %token LEFT_ARROW_HEAD
   136806 %token RIGHT_ARROW_HEAD
   136807 %token DOUBLE_ARROW_HEAD
   136808 %token LAST
   136809 %token UP
   136810 %token DOWN
   136811 %token LEFT
   136812 %token RIGHT
   136813 %token BOX
   136814 %token CIRCLE
   136815 %token ELLIPSE
   136816 %token ARC
   136817 %token LINE
   136818 %token ARROW
   136819 %token MOVE
   136820 %token SPLINE
   136821 %token HEIGHT
   136822 %token RADIUS
   136823 %token WIDTH
   136824 %token DIAMETER
   136825 %token FROM
   136826 %token TO
   136827 %token AT
   136828 %token WITH
   136829 %token BY
   136830 %token THEN
   136831 %token SOLID
   136832 %token DOTTED
   136833 %token DASHED
   136834 %token CHOP
   136835 %token SAME
   136836 %token INVISIBLE
   136837 %token LJUST
   136838 %token RJUST
   136839 %token ABOVE
   136840 %token BELOW
   136841 %token OF
   136842 %token THE
   136843 %token WAY
   136844 %token BETWEEN
   136845 %token AND
   136846 %token HERE
   136847 %token DOT_N
   136848 %token DOT_E
   136849 %token DOT_W
   136850 %token DOT_S
   136851 %token DOT_NE
   136852 %token DOT_SE
   136853 %token DOT_NW
   136854 %token DOT_SW
   136855 %token DOT_C
   136856 %token DOT_START
   136857 %token DOT_END
   136858 %token DOT_X
   136859 %token DOT_Y
   136860 %token DOT_HT
   136861 %token DOT_WID
   136862 %token DOT_RAD
   136863 %token SIN
   136864 %token COS
   136865 %token ATAN2
   136866 %token LOG
   136867 %token EXP
   136868 %token SQRT
   136869 %token K_MAX
   136870 %token K_MIN
   136871 %token INT
   136872 %token RAND
   136873 %token SRAND
   136874 %token COPY
   136875 %token THROUGH
   136876 %token TOP
   136877 %token BOTTOM
   136878 %token UPPER
   136879 %token LOWER
   136880 %token SH
   136881 %token PRINT
   136882 %token CW
   136883 %token CCW
   136884 %token FOR
   136885 %token DO
   136886 %token IF
   136887 %token ELSE
   136888 %token ANDAND
   136889 %token OROR
   136890 %token NOTEQUAL
   136891 %token EQUALEQUAL
   136892 %token LESSEQUAL
   136893 %token GREATEREQUAL
   136894 %token LEFT_CORNER
   136895 %token RIGHT_CORNER
   136896 %token NORTH
   136897 %token SOUTH
   136898 %token EAST
   136899 %token WEST
   136900 %token CENTER
   136901 %token END
   136902 %token START
   136903 %token RESET
   136904 %token UNTIL
   136905 %token PLOT
   136906 %token THICKNESS
   136907 %token FILL
   136908 %token COLORED
   136909 %token OUTLINED
   136910 %token SHADED
   136911 %token ALIGNED
   136912 %token SPRINTF
   136913 %token COMMAND
   136914 
   136915 %left '.'
   136916 
   136917 /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
   136918 %left PLOT
   136919 %left TEXT SPRINTF
   136920 
   136921 /* give text adjustments higher precedence than TEXT, so that
   136922 box "foo" above ljust == box ("foo" above ljust)
   136923 */
   136924 
   136925 %left LJUST RJUST ABOVE BELOW
   136926 
   136927 %left LEFT RIGHT
   136928 /* Give attributes that take an optional expression a higher
   136929 precedence than left and right, so that eg `line chop left'
   136930 parses properly. */
   136931 %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
   136932 %left LABEL
   136933 
   136934 %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
   136935 %left ORDINAL HERE '`'
   136936 
   136937 %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */
   136938 
   136939 /* these need to be lower than '-' */
   136940 %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS
   136941 
   136942 /* these must have higher precedence than CHOP so that `label %prec CHOP'
   136943 works */
   136944 %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
   136945 %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
   136946 %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END
   136947 
   136948 %left ','
   136949 %left OROR
   136950 %left ANDAND
   136951 %left EQUALEQUAL NOTEQUAL
   136952 %left '<' '>' LESSEQUAL GREATEREQUAL
   136953 
   136954 %left BETWEEN OF
   136955 %left AND
   136956 
   136957 %left '+' '-'
   136958 %left '*' '/' '%'
   136959 %right '!'
   136960 %right '^'
   136961 
   136962 
   136963 %%
   136964 
   136965 
   136966 top:
   136967 	optional_separator
   136968 	| element_list
   136969 	;
   136970 
   136971 element_list:
   136972 	optional_separator middle_element_list optional_separator
   136973 	;
   136974 
   136975 middle_element_list:
   136976 	element
   136977 	| middle_element_list separator element
   136978 	;
   136979 
   136980 optional_separator:
   136981 	/* empty */
   136982 	| separator
   136983 	;
   136984 
   136985 separator:
   136986 	';'
   136987 	| separator ';'
   136988 	;
   136989 
   136990 placeless_element:
   136991 	VARIABLE '=' any_expr
   136992 	| VARIABLE ':' '=' any_expr
   136993 	| UP
   136994 	| DOWN
   136995 	| LEFT
   136996 	| RIGHT
   136997 	| COMMAND_LINE
   136998 	| COMMAND print_args
   136999 	| PRINT print_args
   137000 	| SH
   137001 		{}
   137002 	  DELIMITED
   137003 	| COPY TEXT
   137004 	| COPY TEXT THROUGH
   137005 		{}
   137006 	  DELIMITED
   137007 		{}
   137008 	  until
   137009 	| COPY THROUGH
   137010 		{}
   137011 	  DELIMITED
   137012 		{}
   137013 	  until
   137014 	| FOR VARIABLE '=' expr TO expr optional_by DO
   137015 		{}
   137016 	  DELIMITED
   137017 	| simple_if
   137018 	| simple_if ELSE
   137019 		{}
   137020 	  DELIMITED
   137021 	| reset_variables
   137022 	| RESET
   137023 	;
   137024 
   137025 reset_variables:
   137026 	RESET VARIABLE
   137027 	| reset_variables VARIABLE
   137028 	| reset_variables ',' VARIABLE
   137029 	;
   137030 
   137031 print_args:
   137032 	print_arg
   137033 	| print_args print_arg
   137034 	;
   137035 
   137036 print_arg:
   137037 	expr							%prec ','
   137038 	| text
   137039 	| position						%prec ','
   137040 	;
   137041 
   137042 simple_if:
   137043 	IF any_expr THEN
   137044 		{}
   137045 	DELIMITED
   137046 	;
   137047 
   137048 until:
   137049 	/* empty */
   137050 	| UNTIL TEXT
   137051 	;
   137052 
   137053 any_expr:
   137054 	expr
   137055 	| text_expr
   137056 	;
   137057 
   137058 text_expr:
   137059 	text EQUALEQUAL text
   137060 	| text NOTEQUAL text
   137061 	| text_expr ANDAND text_expr
   137062 	| text_expr ANDAND expr
   137063 	| expr ANDAND text_expr
   137064 	| text_expr OROR text_expr
   137065 	| text_expr OROR expr
   137066 	| expr OROR text_expr
   137067 	| '!' text_expr
   137068 	;
   137069 
   137070 optional_by:
   137071 	/* empty */
   137072 	| BY expr
   137073 	| BY '*' expr
   137074 	;
   137075 
   137076 element:
   137077 	object_spec
   137078 	| LABEL ':' optional_separator element
   137079 	| LABEL ':' optional_separator position_not_place
   137080 	| LABEL ':' optional_separator place
   137081 	| '{' {} element_list '}'
   137082 		{}
   137083 	  optional_element
   137084 	| placeless_element
   137085 	;
   137086 
   137087 optional_element:
   137088 	/* empty */
   137089 	| element
   137090 	;
   137091 
   137092 object_spec:
   137093 	BOX
   137094 	| CIRCLE
   137095 	| ELLIPSE
   137096 	| ARC
   137097 	| LINE
   137098 	| ARROW
   137099 	| MOVE
   137100 	| SPLINE
   137101 	| text							%prec TEXT
   137102 	| PLOT expr
   137103 	| PLOT expr text
   137104 	| '['
   137105 		{}
   137106 	  element_list ']'
   137107 	| object_spec HEIGHT expr
   137108 	| object_spec RADIUS expr
   137109 	| object_spec WIDTH expr
   137110 	| object_spec DIAMETER expr
   137111 	| object_spec expr					%prec HEIGHT
   137112 	| object_spec UP
   137113 	| object_spec UP expr
   137114 	| object_spec DOWN
   137115 	| object_spec DOWN expr
   137116 	| object_spec RIGHT
   137117 	| object_spec RIGHT expr
   137118 	| object_spec LEFT
   137119 	| object_spec LEFT expr
   137120 	| object_spec FROM position
   137121 	| object_spec TO position
   137122 	| object_spec AT position
   137123 	| object_spec WITH path
   137124 	| object_spec WITH position				%prec ','
   137125 	| object_spec BY expr_pair
   137126 	| object_spec THEN
   137127 	| object_spec SOLID
   137128 	| object_spec DOTTED
   137129 	| object_spec DOTTED expr
   137130 	| object_spec DASHED
   137131 	| object_spec DASHED expr
   137132 	| object_spec FILL
   137133 	| object_spec FILL expr
   137134 	| object_spec SHADED text
   137135 	| object_spec COLORED text
   137136 	| object_spec OUTLINED text
   137137 	| object_spec CHOP
   137138 	| object_spec CHOP expr
   137139 	| object_spec SAME
   137140 	| object_spec INVISIBLE
   137141 	| object_spec LEFT_ARROW_HEAD
   137142 	| object_spec RIGHT_ARROW_HEAD
   137143 	| object_spec DOUBLE_ARROW_HEAD
   137144 	| object_spec CW
   137145 	| object_spec CCW
   137146 	| object_spec text					%prec TEXT
   137147 	| object_spec LJUST
   137148 	| object_spec RJUST
   137149 	| object_spec ABOVE
   137150 	| object_spec BELOW
   137151 	| object_spec THICKNESS expr
   137152 	| object_spec ALIGNED
   137153 	;
   137154 
   137155 text:
   137156 	TEXT
   137157 	| SPRINTF '(' TEXT sprintf_args ')'
   137158 	;
   137159 
   137160 sprintf_args:
   137161 	/* empty */
   137162 	| sprintf_args ',' expr
   137163 	;
   137164 
   137165 position:
   137166 	position_not_place
   137167 	| place
   137168 	;
   137169 
   137170 position_not_place:
   137171 	expr_pair
   137172 	| position '+' expr_pair
   137173 	| position '-' expr_pair
   137174 	| '(' position ',' position ')'
   137175 	| expr between position AND position
   137176 	| expr '<' position ',' position '>'
   137177 	;
   137178 
   137179 between:
   137180 	BETWEEN
   137181 	| OF THE WAY BETWEEN
   137182 	;
   137183 
   137184 expr_pair:
   137185 	expr ',' expr
   137186 	| '(' expr_pair ')'
   137187 	;
   137188 
   137189 place:
   137190 	/* line at A left == line (at A) left */
   137191 	label							%prec CHOP
   137192 	| label corner
   137193 	| corner label
   137194 	| corner OF label
   137195 	| HERE
   137196 	;
   137197 
   137198 label:
   137199 	LABEL
   137200 	| nth_primitive
   137201 	| label '.' LABEL
   137202 	;
   137203 
   137204 ordinal:
   137205 	ORDINAL
   137206 	| '`' any_expr TH
   137207 	;
   137208 
   137209 optional_ordinal_last:
   137210 	LAST
   137211 	| ordinal LAST
   137212 	;
   137213 
   137214 nth_primitive:
   137215 	ordinal object_type
   137216 	| optional_ordinal_last object_type
   137217 	;
   137218 
   137219 object_type:
   137220 	BOX
   137221 	| CIRCLE
   137222 	| ELLIPSE
   137223 	| ARC
   137224 	| LINE
   137225 	| ARROW
   137226 	| SPLINE
   137227 	| '[' ']'
   137228 	| TEXT
   137229 	;
   137230 
   137231 label_path:
   137232 	'.' LABEL
   137233 	| label_path '.' LABEL
   137234 	;
   137235 
   137236 relative_path:
   137237 	corner							%prec CHOP
   137238 	/* give this a lower precedence than LEFT and RIGHT so that
   137239 	   [A: box] with .A left == [A: box] with (.A left) */
   137240 	| label_path						%prec TEXT
   137241 	| label_path corner
   137242 	;
   137243 
   137244 path:
   137245 	relative_path
   137246 	| '(' relative_path ',' relative_path ')'
   137247 		{}
   137248 	/* The rest of these rules are a compatibility sop. */
   137249 	| ORDINAL LAST object_type relative_path
   137250 	| LAST object_type relative_path
   137251 	| ORDINAL object_type relative_path
   137252 	| LABEL relative_path
   137253 	;
   137254 
   137255 corner:
   137256 	DOT_N
   137257 	| DOT_E
   137258 	| DOT_W
   137259 	| DOT_S
   137260 	| DOT_NE
   137261 	| DOT_SE
   137262 	| DOT_NW
   137263 	| DOT_SW
   137264 	| DOT_C
   137265 	| DOT_START
   137266 	| DOT_END
   137267 	| TOP
   137268 	| BOTTOM
   137269 	| LEFT
   137270 	| RIGHT
   137271 	| UPPER LEFT
   137272 	| LOWER LEFT
   137273 	| UPPER RIGHT
   137274 	| LOWER RIGHT
   137275 	| LEFT_CORNER
   137276 	| RIGHT_CORNER
   137277 	| UPPER LEFT_CORNER
   137278 	| LOWER LEFT_CORNER
   137279 	| UPPER RIGHT_CORNER
   137280 	| LOWER RIGHT_CORNER
   137281 	| NORTH
   137282 	| SOUTH
   137283 	| EAST
   137284 	| WEST
   137285 	| CENTER
   137286 	| START
   137287 	| END
   137288 	;
   137289 
   137290 expr:
   137291 	VARIABLE
   137292 	| NUMBER
   137293 	| place DOT_X
   137294 	| place DOT_Y
   137295 	| place DOT_HT
   137296 	| place DOT_WID
   137297 	| place DOT_RAD
   137298 	| expr '+' expr
   137299 	| expr '-' expr
   137300 	| expr '*' expr
   137301 	| expr '/' expr
   137302 	| expr '%' expr
   137303 	| expr '^' expr
   137304 	| '-' expr						%prec '!'
   137305 	| '(' any_expr ')'
   137306 	| SIN '(' any_expr ')'
   137307 	| COS '(' any_expr ')'
   137308 	| ATAN2 '(' any_expr ',' any_expr ')'
   137309 	| LOG '(' any_expr ')'
   137310 	| EXP '(' any_expr ')'
   137311 	| SQRT '(' any_expr ')'
   137312 	| K_MAX '(' any_expr ',' any_expr ')'
   137313 	| K_MIN '(' any_expr ',' any_expr ')'
   137314 	| INT '(' any_expr ')'
   137315 	| RAND '(' any_expr ')'
   137316 	| RAND '(' ')'
   137317 	| SRAND '(' any_expr ')'
   137318 	| expr '<' expr
   137319 	| expr LESSEQUAL expr
   137320 	| expr '>' expr
   137321 	| expr GREATEREQUAL expr
   137322 	| expr EQUALEQUAL expr
   137323 	| expr NOTEQUAL expr
   137324 	| expr ANDAND expr
   137325 	| expr OROR expr
   137326 	| '!' expr
   137327 	;
   137328 
   137329 
   137330 %%
   137331 #include <stdio.h>
   137332 /* A C error reporting function.  */
   137333 static
   137334 void yyerror ( const char *msg)
   137335 {
   137336   fprintf (stderr, "%s\n", msg);
   137337 }
   137338 static int
   137339 yylex (void)
   137340 {
   137341   static int const input[] = {
   137342     VARIABLE, '=', LABEL, LEFT, DOT_X, 0
   137343   };
   137344   static int const *inputp = input;
   137345   return *inputp++;
   137346 }
   137347 
   137348 int
   137349 main (void)
   137350 {
   137351   return yyparse ();
   137352 }
   137353 _ATEOF
   137354 
   137355 
   137356 
   137357 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   137358 # expanding macros, so it corrupts some special characters in the
   137359 # macros.  To avoid this, expand now and pass it the result with proper
   137360 # string quotation.  Assume args 7 through 12 expand to properly quoted
   137361 # strings.
   137362 
   137363 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   137364   at_save_special_files
   137365   mkdir xml-tests
   137366     # Don't combine these Bison invocations since we want to be sure that
   137367   # --report=all isn't required to get the full XML file.
   137368   { set +x
   137369 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   137370                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y"
   137371 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   137372 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   137373                   --graph=xml-tests/test.dot --report=all --defines -o input.c input.y
   137374 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137375 at_status=$? at_failed=false
   137376 $at_check_filter
   137377 echo stderr:; cat "$at_stderr"
   137378 echo stdout:; cat "$at_stdout"
   137379 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137380 $at_failed && at_fn_log_failure
   137381 $at_traceon; }
   137382 
   137383   { set +x
   137384 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y"
   137385 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:1403"
   137386 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y
   137387 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137388 at_status=$? at_failed=false
   137389 $at_check_filter
   137390 echo stderr:; cat "$at_stderr"
   137391 echo stdout:; cat "$at_stdout"
   137392 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137393 $at_failed && at_fn_log_failure
   137394 $at_traceon; }
   137395 
   137396     cp xml-tests/test.output expout
   137397   { set +x
   137398 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   137399              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   137400              xml-tests/test.xml"
   137401 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   137402 ( $at_check_trace; $XSLTPROC \
   137403              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   137404              xml-tests/test.xml
   137405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137406 at_status=$? at_failed=false
   137407 $at_check_filter
   137408 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137409 $at_diff expout "$at_stdout" || at_failed=:
   137410 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137411 $at_failed && at_fn_log_failure
   137412 $at_traceon; }
   137413 
   137414   sort xml-tests/test.dot > expout
   137415   { set +x
   137416 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   137417              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   137418              xml-tests/test.xml | sort"
   137419 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   137420 ( $at_check_trace; $XSLTPROC \
   137421              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   137422              xml-tests/test.xml | sort
   137423 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137424 at_status=$? at_failed=false
   137425 $at_check_filter
   137426 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137427 $at_diff expout "$at_stdout" || at_failed=:
   137428 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137429 $at_failed && at_fn_log_failure
   137430 $at_traceon; }
   137431 
   137432   rm -rf xml-tests expout
   137433   at_restore_special_files
   137434 fi
   137435 { set +x
   137436 $as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y"
   137437 at_fn_check_prepare_trace "existing.at:1403"
   137438 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   137439 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137440 at_status=$? at_failed=false
   137441 $at_check_filter
   137442 echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
   137443 " | \
   137444   $at_diff - "$at_stderr" || at_failed=:
   137445 at_fn_diff_devnull "$at_stdout" || at_failed=:
   137446 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137447 $at_failed && at_fn_log_failure
   137448 $at_traceon; }
   137449 
   137450 # Defining POSIXLY_CORRECT causes bison to complain if options are
   137451 # added after the grammar file name, so skip these checks in that
   137452 # case.
   137453 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   137454   at_save_special_files
   137455 
   137456   # To avoid expanding it repeatedly, store specified stdout.
   137457   : >expout
   137458 
   137459   # Run with -Werror.
   137460   { set +x
   137461 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror"
   137462 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403"
   137463 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror
   137464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137465 at_status=$? at_failed=false
   137466 $at_check_filter
   137467 echo stderr:; tee stderr <"$at_stderr"
   137468 $at_diff expout "$at_stdout" || at_failed=:
   137469 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   137470 $at_failed && at_fn_log_failure
   137471 $at_traceon; }
   137472 
   137473 
   137474   # Build expected stderr up to and including the "warnings being
   137475   # treated as errors" message.
   137476   cat >at-bison-check-warnings <<'_ATEOF'
   137477 input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
   137478 _ATEOF
   137479 
   137480   at_bison_check_first=`sed -n \
   137481     '/: warning: /{=;q;}' at-bison-check-warnings`
   137482   : ${at_bison_check_first:=1}
   137483   at_bison_check_first_tmp=`sed -n \
   137484     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   137485   : ${at_bison_check_first_tmp:=1}
   137486   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   137487     at_bison_check_first=$at_bison_check_first_tmp
   137488   fi
   137489   if test $at_bison_check_first -gt 1; then
   137490     sed -n "1,`expr $at_bison_check_first - 1`"p \
   137491       at-bison-check-warnings > experr
   137492   fi
   137493   echo 'bison: warnings being treated as errors' >> experr
   137494 
   137495   # Finish building expected stderr and check.  Unlike warnings,
   137496   # complaints cause bison to exit early.  Thus, with -Werror, bison
   137497   # does not necessarily report all warnings that it does without
   137498   # -Werror, but it at least reports one.
   137499   at_bison_check_last=`sed -n '$=' stderr`
   137500   : ${at_bison_check_last:=1}
   137501   at_bison_check_last=`expr $at_bison_check_last - 1`
   137502   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   137503     at-bison-check-warnings >> experr
   137504   { set +x
   137505 $as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   137506               stderr 1>&2"
   137507 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   137508 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   137509               stderr 1>&2
   137510 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137511 at_status=$? at_failed=false
   137512 $at_check_filter
   137513 $at_diff experr "$at_stderr" || at_failed=:
   137514 at_fn_diff_devnull "$at_stdout" || at_failed=:
   137515 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137516 $at_failed && at_fn_log_failure
   137517 $at_traceon; }
   137518 
   137519 
   137520   # Now check --warnings=error.
   137521   cp stderr experr
   137522   { set +x
   137523 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error"
   137524 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403"
   137525 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error
   137526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137527 at_status=$? at_failed=false
   137528 $at_check_filter
   137529 $at_diff experr "$at_stderr" || at_failed=:
   137530 $at_diff expout "$at_stdout" || at_failed=:
   137531 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   137532 $at_failed && at_fn_log_failure
   137533 $at_traceon; }
   137534 
   137535 
   137536   # Now check -Wnone and --warnings=none by making sure that
   137537   # -Werror doesn't change the exit status when -Wnone or
   137538   # --warnings=none is specified.
   137539   { set +x
   137540 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror"
   137541 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403"
   137542 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror
   137543 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137544 at_status=$? at_failed=false
   137545 $at_check_filter
   137546 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137547 $at_diff expout "$at_stdout" || at_failed=:
   137548 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137549 $at_failed && at_fn_log_failure
   137550 $at_traceon; }
   137551 
   137552   { set +x
   137553 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror"
   137554 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403"
   137555 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror
   137556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137557 at_status=$? at_failed=false
   137558 $at_check_filter
   137559 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137560 $at_diff expout "$at_stdout" || at_failed=:
   137561 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137562 $at_failed && at_fn_log_failure
   137563 $at_traceon; }
   137564 
   137565 
   137566   at_restore_special_files
   137567 fi
   137568 
   137569 { set +x
   137570 $as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1"
   137571 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403"
   137572 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   137573 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137574 at_status=$? at_failed=false
   137575 $at_check_filter
   137576 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137577 echo >>"$at_stdout"; $as_echo "427
   137578 " | \
   137579   $at_diff - "$at_stdout" || at_failed=:
   137580 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137581 $at_failed && at_fn_log_failure
   137582 $at_traceon; }
   137583 
   137584 
   137585 { set +x
   137586 $as_echo "$at_srcdir/existing.at:1403: diff -u /dev/null /dev/null || exit 77"
   137587 at_fn_check_prepare_trace "existing.at:1403"
   137588 ( $at_check_trace; diff -u /dev/null /dev/null || exit 77
   137589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137590 at_status=$? at_failed=false
   137591 $at_check_filter
   137592 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137593 echo stdout:; cat "$at_stdout"
   137594 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137595 $at_failed && at_fn_log_failure
   137596 $at_traceon; }
   137597 
   137598 
   137599 { set +x
   137600 $as_echo "$at_srcdir/existing.at:1403: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
   137601 at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1403"
   137602 ( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
   137603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137604 at_status=$? at_failed=false
   137605 $at_check_filter
   137606 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137607 at_fn_diff_devnull "$at_stdout" || at_failed=:
   137608 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137609 $at_failed && at_fn_log_failure
   137610 $at_traceon; }
   137611 
   137612 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   137613   at_save_special_files
   137614   mkdir xml-tests
   137615     # Don't combine these Bison invocations since we want to be sure that
   137616   # --report=all isn't required to get the full XML file.
   137617   { set +x
   137618 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   137619                   --graph=xml-tests/test.dot --report=all input-lalr.y"
   137620 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   137621 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   137622                   --graph=xml-tests/test.dot --report=all input-lalr.y
   137623 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137624 at_status=$? at_failed=false
   137625 $at_check_filter
   137626 echo stderr:; cat "$at_stderr"
   137627 echo stdout:; cat "$at_stdout"
   137628 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137629 $at_failed && at_fn_log_failure
   137630 $at_traceon; }
   137631 
   137632   { set +x
   137633 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y"
   137634 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1403"
   137635 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y
   137636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137637 at_status=$? at_failed=false
   137638 $at_check_filter
   137639 echo stderr:; cat "$at_stderr"
   137640 echo stdout:; cat "$at_stdout"
   137641 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137642 $at_failed && at_fn_log_failure
   137643 $at_traceon; }
   137644 
   137645     cp xml-tests/test.output expout
   137646   { set +x
   137647 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   137648              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   137649              xml-tests/test.xml"
   137650 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   137651 ( $at_check_trace; $XSLTPROC \
   137652              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   137653              xml-tests/test.xml
   137654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137655 at_status=$? at_failed=false
   137656 $at_check_filter
   137657 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137658 $at_diff expout "$at_stdout" || at_failed=:
   137659 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137660 $at_failed && at_fn_log_failure
   137661 $at_traceon; }
   137662 
   137663   sort xml-tests/test.dot > expout
   137664   { set +x
   137665 $as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\
   137666              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   137667              xml-tests/test.xml | sort"
   137668 at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403"
   137669 ( $at_check_trace; $XSLTPROC \
   137670              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   137671              xml-tests/test.xml | sort
   137672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137673 at_status=$? at_failed=false
   137674 $at_check_filter
   137675 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137676 $at_diff expout "$at_stdout" || at_failed=:
   137677 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137678 $at_failed && at_fn_log_failure
   137679 $at_traceon; }
   137680 
   137681   rm -rf xml-tests expout
   137682   at_restore_special_files
   137683 fi
   137684 { set +x
   137685 $as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y"
   137686 at_fn_check_prepare_trace "existing.at:1403"
   137687 ( $at_check_trace; bison --report=all input-lalr.y
   137688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137689 at_status=$? at_failed=false
   137690 $at_check_filter
   137691 echo stderr:; cat "$at_stderr"
   137692 echo stdout:; cat "$at_stdout"
   137693 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   137694 $at_failed && at_fn_log_failure
   137695 $at_traceon; }
   137696 
   137697 
   137698 { set +x
   137699 $as_echo "$at_srcdir/existing.at:1403: diff -u input-lalr.output input.output \\
   137700            | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
   137701 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   137702 ( $at_check_trace; diff -u input-lalr.output input.output \
   137703            | sed -n '/^@@/,$p' | sed 's/^ $//'
   137704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   137705 at_status=$? at_failed=false
   137706 $at_check_filter
   137707 at_fn_diff_devnull "$at_stderr" || at_failed=:
   137708 echo >>"$at_stdout"; $as_echo "@@ -1223,7 +1223,7 @@
   137709      text_expr              go to state 112
   137710      text                   go to state 113
   137711      place                  go to state 114
   137712 -    label                  go to state 102
   137713 +    label                  go to state 423
   137714      ordinal                go to state 103
   137715      optional_ordinal_last  go to state 104
   137716      nth_primitive          go to state 105
   137717 @@ -1377,7 +1377,7 @@
   137718      '!'           shift, and go to state 94
   137719 
   137720      place                  go to state 114
   137721 -    label                  go to state 102
   137722 +    label                  go to state 423
   137723      ordinal                go to state 103
   137724      optional_ordinal_last  go to state 104
   137725      nth_primitive          go to state 105
   137726 @@ -1854,7 +1854,7 @@
   137727 
   137728      text                   go to state 162
   137729      place                  go to state 114
   137730 -    label                  go to state 102
   137731 +    label                  go to state 423
   137732      ordinal                go to state 103
   137733      optional_ordinal_last  go to state 104
   137734      nth_primitive          go to state 105
   137735 @@ -2047,7 +2047,7 @@
   137736      text_expr              go to state 112
   137737      text                   go to state 113
   137738      place                  go to state 114
   137739 -    label                  go to state 102
   137740 +    label                  go to state 423
   137741      ordinal                go to state 103
   137742      optional_ordinal_last  go to state 104
   137743      nth_primitive          go to state 105
   137744 @@ -2571,7 +2571,7 @@
   137745      position_not_place     go to state 99
   137746      expr_pair              go to state 191
   137747      place                  go to state 101
   137748 -    label                  go to state 102
   137749 +    label                  go to state 423
   137750      ordinal                go to state 103
   137751      optional_ordinal_last  go to state 104
   137752      nth_primitive          go to state 105
   137753 @@ -2732,7 +2732,7 @@
   137754      text_expr              go to state 112
   137755      text                   go to state 113
   137756      place                  go to state 114
   137757 -    label                  go to state 102
   137758 +    label                  go to state 423
   137759      ordinal                go to state 103
   137760      optional_ordinal_last  go to state 104
   137761      nth_primitive          go to state 105
   137762 @@ -2875,7 +2875,7 @@
   137763      '!'           shift, and go to state 94
   137764 
   137765      place                  go to state 114
   137766 -    label                  go to state 102
   137767 +    label                  go to state 423
   137768      ordinal                go to state 103
   137769      optional_ordinal_last  go to state 104
   137770      nth_primitive          go to state 105
   137771 @@ -3018,7 +3018,7 @@
   137772      '!'           shift, and go to state 94
   137773 
   137774      place                  go to state 114
   137775 -    label                  go to state 102
   137776 +    label                  go to state 423
   137777      ordinal                go to state 103
   137778      optional_ordinal_last  go to state 104
   137779      nth_primitive          go to state 105
   137780 @@ -3256,7 +3256,7 @@
   137781 
   137782  State 102
   137783 
   137784 -  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, '(', '\`', ',', '>', '+', '-', '!', ';', '}', ']', ')']
   137785 +  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, '(', '\`', '+', '-', '!', ';', '}', ']']
   137786    147      | label . corner
   137787    153 label: label . '.' LABEL
   137788    180 corner: . DOT_N
   137789 @@ -3645,7 +3645,7 @@
   137790      text_expr              go to state 112
   137791      text                   go to state 113
   137792      place                  go to state 114
   137793 -    label                  go to state 102
   137794 +    label                  go to state 423
   137795      ordinal                go to state 103
   137796      optional_ordinal_last  go to state 104
   137797      nth_primitive          go to state 105
   137798 @@ -3804,7 +3804,7 @@
   137799      text_expr              go to state 239
   137800      text                   go to state 113
   137801      place                  go to state 114
   137802 -    label                  go to state 102
   137803 +    label                  go to state 423
   137804      ordinal                go to state 103
   137805      optional_ordinal_last  go to state 104
   137806      nth_primitive          go to state 105
   137807 @@ -4481,7 +4481,7 @@
   137808      \$default  reduce using rule 89 (object_spec)
   137809 
   137810      place                  go to state 114
   137811 -    label                  go to state 102
   137812 +    label                  go to state 423
   137813      ordinal                go to state 103
   137814      optional_ordinal_last  go to state 104
   137815      nth_primitive          go to state 105
   137816 @@ -4673,7 +4673,7 @@
   137817      \$default  reduce using rule 91 (object_spec)
   137818 
   137819      place                  go to state 114
   137820 -    label                  go to state 102
   137821 +    label                  go to state 423
   137822      ordinal                go to state 103
   137823      optional_ordinal_last  go to state 104
   137824      nth_primitive          go to state 105
   137825 @@ -4867,7 +4867,7 @@
   137826      \$default  reduce using rule 95 (object_spec)
   137827 
   137828      place                  go to state 114
   137829 -    label                  go to state 102
   137830 +    label                  go to state 423
   137831      ordinal                go to state 103
   137832      optional_ordinal_last  go to state 104
   137833      nth_primitive          go to state 105
   137834 @@ -5065,7 +5065,7 @@
   137835      \$default  reduce using rule 93 (object_spec)
   137836 
   137837      place                  go to state 114
   137838 -    label                  go to state 102
   137839 +    label                  go to state 423
   137840      ordinal                go to state 103
   137841      optional_ordinal_last  go to state 104
   137842      nth_primitive          go to state 105
   137843 @@ -5260,7 +5260,7 @@
   137844      '!'           shift, and go to state 94
   137845 
   137846      place                  go to state 114
   137847 -    label                  go to state 102
   137848 +    label                  go to state 423
   137849      ordinal                go to state 103
   137850      optional_ordinal_last  go to state 104
   137851      nth_primitive          go to state 105
   137852 @@ -5403,7 +5403,7 @@
   137853      '!'           shift, and go to state 94
   137854 
   137855      place                  go to state 114
   137856 -    label                  go to state 102
   137857 +    label                  go to state 423
   137858      ordinal                go to state 103
   137859      optional_ordinal_last  go to state 104
   137860      nth_primitive          go to state 105
   137861 @@ -5546,7 +5546,7 @@
   137862      '!'           shift, and go to state 94
   137863 
   137864      place                  go to state 114
   137865 -    label                  go to state 102
   137866 +    label                  go to state 423
   137867      ordinal                go to state 103
   137868      optional_ordinal_last  go to state 104
   137869      nth_primitive          go to state 105
   137870 @@ -5689,7 +5689,7 @@
   137871      '!'           shift, and go to state 94
   137872 
   137873      place                  go to state 114
   137874 -    label                  go to state 102
   137875 +    label                  go to state 423
   137876      ordinal                go to state 103
   137877      optional_ordinal_last  go to state 104
   137878      nth_primitive          go to state 105
   137879 @@ -6475,7 +6475,7 @@
   137880 
   137881      expr_pair              go to state 280
   137882      place                  go to state 114
   137883 -    label                  go to state 102
   137884 +    label                  go to state 423
   137885      ordinal                go to state 103
   137886      optional_ordinal_last  go to state 104
   137887      nth_primitive          go to state 105
   137888 @@ -6633,7 +6633,7 @@
   137889      \$default  reduce using rule 105 (object_spec)
   137890 
   137891      place                  go to state 114
   137892 -    label                  go to state 102
   137893 +    label                  go to state 423
   137894      ordinal                go to state 103
   137895      optional_ordinal_last  go to state 104
   137896      nth_primitive          go to state 105
   137897 @@ -6825,7 +6825,7 @@
   137898      \$default  reduce using rule 107 (object_spec)
   137899 
   137900      place                  go to state 114
   137901 -    label                  go to state 102
   137902 +    label                  go to state 423
   137903      ordinal                go to state 103
   137904      optional_ordinal_last  go to state 104
   137905      nth_primitive          go to state 105
   137906 @@ -7017,7 +7017,7 @@
   137907      \$default  reduce using rule 114 (object_spec)
   137908 
   137909      place                  go to state 114
   137910 -    label                  go to state 102
   137911 +    label                  go to state 423
   137912      ordinal                go to state 103
   137913      optional_ordinal_last  go to state 104
   137914      nth_primitive          go to state 105
   137915 @@ -7264,7 +7264,7 @@
   137916      '!'           shift, and go to state 94
   137917 
   137918      place                  go to state 114
   137919 -    label                  go to state 102
   137920 +    label                  go to state 423
   137921      ordinal                go to state 103
   137922      optional_ordinal_last  go to state 104
   137923      nth_primitive          go to state 105
   137924 @@ -7408,7 +7408,7 @@
   137925      \$default  reduce using rule 109 (object_spec)
   137926 
   137927      place                  go to state 114
   137928 -    label                  go to state 102
   137929 +    label                  go to state 423
   137930      ordinal                go to state 103
   137931      optional_ordinal_last  go to state 104
   137932      nth_primitive          go to state 105
   137933 @@ -7819,12 +7819,12 @@
   137934      position_not_place     go to state 296
   137935      expr_pair              go to state 100
   137936      place                  go to state 297
   137937 -    label                  go to state 102
   137938 +    label                  go to state 423
   137939      ordinal                go to state 103
   137940      optional_ordinal_last  go to state 104
   137941      nth_primitive          go to state 105
   137942      corner                 go to state 106
   137943 -    expr                   go to state 266
   137944 +    expr                   go to state 424
   137945 
   137946 
   137947  State 165
   137948 @@ -7987,7 +7987,7 @@
   137949      text_expr              go to state 112
   137950      text                   go to state 113
   137951      place                  go to state 114
   137952 -    label                  go to state 102
   137953 +    label                  go to state 423
   137954      ordinal                go to state 103
   137955      optional_ordinal_last  go to state 104
   137956      nth_primitive          go to state 105
   137957 @@ -8172,7 +8172,7 @@
   137958      text_expr              go to state 112
   137959      text                   go to state 113
   137960      place                  go to state 114
   137961 -    label                  go to state 102
   137962 +    label                  go to state 423
   137963      ordinal                go to state 103
   137964      optional_ordinal_last  go to state 104
   137965      nth_primitive          go to state 105
   137966 @@ -8333,7 +8333,7 @@
   137967      text_expr              go to state 112
   137968      text                   go to state 113
   137969      place                  go to state 114
   137970 -    label                  go to state 102
   137971 +    label                  go to state 423
   137972      ordinal                go to state 103
   137973      optional_ordinal_last  go to state 104
   137974      nth_primitive          go to state 105
   137975 @@ -8494,7 +8494,7 @@
   137976      text_expr              go to state 112
   137977      text                   go to state 113
   137978      place                  go to state 114
   137979 -    label                  go to state 102
   137980 +    label                  go to state 423
   137981      ordinal                go to state 103
   137982      optional_ordinal_last  go to state 104
   137983      nth_primitive          go to state 105
   137984 @@ -8655,7 +8655,7 @@
   137985      text_expr              go to state 112
   137986      text                   go to state 113
   137987      place                  go to state 114
   137988 -    label                  go to state 102
   137989 +    label                  go to state 423
   137990      ordinal                go to state 103
   137991      optional_ordinal_last  go to state 104
   137992      nth_primitive          go to state 105
   137993 @@ -8816,7 +8816,7 @@
   137994      text_expr              go to state 112
   137995      text                   go to state 113
   137996      place                  go to state 114
   137997 -    label                  go to state 102
   137998 +    label                  go to state 423
   137999      ordinal                go to state 103
   138000      optional_ordinal_last  go to state 104
   138001      nth_primitive          go to state 105
   138002 @@ -8977,7 +8977,7 @@
   138003      text_expr              go to state 112
   138004      text                   go to state 113
   138005      place                  go to state 114
   138006 -    label                  go to state 102
   138007 +    label                  go to state 423
   138008      ordinal                go to state 103
   138009      optional_ordinal_last  go to state 104
   138010      nth_primitive          go to state 105
   138011 @@ -9138,7 +9138,7 @@
   138012      text_expr              go to state 112
   138013      text                   go to state 113
   138014      place                  go to state 114
   138015 -    label                  go to state 102
   138016 +    label                  go to state 423
   138017      ordinal                go to state 103
   138018      optional_ordinal_last  go to state 104
   138019      nth_primitive          go to state 105
   138020 @@ -9299,7 +9299,7 @@
   138021      text_expr              go to state 112
   138022      text                   go to state 113
   138023      place                  go to state 114
   138024 -    label                  go to state 102
   138025 +    label                  go to state 423
   138026      ordinal                go to state 103
   138027      optional_ordinal_last  go to state 104
   138028      nth_primitive          go to state 105
   138029 @@ -9460,7 +9460,7 @@
   138030      text_expr              go to state 112
   138031      text                   go to state 113
   138032      place                  go to state 114
   138033 -    label                  go to state 102
   138034 +    label                  go to state 423
   138035      ordinal                go to state 103
   138036      optional_ordinal_last  go to state 104
   138037      nth_primitive          go to state 105
   138038 @@ -9623,7 +9623,7 @@
   138039      text_expr              go to state 112
   138040      text                   go to state 113
   138041      place                  go to state 114
   138042 -    label                  go to state 102
   138043 +    label                  go to state 423
   138044      ordinal                go to state 103
   138045      optional_ordinal_last  go to state 104
   138046      nth_primitive          go to state 105
   138047 @@ -9784,7 +9784,7 @@
   138048      text_expr              go to state 112
   138049      text                   go to state 113
   138050      place                  go to state 114
   138051 -    label                  go to state 102
   138052 +    label                  go to state 423
   138053      ordinal                go to state 103
   138054      optional_ordinal_last  go to state 104
   138055      nth_primitive          go to state 105
   138056 @@ -9921,7 +9921,7 @@
   138057 
   138058      \$default  reduce using rule 47 (any_expr)
   138059 
   138060 -    between  go to state 237
   138061 +    between  go to state 425
   138062 
   138063 
   138064  State 193
   138065 @@ -10152,7 +10152,7 @@
   138066 
   138067      expr_pair              go to state 317
   138068      place                  go to state 114
   138069 -    label                  go to state 102
   138070 +    label                  go to state 423
   138071      ordinal                go to state 103
   138072      optional_ordinal_last  go to state 104
   138073      nth_primitive          go to state 105
   138074 @@ -10298,7 +10298,7 @@
   138075 
   138076      expr_pair              go to state 318
   138077      place                  go to state 114
   138078 -    label                  go to state 102
   138079 +    label                  go to state 423
   138080      ordinal                go to state 103
   138081      optional_ordinal_last  go to state 104
   138082      nth_primitive          go to state 105
   138083 @@ -10622,7 +10622,7 @@
   138084      '!'           shift, and go to state 94
   138085 
   138086      place                  go to state 114
   138087 -    label                  go to state 102
   138088 +    label                  go to state 423
   138089      ordinal                go to state 103
   138090      optional_ordinal_last  go to state 104
   138091      nth_primitive          go to state 105
   138092 @@ -10765,7 +10765,7 @@
   138093      '!'           shift, and go to state 94
   138094 
   138095      place                  go to state 114
   138096 -    label                  go to state 102
   138097 +    label                  go to state 423
   138098      ordinal                go to state 103
   138099      optional_ordinal_last  go to state 104
   138100      nth_primitive          go to state 105
   138101 @@ -10908,7 +10908,7 @@
   138102      '!'           shift, and go to state 94
   138103 
   138104      place                  go to state 114
   138105 -    label                  go to state 102
   138106 +    label                  go to state 423
   138107      ordinal                go to state 103
   138108      optional_ordinal_last  go to state 104
   138109      nth_primitive          go to state 105
   138110 @@ -11051,7 +11051,7 @@
   138111      '!'           shift, and go to state 94
   138112 
   138113      place                  go to state 114
   138114 -    label                  go to state 102
   138115 +    label                  go to state 423
   138116      ordinal                go to state 103
   138117      optional_ordinal_last  go to state 104
   138118      nth_primitive          go to state 105
   138119 @@ -11194,7 +11194,7 @@
   138120      '!'           shift, and go to state 94
   138121 
   138122      place                  go to state 114
   138123 -    label                  go to state 102
   138124 +    label                  go to state 423
   138125      ordinal                go to state 103
   138126      optional_ordinal_last  go to state 104
   138127      nth_primitive          go to state 105
   138128 @@ -11337,7 +11337,7 @@
   138129      '!'           shift, and go to state 94
   138130 
   138131      place                  go to state 114
   138132 -    label                  go to state 102
   138133 +    label                  go to state 423
   138134      ordinal                go to state 103
   138135      optional_ordinal_last  go to state 104
   138136      nth_primitive          go to state 105
   138137 @@ -11480,7 +11480,7 @@
   138138      '!'           shift, and go to state 94
   138139 
   138140      place                  go to state 114
   138141 -    label                  go to state 102
   138142 +    label                  go to state 423
   138143      ordinal                go to state 103
   138144      optional_ordinal_last  go to state 104
   138145      nth_primitive          go to state 105
   138146 @@ -11637,7 +11637,7 @@
   138147      position_not_place     go to state 99
   138148      expr_pair              go to state 100
   138149      place                  go to state 101
   138150 -    label                  go to state 102
   138151 +    label                  go to state 423
   138152      ordinal                go to state 103
   138153      optional_ordinal_last  go to state 104
   138154      nth_primitive          go to state 105
   138155 @@ -11780,7 +11780,7 @@
   138156      '!'           shift, and go to state 94
   138157 
   138158      place                  go to state 114
   138159 -    label                  go to state 102
   138160 +    label                  go to state 423
   138161      ordinal                go to state 103
   138162      optional_ordinal_last  go to state 104
   138163      nth_primitive          go to state 105
   138164 @@ -11923,7 +11923,7 @@
   138165      '!'           shift, and go to state 94
   138166 
   138167      place                  go to state 114
   138168 -    label                  go to state 102
   138169 +    label                  go to state 423
   138170      ordinal                go to state 103
   138171      optional_ordinal_last  go to state 104
   138172      nth_primitive          go to state 105
   138173 @@ -12066,7 +12066,7 @@
   138174      '!'           shift, and go to state 94
   138175 
   138176      place                  go to state 114
   138177 -    label                  go to state 102
   138178 +    label                  go to state 423
   138179      ordinal                go to state 103
   138180      optional_ordinal_last  go to state 104
   138181      nth_primitive          go to state 105
   138182 @@ -12209,7 +12209,7 @@
   138183      '!'           shift, and go to state 94
   138184 
   138185      place                  go to state 114
   138186 -    label                  go to state 102
   138187 +    label                  go to state 423
   138188      ordinal                go to state 103
   138189      optional_ordinal_last  go to state 104
   138190      nth_primitive          go to state 105
   138191 @@ -12352,7 +12352,7 @@
   138192      '!'           shift, and go to state 94
   138193 
   138194      place                  go to state 114
   138195 -    label                  go to state 102
   138196 +    label                  go to state 423
   138197      ordinal                go to state 103
   138198      optional_ordinal_last  go to state 104
   138199      nth_primitive          go to state 105
   138200 @@ -12495,7 +12495,7 @@
   138201      '!'           shift, and go to state 94
   138202 
   138203      place                  go to state 114
   138204 -    label                  go to state 102
   138205 +    label                  go to state 423
   138206      ordinal                go to state 103
   138207      optional_ordinal_last  go to state 104
   138208      nth_primitive          go to state 105
   138209 @@ -12638,7 +12638,7 @@
   138210      '!'           shift, and go to state 94
   138211 
   138212      place                  go to state 114
   138213 -    label                  go to state 102
   138214 +    label                  go to state 423
   138215      ordinal                go to state 103
   138216      optional_ordinal_last  go to state 104
   138217      nth_primitive          go to state 105
   138218 @@ -12794,12 +12794,12 @@
   138219      position_not_place     go to state 99
   138220      expr_pair              go to state 100
   138221      place                  go to state 101
   138222 -    label                  go to state 102
   138223 +    label                  go to state 423
   138224      ordinal                go to state 103
   138225      optional_ordinal_last  go to state 104
   138226      nth_primitive          go to state 105
   138227      corner                 go to state 106
   138228 -    expr                   go to state 266
   138229 +    expr                   go to state 424
   138230 
   138231 
   138232  State 238
   138233 @@ -12937,7 +12937,7 @@
   138234      '!'           shift, and go to state 94
   138235 
   138236      place                  go to state 114
   138237 -    label                  go to state 102
   138238 +    label                  go to state 423
   138239      ordinal                go to state 103
   138240      optional_ordinal_last  go to state 104
   138241      nth_primitive          go to state 105
   138242 @@ -13160,7 +13160,7 @@
   138243      text_expr              go to state 342
   138244      text                   go to state 113
   138245      place                  go to state 114
   138246 -    label                  go to state 102
   138247 +    label                  go to state 423
   138248      ordinal                go to state 103
   138249      optional_ordinal_last  go to state 104
   138250      nth_primitive          go to state 105
   138251 @@ -13319,7 +13319,7 @@
   138252      text_expr              go to state 344
   138253      text                   go to state 113
   138254      place                  go to state 114
   138255 -    label                  go to state 102
   138256 +    label                  go to state 423
   138257      ordinal                go to state 103
   138258      optional_ordinal_last  go to state 104
   138259      nth_primitive          go to state 105
   138260 @@ -13502,7 +13502,7 @@
   138261      text_expr              go to state 348
   138262      text                   go to state 113
   138263      place                  go to state 114
   138264 -    label                  go to state 102
   138265 +    label                  go to state 423
   138266      ordinal                go to state 103
   138267      optional_ordinal_last  go to state 104
   138268      nth_primitive          go to state 105
   138269 @@ -13661,7 +13661,7 @@
   138270      text_expr              go to state 350
   138271      text                   go to state 113
   138272      place                  go to state 114
   138273 -    label                  go to state 102
   138274 +    label                  go to state 423
   138275      ordinal                go to state 103
   138276      optional_ordinal_last  go to state 104
   138277      nth_primitive          go to state 105
   138278 @@ -13804,7 +13804,7 @@
   138279      '!'           shift, and go to state 94
   138280 
   138281      place                  go to state 114
   138282 -    label                  go to state 102
   138283 +    label                  go to state 423
   138284      ordinal                go to state 103
   138285      optional_ordinal_last  go to state 104
   138286      nth_primitive          go to state 105
   138287 @@ -14747,7 +14747,7 @@
   138288      position_not_place     go to state 99
   138289      expr_pair              go to state 191
   138290      place                  go to state 101
   138291 -    label                  go to state 102
   138292 +    label                  go to state 423
   138293      ordinal                go to state 103
   138294      optional_ordinal_last  go to state 104
   138295      nth_primitive          go to state 105
   138296 @@ -15074,7 +15074,7 @@
   138297      text                   go to state 113
   138298      expr_pair              go to state 365
   138299      place                  go to state 114
   138300 -    label                  go to state 102
   138301 +    label                  go to state 423
   138302      ordinal                go to state 103
   138303      optional_ordinal_last  go to state 104
   138304      nth_primitive          go to state 105
   138305 @@ -15693,12 +15693,12 @@
   138306      position_not_place     go to state 99
   138307      expr_pair              go to state 100
   138308      place                  go to state 101
   138309 -    label                  go to state 102
   138310 +    label                  go to state 423
   138311      ordinal                go to state 103
   138312      optional_ordinal_last  go to state 104
   138313      nth_primitive          go to state 105
   138314      corner                 go to state 106
   138315 -    expr                   go to state 266
   138316 +    expr                   go to state 424
   138317 
   138318 
   138319  State 315
   138320 @@ -16124,7 +16124,7 @@
   138321 
   138322      \$default  reduce using rule 239 (expr)
   138323 
   138324 -    between  go to state 237
   138325 +    between  go to state 425
   138326 
   138327      Conflict between rule 239 and token OF resolved as shift ('<' < OF).
   138328      Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN).
   138329 @@ -17234,7 +17234,7 @@
   138330      text_expr              go to state 112
   138331      text                   go to state 113
   138332      place                  go to state 114
   138333 -    label                  go to state 102
   138334 +    label                  go to state 423
   138335      ordinal                go to state 103
   138336      optional_ordinal_last  go to state 104
   138337      nth_primitive          go to state 105
   138338 @@ -17416,7 +17416,7 @@
   138339      text_expr              go to state 112
   138340      text                   go to state 113
   138341      place                  go to state 114
   138342 -    label                  go to state 102
   138343 +    label                  go to state 423
   138344      ordinal                go to state 103
   138345      optional_ordinal_last  go to state 104
   138346      nth_primitive          go to state 105
   138347 @@ -17577,7 +17577,7 @@
   138348      text_expr              go to state 112
   138349      text                   go to state 113
   138350      place                  go to state 114
   138351 -    label                  go to state 102
   138352 +    label                  go to state 423
   138353      ordinal                go to state 103
   138354      optional_ordinal_last  go to state 104
   138355      nth_primitive          go to state 105
   138356 @@ -17772,12 +17772,12 @@
   138357      position_not_place     go to state 99
   138358      expr_pair              go to state 100
   138359      place                  go to state 101
   138360 -    label                  go to state 102
   138361 +    label                  go to state 423
   138362      ordinal                go to state 103
   138363      optional_ordinal_last  go to state 104
   138364      nth_primitive          go to state 105
   138365      corner                 go to state 106
   138366 -    expr                   go to state 266
   138367 +    expr                   go to state 424
   138368 
   138369 
   138370  State 383
   138371 @@ -18071,7 +18071,7 @@
   138372      '!'           shift, and go to state 94
   138373 
   138374      place                  go to state 114
   138375 -    label                  go to state 102
   138376 +    label                  go to state 423
   138377      ordinal                go to state 103
   138378      optional_ordinal_last  go to state 104
   138379      nth_primitive          go to state 105
   138380 @@ -18221,7 +18221,7 @@
   138381      '!'           shift, and go to state 94
   138382 
   138383      place                  go to state 114
   138384 -    label                  go to state 102
   138385 +    label                  go to state 423
   138386      ordinal                go to state 103
   138387      optional_ordinal_last  go to state 104
   138388      nth_primitive          go to state 105
   138389 @@ -18830,7 +18830,7 @@
   138390      '!'           shift, and go to state 94
   138391 
   138392      place                  go to state 114
   138393 -    label                  go to state 102
   138394 +    label                  go to state 423
   138395      ordinal                go to state 103
   138396      optional_ordinal_last  go to state 104
   138397      nth_primitive          go to state 105
   138398 @@ -18987,7 +18987,7 @@
   138399      '!'           shift, and go to state 94
   138400 
   138401      place                  go to state 114
   138402 -    label                  go to state 102
   138403 +    label                  go to state 423
   138404      ordinal                go to state 103
   138405      optional_ordinal_last  go to state 104
   138406      nth_primitive          go to state 105
   138407 @@ -19089,3 +19089,440 @@
   138408     29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO \$@6 DELIMITED .
   138409 
   138410      \$default  reduce using rule 29 (placeless_element)
   138411 +
   138412 +
   138413 +State 423
   138414 +
   138415 +  146 place: label .  [\$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', ']', ')']
   138416 +  147      | label . corner
   138417 +  153 label: label . '.' LABEL
   138418 +  180 corner: . DOT_N
   138419 +  181       | . DOT_E
   138420 +  182       | . DOT_W
   138421 +  183       | . DOT_S
   138422 +  184       | . DOT_NE
   138423 +  185       | . DOT_SE
   138424 +  186       | . DOT_NW
   138425 +  187       | . DOT_SW
   138426 +  188       | . DOT_C
   138427 +  189       | . DOT_START
   138428 +  190       | . DOT_END
   138429 +  191       | . TOP
   138430 +  192       | . BOTTOM
   138431 +  193       | . LEFT
   138432 +  194       | . RIGHT
   138433 +  195       | . UPPER LEFT
   138434 +  196       | . LOWER LEFT
   138435 +  197       | . UPPER RIGHT
   138436 +  198       | . LOWER RIGHT
   138437 +  199       | . LEFT_CORNER
   138438 +  200       | . RIGHT_CORNER
   138439 +  201       | . UPPER LEFT_CORNER
   138440 +  202       | . LOWER LEFT_CORNER
   138441 +  203       | . UPPER RIGHT_CORNER
   138442 +  204       | . LOWER RIGHT_CORNER
   138443 +  205       | . NORTH
   138444 +  206       | . SOUTH
   138445 +  207       | . EAST
   138446 +  208       | . WEST
   138447 +  209       | . CENTER
   138448 +  210       | . START
   138449 +  211       | . END
   138450 +
   138451 +    LEFT          shift, and go to state 53
   138452 +    RIGHT         shift, and go to state 54
   138453 +    DOT_N         shift, and go to state 56
   138454 +    DOT_E         shift, and go to state 57
   138455 +    DOT_W         shift, and go to state 58
   138456 +    DOT_S         shift, and go to state 59
   138457 +    DOT_NE        shift, and go to state 60
   138458 +    DOT_SE        shift, and go to state 61
   138459 +    DOT_NW        shift, and go to state 62
   138460 +    DOT_SW        shift, and go to state 63
   138461 +    DOT_C         shift, and go to state 64
   138462 +    DOT_START     shift, and go to state 65
   138463 +    DOT_END       shift, and go to state 66
   138464 +    TOP           shift, and go to state 78
   138465 +    BOTTOM        shift, and go to state 79
   138466 +    UPPER         shift, and go to state 80
   138467 +    LOWER         shift, and go to state 81
   138468 +    LEFT_CORNER   shift, and go to state 82
   138469 +    RIGHT_CORNER  shift, and go to state 83
   138470 +    NORTH         shift, and go to state 84
   138471 +    SOUTH         shift, and go to state 85
   138472 +    EAST          shift, and go to state 86
   138473 +    WEST          shift, and go to state 87
   138474 +    CENTER        shift, and go to state 88
   138475 +    END           shift, and go to state 89
   138476 +    START         shift, and go to state 90
   138477 +    '.'           shift, and go to state 204
   138478 +
   138479 +    \$default  reduce using rule 146 (place)
   138480 +
   138481 +    corner  go to state 205
   138482 +
   138483 +
   138484 +State 424
   138485 +
   138486 +  140 position_not_place: expr . between position AND position
   138487 +  141                   | expr . '<' position ',' position '>'
   138488 +  142 between: . BETWEEN
   138489 +  143        | . OF THE WAY BETWEEN
   138490 +  144 expr_pair: expr . ',' expr
   138491 +  219 expr: expr . '+' expr
   138492 +  220     | expr . '-' expr
   138493 +  221     | expr . '*' expr
   138494 +  222     | expr . '/' expr
   138495 +  223     | expr . '%' expr
   138496 +  224     | expr . '^' expr
   138497 +  239     | expr . '<' expr
   138498 +  240     | expr . LESSEQUAL expr
   138499 +  241     | expr . '>' expr
   138500 +  242     | expr . GREATEREQUAL expr
   138501 +  243     | expr . EQUALEQUAL expr
   138502 +  244     | expr . NOTEQUAL expr
   138503 +  245     | expr . ANDAND expr
   138504 +  246     | expr . OROR expr
   138505 +
   138506 +    OF            shift, and go to state 220
   138507 +    BETWEEN       shift, and go to state 221
   138508 +    ANDAND        shift, and go to state 222
   138509 +    OROR          shift, and go to state 223
   138510 +    NOTEQUAL      shift, and go to state 224
   138511 +    EQUALEQUAL    shift, and go to state 225
   138512 +    LESSEQUAL     shift, and go to state 226
   138513 +    GREATEREQUAL  shift, and go to state 227
   138514 +    ','           shift, and go to state 228
   138515 +    '<'           shift, and go to state 229
   138516 +    '>'           shift, and go to state 230
   138517 +    '+'           shift, and go to state 231
   138518 +    '-'           shift, and go to state 232
   138519 +    '*'           shift, and go to state 233
   138520 +    '/'           shift, and go to state 234
   138521 +    '%'           shift, and go to state 235
   138522 +    '^'           shift, and go to state 236
   138523 +
   138524 +    between  go to state 425
   138525 +
   138526 +
   138527 +State 425
   138528 +
   138529 +  134 position: . position_not_place
   138530 +  135         | . place
   138531 +  136 position_not_place: . expr_pair
   138532 +  137                   | . position '+' expr_pair
   138533 +  138                   | . position '-' expr_pair
   138534 +  139                   | . '(' position ',' position ')'
   138535 +  140                   | . expr between position AND position
   138536 +  140                   | expr between . position AND position
   138537 +  141                   | . expr '<' position ',' position '>'
   138538 +  144 expr_pair: . expr ',' expr
   138539 +  145          | . '(' expr_pair ')'
   138540 +  146 place: . label
   138541 +  147      | . label corner
   138542 +  148      | . corner label
   138543 +  149      | . corner OF label
   138544 +  150      | . HERE
   138545 +  151 label: . LABEL
   138546 +  152      | . nth_primitive
   138547 +  153      | . label '.' LABEL
   138548 +  154 ordinal: . ORDINAL
   138549 +  155        | . '\`' any_expr TH
   138550 +  156 optional_ordinal_last: . LAST
   138551 +  157                      | . ordinal LAST
   138552 +  158 nth_primitive: . ordinal object_type
   138553 +  159              | . optional_ordinal_last object_type
   138554 +  180 corner: . DOT_N
   138555 +  181       | . DOT_E
   138556 +  182       | . DOT_W
   138557 +  183       | . DOT_S
   138558 +  184       | . DOT_NE
   138559 +  185       | . DOT_SE
   138560 +  186       | . DOT_NW
   138561 +  187       | . DOT_SW
   138562 +  188       | . DOT_C
   138563 +  189       | . DOT_START
   138564 +  190       | . DOT_END
   138565 +  191       | . TOP
   138566 +  192       | . BOTTOM
   138567 +  193       | . LEFT
   138568 +  194       | . RIGHT
   138569 +  195       | . UPPER LEFT
   138570 +  196       | . LOWER LEFT
   138571 +  197       | . UPPER RIGHT
   138572 +  198       | . LOWER RIGHT
   138573 +  199       | . LEFT_CORNER
   138574 +  200       | . RIGHT_CORNER
   138575 +  201       | . UPPER LEFT_CORNER
   138576 +  202       | . LOWER LEFT_CORNER
   138577 +  203       | . UPPER RIGHT_CORNER
   138578 +  204       | . LOWER RIGHT_CORNER
   138579 +  205       | . NORTH
   138580 +  206       | . SOUTH
   138581 +  207       | . EAST
   138582 +  208       | . WEST
   138583 +  209       | . CENTER
   138584 +  210       | . START
   138585 +  211       | . END
   138586 +  212 expr: . VARIABLE
   138587 +  213     | . NUMBER
   138588 +  214     | . place DOT_X
   138589 +  215     | . place DOT_Y
   138590 +  216     | . place DOT_HT
   138591 +  217     | . place DOT_WID
   138592 +  218     | . place DOT_RAD
   138593 +  219     | . expr '+' expr
   138594 +  220     | . expr '-' expr
   138595 +  221     | . expr '*' expr
   138596 +  222     | . expr '/' expr
   138597 +  223     | . expr '%' expr
   138598 +  224     | . expr '^' expr
   138599 +  225     | . '-' expr
   138600 +  226     | . '(' any_expr ')'
   138601 +  227     | . SIN '(' any_expr ')'
   138602 +  228     | . COS '(' any_expr ')'
   138603 +  229     | . ATAN2 '(' any_expr ',' any_expr ')'
   138604 +  230     | . LOG '(' any_expr ')'
   138605 +  231     | . EXP '(' any_expr ')'
   138606 +  232     | . SQRT '(' any_expr ')'
   138607 +  233     | . K_MAX '(' any_expr ',' any_expr ')'
   138608 +  234     | . K_MIN '(' any_expr ',' any_expr ')'
   138609 +  235     | . INT '(' any_expr ')'
   138610 +  236     | . RAND '(' any_expr ')'
   138611 +  237     | . RAND '(' ')'
   138612 +  238     | . SRAND '(' any_expr ')'
   138613 +  239     | . expr '<' expr
   138614 +  240     | . expr LESSEQUAL expr
   138615 +  241     | . expr '>' expr
   138616 +  242     | . expr GREATEREQUAL expr
   138617 +  243     | . expr EQUALEQUAL expr
   138618 +  244     | . expr NOTEQUAL expr
   138619 +  245     | . expr ANDAND expr
   138620 +  246     | . expr OROR expr
   138621 +  247     | . '!' expr
   138622 +
   138623 +    LABEL         shift, and go to state 48
   138624 +    VARIABLE      shift, and go to state 49
   138625 +    NUMBER        shift, and go to state 50
   138626 +    ORDINAL       shift, and go to state 51
   138627 +    LAST          shift, and go to state 52
   138628 +    LEFT          shift, and go to state 53
   138629 +    RIGHT         shift, and go to state 54
   138630 +    HERE          shift, and go to state 55
   138631 +    DOT_N         shift, and go to state 56
   138632 +    DOT_E         shift, and go to state 57
   138633 +    DOT_W         shift, and go to state 58
   138634 +    DOT_S         shift, and go to state 59
   138635 +    DOT_NE        shift, and go to state 60
   138636 +    DOT_SE        shift, and go to state 61
   138637 +    DOT_NW        shift, and go to state 62
   138638 +    DOT_SW        shift, and go to state 63
   138639 +    DOT_C         shift, and go to state 64
   138640 +    DOT_START     shift, and go to state 65
   138641 +    DOT_END       shift, and go to state 66
   138642 +    SIN           shift, and go to state 67
   138643 +    COS           shift, and go to state 68
   138644 +    ATAN2         shift, and go to state 69
   138645 +    LOG           shift, and go to state 70
   138646 +    EXP           shift, and go to state 71
   138647 +    SQRT          shift, and go to state 72
   138648 +    K_MAX         shift, and go to state 73
   138649 +    K_MIN         shift, and go to state 74
   138650 +    INT           shift, and go to state 75
   138651 +    RAND          shift, and go to state 76
   138652 +    SRAND         shift, and go to state 77
   138653 +    TOP           shift, and go to state 78
   138654 +    BOTTOM        shift, and go to state 79
   138655 +    UPPER         shift, and go to state 80
   138656 +    LOWER         shift, and go to state 81
   138657 +    LEFT_CORNER   shift, and go to state 82
   138658 +    RIGHT_CORNER  shift, and go to state 83
   138659 +    NORTH         shift, and go to state 84
   138660 +    SOUTH         shift, and go to state 85
   138661 +    EAST          shift, and go to state 86
   138662 +    WEST          shift, and go to state 87
   138663 +    CENTER        shift, and go to state 88
   138664 +    END           shift, and go to state 89
   138665 +    START         shift, and go to state 90
   138666 +    '('           shift, and go to state 91
   138667 +    '\`'           shift, and go to state 92
   138668 +    '-'           shift, and go to state 93
   138669 +    '!'           shift, and go to state 94
   138670 +
   138671 +    position               go to state 426
   138672 +    position_not_place     go to state 99
   138673 +    expr_pair              go to state 100
   138674 +    place                  go to state 101
   138675 +    label                  go to state 423
   138676 +    ordinal                go to state 103
   138677 +    optional_ordinal_last  go to state 104
   138678 +    nth_primitive          go to state 105
   138679 +    corner                 go to state 106
   138680 +    expr                   go to state 424
   138681 +
   138682 +
   138683 +State 426
   138684 +
   138685 +  137 position_not_place: position . '+' expr_pair
   138686 +  138                   | position . '-' expr_pair
   138687 +  140                   | expr between position . AND position
   138688 +
   138689 +    AND  shift, and go to state 427
   138690 +    '+'  shift, and go to state 197
   138691 +    '-'  shift, and go to state 198
   138692 +
   138693 +
   138694 +State 427
   138695 +
   138696 +  134 position: . position_not_place
   138697 +  135         | . place
   138698 +  136 position_not_place: . expr_pair
   138699 +  137                   | . position '+' expr_pair
   138700 +  138                   | . position '-' expr_pair
   138701 +  139                   | . '(' position ',' position ')'
   138702 +  140                   | . expr between position AND position
   138703 +  140                   | expr between position AND . position
   138704 +  141                   | . expr '<' position ',' position '>'
   138705 +  144 expr_pair: . expr ',' expr
   138706 +  145          | . '(' expr_pair ')'
   138707 +  146 place: . label
   138708 +  147      | . label corner
   138709 +  148      | . corner label
   138710 +  149      | . corner OF label
   138711 +  150      | . HERE
   138712 +  151 label: . LABEL
   138713 +  152      | . nth_primitive
   138714 +  153      | . label '.' LABEL
   138715 +  154 ordinal: . ORDINAL
   138716 +  155        | . '\`' any_expr TH
   138717 +  156 optional_ordinal_last: . LAST
   138718 +  157                      | . ordinal LAST
   138719 +  158 nth_primitive: . ordinal object_type
   138720 +  159              | . optional_ordinal_last object_type
   138721 +  180 corner: . DOT_N
   138722 +  181       | . DOT_E
   138723 +  182       | . DOT_W
   138724 +  183       | . DOT_S
   138725 +  184       | . DOT_NE
   138726 +  185       | . DOT_SE
   138727 +  186       | . DOT_NW
   138728 +  187       | . DOT_SW
   138729 +  188       | . DOT_C
   138730 +  189       | . DOT_START
   138731 +  190       | . DOT_END
   138732 +  191       | . TOP
   138733 +  192       | . BOTTOM
   138734 +  193       | . LEFT
   138735 +  194       | . RIGHT
   138736 +  195       | . UPPER LEFT
   138737 +  196       | . LOWER LEFT
   138738 +  197       | . UPPER RIGHT
   138739 +  198       | . LOWER RIGHT
   138740 +  199       | . LEFT_CORNER
   138741 +  200       | . RIGHT_CORNER
   138742 +  201       | . UPPER LEFT_CORNER
   138743 +  202       | . LOWER LEFT_CORNER
   138744 +  203       | . UPPER RIGHT_CORNER
   138745 +  204       | . LOWER RIGHT_CORNER
   138746 +  205       | . NORTH
   138747 +  206       | . SOUTH
   138748 +  207       | . EAST
   138749 +  208       | . WEST
   138750 +  209       | . CENTER
   138751 +  210       | . START
   138752 +  211       | . END
   138753 +  212 expr: . VARIABLE
   138754 +  213     | . NUMBER
   138755 +  214     | . place DOT_X
   138756 +  215     | . place DOT_Y
   138757 +  216     | . place DOT_HT
   138758 +  217     | . place DOT_WID
   138759 +  218     | . place DOT_RAD
   138760 +  219     | . expr '+' expr
   138761 +  220     | . expr '-' expr
   138762 +  221     | . expr '*' expr
   138763 +  222     | . expr '/' expr
   138764 +  223     | . expr '%' expr
   138765 +  224     | . expr '^' expr
   138766 +  225     | . '-' expr
   138767 +  226     | . '(' any_expr ')'
   138768 +  227     | . SIN '(' any_expr ')'
   138769 +  228     | . COS '(' any_expr ')'
   138770 +  229     | . ATAN2 '(' any_expr ',' any_expr ')'
   138771 +  230     | . LOG '(' any_expr ')'
   138772 +  231     | . EXP '(' any_expr ')'
   138773 +  232     | . SQRT '(' any_expr ')'
   138774 +  233     | . K_MAX '(' any_expr ',' any_expr ')'
   138775 +  234     | . K_MIN '(' any_expr ',' any_expr ')'
   138776 +  235     | . INT '(' any_expr ')'
   138777 +  236     | . RAND '(' any_expr ')'
   138778 +  237     | . RAND '(' ')'
   138779 +  238     | . SRAND '(' any_expr ')'
   138780 +  239     | . expr '<' expr
   138781 +  240     | . expr LESSEQUAL expr
   138782 +  241     | . expr '>' expr
   138783 +  242     | . expr GREATEREQUAL expr
   138784 +  243     | . expr EQUALEQUAL expr
   138785 +  244     | . expr NOTEQUAL expr
   138786 +  245     | . expr ANDAND expr
   138787 +  246     | . expr OROR expr
   138788 +  247     | . '!' expr
   138789 +
   138790 +    LABEL         shift, and go to state 48
   138791 +    VARIABLE      shift, and go to state 49
   138792 +    NUMBER        shift, and go to state 50
   138793 +    ORDINAL       shift, and go to state 51
   138794 +    LAST          shift, and go to state 52
   138795 +    LEFT          shift, and go to state 53
   138796 +    RIGHT         shift, and go to state 54
   138797 +    HERE          shift, and go to state 55
   138798 +    DOT_N         shift, and go to state 56
   138799 +    DOT_E         shift, and go to state 57
   138800 +    DOT_W         shift, and go to state 58
   138801 +    DOT_S         shift, and go to state 59
   138802 +    DOT_NE        shift, and go to state 60
   138803 +    DOT_SE        shift, and go to state 61
   138804 +    DOT_NW        shift, and go to state 62
   138805 +    DOT_SW        shift, and go to state 63
   138806 +    DOT_C         shift, and go to state 64
   138807 +    DOT_START     shift, and go to state 65
   138808 +    DOT_END       shift, and go to state 66
   138809 +    SIN           shift, and go to state 67
   138810 +    COS           shift, and go to state 68
   138811 +    ATAN2         shift, and go to state 69
   138812 +    LOG           shift, and go to state 70
   138813 +    EXP           shift, and go to state 71
   138814 +    SQRT          shift, and go to state 72
   138815 +    K_MAX         shift, and go to state 73
   138816 +    K_MIN         shift, and go to state 74
   138817 +    INT           shift, and go to state 75
   138818 +    RAND          shift, and go to state 76
   138819 +    SRAND         shift, and go to state 77
   138820 +    TOP           shift, and go to state 78
   138821 +    BOTTOM        shift, and go to state 79
   138822 +    UPPER         shift, and go to state 80
   138823 +    LOWER         shift, and go to state 81
   138824 +    LEFT_CORNER   shift, and go to state 82
   138825 +    RIGHT_CORNER  shift, and go to state 83
   138826 +    NORTH         shift, and go to state 84
   138827 +    SOUTH         shift, and go to state 85
   138828 +    EAST          shift, and go to state 86
   138829 +    WEST          shift, and go to state 87
   138830 +    CENTER        shift, and go to state 88
   138831 +    END           shift, and go to state 89
   138832 +    START         shift, and go to state 90
   138833 +    '('           shift, and go to state 91
   138834 +    '\`'           shift, and go to state 92
   138835 +    '-'           shift, and go to state 93
   138836 +    '!'           shift, and go to state 94
   138837 +
   138838 +    position               go to state 402
   138839 +    position_not_place     go to state 99
   138840 +    expr_pair              go to state 100
   138841 +    place                  go to state 101
   138842 +    label                  go to state 423
   138843 +    ordinal                go to state 103
   138844 +    optional_ordinal_last  go to state 104
   138845 +    nth_primitive          go to state 105
   138846 +    corner                 go to state 106
   138847 +    expr                   go to state 424
   138848 " | \
   138849   $at_diff - "$at_stdout" || at_failed=:
   138850 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   138851 $at_failed && at_fn_log_failure
   138852 $at_traceon; }
   138853 
   138854 
   138855 # Canonical LR generates very large tables, resulting in very long
   138856 # files with #line directives that may overflow what the standards
   138857 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   138858 # will issue an error.
   138859 #
   138860 # There is no "" around `wc` since some indent the result.
   138861 
   138862 { set +x
   138863 $as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS"
   138864 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403"
   138865 ( $at_check_trace; $BISON_C_WORKS
   138866 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   138867 at_status=$? at_failed=false
   138868 $at_check_filter
   138869 echo stderr:; cat "$at_stderr"
   138870 echo stdout:; cat "$at_stdout"
   138871 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   138872 $at_failed && at_fn_log_failure
   138873 $at_traceon; }
   138874 
   138875 { set +x
   138876 $as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   138877 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403"
   138878 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   138879 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   138880 at_status=$? at_failed=false
   138881 $at_check_filter
   138882 echo stderr:; cat "$at_stderr"
   138883 echo stdout:; cat "$at_stdout"
   138884 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   138885 $at_failed && at_fn_log_failure
   138886 $at_traceon; }
   138887 
   138888 
   138889 { set +x
   138890 $as_echo "$at_srcdir/existing.at:1403:  \$PREPARSER ./input"
   138891 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403"
   138892 ( $at_check_trace;  $PREPARSER ./input
   138893 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   138894 at_status=$? at_failed=false
   138895 $at_check_filter
   138896 echo stderr:; tee stderr <"$at_stderr"
   138897 at_fn_diff_devnull "$at_stdout" || at_failed=:
   138898 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   138899 $at_failed && at_fn_log_failure
   138900 $at_traceon; }
   138901 
   138902 { set +x
   138903 $as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   138904 at_fn_check_prepare_trace "existing.at:1403"
   138905 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   138906 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   138907 at_status=$? at_failed=false
   138908 $at_check_filter
   138909 at_fn_diff_devnull "$at_stderr" || at_failed=:
   138910 at_fn_diff_devnull "$at_stdout" || at_failed=:
   138911 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   138912 $at_failed && at_fn_log_failure
   138913 $at_traceon; }
   138914 
   138915 
   138916 
   138917 
   138918   set +x
   138919   $at_times_p && times >"$at_times_file"
   138920 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   138921 read at_status <"$at_status_file"
   138922 #AT_STOP_266
   138923 #AT_START_267
   138924 at_fn_group_banner 267 'existing.at:1403' \
   138925   "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 16
   138926 at_xfail=no
   138927 (
   138928   $as_echo "267. $at_setup_line: testing $at_desc ..."
   138929   $at_traceon
   138930 
   138931 
   138932 cat >input.y <<'_ATEOF'
   138933 %code top {
   138934 #include <config.h>
   138935 /* We don't need perfect functions for these tests. */
   138936 #undef malloc
   138937 #undef memcmp
   138938 #undef realloc
   138939 }
   138940 
   138941 %code {
   138942   #include <stdio.h>
   138943   static void yyerror ( const char *msg);
   138944   static int yylex (void);
   138945 }
   138946 
   138947 %define lr.type canonical-lr
   138948 %error-verbose
   138949 
   138950 %token LABEL
   138951 %token VARIABLE
   138952 %token NUMBER
   138953 %token TEXT
   138954 %token COMMAND_LINE
   138955 %token DELIMITED
   138956 %token ORDINAL
   138957 %token TH
   138958 %token LEFT_ARROW_HEAD
   138959 %token RIGHT_ARROW_HEAD
   138960 %token DOUBLE_ARROW_HEAD
   138961 %token LAST
   138962 %token UP
   138963 %token DOWN
   138964 %token LEFT
   138965 %token RIGHT
   138966 %token BOX
   138967 %token CIRCLE
   138968 %token ELLIPSE
   138969 %token ARC
   138970 %token LINE
   138971 %token ARROW
   138972 %token MOVE
   138973 %token SPLINE
   138974 %token HEIGHT
   138975 %token RADIUS
   138976 %token WIDTH
   138977 %token DIAMETER
   138978 %token FROM
   138979 %token TO
   138980 %token AT
   138981 %token WITH
   138982 %token BY
   138983 %token THEN
   138984 %token SOLID
   138985 %token DOTTED
   138986 %token DASHED
   138987 %token CHOP
   138988 %token SAME
   138989 %token INVISIBLE
   138990 %token LJUST
   138991 %token RJUST
   138992 %token ABOVE
   138993 %token BELOW
   138994 %token OF
   138995 %token THE
   138996 %token WAY
   138997 %token BETWEEN
   138998 %token AND
   138999 %token HERE
   139000 %token DOT_N
   139001 %token DOT_E
   139002 %token DOT_W
   139003 %token DOT_S
   139004 %token DOT_NE
   139005 %token DOT_SE
   139006 %token DOT_NW
   139007 %token DOT_SW
   139008 %token DOT_C
   139009 %token DOT_START
   139010 %token DOT_END
   139011 %token DOT_X
   139012 %token DOT_Y
   139013 %token DOT_HT
   139014 %token DOT_WID
   139015 %token DOT_RAD
   139016 %token SIN
   139017 %token COS
   139018 %token ATAN2
   139019 %token LOG
   139020 %token EXP
   139021 %token SQRT
   139022 %token K_MAX
   139023 %token K_MIN
   139024 %token INT
   139025 %token RAND
   139026 %token SRAND
   139027 %token COPY
   139028 %token THROUGH
   139029 %token TOP
   139030 %token BOTTOM
   139031 %token UPPER
   139032 %token LOWER
   139033 %token SH
   139034 %token PRINT
   139035 %token CW
   139036 %token CCW
   139037 %token FOR
   139038 %token DO
   139039 %token IF
   139040 %token ELSE
   139041 %token ANDAND
   139042 %token OROR
   139043 %token NOTEQUAL
   139044 %token EQUALEQUAL
   139045 %token LESSEQUAL
   139046 %token GREATEREQUAL
   139047 %token LEFT_CORNER
   139048 %token RIGHT_CORNER
   139049 %token NORTH
   139050 %token SOUTH
   139051 %token EAST
   139052 %token WEST
   139053 %token CENTER
   139054 %token END
   139055 %token START
   139056 %token RESET
   139057 %token UNTIL
   139058 %token PLOT
   139059 %token THICKNESS
   139060 %token FILL
   139061 %token COLORED
   139062 %token OUTLINED
   139063 %token SHADED
   139064 %token ALIGNED
   139065 %token SPRINTF
   139066 %token COMMAND
   139067 
   139068 %left '.'
   139069 
   139070 /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
   139071 %left PLOT
   139072 %left TEXT SPRINTF
   139073 
   139074 /* give text adjustments higher precedence than TEXT, so that
   139075 box "foo" above ljust == box ("foo" above ljust)
   139076 */
   139077 
   139078 %left LJUST RJUST ABOVE BELOW
   139079 
   139080 %left LEFT RIGHT
   139081 /* Give attributes that take an optional expression a higher
   139082 precedence than left and right, so that eg `line chop left'
   139083 parses properly. */
   139084 %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
   139085 %left LABEL
   139086 
   139087 %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
   139088 %left ORDINAL HERE '`'
   139089 
   139090 %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */
   139091 
   139092 /* these need to be lower than '-' */
   139093 %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS
   139094 
   139095 /* these must have higher precedence than CHOP so that `label %prec CHOP'
   139096 works */
   139097 %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
   139098 %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
   139099 %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END
   139100 
   139101 %left ','
   139102 %left OROR
   139103 %left ANDAND
   139104 %left EQUALEQUAL NOTEQUAL
   139105 %left '<' '>' LESSEQUAL GREATEREQUAL
   139106 
   139107 %left BETWEEN OF
   139108 %left AND
   139109 
   139110 %left '+' '-'
   139111 %left '*' '/' '%'
   139112 %right '!'
   139113 %right '^'
   139114 
   139115 
   139116 %%
   139117 
   139118 
   139119 top:
   139120 	optional_separator
   139121 	| element_list
   139122 	;
   139123 
   139124 element_list:
   139125 	optional_separator middle_element_list optional_separator
   139126 	;
   139127 
   139128 middle_element_list:
   139129 	element
   139130 	| middle_element_list separator element
   139131 	;
   139132 
   139133 optional_separator:
   139134 	/* empty */
   139135 	| separator
   139136 	;
   139137 
   139138 separator:
   139139 	';'
   139140 	| separator ';'
   139141 	;
   139142 
   139143 placeless_element:
   139144 	VARIABLE '=' any_expr
   139145 	| VARIABLE ':' '=' any_expr
   139146 	| UP
   139147 	| DOWN
   139148 	| LEFT
   139149 	| RIGHT
   139150 	| COMMAND_LINE
   139151 	| COMMAND print_args
   139152 	| PRINT print_args
   139153 	| SH
   139154 		{}
   139155 	  DELIMITED
   139156 	| COPY TEXT
   139157 	| COPY TEXT THROUGH
   139158 		{}
   139159 	  DELIMITED
   139160 		{}
   139161 	  until
   139162 	| COPY THROUGH
   139163 		{}
   139164 	  DELIMITED
   139165 		{}
   139166 	  until
   139167 	| FOR VARIABLE '=' expr TO expr optional_by DO
   139168 		{}
   139169 	  DELIMITED
   139170 	| simple_if
   139171 	| simple_if ELSE
   139172 		{}
   139173 	  DELIMITED
   139174 	| reset_variables
   139175 	| RESET
   139176 	;
   139177 
   139178 reset_variables:
   139179 	RESET VARIABLE
   139180 	| reset_variables VARIABLE
   139181 	| reset_variables ',' VARIABLE
   139182 	;
   139183 
   139184 print_args:
   139185 	print_arg
   139186 	| print_args print_arg
   139187 	;
   139188 
   139189 print_arg:
   139190 	expr							%prec ','
   139191 	| text
   139192 	| position						%prec ','
   139193 	;
   139194 
   139195 simple_if:
   139196 	IF any_expr THEN
   139197 		{}
   139198 	DELIMITED
   139199 	;
   139200 
   139201 until:
   139202 	/* empty */
   139203 	| UNTIL TEXT
   139204 	;
   139205 
   139206 any_expr:
   139207 	expr
   139208 	| text_expr
   139209 	;
   139210 
   139211 text_expr:
   139212 	text EQUALEQUAL text
   139213 	| text NOTEQUAL text
   139214 	| text_expr ANDAND text_expr
   139215 	| text_expr ANDAND expr
   139216 	| expr ANDAND text_expr
   139217 	| text_expr OROR text_expr
   139218 	| text_expr OROR expr
   139219 	| expr OROR text_expr
   139220 	| '!' text_expr
   139221 	;
   139222 
   139223 optional_by:
   139224 	/* empty */
   139225 	| BY expr
   139226 	| BY '*' expr
   139227 	;
   139228 
   139229 element:
   139230 	object_spec
   139231 	| LABEL ':' optional_separator element
   139232 	| LABEL ':' optional_separator position_not_place
   139233 	| LABEL ':' optional_separator place
   139234 	| '{' {} element_list '}'
   139235 		{}
   139236 	  optional_element
   139237 	| placeless_element
   139238 	;
   139239 
   139240 optional_element:
   139241 	/* empty */
   139242 	| element
   139243 	;
   139244 
   139245 object_spec:
   139246 	BOX
   139247 	| CIRCLE
   139248 	| ELLIPSE
   139249 	| ARC
   139250 	| LINE
   139251 	| ARROW
   139252 	| MOVE
   139253 	| SPLINE
   139254 	| text							%prec TEXT
   139255 	| PLOT expr
   139256 	| PLOT expr text
   139257 	| '['
   139258 		{}
   139259 	  element_list ']'
   139260 	| object_spec HEIGHT expr
   139261 	| object_spec RADIUS expr
   139262 	| object_spec WIDTH expr
   139263 	| object_spec DIAMETER expr
   139264 	| object_spec expr					%prec HEIGHT
   139265 	| object_spec UP
   139266 	| object_spec UP expr
   139267 	| object_spec DOWN
   139268 	| object_spec DOWN expr
   139269 	| object_spec RIGHT
   139270 	| object_spec RIGHT expr
   139271 	| object_spec LEFT
   139272 	| object_spec LEFT expr
   139273 	| object_spec FROM position
   139274 	| object_spec TO position
   139275 	| object_spec AT position
   139276 	| object_spec WITH path
   139277 	| object_spec WITH position				%prec ','
   139278 	| object_spec BY expr_pair
   139279 	| object_spec THEN
   139280 	| object_spec SOLID
   139281 	| object_spec DOTTED
   139282 	| object_spec DOTTED expr
   139283 	| object_spec DASHED
   139284 	| object_spec DASHED expr
   139285 	| object_spec FILL
   139286 	| object_spec FILL expr
   139287 	| object_spec SHADED text
   139288 	| object_spec COLORED text
   139289 	| object_spec OUTLINED text
   139290 	| object_spec CHOP
   139291 	| object_spec CHOP expr
   139292 	| object_spec SAME
   139293 	| object_spec INVISIBLE
   139294 	| object_spec LEFT_ARROW_HEAD
   139295 	| object_spec RIGHT_ARROW_HEAD
   139296 	| object_spec DOUBLE_ARROW_HEAD
   139297 	| object_spec CW
   139298 	| object_spec CCW
   139299 	| object_spec text					%prec TEXT
   139300 	| object_spec LJUST
   139301 	| object_spec RJUST
   139302 	| object_spec ABOVE
   139303 	| object_spec BELOW
   139304 	| object_spec THICKNESS expr
   139305 	| object_spec ALIGNED
   139306 	;
   139307 
   139308 text:
   139309 	TEXT
   139310 	| SPRINTF '(' TEXT sprintf_args ')'
   139311 	;
   139312 
   139313 sprintf_args:
   139314 	/* empty */
   139315 	| sprintf_args ',' expr
   139316 	;
   139317 
   139318 position:
   139319 	position_not_place
   139320 	| place
   139321 	;
   139322 
   139323 position_not_place:
   139324 	expr_pair
   139325 	| position '+' expr_pair
   139326 	| position '-' expr_pair
   139327 	| '(' position ',' position ')'
   139328 	| expr between position AND position
   139329 	| expr '<' position ',' position '>'
   139330 	;
   139331 
   139332 between:
   139333 	BETWEEN
   139334 	| OF THE WAY BETWEEN
   139335 	;
   139336 
   139337 expr_pair:
   139338 	expr ',' expr
   139339 	| '(' expr_pair ')'
   139340 	;
   139341 
   139342 place:
   139343 	/* line at A left == line (at A) left */
   139344 	label							%prec CHOP
   139345 	| label corner
   139346 	| corner label
   139347 	| corner OF label
   139348 	| HERE
   139349 	;
   139350 
   139351 label:
   139352 	LABEL
   139353 	| nth_primitive
   139354 	| label '.' LABEL
   139355 	;
   139356 
   139357 ordinal:
   139358 	ORDINAL
   139359 	| '`' any_expr TH
   139360 	;
   139361 
   139362 optional_ordinal_last:
   139363 	LAST
   139364 	| ordinal LAST
   139365 	;
   139366 
   139367 nth_primitive:
   139368 	ordinal object_type
   139369 	| optional_ordinal_last object_type
   139370 	;
   139371 
   139372 object_type:
   139373 	BOX
   139374 	| CIRCLE
   139375 	| ELLIPSE
   139376 	| ARC
   139377 	| LINE
   139378 	| ARROW
   139379 	| SPLINE
   139380 	| '[' ']'
   139381 	| TEXT
   139382 	;
   139383 
   139384 label_path:
   139385 	'.' LABEL
   139386 	| label_path '.' LABEL
   139387 	;
   139388 
   139389 relative_path:
   139390 	corner							%prec CHOP
   139391 	/* give this a lower precedence than LEFT and RIGHT so that
   139392 	   [A: box] with .A left == [A: box] with (.A left) */
   139393 	| label_path						%prec TEXT
   139394 	| label_path corner
   139395 	;
   139396 
   139397 path:
   139398 	relative_path
   139399 	| '(' relative_path ',' relative_path ')'
   139400 		{}
   139401 	/* The rest of these rules are a compatibility sop. */
   139402 	| ORDINAL LAST object_type relative_path
   139403 	| LAST object_type relative_path
   139404 	| ORDINAL object_type relative_path
   139405 	| LABEL relative_path
   139406 	;
   139407 
   139408 corner:
   139409 	DOT_N
   139410 	| DOT_E
   139411 	| DOT_W
   139412 	| DOT_S
   139413 	| DOT_NE
   139414 	| DOT_SE
   139415 	| DOT_NW
   139416 	| DOT_SW
   139417 	| DOT_C
   139418 	| DOT_START
   139419 	| DOT_END
   139420 	| TOP
   139421 	| BOTTOM
   139422 	| LEFT
   139423 	| RIGHT
   139424 	| UPPER LEFT
   139425 	| LOWER LEFT
   139426 	| UPPER RIGHT
   139427 	| LOWER RIGHT
   139428 	| LEFT_CORNER
   139429 	| RIGHT_CORNER
   139430 	| UPPER LEFT_CORNER
   139431 	| LOWER LEFT_CORNER
   139432 	| UPPER RIGHT_CORNER
   139433 	| LOWER RIGHT_CORNER
   139434 	| NORTH
   139435 	| SOUTH
   139436 	| EAST
   139437 	| WEST
   139438 	| CENTER
   139439 	| START
   139440 	| END
   139441 	;
   139442 
   139443 expr:
   139444 	VARIABLE
   139445 	| NUMBER
   139446 	| place DOT_X
   139447 	| place DOT_Y
   139448 	| place DOT_HT
   139449 	| place DOT_WID
   139450 	| place DOT_RAD
   139451 	| expr '+' expr
   139452 	| expr '-' expr
   139453 	| expr '*' expr
   139454 	| expr '/' expr
   139455 	| expr '%' expr
   139456 	| expr '^' expr
   139457 	| '-' expr						%prec '!'
   139458 	| '(' any_expr ')'
   139459 	| SIN '(' any_expr ')'
   139460 	| COS '(' any_expr ')'
   139461 	| ATAN2 '(' any_expr ',' any_expr ')'
   139462 	| LOG '(' any_expr ')'
   139463 	| EXP '(' any_expr ')'
   139464 	| SQRT '(' any_expr ')'
   139465 	| K_MAX '(' any_expr ',' any_expr ')'
   139466 	| K_MIN '(' any_expr ',' any_expr ')'
   139467 	| INT '(' any_expr ')'
   139468 	| RAND '(' any_expr ')'
   139469 	| RAND '(' ')'
   139470 	| SRAND '(' any_expr ')'
   139471 	| expr '<' expr
   139472 	| expr LESSEQUAL expr
   139473 	| expr '>' expr
   139474 	| expr GREATEREQUAL expr
   139475 	| expr EQUALEQUAL expr
   139476 	| expr NOTEQUAL expr
   139477 	| expr ANDAND expr
   139478 	| expr OROR expr
   139479 	| '!' expr
   139480 	;
   139481 
   139482 
   139483 %%
   139484 #include <stdio.h>
   139485 /* A C error reporting function.  */
   139486 static
   139487 void yyerror ( const char *msg)
   139488 {
   139489   fprintf (stderr, "%s\n", msg);
   139490 }
   139491 static int
   139492 yylex (void)
   139493 {
   139494   static int const input[] = {
   139495     VARIABLE, '=', LABEL, LEFT, DOT_X, 0
   139496   };
   139497   static int const *inputp = input;
   139498   return *inputp++;
   139499 }
   139500 
   139501 int
   139502 main (void)
   139503 {
   139504   return yyparse ();
   139505 }
   139506 _ATEOF
   139507 
   139508 
   139509 
   139510 # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
   139511 # expanding macros, so it corrupts some special characters in the
   139512 # macros.  To avoid this, expand now and pass it the result with proper
   139513 # string quotation.  Assume args 7 through 12 expand to properly quoted
   139514 # strings.
   139515 
   139516 { set +x
   139517 $as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y"
   139518 at_fn_check_prepare_trace "existing.at:1403"
   139519 ( $at_check_trace; bison --report=all --defines -o input.c input.y
   139520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139521 at_status=$? at_failed=false
   139522 $at_check_filter
   139523 echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
   139524 " | \
   139525   $at_diff - "$at_stderr" || at_failed=:
   139526 at_fn_diff_devnull "$at_stdout" || at_failed=:
   139527 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139528 $at_failed && at_fn_log_failure
   139529 $at_traceon; }
   139530 
   139531 # Defining POSIXLY_CORRECT causes bison to complain if options are
   139532 # added after the grammar file name, so skip these checks in that
   139533 # case.
   139534 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   139535   at_save_special_files
   139536 
   139537   # To avoid expanding it repeatedly, store specified stdout.
   139538   : >expout
   139539 
   139540   # Run with -Werror.
   139541   { set +x
   139542 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror"
   139543 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403"
   139544 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror
   139545 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139546 at_status=$? at_failed=false
   139547 $at_check_filter
   139548 echo stderr:; tee stderr <"$at_stderr"
   139549 $at_diff expout "$at_stdout" || at_failed=:
   139550 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   139551 $at_failed && at_fn_log_failure
   139552 $at_traceon; }
   139553 
   139554 
   139555   # Build expected stderr up to and including the "warnings being
   139556   # treated as errors" message.
   139557   cat >at-bison-check-warnings <<'_ATEOF'
   139558 input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
   139559 _ATEOF
   139560 
   139561   at_bison_check_first=`sed -n \
   139562     '/: warning: /{=;q;}' at-bison-check-warnings`
   139563   : ${at_bison_check_first:=1}
   139564   at_bison_check_first_tmp=`sed -n \
   139565     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   139566   : ${at_bison_check_first_tmp:=1}
   139567   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   139568     at_bison_check_first=$at_bison_check_first_tmp
   139569   fi
   139570   if test $at_bison_check_first -gt 1; then
   139571     sed -n "1,`expr $at_bison_check_first - 1`"p \
   139572       at-bison-check-warnings > experr
   139573   fi
   139574   echo 'bison: warnings being treated as errors' >> experr
   139575 
   139576   # Finish building expected stderr and check.  Unlike warnings,
   139577   # complaints cause bison to exit early.  Thus, with -Werror, bison
   139578   # does not necessarily report all warnings that it does without
   139579   # -Werror, but it at least reports one.
   139580   at_bison_check_last=`sed -n '$=' stderr`
   139581   : ${at_bison_check_last:=1}
   139582   at_bison_check_last=`expr $at_bison_check_last - 1`
   139583   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   139584     at-bison-check-warnings >> experr
   139585   { set +x
   139586 $as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   139587               stderr 1>&2"
   139588 at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403"
   139589 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   139590               stderr 1>&2
   139591 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139592 at_status=$? at_failed=false
   139593 $at_check_filter
   139594 $at_diff experr "$at_stderr" || at_failed=:
   139595 at_fn_diff_devnull "$at_stdout" || at_failed=:
   139596 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139597 $at_failed && at_fn_log_failure
   139598 $at_traceon; }
   139599 
   139600 
   139601   # Now check --warnings=error.
   139602   cp stderr experr
   139603   { set +x
   139604 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error"
   139605 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403"
   139606 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error
   139607 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139608 at_status=$? at_failed=false
   139609 $at_check_filter
   139610 $at_diff experr "$at_stderr" || at_failed=:
   139611 $at_diff expout "$at_stdout" || at_failed=:
   139612 at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403"
   139613 $at_failed && at_fn_log_failure
   139614 $at_traceon; }
   139615 
   139616 
   139617   # Now check -Wnone and --warnings=none by making sure that
   139618   # -Werror doesn't change the exit status when -Wnone or
   139619   # --warnings=none is specified.
   139620   { set +x
   139621 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror"
   139622 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403"
   139623 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror
   139624 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139625 at_status=$? at_failed=false
   139626 $at_check_filter
   139627 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139628 $at_diff expout "$at_stdout" || at_failed=:
   139629 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139630 $at_failed && at_fn_log_failure
   139631 $at_traceon; }
   139632 
   139633   { set +x
   139634 $as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror"
   139635 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403"
   139636 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror
   139637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139638 at_status=$? at_failed=false
   139639 $at_check_filter
   139640 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139641 $at_diff expout "$at_stdout" || at_failed=:
   139642 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139643 $at_failed && at_fn_log_failure
   139644 $at_traceon; }
   139645 
   139646 
   139647   at_restore_special_files
   139648 fi
   139649 
   139650 { set +x
   139651 $as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1"
   139652 at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403"
   139653 ( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
   139654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139655 at_status=$? at_failed=false
   139656 $at_check_filter
   139657 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139658 echo >>"$at_stdout"; $as_echo "4833
   139659 " | \
   139660   $at_diff - "$at_stdout" || at_failed=:
   139661 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139662 $at_failed && at_fn_log_failure
   139663 $at_traceon; }
   139664 
   139665 
   139666 
   139667 
   139668 # Canonical LR generates very large tables, resulting in very long
   139669 # files with #line directives that may overflow what the standards
   139670 # (C90 and C++98) guarantee: 32767.  In that case, GCC's -pedantic
   139671 # will issue an error.
   139672 #
   139673 # There is no "" around `wc` since some indent the result.
   139674 if test 32767 -lt `wc -l < input.c`; then
   139675   CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
   139676   CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
   139677 fi
   139678 { set +x
   139679 $as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS"
   139680 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403"
   139681 ( $at_check_trace; $BISON_C_WORKS
   139682 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139683 at_status=$? at_failed=false
   139684 $at_check_filter
   139685 echo stderr:; cat "$at_stderr"
   139686 echo stdout:; cat "$at_stdout"
   139687 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139688 $at_failed && at_fn_log_failure
   139689 $at_traceon; }
   139690 
   139691 { set +x
   139692 $as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   139693 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403"
   139694 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   139695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139696 at_status=$? at_failed=false
   139697 $at_check_filter
   139698 echo stderr:; cat "$at_stderr"
   139699 echo stdout:; cat "$at_stdout"
   139700 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139701 $at_failed && at_fn_log_failure
   139702 $at_traceon; }
   139703 
   139704 
   139705 { set +x
   139706 $as_echo "$at_srcdir/existing.at:1403:  \$PREPARSER ./input"
   139707 at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403"
   139708 ( $at_check_trace;  $PREPARSER ./input
   139709 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139710 at_status=$? at_failed=false
   139711 $at_check_filter
   139712 echo stderr:; tee stderr <"$at_stderr"
   139713 at_fn_diff_devnull "$at_stdout" || at_failed=:
   139714 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139715 $at_failed && at_fn_log_failure
   139716 $at_traceon; }
   139717 
   139718 { set +x
   139719 $as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   139720 at_fn_check_prepare_trace "existing.at:1403"
   139721 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   139722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139723 at_status=$? at_failed=false
   139724 $at_check_filter
   139725 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139726 at_fn_diff_devnull "$at_stdout" || at_failed=:
   139727 at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403"
   139728 $at_failed && at_fn_log_failure
   139729 $at_traceon; }
   139730 
   139731 
   139732 
   139733 
   139734   set +x
   139735   $at_times_p && times >"$at_times_file"
   139736 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   139737 read at_status <"$at_status_file"
   139738 #AT_STOP_267
   139739 #AT_START_268
   139740 at_fn_group_banner 268 'regression.at:25' \
   139741   "Trivial grammars" "                               " 17
   139742 at_xfail=no
   139743 (
   139744   $as_echo "268. $at_setup_line: testing $at_desc ..."
   139745   $at_traceon
   139746 
   139747 
   139748 
   139749 cat >input.y <<'_ATEOF'
   139750 %code top {
   139751 #include <config.h>
   139752 /* We don't need perfect functions for these tests. */
   139753 #undef malloc
   139754 #undef memcmp
   139755 #undef realloc
   139756 }
   139757 
   139758 %{
   139759 void yyerror ( const char *msg);
   139760 int yylex (void);
   139761 #define YYSTYPE int *
   139762 %}
   139763 
   139764 %error-verbose
   139765 
   139766 %%
   139767 
   139768 program: 'x';
   139769 _ATEOF
   139770 
   139771 
   139772 
   139773 
   139774 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   139775   at_save_special_files
   139776   mkdir xml-tests
   139777     # Don't combine these Bison invocations since we want to be sure that
   139778   # --report=all isn't required to get the full XML file.
   139779   { set +x
   139780 $as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   139781                   --graph=xml-tests/test.dot -o input.c input.y"
   139782 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:43"
   139783 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   139784                   --graph=xml-tests/test.dot -o input.c input.y
   139785 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139786 at_status=$? at_failed=false
   139787 $at_check_filter
   139788 echo stderr:; cat "$at_stderr"
   139789 echo stdout:; cat "$at_stdout"
   139790 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
   139791 $at_failed && at_fn_log_failure
   139792 $at_traceon; }
   139793 
   139794   { set +x
   139795 $as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   139796 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:43"
   139797 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   139798 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139799 at_status=$? at_failed=false
   139800 $at_check_filter
   139801 echo stderr:; cat "$at_stderr"
   139802 echo stdout:; cat "$at_stdout"
   139803 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
   139804 $at_failed && at_fn_log_failure
   139805 $at_traceon; }
   139806 
   139807     cp xml-tests/test.output expout
   139808   { set +x
   139809 $as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\
   139810              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   139811              xml-tests/test.xml"
   139812 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43"
   139813 ( $at_check_trace; $XSLTPROC \
   139814              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   139815              xml-tests/test.xml
   139816 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139817 at_status=$? at_failed=false
   139818 $at_check_filter
   139819 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139820 $at_diff expout "$at_stdout" || at_failed=:
   139821 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
   139822 $at_failed && at_fn_log_failure
   139823 $at_traceon; }
   139824 
   139825   sort xml-tests/test.dot > expout
   139826   { set +x
   139827 $as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\
   139828              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   139829              xml-tests/test.xml | sort"
   139830 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43"
   139831 ( $at_check_trace; $XSLTPROC \
   139832              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   139833              xml-tests/test.xml | sort
   139834 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139835 at_status=$? at_failed=false
   139836 $at_check_filter
   139837 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139838 $at_diff expout "$at_stdout" || at_failed=:
   139839 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
   139840 $at_failed && at_fn_log_failure
   139841 $at_traceon; }
   139842 
   139843   rm -rf xml-tests expout
   139844   at_restore_special_files
   139845 fi
   139846 { set +x
   139847 $as_echo "$at_srcdir/regression.at:43: bison -o input.c input.y"
   139848 at_fn_check_prepare_trace "regression.at:43"
   139849 ( $at_check_trace; bison -o input.c input.y
   139850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139851 at_status=$? at_failed=false
   139852 $at_check_filter
   139853 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139854 at_fn_diff_devnull "$at_stdout" || at_failed=:
   139855 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
   139856 $at_failed && at_fn_log_failure
   139857 $at_traceon; }
   139858 
   139859 
   139860 { set +x
   139861 $as_echo "$at_srcdir/regression.at:44: \$BISON_C_WORKS"
   139862 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:44"
   139863 ( $at_check_trace; $BISON_C_WORKS
   139864 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139865 at_status=$? at_failed=false
   139866 $at_check_filter
   139867 echo stderr:; cat "$at_stderr"
   139868 echo stdout:; cat "$at_stdout"
   139869 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:44"
   139870 $at_failed && at_fn_log_failure
   139871 $at_traceon; }
   139872 
   139873 { set +x
   139874 $as_echo "$at_srcdir/regression.at:44: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   139875 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:44"
   139876 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   139877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139878 at_status=$? at_failed=false
   139879 $at_check_filter
   139880 echo stderr:; cat "$at_stderr"
   139881 echo stdout:; cat "$at_stdout"
   139882 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:44"
   139883 $at_failed && at_fn_log_failure
   139884 $at_traceon; }
   139885 
   139886 { set +x
   139887 $as_echo "$at_srcdir/regression.at:45: \$BISON_C_WORKS"
   139888 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:45"
   139889 ( $at_check_trace; $BISON_C_WORKS
   139890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139891 at_status=$? at_failed=false
   139892 $at_check_filter
   139893 echo stderr:; cat "$at_stderr"
   139894 echo stdout:; cat "$at_stdout"
   139895 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:45"
   139896 $at_failed && at_fn_log_failure
   139897 $at_traceon; }
   139898 
   139899 { set +x
   139900 $as_echo "$at_srcdir/regression.at:45: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o -DYYDEBUG -c input.c "
   139901 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " "regression.at:45"
   139902 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c
   139903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139904 at_status=$? at_failed=false
   139905 $at_check_filter
   139906 echo stderr:; cat "$at_stderr"
   139907 echo stdout:; cat "$at_stdout"
   139908 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:45"
   139909 $at_failed && at_fn_log_failure
   139910 $at_traceon; }
   139911 
   139912 
   139913   set +x
   139914   $at_times_p && times >"$at_times_file"
   139915 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   139916 read at_status <"$at_status_file"
   139917 #AT_STOP_268
   139918 #AT_START_269
   139919 at_fn_group_banner 269 'regression.at:55' \
   139920   "YYSTYPE typedef" "                                " 17
   139921 at_xfail=no
   139922 (
   139923   $as_echo "269. $at_setup_line: testing $at_desc ..."
   139924   $at_traceon
   139925 
   139926 
   139927 
   139928 cat >input.y <<'_ATEOF'
   139929 %code top {
   139930 #include <config.h>
   139931 /* We don't need perfect functions for these tests. */
   139932 #undef malloc
   139933 #undef memcmp
   139934 #undef realloc
   139935 }
   139936 
   139937 %{
   139938 void yyerror ( const char *msg);
   139939 int yylex (void);
   139940 typedef union { char const *val; } YYSTYPE;
   139941 %}
   139942 
   139943 %type <val> program
   139944 
   139945 %%
   139946 
   139947 program: { $$ = ""; };
   139948 _ATEOF
   139949 
   139950 
   139951 
   139952 
   139953 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   139954   at_save_special_files
   139955   mkdir xml-tests
   139956     # Don't combine these Bison invocations since we want to be sure that
   139957   # --report=all isn't required to get the full XML file.
   139958   { set +x
   139959 $as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   139960                   --graph=xml-tests/test.dot -o input.c input.y"
   139961 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:73"
   139962 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   139963                   --graph=xml-tests/test.dot -o input.c input.y
   139964 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139965 at_status=$? at_failed=false
   139966 $at_check_filter
   139967 echo stderr:; cat "$at_stderr"
   139968 echo stdout:; cat "$at_stdout"
   139969 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
   139970 $at_failed && at_fn_log_failure
   139971 $at_traceon; }
   139972 
   139973   { set +x
   139974 $as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   139975 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:73"
   139976 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   139977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139978 at_status=$? at_failed=false
   139979 $at_check_filter
   139980 echo stderr:; cat "$at_stderr"
   139981 echo stdout:; cat "$at_stdout"
   139982 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
   139983 $at_failed && at_fn_log_failure
   139984 $at_traceon; }
   139985 
   139986     cp xml-tests/test.output expout
   139987   { set +x
   139988 $as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\
   139989              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   139990              xml-tests/test.xml"
   139991 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73"
   139992 ( $at_check_trace; $XSLTPROC \
   139993              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   139994              xml-tests/test.xml
   139995 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   139996 at_status=$? at_failed=false
   139997 $at_check_filter
   139998 at_fn_diff_devnull "$at_stderr" || at_failed=:
   139999 $at_diff expout "$at_stdout" || at_failed=:
   140000 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
   140001 $at_failed && at_fn_log_failure
   140002 $at_traceon; }
   140003 
   140004   sort xml-tests/test.dot > expout
   140005   { set +x
   140006 $as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\
   140007              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   140008              xml-tests/test.xml | sort"
   140009 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73"
   140010 ( $at_check_trace; $XSLTPROC \
   140011              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   140012              xml-tests/test.xml | sort
   140013 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140014 at_status=$? at_failed=false
   140015 $at_check_filter
   140016 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140017 $at_diff expout "$at_stdout" || at_failed=:
   140018 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
   140019 $at_failed && at_fn_log_failure
   140020 $at_traceon; }
   140021 
   140022   rm -rf xml-tests expout
   140023   at_restore_special_files
   140024 fi
   140025 { set +x
   140026 $as_echo "$at_srcdir/regression.at:73: bison -o input.c input.y"
   140027 at_fn_check_prepare_trace "regression.at:73"
   140028 ( $at_check_trace; bison -o input.c input.y
   140029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140030 at_status=$? at_failed=false
   140031 $at_check_filter
   140032 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140033 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140034 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
   140035 $at_failed && at_fn_log_failure
   140036 $at_traceon; }
   140037 
   140038 
   140039 { set +x
   140040 $as_echo "$at_srcdir/regression.at:74: \$BISON_C_WORKS"
   140041 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:74"
   140042 ( $at_check_trace; $BISON_C_WORKS
   140043 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140044 at_status=$? at_failed=false
   140045 $at_check_filter
   140046 echo stderr:; cat "$at_stderr"
   140047 echo stdout:; cat "$at_stdout"
   140048 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:74"
   140049 $at_failed && at_fn_log_failure
   140050 $at_traceon; }
   140051 
   140052 { set +x
   140053 $as_echo "$at_srcdir/regression.at:74: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   140054 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:74"
   140055 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   140056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140057 at_status=$? at_failed=false
   140058 $at_check_filter
   140059 echo stderr:; cat "$at_stderr"
   140060 echo stdout:; cat "$at_stdout"
   140061 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:74"
   140062 $at_failed && at_fn_log_failure
   140063 $at_traceon; }
   140064 
   140065 
   140066   set +x
   140067   $at_times_p && times >"$at_times_file"
   140068 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   140069 read at_status <"$at_status_file"
   140070 #AT_STOP_269
   140071 #AT_START_270
   140072 at_fn_group_banner 270 'regression.at:85' \
   140073   "Early token definitions with --yacc" "            " 17
   140074 at_xfail=no
   140075 (
   140076   $as_echo "270. $at_setup_line: testing $at_desc ..."
   140077   $at_traceon
   140078 
   140079 
   140080 # Found in GCJ: they expect the tokens to be defined before the user
   140081 # prologue, so that they can use the token definitions in it.
   140082 
   140083 
   140084 cat >input.y <<'_ATEOF'
   140085 %code top {
   140086 #include <config.h>
   140087 /* We don't need perfect functions for these tests. */
   140088 #undef malloc
   140089 #undef memcmp
   140090 #undef realloc
   140091 }
   140092 
   140093 %{
   140094 void yyerror ( const char *msg);
   140095 int yylex (void);
   140096 %}
   140097 
   140098 %union
   140099 {
   140100   int val;
   140101 };
   140102 %{
   140103 #ifndef MY_TOKEN
   140104 # error "MY_TOKEN not defined."
   140105 #endif
   140106 %}
   140107 %token MY_TOKEN
   140108 %%
   140109 exp: MY_TOKEN;
   140110 %%
   140111 _ATEOF
   140112 
   140113 
   140114 
   140115 
   140116 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   140117   at_save_special_files
   140118   mkdir xml-tests
   140119     # Don't combine these Bison invocations since we want to be sure that
   140120   # --report=all isn't required to get the full XML file.
   140121   { set +x
   140122 $as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   140123                   --graph=xml-tests/test.dot -y -o input.c input.y"
   140124 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:113"
   140125 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   140126                   --graph=xml-tests/test.dot -y -o input.c input.y
   140127 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140128 at_status=$? at_failed=false
   140129 $at_check_filter
   140130 echo stderr:; cat "$at_stderr"
   140131 echo stdout:; cat "$at_stdout"
   140132 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
   140133 $at_failed && at_fn_log_failure
   140134 $at_traceon; }
   140135 
   140136   { set +x
   140137 $as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y"
   140138 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y" "regression.at:113"
   140139 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y
   140140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140141 at_status=$? at_failed=false
   140142 $at_check_filter
   140143 echo stderr:; cat "$at_stderr"
   140144 echo stdout:; cat "$at_stdout"
   140145 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
   140146 $at_failed && at_fn_log_failure
   140147 $at_traceon; }
   140148 
   140149     cp xml-tests/test.output expout
   140150   { set +x
   140151 $as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\
   140152              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   140153              xml-tests/test.xml"
   140154 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113"
   140155 ( $at_check_trace; $XSLTPROC \
   140156              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   140157              xml-tests/test.xml
   140158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140159 at_status=$? at_failed=false
   140160 $at_check_filter
   140161 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140162 $at_diff expout "$at_stdout" || at_failed=:
   140163 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
   140164 $at_failed && at_fn_log_failure
   140165 $at_traceon; }
   140166 
   140167   sort xml-tests/test.dot > expout
   140168   { set +x
   140169 $as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\
   140170              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   140171              xml-tests/test.xml | sort"
   140172 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113"
   140173 ( $at_check_trace; $XSLTPROC \
   140174              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   140175              xml-tests/test.xml | sort
   140176 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140177 at_status=$? at_failed=false
   140178 $at_check_filter
   140179 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140180 $at_diff expout "$at_stdout" || at_failed=:
   140181 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
   140182 $at_failed && at_fn_log_failure
   140183 $at_traceon; }
   140184 
   140185   rm -rf xml-tests expout
   140186   at_restore_special_files
   140187 fi
   140188 { set +x
   140189 $as_echo "$at_srcdir/regression.at:113: bison -y -o input.c input.y"
   140190 at_fn_check_prepare_trace "regression.at:113"
   140191 ( $at_check_trace; bison -y -o input.c input.y
   140192 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140193 at_status=$? at_failed=false
   140194 $at_check_filter
   140195 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140196 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140197 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
   140198 $at_failed && at_fn_log_failure
   140199 $at_traceon; }
   140200 
   140201 
   140202 { set +x
   140203 $as_echo "$at_srcdir/regression.at:114: \$BISON_C_WORKS"
   140204 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:114"
   140205 ( $at_check_trace; $BISON_C_WORKS
   140206 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140207 at_status=$? at_failed=false
   140208 $at_check_filter
   140209 echo stderr:; cat "$at_stderr"
   140210 echo stdout:; cat "$at_stdout"
   140211 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:114"
   140212 $at_failed && at_fn_log_failure
   140213 $at_traceon; }
   140214 
   140215 { set +x
   140216 $as_echo "$at_srcdir/regression.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   140217 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:114"
   140218 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   140219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140220 at_status=$? at_failed=false
   140221 $at_check_filter
   140222 echo stderr:; cat "$at_stderr"
   140223 echo stdout:; cat "$at_stdout"
   140224 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:114"
   140225 $at_failed && at_fn_log_failure
   140226 $at_traceon; }
   140227 
   140228 
   140229   set +x
   140230   $at_times_p && times >"$at_times_file"
   140231 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   140232 read at_status <"$at_status_file"
   140233 #AT_STOP_270
   140234 #AT_START_271
   140235 at_fn_group_banner 271 'regression.at:125' \
   140236   "Early token definitions without --yacc" "         " 17
   140237 at_xfail=no
   140238 (
   140239   $as_echo "271. $at_setup_line: testing $at_desc ..."
   140240   $at_traceon
   140241 
   140242 
   140243 # Found in GCJ: they expect the tokens to be defined before the user
   140244 # prologue, so that they can use the token definitions in it.
   140245 
   140246 
   140247 cat >input.y <<'_ATEOF'
   140248 %code top {
   140249 #include <config.h>
   140250 /* We don't need perfect functions for these tests. */
   140251 #undef malloc
   140252 #undef memcmp
   140253 #undef realloc
   140254 }
   140255 
   140256 %{
   140257 #include <stdio.h>
   140258 void yyerror ( const char *msg);
   140259 int yylex (void);
   140260 void print_my_token (void);
   140261 %}
   140262 
   140263 %union
   140264 {
   140265   int val;
   140266 };
   140267 %{
   140268 void
   140269 print_my_token (void)
   140270 {
   140271   enum yytokentype my_token = MY_TOKEN;
   140272   printf ("%d\n", my_token);
   140273 }
   140274 %}
   140275 %token MY_TOKEN
   140276 %%
   140277 exp: MY_TOKEN;
   140278 %%
   140279 _ATEOF
   140280 
   140281 
   140282 
   140283 
   140284 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   140285   at_save_special_files
   140286   mkdir xml-tests
   140287     # Don't combine these Bison invocations since we want to be sure that
   140288   # --report=all isn't required to get the full XML file.
   140289   { set +x
   140290 $as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   140291                   --graph=xml-tests/test.dot -o input.c input.y"
   140292 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:158"
   140293 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   140294                   --graph=xml-tests/test.dot -o input.c input.y
   140295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140296 at_status=$? at_failed=false
   140297 $at_check_filter
   140298 echo stderr:; cat "$at_stderr"
   140299 echo stdout:; cat "$at_stdout"
   140300 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
   140301 $at_failed && at_fn_log_failure
   140302 $at_traceon; }
   140303 
   140304   { set +x
   140305 $as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   140306 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:158"
   140307 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   140308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140309 at_status=$? at_failed=false
   140310 $at_check_filter
   140311 echo stderr:; cat "$at_stderr"
   140312 echo stdout:; cat "$at_stdout"
   140313 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
   140314 $at_failed && at_fn_log_failure
   140315 $at_traceon; }
   140316 
   140317     cp xml-tests/test.output expout
   140318   { set +x
   140319 $as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\
   140320              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   140321              xml-tests/test.xml"
   140322 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158"
   140323 ( $at_check_trace; $XSLTPROC \
   140324              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   140325              xml-tests/test.xml
   140326 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140327 at_status=$? at_failed=false
   140328 $at_check_filter
   140329 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140330 $at_diff expout "$at_stdout" || at_failed=:
   140331 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
   140332 $at_failed && at_fn_log_failure
   140333 $at_traceon; }
   140334 
   140335   sort xml-tests/test.dot > expout
   140336   { set +x
   140337 $as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\
   140338              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   140339              xml-tests/test.xml | sort"
   140340 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158"
   140341 ( $at_check_trace; $XSLTPROC \
   140342              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   140343              xml-tests/test.xml | sort
   140344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140345 at_status=$? at_failed=false
   140346 $at_check_filter
   140347 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140348 $at_diff expout "$at_stdout" || at_failed=:
   140349 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
   140350 $at_failed && at_fn_log_failure
   140351 $at_traceon; }
   140352 
   140353   rm -rf xml-tests expout
   140354   at_restore_special_files
   140355 fi
   140356 { set +x
   140357 $as_echo "$at_srcdir/regression.at:158: bison -o input.c input.y"
   140358 at_fn_check_prepare_trace "regression.at:158"
   140359 ( $at_check_trace; bison -o input.c input.y
   140360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140361 at_status=$? at_failed=false
   140362 $at_check_filter
   140363 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140364 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140365 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
   140366 $at_failed && at_fn_log_failure
   140367 $at_traceon; }
   140368 
   140369 
   140370 { set +x
   140371 $as_echo "$at_srcdir/regression.at:159: \$BISON_C_WORKS"
   140372 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:159"
   140373 ( $at_check_trace; $BISON_C_WORKS
   140374 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140375 at_status=$? at_failed=false
   140376 $at_check_filter
   140377 echo stderr:; cat "$at_stderr"
   140378 echo stdout:; cat "$at_stdout"
   140379 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:159"
   140380 $at_failed && at_fn_log_failure
   140381 $at_traceon; }
   140382 
   140383 { set +x
   140384 $as_echo "$at_srcdir/regression.at:159: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   140385 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:159"
   140386 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   140387 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140388 at_status=$? at_failed=false
   140389 $at_check_filter
   140390 echo stderr:; cat "$at_stderr"
   140391 echo stdout:; cat "$at_stdout"
   140392 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:159"
   140393 $at_failed && at_fn_log_failure
   140394 $at_traceon; }
   140395 
   140396 
   140397   set +x
   140398   $at_times_p && times >"$at_times_file"
   140399 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   140400 read at_status <"$at_status_file"
   140401 #AT_STOP_271
   140402 #AT_START_272
   140403 at_fn_group_banner 272 'regression.at:170' \
   140404   "Braces parsing" "                                 " 17
   140405 at_xfail=no
   140406 (
   140407   $as_echo "272. $at_setup_line: testing $at_desc ..."
   140408   $at_traceon
   140409 
   140410 
   140411 
   140412 cat >input.y <<'_ATEOF'
   140413 /* Bison used to swallow the character after '}'. */
   140414 
   140415 %%
   140416 exp: { tests = {{{{{{{{{{}}}}}}}}}}; };
   140417 %%
   140418 _ATEOF
   140419 
   140420 
   140421 
   140422 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   140423   at_save_special_files
   140424   mkdir xml-tests
   140425     # Don't combine these Bison invocations since we want to be sure that
   140426   # --report=all isn't required to get the full XML file.
   140427   { set +x
   140428 $as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   140429                   --graph=xml-tests/test.dot -v -o input.c input.y"
   140430 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:182"
   140431 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   140432                   --graph=xml-tests/test.dot -v -o input.c input.y
   140433 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140434 at_status=$? at_failed=false
   140435 $at_check_filter
   140436 echo stderr:; cat "$at_stderr"
   140437 echo stdout:; cat "$at_stdout"
   140438 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
   140439 $at_failed && at_fn_log_failure
   140440 $at_traceon; }
   140441 
   140442   { set +x
   140443 $as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y"
   140444 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:182"
   140445 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y
   140446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140447 at_status=$? at_failed=false
   140448 $at_check_filter
   140449 echo stderr:; cat "$at_stderr"
   140450 echo stdout:; cat "$at_stdout"
   140451 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
   140452 $at_failed && at_fn_log_failure
   140453 $at_traceon; }
   140454 
   140455     cp xml-tests/test.output expout
   140456   { set +x
   140457 $as_echo "$at_srcdir/regression.at:182: \$XSLTPROC \\
   140458              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   140459              xml-tests/test.xml"
   140460 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:182"
   140461 ( $at_check_trace; $XSLTPROC \
   140462              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   140463              xml-tests/test.xml
   140464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140465 at_status=$? at_failed=false
   140466 $at_check_filter
   140467 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140468 $at_diff expout "$at_stdout" || at_failed=:
   140469 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
   140470 $at_failed && at_fn_log_failure
   140471 $at_traceon; }
   140472 
   140473   sort xml-tests/test.dot > expout
   140474   { set +x
   140475 $as_echo "$at_srcdir/regression.at:182: \$XSLTPROC \\
   140476              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   140477              xml-tests/test.xml | sort"
   140478 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:182"
   140479 ( $at_check_trace; $XSLTPROC \
   140480              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   140481              xml-tests/test.xml | sort
   140482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140483 at_status=$? at_failed=false
   140484 $at_check_filter
   140485 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140486 $at_diff expout "$at_stdout" || at_failed=:
   140487 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
   140488 $at_failed && at_fn_log_failure
   140489 $at_traceon; }
   140490 
   140491   rm -rf xml-tests expout
   140492   at_restore_special_files
   140493 fi
   140494 { set +x
   140495 $as_echo "$at_srcdir/regression.at:182: bison -v -o input.c input.y"
   140496 at_fn_check_prepare_trace "regression.at:182"
   140497 ( $at_check_trace; bison -v -o input.c input.y
   140498 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140499 at_status=$? at_failed=false
   140500 $at_check_filter
   140501 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140502 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140503 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
   140504 $at_failed && at_fn_log_failure
   140505 $at_traceon; }
   140506 
   140507 
   140508 
   140509 { set +x
   140510 $as_echo "$at_srcdir/regression.at:184: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c"
   140511 at_fn_check_prepare_trace "regression.at:184"
   140512 ( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c
   140513 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140514 at_status=$? at_failed=false
   140515 $at_check_filter
   140516 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140517 echo stdout:; cat "$at_stdout"
   140518 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:184"
   140519 $at_failed && at_fn_log_failure
   140520 $at_traceon; }
   140521 
   140522 
   140523   set +x
   140524   $at_times_p && times >"$at_times_file"
   140525 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   140526 read at_status <"$at_status_file"
   140527 #AT_STOP_272
   140528 #AT_START_273
   140529 at_fn_group_banner 273 'regression.at:194' \
   140530   "Duplicate string" "                               " 17
   140531 at_xfail=no
   140532 (
   140533   $as_echo "273. $at_setup_line: testing $at_desc ..."
   140534   $at_traceon
   140535 
   140536 
   140537 
   140538 cat >input.y <<'_ATEOF'
   140539 /* 'Bison -v' used to dump core when two tokens are defined with the same
   140540    string, as LE and GE below. */
   140541 
   140542 %token NUM
   140543 %token LE "<="
   140544 %token GE "<="
   140545 
   140546 %%
   140547 exp: '(' exp ')' | NUM ;
   140548 %%
   140549 _ATEOF
   140550 
   140551 
   140552 
   140553 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   140554   at_save_special_files
   140555   mkdir xml-tests
   140556     # Don't combine these Bison invocations since we want to be sure that
   140557   # --report=all isn't required to get the full XML file.
   140558   { set +x
   140559 $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   140560                   --graph=xml-tests/test.dot -v -o input.c input.y"
   140561 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:211"
   140562 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   140563                   --graph=xml-tests/test.dot -v -o input.c input.y
   140564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140565 at_status=$? at_failed=false
   140566 $at_check_filter
   140567 echo stderr:; cat "$at_stderr"
   140568 echo stdout:; cat "$at_stdout"
   140569 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140570 $at_failed && at_fn_log_failure
   140571 $at_traceon; }
   140572 
   140573   { set +x
   140574 $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y"
   140575 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:211"
   140576 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y
   140577 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140578 at_status=$? at_failed=false
   140579 $at_check_filter
   140580 echo stderr:; cat "$at_stderr"
   140581 echo stdout:; cat "$at_stdout"
   140582 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140583 $at_failed && at_fn_log_failure
   140584 $at_traceon; }
   140585 
   140586     cp xml-tests/test.output expout
   140587   { set +x
   140588 $as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\
   140589              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   140590              xml-tests/test.xml"
   140591 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211"
   140592 ( $at_check_trace; $XSLTPROC \
   140593              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   140594              xml-tests/test.xml
   140595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140596 at_status=$? at_failed=false
   140597 $at_check_filter
   140598 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140599 $at_diff expout "$at_stdout" || at_failed=:
   140600 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140601 $at_failed && at_fn_log_failure
   140602 $at_traceon; }
   140603 
   140604   sort xml-tests/test.dot > expout
   140605   { set +x
   140606 $as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\
   140607              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   140608              xml-tests/test.xml | sort"
   140609 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211"
   140610 ( $at_check_trace; $XSLTPROC \
   140611              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   140612              xml-tests/test.xml | sort
   140613 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140614 at_status=$? at_failed=false
   140615 $at_check_filter
   140616 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140617 $at_diff expout "$at_stdout" || at_failed=:
   140618 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140619 $at_failed && at_fn_log_failure
   140620 $at_traceon; }
   140621 
   140622   rm -rf xml-tests expout
   140623   at_restore_special_files
   140624 fi
   140625 { set +x
   140626 $as_echo "$at_srcdir/regression.at:211: bison -v -o input.c input.y"
   140627 at_fn_check_prepare_trace "regression.at:211"
   140628 ( $at_check_trace; bison -v -o input.c input.y
   140629 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140630 at_status=$? at_failed=false
   140631 $at_check_filter
   140632 echo >>"$at_stderr"; $as_echo "input.y:6.8-14: warning: symbol \"<=\" used more than once as a literal string
   140633 " | \
   140634   $at_diff - "$at_stderr" || at_failed=:
   140635 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140636 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140637 $at_failed && at_fn_log_failure
   140638 $at_traceon; }
   140639 
   140640 # Defining POSIXLY_CORRECT causes bison to complain if options are
   140641 # added after the grammar file name, so skip these checks in that
   140642 # case.
   140643 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   140644   at_save_special_files
   140645 
   140646   # To avoid expanding it repeatedly, store specified stdout.
   140647   : >expout
   140648 
   140649   # Run with -Werror.
   140650   { set +x
   140651 $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror"
   140652 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror" "regression.at:211"
   140653 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror
   140654 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140655 at_status=$? at_failed=false
   140656 $at_check_filter
   140657 echo stderr:; tee stderr <"$at_stderr"
   140658 $at_diff expout "$at_stdout" || at_failed=:
   140659 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:211"
   140660 $at_failed && at_fn_log_failure
   140661 $at_traceon; }
   140662 
   140663 
   140664   # Build expected stderr up to and including the "warnings being
   140665   # treated as errors" message.
   140666   cat >at-bison-check-warnings <<'_ATEOF'
   140667 input.y:6.8-14: warning: symbol "<=" used more than once as a literal string
   140668 _ATEOF
   140669 
   140670   at_bison_check_first=`sed -n \
   140671     '/: warning: /{=;q;}' at-bison-check-warnings`
   140672   : ${at_bison_check_first:=1}
   140673   at_bison_check_first_tmp=`sed -n \
   140674     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   140675   : ${at_bison_check_first_tmp:=1}
   140676   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   140677     at_bison_check_first=$at_bison_check_first_tmp
   140678   fi
   140679   if test $at_bison_check_first -gt 1; then
   140680     sed -n "1,`expr $at_bison_check_first - 1`"p \
   140681       at-bison-check-warnings > experr
   140682   fi
   140683   echo 'bison: warnings being treated as errors' >> experr
   140684 
   140685   # Finish building expected stderr and check.  Unlike warnings,
   140686   # complaints cause bison to exit early.  Thus, with -Werror, bison
   140687   # does not necessarily report all warnings that it does without
   140688   # -Werror, but it at least reports one.
   140689   at_bison_check_last=`sed -n '$=' stderr`
   140690   : ${at_bison_check_last:=1}
   140691   at_bison_check_last=`expr $at_bison_check_last - 1`
   140692   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   140693     at-bison-check-warnings >> experr
   140694   { set +x
   140695 $as_echo "$at_srcdir/regression.at:211: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   140696               stderr 1>&2"
   140697 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:211"
   140698 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   140699               stderr 1>&2
   140700 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140701 at_status=$? at_failed=false
   140702 $at_check_filter
   140703 $at_diff experr "$at_stderr" || at_failed=:
   140704 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140705 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140706 $at_failed && at_fn_log_failure
   140707 $at_traceon; }
   140708 
   140709 
   140710   # Now check --warnings=error.
   140711   cp stderr experr
   140712   { set +x
   140713 $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error"
   140714 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error" "regression.at:211"
   140715 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error
   140716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140717 at_status=$? at_failed=false
   140718 $at_check_filter
   140719 $at_diff experr "$at_stderr" || at_failed=:
   140720 $at_diff expout "$at_stdout" || at_failed=:
   140721 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:211"
   140722 $at_failed && at_fn_log_failure
   140723 $at_traceon; }
   140724 
   140725 
   140726   # Now check -Wnone and --warnings=none by making sure that
   140727   # -Werror doesn't change the exit status when -Wnone or
   140728   # --warnings=none is specified.
   140729   { set +x
   140730 $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror"
   140731 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror" "regression.at:211"
   140732 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror
   140733 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140734 at_status=$? at_failed=false
   140735 $at_check_filter
   140736 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140737 $at_diff expout "$at_stdout" || at_failed=:
   140738 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140739 $at_failed && at_fn_log_failure
   140740 $at_traceon; }
   140741 
   140742   { set +x
   140743 $as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror"
   140744 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror" "regression.at:211"
   140745 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror
   140746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140747 at_status=$? at_failed=false
   140748 $at_check_filter
   140749 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140750 $at_diff expout "$at_stdout" || at_failed=:
   140751 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
   140752 $at_failed && at_fn_log_failure
   140753 $at_traceon; }
   140754 
   140755 
   140756   at_restore_special_files
   140757 fi
   140758 
   140759   set +x
   140760   $at_times_p && times >"$at_times_file"
   140761 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   140762 read at_status <"$at_status_file"
   140763 #AT_STOP_273
   140764 #AT_START_274
   140765 at_fn_group_banner 274 'regression.at:222' \
   140766   "Rule Line Numbers" "                              " 17
   140767 at_xfail=no
   140768 (
   140769   $as_echo "274. $at_setup_line: testing $at_desc ..."
   140770   $at_traceon
   140771 
   140772 
   140773 
   140774 
   140775 
   140776 cat >input.y <<'_ATEOF'
   140777 %%
   140778 expr:
   140779 'a'
   140780 
   140781 {
   140782 
   140783 }
   140784 
   140785 'b'
   140786 
   140787 {
   140788 
   140789 }
   140790 
   140791 |
   140792 
   140793 
   140794 {
   140795 
   140796 
   140797 }
   140798 
   140799 'c'
   140800 
   140801 {
   140802 
   140803 };
   140804 _ATEOF
   140805 
   140806 
   140807 
   140808 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   140809   at_save_special_files
   140810   mkdir xml-tests
   140811     # Don't combine these Bison invocations since we want to be sure that
   140812   # --report=all isn't required to get the full XML file.
   140813   { set +x
   140814 $as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   140815                   --graph=xml-tests/test.dot -o input.c -v input.y"
   140816 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:258"
   140817 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   140818                   --graph=xml-tests/test.dot -o input.c -v input.y
   140819 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140820 at_status=$? at_failed=false
   140821 $at_check_filter
   140822 echo stderr:; cat "$at_stderr"
   140823 echo stdout:; cat "$at_stdout"
   140824 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
   140825 $at_failed && at_fn_log_failure
   140826 $at_traceon; }
   140827 
   140828   { set +x
   140829 $as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y"
   140830 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y" "regression.at:258"
   140831 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y
   140832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140833 at_status=$? at_failed=false
   140834 $at_check_filter
   140835 echo stderr:; cat "$at_stderr"
   140836 echo stdout:; cat "$at_stdout"
   140837 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
   140838 $at_failed && at_fn_log_failure
   140839 $at_traceon; }
   140840 
   140841     cp xml-tests/test.output expout
   140842   { set +x
   140843 $as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\
   140844              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   140845              xml-tests/test.xml"
   140846 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258"
   140847 ( $at_check_trace; $XSLTPROC \
   140848              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   140849              xml-tests/test.xml
   140850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140851 at_status=$? at_failed=false
   140852 $at_check_filter
   140853 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140854 $at_diff expout "$at_stdout" || at_failed=:
   140855 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
   140856 $at_failed && at_fn_log_failure
   140857 $at_traceon; }
   140858 
   140859   sort xml-tests/test.dot > expout
   140860   { set +x
   140861 $as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\
   140862              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   140863              xml-tests/test.xml | sort"
   140864 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258"
   140865 ( $at_check_trace; $XSLTPROC \
   140866              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   140867              xml-tests/test.xml | sort
   140868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140869 at_status=$? at_failed=false
   140870 $at_check_filter
   140871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140872 $at_diff expout "$at_stdout" || at_failed=:
   140873 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
   140874 $at_failed && at_fn_log_failure
   140875 $at_traceon; }
   140876 
   140877   rm -rf xml-tests expout
   140878   at_restore_special_files
   140879 fi
   140880 { set +x
   140881 $as_echo "$at_srcdir/regression.at:258: bison -o input.c -v input.y"
   140882 at_fn_check_prepare_trace "regression.at:258"
   140883 ( $at_check_trace; bison -o input.c -v input.y
   140884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140885 at_status=$? at_failed=false
   140886 $at_check_filter
   140887 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140888 at_fn_diff_devnull "$at_stdout" || at_failed=:
   140889 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
   140890 $at_failed && at_fn_log_failure
   140891 $at_traceon; }
   140892 
   140893 
   140894 
   140895 # Check the contents of the report.
   140896 { set +x
   140897 $as_echo "$at_srcdir/regression.at:261: cat input.output"
   140898 at_fn_check_prepare_trace "regression.at:261"
   140899 ( $at_check_trace; cat input.output
   140900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   140901 at_status=$? at_failed=false
   140902 $at_check_filter
   140903 at_fn_diff_devnull "$at_stderr" || at_failed=:
   140904 echo >>"$at_stdout"; $as_echo "Grammar
   140905 
   140906     0 \$accept: expr \$end
   140907 
   140908     1 \$@1: /* empty */
   140909 
   140910     2 expr: 'a' \$@1 'b'
   140911 
   140912     3 \$@2: /* empty */
   140913 
   140914     4 expr: \$@2 'c'
   140915 
   140916 
   140917 Terminals, with rules where they appear
   140918 
   140919 \$end (0) 0
   140920 'a' (97) 2
   140921 'b' (98) 2
   140922 'c' (99) 4
   140923 error (256)
   140924 
   140925 
   140926 Nonterminals, with rules where they appear
   140927 
   140928 \$accept (6)
   140929     on left: 0
   140930 expr (7)
   140931     on left: 2 4, on right: 0
   140932 \$@1 (8)
   140933     on left: 1, on right: 2
   140934 \$@2 (9)
   140935     on left: 3, on right: 4
   140936 
   140937 
   140938 State 0
   140939 
   140940     0 \$accept: . expr \$end
   140941 
   140942     'a'  shift, and go to state 1
   140943 
   140944     \$default  reduce using rule 3 (\$@2)
   140945 
   140946     expr  go to state 2
   140947     \$@2   go to state 3
   140948 
   140949 
   140950 State 1
   140951 
   140952     2 expr: 'a' . \$@1 'b'
   140953 
   140954     \$default  reduce using rule 1 (\$@1)
   140955 
   140956     \$@1  go to state 4
   140957 
   140958 
   140959 State 2
   140960 
   140961     0 \$accept: expr . \$end
   140962 
   140963     \$end  shift, and go to state 5
   140964 
   140965 
   140966 State 3
   140967 
   140968     4 expr: \$@2 . 'c'
   140969 
   140970     'c'  shift, and go to state 6
   140971 
   140972 
   140973 State 4
   140974 
   140975     2 expr: 'a' \$@1 . 'b'
   140976 
   140977     'b'  shift, and go to state 7
   140978 
   140979 
   140980 State 5
   140981 
   140982     0 \$accept: expr \$end .
   140983 
   140984     \$default  accept
   140985 
   140986 
   140987 State 6
   140988 
   140989     4 expr: \$@2 'c' .
   140990 
   140991     \$default  reduce using rule 4 (expr)
   140992 
   140993 
   140994 State 7
   140995 
   140996     2 expr: 'a' \$@1 'b' .
   140997 
   140998     \$default  reduce using rule 2 (expr)
   140999 " | \
   141000   $at_diff - "$at_stdout" || at_failed=:
   141001 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:261"
   141002 $at_failed && at_fn_log_failure
   141003 $at_traceon; }
   141004 
   141005 
   141006   set +x
   141007   $at_times_p && times >"$at_times_file"
   141008 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   141009 read at_status <"$at_status_file"
   141010 #AT_STOP_274
   141011 #AT_START_275
   141012 at_fn_group_banner 275 'regression.at:368' \
   141013   "Mixing %token styles" "                           " 17
   141014 at_xfail=no
   141015 (
   141016   $as_echo "275. $at_setup_line: testing $at_desc ..."
   141017   $at_traceon
   141018 
   141019 
   141020 # Taken from the documentation.
   141021 cat >input.y <<'_ATEOF'
   141022 %token  <operator>  OR      "||"
   141023 %token  <operator>  LE 134  "<="
   141024 %left  OR  "<="
   141025 %%
   141026 exp: ;
   141027 %%
   141028 _ATEOF
   141029 
   141030 
   141031 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   141032   at_save_special_files
   141033   mkdir xml-tests
   141034     # Don't combine these Bison invocations since we want to be sure that
   141035   # --report=all isn't required to get the full XML file.
   141036   { set +x
   141037 $as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   141038                   --graph=xml-tests/test.dot -v -o input.c input.y"
   141039 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:380"
   141040 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   141041                   --graph=xml-tests/test.dot -v -o input.c input.y
   141042 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141043 at_status=$? at_failed=false
   141044 $at_check_filter
   141045 echo stderr:; cat "$at_stderr"
   141046 echo stdout:; cat "$at_stdout"
   141047 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
   141048 $at_failed && at_fn_log_failure
   141049 $at_traceon; }
   141050 
   141051   { set +x
   141052 $as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y"
   141053 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:380"
   141054 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y
   141055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141056 at_status=$? at_failed=false
   141057 $at_check_filter
   141058 echo stderr:; cat "$at_stderr"
   141059 echo stdout:; cat "$at_stdout"
   141060 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
   141061 $at_failed && at_fn_log_failure
   141062 $at_traceon; }
   141063 
   141064     cp xml-tests/test.output expout
   141065   { set +x
   141066 $as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\
   141067              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   141068              xml-tests/test.xml"
   141069 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380"
   141070 ( $at_check_trace; $XSLTPROC \
   141071              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   141072              xml-tests/test.xml
   141073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141074 at_status=$? at_failed=false
   141075 $at_check_filter
   141076 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141077 $at_diff expout "$at_stdout" || at_failed=:
   141078 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
   141079 $at_failed && at_fn_log_failure
   141080 $at_traceon; }
   141081 
   141082   sort xml-tests/test.dot > expout
   141083   { set +x
   141084 $as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\
   141085              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   141086              xml-tests/test.xml | sort"
   141087 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380"
   141088 ( $at_check_trace; $XSLTPROC \
   141089              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   141090              xml-tests/test.xml | sort
   141091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141092 at_status=$? at_failed=false
   141093 $at_check_filter
   141094 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141095 $at_diff expout "$at_stdout" || at_failed=:
   141096 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
   141097 $at_failed && at_fn_log_failure
   141098 $at_traceon; }
   141099 
   141100   rm -rf xml-tests expout
   141101   at_restore_special_files
   141102 fi
   141103 { set +x
   141104 $as_echo "$at_srcdir/regression.at:380: bison -v -o input.c input.y"
   141105 at_fn_check_prepare_trace "regression.at:380"
   141106 ( $at_check_trace; bison -v -o input.c input.y
   141107 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141108 at_status=$? at_failed=false
   141109 $at_check_filter
   141110 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141111 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141112 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
   141113 $at_failed && at_fn_log_failure
   141114 $at_traceon; }
   141115 
   141116 
   141117 
   141118   set +x
   141119   $at_times_p && times >"$at_times_file"
   141120 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   141121 read at_status <"$at_status_file"
   141122 #AT_STOP_275
   141123 #AT_START_276
   141124 at_fn_group_banner 276 'regression.at:391' \
   141125   "Invalid inputs" "                                 " 17
   141126 at_xfail=no
   141127 (
   141128   $as_echo "276. $at_setup_line: testing $at_desc ..."
   141129   $at_traceon
   141130 
   141131 
   141132 cat >input.y <<'_ATEOF'
   141133 %%
   141134 ?
   141135 default: 'a' }
   141136 %&
   141137 %a-does-not-exist
   141138 %-
   141139 %{
   141140 _ATEOF
   141141 
   141142 
   141143 
   141144 { set +x
   141145 $as_echo "$at_srcdir/regression.at:403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   141146 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "regression.at:403"
   141147 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   141148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141149 at_status=$? at_failed=false
   141150 $at_check_filter
   141151 echo >>"$at_stderr"; $as_echo "input.y:2.1: error: invalid character: '?'
   141152 input.y:3.14: error: invalid character: '}'
   141153 input.y:4.1: error: invalid character: '%'
   141154 input.y:4.2: error: invalid character: '&'
   141155 input.y:5.1-17: error: invalid directive: '%a-does-not-exist'
   141156 input.y:6.1: error: invalid character: '%'
   141157 input.y:6.2: error: invalid character: '-'
   141158 input.y:7.1-8.0: error: missing '%}' at end of file
   141159 input.y:7.1-8.0: error: syntax error, unexpected %{...%}
   141160 " | \
   141161   $at_diff - "$at_stderr" || at_failed=:
   141162 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141163 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:403"
   141164 $at_failed && at_fn_log_failure
   141165 $at_traceon; }
   141166 
   141167 
   141168 
   141169   set +x
   141170   $at_times_p && times >"$at_times_file"
   141171 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   141172 read at_status <"$at_status_file"
   141173 #AT_STOP_276
   141174 #AT_START_277
   141175 at_fn_group_banner 277 'regression.at:418' \
   141176   "Invalid inputs with {}" "                         " 17
   141177 at_xfail=no
   141178 (
   141179   $as_echo "277. $at_setup_line: testing $at_desc ..."
   141180   $at_traceon
   141181 
   141182 
   141183 cat >input.y <<'_ATEOF'
   141184 
   141185 %destructor
   141186 %initial-action
   141187 %lex-param
   141188 %parse-param
   141189 %printer
   141190 %union
   141191 _ATEOF
   141192 
   141193 
   141194 
   141195 { set +x
   141196 $as_echo "$at_srcdir/regression.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   141197 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "regression.at:430"
   141198 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   141199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141200 at_status=$? at_failed=false
   141201 $at_check_filter
   141202 echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
   141203 " | \
   141204   $at_diff - "$at_stderr" || at_failed=:
   141205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141206 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:430"
   141207 $at_failed && at_fn_log_failure
   141208 $at_traceon; }
   141209 
   141210 
   141211 
   141212   set +x
   141213   $at_times_p && times >"$at_times_file"
   141214 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   141215 read at_status <"$at_status_file"
   141216 #AT_STOP_277
   141217 #AT_START_278
   141218 at_fn_group_banner 278 'regression.at:443' \
   141219   "Token definitions" "                              " 17
   141220 at_xfail=no
   141221 (
   141222   $as_echo "278. $at_setup_line: testing $at_desc ..."
   141223   $at_traceon
   141224 
   141225 
   141226 
   141227 # Bison managed, when fed with '%token 'f' "f"' to #define 'f'!
   141228 cat >input.y <<'_ATEOF'
   141229 %code top {
   141230 #include <config.h>
   141231 /* We don't need perfect functions for these tests. */
   141232 #undef malloc
   141233 #undef memcmp
   141234 #undef realloc
   141235 }
   141236 
   141237 %{
   141238 #include <stdlib.h>
   141239 #include <stdio.h>
   141240 static void yyerror ( const char *msg);
   141241 static int yylex (void);
   141242 %}
   141243 %error-verbose
   141244 %token MYEOF 0 "end of file"
   141245 %token 'a' "a"
   141246 %token B_TOKEN "b"
   141247 %token C_TOKEN 'c'
   141248 %token 'd' D_TOKEN
   141249 %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
   141250 %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
   141251 %%
   141252 exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
   141253 %%
   141254 #include <stdio.h>
   141255 /* A C error reporting function.  */
   141256 static
   141257 void yyerror ( const char *msg)
   141258 {
   141259   fprintf (stderr, "%s\n", msg);
   141260 }
   141261 #include <assert.h>
   141262 static
   141263 int yylex (void)
   141264 {
   141265   static int const input[] = { SPECIAL };
   141266   static size_t toknum = 0;
   141267   int res;
   141268   ;
   141269   assert (toknum < sizeof input / sizeof input[0]);
   141270   res = input[toknum++];
   141271   ;
   141272   return res;
   141273 }
   141274 
   141275 int
   141276 main (void)
   141277 {
   141278   return yyparse ();
   141279 }
   141280 _ATEOF
   141281 
   141282 
   141283 
   141284 
   141285 # Checking the warning message guarantees that the trigraph "??!" isn't
   141286 # unnecessarily escaped here even though it would need to be if encoded in a
   141287 # C-string literal.  Also notice that unnecessary escaping, such as "\?", from
   141288 # the user specification is eliminated.
   141289 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   141290   at_save_special_files
   141291   mkdir xml-tests
   141292     # Don't combine these Bison invocations since we want to be sure that
   141293   # --report=all isn't required to get the full XML file.
   141294   { set +x
   141295 $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   141296                   --graph=xml-tests/test.dot -o input.c input.y"
   141297 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:480"
   141298 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   141299                   --graph=xml-tests/test.dot -o input.c input.y
   141300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141301 at_status=$? at_failed=false
   141302 $at_check_filter
   141303 echo stderr:; cat "$at_stderr"
   141304 echo stdout:; cat "$at_stdout"
   141305 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141306 $at_failed && at_fn_log_failure
   141307 $at_traceon; }
   141308 
   141309   { set +x
   141310 $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   141311 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:480"
   141312 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   141313 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141314 at_status=$? at_failed=false
   141315 $at_check_filter
   141316 echo stderr:; cat "$at_stderr"
   141317 echo stdout:; cat "$at_stdout"
   141318 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141319 $at_failed && at_fn_log_failure
   141320 $at_traceon; }
   141321 
   141322     cp xml-tests/test.output expout
   141323   { set +x
   141324 $as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\
   141325              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   141326              xml-tests/test.xml"
   141327 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480"
   141328 ( $at_check_trace; $XSLTPROC \
   141329              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   141330              xml-tests/test.xml
   141331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141332 at_status=$? at_failed=false
   141333 $at_check_filter
   141334 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141335 $at_diff expout "$at_stdout" || at_failed=:
   141336 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141337 $at_failed && at_fn_log_failure
   141338 $at_traceon; }
   141339 
   141340   sort xml-tests/test.dot > expout
   141341   { set +x
   141342 $as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\
   141343              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   141344              xml-tests/test.xml | sort"
   141345 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480"
   141346 ( $at_check_trace; $XSLTPROC \
   141347              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   141348              xml-tests/test.xml | sort
   141349 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141350 at_status=$? at_failed=false
   141351 $at_check_filter
   141352 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141353 $at_diff expout "$at_stdout" || at_failed=:
   141354 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141355 $at_failed && at_fn_log_failure
   141356 $at_traceon; }
   141357 
   141358   rm -rf xml-tests expout
   141359   at_restore_special_files
   141360 fi
   141361 { set +x
   141362 $as_echo "$at_srcdir/regression.at:480: bison -o input.c input.y"
   141363 at_fn_check_prepare_trace "regression.at:480"
   141364 ( $at_check_trace; bison -o input.c input.y
   141365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141366 at_status=$? at_failed=false
   141367 $at_check_filter
   141368 echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared
   141369 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
   141370 " | \
   141371   $at_diff - "$at_stderr" || at_failed=:
   141372 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141373 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141374 $at_failed && at_fn_log_failure
   141375 $at_traceon; }
   141376 
   141377 # Defining POSIXLY_CORRECT causes bison to complain if options are
   141378 # added after the grammar file name, so skip these checks in that
   141379 # case.
   141380 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   141381   at_save_special_files
   141382 
   141383   # To avoid expanding it repeatedly, store specified stdout.
   141384   : >expout
   141385 
   141386   # Run with -Werror.
   141387   { set +x
   141388 $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror"
   141389 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "regression.at:480"
   141390 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror
   141391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141392 at_status=$? at_failed=false
   141393 $at_check_filter
   141394 echo stderr:; tee stderr <"$at_stderr"
   141395 $at_diff expout "$at_stdout" || at_failed=:
   141396 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:480"
   141397 $at_failed && at_fn_log_failure
   141398 $at_traceon; }
   141399 
   141400 
   141401   # Build expected stderr up to and including the "warnings being
   141402   # treated as errors" message.
   141403   cat >at-bison-check-warnings <<'_ATEOF'
   141404 input.y:22.8-14: warning: symbol SPECIAL redeclared
   141405 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
   141406 _ATEOF
   141407 
   141408   at_bison_check_first=`sed -n \
   141409     '/: warning: /{=;q;}' at-bison-check-warnings`
   141410   : ${at_bison_check_first:=1}
   141411   at_bison_check_first_tmp=`sed -n \
   141412     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   141413   : ${at_bison_check_first_tmp:=1}
   141414   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   141415     at_bison_check_first=$at_bison_check_first_tmp
   141416   fi
   141417   if test $at_bison_check_first -gt 1; then
   141418     sed -n "1,`expr $at_bison_check_first - 1`"p \
   141419       at-bison-check-warnings > experr
   141420   fi
   141421   echo 'bison: warnings being treated as errors' >> experr
   141422 
   141423   # Finish building expected stderr and check.  Unlike warnings,
   141424   # complaints cause bison to exit early.  Thus, with -Werror, bison
   141425   # does not necessarily report all warnings that it does without
   141426   # -Werror, but it at least reports one.
   141427   at_bison_check_last=`sed -n '$=' stderr`
   141428   : ${at_bison_check_last:=1}
   141429   at_bison_check_last=`expr $at_bison_check_last - 1`
   141430   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   141431     at-bison-check-warnings >> experr
   141432   { set +x
   141433 $as_echo "$at_srcdir/regression.at:480: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   141434               stderr 1>&2"
   141435 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:480"
   141436 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   141437               stderr 1>&2
   141438 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141439 at_status=$? at_failed=false
   141440 $at_check_filter
   141441 $at_diff experr "$at_stderr" || at_failed=:
   141442 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141443 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141444 $at_failed && at_fn_log_failure
   141445 $at_traceon; }
   141446 
   141447 
   141448   # Now check --warnings=error.
   141449   cp stderr experr
   141450   { set +x
   141451 $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error"
   141452 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "regression.at:480"
   141453 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error
   141454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141455 at_status=$? at_failed=false
   141456 $at_check_filter
   141457 $at_diff experr "$at_stderr" || at_failed=:
   141458 $at_diff expout "$at_stdout" || at_failed=:
   141459 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:480"
   141460 $at_failed && at_fn_log_failure
   141461 $at_traceon; }
   141462 
   141463 
   141464   # Now check -Wnone and --warnings=none by making sure that
   141465   # -Werror doesn't change the exit status when -Wnone or
   141466   # --warnings=none is specified.
   141467   { set +x
   141468 $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror"
   141469 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "regression.at:480"
   141470 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror
   141471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141472 at_status=$? at_failed=false
   141473 $at_check_filter
   141474 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141475 $at_diff expout "$at_stdout" || at_failed=:
   141476 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141477 $at_failed && at_fn_log_failure
   141478 $at_traceon; }
   141479 
   141480   { set +x
   141481 $as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror"
   141482 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "regression.at:480"
   141483 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror
   141484 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141485 at_status=$? at_failed=false
   141486 $at_check_filter
   141487 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141488 $at_diff expout "$at_stdout" || at_failed=:
   141489 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
   141490 $at_failed && at_fn_log_failure
   141491 $at_traceon; }
   141492 
   141493 
   141494   at_restore_special_files
   141495 fi
   141496 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   141497   at_save_special_files
   141498   mkdir xml-tests
   141499     # Don't combine these Bison invocations since we want to be sure that
   141500   # --report=all isn't required to get the full XML file.
   141501   { set +x
   141502 $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   141503                   --graph=xml-tests/test.dot -fcaret -o input.c input.y"
   141504 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:484"
   141505 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   141506                   --graph=xml-tests/test.dot -fcaret -o input.c input.y
   141507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141508 at_status=$? at_failed=false
   141509 $at_check_filter
   141510 echo stderr:; cat "$at_stderr"
   141511 echo stdout:; cat "$at_stdout"
   141512 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141513 $at_failed && at_fn_log_failure
   141514 $at_traceon; }
   141515 
   141516   { set +x
   141517 $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y"
   141518 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "regression.at:484"
   141519 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y
   141520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141521 at_status=$? at_failed=false
   141522 $at_check_filter
   141523 echo stderr:; cat "$at_stderr"
   141524 echo stdout:; cat "$at_stdout"
   141525 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141526 $at_failed && at_fn_log_failure
   141527 $at_traceon; }
   141528 
   141529     cp xml-tests/test.output expout
   141530   { set +x
   141531 $as_echo "$at_srcdir/regression.at:484: \$XSLTPROC \\
   141532              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   141533              xml-tests/test.xml"
   141534 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:484"
   141535 ( $at_check_trace; $XSLTPROC \
   141536              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   141537              xml-tests/test.xml
   141538 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141539 at_status=$? at_failed=false
   141540 $at_check_filter
   141541 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141542 $at_diff expout "$at_stdout" || at_failed=:
   141543 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141544 $at_failed && at_fn_log_failure
   141545 $at_traceon; }
   141546 
   141547   sort xml-tests/test.dot > expout
   141548   { set +x
   141549 $as_echo "$at_srcdir/regression.at:484: \$XSLTPROC \\
   141550              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   141551              xml-tests/test.xml | sort"
   141552 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:484"
   141553 ( $at_check_trace; $XSLTPROC \
   141554              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   141555              xml-tests/test.xml | sort
   141556 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141557 at_status=$? at_failed=false
   141558 $at_check_filter
   141559 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141560 $at_diff expout "$at_stdout" || at_failed=:
   141561 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141562 $at_failed && at_fn_log_failure
   141563 $at_traceon; }
   141564 
   141565   rm -rf xml-tests expout
   141566   at_restore_special_files
   141567 fi
   141568 { set +x
   141569 $as_echo "$at_srcdir/regression.at:484: bison -fcaret -o input.c input.y"
   141570 at_fn_check_prepare_trace "regression.at:484"
   141571 ( $at_check_trace; bison -fcaret -o input.c input.y
   141572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141573 at_status=$? at_failed=false
   141574 $at_check_filter
   141575 echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared
   141576  %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\"
   141577         ^^^^^^^
   141578 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
   141579  %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\"
   141580         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   141581 " | \
   141582   $at_diff - "$at_stderr" || at_failed=:
   141583 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141584 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141585 $at_failed && at_fn_log_failure
   141586 $at_traceon; }
   141587 
   141588 # Defining POSIXLY_CORRECT causes bison to complain if options are
   141589 # added after the grammar file name, so skip these checks in that
   141590 # case.
   141591 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   141592   at_save_special_files
   141593 
   141594   # To avoid expanding it repeatedly, store specified stdout.
   141595   : >expout
   141596 
   141597   # Run with -Werror.
   141598   { set +x
   141599 $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror"
   141600 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "regression.at:484"
   141601 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror
   141602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141603 at_status=$? at_failed=false
   141604 $at_check_filter
   141605 echo stderr:; tee stderr <"$at_stderr"
   141606 $at_diff expout "$at_stdout" || at_failed=:
   141607 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:484"
   141608 $at_failed && at_fn_log_failure
   141609 $at_traceon; }
   141610 
   141611 
   141612   # Build expected stderr up to and including the "warnings being
   141613   # treated as errors" message.
   141614   cat >at-bison-check-warnings <<'_ATEOF'
   141615 input.y:22.8-14: warning: symbol SPECIAL redeclared
   141616  %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
   141617         ^^^^^^^
   141618 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
   141619  %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
   141620         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   141621 _ATEOF
   141622 
   141623   at_bison_check_first=`sed -n \
   141624     '/: warning: /{=;q;}' at-bison-check-warnings`
   141625   : ${at_bison_check_first:=1}
   141626   at_bison_check_first_tmp=`sed -n \
   141627     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   141628   : ${at_bison_check_first_tmp:=1}
   141629   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   141630     at_bison_check_first=$at_bison_check_first_tmp
   141631   fi
   141632   if test $at_bison_check_first -gt 1; then
   141633     sed -n "1,`expr $at_bison_check_first - 1`"p \
   141634       at-bison-check-warnings > experr
   141635   fi
   141636   echo 'bison: warnings being treated as errors' >> experr
   141637 
   141638   # Finish building expected stderr and check.  Unlike warnings,
   141639   # complaints cause bison to exit early.  Thus, with -Werror, bison
   141640   # does not necessarily report all warnings that it does without
   141641   # -Werror, but it at least reports one.
   141642   at_bison_check_last=`sed -n '$=' stderr`
   141643   : ${at_bison_check_last:=1}
   141644   at_bison_check_last=`expr $at_bison_check_last - 1`
   141645   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   141646     at-bison-check-warnings >> experr
   141647   { set +x
   141648 $as_echo "$at_srcdir/regression.at:484: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   141649               stderr 1>&2"
   141650 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:484"
   141651 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   141652               stderr 1>&2
   141653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141654 at_status=$? at_failed=false
   141655 $at_check_filter
   141656 $at_diff experr "$at_stderr" || at_failed=:
   141657 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141658 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141659 $at_failed && at_fn_log_failure
   141660 $at_traceon; }
   141661 
   141662 
   141663   # Now check --warnings=error.
   141664   cp stderr experr
   141665   { set +x
   141666 $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error"
   141667 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "regression.at:484"
   141668 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error
   141669 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141670 at_status=$? at_failed=false
   141671 $at_check_filter
   141672 $at_diff experr "$at_stderr" || at_failed=:
   141673 $at_diff expout "$at_stdout" || at_failed=:
   141674 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:484"
   141675 $at_failed && at_fn_log_failure
   141676 $at_traceon; }
   141677 
   141678 
   141679   # Now check -Wnone and --warnings=none by making sure that
   141680   # -Werror doesn't change the exit status when -Wnone or
   141681   # --warnings=none is specified.
   141682   { set +x
   141683 $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror"
   141684 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "regression.at:484"
   141685 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror
   141686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141687 at_status=$? at_failed=false
   141688 $at_check_filter
   141689 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141690 $at_diff expout "$at_stdout" || at_failed=:
   141691 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141692 $at_failed && at_fn_log_failure
   141693 $at_traceon; }
   141694 
   141695   { set +x
   141696 $as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror"
   141697 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "regression.at:484"
   141698 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror
   141699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141700 at_status=$? at_failed=false
   141701 $at_check_filter
   141702 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141703 $at_diff expout "$at_stdout" || at_failed=:
   141704 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:484"
   141705 $at_failed && at_fn_log_failure
   141706 $at_traceon; }
   141707 
   141708 
   141709   at_restore_special_files
   141710 fi
   141711 { set +x
   141712 $as_echo "$at_srcdir/regression.at:492: \$BISON_C_WORKS"
   141713 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:492"
   141714 ( $at_check_trace; $BISON_C_WORKS
   141715 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141716 at_status=$? at_failed=false
   141717 $at_check_filter
   141718 echo stderr:; cat "$at_stderr"
   141719 echo stdout:; cat "$at_stdout"
   141720 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:492"
   141721 $at_failed && at_fn_log_failure
   141722 $at_traceon; }
   141723 
   141724 { set +x
   141725 $as_echo "$at_srcdir/regression.at:492: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   141726 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:492"
   141727 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   141728 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141729 at_status=$? at_failed=false
   141730 $at_check_filter
   141731 echo stderr:; cat "$at_stderr"
   141732 echo stdout:; cat "$at_stdout"
   141733 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:492"
   141734 $at_failed && at_fn_log_failure
   141735 $at_traceon; }
   141736 
   141737 
   141738 # Checking the error message here guarantees that yytname, which does contain
   141739 # C-string literals, does have the trigraph escaped correctly.  Thus, the
   141740 # symbol name reported by the parser is exactly the same as that reported by
   141741 # Bison itself.
   141742 cat >experr <<'_ATEOF'
   141743 syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!", expecting a
   141744 _ATEOF
   141745 
   141746 { set +x
   141747 $as_echo "$at_srcdir/regression.at:501:  \$PREPARSER ./input"
   141748 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:501"
   141749 ( $at_check_trace;  $PREPARSER ./input
   141750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141751 at_status=$? at_failed=false
   141752 $at_check_filter
   141753 echo stderr:; tee stderr <"$at_stderr"
   141754 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141755 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:501"
   141756 $at_failed && at_fn_log_failure
   141757 $at_traceon; }
   141758 
   141759 { set +x
   141760 $as_echo "$at_srcdir/regression.at:501: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   141761 at_fn_check_prepare_trace "regression.at:501"
   141762 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   141763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141764 at_status=$? at_failed=false
   141765 $at_check_filter
   141766 $at_diff experr "$at_stderr" || at_failed=:
   141767 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141768 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:501"
   141769 $at_failed && at_fn_log_failure
   141770 $at_traceon; }
   141771 
   141772 
   141773   set +x
   141774   $at_times_p && times >"$at_times_file"
   141775 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   141776 read at_status <"$at_status_file"
   141777 #AT_STOP_278
   141778 #AT_START_279
   141779 at_fn_group_banner 279 'regression.at:511' \
   141780   "Characters Escapes" "                             " 17
   141781 at_xfail=no
   141782 (
   141783   $as_echo "279. $at_setup_line: testing $at_desc ..."
   141784   $at_traceon
   141785 
   141786 
   141787 
   141788 cat >input.y <<'_ATEOF'
   141789 %code top {
   141790 #include <config.h>
   141791 /* We don't need perfect functions for these tests. */
   141792 #undef malloc
   141793 #undef memcmp
   141794 #undef realloc
   141795 }
   141796 
   141797 %{
   141798 void yyerror ( const char *msg);
   141799 int yylex (void);
   141800 %}
   141801 %%
   141802 exp:
   141803   '\'' "\'"
   141804 | '\"' "\""
   141805 | '"'  "'" /* Pacify font-lock-mode: ". */
   141806 ;
   141807 _ATEOF
   141808 
   141809 
   141810 
   141811 
   141812 
   141813 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   141814   at_save_special_files
   141815   mkdir xml-tests
   141816     # Don't combine these Bison invocations since we want to be sure that
   141817   # --report=all isn't required to get the full XML file.
   141818   { set +x
   141819 $as_echo "$at_srcdir/regression.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   141820                   --graph=xml-tests/test.dot -o input.c input.y"
   141821 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:529"
   141822 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   141823                   --graph=xml-tests/test.dot -o input.c input.y
   141824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141825 at_status=$? at_failed=false
   141826 $at_check_filter
   141827 echo stderr:; cat "$at_stderr"
   141828 echo stdout:; cat "$at_stdout"
   141829 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529"
   141830 $at_failed && at_fn_log_failure
   141831 $at_traceon; }
   141832 
   141833   { set +x
   141834 $as_echo "$at_srcdir/regression.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   141835 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:529"
   141836 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   141837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141838 at_status=$? at_failed=false
   141839 $at_check_filter
   141840 echo stderr:; cat "$at_stderr"
   141841 echo stdout:; cat "$at_stdout"
   141842 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529"
   141843 $at_failed && at_fn_log_failure
   141844 $at_traceon; }
   141845 
   141846     cp xml-tests/test.output expout
   141847   { set +x
   141848 $as_echo "$at_srcdir/regression.at:529: \$XSLTPROC \\
   141849              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   141850              xml-tests/test.xml"
   141851 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:529"
   141852 ( $at_check_trace; $XSLTPROC \
   141853              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   141854              xml-tests/test.xml
   141855 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141856 at_status=$? at_failed=false
   141857 $at_check_filter
   141858 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141859 $at_diff expout "$at_stdout" || at_failed=:
   141860 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529"
   141861 $at_failed && at_fn_log_failure
   141862 $at_traceon; }
   141863 
   141864   sort xml-tests/test.dot > expout
   141865   { set +x
   141866 $as_echo "$at_srcdir/regression.at:529: \$XSLTPROC \\
   141867              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   141868              xml-tests/test.xml | sort"
   141869 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:529"
   141870 ( $at_check_trace; $XSLTPROC \
   141871              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   141872              xml-tests/test.xml | sort
   141873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141874 at_status=$? at_failed=false
   141875 $at_check_filter
   141876 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141877 $at_diff expout "$at_stdout" || at_failed=:
   141878 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529"
   141879 $at_failed && at_fn_log_failure
   141880 $at_traceon; }
   141881 
   141882   rm -rf xml-tests expout
   141883   at_restore_special_files
   141884 fi
   141885 { set +x
   141886 $as_echo "$at_srcdir/regression.at:529: bison -o input.c input.y"
   141887 at_fn_check_prepare_trace "regression.at:529"
   141888 ( $at_check_trace; bison -o input.c input.y
   141889 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141890 at_status=$? at_failed=false
   141891 $at_check_filter
   141892 at_fn_diff_devnull "$at_stderr" || at_failed=:
   141893 at_fn_diff_devnull "$at_stdout" || at_failed=:
   141894 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:529"
   141895 $at_failed && at_fn_log_failure
   141896 $at_traceon; }
   141897 
   141898 
   141899 { set +x
   141900 $as_echo "$at_srcdir/regression.at:530: \$BISON_C_WORKS"
   141901 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:530"
   141902 ( $at_check_trace; $BISON_C_WORKS
   141903 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141904 at_status=$? at_failed=false
   141905 $at_check_filter
   141906 echo stderr:; cat "$at_stderr"
   141907 echo stdout:; cat "$at_stdout"
   141908 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:530"
   141909 $at_failed && at_fn_log_failure
   141910 $at_traceon; }
   141911 
   141912 { set +x
   141913 $as_echo "$at_srcdir/regression.at:530: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
   141914 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:530"
   141915 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
   141916 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141917 at_status=$? at_failed=false
   141918 $at_check_filter
   141919 echo stderr:; cat "$at_stderr"
   141920 echo stdout:; cat "$at_stdout"
   141921 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:530"
   141922 $at_failed && at_fn_log_failure
   141923 $at_traceon; }
   141924 
   141925   set +x
   141926   $at_times_p && times >"$at_times_file"
   141927 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   141928 read at_status <"$at_status_file"
   141929 #AT_STOP_279
   141930 #AT_START_280
   141931 at_fn_group_banner 280 'regression.at:544' \
   141932   "Web2c Report" "                                   " 17
   141933 at_xfail=no
   141934 (
   141935   $as_echo "280. $at_setup_line: testing $at_desc ..."
   141936   $at_traceon
   141937 
   141938 
   141939 
   141940 
   141941 cat >input.y <<'_ATEOF'
   141942 %token	undef_id_tok const_id_tok
   141943 
   141944 %start CONST_DEC_PART
   141945 
   141946 %%
   141947 CONST_DEC_PART:
   141948          CONST_DEC_LIST
   141949         ;
   141950 
   141951 CONST_DEC_LIST:
   141952 	  CONST_DEC
   141953         | CONST_DEC_LIST CONST_DEC
   141954         ;
   141955 
   141956 CONST_DEC:
   141957 	  { } undef_id_tok '=' const_id_tok ';'
   141958         ;
   141959 %%
   141960 _ATEOF
   141961 
   141962 
   141963 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   141964   at_save_special_files
   141965   mkdir xml-tests
   141966     # Don't combine these Bison invocations since we want to be sure that
   141967   # --report=all isn't required to get the full XML file.
   141968   { set +x
   141969 $as_echo "$at_srcdir/regression.at:569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   141970                   --graph=xml-tests/test.dot -v input.y"
   141971 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:569"
   141972 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   141973                   --graph=xml-tests/test.dot -v input.y
   141974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141975 at_status=$? at_failed=false
   141976 $at_check_filter
   141977 echo stderr:; cat "$at_stderr"
   141978 echo stdout:; cat "$at_stdout"
   141979 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569"
   141980 $at_failed && at_fn_log_failure
   141981 $at_traceon; }
   141982 
   141983   { set +x
   141984 $as_echo "$at_srcdir/regression.at:569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y"
   141985 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y" "regression.at:569"
   141986 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y
   141987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   141988 at_status=$? at_failed=false
   141989 $at_check_filter
   141990 echo stderr:; cat "$at_stderr"
   141991 echo stdout:; cat "$at_stdout"
   141992 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569"
   141993 $at_failed && at_fn_log_failure
   141994 $at_traceon; }
   141995 
   141996     cp xml-tests/test.output expout
   141997   { set +x
   141998 $as_echo "$at_srcdir/regression.at:569: \$XSLTPROC \\
   141999              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   142000              xml-tests/test.xml"
   142001 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:569"
   142002 ( $at_check_trace; $XSLTPROC \
   142003              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   142004              xml-tests/test.xml
   142005 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142006 at_status=$? at_failed=false
   142007 $at_check_filter
   142008 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142009 $at_diff expout "$at_stdout" || at_failed=:
   142010 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569"
   142011 $at_failed && at_fn_log_failure
   142012 $at_traceon; }
   142013 
   142014   sort xml-tests/test.dot > expout
   142015   { set +x
   142016 $as_echo "$at_srcdir/regression.at:569: \$XSLTPROC \\
   142017              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   142018              xml-tests/test.xml | sort"
   142019 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:569"
   142020 ( $at_check_trace; $XSLTPROC \
   142021              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   142022              xml-tests/test.xml | sort
   142023 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142024 at_status=$? at_failed=false
   142025 $at_check_filter
   142026 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142027 $at_diff expout "$at_stdout" || at_failed=:
   142028 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569"
   142029 $at_failed && at_fn_log_failure
   142030 $at_traceon; }
   142031 
   142032   rm -rf xml-tests expout
   142033   at_restore_special_files
   142034 fi
   142035 { set +x
   142036 $as_echo "$at_srcdir/regression.at:569: bison -v input.y"
   142037 at_fn_check_prepare_trace "regression.at:569"
   142038 ( $at_check_trace; bison -v input.y
   142039 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142040 at_status=$? at_failed=false
   142041 $at_check_filter
   142042 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142043 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142044 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:569"
   142045 $at_failed && at_fn_log_failure
   142046 $at_traceon; }
   142047 
   142048 
   142049 { set +x
   142050 $as_echo "$at_srcdir/regression.at:570: cat input.output"
   142051 at_fn_check_prepare_trace "regression.at:570"
   142052 ( $at_check_trace; cat input.output
   142053 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142054 at_status=$? at_failed=false
   142055 $at_check_filter
   142056 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142057 echo >>"$at_stdout"; $as_echo "Grammar
   142058 
   142059     0 \$accept: CONST_DEC_PART \$end
   142060 
   142061     1 CONST_DEC_PART: CONST_DEC_LIST
   142062 
   142063     2 CONST_DEC_LIST: CONST_DEC
   142064     3               | CONST_DEC_LIST CONST_DEC
   142065 
   142066     4 \$@1: /* empty */
   142067 
   142068     5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';'
   142069 
   142070 
   142071 Terminals, with rules where they appear
   142072 
   142073 \$end (0) 0
   142074 ';' (59) 5
   142075 '=' (61) 5
   142076 error (256)
   142077 undef_id_tok (258) 5
   142078 const_id_tok (259) 5
   142079 
   142080 
   142081 Nonterminals, with rules where they appear
   142082 
   142083 \$accept (7)
   142084     on left: 0
   142085 CONST_DEC_PART (8)
   142086     on left: 1, on right: 0
   142087 CONST_DEC_LIST (9)
   142088     on left: 2 3, on right: 1 3
   142089 CONST_DEC (10)
   142090     on left: 5, on right: 2 3
   142091 \$@1 (11)
   142092     on left: 4, on right: 5
   142093 
   142094 
   142095 State 0
   142096 
   142097     0 \$accept: . CONST_DEC_PART \$end
   142098 
   142099     \$default  reduce using rule 4 (\$@1)
   142100 
   142101     CONST_DEC_PART  go to state 1
   142102     CONST_DEC_LIST  go to state 2
   142103     CONST_DEC       go to state 3
   142104     \$@1             go to state 4
   142105 
   142106 
   142107 State 1
   142108 
   142109     0 \$accept: CONST_DEC_PART . \$end
   142110 
   142111     \$end  shift, and go to state 5
   142112 
   142113 
   142114 State 2
   142115 
   142116     1 CONST_DEC_PART: CONST_DEC_LIST .
   142117     3 CONST_DEC_LIST: CONST_DEC_LIST . CONST_DEC
   142118 
   142119     undef_id_tok  reduce using rule 4 (\$@1)
   142120     \$default      reduce using rule 1 (CONST_DEC_PART)
   142121 
   142122     CONST_DEC  go to state 6
   142123     \$@1        go to state 4
   142124 
   142125 
   142126 State 3
   142127 
   142128     2 CONST_DEC_LIST: CONST_DEC .
   142129 
   142130     \$default  reduce using rule 2 (CONST_DEC_LIST)
   142131 
   142132 
   142133 State 4
   142134 
   142135     5 CONST_DEC: \$@1 . undef_id_tok '=' const_id_tok ';'
   142136 
   142137     undef_id_tok  shift, and go to state 7
   142138 
   142139 
   142140 State 5
   142141 
   142142     0 \$accept: CONST_DEC_PART \$end .
   142143 
   142144     \$default  accept
   142145 
   142146 
   142147 State 6
   142148 
   142149     3 CONST_DEC_LIST: CONST_DEC_LIST CONST_DEC .
   142150 
   142151     \$default  reduce using rule 3 (CONST_DEC_LIST)
   142152 
   142153 
   142154 State 7
   142155 
   142156     5 CONST_DEC: \$@1 undef_id_tok . '=' const_id_tok ';'
   142157 
   142158     '='  shift, and go to state 8
   142159 
   142160 
   142161 State 8
   142162 
   142163     5 CONST_DEC: \$@1 undef_id_tok '=' . const_id_tok ';'
   142164 
   142165     const_id_tok  shift, and go to state 9
   142166 
   142167 
   142168 State 9
   142169 
   142170     5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok . ';'
   142171 
   142172     ';'  shift, and go to state 10
   142173 
   142174 
   142175 State 10
   142176 
   142177     5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';' .
   142178 
   142179     \$default  reduce using rule 5 (CONST_DEC)
   142180 " | \
   142181   $at_diff - "$at_stdout" || at_failed=:
   142182 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:570"
   142183 $at_failed && at_fn_log_failure
   142184 $at_traceon; }
   142185 
   142186 
   142187   set +x
   142188   $at_times_p && times >"$at_times_file"
   142189 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   142190 read at_status <"$at_status_file"
   142191 #AT_STOP_280
   142192 #AT_START_281
   142193 at_fn_group_banner 281 'regression.at:721' \
   142194   "Web2c Actions" "                                  " 17
   142195 at_xfail=no
   142196 (
   142197   $as_echo "281. $at_setup_line: testing $at_desc ..."
   142198   $at_traceon
   142199 
   142200 
   142201 
   142202 
   142203 cat >input.y <<'_ATEOF'
   142204 %%
   142205 statement:  struct_stat;
   142206 struct_stat:  /* empty. */ | if else;
   142207 if: "if" "const" "then" statement;
   142208 else: "else" statement;
   142209 %%
   142210 _ATEOF
   142211 
   142212 
   142213 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   142214   at_save_special_files
   142215   mkdir xml-tests
   142216     # Don't combine these Bison invocations since we want to be sure that
   142217   # --report=all isn't required to get the full XML file.
   142218   { set +x
   142219 $as_echo "$at_srcdir/regression.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   142220                   --graph=xml-tests/test.dot -v -o input.c input.y"
   142221 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:734"
   142222 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   142223                   --graph=xml-tests/test.dot -v -o input.c input.y
   142224 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142225 at_status=$? at_failed=false
   142226 $at_check_filter
   142227 echo stderr:; cat "$at_stderr"
   142228 echo stdout:; cat "$at_stdout"
   142229 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734"
   142230 $at_failed && at_fn_log_failure
   142231 $at_traceon; }
   142232 
   142233   { set +x
   142234 $as_echo "$at_srcdir/regression.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y"
   142235 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:734"
   142236 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y
   142237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142238 at_status=$? at_failed=false
   142239 $at_check_filter
   142240 echo stderr:; cat "$at_stderr"
   142241 echo stdout:; cat "$at_stdout"
   142242 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734"
   142243 $at_failed && at_fn_log_failure
   142244 $at_traceon; }
   142245 
   142246     cp xml-tests/test.output expout
   142247   { set +x
   142248 $as_echo "$at_srcdir/regression.at:734: \$XSLTPROC \\
   142249              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   142250              xml-tests/test.xml"
   142251 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:734"
   142252 ( $at_check_trace; $XSLTPROC \
   142253              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   142254              xml-tests/test.xml
   142255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142256 at_status=$? at_failed=false
   142257 $at_check_filter
   142258 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142259 $at_diff expout "$at_stdout" || at_failed=:
   142260 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734"
   142261 $at_failed && at_fn_log_failure
   142262 $at_traceon; }
   142263 
   142264   sort xml-tests/test.dot > expout
   142265   { set +x
   142266 $as_echo "$at_srcdir/regression.at:734: \$XSLTPROC \\
   142267              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   142268              xml-tests/test.xml | sort"
   142269 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:734"
   142270 ( $at_check_trace; $XSLTPROC \
   142271              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   142272              xml-tests/test.xml | sort
   142273 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142274 at_status=$? at_failed=false
   142275 $at_check_filter
   142276 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142277 $at_diff expout "$at_stdout" || at_failed=:
   142278 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734"
   142279 $at_failed && at_fn_log_failure
   142280 $at_traceon; }
   142281 
   142282   rm -rf xml-tests expout
   142283   at_restore_special_files
   142284 fi
   142285 { set +x
   142286 $as_echo "$at_srcdir/regression.at:734: bison -v -o input.c input.y"
   142287 at_fn_check_prepare_trace "regression.at:734"
   142288 ( $at_check_trace; bison -v -o input.c input.y
   142289 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142290 at_status=$? at_failed=false
   142291 $at_check_filter
   142292 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142293 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142294 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:734"
   142295 $at_failed && at_fn_log_failure
   142296 $at_traceon; }
   142297 
   142298 
   142299 
   142300 # Check only the tables.
   142301 sed -n 's/  *$//;/^static const.*\[\] =/,/^}/p' input.c >tables.c
   142302 
   142303 { set +x
   142304 $as_echo "$at_srcdir/regression.at:739: cat tables.c"
   142305 at_fn_check_prepare_trace "regression.at:739"
   142306 ( $at_check_trace; cat tables.c
   142307 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142308 at_status=$? at_failed=false
   142309 $at_check_filter
   142310 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142311 echo >>"$at_stdout"; $as_echo "static const yytype_uint8 yytranslate[] =
   142312 {
   142313        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142314        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142315        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142316        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142317        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142318        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142319        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142320        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142321        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142322        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142323        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142324        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142325        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142326        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142327        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142328        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142329        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142330        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142331        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142332        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142333        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142334        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142335        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142336        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142337        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   142338        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
   142339        5,     6
   142340 };
   142341 static const yytype_uint8 yyprhs[] =
   142342 {
   142343        0,     0,     3,     5,     6,     9,    14
   142344 };
   142345 static const yytype_int8 yyrhs[] =
   142346 {
   142347        8,     0,    -1,     9,    -1,    -1,    10,    11,    -1,     3,
   142348        4,     5,     8,    -1,     6,     8,    -1
   142349 };
   142350 static const yytype_uint8 yyrline[] =
   142351 {
   142352        0,     2,     2,     3,     3,     4,     5
   142353 };
   142354 static const char *const yytname[] =
   142355 {
   142356   \"\$end\", \"error\", \"\$undefined\", \"\\\"if\\\"\", \"\\\"const\\\"\", \"\\\"then\\\"\",
   142357   \"\\\"else\\\"\", \"\$accept\", \"statement\", \"struct_stat\", \"if\", \"else\", YY_NULL
   142358 };
   142359 static const yytype_uint16 yytoknum[] =
   142360 {
   142361        0,   256,   257,   258,   259,   260,   261
   142362 };
   142363 static const yytype_uint8 yyr1[] =
   142364 {
   142365        0,     7,     8,     9,     9,    10,    11
   142366 };
   142367 static const yytype_uint8 yyr2[] =
   142368 {
   142369        0,     2,     1,     0,     2,     4,     2
   142370 };
   142371 static const yytype_uint8 yydefact[] =
   142372 {
   142373        3,     0,     0,     2,     0,     0,     1,     3,     4,     3,
   142374        6,     5
   142375 };
   142376 static const yytype_int8 yydefgoto[] =
   142377 {
   142378       -1,     2,     3,     4,     8
   142379 };
   142380 static const yytype_int8 yypact[] =
   142381 {
   142382       -2,    -1,     4,    -8,     0,     2,    -8,    -2,    -8,    -2,
   142383       -8,    -8
   142384 };
   142385 static const yytype_int8 yypgoto[] =
   142386 {
   142387       -8,    -7,    -8,    -8,    -8
   142388 };
   142389 static const yytype_uint8 yytable[] =
   142390 {
   142391       10,     1,    11,     5,     6,     0,     7,     9
   142392 };
   142393 static const yytype_int8 yycheck[] =
   142394 {
   142395        7,     3,     9,     4,     0,    -1,     6,     5
   142396 };
   142397 static const yytype_uint8 yystos[] =
   142398 {
   142399        0,     3,     8,     9,    10,     4,     0,     6,    11,     5,
   142400        8,     8
   142401 };
   142402 " | \
   142403   $at_diff - "$at_stdout" || at_failed=:
   142404 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:739"
   142405 $at_failed && at_fn_log_failure
   142406 $at_traceon; }
   142407 
   142408 
   142409   set +x
   142410   $at_times_p && times >"$at_times_file"
   142411 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   142412 read at_status <"$at_status_file"
   142413 #AT_STOP_281
   142414 #AT_START_282
   142415 at_fn_group_banner 282 'regression.at:936' \
   142416   "Dancer " "                                        " 17
   142417 at_xfail=no
   142418 (
   142419   $as_echo "282. $at_setup_line: testing $at_desc ..."
   142420   $at_traceon
   142421 
   142422 
   142423 cat >dancer.y <<'_ATEOF'
   142424 %code top {
   142425 #include <config.h>
   142426 /* We don't need perfect functions for these tests. */
   142427 #undef malloc
   142428 #undef memcmp
   142429 #undef realloc
   142430 }
   142431 
   142432 %code provides
   142433 {
   142434   static void yyerror ( const char *msg);
   142435   static int yylex (void);
   142436 }
   142437 
   142438 %token ARROW INVALID NUMBER STRING DATA
   142439 %defines
   142440 %verbose
   142441 %error-verbose
   142442 /* Grammar follows */
   142443 %%
   142444 line: header body
   142445    ;
   142446 
   142447 header: '<' from ARROW to '>' type ':'
   142448    | '<' ARROW to '>' type ':'
   142449    | ARROW to type ':'
   142450    | type ':'
   142451    | '<' '>'
   142452    ;
   142453 
   142454 from: DATA
   142455    | STRING
   142456    | INVALID
   142457    ;
   142458 
   142459 to: DATA
   142460    | STRING
   142461    | INVALID
   142462    ;
   142463 
   142464 type: DATA
   142465    | STRING
   142466    | INVALID
   142467    ;
   142468 
   142469 body: /* empty */
   142470    | body member
   142471    ;
   142472 
   142473 member: STRING
   142474    | DATA
   142475    | '+' NUMBER
   142476    | '-' NUMBER
   142477    | NUMBER
   142478    | INVALID
   142479    ;
   142480 %%
   142481 #include <stdio.h>
   142482 /* A C error reporting function.  */
   142483 static
   142484 void yyerror ( const char *msg)
   142485 {
   142486   fprintf (stderr, "%s\n", msg);
   142487 }
   142488 #include <assert.h>
   142489 static
   142490 int yylex (void)
   142491 {
   142492   static char const input[] = ":";
   142493   static size_t toknum = 0;
   142494   int res;
   142495   ;
   142496   assert (toknum < sizeof input / sizeof input[0]);
   142497   res = input[toknum++];
   142498   ;
   142499   return res;
   142500 }
   142501 
   142502 
   142503 int
   142504 main (void)
   142505 {
   142506   return yyparse ();
   142507 }
   142508 _ATEOF
   142509 
   142510 
   142511 
   142512 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   142513   at_save_special_files
   142514   mkdir xml-tests
   142515     # Don't combine these Bison invocations since we want to be sure that
   142516   # --report=all isn't required to get the full XML file.
   142517   { set +x
   142518 $as_echo "$at_srcdir/regression.at:936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   142519                   --graph=xml-tests/test.dot -o dancer.c dancer.y"
   142520 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:936"
   142521 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   142522                   --graph=xml-tests/test.dot -o dancer.c dancer.y
   142523 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142524 at_status=$? at_failed=false
   142525 $at_check_filter
   142526 echo stderr:; cat "$at_stderr"
   142527 echo stdout:; cat "$at_stdout"
   142528 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142529 $at_failed && at_fn_log_failure
   142530 $at_traceon; }
   142531 
   142532   { set +x
   142533 $as_echo "$at_srcdir/regression.at:936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
   142534 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:936"
   142535 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
   142536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142537 at_status=$? at_failed=false
   142538 $at_check_filter
   142539 echo stderr:; cat "$at_stderr"
   142540 echo stdout:; cat "$at_stdout"
   142541 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142542 $at_failed && at_fn_log_failure
   142543 $at_traceon; }
   142544 
   142545     cp xml-tests/test.output expout
   142546   { set +x
   142547 $as_echo "$at_srcdir/regression.at:936: \$XSLTPROC \\
   142548              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   142549              xml-tests/test.xml"
   142550 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:936"
   142551 ( $at_check_trace; $XSLTPROC \
   142552              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   142553              xml-tests/test.xml
   142554 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142555 at_status=$? at_failed=false
   142556 $at_check_filter
   142557 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142558 $at_diff expout "$at_stdout" || at_failed=:
   142559 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142560 $at_failed && at_fn_log_failure
   142561 $at_traceon; }
   142562 
   142563   sort xml-tests/test.dot > expout
   142564   { set +x
   142565 $as_echo "$at_srcdir/regression.at:936: \$XSLTPROC \\
   142566              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   142567              xml-tests/test.xml | sort"
   142568 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:936"
   142569 ( $at_check_trace; $XSLTPROC \
   142570              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   142571              xml-tests/test.xml | sort
   142572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142573 at_status=$? at_failed=false
   142574 $at_check_filter
   142575 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142576 $at_diff expout "$at_stdout" || at_failed=:
   142577 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142578 $at_failed && at_fn_log_failure
   142579 $at_traceon; }
   142580 
   142581   rm -rf xml-tests expout
   142582   at_restore_special_files
   142583 fi
   142584 { set +x
   142585 $as_echo "$at_srcdir/regression.at:936: bison -o dancer.c dancer.y"
   142586 at_fn_check_prepare_trace "regression.at:936"
   142587 ( $at_check_trace; bison -o dancer.c dancer.y
   142588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142589 at_status=$? at_failed=false
   142590 $at_check_filter
   142591 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142592 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142593 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142594 $at_failed && at_fn_log_failure
   142595 $at_traceon; }
   142596 
   142597 
   142598    { set +x
   142599 $as_echo "$at_srcdir/regression.at:936: \$BISON_C_WORKS"
   142600 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:936"
   142601 ( $at_check_trace; $BISON_C_WORKS
   142602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142603 at_status=$? at_failed=false
   142604 $at_check_filter
   142605 echo stderr:; cat "$at_stderr"
   142606 echo stdout:; cat "$at_stdout"
   142607 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142608 $at_failed && at_fn_log_failure
   142609 $at_traceon; }
   142610 
   142611 { set +x
   142612 $as_echo "$at_srcdir/regression.at:936: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS"
   142613 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:936"
   142614 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS
   142615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142616 at_status=$? at_failed=false
   142617 $at_check_filter
   142618 echo stderr:; cat "$at_stderr"
   142619 echo stdout:; cat "$at_stdout"
   142620 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142621 $at_failed && at_fn_log_failure
   142622 $at_traceon; }
   142623 
   142624 
   142625 { set +x
   142626 $as_echo "$at_srcdir/regression.at:936:  \$PREPARSER ./dancer"
   142627 at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:936"
   142628 ( $at_check_trace;  $PREPARSER ./dancer
   142629 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142630 at_status=$? at_failed=false
   142631 $at_check_filter
   142632 echo stderr:; tee stderr <"$at_stderr"
   142633 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142634 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:936"
   142635 $at_failed && at_fn_log_failure
   142636 $at_traceon; }
   142637 
   142638 { set +x
   142639 $as_echo "$at_srcdir/regression.at:936: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   142640 at_fn_check_prepare_trace "regression.at:936"
   142641 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   142642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142643 at_status=$? at_failed=false
   142644 $at_check_filter
   142645 echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
   142646 " | \
   142647   $at_diff - "$at_stderr" || at_failed=:
   142648 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142649 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:936"
   142650 $at_failed && at_fn_log_failure
   142651 $at_traceon; }
   142652 
   142653 
   142654 
   142655   set +x
   142656   $at_times_p && times >"$at_times_file"
   142657 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   142658 read at_status <"$at_status_file"
   142659 #AT_STOP_282
   142660 #AT_START_283
   142661 at_fn_group_banner 283 'regression.at:937' \
   142662   "Dancer %glr-parser" "                             " 17
   142663 at_xfail=no
   142664 (
   142665   $as_echo "283. $at_setup_line: testing $at_desc ..."
   142666   $at_traceon
   142667 
   142668 
   142669 cat >dancer.y <<'_ATEOF'
   142670 %code top {
   142671 #include <config.h>
   142672 /* We don't need perfect functions for these tests. */
   142673 #undef malloc
   142674 #undef memcmp
   142675 #undef realloc
   142676 }
   142677 
   142678 %code provides
   142679 {
   142680   static void yyerror ( const char *msg);
   142681   static int yylex (void);
   142682 }
   142683 %glr-parser
   142684 %token ARROW INVALID NUMBER STRING DATA
   142685 %defines
   142686 %verbose
   142687 %error-verbose
   142688 /* Grammar follows */
   142689 %%
   142690 line: header body
   142691    ;
   142692 
   142693 header: '<' from ARROW to '>' type ':'
   142694    | '<' ARROW to '>' type ':'
   142695    | ARROW to type ':'
   142696    | type ':'
   142697    | '<' '>'
   142698    ;
   142699 
   142700 from: DATA
   142701    | STRING
   142702    | INVALID
   142703    ;
   142704 
   142705 to: DATA
   142706    | STRING
   142707    | INVALID
   142708    ;
   142709 
   142710 type: DATA
   142711    | STRING
   142712    | INVALID
   142713    ;
   142714 
   142715 body: /* empty */
   142716    | body member
   142717    ;
   142718 
   142719 member: STRING
   142720    | DATA
   142721    | '+' NUMBER
   142722    | '-' NUMBER
   142723    | NUMBER
   142724    | INVALID
   142725    ;
   142726 %%
   142727 #include <stdio.h>
   142728 /* A C error reporting function.  */
   142729 static
   142730 void yyerror ( const char *msg)
   142731 {
   142732   fprintf (stderr, "%s\n", msg);
   142733 }
   142734 #include <assert.h>
   142735 static
   142736 int yylex (void)
   142737 {
   142738   static char const input[] = ":";
   142739   static size_t toknum = 0;
   142740   int res;
   142741   ;
   142742   assert (toknum < sizeof input / sizeof input[0]);
   142743   res = input[toknum++];
   142744   ;
   142745   return res;
   142746 }
   142747 
   142748 
   142749 int
   142750 main (void)
   142751 {
   142752   return yyparse ();
   142753 }
   142754 _ATEOF
   142755 
   142756 
   142757 
   142758 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   142759   at_save_special_files
   142760   mkdir xml-tests
   142761     # Don't combine these Bison invocations since we want to be sure that
   142762   # --report=all isn't required to get the full XML file.
   142763   { set +x
   142764 $as_echo "$at_srcdir/regression.at:937: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   142765                   --graph=xml-tests/test.dot -o dancer.c dancer.y"
   142766 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:937"
   142767 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   142768                   --graph=xml-tests/test.dot -o dancer.c dancer.y
   142769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142770 at_status=$? at_failed=false
   142771 $at_check_filter
   142772 echo stderr:; cat "$at_stderr"
   142773 echo stdout:; cat "$at_stdout"
   142774 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142775 $at_failed && at_fn_log_failure
   142776 $at_traceon; }
   142777 
   142778   { set +x
   142779 $as_echo "$at_srcdir/regression.at:937: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
   142780 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:937"
   142781 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
   142782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142783 at_status=$? at_failed=false
   142784 $at_check_filter
   142785 echo stderr:; cat "$at_stderr"
   142786 echo stdout:; cat "$at_stdout"
   142787 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142788 $at_failed && at_fn_log_failure
   142789 $at_traceon; }
   142790 
   142791     cp xml-tests/test.output expout
   142792   { set +x
   142793 $as_echo "$at_srcdir/regression.at:937: \$XSLTPROC \\
   142794              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   142795              xml-tests/test.xml"
   142796 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:937"
   142797 ( $at_check_trace; $XSLTPROC \
   142798              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   142799              xml-tests/test.xml
   142800 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142801 at_status=$? at_failed=false
   142802 $at_check_filter
   142803 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142804 $at_diff expout "$at_stdout" || at_failed=:
   142805 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142806 $at_failed && at_fn_log_failure
   142807 $at_traceon; }
   142808 
   142809   sort xml-tests/test.dot > expout
   142810   { set +x
   142811 $as_echo "$at_srcdir/regression.at:937: \$XSLTPROC \\
   142812              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   142813              xml-tests/test.xml | sort"
   142814 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:937"
   142815 ( $at_check_trace; $XSLTPROC \
   142816              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   142817              xml-tests/test.xml | sort
   142818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142819 at_status=$? at_failed=false
   142820 $at_check_filter
   142821 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142822 $at_diff expout "$at_stdout" || at_failed=:
   142823 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142824 $at_failed && at_fn_log_failure
   142825 $at_traceon; }
   142826 
   142827   rm -rf xml-tests expout
   142828   at_restore_special_files
   142829 fi
   142830 { set +x
   142831 $as_echo "$at_srcdir/regression.at:937: bison -o dancer.c dancer.y"
   142832 at_fn_check_prepare_trace "regression.at:937"
   142833 ( $at_check_trace; bison -o dancer.c dancer.y
   142834 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142835 at_status=$? at_failed=false
   142836 $at_check_filter
   142837 at_fn_diff_devnull "$at_stderr" || at_failed=:
   142838 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142839 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142840 $at_failed && at_fn_log_failure
   142841 $at_traceon; }
   142842 
   142843 
   142844    { set +x
   142845 $as_echo "$at_srcdir/regression.at:937: \$BISON_C_WORKS"
   142846 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:937"
   142847 ( $at_check_trace; $BISON_C_WORKS
   142848 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142849 at_status=$? at_failed=false
   142850 $at_check_filter
   142851 echo stderr:; cat "$at_stderr"
   142852 echo stdout:; cat "$at_stdout"
   142853 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142854 $at_failed && at_fn_log_failure
   142855 $at_traceon; }
   142856 
   142857 { set +x
   142858 $as_echo "$at_srcdir/regression.at:937: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS"
   142859 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:937"
   142860 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS
   142861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142862 at_status=$? at_failed=false
   142863 $at_check_filter
   142864 echo stderr:; cat "$at_stderr"
   142865 echo stdout:; cat "$at_stdout"
   142866 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142867 $at_failed && at_fn_log_failure
   142868 $at_traceon; }
   142869 
   142870 
   142871 { set +x
   142872 $as_echo "$at_srcdir/regression.at:937:  \$PREPARSER ./dancer"
   142873 at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:937"
   142874 ( $at_check_trace;  $PREPARSER ./dancer
   142875 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142876 at_status=$? at_failed=false
   142877 $at_check_filter
   142878 echo stderr:; tee stderr <"$at_stderr"
   142879 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142880 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:937"
   142881 $at_failed && at_fn_log_failure
   142882 $at_traceon; }
   142883 
   142884 { set +x
   142885 $as_echo "$at_srcdir/regression.at:937: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   142886 at_fn_check_prepare_trace "regression.at:937"
   142887 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   142888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   142889 at_status=$? at_failed=false
   142890 $at_check_filter
   142891 echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
   142892 " | \
   142893   $at_diff - "$at_stderr" || at_failed=:
   142894 at_fn_diff_devnull "$at_stdout" || at_failed=:
   142895 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:937"
   142896 $at_failed && at_fn_log_failure
   142897 $at_traceon; }
   142898 
   142899 
   142900 
   142901   set +x
   142902   $at_times_p && times >"$at_times_file"
   142903 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   142904 read at_status <"$at_status_file"
   142905 #AT_STOP_283
   142906 #AT_START_284
   142907 at_fn_group_banner 284 'regression.at:938' \
   142908   "Dancer %skeleton \"lalr1.cc\"" "                    " 17
   142909 at_xfail=no
   142910 (
   142911   $as_echo "284. $at_setup_line: testing $at_desc ..."
   142912   $at_traceon
   142913 
   142914 
   142915 cat >dancer.y <<'_ATEOF'
   142916 %code top {
   142917 #include <config.h>
   142918 /* We don't need perfect functions for these tests. */
   142919 #undef malloc
   142920 #undef memcmp
   142921 #undef realloc
   142922 }
   142923 
   142924 %code provides
   142925 {
   142926 
   142927   static int yylex (yy::parser::semantic_type *lvalp);
   142928 }
   142929 %skeleton "lalr1.cc"
   142930 %token ARROW INVALID NUMBER STRING DATA
   142931 %defines
   142932 %verbose
   142933 %error-verbose
   142934 /* Grammar follows */
   142935 %%
   142936 line: header body
   142937    ;
   142938 
   142939 header: '<' from ARROW to '>' type ':'
   142940    | '<' ARROW to '>' type ':'
   142941    | ARROW to type ':'
   142942    | type ':'
   142943    | '<' '>'
   142944    ;
   142945 
   142946 from: DATA
   142947    | STRING
   142948    | INVALID
   142949    ;
   142950 
   142951 to: DATA
   142952    | STRING
   142953    | INVALID
   142954    ;
   142955 
   142956 type: DATA
   142957    | STRING
   142958    | INVALID
   142959    ;
   142960 
   142961 body: /* empty */
   142962    | body member
   142963    ;
   142964 
   142965 member: STRING
   142966    | DATA
   142967    | '+' NUMBER
   142968    | '-' NUMBER
   142969    | NUMBER
   142970    | INVALID
   142971    ;
   142972 %%
   142973 /* A C++ error reporting function.  */
   142974 void
   142975 yy::parser::error (const location_type& l, const std::string& m)
   142976 {
   142977   (void) l;
   142978   std::cerr << m << std::endl;
   142979 }
   142980 #include <assert.h>
   142981 static
   142982 int yylex (yy::parser::semantic_type *lvalp)
   142983 {
   142984   static char const input[] = ":";
   142985   static size_t toknum = 0;
   142986   int res;
   142987   (void) lvalp;;
   142988   assert (toknum < sizeof input / sizeof input[0]);
   142989   res = input[toknum++];
   142990   ;
   142991   return res;
   142992 }
   142993 int
   142994 yyparse ()
   142995 {
   142996   yy::parser parser;
   142997 #if YYDEBUG
   142998   parser.set_debug_level (YYDEBUG);
   142999 #endif
   143000   return parser.parse ();
   143001 }
   143002 
   143003 
   143004 int
   143005 main (void)
   143006 {
   143007   return yyparse ();
   143008 }
   143009 _ATEOF
   143010 
   143011 
   143012 
   143013 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   143014   at_save_special_files
   143015   mkdir xml-tests
   143016     # Don't combine these Bison invocations since we want to be sure that
   143017   # --report=all isn't required to get the full XML file.
   143018   { set +x
   143019 $as_echo "$at_srcdir/regression.at:938: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   143020                   --graph=xml-tests/test.dot -o dancer.cc dancer.y"
   143021 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:938"
   143022 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   143023                   --graph=xml-tests/test.dot -o dancer.cc dancer.y
   143024 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143025 at_status=$? at_failed=false
   143026 $at_check_filter
   143027 echo stderr:; cat "$at_stderr"
   143028 echo stdout:; cat "$at_stdout"
   143029 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143030 $at_failed && at_fn_log_failure
   143031 $at_traceon; }
   143032 
   143033   { set +x
   143034 $as_echo "$at_srcdir/regression.at:938: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y"
   143035 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y" "regression.at:938"
   143036 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y
   143037 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143038 at_status=$? at_failed=false
   143039 $at_check_filter
   143040 echo stderr:; cat "$at_stderr"
   143041 echo stdout:; cat "$at_stdout"
   143042 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143043 $at_failed && at_fn_log_failure
   143044 $at_traceon; }
   143045 
   143046     cp xml-tests/test.output expout
   143047   { set +x
   143048 $as_echo "$at_srcdir/regression.at:938: \$XSLTPROC \\
   143049              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   143050              xml-tests/test.xml"
   143051 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:938"
   143052 ( $at_check_trace; $XSLTPROC \
   143053              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   143054              xml-tests/test.xml
   143055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143056 at_status=$? at_failed=false
   143057 $at_check_filter
   143058 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143059 $at_diff expout "$at_stdout" || at_failed=:
   143060 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143061 $at_failed && at_fn_log_failure
   143062 $at_traceon; }
   143063 
   143064   sort xml-tests/test.dot > expout
   143065   { set +x
   143066 $as_echo "$at_srcdir/regression.at:938: \$XSLTPROC \\
   143067              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   143068              xml-tests/test.xml | sort"
   143069 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:938"
   143070 ( $at_check_trace; $XSLTPROC \
   143071              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   143072              xml-tests/test.xml | sort
   143073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143074 at_status=$? at_failed=false
   143075 $at_check_filter
   143076 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143077 $at_diff expout "$at_stdout" || at_failed=:
   143078 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143079 $at_failed && at_fn_log_failure
   143080 $at_traceon; }
   143081 
   143082   rm -rf xml-tests expout
   143083   at_restore_special_files
   143084 fi
   143085 { set +x
   143086 $as_echo "$at_srcdir/regression.at:938: bison -o dancer.cc dancer.y"
   143087 at_fn_check_prepare_trace "regression.at:938"
   143088 ( $at_check_trace; bison -o dancer.cc dancer.y
   143089 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143090 at_status=$? at_failed=false
   143091 $at_check_filter
   143092 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143093 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143094 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143095 $at_failed && at_fn_log_failure
   143096 $at_traceon; }
   143097 
   143098 
   143099 
   143100 { set +x
   143101 $as_echo "$at_srcdir/regression.at:938: \$BISON_CXX_WORKS"
   143102 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:938"
   143103 ( $at_check_trace; $BISON_CXX_WORKS
   143104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143105 at_status=$? at_failed=false
   143106 $at_check_filter
   143107 echo stderr:; cat "$at_stderr"
   143108 echo stdout:; cat "$at_stdout"
   143109 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143110 $at_failed && at_fn_log_failure
   143111 $at_traceon; }
   143112 
   143113 { set +x
   143114 $as_echo "$at_srcdir/regression.at:938: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.cc \$LIBS"
   143115 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS" "regression.at:938"
   143116 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS
   143117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143118 at_status=$? at_failed=false
   143119 $at_check_filter
   143120 echo stderr:; cat "$at_stderr"
   143121 echo stdout:; cat "$at_stdout"
   143122 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143123 $at_failed && at_fn_log_failure
   143124 $at_traceon; }
   143125 
   143126 
   143127 { set +x
   143128 $as_echo "$at_srcdir/regression.at:938:  \$PREPARSER ./dancer"
   143129 at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:938"
   143130 ( $at_check_trace;  $PREPARSER ./dancer
   143131 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143132 at_status=$? at_failed=false
   143133 $at_check_filter
   143134 echo stderr:; tee stderr <"$at_stderr"
   143135 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143136 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:938"
   143137 $at_failed && at_fn_log_failure
   143138 $at_traceon; }
   143139 
   143140 { set +x
   143141 $as_echo "$at_srcdir/regression.at:938: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   143142 at_fn_check_prepare_trace "regression.at:938"
   143143 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   143144 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143145 at_status=$? at_failed=false
   143146 $at_check_filter
   143147 echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
   143148 " | \
   143149   $at_diff - "$at_stderr" || at_failed=:
   143150 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143151 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:938"
   143152 $at_failed && at_fn_log_failure
   143153 $at_traceon; }
   143154 
   143155 
   143156 
   143157   set +x
   143158   $at_times_p && times >"$at_times_file"
   143159 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   143160 read at_status <"$at_status_file"
   143161 #AT_STOP_284
   143162 #AT_START_285
   143163 at_fn_group_banner 285 'regression.at:1020' \
   143164   "Expecting two tokens " "                          " 17
   143165 at_xfail=no
   143166 (
   143167   $as_echo "285. $at_setup_line: testing $at_desc ..."
   143168   $at_traceon
   143169 
   143170 
   143171 cat >expect2.y <<'_ATEOF'
   143172 %code top {
   143173 #include <config.h>
   143174 /* We don't need perfect functions for these tests. */
   143175 #undef malloc
   143176 #undef memcmp
   143177 #undef realloc
   143178 }
   143179 
   143180 %{
   143181 static int yylex (void);
   143182 #include <stdio.h>
   143183 #include <stdlib.h>
   143184 static void yyerror ( const char *msg);
   143185 %}
   143186 
   143187 %defines
   143188 %error-verbose
   143189 %token A 1000
   143190 %token B
   143191 
   143192 %%
   143193 program: /* empty */
   143194  | program e ';'
   143195  | program error ';';
   143196 
   143197 e: e '+' t | t;
   143198 t: A | B;
   143199 
   143200 %%
   143201 #include <stdio.h>
   143202 /* A C error reporting function.  */
   143203 static
   143204 void yyerror ( const char *msg)
   143205 {
   143206   fprintf (stderr, "%s\n", msg);
   143207 }
   143208 
   143209 
   143210 #include <assert.h>
   143211 static int
   143212 yylex (void)
   143213 {
   143214   static int const tokens[] =
   143215     {
   143216       1000, '+', '+', -1
   143217     };
   143218   static size_t toknum;
   143219 
   143220   assert (toknum < sizeof tokens / sizeof *tokens);
   143221   return tokens[toknum++];
   143222 }
   143223 
   143224 int
   143225 main (void)
   143226 {
   143227   return yyparse ();
   143228 }
   143229 _ATEOF
   143230 
   143231 
   143232 
   143233 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   143234   at_save_special_files
   143235   mkdir xml-tests
   143236     # Don't combine these Bison invocations since we want to be sure that
   143237   # --report=all isn't required to get the full XML file.
   143238   { set +x
   143239 $as_echo "$at_srcdir/regression.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   143240                   --graph=xml-tests/test.dot -o expect2.c expect2.y"
   143241 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1020"
   143242 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   143243                   --graph=xml-tests/test.dot -o expect2.c expect2.y
   143244 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143245 at_status=$? at_failed=false
   143246 $at_check_filter
   143247 echo stderr:; cat "$at_stderr"
   143248 echo stdout:; cat "$at_stdout"
   143249 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143250 $at_failed && at_fn_log_failure
   143251 $at_traceon; }
   143252 
   143253   { set +x
   143254 $as_echo "$at_srcdir/regression.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
   143255 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:1020"
   143256 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
   143257 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143258 at_status=$? at_failed=false
   143259 $at_check_filter
   143260 echo stderr:; cat "$at_stderr"
   143261 echo stdout:; cat "$at_stdout"
   143262 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143263 $at_failed && at_fn_log_failure
   143264 $at_traceon; }
   143265 
   143266     cp xml-tests/test.output expout
   143267   { set +x
   143268 $as_echo "$at_srcdir/regression.at:1020: \$XSLTPROC \\
   143269              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   143270              xml-tests/test.xml"
   143271 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1020"
   143272 ( $at_check_trace; $XSLTPROC \
   143273              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   143274              xml-tests/test.xml
   143275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143276 at_status=$? at_failed=false
   143277 $at_check_filter
   143278 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143279 $at_diff expout "$at_stdout" || at_failed=:
   143280 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143281 $at_failed && at_fn_log_failure
   143282 $at_traceon; }
   143283 
   143284   sort xml-tests/test.dot > expout
   143285   { set +x
   143286 $as_echo "$at_srcdir/regression.at:1020: \$XSLTPROC \\
   143287              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   143288              xml-tests/test.xml | sort"
   143289 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1020"
   143290 ( $at_check_trace; $XSLTPROC \
   143291              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   143292              xml-tests/test.xml | sort
   143293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143294 at_status=$? at_failed=false
   143295 $at_check_filter
   143296 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143297 $at_diff expout "$at_stdout" || at_failed=:
   143298 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143299 $at_failed && at_fn_log_failure
   143300 $at_traceon; }
   143301 
   143302   rm -rf xml-tests expout
   143303   at_restore_special_files
   143304 fi
   143305 { set +x
   143306 $as_echo "$at_srcdir/regression.at:1020: bison -o expect2.c expect2.y"
   143307 at_fn_check_prepare_trace "regression.at:1020"
   143308 ( $at_check_trace; bison -o expect2.c expect2.y
   143309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143310 at_status=$? at_failed=false
   143311 $at_check_filter
   143312 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143313 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143314 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143315 $at_failed && at_fn_log_failure
   143316 $at_traceon; }
   143317 
   143318 
   143319    { set +x
   143320 $as_echo "$at_srcdir/regression.at:1020: \$BISON_C_WORKS"
   143321 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1020"
   143322 ( $at_check_trace; $BISON_C_WORKS
   143323 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143324 at_status=$? at_failed=false
   143325 $at_check_filter
   143326 echo stderr:; cat "$at_stderr"
   143327 echo stdout:; cat "$at_stdout"
   143328 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143329 $at_failed && at_fn_log_failure
   143330 $at_traceon; }
   143331 
   143332 { set +x
   143333 $as_echo "$at_srcdir/regression.at:1020: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS"
   143334 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:1020"
   143335 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS
   143336 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143337 at_status=$? at_failed=false
   143338 $at_check_filter
   143339 echo stderr:; cat "$at_stderr"
   143340 echo stdout:; cat "$at_stdout"
   143341 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143342 $at_failed && at_fn_log_failure
   143343 $at_traceon; }
   143344 
   143345 
   143346 { set +x
   143347 $as_echo "$at_srcdir/regression.at:1020:  \$PREPARSER ./expect2"
   143348 at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1020"
   143349 ( $at_check_trace;  $PREPARSER ./expect2
   143350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143351 at_status=$? at_failed=false
   143352 $at_check_filter
   143353 echo stderr:; tee stderr <"$at_stderr"
   143354 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143355 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1020"
   143356 $at_failed && at_fn_log_failure
   143357 $at_traceon; }
   143358 
   143359 { set +x
   143360 $as_echo "$at_srcdir/regression.at:1020: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   143361 at_fn_check_prepare_trace "regression.at:1020"
   143362 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   143363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143364 at_status=$? at_failed=false
   143365 $at_check_filter
   143366 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
   143367 " | \
   143368   $at_diff - "$at_stderr" || at_failed=:
   143369 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143370 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1020"
   143371 $at_failed && at_fn_log_failure
   143372 $at_traceon; }
   143373 
   143374 
   143375 
   143376   set +x
   143377   $at_times_p && times >"$at_times_file"
   143378 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   143379 read at_status <"$at_status_file"
   143380 #AT_STOP_285
   143381 #AT_START_286
   143382 at_fn_group_banner 286 'regression.at:1021' \
   143383   "Expecting two tokens %glr-parser" "               " 17
   143384 at_xfail=no
   143385 (
   143386   $as_echo "286. $at_setup_line: testing $at_desc ..."
   143387   $at_traceon
   143388 
   143389 
   143390 cat >expect2.y <<'_ATEOF'
   143391 %code top {
   143392 #include <config.h>
   143393 /* We don't need perfect functions for these tests. */
   143394 #undef malloc
   143395 #undef memcmp
   143396 #undef realloc
   143397 }
   143398 
   143399 %{
   143400 static int yylex (void);
   143401 #include <stdio.h>
   143402 #include <stdlib.h>
   143403 static void yyerror ( const char *msg);
   143404 %}
   143405 %glr-parser
   143406 %defines
   143407 %error-verbose
   143408 %token A 1000
   143409 %token B
   143410 
   143411 %%
   143412 program: /* empty */
   143413  | program e ';'
   143414  | program error ';';
   143415 
   143416 e: e '+' t | t;
   143417 t: A | B;
   143418 
   143419 %%
   143420 #include <stdio.h>
   143421 /* A C error reporting function.  */
   143422 static
   143423 void yyerror ( const char *msg)
   143424 {
   143425   fprintf (stderr, "%s\n", msg);
   143426 }
   143427 
   143428 
   143429 #include <assert.h>
   143430 static int
   143431 yylex (void)
   143432 {
   143433   static int const tokens[] =
   143434     {
   143435       1000, '+', '+', -1
   143436     };
   143437   static size_t toknum;
   143438 
   143439   assert (toknum < sizeof tokens / sizeof *tokens);
   143440   return tokens[toknum++];
   143441 }
   143442 
   143443 int
   143444 main (void)
   143445 {
   143446   return yyparse ();
   143447 }
   143448 _ATEOF
   143449 
   143450 
   143451 
   143452 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   143453   at_save_special_files
   143454   mkdir xml-tests
   143455     # Don't combine these Bison invocations since we want to be sure that
   143456   # --report=all isn't required to get the full XML file.
   143457   { set +x
   143458 $as_echo "$at_srcdir/regression.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   143459                   --graph=xml-tests/test.dot -o expect2.c expect2.y"
   143460 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1021"
   143461 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   143462                   --graph=xml-tests/test.dot -o expect2.c expect2.y
   143463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143464 at_status=$? at_failed=false
   143465 $at_check_filter
   143466 echo stderr:; cat "$at_stderr"
   143467 echo stdout:; cat "$at_stdout"
   143468 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143469 $at_failed && at_fn_log_failure
   143470 $at_traceon; }
   143471 
   143472   { set +x
   143473 $as_echo "$at_srcdir/regression.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
   143474 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:1021"
   143475 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
   143476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143477 at_status=$? at_failed=false
   143478 $at_check_filter
   143479 echo stderr:; cat "$at_stderr"
   143480 echo stdout:; cat "$at_stdout"
   143481 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143482 $at_failed && at_fn_log_failure
   143483 $at_traceon; }
   143484 
   143485     cp xml-tests/test.output expout
   143486   { set +x
   143487 $as_echo "$at_srcdir/regression.at:1021: \$XSLTPROC \\
   143488              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   143489              xml-tests/test.xml"
   143490 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1021"
   143491 ( $at_check_trace; $XSLTPROC \
   143492              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   143493              xml-tests/test.xml
   143494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143495 at_status=$? at_failed=false
   143496 $at_check_filter
   143497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143498 $at_diff expout "$at_stdout" || at_failed=:
   143499 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143500 $at_failed && at_fn_log_failure
   143501 $at_traceon; }
   143502 
   143503   sort xml-tests/test.dot > expout
   143504   { set +x
   143505 $as_echo "$at_srcdir/regression.at:1021: \$XSLTPROC \\
   143506              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   143507              xml-tests/test.xml | sort"
   143508 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1021"
   143509 ( $at_check_trace; $XSLTPROC \
   143510              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   143511              xml-tests/test.xml | sort
   143512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143513 at_status=$? at_failed=false
   143514 $at_check_filter
   143515 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143516 $at_diff expout "$at_stdout" || at_failed=:
   143517 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143518 $at_failed && at_fn_log_failure
   143519 $at_traceon; }
   143520 
   143521   rm -rf xml-tests expout
   143522   at_restore_special_files
   143523 fi
   143524 { set +x
   143525 $as_echo "$at_srcdir/regression.at:1021: bison -o expect2.c expect2.y"
   143526 at_fn_check_prepare_trace "regression.at:1021"
   143527 ( $at_check_trace; bison -o expect2.c expect2.y
   143528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143529 at_status=$? at_failed=false
   143530 $at_check_filter
   143531 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143532 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143533 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143534 $at_failed && at_fn_log_failure
   143535 $at_traceon; }
   143536 
   143537 
   143538    { set +x
   143539 $as_echo "$at_srcdir/regression.at:1021: \$BISON_C_WORKS"
   143540 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1021"
   143541 ( $at_check_trace; $BISON_C_WORKS
   143542 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143543 at_status=$? at_failed=false
   143544 $at_check_filter
   143545 echo stderr:; cat "$at_stderr"
   143546 echo stdout:; cat "$at_stdout"
   143547 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143548 $at_failed && at_fn_log_failure
   143549 $at_traceon; }
   143550 
   143551 { set +x
   143552 $as_echo "$at_srcdir/regression.at:1021: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS"
   143553 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:1021"
   143554 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS
   143555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143556 at_status=$? at_failed=false
   143557 $at_check_filter
   143558 echo stderr:; cat "$at_stderr"
   143559 echo stdout:; cat "$at_stdout"
   143560 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143561 $at_failed && at_fn_log_failure
   143562 $at_traceon; }
   143563 
   143564 
   143565 { set +x
   143566 $as_echo "$at_srcdir/regression.at:1021:  \$PREPARSER ./expect2"
   143567 at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1021"
   143568 ( $at_check_trace;  $PREPARSER ./expect2
   143569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143570 at_status=$? at_failed=false
   143571 $at_check_filter
   143572 echo stderr:; tee stderr <"$at_stderr"
   143573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143574 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1021"
   143575 $at_failed && at_fn_log_failure
   143576 $at_traceon; }
   143577 
   143578 { set +x
   143579 $as_echo "$at_srcdir/regression.at:1021: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   143580 at_fn_check_prepare_trace "regression.at:1021"
   143581 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   143582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143583 at_status=$? at_failed=false
   143584 $at_check_filter
   143585 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
   143586 " | \
   143587   $at_diff - "$at_stderr" || at_failed=:
   143588 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143589 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1021"
   143590 $at_failed && at_fn_log_failure
   143591 $at_traceon; }
   143592 
   143593 
   143594 
   143595   set +x
   143596   $at_times_p && times >"$at_times_file"
   143597 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   143598 read at_status <"$at_status_file"
   143599 #AT_STOP_286
   143600 #AT_START_287
   143601 at_fn_group_banner 287 'regression.at:1022' \
   143602   "Expecting two tokens %skeleton \"lalr1.cc\"" "      " 17
   143603 at_xfail=no
   143604 (
   143605   $as_echo "287. $at_setup_line: testing $at_desc ..."
   143606   $at_traceon
   143607 
   143608 
   143609 cat >expect2.y <<'_ATEOF'
   143610 %code top {
   143611 #include <config.h>
   143612 /* We don't need perfect functions for these tests. */
   143613 #undef malloc
   143614 #undef memcmp
   143615 #undef realloc
   143616 }
   143617 
   143618 %{
   143619 static int yylex (int *);
   143620 
   143621 %}
   143622 %skeleton "lalr1.cc"
   143623 %defines
   143624 %error-verbose
   143625 %token A 1000
   143626 %token B
   143627 
   143628 %%
   143629 program: /* empty */
   143630  | program e ';'
   143631  | program error ';';
   143632 
   143633 e: e '+' t | t;
   143634 t: A | B;
   143635 
   143636 %%
   143637 /* A C++ error reporting function.  */
   143638 void
   143639 yy::parser::error (const location_type& l, const std::string& m)
   143640 {
   143641   (void) l;
   143642   std::cerr << m << std::endl;
   143643 }
   143644 int
   143645 yyparse ()
   143646 {
   143647   yy::parser parser;
   143648   return parser.parse ();
   143649 }
   143650 
   143651 
   143652 #include <assert.h>
   143653 static int
   143654 yylex (int *lval)
   143655 {
   143656   static int const tokens[] =
   143657     {
   143658       1000, '+', '+', -1
   143659     };
   143660   static size_t toknum;
   143661   *lval = 0; /* Pacify GCC.  */
   143662   assert (toknum < sizeof tokens / sizeof *tokens);
   143663   return tokens[toknum++];
   143664 }
   143665 
   143666 int
   143667 main (void)
   143668 {
   143669   return yyparse ();
   143670 }
   143671 _ATEOF
   143672 
   143673 
   143674 
   143675 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   143676   at_save_special_files
   143677   mkdir xml-tests
   143678     # Don't combine these Bison invocations since we want to be sure that
   143679   # --report=all isn't required to get the full XML file.
   143680   { set +x
   143681 $as_echo "$at_srcdir/regression.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   143682                   --graph=xml-tests/test.dot -o expect2.cc expect2.y"
   143683 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1022"
   143684 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   143685                   --graph=xml-tests/test.dot -o expect2.cc expect2.y
   143686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143687 at_status=$? at_failed=false
   143688 $at_check_filter
   143689 echo stderr:; cat "$at_stderr"
   143690 echo stdout:; cat "$at_stdout"
   143691 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143692 $at_failed && at_fn_log_failure
   143693 $at_traceon; }
   143694 
   143695   { set +x
   143696 $as_echo "$at_srcdir/regression.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y"
   143697 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y" "regression.at:1022"
   143698 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y
   143699 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143700 at_status=$? at_failed=false
   143701 $at_check_filter
   143702 echo stderr:; cat "$at_stderr"
   143703 echo stdout:; cat "$at_stdout"
   143704 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143705 $at_failed && at_fn_log_failure
   143706 $at_traceon; }
   143707 
   143708     cp xml-tests/test.output expout
   143709   { set +x
   143710 $as_echo "$at_srcdir/regression.at:1022: \$XSLTPROC \\
   143711              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   143712              xml-tests/test.xml"
   143713 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1022"
   143714 ( $at_check_trace; $XSLTPROC \
   143715              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   143716              xml-tests/test.xml
   143717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143718 at_status=$? at_failed=false
   143719 $at_check_filter
   143720 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143721 $at_diff expout "$at_stdout" || at_failed=:
   143722 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143723 $at_failed && at_fn_log_failure
   143724 $at_traceon; }
   143725 
   143726   sort xml-tests/test.dot > expout
   143727   { set +x
   143728 $as_echo "$at_srcdir/regression.at:1022: \$XSLTPROC \\
   143729              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   143730              xml-tests/test.xml | sort"
   143731 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1022"
   143732 ( $at_check_trace; $XSLTPROC \
   143733              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   143734              xml-tests/test.xml | sort
   143735 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143736 at_status=$? at_failed=false
   143737 $at_check_filter
   143738 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143739 $at_diff expout "$at_stdout" || at_failed=:
   143740 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143741 $at_failed && at_fn_log_failure
   143742 $at_traceon; }
   143743 
   143744   rm -rf xml-tests expout
   143745   at_restore_special_files
   143746 fi
   143747 { set +x
   143748 $as_echo "$at_srcdir/regression.at:1022: bison -o expect2.cc expect2.y"
   143749 at_fn_check_prepare_trace "regression.at:1022"
   143750 ( $at_check_trace; bison -o expect2.cc expect2.y
   143751 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143752 at_status=$? at_failed=false
   143753 $at_check_filter
   143754 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143755 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143756 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143757 $at_failed && at_fn_log_failure
   143758 $at_traceon; }
   143759 
   143760 
   143761 
   143762 { set +x
   143763 $as_echo "$at_srcdir/regression.at:1022: \$BISON_CXX_WORKS"
   143764 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1022"
   143765 ( $at_check_trace; $BISON_CXX_WORKS
   143766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143767 at_status=$? at_failed=false
   143768 $at_check_filter
   143769 echo stderr:; cat "$at_stderr"
   143770 echo stdout:; cat "$at_stdout"
   143771 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143772 $at_failed && at_fn_log_failure
   143773 $at_traceon; }
   143774 
   143775 { set +x
   143776 $as_echo "$at_srcdir/regression.at:1022: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.cc \$LIBS"
   143777 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS" "regression.at:1022"
   143778 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS
   143779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143780 at_status=$? at_failed=false
   143781 $at_check_filter
   143782 echo stderr:; cat "$at_stderr"
   143783 echo stdout:; cat "$at_stdout"
   143784 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143785 $at_failed && at_fn_log_failure
   143786 $at_traceon; }
   143787 
   143788 
   143789 { set +x
   143790 $as_echo "$at_srcdir/regression.at:1022:  \$PREPARSER ./expect2"
   143791 at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1022"
   143792 ( $at_check_trace;  $PREPARSER ./expect2
   143793 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143794 at_status=$? at_failed=false
   143795 $at_check_filter
   143796 echo stderr:; tee stderr <"$at_stderr"
   143797 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143798 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1022"
   143799 $at_failed && at_fn_log_failure
   143800 $at_traceon; }
   143801 
   143802 { set +x
   143803 $as_echo "$at_srcdir/regression.at:1022: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   143804 at_fn_check_prepare_trace "regression.at:1022"
   143805 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   143806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143807 at_status=$? at_failed=false
   143808 $at_check_filter
   143809 echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
   143810 " | \
   143811   $at_diff - "$at_stderr" || at_failed=:
   143812 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143813 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1022"
   143814 $at_failed && at_fn_log_failure
   143815 $at_traceon; }
   143816 
   143817 
   143818 
   143819   set +x
   143820   $at_times_p && times >"$at_times_file"
   143821 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   143822 read at_status <"$at_status_file"
   143823 #AT_STOP_287
   143824 #AT_START_288
   143825 at_fn_group_banner 288 'regression.at:1030' \
   143826   "Braced code in declaration in rules section" "    " 17
   143827 at_xfail=no
   143828 (
   143829   $as_echo "288. $at_setup_line: testing $at_desc ..."
   143830   $at_traceon
   143831 
   143832 
   143833 # Bison once mistook braced code in a declaration in the rules section to be a
   143834 # rule action.
   143835 
   143836 cat >input.y <<'_ATEOF'
   143837 %code top {
   143838 #include <config.h>
   143839 /* We don't need perfect functions for these tests. */
   143840 #undef malloc
   143841 #undef memcmp
   143842 #undef realloc
   143843 }
   143844 
   143845 %{
   143846 #include <stdio.h>
   143847 static void yyerror ( const char *msg);
   143848 static int yylex (void);
   143849 %}
   143850 
   143851 %error-verbose
   143852 
   143853 %%
   143854 
   143855 start:
   143856   {
   143857     printf ("Bison would once convert this action to a midrule because of the"
   143858 	    " subsequent braced code.\n");
   143859   }
   143860   ;
   143861 
   143862 %destructor { fprintf (stderr, "DESTRUCTOR\n"); } 'a';
   143863 %printer { fprintf (yyoutput, "PRINTER"); } 'a';
   143864 
   143865 %%
   143866 #include <stdio.h>
   143867 /* A C error reporting function.  */
   143868 static
   143869 void yyerror ( const char *msg)
   143870 {
   143871   fprintf (stderr, "%s\n", msg);
   143872 }
   143873 #include <assert.h>
   143874 static
   143875 int yylex (void)
   143876 {
   143877   static char const input[] = "a";
   143878   static size_t toknum = 0;
   143879   int res;
   143880   ;
   143881   assert (toknum < sizeof input / sizeof input[0]);
   143882   res = input[toknum++];
   143883   ;
   143884   return res;
   143885 }
   143886 
   143887 int
   143888 main (void)
   143889 {
   143890   yydebug = 1;
   143891   return !yyparse ();
   143892 }
   143893 _ATEOF
   143894 
   143895 
   143896 
   143897 
   143898 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   143899   at_save_special_files
   143900   mkdir xml-tests
   143901     # Don't combine these Bison invocations since we want to be sure that
   143902   # --report=all isn't required to get the full XML file.
   143903   { set +x
   143904 $as_echo "$at_srcdir/regression.at:1069: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   143905                   --graph=xml-tests/test.dot -t -o input.c input.y"
   143906 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1069"
   143907 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   143908                   --graph=xml-tests/test.dot -t -o input.c input.y
   143909 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143910 at_status=$? at_failed=false
   143911 $at_check_filter
   143912 echo stderr:; cat "$at_stderr"
   143913 echo stdout:; cat "$at_stdout"
   143914 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069"
   143915 $at_failed && at_fn_log_failure
   143916 $at_traceon; }
   143917 
   143918   { set +x
   143919 $as_echo "$at_srcdir/regression.at:1069: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y"
   143920 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" "regression.at:1069"
   143921 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y
   143922 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143923 at_status=$? at_failed=false
   143924 $at_check_filter
   143925 echo stderr:; cat "$at_stderr"
   143926 echo stdout:; cat "$at_stdout"
   143927 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069"
   143928 $at_failed && at_fn_log_failure
   143929 $at_traceon; }
   143930 
   143931     cp xml-tests/test.output expout
   143932   { set +x
   143933 $as_echo "$at_srcdir/regression.at:1069: \$XSLTPROC \\
   143934              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   143935              xml-tests/test.xml"
   143936 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1069"
   143937 ( $at_check_trace; $XSLTPROC \
   143938              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   143939              xml-tests/test.xml
   143940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143941 at_status=$? at_failed=false
   143942 $at_check_filter
   143943 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143944 $at_diff expout "$at_stdout" || at_failed=:
   143945 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069"
   143946 $at_failed && at_fn_log_failure
   143947 $at_traceon; }
   143948 
   143949   sort xml-tests/test.dot > expout
   143950   { set +x
   143951 $as_echo "$at_srcdir/regression.at:1069: \$XSLTPROC \\
   143952              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   143953              xml-tests/test.xml | sort"
   143954 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1069"
   143955 ( $at_check_trace; $XSLTPROC \
   143956              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   143957              xml-tests/test.xml | sort
   143958 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143959 at_status=$? at_failed=false
   143960 $at_check_filter
   143961 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143962 $at_diff expout "$at_stdout" || at_failed=:
   143963 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069"
   143964 $at_failed && at_fn_log_failure
   143965 $at_traceon; }
   143966 
   143967   rm -rf xml-tests expout
   143968   at_restore_special_files
   143969 fi
   143970 { set +x
   143971 $as_echo "$at_srcdir/regression.at:1069: bison -t -o input.c input.y"
   143972 at_fn_check_prepare_trace "regression.at:1069"
   143973 ( $at_check_trace; bison -t -o input.c input.y
   143974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143975 at_status=$? at_failed=false
   143976 $at_check_filter
   143977 at_fn_diff_devnull "$at_stderr" || at_failed=:
   143978 at_fn_diff_devnull "$at_stdout" || at_failed=:
   143979 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1069"
   143980 $at_failed && at_fn_log_failure
   143981 $at_traceon; }
   143982 
   143983 
   143984 { set +x
   143985 $as_echo "$at_srcdir/regression.at:1070: \$BISON_C_WORKS"
   143986 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1070"
   143987 ( $at_check_trace; $BISON_C_WORKS
   143988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   143989 at_status=$? at_failed=false
   143990 $at_check_filter
   143991 echo stderr:; cat "$at_stderr"
   143992 echo stdout:; cat "$at_stdout"
   143993 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1070"
   143994 $at_failed && at_fn_log_failure
   143995 $at_traceon; }
   143996 
   143997 { set +x
   143998 $as_echo "$at_srcdir/regression.at:1070: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   143999 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1070"
   144000 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   144001 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144002 at_status=$? at_failed=false
   144003 $at_check_filter
   144004 echo stderr:; cat "$at_stderr"
   144005 echo stdout:; cat "$at_stdout"
   144006 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1070"
   144007 $at_failed && at_fn_log_failure
   144008 $at_traceon; }
   144009 
   144010 { set +x
   144011 $as_echo "$at_srcdir/regression.at:1071:  \$PREPARSER ./input"
   144012 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1071"
   144013 ( $at_check_trace;  $PREPARSER ./input
   144014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144015 at_status=$? at_failed=false
   144016 $at_check_filter
   144017 echo stderr:; tee stderr <"$at_stderr"
   144018 echo >>"$at_stdout"; $as_echo "Bison would once convert this action to a midrule because of the subsequent braced code.
   144019 " | \
   144020   $at_diff - "$at_stdout" || at_failed=:
   144021 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1071"
   144022 $at_failed && at_fn_log_failure
   144023 $at_traceon; }
   144024 
   144025 { set +x
   144026 $as_echo "$at_srcdir/regression.at:1071: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   144027 at_fn_check_prepare_trace "regression.at:1071"
   144028 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   144029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144030 at_status=$? at_failed=false
   144031 $at_check_filter
   144032 echo >>"$at_stderr"; $as_echo "Starting parse
   144033 Entering state 0
   144034 Reducing stack by rule 1 (line 20):
   144035 -> \$\$ = nterm start ()
   144036 Stack now 0
   144037 Entering state 1
   144038 Reading a token: Next token is token 'a' (PRINTER)
   144039 syntax error, unexpected 'a', expecting \$end
   144040 Error: popping nterm start ()
   144041 Stack now 0
   144042 Cleanup: discarding lookahead token 'a' (PRINTER)
   144043 DESTRUCTOR
   144044 Stack now 0
   144045 " | \
   144046   $at_diff - "$at_stderr" || at_failed=:
   144047 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144048 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1071"
   144049 $at_failed && at_fn_log_failure
   144050 $at_traceon; }
   144051 
   144052 
   144053 
   144054   set +x
   144055   $at_times_p && times >"$at_times_file"
   144056 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   144057 read at_status <"$at_status_file"
   144058 #AT_STOP_288
   144059 #AT_START_289
   144060 at_fn_group_banner 289 'regression.at:1097' \
   144061   "String alias declared after use" "                " 17
   144062 at_xfail=no
   144063 (
   144064   $as_echo "289. $at_setup_line: testing $at_desc ..."
   144065   $at_traceon
   144066 
   144067 
   144068 # Bison once incorrectly asserted that the symbol number for either a token or
   144069 # its alias was the highest symbol number so far at the point of the alias
   144070 # declaration.  That was true unless the declaration appeared after their first
   144071 # uses and other tokens appeared in between.
   144072 
   144073 cat >input.y <<'_ATEOF'
   144074 %%
   144075 start: 'a' "A" 'b';
   144076 %token 'a' "A";
   144077 _ATEOF
   144078 
   144079 
   144080 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   144081   at_save_special_files
   144082   mkdir xml-tests
   144083     # Don't combine these Bison invocations since we want to be sure that
   144084   # --report=all isn't required to get the full XML file.
   144085   { set +x
   144086 $as_echo "$at_srcdir/regression.at:1110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   144087                   --graph=xml-tests/test.dot -t -o input.c input.y"
   144088 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1110"
   144089 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   144090                   --graph=xml-tests/test.dot -t -o input.c input.y
   144091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144092 at_status=$? at_failed=false
   144093 $at_check_filter
   144094 echo stderr:; cat "$at_stderr"
   144095 echo stdout:; cat "$at_stdout"
   144096 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110"
   144097 $at_failed && at_fn_log_failure
   144098 $at_traceon; }
   144099 
   144100   { set +x
   144101 $as_echo "$at_srcdir/regression.at:1110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y"
   144102 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" "regression.at:1110"
   144103 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y
   144104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144105 at_status=$? at_failed=false
   144106 $at_check_filter
   144107 echo stderr:; cat "$at_stderr"
   144108 echo stdout:; cat "$at_stdout"
   144109 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110"
   144110 $at_failed && at_fn_log_failure
   144111 $at_traceon; }
   144112 
   144113     cp xml-tests/test.output expout
   144114   { set +x
   144115 $as_echo "$at_srcdir/regression.at:1110: \$XSLTPROC \\
   144116              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   144117              xml-tests/test.xml"
   144118 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1110"
   144119 ( $at_check_trace; $XSLTPROC \
   144120              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   144121              xml-tests/test.xml
   144122 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144123 at_status=$? at_failed=false
   144124 $at_check_filter
   144125 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144126 $at_diff expout "$at_stdout" || at_failed=:
   144127 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110"
   144128 $at_failed && at_fn_log_failure
   144129 $at_traceon; }
   144130 
   144131   sort xml-tests/test.dot > expout
   144132   { set +x
   144133 $as_echo "$at_srcdir/regression.at:1110: \$XSLTPROC \\
   144134              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   144135              xml-tests/test.xml | sort"
   144136 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1110"
   144137 ( $at_check_trace; $XSLTPROC \
   144138              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   144139              xml-tests/test.xml | sort
   144140 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144141 at_status=$? at_failed=false
   144142 $at_check_filter
   144143 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144144 $at_diff expout "$at_stdout" || at_failed=:
   144145 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110"
   144146 $at_failed && at_fn_log_failure
   144147 $at_traceon; }
   144148 
   144149   rm -rf xml-tests expout
   144150   at_restore_special_files
   144151 fi
   144152 { set +x
   144153 $as_echo "$at_srcdir/regression.at:1110: bison -t -o input.c input.y"
   144154 at_fn_check_prepare_trace "regression.at:1110"
   144155 ( $at_check_trace; bison -t -o input.c input.y
   144156 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144157 at_status=$? at_failed=false
   144158 $at_check_filter
   144159 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144160 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144161 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1110"
   144162 $at_failed && at_fn_log_failure
   144163 $at_traceon; }
   144164 
   144165 
   144166 
   144167   set +x
   144168   $at_times_p && times >"$at_times_file"
   144169 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   144170 read at_status <"$at_status_file"
   144171 #AT_STOP_289
   144172 #AT_START_290
   144173 at_fn_group_banner 290 'regression.at:1120' \
   144174   "Extra lookahead sets in report" "                 " 17
   144175 at_xfail=no
   144176 (
   144177   $as_echo "290. $at_setup_line: testing $at_desc ..."
   144178   $at_traceon
   144179 
   144180 
   144181 # Bison prints each reduction's lookahead set only next to the associated
   144182 # state's one item that (1) is associated with the same rule as the reduction
   144183 # and (2) has its dot at the end of its RHS.  Previously, Bison also
   144184 # erroneously printed the lookahead set next to all of the state's other items
   144185 # associated with the same rule.  This bug affected only the '.output' file and
   144186 # not the generated parser source code.
   144187 
   144188 cat >input.y <<'_ATEOF'
   144189 %%
   144190 start: a | 'a' a 'a' ;
   144191 a: 'a' ;
   144192 _ATEOF
   144193 
   144194 
   144195 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   144196   at_save_special_files
   144197   mkdir xml-tests
   144198     # Don't combine these Bison invocations since we want to be sure that
   144199   # --report=all isn't required to get the full XML file.
   144200   { set +x
   144201 $as_echo "$at_srcdir/regression.at:1135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   144202                   --graph=xml-tests/test.dot --report=all input.y"
   144203 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1135"
   144204 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   144205                   --graph=xml-tests/test.dot --report=all input.y
   144206 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144207 at_status=$? at_failed=false
   144208 $at_check_filter
   144209 echo stderr:; cat "$at_stderr"
   144210 echo stdout:; cat "$at_stdout"
   144211 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135"
   144212 $at_failed && at_fn_log_failure
   144213 $at_traceon; }
   144214 
   144215   { set +x
   144216 $as_echo "$at_srcdir/regression.at:1135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y"
   144217 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" "regression.at:1135"
   144218 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y
   144219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144220 at_status=$? at_failed=false
   144221 $at_check_filter
   144222 echo stderr:; cat "$at_stderr"
   144223 echo stdout:; cat "$at_stdout"
   144224 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135"
   144225 $at_failed && at_fn_log_failure
   144226 $at_traceon; }
   144227 
   144228     cp xml-tests/test.output expout
   144229   { set +x
   144230 $as_echo "$at_srcdir/regression.at:1135: \$XSLTPROC \\
   144231              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   144232              xml-tests/test.xml"
   144233 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1135"
   144234 ( $at_check_trace; $XSLTPROC \
   144235              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   144236              xml-tests/test.xml
   144237 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144238 at_status=$? at_failed=false
   144239 $at_check_filter
   144240 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144241 $at_diff expout "$at_stdout" || at_failed=:
   144242 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135"
   144243 $at_failed && at_fn_log_failure
   144244 $at_traceon; }
   144245 
   144246   sort xml-tests/test.dot > expout
   144247   { set +x
   144248 $as_echo "$at_srcdir/regression.at:1135: \$XSLTPROC \\
   144249              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   144250              xml-tests/test.xml | sort"
   144251 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1135"
   144252 ( $at_check_trace; $XSLTPROC \
   144253              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   144254              xml-tests/test.xml | sort
   144255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144256 at_status=$? at_failed=false
   144257 $at_check_filter
   144258 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144259 $at_diff expout "$at_stdout" || at_failed=:
   144260 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135"
   144261 $at_failed && at_fn_log_failure
   144262 $at_traceon; }
   144263 
   144264   rm -rf xml-tests expout
   144265   at_restore_special_files
   144266 fi
   144267 { set +x
   144268 $as_echo "$at_srcdir/regression.at:1135: bison --report=all input.y"
   144269 at_fn_check_prepare_trace "regression.at:1135"
   144270 ( $at_check_trace; bison --report=all input.y
   144271 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144272 at_status=$? at_failed=false
   144273 $at_check_filter
   144274 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144275 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144276 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1135"
   144277 $at_failed && at_fn_log_failure
   144278 $at_traceon; }
   144279 
   144280 
   144281 { set +x
   144282 $as_echo "$at_srcdir/regression.at:1136: sed -n '/^State 1\$/,/^State 2\$/p' input.output"
   144283 at_fn_check_prepare_dynamic "sed -n '/^State 1$/,/^State 2$/p' input.output" "regression.at:1136"
   144284 ( $at_check_trace; sed -n '/^State 1$/,/^State 2$/p' input.output
   144285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144286 at_status=$? at_failed=false
   144287 $at_check_filter
   144288 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144289 echo >>"$at_stdout"; $as_echo "State 1
   144290 
   144291     2 start: 'a' . a 'a'
   144292     3 a: . 'a'
   144293     3  | 'a' .  [\$end]
   144294 
   144295     'a'  shift, and go to state 4
   144296 
   144297     \$default  reduce using rule 3 (a)
   144298 
   144299     a  go to state 5
   144300 
   144301 
   144302 State 2
   144303 " | \
   144304   $at_diff - "$at_stdout" || at_failed=:
   144305 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1136"
   144306 $at_failed && at_fn_log_failure
   144307 $at_traceon; }
   144308 
   144309 
   144310   set +x
   144311   $at_times_p && times >"$at_times_file"
   144312 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   144313 read at_status <"$at_status_file"
   144314 #AT_STOP_290
   144315 #AT_START_291
   144316 at_fn_group_banner 291 'regression.at:1161' \
   144317   "Token number in precedence declaration" "         " 17
   144318 at_xfail=no
   144319 (
   144320   $as_echo "291. $at_setup_line: testing $at_desc ..."
   144321   $at_traceon
   144322 
   144323 
   144324 # POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
   144325 # we lost this in Bison 1.50.
   144326 
   144327 cat >input.y <<'_ATEOF'
   144328 %code top {
   144329 #include <config.h>
   144330 /* We don't need perfect functions for these tests. */
   144331 #undef malloc
   144332 #undef memcmp
   144333 #undef realloc
   144334 }
   144335 
   144336 %{
   144337   #include <stdio.h>
   144338   static void yyerror ( const char *msg);
   144339   static int yylex (void);
   144340 %}
   144341 
   144342 %error-verbose
   144343 %right END 0
   144344 %left TK1 1 TK2 2 "tok alias" 3
   144345 
   144346 %%
   144347 
   144348 start:
   144349     TK1 sr_conflict "tok alias"
   144350   | start %prec END
   144351   ;
   144352 sr_conflict:
   144353   TK2
   144354   | TK2 "tok alias"
   144355   ;
   144356 
   144357 %%
   144358 
   144359 #include <stdio.h>
   144360 /* A C error reporting function.  */
   144361 static
   144362 void yyerror ( const char *msg)
   144363 {
   144364   fprintf (stderr, "%s\n", msg);
   144365 }
   144366 #include <assert.h>
   144367 static
   144368 int yylex (void)
   144369 {
   144370   static int const input[] = { 1, 2, 3, 0 };
   144371   static size_t toknum = 0;
   144372   int res;
   144373   ;
   144374   assert (toknum < sizeof input / sizeof input[0]);
   144375   res = input[toknum++];
   144376   ;
   144377   return res;
   144378 }
   144379 
   144380 int
   144381 main (void)
   144382 {
   144383   return yyparse ();
   144384 }
   144385 _ATEOF
   144386 
   144387 
   144388 
   144389 
   144390 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   144391   at_save_special_files
   144392   mkdir xml-tests
   144393     # Don't combine these Bison invocations since we want to be sure that
   144394   # --report=all isn't required to get the full XML file.
   144395   { set +x
   144396 $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   144397                   --graph=xml-tests/test.dot -o input.c input.y"
   144398 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1201"
   144399 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   144400                   --graph=xml-tests/test.dot -o input.c input.y
   144401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144402 at_status=$? at_failed=false
   144403 $at_check_filter
   144404 echo stderr:; cat "$at_stderr"
   144405 echo stdout:; cat "$at_stdout"
   144406 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144407 $at_failed && at_fn_log_failure
   144408 $at_traceon; }
   144409 
   144410   { set +x
   144411 $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   144412 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1201"
   144413 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   144414 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144415 at_status=$? at_failed=false
   144416 $at_check_filter
   144417 echo stderr:; cat "$at_stderr"
   144418 echo stdout:; cat "$at_stdout"
   144419 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144420 $at_failed && at_fn_log_failure
   144421 $at_traceon; }
   144422 
   144423     cp xml-tests/test.output expout
   144424   { set +x
   144425 $as_echo "$at_srcdir/regression.at:1201: \$XSLTPROC \\
   144426              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   144427              xml-tests/test.xml"
   144428 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1201"
   144429 ( $at_check_trace; $XSLTPROC \
   144430              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   144431              xml-tests/test.xml
   144432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144433 at_status=$? at_failed=false
   144434 $at_check_filter
   144435 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144436 $at_diff expout "$at_stdout" || at_failed=:
   144437 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144438 $at_failed && at_fn_log_failure
   144439 $at_traceon; }
   144440 
   144441   sort xml-tests/test.dot > expout
   144442   { set +x
   144443 $as_echo "$at_srcdir/regression.at:1201: \$XSLTPROC \\
   144444              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   144445              xml-tests/test.xml | sort"
   144446 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1201"
   144447 ( $at_check_trace; $XSLTPROC \
   144448              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   144449              xml-tests/test.xml | sort
   144450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144451 at_status=$? at_failed=false
   144452 $at_check_filter
   144453 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144454 $at_diff expout "$at_stdout" || at_failed=:
   144455 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144456 $at_failed && at_fn_log_failure
   144457 $at_traceon; }
   144458 
   144459   rm -rf xml-tests expout
   144460   at_restore_special_files
   144461 fi
   144462 { set +x
   144463 $as_echo "$at_srcdir/regression.at:1201: bison -o input.c input.y"
   144464 at_fn_check_prepare_trace "regression.at:1201"
   144465 ( $at_check_trace; bison -o input.c input.y
   144466 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144467 at_status=$? at_failed=false
   144468 $at_check_filter
   144469 echo >>"$at_stderr"; $as_echo "input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start
   144470 input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 \"tok alias\"
   144471 " | \
   144472   $at_diff - "$at_stderr" || at_failed=:
   144473 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144474 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144475 $at_failed && at_fn_log_failure
   144476 $at_traceon; }
   144477 
   144478 # Defining POSIXLY_CORRECT causes bison to complain if options are
   144479 # added after the grammar file name, so skip these checks in that
   144480 # case.
   144481 if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
   144482   at_save_special_files
   144483 
   144484   # To avoid expanding it repeatedly, store specified stdout.
   144485   : >expout
   144486 
   144487   # Run with -Werror.
   144488   { set +x
   144489 $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror"
   144490 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "regression.at:1201"
   144491 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror
   144492 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144493 at_status=$? at_failed=false
   144494 $at_check_filter
   144495 echo stderr:; tee stderr <"$at_stderr"
   144496 $at_diff expout "$at_stdout" || at_failed=:
   144497 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1201"
   144498 $at_failed && at_fn_log_failure
   144499 $at_traceon; }
   144500 
   144501 
   144502   # Build expected stderr up to and including the "warnings being
   144503   # treated as errors" message.
   144504   cat >at-bison-check-warnings <<'_ATEOF'
   144505 input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start
   144506 input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 "tok alias"
   144507 _ATEOF
   144508 
   144509   at_bison_check_first=`sed -n \
   144510     '/: warning: /{=;q;}' at-bison-check-warnings`
   144511   : ${at_bison_check_first:=1}
   144512   at_bison_check_first_tmp=`sed -n \
   144513     '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
   144514   : ${at_bison_check_first_tmp:=1}
   144515   if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
   144516     at_bison_check_first=$at_bison_check_first_tmp
   144517   fi
   144518   if test $at_bison_check_first -gt 1; then
   144519     sed -n "1,`expr $at_bison_check_first - 1`"p \
   144520       at-bison-check-warnings > experr
   144521   fi
   144522   echo 'bison: warnings being treated as errors' >> experr
   144523 
   144524   # Finish building expected stderr and check.  Unlike warnings,
   144525   # complaints cause bison to exit early.  Thus, with -Werror, bison
   144526   # does not necessarily report all warnings that it does without
   144527   # -Werror, but it at least reports one.
   144528   at_bison_check_last=`sed -n '$=' stderr`
   144529   : ${at_bison_check_last:=1}
   144530   at_bison_check_last=`expr $at_bison_check_last - 1`
   144531   sed -n "$at_bison_check_first,$at_bison_check_last"p \
   144532     at-bison-check-warnings >> experr
   144533   { set +x
   144534 $as_echo "$at_srcdir/regression.at:1201: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\
   144535               stderr 1>&2"
   144536 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1201"
   144537 ( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \
   144538               stderr 1>&2
   144539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144540 at_status=$? at_failed=false
   144541 $at_check_filter
   144542 $at_diff experr "$at_stderr" || at_failed=:
   144543 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144544 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144545 $at_failed && at_fn_log_failure
   144546 $at_traceon; }
   144547 
   144548 
   144549   # Now check --warnings=error.
   144550   cp stderr experr
   144551   { set +x
   144552 $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error"
   144553 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "regression.at:1201"
   144554 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error
   144555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144556 at_status=$? at_failed=false
   144557 $at_check_filter
   144558 $at_diff experr "$at_stderr" || at_failed=:
   144559 $at_diff expout "$at_stdout" || at_failed=:
   144560 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1201"
   144561 $at_failed && at_fn_log_failure
   144562 $at_traceon; }
   144563 
   144564 
   144565   # Now check -Wnone and --warnings=none by making sure that
   144566   # -Werror doesn't change the exit status when -Wnone or
   144567   # --warnings=none is specified.
   144568   { set +x
   144569 $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror"
   144570 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "regression.at:1201"
   144571 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror
   144572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144573 at_status=$? at_failed=false
   144574 $at_check_filter
   144575 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144576 $at_diff expout "$at_stdout" || at_failed=:
   144577 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144578 $at_failed && at_fn_log_failure
   144579 $at_traceon; }
   144580 
   144581   { set +x
   144582 $as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror"
   144583 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "regression.at:1201"
   144584 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror
   144585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144586 at_status=$? at_failed=false
   144587 $at_check_filter
   144588 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144589 $at_diff expout "$at_stdout" || at_failed=:
   144590 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1201"
   144591 $at_failed && at_fn_log_failure
   144592 $at_traceon; }
   144593 
   144594 
   144595   at_restore_special_files
   144596 fi
   144597 { set +x
   144598 $as_echo "$at_srcdir/regression.at:1205: \$BISON_C_WORKS"
   144599 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1205"
   144600 ( $at_check_trace; $BISON_C_WORKS
   144601 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144602 at_status=$? at_failed=false
   144603 $at_check_filter
   144604 echo stderr:; cat "$at_stderr"
   144605 echo stdout:; cat "$at_stdout"
   144606 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1205"
   144607 $at_failed && at_fn_log_failure
   144608 $at_traceon; }
   144609 
   144610 { set +x
   144611 $as_echo "$at_srcdir/regression.at:1205: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   144612 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1205"
   144613 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   144614 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144615 at_status=$? at_failed=false
   144616 $at_check_filter
   144617 echo stderr:; cat "$at_stderr"
   144618 echo stdout:; cat "$at_stdout"
   144619 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1205"
   144620 $at_failed && at_fn_log_failure
   144621 $at_traceon; }
   144622 
   144623 { set +x
   144624 $as_echo "$at_srcdir/regression.at:1206:  \$PREPARSER ./input"
   144625 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1206"
   144626 ( $at_check_trace;  $PREPARSER ./input
   144627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144628 at_status=$? at_failed=false
   144629 $at_check_filter
   144630 echo stderr:; tee stderr <"$at_stderr"
   144631 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144632 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1206"
   144633 $at_failed && at_fn_log_failure
   144634 $at_traceon; }
   144635 
   144636 { set +x
   144637 $as_echo "$at_srcdir/regression.at:1206: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   144638 at_fn_check_prepare_trace "regression.at:1206"
   144639 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   144640 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144641 at_status=$? at_failed=false
   144642 $at_check_filter
   144643 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144644 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144645 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1206"
   144646 $at_failed && at_fn_log_failure
   144647 $at_traceon; }
   144648 
   144649 
   144650 
   144651   set +x
   144652   $at_times_p && times >"$at_times_file"
   144653 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   144654 read at_status <"$at_status_file"
   144655 #AT_STOP_291
   144656 #AT_START_292
   144657 at_fn_group_banner 292 'regression.at:1219' \
   144658   "parse-gram.y: LALR = IELR" "                      " 17
   144659 at_xfail=no
   144660 (
   144661   $as_echo "292. $at_setup_line: testing $at_desc ..."
   144662   $at_traceon
   144663 
   144664 
   144665 # Avoid differences in synclines by telling bison that the output files
   144666 # have the same name.
   144667 cp $abs_top_srcdir/src/parse-gram.y input.y
   144668 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   144669   at_save_special_files
   144670   mkdir xml-tests
   144671     # Don't combine these Bison invocations since we want to be sure that
   144672   # --report=all isn't required to get the full XML file.
   144673   { set +x
   144674 $as_echo "$at_srcdir/regression.at:1224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   144675                   --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y"
   144676 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1224"
   144677 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   144678                   --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y
   144679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144680 at_status=$? at_failed=false
   144681 $at_check_filter
   144682 echo stderr:; cat "$at_stderr"
   144683 echo stdout:; cat "$at_stdout"
   144684 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224"
   144685 $at_failed && at_fn_log_failure
   144686 $at_traceon; }
   144687 
   144688   { set +x
   144689 $as_echo "$at_srcdir/regression.at:1224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y"
   144690 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" "regression.at:1224"
   144691 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y
   144692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144693 at_status=$? at_failed=false
   144694 $at_check_filter
   144695 echo stderr:; cat "$at_stderr"
   144696 echo stdout:; cat "$at_stdout"
   144697 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224"
   144698 $at_failed && at_fn_log_failure
   144699 $at_traceon; }
   144700 
   144701     cp xml-tests/test.output expout
   144702   { set +x
   144703 $as_echo "$at_srcdir/regression.at:1224: \$XSLTPROC \\
   144704              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   144705              xml-tests/test.xml"
   144706 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1224"
   144707 ( $at_check_trace; $XSLTPROC \
   144708              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   144709              xml-tests/test.xml
   144710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144711 at_status=$? at_failed=false
   144712 $at_check_filter
   144713 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144714 $at_diff expout "$at_stdout" || at_failed=:
   144715 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224"
   144716 $at_failed && at_fn_log_failure
   144717 $at_traceon; }
   144718 
   144719   sort xml-tests/test.dot > expout
   144720   { set +x
   144721 $as_echo "$at_srcdir/regression.at:1224: \$XSLTPROC \\
   144722              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   144723              xml-tests/test.xml | sort"
   144724 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1224"
   144725 ( $at_check_trace; $XSLTPROC \
   144726              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   144727              xml-tests/test.xml | sort
   144728 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144729 at_status=$? at_failed=false
   144730 $at_check_filter
   144731 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144732 $at_diff expout "$at_stdout" || at_failed=:
   144733 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224"
   144734 $at_failed && at_fn_log_failure
   144735 $at_traceon; }
   144736 
   144737   rm -rf xml-tests expout
   144738   at_restore_special_files
   144739 fi
   144740 { set +x
   144741 $as_echo "$at_srcdir/regression.at:1224: bison -o input.c -Dlr.type=lalr input.y"
   144742 at_fn_check_prepare_trace "regression.at:1224"
   144743 ( $at_check_trace; bison -o input.c -Dlr.type=lalr input.y
   144744 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144745 at_status=$? at_failed=false
   144746 $at_check_filter
   144747 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144748 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144749 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1224"
   144750 $at_failed && at_fn_log_failure
   144751 $at_traceon; }
   144752 
   144753 
   144754 mv input.c lalr.c
   144755 
   144756 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   144757   at_save_special_files
   144758   mkdir xml-tests
   144759     # Don't combine these Bison invocations since we want to be sure that
   144760   # --report=all isn't required to get the full XML file.
   144761   { set +x
   144762 $as_echo "$at_srcdir/regression.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   144763                   --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y"
   144764 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1227"
   144765 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   144766                   --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y
   144767 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144768 at_status=$? at_failed=false
   144769 $at_check_filter
   144770 echo stderr:; cat "$at_stderr"
   144771 echo stdout:; cat "$at_stdout"
   144772 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227"
   144773 $at_failed && at_fn_log_failure  \
   144774 "lalr.c"
   144775 $at_traceon; }
   144776 
   144777   { set +x
   144778 $as_echo "$at_srcdir/regression.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y"
   144779 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" "regression.at:1227"
   144780 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y
   144781 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144782 at_status=$? at_failed=false
   144783 $at_check_filter
   144784 echo stderr:; cat "$at_stderr"
   144785 echo stdout:; cat "$at_stdout"
   144786 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227"
   144787 $at_failed && at_fn_log_failure  \
   144788 "lalr.c"
   144789 $at_traceon; }
   144790 
   144791     cp xml-tests/test.output expout
   144792   { set +x
   144793 $as_echo "$at_srcdir/regression.at:1227: \$XSLTPROC \\
   144794              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   144795              xml-tests/test.xml"
   144796 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1227"
   144797 ( $at_check_trace; $XSLTPROC \
   144798              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   144799              xml-tests/test.xml
   144800 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144801 at_status=$? at_failed=false
   144802 $at_check_filter
   144803 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144804 $at_diff expout "$at_stdout" || at_failed=:
   144805 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227"
   144806 $at_failed && at_fn_log_failure  \
   144807 "lalr.c"
   144808 $at_traceon; }
   144809 
   144810   sort xml-tests/test.dot > expout
   144811   { set +x
   144812 $as_echo "$at_srcdir/regression.at:1227: \$XSLTPROC \\
   144813              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   144814              xml-tests/test.xml | sort"
   144815 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1227"
   144816 ( $at_check_trace; $XSLTPROC \
   144817              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   144818              xml-tests/test.xml | sort
   144819 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144820 at_status=$? at_failed=false
   144821 $at_check_filter
   144822 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144823 $at_diff expout "$at_stdout" || at_failed=:
   144824 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227"
   144825 $at_failed && at_fn_log_failure  \
   144826 "lalr.c"
   144827 $at_traceon; }
   144828 
   144829   rm -rf xml-tests expout
   144830   at_restore_special_files
   144831 fi
   144832 { set +x
   144833 $as_echo "$at_srcdir/regression.at:1227: bison -o input.c -Dlr.type=ielr input.y"
   144834 at_fn_check_prepare_trace "regression.at:1227"
   144835 ( $at_check_trace; bison -o input.c -Dlr.type=ielr input.y
   144836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144837 at_status=$? at_failed=false
   144838 $at_check_filter
   144839 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144840 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144841 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227"
   144842 $at_failed && at_fn_log_failure  \
   144843 "lalr.c"
   144844 $at_traceon; }
   144845 
   144846 
   144847 mv input.c ielr.c
   144848 
   144849 { set +x
   144850 $as_echo "$at_srcdir/regression.at:1230: diff lalr.c ielr.c"
   144851 at_fn_check_prepare_trace "regression.at:1230"
   144852 ( $at_check_trace; diff lalr.c ielr.c
   144853 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144854 at_status=$? at_failed=false
   144855 $at_check_filter
   144856 at_fn_diff_devnull "$at_stderr" || at_failed=:
   144857 at_fn_diff_devnull "$at_stdout" || at_failed=:
   144858 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1230"
   144859 $at_failed && at_fn_log_failure  \
   144860 "lalr.c" \
   144861 "ielr.c"
   144862 $at_traceon; }
   144863 
   144864 
   144865   set +x
   144866   $at_times_p && times >"$at_times_file"
   144867 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   144868 read at_status <"$at_status_file"
   144869 #AT_STOP_292
   144870 #AT_START_293
   144871 at_fn_group_banner 293 'regression.at:1240' \
   144872   "%error-verbose and YYSTACK_USE_ALLOCA" "          " 17
   144873 at_xfail=no
   144874 (
   144875   $as_echo "293. $at_setup_line: testing $at_desc ..."
   144876   $at_traceon
   144877 
   144878 
   144879 
   144880 cat >input.y <<'_ATEOF'
   144881 %code top {
   144882 #include <config.h>
   144883 /* We don't need perfect functions for these tests. */
   144884 #undef malloc
   144885 #undef memcmp
   144886 #undef realloc
   144887 }
   144888 
   144889 %code {
   144890   #include <stdio.h>
   144891   static void yyerror ( const char *msg);
   144892   static int yylex (void);
   144893   #define YYSTACK_USE_ALLOCA 1
   144894 }
   144895 
   144896 %error-verbose
   144897 
   144898 %%
   144899 
   144900 start: check syntax_error syntax_error ;
   144901 
   144902 check:
   144903 {
   144904   if (128 < sizeof yymsgbuf)
   144905     {
   144906       fprintf (stderr,
   144907                "The initial size of yymsgbuf in yyparse has increased\n"
   144908                "since this test group was last updated.  As a result,\n"
   144909                "this test group may no longer manage to induce a\n"
   144910                "reallocation of the syntax error message buffer.\n"
   144911                "This test group must be adjusted to produce a longer\n"
   144912                "error message.\n");
   144913       YYABORT;
   144914     }
   144915 }
   144916 ;
   144917 
   144918 // Induce a syntax error message whose total length is more than
   144919 // sizeof yymsgbuf in yyparse.  Each token here is 64 bytes.
   144920 syntax_error:
   144921   "123456789112345678921234567893123456789412345678951234567896123A"
   144922 | "123456789112345678921234567893123456789412345678951234567896123B"
   144923 | error 'a' 'b' 'c'
   144924 ;
   144925 
   144926 %%
   144927 
   144928 #include <stdio.h>
   144929 /* A C error reporting function.  */
   144930 static
   144931 void yyerror ( const char *msg)
   144932 {
   144933   fprintf (stderr, "%s\n", msg);
   144934 }
   144935 /* Induce two syntax error messages (which requires full error
   144936    recovery by shifting 3 tokens) in order to detect any loss of the
   144937    reallocated buffer.  */
   144938 #include <assert.h>
   144939 static
   144940 int yylex (void)
   144941 {
   144942   static char const input[] = "abc";
   144943   static size_t toknum = 0;
   144944   int res;
   144945   ;
   144946   assert (toknum < sizeof input / sizeof input[0]);
   144947   res = input[toknum++];
   144948   ;
   144949   return res;
   144950 }
   144951 int
   144952 main (void)
   144953 {
   144954   return yyparse ();
   144955 }
   144956 _ATEOF
   144957 
   144958 
   144959 
   144960 
   144961 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   144962   at_save_special_files
   144963   mkdir xml-tests
   144964     # Don't combine these Bison invocations since we want to be sure that
   144965   # --report=all isn't required to get the full XML file.
   144966   { set +x
   144967 $as_echo "$at_srcdir/regression.at:1296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   144968                   --graph=xml-tests/test.dot -o input.c input.y"
   144969 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1296"
   144970 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   144971                   --graph=xml-tests/test.dot -o input.c input.y
   144972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144973 at_status=$? at_failed=false
   144974 $at_check_filter
   144975 echo stderr:; cat "$at_stderr"
   144976 echo stdout:; cat "$at_stdout"
   144977 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296"
   144978 $at_failed && at_fn_log_failure
   144979 $at_traceon; }
   144980 
   144981   { set +x
   144982 $as_echo "$at_srcdir/regression.at:1296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   144983 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1296"
   144984 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   144985 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   144986 at_status=$? at_failed=false
   144987 $at_check_filter
   144988 echo stderr:; cat "$at_stderr"
   144989 echo stdout:; cat "$at_stdout"
   144990 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296"
   144991 $at_failed && at_fn_log_failure
   144992 $at_traceon; }
   144993 
   144994     cp xml-tests/test.output expout
   144995   { set +x
   144996 $as_echo "$at_srcdir/regression.at:1296: \$XSLTPROC \\
   144997              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   144998              xml-tests/test.xml"
   144999 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1296"
   145000 ( $at_check_trace; $XSLTPROC \
   145001              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   145002              xml-tests/test.xml
   145003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145004 at_status=$? at_failed=false
   145005 $at_check_filter
   145006 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145007 $at_diff expout "$at_stdout" || at_failed=:
   145008 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296"
   145009 $at_failed && at_fn_log_failure
   145010 $at_traceon; }
   145011 
   145012   sort xml-tests/test.dot > expout
   145013   { set +x
   145014 $as_echo "$at_srcdir/regression.at:1296: \$XSLTPROC \\
   145015              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   145016              xml-tests/test.xml | sort"
   145017 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1296"
   145018 ( $at_check_trace; $XSLTPROC \
   145019              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   145020              xml-tests/test.xml | sort
   145021 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145022 at_status=$? at_failed=false
   145023 $at_check_filter
   145024 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145025 $at_diff expout "$at_stdout" || at_failed=:
   145026 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296"
   145027 $at_failed && at_fn_log_failure
   145028 $at_traceon; }
   145029 
   145030   rm -rf xml-tests expout
   145031   at_restore_special_files
   145032 fi
   145033 { set +x
   145034 $as_echo "$at_srcdir/regression.at:1296: bison -o input.c input.y"
   145035 at_fn_check_prepare_trace "regression.at:1296"
   145036 ( $at_check_trace; bison -o input.c input.y
   145037 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145038 at_status=$? at_failed=false
   145039 $at_check_filter
   145040 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145041 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145042 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1296"
   145043 $at_failed && at_fn_log_failure
   145044 $at_traceon; }
   145045 
   145046 
   145047 { set +x
   145048 $as_echo "$at_srcdir/regression.at:1297: \$BISON_C_WORKS"
   145049 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1297"
   145050 ( $at_check_trace; $BISON_C_WORKS
   145051 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145052 at_status=$? at_failed=false
   145053 $at_check_filter
   145054 echo stderr:; cat "$at_stderr"
   145055 echo stdout:; cat "$at_stdout"
   145056 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1297"
   145057 $at_failed && at_fn_log_failure
   145058 $at_traceon; }
   145059 
   145060 { set +x
   145061 $as_echo "$at_srcdir/regression.at:1297: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   145062 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1297"
   145063 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   145064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145065 at_status=$? at_failed=false
   145066 $at_check_filter
   145067 echo stderr:; cat "$at_stderr"
   145068 echo stdout:; cat "$at_stdout"
   145069 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1297"
   145070 $at_failed && at_fn_log_failure
   145071 $at_traceon; }
   145072 
   145073 { set +x
   145074 $as_echo "$at_srcdir/regression.at:1298:  \$PREPARSER ./input"
   145075 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1298"
   145076 ( $at_check_trace;  $PREPARSER ./input
   145077 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145078 at_status=$? at_failed=false
   145079 $at_check_filter
   145080 echo stderr:; tee stderr <"$at_stderr"
   145081 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145082 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1298"
   145083 $at_failed && at_fn_log_failure
   145084 $at_traceon; }
   145085 
   145086 { set +x
   145087 $as_echo "$at_srcdir/regression.at:1298: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   145088 at_fn_check_prepare_trace "regression.at:1298"
   145089 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   145090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145091 at_status=$? at_failed=false
   145092 $at_check_filter
   145093 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
   145094 syntax error, unexpected \$end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
   145095 " | \
   145096   $at_diff - "$at_stderr" || at_failed=:
   145097 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145098 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1298"
   145099 $at_failed && at_fn_log_failure
   145100 $at_traceon; }
   145101 
   145102 
   145103 
   145104   set +x
   145105   $at_times_p && times >"$at_times_file"
   145106 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   145107 read at_status <"$at_status_file"
   145108 #AT_STOP_293
   145109 #AT_START_294
   145110 at_fn_group_banner 294 'regression.at:1319' \
   145111   "%error-verbose overflow" "                        " 17
   145112 at_xfail=no
   145113 (
   145114   $as_echo "294. $at_setup_line: testing $at_desc ..."
   145115   $at_traceon
   145116 
   145117 
   145118 cat >input.y <<'_ATEOF'
   145119 %code top {
   145120 #include <config.h>
   145121 /* We don't need perfect functions for these tests. */
   145122 #undef malloc
   145123 #undef memcmp
   145124 #undef realloc
   145125 }
   145126 
   145127 %code {
   145128   #include <stdio.h>
   145129   static void yyerror ( const char *msg);
   145130   static int yylex (void);
   145131 
   145132   /* This prevents this test case from having to induce error messages
   145133      large enough to overflow size_t.  */
   145134   #define YYSIZE_T unsigned char
   145135 
   145136   /* Bring in malloc and set EXIT_SUCCESS so yacc.c doesn't try to
   145137      provide a malloc prototype using our YYSIZE_T.  */
   145138   #include <stdlib.h>
   145139   #ifndef EXIT_SUCCESS
   145140   # define EXIT_SUCCESS 0
   145141   #endif
   145142 
   145143   /* Max depth is usually much smaller than YYSTACK_ALLOC_MAXIMUM, and
   145144      we don't want gcc to warn everywhere this constant would be too big
   145145      to make sense for our YYSIZE_T.  */
   145146   #define YYMAXDEPTH 100
   145147 }
   145148 
   145149 %error-verbose
   145150 
   145151 %%
   145152 
   145153 start: syntax_error1 check syntax_error2 ;
   145154 
   145155 // Induce a syntax error message whose total length causes yymsg in
   145156 // yyparse to be reallocated to size YYSTACK_ALLOC_MAXIMUM, which
   145157 // should be 255.  Each token here is 64 bytes.
   145158 syntax_error1:
   145159   "123456789112345678921234567893123456789412345678951234567896123A"
   145160 | "123456789112345678921234567893123456789412345678951234567896123B"
   145161 | "123456789112345678921234567893123456789412345678951234567896123C"
   145162 | error 'a' 'b' 'c'
   145163 ;
   145164 
   145165 check:
   145166 {
   145167   if (yymsg_alloc != YYSTACK_ALLOC_MAXIMUM
   145168       || YYSTACK_ALLOC_MAXIMUM != YYSIZE_MAXIMUM
   145169       || YYSIZE_MAXIMUM != 255)
   145170     {
   145171       fprintf (stderr,
   145172                "The assumptions of this test group are no longer\n"
   145173                "valid, so it may no longer catch the error it was\n"
   145174                "designed to catch.  Specifically, the following\n"
   145175                "values should all be 255:\n\n");
   145176       fprintf (stderr, "  yymsg_alloc = %d\n", yymsg_alloc);
   145177       fprintf (stderr, "  YYSTACK_ALLOC_MAXIMUM = %d\n",
   145178                YYSTACK_ALLOC_MAXIMUM);
   145179       fprintf (stderr, "  YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM);
   145180       YYABORT;
   145181     }
   145182 }
   145183 ;
   145184 
   145185 // Now overflow.
   145186 syntax_error2:
   145187   "123456789112345678921234567893123456789412345678951234567896123A"
   145188 | "123456789112345678921234567893123456789412345678951234567896123B"
   145189 | "123456789112345678921234567893123456789412345678951234567896123C"
   145190 | "123456789112345678921234567893123456789412345678951234567896123D"
   145191 | "123456789112345678921234567893123456789412345678951234567896123E"
   145192 ;
   145193 
   145194 %%
   145195 
   145196 #include <stdio.h>
   145197 /* A C error reporting function.  */
   145198 static
   145199 void yyerror ( const char *msg)
   145200 {
   145201   fprintf (stderr, "%s\n", msg);
   145202 }
   145203 /* Induce two syntax error messages (which requires full error
   145204    recovery by shifting 3 tokens).  */
   145205 #include <assert.h>
   145206 static
   145207 int yylex (void)
   145208 {
   145209   static char const input[] = "abc";
   145210   static size_t toknum = 0;
   145211   int res;
   145212   ;
   145213   assert (toknum < sizeof input / sizeof input[0]);
   145214   res = input[toknum++];
   145215   ;
   145216   return res;
   145217 }
   145218 int
   145219 main (void)
   145220 {
   145221   /* Push parsers throw away the message buffer between tokens, so skip
   145222      this test under maintainer-push-check.  */
   145223   if (YYPUSH)
   145224     return 77;
   145225   return yyparse ();
   145226 }
   145227 _ATEOF
   145228 
   145229 
   145230 
   145231 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   145232   at_save_special_files
   145233   mkdir xml-tests
   145234     # Don't combine these Bison invocations since we want to be sure that
   145235   # --report=all isn't required to get the full XML file.
   145236   { set +x
   145237 $as_echo "$at_srcdir/regression.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   145238                   --graph=xml-tests/test.dot -o input.c input.y"
   145239 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1406"
   145240 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   145241                   --graph=xml-tests/test.dot -o input.c input.y
   145242 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145243 at_status=$? at_failed=false
   145244 $at_check_filter
   145245 echo stderr:; cat "$at_stderr"
   145246 echo stdout:; cat "$at_stdout"
   145247 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406"
   145248 $at_failed && at_fn_log_failure
   145249 $at_traceon; }
   145250 
   145251   { set +x
   145252 $as_echo "$at_srcdir/regression.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   145253 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1406"
   145254 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   145255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145256 at_status=$? at_failed=false
   145257 $at_check_filter
   145258 echo stderr:; cat "$at_stderr"
   145259 echo stdout:; cat "$at_stdout"
   145260 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406"
   145261 $at_failed && at_fn_log_failure
   145262 $at_traceon; }
   145263 
   145264     cp xml-tests/test.output expout
   145265   { set +x
   145266 $as_echo "$at_srcdir/regression.at:1406: \$XSLTPROC \\
   145267              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   145268              xml-tests/test.xml"
   145269 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1406"
   145270 ( $at_check_trace; $XSLTPROC \
   145271              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   145272              xml-tests/test.xml
   145273 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145274 at_status=$? at_failed=false
   145275 $at_check_filter
   145276 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145277 $at_diff expout "$at_stdout" || at_failed=:
   145278 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406"
   145279 $at_failed && at_fn_log_failure
   145280 $at_traceon; }
   145281 
   145282   sort xml-tests/test.dot > expout
   145283   { set +x
   145284 $as_echo "$at_srcdir/regression.at:1406: \$XSLTPROC \\
   145285              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   145286              xml-tests/test.xml | sort"
   145287 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1406"
   145288 ( $at_check_trace; $XSLTPROC \
   145289              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   145290              xml-tests/test.xml | sort
   145291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145292 at_status=$? at_failed=false
   145293 $at_check_filter
   145294 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145295 $at_diff expout "$at_stdout" || at_failed=:
   145296 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406"
   145297 $at_failed && at_fn_log_failure
   145298 $at_traceon; }
   145299 
   145300   rm -rf xml-tests expout
   145301   at_restore_special_files
   145302 fi
   145303 { set +x
   145304 $as_echo "$at_srcdir/regression.at:1406: bison -o input.c input.y"
   145305 at_fn_check_prepare_trace "regression.at:1406"
   145306 ( $at_check_trace; bison -o input.c input.y
   145307 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145308 at_status=$? at_failed=false
   145309 $at_check_filter
   145310 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145311 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145312 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1406"
   145313 $at_failed && at_fn_log_failure
   145314 $at_traceon; }
   145315 
   145316 
   145317 
   145318 # gcc warns about tautologies and fallacies involving comparisons for
   145319 # unsigned char.  However, it doesn't produce these same warnings for
   145320 # size_t and many other types when the warnings would seem to make just
   145321 # as much sense.  We ignore the warnings.
   145322 CFLAGS="$NO_WERROR_CFLAGS"
   145323 { set +x
   145324 $as_echo "$at_srcdir/regression.at:1413: \$BISON_C_WORKS"
   145325 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1413"
   145326 ( $at_check_trace; $BISON_C_WORKS
   145327 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145328 at_status=$? at_failed=false
   145329 $at_check_filter
   145330 echo stderr:; cat "$at_stderr"
   145331 echo stdout:; cat "$at_stdout"
   145332 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1413"
   145333 $at_failed && at_fn_log_failure
   145334 $at_traceon; }
   145335 
   145336 { set +x
   145337 $as_echo "$at_srcdir/regression.at:1413: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   145338 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1413"
   145339 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   145340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145341 at_status=$? at_failed=false
   145342 $at_check_filter
   145343 echo stderr:; cat "$at_stderr"
   145344 echo stdout:; cat "$at_stdout"
   145345 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1413"
   145346 $at_failed && at_fn_log_failure
   145347 $at_traceon; }
   145348 
   145349 
   145350 { set +x
   145351 $as_echo "$at_srcdir/regression.at:1415:  \$PREPARSER ./input"
   145352 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1415"
   145353 ( $at_check_trace;  $PREPARSER ./input
   145354 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145355 at_status=$? at_failed=false
   145356 $at_check_filter
   145357 echo stderr:; tee stderr <"$at_stderr"
   145358 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145359 at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1415"
   145360 $at_failed && at_fn_log_failure
   145361 $at_traceon; }
   145362 
   145363 { set +x
   145364 $as_echo "$at_srcdir/regression.at:1415: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   145365 at_fn_check_prepare_trace "regression.at:1415"
   145366 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   145367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145368 at_status=$? at_failed=false
   145369 $at_check_filter
   145370 echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B or 123456789112345678921234567893123456789412345678951234567896123C
   145371 syntax error
   145372 memory exhausted
   145373 " | \
   145374   $at_diff - "$at_stderr" || at_failed=:
   145375 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145376 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1415"
   145377 $at_failed && at_fn_log_failure
   145378 $at_traceon; }
   145379 
   145380 
   145381 
   145382   set +x
   145383   $at_times_p && times >"$at_times_file"
   145384 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   145385 read at_status <"$at_status_file"
   145386 #AT_STOP_294
   145387 #AT_START_295
   145388 at_fn_group_banner 295 'regression.at:1429' \
   145389   "LAC: Exploratory stack" "                         " 17
   145390 at_xfail=no
   145391 (
   145392   $as_echo "295. $at_setup_line: testing $at_desc ..."
   145393   $at_traceon
   145394 
   145395 
   145396 
   145397 
   145398 
   145399 
   145400 
   145401 
   145402 cat >input.y <<'_ATEOF'
   145403 %code top {
   145404 #include <config.h>
   145405 /* We don't need perfect functions for these tests. */
   145406 #undef malloc
   145407 #undef memcmp
   145408 #undef realloc
   145409 }
   145410 
   145411 %code {
   145412   #include <stdio.h>
   145413   static void yyerror ( const char *msg);
   145414   int yylex (void);
   145415 }
   145416 
   145417 %define api.push-pull pull
   145418 %error-verbose
   145419 %token 'c'
   145420 
   145421 %%
   145422 
   145423 // default reductions in inconsistent states
   145424 // v   v v   v v v v   v v v v v v v
   145425 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 ;
   145426 //       ^                     ^                               ^
   145427 // LAC reallocs
   145428 
   145429 A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
   145430 B: 'b' ;
   145431 C: /*empty*/ { printf ("consistent default reduction\n"); } ;
   145432 
   145433 %%
   145434 #include <stdio.h>
   145435 /* A C error reporting function.  */
   145436 static
   145437 void yyerror ( const char *msg)
   145438 {
   145439   fprintf (stderr, "%s\n", msg);
   145440 }
   145441 int
   145442 yylex (void)
   145443 {
   145444   static char const *input = "bbbbc";
   145445   return *input++;
   145446 }
   145447 
   145448 int
   145449 main (void)
   145450 {
   145451   yydebug = 1;
   145452   return yyparse ();
   145453 }
   145454 _ATEOF
   145455 
   145456 
   145457 
   145458 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   145459   at_save_special_files
   145460   mkdir xml-tests
   145461     # Don't combine these Bison invocations since we want to be sure that
   145462   # --report=all isn't required to get the full XML file.
   145463   { set +x
   145464 $as_echo "$at_srcdir/regression.at:1508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   145465                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   145466                  -Dparse.lac.memory-trace=full \\
   145467                  -t -o input.c input.y"
   145468 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508"
   145469 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   145470                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   145471                  -Dparse.lac.memory-trace=full \
   145472                  -t -o input.c input.y
   145473 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145474 at_status=$? at_failed=false
   145475 $at_check_filter
   145476 echo stderr:; cat "$at_stderr"
   145477 echo stdout:; cat "$at_stdout"
   145478 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145479 $at_failed && at_fn_log_failure
   145480 $at_traceon; }
   145481 
   145482   { set +x
   145483 $as_echo "$at_srcdir/regression.at:1508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   145484                  -Dparse.lac.memory-trace=full \\
   145485                  -t -o input.c input.y"
   145486 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508"
   145487 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   145488                  -Dparse.lac.memory-trace=full \
   145489                  -t -o input.c input.y
   145490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145491 at_status=$? at_failed=false
   145492 $at_check_filter
   145493 echo stderr:; cat "$at_stderr"
   145494 echo stdout:; cat "$at_stdout"
   145495 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145496 $at_failed && at_fn_log_failure
   145497 $at_traceon; }
   145498 
   145499     cp xml-tests/test.output expout
   145500   { set +x
   145501 $as_echo "$at_srcdir/regression.at:1508: \$XSLTPROC \\
   145502              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   145503              xml-tests/test.xml"
   145504 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1508"
   145505 ( $at_check_trace; $XSLTPROC \
   145506              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   145507              xml-tests/test.xml
   145508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145509 at_status=$? at_failed=false
   145510 $at_check_filter
   145511 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145512 $at_diff expout "$at_stdout" || at_failed=:
   145513 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145514 $at_failed && at_fn_log_failure
   145515 $at_traceon; }
   145516 
   145517   sort xml-tests/test.dot > expout
   145518   { set +x
   145519 $as_echo "$at_srcdir/regression.at:1508: \$XSLTPROC \\
   145520              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   145521              xml-tests/test.xml | sort"
   145522 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1508"
   145523 ( $at_check_trace; $XSLTPROC \
   145524              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   145525              xml-tests/test.xml | sort
   145526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145527 at_status=$? at_failed=false
   145528 $at_check_filter
   145529 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145530 $at_diff expout "$at_stdout" || at_failed=:
   145531 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145532 $at_failed && at_fn_log_failure
   145533 $at_traceon; }
   145534 
   145535   rm -rf xml-tests expout
   145536   at_restore_special_files
   145537 fi
   145538 { set +x
   145539 $as_echo "$at_srcdir/regression.at:1508: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   145540                  -Dparse.lac.memory-trace=full \\
   145541                  -t -o input.c input.y"
   145542 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508"
   145543 ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   145544                  -Dparse.lac.memory-trace=full \
   145545                  -t -o input.c input.y
   145546 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145547 at_status=$? at_failed=false
   145548 $at_check_filter
   145549 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
   145550 " | \
   145551   $at_diff - "$at_stderr" || at_failed=:
   145552 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145553 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145554 $at_failed && at_fn_log_failure
   145555 $at_traceon; }
   145556 
   145557 
   145558 { set +x
   145559 $as_echo "$at_srcdir/regression.at:1508: \$BISON_C_WORKS"
   145560 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1508"
   145561 ( $at_check_trace; $BISON_C_WORKS
   145562 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145563 at_status=$? at_failed=false
   145564 $at_check_filter
   145565 echo stderr:; cat "$at_stderr"
   145566 echo stdout:; cat "$at_stdout"
   145567 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145568 $at_failed && at_fn_log_failure
   145569 $at_traceon; }
   145570 
   145571 { set +x
   145572 $as_echo "$at_srcdir/regression.at:1508: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   145573 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1508"
   145574 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   145575 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145576 at_status=$? at_failed=false
   145577 $at_check_filter
   145578 echo stderr:; cat "$at_stderr"
   145579 echo stdout:; cat "$at_stdout"
   145580 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145581 $at_failed && at_fn_log_failure
   145582 $at_traceon; }
   145583 
   145584 { set +x
   145585 $as_echo "$at_srcdir/regression.at:1508:  \$PREPARSER ./input > stdout.txt 2> stderr.txt"
   145586 at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1508"
   145587 ( $at_check_trace;  $PREPARSER ./input > stdout.txt 2> stderr.txt
   145588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145589 at_status=$? at_failed=false
   145590 $at_check_filter
   145591 echo stderr:; tee stderr <"$at_stderr"
   145592 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145593 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1508"
   145594 $at_failed && at_fn_log_failure
   145595 $at_traceon; }
   145596 
   145597 { set +x
   145598 $as_echo "$at_srcdir/regression.at:1508: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   145599 at_fn_check_prepare_trace "regression.at:1508"
   145600 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   145601 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145602 at_status=$? at_failed=false
   145603 $at_check_filter
   145604 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145605 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145606 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145607 $at_failed && at_fn_log_failure
   145608 $at_traceon; }
   145609 
   145610 
   145611 
   145612 # Make sure syntax error doesn't forget that 'a' is expected.  It would
   145613 # be forgotten without lookahead correction.
   145614 { set +x
   145615 $as_echo "$at_srcdir/regression.at:1508: grep 'syntax error,' stderr.txt"
   145616 at_fn_check_prepare_trace "regression.at:1508"
   145617 ( $at_check_trace; grep 'syntax error,' stderr.txt
   145618 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145619 at_status=$? at_failed=false
   145620 $at_check_filter
   145621 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145622 echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
   145623 " | \
   145624   $at_diff - "$at_stdout" || at_failed=:
   145625 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145626 $at_failed && at_fn_log_failure
   145627 $at_traceon; }
   145628 
   145629 
   145630 # Check number of default reductions in inconsistent states to be sure
   145631 # syntax error is detected before unnecessary reductions are performed.
   145632 { set +x
   145633 $as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
   145634            < stdout.txt || exit 77"
   145635 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508"
   145636 ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
   145637            < stdout.txt || exit 77
   145638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145639 at_status=$? at_failed=false
   145640 $at_check_filter
   145641 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145642 echo >>"$at_stdout"; $as_echo "14" | \
   145643   $at_diff - "$at_stdout" || at_failed=:
   145644 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145645 $at_failed && at_fn_log_failure
   145646 $at_traceon; }
   145647 
   145648 
   145649 # Check number of default reductions in consistent states to be sure
   145650 # it is performed before the syntax error is detected.
   145651 { set +x
   145652 $as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
   145653            < stdout.txt || exit 77"
   145654 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508"
   145655 ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
   145656            < stdout.txt || exit 77
   145657 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145658 at_status=$? at_failed=false
   145659 $at_check_filter
   145660 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145661 echo >>"$at_stdout"; $as_echo "2" | \
   145662   $at_diff - "$at_stdout" || at_failed=:
   145663 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145664 $at_failed && at_fn_log_failure
   145665 $at_traceon; }
   145666 
   145667 
   145668 # Check number of reallocs to be sure reallocated memory isn't somehow
   145669 # lost between LAC invocations.
   145670 { set +x
   145671 $as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
   145672            || exit 77"
   145673 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508"
   145674 ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
   145675            || exit 77
   145676 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145677 at_status=$? at_failed=false
   145678 $at_check_filter
   145679 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145680 echo >>"$at_stdout"; $as_echo "3" | \
   145681   $at_diff - "$at_stdout" || at_failed=:
   145682 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508"
   145683 $at_failed && at_fn_log_failure
   145684 $at_traceon; }
   145685 
   145686 
   145687 
   145688 
   145689 
   145690 
   145691 
   145692 
   145693 cat >input.y <<'_ATEOF'
   145694 %code top {
   145695 #include <config.h>
   145696 /* We don't need perfect functions for these tests. */
   145697 #undef malloc
   145698 #undef memcmp
   145699 #undef realloc
   145700 }
   145701 
   145702 %code {
   145703   #include <stdio.h>
   145704   static void yyerror ( const char *msg);
   145705   int yylex (YYSTYPE *);
   145706 }
   145707 
   145708 %define api.push-pull pull %define api.pure
   145709 %error-verbose
   145710 %token 'c'
   145711 
   145712 %%
   145713 
   145714 // default reductions in inconsistent states
   145715 // v   v v   v v v v   v v v v v v v
   145716 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 ;
   145717 //       ^                     ^                               ^
   145718 // LAC reallocs
   145719 
   145720 A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
   145721 B: 'b' ;
   145722 C: /*empty*/ { printf ("consistent default reduction\n"); } ;
   145723 
   145724 %%
   145725 #include <stdio.h>
   145726 /* A C error reporting function.  */
   145727 static
   145728 void yyerror ( const char *msg)
   145729 {
   145730   fprintf (stderr, "%s\n", msg);
   145731 }
   145732 int
   145733 yylex (YYSTYPE *v)
   145734 {
   145735   static char const *input = "bbbbc";
   145736   *v = 0;
   145737   return *input++;
   145738 }
   145739 
   145740 int
   145741 main (void)
   145742 {
   145743   yydebug = 1;
   145744   return yyparse ();
   145745 }
   145746 _ATEOF
   145747 
   145748 
   145749 
   145750 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   145751   at_save_special_files
   145752   mkdir xml-tests
   145753     # Don't combine these Bison invocations since we want to be sure that
   145754   # --report=all isn't required to get the full XML file.
   145755   { set +x
   145756 $as_echo "$at_srcdir/regression.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   145757                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   145758                  -Dparse.lac.memory-trace=full \\
   145759                  -t -o input.c input.y"
   145760 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509"
   145761 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   145762                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   145763                  -Dparse.lac.memory-trace=full \
   145764                  -t -o input.c input.y
   145765 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145766 at_status=$? at_failed=false
   145767 $at_check_filter
   145768 echo stderr:; cat "$at_stderr"
   145769 echo stdout:; cat "$at_stdout"
   145770 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145771 $at_failed && at_fn_log_failure
   145772 $at_traceon; }
   145773 
   145774   { set +x
   145775 $as_echo "$at_srcdir/regression.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   145776                  -Dparse.lac.memory-trace=full \\
   145777                  -t -o input.c input.y"
   145778 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509"
   145779 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   145780                  -Dparse.lac.memory-trace=full \
   145781                  -t -o input.c input.y
   145782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145783 at_status=$? at_failed=false
   145784 $at_check_filter
   145785 echo stderr:; cat "$at_stderr"
   145786 echo stdout:; cat "$at_stdout"
   145787 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145788 $at_failed && at_fn_log_failure
   145789 $at_traceon; }
   145790 
   145791     cp xml-tests/test.output expout
   145792   { set +x
   145793 $as_echo "$at_srcdir/regression.at:1509: \$XSLTPROC \\
   145794              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   145795              xml-tests/test.xml"
   145796 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1509"
   145797 ( $at_check_trace; $XSLTPROC \
   145798              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   145799              xml-tests/test.xml
   145800 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145801 at_status=$? at_failed=false
   145802 $at_check_filter
   145803 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145804 $at_diff expout "$at_stdout" || at_failed=:
   145805 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145806 $at_failed && at_fn_log_failure
   145807 $at_traceon; }
   145808 
   145809   sort xml-tests/test.dot > expout
   145810   { set +x
   145811 $as_echo "$at_srcdir/regression.at:1509: \$XSLTPROC \\
   145812              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   145813              xml-tests/test.xml | sort"
   145814 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1509"
   145815 ( $at_check_trace; $XSLTPROC \
   145816              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   145817              xml-tests/test.xml | sort
   145818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145819 at_status=$? at_failed=false
   145820 $at_check_filter
   145821 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145822 $at_diff expout "$at_stdout" || at_failed=:
   145823 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145824 $at_failed && at_fn_log_failure
   145825 $at_traceon; }
   145826 
   145827   rm -rf xml-tests expout
   145828   at_restore_special_files
   145829 fi
   145830 { set +x
   145831 $as_echo "$at_srcdir/regression.at:1509: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   145832                  -Dparse.lac.memory-trace=full \\
   145833                  -t -o input.c input.y"
   145834 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509"
   145835 ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   145836                  -Dparse.lac.memory-trace=full \
   145837                  -t -o input.c input.y
   145838 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145839 at_status=$? at_failed=false
   145840 $at_check_filter
   145841 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
   145842 " | \
   145843   $at_diff - "$at_stderr" || at_failed=:
   145844 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145845 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145846 $at_failed && at_fn_log_failure
   145847 $at_traceon; }
   145848 
   145849 
   145850 { set +x
   145851 $as_echo "$at_srcdir/regression.at:1509: \$BISON_C_WORKS"
   145852 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1509"
   145853 ( $at_check_trace; $BISON_C_WORKS
   145854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145855 at_status=$? at_failed=false
   145856 $at_check_filter
   145857 echo stderr:; cat "$at_stderr"
   145858 echo stdout:; cat "$at_stdout"
   145859 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145860 $at_failed && at_fn_log_failure
   145861 $at_traceon; }
   145862 
   145863 { set +x
   145864 $as_echo "$at_srcdir/regression.at:1509: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   145865 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1509"
   145866 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   145867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145868 at_status=$? at_failed=false
   145869 $at_check_filter
   145870 echo stderr:; cat "$at_stderr"
   145871 echo stdout:; cat "$at_stdout"
   145872 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145873 $at_failed && at_fn_log_failure
   145874 $at_traceon; }
   145875 
   145876 { set +x
   145877 $as_echo "$at_srcdir/regression.at:1509:  \$PREPARSER ./input > stdout.txt 2> stderr.txt"
   145878 at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1509"
   145879 ( $at_check_trace;  $PREPARSER ./input > stdout.txt 2> stderr.txt
   145880 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145881 at_status=$? at_failed=false
   145882 $at_check_filter
   145883 echo stderr:; tee stderr <"$at_stderr"
   145884 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145885 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1509"
   145886 $at_failed && at_fn_log_failure
   145887 $at_traceon; }
   145888 
   145889 { set +x
   145890 $as_echo "$at_srcdir/regression.at:1509: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   145891 at_fn_check_prepare_trace "regression.at:1509"
   145892 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   145893 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145894 at_status=$? at_failed=false
   145895 $at_check_filter
   145896 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145897 at_fn_diff_devnull "$at_stdout" || at_failed=:
   145898 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145899 $at_failed && at_fn_log_failure
   145900 $at_traceon; }
   145901 
   145902 
   145903 
   145904 # Make sure syntax error doesn't forget that 'a' is expected.  It would
   145905 # be forgotten without lookahead correction.
   145906 { set +x
   145907 $as_echo "$at_srcdir/regression.at:1509: grep 'syntax error,' stderr.txt"
   145908 at_fn_check_prepare_trace "regression.at:1509"
   145909 ( $at_check_trace; grep 'syntax error,' stderr.txt
   145910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145911 at_status=$? at_failed=false
   145912 $at_check_filter
   145913 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145914 echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
   145915 " | \
   145916   $at_diff - "$at_stdout" || at_failed=:
   145917 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145918 $at_failed && at_fn_log_failure
   145919 $at_traceon; }
   145920 
   145921 
   145922 # Check number of default reductions in inconsistent states to be sure
   145923 # syntax error is detected before unnecessary reductions are performed.
   145924 { set +x
   145925 $as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
   145926            < stdout.txt || exit 77"
   145927 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509"
   145928 ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
   145929            < stdout.txt || exit 77
   145930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145931 at_status=$? at_failed=false
   145932 $at_check_filter
   145933 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145934 echo >>"$at_stdout"; $as_echo "14" | \
   145935   $at_diff - "$at_stdout" || at_failed=:
   145936 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145937 $at_failed && at_fn_log_failure
   145938 $at_traceon; }
   145939 
   145940 
   145941 # Check number of default reductions in consistent states to be sure
   145942 # it is performed before the syntax error is detected.
   145943 { set +x
   145944 $as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
   145945            < stdout.txt || exit 77"
   145946 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509"
   145947 ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
   145948            < stdout.txt || exit 77
   145949 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145950 at_status=$? at_failed=false
   145951 $at_check_filter
   145952 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145953 echo >>"$at_stdout"; $as_echo "2" | \
   145954   $at_diff - "$at_stdout" || at_failed=:
   145955 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145956 $at_failed && at_fn_log_failure
   145957 $at_traceon; }
   145958 
   145959 
   145960 # Check number of reallocs to be sure reallocated memory isn't somehow
   145961 # lost between LAC invocations.
   145962 { set +x
   145963 $as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
   145964            || exit 77"
   145965 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509"
   145966 ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
   145967            || exit 77
   145968 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   145969 at_status=$? at_failed=false
   145970 $at_check_filter
   145971 at_fn_diff_devnull "$at_stderr" || at_failed=:
   145972 echo >>"$at_stdout"; $as_echo "3" | \
   145973   $at_diff - "$at_stdout" || at_failed=:
   145974 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509"
   145975 $at_failed && at_fn_log_failure
   145976 $at_traceon; }
   145977 
   145978 
   145979 
   145980 
   145981 
   145982 
   145983 
   145984 
   145985 cat >input.y <<'_ATEOF'
   145986 %code top {
   145987 #include <config.h>
   145988 /* We don't need perfect functions for these tests. */
   145989 #undef malloc
   145990 #undef memcmp
   145991 #undef realloc
   145992 }
   145993 
   145994 %code {
   145995   #include <stdio.h>
   145996   static void yyerror ( const char *msg);
   145997   int yylex (void);
   145998 }
   145999 
   146000 %define api.push-pull both
   146001 %error-verbose
   146002 %token 'c'
   146003 
   146004 %%
   146005 
   146006 // default reductions in inconsistent states
   146007 // v   v v   v v v v   v v v v v v v
   146008 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 ;
   146009 //       ^                     ^                               ^
   146010 // LAC reallocs
   146011 
   146012 A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
   146013 B: 'b' ;
   146014 C: /*empty*/ { printf ("consistent default reduction\n"); } ;
   146015 
   146016 %%
   146017 #include <stdio.h>
   146018 /* A C error reporting function.  */
   146019 static
   146020 void yyerror ( const char *msg)
   146021 {
   146022   fprintf (stderr, "%s\n", msg);
   146023 }
   146024 int
   146025 yylex (void)
   146026 {
   146027   static char const *input = "bbbbc";
   146028   return *input++;
   146029 }
   146030 
   146031 int
   146032 main (void)
   146033 {
   146034   yydebug = 1;
   146035   return yyparse ();
   146036 }
   146037 _ATEOF
   146038 
   146039 
   146040 
   146041 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   146042   at_save_special_files
   146043   mkdir xml-tests
   146044     # Don't combine these Bison invocations since we want to be sure that
   146045   # --report=all isn't required to get the full XML file.
   146046   { set +x
   146047 $as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   146048                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146049                  -Dparse.lac.memory-trace=full \\
   146050                  -t -o input.c input.y"
   146051 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
   146052 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   146053                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146054                  -Dparse.lac.memory-trace=full \
   146055                  -t -o input.c input.y
   146056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146057 at_status=$? at_failed=false
   146058 $at_check_filter
   146059 echo stderr:; cat "$at_stderr"
   146060 echo stdout:; cat "$at_stdout"
   146061 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146062 $at_failed && at_fn_log_failure
   146063 $at_traceon; }
   146064 
   146065   { set +x
   146066 $as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146067                  -Dparse.lac.memory-trace=full \\
   146068                  -t -o input.c input.y"
   146069 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
   146070 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146071                  -Dparse.lac.memory-trace=full \
   146072                  -t -o input.c input.y
   146073 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146074 at_status=$? at_failed=false
   146075 $at_check_filter
   146076 echo stderr:; cat "$at_stderr"
   146077 echo stdout:; cat "$at_stdout"
   146078 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146079 $at_failed && at_fn_log_failure
   146080 $at_traceon; }
   146081 
   146082     cp xml-tests/test.output expout
   146083   { set +x
   146084 $as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\
   146085              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   146086              xml-tests/test.xml"
   146087 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510"
   146088 ( $at_check_trace; $XSLTPROC \
   146089              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   146090              xml-tests/test.xml
   146091 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146092 at_status=$? at_failed=false
   146093 $at_check_filter
   146094 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146095 $at_diff expout "$at_stdout" || at_failed=:
   146096 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146097 $at_failed && at_fn_log_failure
   146098 $at_traceon; }
   146099 
   146100   sort xml-tests/test.dot > expout
   146101   { set +x
   146102 $as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\
   146103              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   146104              xml-tests/test.xml | sort"
   146105 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510"
   146106 ( $at_check_trace; $XSLTPROC \
   146107              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   146108              xml-tests/test.xml | sort
   146109 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146110 at_status=$? at_failed=false
   146111 $at_check_filter
   146112 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146113 $at_diff expout "$at_stdout" || at_failed=:
   146114 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146115 $at_failed && at_fn_log_failure
   146116 $at_traceon; }
   146117 
   146118   rm -rf xml-tests expout
   146119   at_restore_special_files
   146120 fi
   146121 { set +x
   146122 $as_echo "$at_srcdir/regression.at:1510: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146123                  -Dparse.lac.memory-trace=full \\
   146124                  -t -o input.c input.y"
   146125 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
   146126 ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146127                  -Dparse.lac.memory-trace=full \
   146128                  -t -o input.c input.y
   146129 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146130 at_status=$? at_failed=false
   146131 $at_check_filter
   146132 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
   146133 " | \
   146134   $at_diff - "$at_stderr" || at_failed=:
   146135 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146136 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146137 $at_failed && at_fn_log_failure
   146138 $at_traceon; }
   146139 
   146140 
   146141 { set +x
   146142 $as_echo "$at_srcdir/regression.at:1510: \$BISON_C_WORKS"
   146143 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1510"
   146144 ( $at_check_trace; $BISON_C_WORKS
   146145 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146146 at_status=$? at_failed=false
   146147 $at_check_filter
   146148 echo stderr:; cat "$at_stderr"
   146149 echo stdout:; cat "$at_stdout"
   146150 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146151 $at_failed && at_fn_log_failure
   146152 $at_traceon; }
   146153 
   146154 { set +x
   146155 $as_echo "$at_srcdir/regression.at:1510: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   146156 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1510"
   146157 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   146158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146159 at_status=$? at_failed=false
   146160 $at_check_filter
   146161 echo stderr:; cat "$at_stderr"
   146162 echo stdout:; cat "$at_stdout"
   146163 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146164 $at_failed && at_fn_log_failure
   146165 $at_traceon; }
   146166 
   146167 { set +x
   146168 $as_echo "$at_srcdir/regression.at:1510:  \$PREPARSER ./input > stdout.txt 2> stderr.txt"
   146169 at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1510"
   146170 ( $at_check_trace;  $PREPARSER ./input > stdout.txt 2> stderr.txt
   146171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146172 at_status=$? at_failed=false
   146173 $at_check_filter
   146174 echo stderr:; tee stderr <"$at_stderr"
   146175 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146176 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1510"
   146177 $at_failed && at_fn_log_failure
   146178 $at_traceon; }
   146179 
   146180 { set +x
   146181 $as_echo "$at_srcdir/regression.at:1510: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   146182 at_fn_check_prepare_trace "regression.at:1510"
   146183 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   146184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146185 at_status=$? at_failed=false
   146186 $at_check_filter
   146187 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146188 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146189 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146190 $at_failed && at_fn_log_failure
   146191 $at_traceon; }
   146192 
   146193 
   146194 
   146195 # Make sure syntax error doesn't forget that 'a' is expected.  It would
   146196 # be forgotten without lookahead correction.
   146197 { set +x
   146198 $as_echo "$at_srcdir/regression.at:1510: grep 'syntax error,' stderr.txt"
   146199 at_fn_check_prepare_trace "regression.at:1510"
   146200 ( $at_check_trace; grep 'syntax error,' stderr.txt
   146201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146202 at_status=$? at_failed=false
   146203 $at_check_filter
   146204 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146205 echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
   146206 " | \
   146207   $at_diff - "$at_stdout" || at_failed=:
   146208 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146209 $at_failed && at_fn_log_failure
   146210 $at_traceon; }
   146211 
   146212 
   146213 # Check number of default reductions in inconsistent states to be sure
   146214 # syntax error is detected before unnecessary reductions are performed.
   146215 { set +x
   146216 $as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
   146217            < stdout.txt || exit 77"
   146218 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
   146219 ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
   146220            < stdout.txt || exit 77
   146221 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146222 at_status=$? at_failed=false
   146223 $at_check_filter
   146224 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146225 echo >>"$at_stdout"; $as_echo "14" | \
   146226   $at_diff - "$at_stdout" || at_failed=:
   146227 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146228 $at_failed && at_fn_log_failure
   146229 $at_traceon; }
   146230 
   146231 
   146232 # Check number of default reductions in consistent states to be sure
   146233 # it is performed before the syntax error is detected.
   146234 { set +x
   146235 $as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
   146236            < stdout.txt || exit 77"
   146237 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
   146238 ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
   146239            < stdout.txt || exit 77
   146240 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146241 at_status=$? at_failed=false
   146242 $at_check_filter
   146243 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146244 echo >>"$at_stdout"; $as_echo "2" | \
   146245   $at_diff - "$at_stdout" || at_failed=:
   146246 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146247 $at_failed && at_fn_log_failure
   146248 $at_traceon; }
   146249 
   146250 
   146251 # Check number of reallocs to be sure reallocated memory isn't somehow
   146252 # lost between LAC invocations.
   146253 { set +x
   146254 $as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
   146255            || exit 77"
   146256 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
   146257 ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
   146258            || exit 77
   146259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146260 at_status=$? at_failed=false
   146261 $at_check_filter
   146262 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146263 echo >>"$at_stdout"; $as_echo "3" | \
   146264   $at_diff - "$at_stdout" || at_failed=:
   146265 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
   146266 $at_failed && at_fn_log_failure
   146267 $at_traceon; }
   146268 
   146269 
   146270 
   146271 
   146272 
   146273 
   146274 
   146275 
   146276 cat >input.y <<'_ATEOF'
   146277 %code top {
   146278 #include <config.h>
   146279 /* We don't need perfect functions for these tests. */
   146280 #undef malloc
   146281 #undef memcmp
   146282 #undef realloc
   146283 }
   146284 
   146285 %code {
   146286   #include <stdio.h>
   146287   static void yyerror ( const char *msg);
   146288   int yylex (YYSTYPE *);
   146289 }
   146290 
   146291 %define api.push-pull both %define api.pure
   146292 %error-verbose
   146293 %token 'c'
   146294 
   146295 %%
   146296 
   146297 // default reductions in inconsistent states
   146298 // v   v v   v v v v   v v v v v v v
   146299 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 ;
   146300 //       ^                     ^                               ^
   146301 // LAC reallocs
   146302 
   146303 A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
   146304 B: 'b' ;
   146305 C: /*empty*/ { printf ("consistent default reduction\n"); } ;
   146306 
   146307 %%
   146308 #include <stdio.h>
   146309 /* A C error reporting function.  */
   146310 static
   146311 void yyerror ( const char *msg)
   146312 {
   146313   fprintf (stderr, "%s\n", msg);
   146314 }
   146315 int
   146316 yylex (YYSTYPE *v)
   146317 {
   146318   static char const *input = "bbbbc";
   146319   *v = 0;
   146320   return *input++;
   146321 }
   146322 
   146323 int
   146324 main (void)
   146325 {
   146326   yydebug = 1;
   146327   return yyparse ();
   146328 }
   146329 _ATEOF
   146330 
   146331 
   146332 
   146333 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   146334   at_save_special_files
   146335   mkdir xml-tests
   146336     # Don't combine these Bison invocations since we want to be sure that
   146337   # --report=all isn't required to get the full XML file.
   146338   { set +x
   146339 $as_echo "$at_srcdir/regression.at:1511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   146340                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146341                  -Dparse.lac.memory-trace=full \\
   146342                  -t -o input.c input.y"
   146343 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511"
   146344 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   146345                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146346                  -Dparse.lac.memory-trace=full \
   146347                  -t -o input.c input.y
   146348 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146349 at_status=$? at_failed=false
   146350 $at_check_filter
   146351 echo stderr:; cat "$at_stderr"
   146352 echo stdout:; cat "$at_stdout"
   146353 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146354 $at_failed && at_fn_log_failure
   146355 $at_traceon; }
   146356 
   146357   { set +x
   146358 $as_echo "$at_srcdir/regression.at:1511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146359                  -Dparse.lac.memory-trace=full \\
   146360                  -t -o input.c input.y"
   146361 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511"
   146362 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146363                  -Dparse.lac.memory-trace=full \
   146364                  -t -o input.c input.y
   146365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146366 at_status=$? at_failed=false
   146367 $at_check_filter
   146368 echo stderr:; cat "$at_stderr"
   146369 echo stdout:; cat "$at_stdout"
   146370 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146371 $at_failed && at_fn_log_failure
   146372 $at_traceon; }
   146373 
   146374     cp xml-tests/test.output expout
   146375   { set +x
   146376 $as_echo "$at_srcdir/regression.at:1511: \$XSLTPROC \\
   146377              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   146378              xml-tests/test.xml"
   146379 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1511"
   146380 ( $at_check_trace; $XSLTPROC \
   146381              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   146382              xml-tests/test.xml
   146383 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146384 at_status=$? at_failed=false
   146385 $at_check_filter
   146386 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146387 $at_diff expout "$at_stdout" || at_failed=:
   146388 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146389 $at_failed && at_fn_log_failure
   146390 $at_traceon; }
   146391 
   146392   sort xml-tests/test.dot > expout
   146393   { set +x
   146394 $as_echo "$at_srcdir/regression.at:1511: \$XSLTPROC \\
   146395              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   146396              xml-tests/test.xml | sort"
   146397 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1511"
   146398 ( $at_check_trace; $XSLTPROC \
   146399              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   146400              xml-tests/test.xml | sort
   146401 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146402 at_status=$? at_failed=false
   146403 $at_check_filter
   146404 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146405 $at_diff expout "$at_stdout" || at_failed=:
   146406 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146407 $at_failed && at_fn_log_failure
   146408 $at_traceon; }
   146409 
   146410   rm -rf xml-tests expout
   146411   at_restore_special_files
   146412 fi
   146413 { set +x
   146414 $as_echo "$at_srcdir/regression.at:1511: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146415                  -Dparse.lac.memory-trace=full \\
   146416                  -t -o input.c input.y"
   146417 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511"
   146418 ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146419                  -Dparse.lac.memory-trace=full \
   146420                  -t -o input.c input.y
   146421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146422 at_status=$? at_failed=false
   146423 $at_check_filter
   146424 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce
   146425 " | \
   146426   $at_diff - "$at_stderr" || at_failed=:
   146427 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146428 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146429 $at_failed && at_fn_log_failure
   146430 $at_traceon; }
   146431 
   146432 
   146433 { set +x
   146434 $as_echo "$at_srcdir/regression.at:1511: \$BISON_C_WORKS"
   146435 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1511"
   146436 ( $at_check_trace; $BISON_C_WORKS
   146437 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146438 at_status=$? at_failed=false
   146439 $at_check_filter
   146440 echo stderr:; cat "$at_stderr"
   146441 echo stdout:; cat "$at_stdout"
   146442 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146443 $at_failed && at_fn_log_failure
   146444 $at_traceon; }
   146445 
   146446 { set +x
   146447 $as_echo "$at_srcdir/regression.at:1511: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   146448 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1511"
   146449 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   146450 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146451 at_status=$? at_failed=false
   146452 $at_check_filter
   146453 echo stderr:; cat "$at_stderr"
   146454 echo stdout:; cat "$at_stdout"
   146455 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146456 $at_failed && at_fn_log_failure
   146457 $at_traceon; }
   146458 
   146459 { set +x
   146460 $as_echo "$at_srcdir/regression.at:1511:  \$PREPARSER ./input > stdout.txt 2> stderr.txt"
   146461 at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1511"
   146462 ( $at_check_trace;  $PREPARSER ./input > stdout.txt 2> stderr.txt
   146463 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146464 at_status=$? at_failed=false
   146465 $at_check_filter
   146466 echo stderr:; tee stderr <"$at_stderr"
   146467 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146468 at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1511"
   146469 $at_failed && at_fn_log_failure
   146470 $at_traceon; }
   146471 
   146472 { set +x
   146473 $as_echo "$at_srcdir/regression.at:1511: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   146474 at_fn_check_prepare_trace "regression.at:1511"
   146475 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   146476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146477 at_status=$? at_failed=false
   146478 $at_check_filter
   146479 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146480 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146481 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146482 $at_failed && at_fn_log_failure
   146483 $at_traceon; }
   146484 
   146485 
   146486 
   146487 # Make sure syntax error doesn't forget that 'a' is expected.  It would
   146488 # be forgotten without lookahead correction.
   146489 { set +x
   146490 $as_echo "$at_srcdir/regression.at:1511: grep 'syntax error,' stderr.txt"
   146491 at_fn_check_prepare_trace "regression.at:1511"
   146492 ( $at_check_trace; grep 'syntax error,' stderr.txt
   146493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146494 at_status=$? at_failed=false
   146495 $at_check_filter
   146496 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146497 echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
   146498 " | \
   146499   $at_diff - "$at_stdout" || at_failed=:
   146500 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146501 $at_failed && at_fn_log_failure
   146502 $at_traceon; }
   146503 
   146504 
   146505 # Check number of default reductions in inconsistent states to be sure
   146506 # syntax error is detected before unnecessary reductions are performed.
   146507 { set +x
   146508 $as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
   146509            < stdout.txt || exit 77"
   146510 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511"
   146511 ( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
   146512            < stdout.txt || exit 77
   146513 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146514 at_status=$? at_failed=false
   146515 $at_check_filter
   146516 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146517 echo >>"$at_stdout"; $as_echo "14" | \
   146518   $at_diff - "$at_stdout" || at_failed=:
   146519 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146520 $at_failed && at_fn_log_failure
   146521 $at_traceon; }
   146522 
   146523 
   146524 # Check number of default reductions in consistent states to be sure
   146525 # it is performed before the syntax error is detected.
   146526 { set +x
   146527 $as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
   146528            < stdout.txt || exit 77"
   146529 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511"
   146530 ( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
   146531            < stdout.txt || exit 77
   146532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146533 at_status=$? at_failed=false
   146534 $at_check_filter
   146535 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146536 echo >>"$at_stdout"; $as_echo "2" | \
   146537   $at_diff - "$at_stdout" || at_failed=:
   146538 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146539 $at_failed && at_fn_log_failure
   146540 $at_traceon; }
   146541 
   146542 
   146543 # Check number of reallocs to be sure reallocated memory isn't somehow
   146544 # lost between LAC invocations.
   146545 { set +x
   146546 $as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
   146547            || exit 77"
   146548 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511"
   146549 ( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
   146550            || exit 77
   146551 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146552 at_status=$? at_failed=false
   146553 $at_check_filter
   146554 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146555 echo >>"$at_stdout"; $as_echo "3" | \
   146556   $at_diff - "$at_stdout" || at_failed=:
   146557 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511"
   146558 $at_failed && at_fn_log_failure
   146559 $at_traceon; }
   146560 
   146561 
   146562 
   146563 
   146564 
   146565 
   146566 
   146567   set +x
   146568   $at_times_p && times >"$at_times_file"
   146569 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   146570 read at_status <"$at_status_file"
   146571 #AT_STOP_295
   146572 #AT_START_296
   146573 at_fn_group_banner 296 'regression.at:1523' \
   146574   "LAC: Memory exhaustion" "                         " 17
   146575 at_xfail=no
   146576 (
   146577   $as_echo "296. $at_setup_line: testing $at_desc ..."
   146578   $at_traceon
   146579 
   146580 
   146581 
   146582 
   146583 # Check for memory exhaustion during parsing.
   146584 
   146585 cat >input.y <<'_ATEOF'
   146586 %code top {
   146587 #include <config.h>
   146588 /* We don't need perfect functions for these tests. */
   146589 #undef malloc
   146590 #undef memcmp
   146591 #undef realloc
   146592 }
   146593 
   146594 %code {
   146595   #include <stdio.h>
   146596   static void yyerror ( const char *msg);
   146597   static int yylex (void);
   146598   #define YYMAXDEPTH 8
   146599 }
   146600 
   146601 %error-verbose
   146602 
   146603 %%
   146604 
   146605 S: A A A A A A A A A ;
   146606 A: /*empty*/ | 'a' ;
   146607 
   146608 %%
   146609 #include <stdio.h>
   146610 /* A C error reporting function.  */
   146611 static
   146612 void yyerror ( const char *msg)
   146613 {
   146614   fprintf (stderr, "%s\n", msg);
   146615 }
   146616 #include <assert.h>
   146617 static
   146618 int yylex (void)
   146619 {
   146620   static char const input[] = "";
   146621   static size_t toknum = 0;
   146622   int res;
   146623   ;
   146624   assert (toknum < sizeof input / sizeof input[0]);
   146625   res = input[toknum++];
   146626   ;
   146627   return res;
   146628 }
   146629 int
   146630 main (void)
   146631 {
   146632   yydebug = 1;
   146633   return yyparse ();
   146634 }
   146635 _ATEOF
   146636 
   146637 
   146638 
   146639 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   146640   at_save_special_files
   146641   mkdir xml-tests
   146642     # Don't combine these Bison invocations since we want to be sure that
   146643   # --report=all isn't required to get the full XML file.
   146644   { set +x
   146645 $as_echo "$at_srcdir/regression.at:1562: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   146646                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146647                  -t -o input.c input.y"
   146648 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562"
   146649 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   146650                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146651                  -t -o input.c input.y
   146652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146653 at_status=$? at_failed=false
   146654 $at_check_filter
   146655 echo stderr:; cat "$at_stderr"
   146656 echo stdout:; cat "$at_stdout"
   146657 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146658 $at_failed && at_fn_log_failure
   146659 $at_traceon; }
   146660 
   146661   { set +x
   146662 $as_echo "$at_srcdir/regression.at:1562: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146663                  -t -o input.c input.y"
   146664 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562"
   146665 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146666                  -t -o input.c input.y
   146667 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146668 at_status=$? at_failed=false
   146669 $at_check_filter
   146670 echo stderr:; cat "$at_stderr"
   146671 echo stdout:; cat "$at_stdout"
   146672 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146673 $at_failed && at_fn_log_failure
   146674 $at_traceon; }
   146675 
   146676     cp xml-tests/test.output expout
   146677   { set +x
   146678 $as_echo "$at_srcdir/regression.at:1562: \$XSLTPROC \\
   146679              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   146680              xml-tests/test.xml"
   146681 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1562"
   146682 ( $at_check_trace; $XSLTPROC \
   146683              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   146684              xml-tests/test.xml
   146685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146686 at_status=$? at_failed=false
   146687 $at_check_filter
   146688 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146689 $at_diff expout "$at_stdout" || at_failed=:
   146690 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146691 $at_failed && at_fn_log_failure
   146692 $at_traceon; }
   146693 
   146694   sort xml-tests/test.dot > expout
   146695   { set +x
   146696 $as_echo "$at_srcdir/regression.at:1562: \$XSLTPROC \\
   146697              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   146698              xml-tests/test.xml | sort"
   146699 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1562"
   146700 ( $at_check_trace; $XSLTPROC \
   146701              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   146702              xml-tests/test.xml | sort
   146703 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146704 at_status=$? at_failed=false
   146705 $at_check_filter
   146706 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146707 $at_diff expout "$at_stdout" || at_failed=:
   146708 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146709 $at_failed && at_fn_log_failure
   146710 $at_traceon; }
   146711 
   146712   rm -rf xml-tests expout
   146713   at_restore_special_files
   146714 fi
   146715 { set +x
   146716 $as_echo "$at_srcdir/regression.at:1562: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146717                  -t -o input.c input.y"
   146718 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562"
   146719 ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146720                  -t -o input.c input.y
   146721 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146722 at_status=$? at_failed=false
   146723 $at_check_filter
   146724 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce
   146725 " | \
   146726   $at_diff - "$at_stderr" || at_failed=:
   146727 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146728 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146729 $at_failed && at_fn_log_failure
   146730 $at_traceon; }
   146731 
   146732 
   146733 { set +x
   146734 $as_echo "$at_srcdir/regression.at:1562: \$BISON_C_WORKS"
   146735 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1562"
   146736 ( $at_check_trace; $BISON_C_WORKS
   146737 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146738 at_status=$? at_failed=false
   146739 $at_check_filter
   146740 echo stderr:; cat "$at_stderr"
   146741 echo stdout:; cat "$at_stdout"
   146742 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146743 $at_failed && at_fn_log_failure
   146744 $at_traceon; }
   146745 
   146746 { set +x
   146747 $as_echo "$at_srcdir/regression.at:1562: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   146748 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1562"
   146749 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   146750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146751 at_status=$? at_failed=false
   146752 $at_check_filter
   146753 echo stderr:; cat "$at_stderr"
   146754 echo stdout:; cat "$at_stdout"
   146755 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1562"
   146756 $at_failed && at_fn_log_failure
   146757 $at_traceon; }
   146758 
   146759 
   146760 
   146761 { set +x
   146762 $as_echo "$at_srcdir/regression.at:1563:  \$PREPARSER ./input"
   146763 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1563"
   146764 ( $at_check_trace;  $PREPARSER ./input
   146765 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146766 at_status=$? at_failed=false
   146767 $at_check_filter
   146768 echo stderr:; tee stderr <"$at_stderr"
   146769 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146770 at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1563"
   146771 $at_failed && at_fn_log_failure
   146772 $at_traceon; }
   146773 
   146774 { set +x
   146775 $as_echo "$at_srcdir/regression.at:1563: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   146776 at_fn_check_prepare_trace "regression.at:1563"
   146777 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   146778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146779 at_status=$? at_failed=false
   146780 $at_check_filter
   146781 echo >>"$at_stderr"; $as_echo "Starting parse
   146782 Entering state 0
   146783 Reading a token: Now at end of input.
   146784 LAC: initial context established for \$end
   146785 LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
   146786 memory exhausted
   146787 Cleanup: discarding lookahead token \$end ()
   146788 Stack now 0
   146789 " | \
   146790   $at_diff - "$at_stderr" || at_failed=:
   146791 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146792 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1563"
   146793 $at_failed && at_fn_log_failure
   146794 $at_traceon; }
   146795 
   146796 
   146797 
   146798 # Induce an immediate syntax error with an undefined token, and check
   146799 # for memory exhaustion while building syntax error message.
   146800 
   146801 cat >input.y <<'_ATEOF'
   146802 %code top {
   146803 #include <config.h>
   146804 /* We don't need perfect functions for these tests. */
   146805 #undef malloc
   146806 #undef memcmp
   146807 #undef realloc
   146808 }
   146809 
   146810 %code {
   146811   #include <stdio.h>
   146812   static void yyerror ( const char *msg);
   146813   static int yylex (void);
   146814   #define YYMAXDEPTH 8
   146815 }
   146816 
   146817 %error-verbose
   146818 
   146819 %%
   146820 
   146821 S: A A A A A A A A A ;
   146822 A: /*empty*/ | 'a' ;
   146823 
   146824 %%
   146825 #include <stdio.h>
   146826 /* A C error reporting function.  */
   146827 static
   146828 void yyerror ( const char *msg)
   146829 {
   146830   fprintf (stderr, "%s\n", msg);
   146831 }
   146832 #include <assert.h>
   146833 static
   146834 int yylex (void)
   146835 {
   146836   static char const input[] = "z";
   146837   static size_t toknum = 0;
   146838   int res;
   146839   ;
   146840   assert (toknum < sizeof input / sizeof input[0]);
   146841   res = input[toknum++];
   146842   ;
   146843   return res;
   146844 }
   146845 int
   146846 main (void)
   146847 {
   146848   yydebug = 1;
   146849   return yyparse ();
   146850 }
   146851 _ATEOF
   146852 
   146853 
   146854 
   146855 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   146856   at_save_special_files
   146857   mkdir xml-tests
   146858     # Don't combine these Bison invocations since we want to be sure that
   146859   # --report=all isn't required to get the full XML file.
   146860   { set +x
   146861 $as_echo "$at_srcdir/regression.at:1576: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   146862                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146863                  -t -o input.c input.y"
   146864 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576"
   146865 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   146866                   --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146867                  -t -o input.c input.y
   146868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146869 at_status=$? at_failed=false
   146870 $at_check_filter
   146871 echo stderr:; cat "$at_stderr"
   146872 echo stdout:; cat "$at_stdout"
   146873 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146874 $at_failed && at_fn_log_failure
   146875 $at_traceon; }
   146876 
   146877   { set +x
   146878 $as_echo "$at_srcdir/regression.at:1576: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146879                  -t -o input.c input.y"
   146880 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576"
   146881 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146882                  -t -o input.c input.y
   146883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146884 at_status=$? at_failed=false
   146885 $at_check_filter
   146886 echo stderr:; cat "$at_stderr"
   146887 echo stdout:; cat "$at_stdout"
   146888 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146889 $at_failed && at_fn_log_failure
   146890 $at_traceon; }
   146891 
   146892     cp xml-tests/test.output expout
   146893   { set +x
   146894 $as_echo "$at_srcdir/regression.at:1576: \$XSLTPROC \\
   146895              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   146896              xml-tests/test.xml"
   146897 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1576"
   146898 ( $at_check_trace; $XSLTPROC \
   146899              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   146900              xml-tests/test.xml
   146901 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146902 at_status=$? at_failed=false
   146903 $at_check_filter
   146904 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146905 $at_diff expout "$at_stdout" || at_failed=:
   146906 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146907 $at_failed && at_fn_log_failure
   146908 $at_traceon; }
   146909 
   146910   sort xml-tests/test.dot > expout
   146911   { set +x
   146912 $as_echo "$at_srcdir/regression.at:1576: \$XSLTPROC \\
   146913              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   146914              xml-tests/test.xml | sort"
   146915 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1576"
   146916 ( $at_check_trace; $XSLTPROC \
   146917              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   146918              xml-tests/test.xml | sort
   146919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146920 at_status=$? at_failed=false
   146921 $at_check_filter
   146922 at_fn_diff_devnull "$at_stderr" || at_failed=:
   146923 $at_diff expout "$at_stdout" || at_failed=:
   146924 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146925 $at_failed && at_fn_log_failure
   146926 $at_traceon; }
   146927 
   146928   rm -rf xml-tests expout
   146929   at_restore_special_files
   146930 fi
   146931 { set +x
   146932 $as_echo "$at_srcdir/regression.at:1576: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
   146933                  -t -o input.c input.y"
   146934 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576"
   146935 ( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
   146936                  -t -o input.c input.y
   146937 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146938 at_status=$? at_failed=false
   146939 $at_check_filter
   146940 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce
   146941 " | \
   146942   $at_diff - "$at_stderr" || at_failed=:
   146943 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146944 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146945 $at_failed && at_fn_log_failure
   146946 $at_traceon; }
   146947 
   146948 
   146949 { set +x
   146950 $as_echo "$at_srcdir/regression.at:1576: \$BISON_C_WORKS"
   146951 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1576"
   146952 ( $at_check_trace; $BISON_C_WORKS
   146953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146954 at_status=$? at_failed=false
   146955 $at_check_filter
   146956 echo stderr:; cat "$at_stderr"
   146957 echo stdout:; cat "$at_stdout"
   146958 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146959 $at_failed && at_fn_log_failure
   146960 $at_traceon; }
   146961 
   146962 { set +x
   146963 $as_echo "$at_srcdir/regression.at:1576: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   146964 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1576"
   146965 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   146966 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146967 at_status=$? at_failed=false
   146968 $at_check_filter
   146969 echo stderr:; cat "$at_stderr"
   146970 echo stdout:; cat "$at_stdout"
   146971 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1576"
   146972 $at_failed && at_fn_log_failure
   146973 $at_traceon; }
   146974 
   146975 
   146976 
   146977 { set +x
   146978 $as_echo "$at_srcdir/regression.at:1577:  \$PREPARSER ./input"
   146979 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1577"
   146980 ( $at_check_trace;  $PREPARSER ./input
   146981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146982 at_status=$? at_failed=false
   146983 $at_check_filter
   146984 echo stderr:; tee stderr <"$at_stderr"
   146985 at_fn_diff_devnull "$at_stdout" || at_failed=:
   146986 at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1577"
   146987 $at_failed && at_fn_log_failure
   146988 $at_traceon; }
   146989 
   146990 { set +x
   146991 $as_echo "$at_srcdir/regression.at:1577: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   146992 at_fn_check_prepare_trace "regression.at:1577"
   146993 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   146994 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   146995 at_status=$? at_failed=false
   146996 $at_check_filter
   146997 echo >>"$at_stderr"; $as_echo "Starting parse
   146998 Entering state 0
   146999 Reading a token: Next token is token \$undefined ()
   147000 LAC: initial context established for \$undefined
   147001 LAC: checking lookahead \$undefined: Always Err
   147002 Constructing syntax error message
   147003 LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
   147004 syntax error
   147005 memory exhausted
   147006 Cleanup: discarding lookahead token \$undefined ()
   147007 Stack now 0
   147008 " | \
   147009   $at_diff - "$at_stderr" || at_failed=:
   147010 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147011 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1577"
   147012 $at_failed && at_fn_log_failure
   147013 $at_traceon; }
   147014 
   147015 
   147016 
   147017 
   147018 
   147019   set +x
   147020   $at_times_p && times >"$at_times_file"
   147021 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   147022 read at_status <"$at_status_file"
   147023 #AT_STOP_296
   147024 #AT_START_297
   147025 at_fn_group_banner 297 'regression.at:1664' \
   147026   "Lex and parse params: yacc.c" "                   " 17
   147027 at_xfail=no
   147028 (
   147029   $as_echo "297. $at_setup_line: testing $at_desc ..."
   147030   $at_traceon
   147031 
   147032 
   147033 
   147034 
   147035 ## FIXME: Improve parsing of parse-param and use the generated
   147036 ## yyerror.
   147037 cat >input.y <<'_ATEOF'
   147038 %code top {
   147039 #include <config.h>
   147040 /* We don't need perfect functions for these tests. */
   147041 #undef malloc
   147042 #undef memcmp
   147043 #undef realloc
   147044 }
   147045 
   147046 %defines
   147047 %locations
   147048 %skeleton "yacc.c"
   147049 %union { int ival; }
   147050 %parse-param { int x }
   147051 // Spaces, tabs, and new lines.
   147052 %parse-param { 
   147053 	 int y	 
   147054          
   147055  
   147056 }
   147057 
   147058 %{
   147059 #include <stdio.h>
   147060 #include <stdlib.h>
   147061 
   147062   static void yyerror (int x, int y,  const char *msg);
   147063   static int yylex (void);
   147064 %}
   147065 
   147066 %%
   147067 exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
   147068 %%
   147069 #include <stdio.h>
   147070 /* A C error reporting function.  */
   147071 static
   147072 void yyerror (int x, int y,  const char *msg)
   147073 {
   147074   YYUSE(x);
   147075   YYUSE(y);
   147076   YY_LOCATION_PRINT (stderr, (yylloc));
   147077   fprintf (stderr, ": ");
   147078   fprintf (stderr, "%s\n", msg);
   147079 }
   147080 #include <assert.h>
   147081 static
   147082 int yylex (void)
   147083 {
   147084   static char const input[] = "a";
   147085   static size_t toknum = 0;
   147086   int res;
   147087   ;
   147088   assert (toknum < sizeof input / sizeof input[0]);
   147089   res = input[toknum++];
   147090   ;
   147091   (yylloc).first_line = (yylloc).last_line = 1;
   147092   (yylloc).first_column = (yylloc).last_column = toknum;
   147093   return res;
   147094 }
   147095 
   147096 
   147097 
   147098 int
   147099 main (void)
   147100 {
   147101   return !!yyparse(1, 2);
   147102 }
   147103 _ATEOF
   147104 
   147105 
   147106 
   147107 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   147108   at_save_special_files
   147109   mkdir xml-tests
   147110     # Don't combine these Bison invocations since we want to be sure that
   147111   # --report=all isn't required to get the full XML file.
   147112   { set +x
   147113 $as_echo "$at_srcdir/regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   147114                   --graph=xml-tests/test.dot -o input.c input.y"
   147115 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1664"
   147116 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   147117                   --graph=xml-tests/test.dot -o input.c input.y
   147118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147119 at_status=$? at_failed=false
   147120 $at_check_filter
   147121 echo stderr:; cat "$at_stderr"
   147122 echo stdout:; cat "$at_stdout"
   147123 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147124 $at_failed && at_fn_log_failure
   147125 $at_traceon; }
   147126 
   147127   { set +x
   147128 $as_echo "$at_srcdir/regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   147129 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1664"
   147130 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   147131 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147132 at_status=$? at_failed=false
   147133 $at_check_filter
   147134 echo stderr:; cat "$at_stderr"
   147135 echo stdout:; cat "$at_stdout"
   147136 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147137 $at_failed && at_fn_log_failure
   147138 $at_traceon; }
   147139 
   147140     cp xml-tests/test.output expout
   147141   { set +x
   147142 $as_echo "$at_srcdir/regression.at:1664: \$XSLTPROC \\
   147143              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   147144              xml-tests/test.xml"
   147145 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1664"
   147146 ( $at_check_trace; $XSLTPROC \
   147147              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   147148              xml-tests/test.xml
   147149 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147150 at_status=$? at_failed=false
   147151 $at_check_filter
   147152 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147153 $at_diff expout "$at_stdout" || at_failed=:
   147154 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147155 $at_failed && at_fn_log_failure
   147156 $at_traceon; }
   147157 
   147158   sort xml-tests/test.dot > expout
   147159   { set +x
   147160 $as_echo "$at_srcdir/regression.at:1664: \$XSLTPROC \\
   147161              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   147162              xml-tests/test.xml | sort"
   147163 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1664"
   147164 ( $at_check_trace; $XSLTPROC \
   147165              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   147166              xml-tests/test.xml | sort
   147167 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147168 at_status=$? at_failed=false
   147169 $at_check_filter
   147170 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147171 $at_diff expout "$at_stdout" || at_failed=:
   147172 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147173 $at_failed && at_fn_log_failure
   147174 $at_traceon; }
   147175 
   147176   rm -rf xml-tests expout
   147177   at_restore_special_files
   147178 fi
   147179 { set +x
   147180 $as_echo "$at_srcdir/regression.at:1664: bison -o input.c input.y"
   147181 at_fn_check_prepare_trace "regression.at:1664"
   147182 ( $at_check_trace; bison -o input.c input.y
   147183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147184 at_status=$? at_failed=false
   147185 $at_check_filter
   147186 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147187 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147188 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147189 $at_failed && at_fn_log_failure
   147190 $at_traceon; }
   147191 
   147192 
   147193    { set +x
   147194 $as_echo "$at_srcdir/regression.at:1664: \$BISON_C_WORKS"
   147195 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1664"
   147196 ( $at_check_trace; $BISON_C_WORKS
   147197 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147198 at_status=$? at_failed=false
   147199 $at_check_filter
   147200 echo stderr:; cat "$at_stderr"
   147201 echo stdout:; cat "$at_stdout"
   147202 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147203 $at_failed && at_fn_log_failure
   147204 $at_traceon; }
   147205 
   147206 { set +x
   147207 $as_echo "$at_srcdir/regression.at:1664: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   147208 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1664"
   147209 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   147210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147211 at_status=$? at_failed=false
   147212 $at_check_filter
   147213 echo stderr:; cat "$at_stderr"
   147214 echo stdout:; cat "$at_stdout"
   147215 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147216 $at_failed && at_fn_log_failure
   147217 $at_traceon; }
   147218 
   147219 
   147220 { set +x
   147221 $as_echo "$at_srcdir/regression.at:1664:  \$PREPARSER ./input"
   147222 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1664"
   147223 ( $at_check_trace;  $PREPARSER ./input
   147224 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147225 at_status=$? at_failed=false
   147226 $at_check_filter
   147227 echo stderr:; tee stderr <"$at_stderr"
   147228 echo >>"$at_stdout"; $as_echo "x: 1, y: 2
   147229 " | \
   147230   $at_diff - "$at_stdout" || at_failed=:
   147231 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147232 $at_failed && at_fn_log_failure
   147233 $at_traceon; }
   147234 
   147235 { set +x
   147236 $as_echo "$at_srcdir/regression.at:1664: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   147237 at_fn_check_prepare_trace "regression.at:1664"
   147238 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   147239 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147240 at_status=$? at_failed=false
   147241 $at_check_filter
   147242 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147243 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147244 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664"
   147245 $at_failed && at_fn_log_failure
   147246 $at_traceon; }
   147247 
   147248 
   147249 
   147250 
   147251   set +x
   147252   $at_times_p && times >"$at_times_file"
   147253 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   147254 read at_status <"$at_status_file"
   147255 #AT_STOP_297
   147256 #AT_START_298
   147257 at_fn_group_banner 298 'regression.at:1665' \
   147258   "Lex and parse params: glr.c" "                    " 17
   147259 at_xfail=no
   147260 (
   147261   $as_echo "298. $at_setup_line: testing $at_desc ..."
   147262   $at_traceon
   147263 
   147264 
   147265 
   147266 
   147267 ## FIXME: Improve parsing of parse-param and use the generated
   147268 ## yyerror.
   147269 cat >input.y <<'_ATEOF'
   147270 %code top {
   147271 #include <config.h>
   147272 /* We don't need perfect functions for these tests. */
   147273 #undef malloc
   147274 #undef memcmp
   147275 #undef realloc
   147276 }
   147277 
   147278 %defines
   147279 %locations
   147280 %skeleton "glr.c"
   147281 %union { int ival; }
   147282 %parse-param { int x }
   147283 // Spaces, tabs, and new lines.
   147284 %parse-param { 
   147285 	 int y	 
   147286          
   147287  
   147288 }
   147289 
   147290 %{
   147291 #include <stdio.h>
   147292 #include <stdlib.h>
   147293 
   147294   static void yyerror (int x, int y,  const char *msg);
   147295   static int yylex (void);
   147296 %}
   147297 
   147298 %%
   147299 exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
   147300 %%
   147301 #include <stdio.h>
   147302 /* A C error reporting function.  */
   147303 static
   147304 void yyerror (int x, int y,  const char *msg)
   147305 {
   147306   YYUSE(x);
   147307   YYUSE(y);
   147308   YY_LOCATION_PRINT (stderr, (yylloc));
   147309   fprintf (stderr, ": ");
   147310   fprintf (stderr, "%s\n", msg);
   147311 }
   147312 #include <assert.h>
   147313 static
   147314 int yylex (void)
   147315 {
   147316   static char const input[] = "a";
   147317   static size_t toknum = 0;
   147318   int res;
   147319   ;
   147320   assert (toknum < sizeof input / sizeof input[0]);
   147321   res = input[toknum++];
   147322   ;
   147323   (yylloc).first_line = (yylloc).last_line = 1;
   147324   (yylloc).first_column = (yylloc).last_column = toknum;
   147325   return res;
   147326 }
   147327 
   147328 
   147329 
   147330 int
   147331 main (void)
   147332 {
   147333   return !!yyparse(1, 2);
   147334 }
   147335 _ATEOF
   147336 
   147337 
   147338 
   147339 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   147340   at_save_special_files
   147341   mkdir xml-tests
   147342     # Don't combine these Bison invocations since we want to be sure that
   147343   # --report=all isn't required to get the full XML file.
   147344   { set +x
   147345 $as_echo "$at_srcdir/regression.at:1665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   147346                   --graph=xml-tests/test.dot -o input.c input.y"
   147347 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1665"
   147348 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   147349                   --graph=xml-tests/test.dot -o input.c input.y
   147350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147351 at_status=$? at_failed=false
   147352 $at_check_filter
   147353 echo stderr:; cat "$at_stderr"
   147354 echo stdout:; cat "$at_stdout"
   147355 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147356 $at_failed && at_fn_log_failure
   147357 $at_traceon; }
   147358 
   147359   { set +x
   147360 $as_echo "$at_srcdir/regression.at:1665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   147361 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1665"
   147362 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   147363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147364 at_status=$? at_failed=false
   147365 $at_check_filter
   147366 echo stderr:; cat "$at_stderr"
   147367 echo stdout:; cat "$at_stdout"
   147368 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147369 $at_failed && at_fn_log_failure
   147370 $at_traceon; }
   147371 
   147372     cp xml-tests/test.output expout
   147373   { set +x
   147374 $as_echo "$at_srcdir/regression.at:1665: \$XSLTPROC \\
   147375              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   147376              xml-tests/test.xml"
   147377 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1665"
   147378 ( $at_check_trace; $XSLTPROC \
   147379              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   147380              xml-tests/test.xml
   147381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147382 at_status=$? at_failed=false
   147383 $at_check_filter
   147384 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147385 $at_diff expout "$at_stdout" || at_failed=:
   147386 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147387 $at_failed && at_fn_log_failure
   147388 $at_traceon; }
   147389 
   147390   sort xml-tests/test.dot > expout
   147391   { set +x
   147392 $as_echo "$at_srcdir/regression.at:1665: \$XSLTPROC \\
   147393              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   147394              xml-tests/test.xml | sort"
   147395 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1665"
   147396 ( $at_check_trace; $XSLTPROC \
   147397              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   147398              xml-tests/test.xml | sort
   147399 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147400 at_status=$? at_failed=false
   147401 $at_check_filter
   147402 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147403 $at_diff expout "$at_stdout" || at_failed=:
   147404 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147405 $at_failed && at_fn_log_failure
   147406 $at_traceon; }
   147407 
   147408   rm -rf xml-tests expout
   147409   at_restore_special_files
   147410 fi
   147411 { set +x
   147412 $as_echo "$at_srcdir/regression.at:1665: bison -o input.c input.y"
   147413 at_fn_check_prepare_trace "regression.at:1665"
   147414 ( $at_check_trace; bison -o input.c input.y
   147415 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147416 at_status=$? at_failed=false
   147417 $at_check_filter
   147418 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147419 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147420 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147421 $at_failed && at_fn_log_failure
   147422 $at_traceon; }
   147423 
   147424 
   147425    { set +x
   147426 $as_echo "$at_srcdir/regression.at:1665: \$BISON_C_WORKS"
   147427 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1665"
   147428 ( $at_check_trace; $BISON_C_WORKS
   147429 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147430 at_status=$? at_failed=false
   147431 $at_check_filter
   147432 echo stderr:; cat "$at_stderr"
   147433 echo stdout:; cat "$at_stdout"
   147434 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147435 $at_failed && at_fn_log_failure
   147436 $at_traceon; }
   147437 
   147438 { set +x
   147439 $as_echo "$at_srcdir/regression.at:1665: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   147440 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1665"
   147441 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   147442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147443 at_status=$? at_failed=false
   147444 $at_check_filter
   147445 echo stderr:; cat "$at_stderr"
   147446 echo stdout:; cat "$at_stdout"
   147447 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147448 $at_failed && at_fn_log_failure
   147449 $at_traceon; }
   147450 
   147451 
   147452 { set +x
   147453 $as_echo "$at_srcdir/regression.at:1665:  \$PREPARSER ./input"
   147454 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1665"
   147455 ( $at_check_trace;  $PREPARSER ./input
   147456 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147457 at_status=$? at_failed=false
   147458 $at_check_filter
   147459 echo stderr:; tee stderr <"$at_stderr"
   147460 echo >>"$at_stdout"; $as_echo "x: 1, y: 2
   147461 " | \
   147462   $at_diff - "$at_stdout" || at_failed=:
   147463 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147464 $at_failed && at_fn_log_failure
   147465 $at_traceon; }
   147466 
   147467 { set +x
   147468 $as_echo "$at_srcdir/regression.at:1665: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   147469 at_fn_check_prepare_trace "regression.at:1665"
   147470 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   147471 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147472 at_status=$? at_failed=false
   147473 $at_check_filter
   147474 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147475 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147476 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665"
   147477 $at_failed && at_fn_log_failure
   147478 $at_traceon; }
   147479 
   147480 
   147481 
   147482 
   147483   set +x
   147484   $at_times_p && times >"$at_times_file"
   147485 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   147486 read at_status <"$at_status_file"
   147487 #AT_STOP_298
   147488 #AT_START_299
   147489 at_fn_group_banner 299 'regression.at:1666' \
   147490   "Lex and parse params: lalr1.cc" "                 " 17
   147491 at_xfail=no
   147492 (
   147493   $as_echo "299. $at_setup_line: testing $at_desc ..."
   147494   $at_traceon
   147495 
   147496 
   147497 
   147498 
   147499 ## FIXME: Improve parsing of parse-param and use the generated
   147500 ## yyerror.
   147501 cat >input.y <<'_ATEOF'
   147502 %code top {
   147503 #include <config.h>
   147504 /* We don't need perfect functions for these tests. */
   147505 #undef malloc
   147506 #undef memcmp
   147507 #undef realloc
   147508 }
   147509 
   147510 %defines
   147511 %locations
   147512 %skeleton "lalr1.cc"
   147513 %union { int ival; }
   147514 %parse-param { int x }
   147515 // Spaces, tabs, and new lines.
   147516 %parse-param { 
   147517 	 int y	 
   147518          
   147519  
   147520 }
   147521 
   147522 %{
   147523 #include <stdio.h>
   147524 #include <stdlib.h>
   147525 
   147526 
   147527   static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   147528 %}
   147529 
   147530 %%
   147531 exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
   147532 %%
   147533 /* A C++ error reporting function.  */
   147534 void
   147535 yy::parser::error (const location_type& l, const std::string& m)
   147536 {
   147537   (void) l;
   147538   std::cerr << l << ": " << m << std::endl;
   147539 }
   147540 #include <assert.h>
   147541 static
   147542 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   147543 {
   147544   static char const input[] = "a";
   147545   static size_t toknum = 0;
   147546   int res;
   147547   (void) lvalp;(void) llocp;
   147548   assert (toknum < sizeof input / sizeof input[0]);
   147549   res = input[toknum++];
   147550   ;
   147551   (*llocp).begin.line = (*llocp).end.line = 1;
   147552   (*llocp).begin.column = (*llocp).end.column = toknum;
   147553   return res;
   147554 }
   147555 
   147556 int
   147557 yyparse (int x, int y)
   147558 {
   147559   yy::parser parser(x, y);
   147560   return parser.parse ();
   147561 }
   147562 
   147563 
   147564 int
   147565 main (void)
   147566 {
   147567   return !!yyparse(1, 2);
   147568 }
   147569 _ATEOF
   147570 
   147571 
   147572 
   147573 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   147574   at_save_special_files
   147575   mkdir xml-tests
   147576     # Don't combine these Bison invocations since we want to be sure that
   147577   # --report=all isn't required to get the full XML file.
   147578   { set +x
   147579 $as_echo "$at_srcdir/regression.at:1666: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   147580                   --graph=xml-tests/test.dot -o input.cc input.y"
   147581 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1666"
   147582 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   147583                   --graph=xml-tests/test.dot -o input.cc input.y
   147584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147585 at_status=$? at_failed=false
   147586 $at_check_filter
   147587 echo stderr:; cat "$at_stderr"
   147588 echo stdout:; cat "$at_stdout"
   147589 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147590 $at_failed && at_fn_log_failure
   147591 $at_traceon; }
   147592 
   147593   { set +x
   147594 $as_echo "$at_srcdir/regression.at:1666: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   147595 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1666"
   147596 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   147597 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147598 at_status=$? at_failed=false
   147599 $at_check_filter
   147600 echo stderr:; cat "$at_stderr"
   147601 echo stdout:; cat "$at_stdout"
   147602 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147603 $at_failed && at_fn_log_failure
   147604 $at_traceon; }
   147605 
   147606     cp xml-tests/test.output expout
   147607   { set +x
   147608 $as_echo "$at_srcdir/regression.at:1666: \$XSLTPROC \\
   147609              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   147610              xml-tests/test.xml"
   147611 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1666"
   147612 ( $at_check_trace; $XSLTPROC \
   147613              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   147614              xml-tests/test.xml
   147615 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147616 at_status=$? at_failed=false
   147617 $at_check_filter
   147618 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147619 $at_diff expout "$at_stdout" || at_failed=:
   147620 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147621 $at_failed && at_fn_log_failure
   147622 $at_traceon; }
   147623 
   147624   sort xml-tests/test.dot > expout
   147625   { set +x
   147626 $as_echo "$at_srcdir/regression.at:1666: \$XSLTPROC \\
   147627              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   147628              xml-tests/test.xml | sort"
   147629 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1666"
   147630 ( $at_check_trace; $XSLTPROC \
   147631              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   147632              xml-tests/test.xml | sort
   147633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147634 at_status=$? at_failed=false
   147635 $at_check_filter
   147636 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147637 $at_diff expout "$at_stdout" || at_failed=:
   147638 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147639 $at_failed && at_fn_log_failure
   147640 $at_traceon; }
   147641 
   147642   rm -rf xml-tests expout
   147643   at_restore_special_files
   147644 fi
   147645 { set +x
   147646 $as_echo "$at_srcdir/regression.at:1666: bison -o input.cc input.y"
   147647 at_fn_check_prepare_trace "regression.at:1666"
   147648 ( $at_check_trace; bison -o input.cc input.y
   147649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147650 at_status=$? at_failed=false
   147651 $at_check_filter
   147652 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147653 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147654 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147655 $at_failed && at_fn_log_failure
   147656 $at_traceon; }
   147657 
   147658 
   147659 
   147660 { set +x
   147661 $as_echo "$at_srcdir/regression.at:1666: \$BISON_CXX_WORKS"
   147662 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1666"
   147663 ( $at_check_trace; $BISON_CXX_WORKS
   147664 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147665 at_status=$? at_failed=false
   147666 $at_check_filter
   147667 echo stderr:; cat "$at_stderr"
   147668 echo stdout:; cat "$at_stdout"
   147669 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147670 $at_failed && at_fn_log_failure
   147671 $at_traceon; }
   147672 
   147673 { set +x
   147674 $as_echo "$at_srcdir/regression.at:1666: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   147675 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1666"
   147676 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   147677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147678 at_status=$? at_failed=false
   147679 $at_check_filter
   147680 echo stderr:; cat "$at_stderr"
   147681 echo stdout:; cat "$at_stdout"
   147682 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147683 $at_failed && at_fn_log_failure
   147684 $at_traceon; }
   147685 
   147686 
   147687 { set +x
   147688 $as_echo "$at_srcdir/regression.at:1666:  \$PREPARSER ./input"
   147689 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1666"
   147690 ( $at_check_trace;  $PREPARSER ./input
   147691 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147692 at_status=$? at_failed=false
   147693 $at_check_filter
   147694 echo stderr:; tee stderr <"$at_stderr"
   147695 echo >>"$at_stdout"; $as_echo "x: 1, y: 2
   147696 " | \
   147697   $at_diff - "$at_stdout" || at_failed=:
   147698 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147699 $at_failed && at_fn_log_failure
   147700 $at_traceon; }
   147701 
   147702 { set +x
   147703 $as_echo "$at_srcdir/regression.at:1666: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   147704 at_fn_check_prepare_trace "regression.at:1666"
   147705 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   147706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147707 at_status=$? at_failed=false
   147708 $at_check_filter
   147709 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147710 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147711 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666"
   147712 $at_failed && at_fn_log_failure
   147713 $at_traceon; }
   147714 
   147715 
   147716 
   147717 
   147718   set +x
   147719   $at_times_p && times >"$at_times_file"
   147720 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   147721 read at_status <"$at_status_file"
   147722 #AT_STOP_299
   147723 #AT_START_300
   147724 at_fn_group_banner 300 'regression.at:1667' \
   147725   "Lex and parse params: glr.cc" "                   " 17
   147726 at_xfail=no
   147727 (
   147728   $as_echo "300. $at_setup_line: testing $at_desc ..."
   147729   $at_traceon
   147730 
   147731 
   147732 
   147733 
   147734 ## FIXME: Improve parsing of parse-param and use the generated
   147735 ## yyerror.
   147736 cat >input.y <<'_ATEOF'
   147737 %code top {
   147738 #include <config.h>
   147739 /* We don't need perfect functions for these tests. */
   147740 #undef malloc
   147741 #undef memcmp
   147742 #undef realloc
   147743 }
   147744 
   147745 %defines
   147746 %locations
   147747 %skeleton "glr.cc"
   147748 %union { int ival; }
   147749 %parse-param { int x }
   147750 // Spaces, tabs, and new lines.
   147751 %parse-param { 
   147752 	 int y	 
   147753          
   147754  
   147755 }
   147756 
   147757 %{
   147758 #include <stdio.h>
   147759 #include <stdlib.h>
   147760 
   147761 
   147762   static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
   147763 %}
   147764 
   147765 %%
   147766 exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
   147767 %%
   147768 /* A C++ error reporting function.  */
   147769 void
   147770 yy::parser::error (const location_type& l, const std::string& m)
   147771 {
   147772   (void) l;
   147773   std::cerr << l << ": " << m << std::endl;
   147774 }
   147775 #include <assert.h>
   147776 static
   147777 int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
   147778 {
   147779   static char const input[] = "a";
   147780   static size_t toknum = 0;
   147781   int res;
   147782   (void) lvalp;(void) llocp;
   147783   assert (toknum < sizeof input / sizeof input[0]);
   147784   res = input[toknum++];
   147785   ;
   147786   (*llocp).begin.line = (*llocp).end.line = 1;
   147787   (*llocp).begin.column = (*llocp).end.column = toknum;
   147788   return res;
   147789 }
   147790 
   147791 int
   147792 yyparse (int x, int y)
   147793 {
   147794   yy::parser parser(x, y);
   147795   return parser.parse ();
   147796 }
   147797 
   147798 
   147799 int
   147800 main (void)
   147801 {
   147802   return !!yyparse(1, 2);
   147803 }
   147804 _ATEOF
   147805 
   147806 
   147807 
   147808 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   147809   at_save_special_files
   147810   mkdir xml-tests
   147811     # Don't combine these Bison invocations since we want to be sure that
   147812   # --report=all isn't required to get the full XML file.
   147813   { set +x
   147814 $as_echo "$at_srcdir/regression.at:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   147815                   --graph=xml-tests/test.dot -o input.cc input.y"
   147816 at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1667"
   147817 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   147818                   --graph=xml-tests/test.dot -o input.cc input.y
   147819 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147820 at_status=$? at_failed=false
   147821 $at_check_filter
   147822 echo stderr:; cat "$at_stderr"
   147823 echo stdout:; cat "$at_stdout"
   147824 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147825 $at_failed && at_fn_log_failure
   147826 $at_traceon; }
   147827 
   147828   { set +x
   147829 $as_echo "$at_srcdir/regression.at:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   147830 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1667"
   147831 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   147832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147833 at_status=$? at_failed=false
   147834 $at_check_filter
   147835 echo stderr:; cat "$at_stderr"
   147836 echo stdout:; cat "$at_stdout"
   147837 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147838 $at_failed && at_fn_log_failure
   147839 $at_traceon; }
   147840 
   147841     cp xml-tests/test.output expout
   147842   { set +x
   147843 $as_echo "$at_srcdir/regression.at:1667: \$XSLTPROC \\
   147844              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   147845              xml-tests/test.xml"
   147846 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1667"
   147847 ( $at_check_trace; $XSLTPROC \
   147848              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   147849              xml-tests/test.xml
   147850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147851 at_status=$? at_failed=false
   147852 $at_check_filter
   147853 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147854 $at_diff expout "$at_stdout" || at_failed=:
   147855 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147856 $at_failed && at_fn_log_failure
   147857 $at_traceon; }
   147858 
   147859   sort xml-tests/test.dot > expout
   147860   { set +x
   147861 $as_echo "$at_srcdir/regression.at:1667: \$XSLTPROC \\
   147862              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   147863              xml-tests/test.xml | sort"
   147864 at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1667"
   147865 ( $at_check_trace; $XSLTPROC \
   147866              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   147867              xml-tests/test.xml | sort
   147868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147869 at_status=$? at_failed=false
   147870 $at_check_filter
   147871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147872 $at_diff expout "$at_stdout" || at_failed=:
   147873 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147874 $at_failed && at_fn_log_failure
   147875 $at_traceon; }
   147876 
   147877   rm -rf xml-tests expout
   147878   at_restore_special_files
   147879 fi
   147880 { set +x
   147881 $as_echo "$at_srcdir/regression.at:1667: bison -o input.cc input.y"
   147882 at_fn_check_prepare_trace "regression.at:1667"
   147883 ( $at_check_trace; bison -o input.cc input.y
   147884 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147885 at_status=$? at_failed=false
   147886 $at_check_filter
   147887 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147888 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147889 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147890 $at_failed && at_fn_log_failure
   147891 $at_traceon; }
   147892 
   147893 
   147894 
   147895 { set +x
   147896 $as_echo "$at_srcdir/regression.at:1667: \$BISON_CXX_WORKS"
   147897 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1667"
   147898 ( $at_check_trace; $BISON_CXX_WORKS
   147899 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147900 at_status=$? at_failed=false
   147901 $at_check_filter
   147902 echo stderr:; cat "$at_stderr"
   147903 echo stdout:; cat "$at_stdout"
   147904 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147905 $at_failed && at_fn_log_failure
   147906 $at_traceon; }
   147907 
   147908 { set +x
   147909 $as_echo "$at_srcdir/regression.at:1667: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   147910 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1667"
   147911 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   147912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147913 at_status=$? at_failed=false
   147914 $at_check_filter
   147915 echo stderr:; cat "$at_stderr"
   147916 echo stdout:; cat "$at_stdout"
   147917 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147918 $at_failed && at_fn_log_failure
   147919 $at_traceon; }
   147920 
   147921 
   147922 { set +x
   147923 $as_echo "$at_srcdir/regression.at:1667:  \$PREPARSER ./input"
   147924 at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1667"
   147925 ( $at_check_trace;  $PREPARSER ./input
   147926 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147927 at_status=$? at_failed=false
   147928 $at_check_filter
   147929 echo stderr:; tee stderr <"$at_stderr"
   147930 echo >>"$at_stdout"; $as_echo "x: 1, y: 2
   147931 " | \
   147932   $at_diff - "$at_stdout" || at_failed=:
   147933 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147934 $at_failed && at_fn_log_failure
   147935 $at_traceon; }
   147936 
   147937 { set +x
   147938 $as_echo "$at_srcdir/regression.at:1667: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   147939 at_fn_check_prepare_trace "regression.at:1667"
   147940 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   147941 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147942 at_status=$? at_failed=false
   147943 $at_check_filter
   147944 at_fn_diff_devnull "$at_stderr" || at_failed=:
   147945 at_fn_diff_devnull "$at_stdout" || at_failed=:
   147946 at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667"
   147947 $at_failed && at_fn_log_failure
   147948 $at_traceon; }
   147949 
   147950 
   147951 
   147952 
   147953   set +x
   147954   $at_times_p && times >"$at_times_file"
   147955 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   147956 read at_status <"$at_status_file"
   147957 #AT_STOP_300
   147958 #AT_START_301
   147959 at_fn_group_banner 301 'c++.at:101' \
   147960   "Doxygen Public Documentation" "                   " 18
   147961 at_xfail=no
   147962 (
   147963   $as_echo "301. $at_setup_line: testing $at_desc ..."
   147964   $at_traceon
   147965 
   147966 
   147967 
   147968 cat >input.yy <<'_ATEOF'
   147969 %skeleton "lalr1.cc"
   147970 %locations
   147971 %debug
   147972 %defines
   147973 %%
   147974 exp:;
   147975 %%
   147976 /* A C++ error reporting function.  */
   147977 void
   147978 yy::parser::error (const location_type& l, const std::string& m)
   147979 {
   147980   (void) l;
   147981   std::cerr << m << std::endl;
   147982 }
   147983 _ATEOF
   147984 
   147985 
   147986 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   147987   at_save_special_files
   147988   mkdir xml-tests
   147989     # Don't combine these Bison invocations since we want to be sure that
   147990   # --report=all isn't required to get the full XML file.
   147991   { set +x
   147992 $as_echo "$at_srcdir/c++.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   147993                   --graph=xml-tests/test.dot -o input.cc input.yy"
   147994 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:101"
   147995 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   147996                   --graph=xml-tests/test.dot -o input.cc input.yy
   147997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   147998 at_status=$? at_failed=false
   147999 $at_check_filter
   148000 echo stderr:; cat "$at_stderr"
   148001 echo stdout:; cat "$at_stdout"
   148002 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148003 $at_failed && at_fn_log_failure
   148004 $at_traceon; }
   148005 
   148006   { set +x
   148007 $as_echo "$at_srcdir/c++.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy"
   148008 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:101"
   148009 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy
   148010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148011 at_status=$? at_failed=false
   148012 $at_check_filter
   148013 echo stderr:; cat "$at_stderr"
   148014 echo stdout:; cat "$at_stdout"
   148015 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148016 $at_failed && at_fn_log_failure
   148017 $at_traceon; }
   148018 
   148019     cp xml-tests/test.output expout
   148020   { set +x
   148021 $as_echo "$at_srcdir/c++.at:101: \$XSLTPROC \\
   148022              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   148023              xml-tests/test.xml"
   148024 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:101"
   148025 ( $at_check_trace; $XSLTPROC \
   148026              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   148027              xml-tests/test.xml
   148028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148029 at_status=$? at_failed=false
   148030 $at_check_filter
   148031 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148032 $at_diff expout "$at_stdout" || at_failed=:
   148033 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148034 $at_failed && at_fn_log_failure
   148035 $at_traceon; }
   148036 
   148037   sort xml-tests/test.dot > expout
   148038   { set +x
   148039 $as_echo "$at_srcdir/c++.at:101: \$XSLTPROC \\
   148040              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   148041              xml-tests/test.xml | sort"
   148042 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:101"
   148043 ( $at_check_trace; $XSLTPROC \
   148044              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   148045              xml-tests/test.xml | sort
   148046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148047 at_status=$? at_failed=false
   148048 $at_check_filter
   148049 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148050 $at_diff expout "$at_stdout" || at_failed=:
   148051 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148052 $at_failed && at_fn_log_failure
   148053 $at_traceon; }
   148054 
   148055   rm -rf xml-tests expout
   148056   at_restore_special_files
   148057 fi
   148058 { set +x
   148059 $as_echo "$at_srcdir/c++.at:101: bison -o input.cc input.yy"
   148060 at_fn_check_prepare_trace "c++.at:101"
   148061 ( $at_check_trace; bison -o input.cc input.yy
   148062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148063 at_status=$? at_failed=false
   148064 $at_check_filter
   148065 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148066 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148067 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148068 $at_failed && at_fn_log_failure
   148069 $at_traceon; }
   148070 
   148071 
   148072 
   148073 cat >Doxyfile <<'_ATEOF'
   148074 # The PROJECT_NAME tag is a single word (or a sequence of words
   148075 # surrounded by quotes) that should identify the project.
   148076 PROJECT_NAME = "Bison C++ Parser"
   148077 
   148078 # The QUIET tag can be used to turn on/off the messages that are
   148079 # generated by doxygen. Possible values are YES and NO. If left blank
   148080 # NO is used.
   148081 QUIET = YES
   148082 
   148083 # The WARNINGS tag can be used to turn on/off the warning messages
   148084 # that are generated by doxygen. Possible values are YES and NO. If
   148085 # left blank NO is used.
   148086 WARNINGS     = YES
   148087 # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate
   148088 # warnings for undocumented members. If EXTRACT_ALL is set to YES then
   148089 # this flag will automatically be disabled.
   148090 WARN_IF_UNDOCUMENTED   = YES
   148091 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings
   148092 # for potential errors in the documentation, such as not documenting
   148093 # some parameters in a documented function, or documenting parameters
   148094 # that don't exist or using markup commands wrongly.
   148095 WARN_IF_DOC_ERROR      = YES
   148096 # The WARN_FORMAT tag determines the format of the warning messages
   148097 # that doxygen can produce. The string should contain the $file,
   148098 # $line, and $text tags, which will be replaced by the file and line
   148099 # number from which the warning originated and the warning text.
   148100 WARN_FORMAT            = "$file:$line: $text"
   148101 
   148102 # If the EXTRACT_ALL tag is set to YES doxygen will assume all
   148103 # entities in documentation are documented, even if no documentation
   148104 # was available.  Private class members and static file members will
   148105 # be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set
   148106 # to YES
   148107 EXTRACT_ALL            = YES
   148108 
   148109 # If the EXTRACT_PRIVATE tag is set to YES all private members of a
   148110 # class will be included in the documentation.
   148111 EXTRACT_PRIVATE        = NO
   148112 
   148113 # If the EXTRACT_STATIC tag is set to YES all static members of a file
   148114 # will be included in the documentation.
   148115 EXTRACT_STATIC         = NO
   148116 _ATEOF
   148117 
   148118 
   148119 { set +x
   148120 $as_echo "$at_srcdir/c++.at:101: doxygen --version || exit 77"
   148121 at_fn_check_prepare_trace "c++.at:101"
   148122 ( $at_check_trace; doxygen --version || exit 77
   148123 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148124 at_status=$? at_failed=false
   148125 $at_check_filter
   148126 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148127 echo stdout:; cat "$at_stdout"
   148128 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148129 $at_failed && at_fn_log_failure
   148130 $at_traceon; }
   148131 
   148132 { set +x
   148133 $as_echo "$at_srcdir/c++.at:101: doxygen"
   148134 at_fn_check_prepare_trace "c++.at:101"
   148135 ( $at_check_trace; doxygen
   148136 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148137 at_status=$? at_failed=false
   148138 $at_check_filter
   148139 echo stderr:; cat "$at_stderr"
   148140 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148141 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
   148142 $at_failed && at_fn_log_failure
   148143 $at_traceon; }
   148144 
   148145 
   148146 
   148147   set +x
   148148   $at_times_p && times >"$at_times_file"
   148149 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   148150 read at_status <"$at_status_file"
   148151 #AT_STOP_301
   148152 #AT_START_302
   148153 at_fn_group_banner 302 'c++.at:102' \
   148154   "Doxygen Private Documentation" "                  " 18
   148155 at_xfail=no
   148156 (
   148157   $as_echo "302. $at_setup_line: testing $at_desc ..."
   148158   $at_traceon
   148159 
   148160 
   148161 
   148162 cat >input.yy <<'_ATEOF'
   148163 %skeleton "lalr1.cc"
   148164 %locations
   148165 %debug
   148166 %defines
   148167 %%
   148168 exp:;
   148169 %%
   148170 /* A C++ error reporting function.  */
   148171 void
   148172 yy::parser::error (const location_type& l, const std::string& m)
   148173 {
   148174   (void) l;
   148175   std::cerr << m << std::endl;
   148176 }
   148177 _ATEOF
   148178 
   148179 
   148180 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   148181   at_save_special_files
   148182   mkdir xml-tests
   148183     # Don't combine these Bison invocations since we want to be sure that
   148184   # --report=all isn't required to get the full XML file.
   148185   { set +x
   148186 $as_echo "$at_srcdir/c++.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   148187                   --graph=xml-tests/test.dot -o input.cc input.yy"
   148188 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:102"
   148189 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   148190                   --graph=xml-tests/test.dot -o input.cc input.yy
   148191 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148192 at_status=$? at_failed=false
   148193 $at_check_filter
   148194 echo stderr:; cat "$at_stderr"
   148195 echo stdout:; cat "$at_stdout"
   148196 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148197 $at_failed && at_fn_log_failure
   148198 $at_traceon; }
   148199 
   148200   { set +x
   148201 $as_echo "$at_srcdir/c++.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy"
   148202 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:102"
   148203 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy
   148204 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148205 at_status=$? at_failed=false
   148206 $at_check_filter
   148207 echo stderr:; cat "$at_stderr"
   148208 echo stdout:; cat "$at_stdout"
   148209 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148210 $at_failed && at_fn_log_failure
   148211 $at_traceon; }
   148212 
   148213     cp xml-tests/test.output expout
   148214   { set +x
   148215 $as_echo "$at_srcdir/c++.at:102: \$XSLTPROC \\
   148216              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   148217              xml-tests/test.xml"
   148218 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:102"
   148219 ( $at_check_trace; $XSLTPROC \
   148220              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   148221              xml-tests/test.xml
   148222 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148223 at_status=$? at_failed=false
   148224 $at_check_filter
   148225 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148226 $at_diff expout "$at_stdout" || at_failed=:
   148227 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148228 $at_failed && at_fn_log_failure
   148229 $at_traceon; }
   148230 
   148231   sort xml-tests/test.dot > expout
   148232   { set +x
   148233 $as_echo "$at_srcdir/c++.at:102: \$XSLTPROC \\
   148234              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   148235              xml-tests/test.xml | sort"
   148236 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:102"
   148237 ( $at_check_trace; $XSLTPROC \
   148238              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   148239              xml-tests/test.xml | sort
   148240 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148241 at_status=$? at_failed=false
   148242 $at_check_filter
   148243 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148244 $at_diff expout "$at_stdout" || at_failed=:
   148245 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148246 $at_failed && at_fn_log_failure
   148247 $at_traceon; }
   148248 
   148249   rm -rf xml-tests expout
   148250   at_restore_special_files
   148251 fi
   148252 { set +x
   148253 $as_echo "$at_srcdir/c++.at:102: bison -o input.cc input.yy"
   148254 at_fn_check_prepare_trace "c++.at:102"
   148255 ( $at_check_trace; bison -o input.cc input.yy
   148256 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148257 at_status=$? at_failed=false
   148258 $at_check_filter
   148259 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148260 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148261 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148262 $at_failed && at_fn_log_failure
   148263 $at_traceon; }
   148264 
   148265 
   148266 
   148267 cat >Doxyfile <<'_ATEOF'
   148268 # The PROJECT_NAME tag is a single word (or a sequence of words
   148269 # surrounded by quotes) that should identify the project.
   148270 PROJECT_NAME = "Bison C++ Parser"
   148271 
   148272 # The QUIET tag can be used to turn on/off the messages that are
   148273 # generated by doxygen. Possible values are YES and NO. If left blank
   148274 # NO is used.
   148275 QUIET = YES
   148276 
   148277 # The WARNINGS tag can be used to turn on/off the warning messages
   148278 # that are generated by doxygen. Possible values are YES and NO. If
   148279 # left blank NO is used.
   148280 WARNINGS     = YES
   148281 # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate
   148282 # warnings for undocumented members. If EXTRACT_ALL is set to YES then
   148283 # this flag will automatically be disabled.
   148284 WARN_IF_UNDOCUMENTED   = YES
   148285 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings
   148286 # for potential errors in the documentation, such as not documenting
   148287 # some parameters in a documented function, or documenting parameters
   148288 # that don't exist or using markup commands wrongly.
   148289 WARN_IF_DOC_ERROR      = YES
   148290 # The WARN_FORMAT tag determines the format of the warning messages
   148291 # that doxygen can produce. The string should contain the $file,
   148292 # $line, and $text tags, which will be replaced by the file and line
   148293 # number from which the warning originated and the warning text.
   148294 WARN_FORMAT            = "$file:$line: $text"
   148295 
   148296 # If the EXTRACT_ALL tag is set to YES doxygen will assume all
   148297 # entities in documentation are documented, even if no documentation
   148298 # was available.  Private class members and static file members will
   148299 # be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set
   148300 # to YES
   148301 EXTRACT_ALL            = YES
   148302 
   148303 # If the EXTRACT_PRIVATE tag is set to YES all private members of a
   148304 # class will be included in the documentation.
   148305 EXTRACT_PRIVATE        = YES
   148306 
   148307 # If the EXTRACT_STATIC tag is set to YES all static members of a file
   148308 # will be included in the documentation.
   148309 EXTRACT_STATIC         = YES
   148310 _ATEOF
   148311 
   148312 
   148313 { set +x
   148314 $as_echo "$at_srcdir/c++.at:102: doxygen --version || exit 77"
   148315 at_fn_check_prepare_trace "c++.at:102"
   148316 ( $at_check_trace; doxygen --version || exit 77
   148317 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148318 at_status=$? at_failed=false
   148319 $at_check_filter
   148320 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148321 echo stdout:; cat "$at_stdout"
   148322 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148323 $at_failed && at_fn_log_failure
   148324 $at_traceon; }
   148325 
   148326 { set +x
   148327 $as_echo "$at_srcdir/c++.at:102: doxygen"
   148328 at_fn_check_prepare_trace "c++.at:102"
   148329 ( $at_check_trace; doxygen
   148330 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148331 at_status=$? at_failed=false
   148332 $at_check_filter
   148333 echo stderr:; cat "$at_stderr"
   148334 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148335 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
   148336 $at_failed && at_fn_log_failure
   148337 $at_traceon; }
   148338 
   148339 
   148340 
   148341   set +x
   148342   $at_times_p && times >"$at_times_file"
   148343 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   148344 read at_status <"$at_status_file"
   148345 #AT_STOP_302
   148346 #AT_START_303
   148347 at_fn_group_banner 303 'c++.at:160' \
   148348   "Relative namespace references" "                  " 18
   148349 at_xfail=no
   148350 (
   148351   $as_echo "303. $at_setup_line: testing $at_desc ..."
   148352   $at_traceon
   148353 
   148354 
   148355 
   148356 cat >input.y <<'_ATEOF'
   148357 %code top {
   148358 #include <config.h>
   148359 /* We don't need perfect functions for these tests. */
   148360 #undef malloc
   148361 #undef memcmp
   148362 #undef realloc
   148363 }
   148364 
   148365 %language "C++"
   148366 %defines
   148367 %define namespace "foo"
   148368 %union { int i; }
   148369 %define global_tokens_and_yystype
   148370 
   148371 %code {
   148372   // YYSTYPE contains a namespace reference.
   148373   int yylex (YYSTYPE *lval) {
   148374     lval->i = 3;
   148375     return 0;
   148376   }
   148377 }
   148378 
   148379 %%
   148380 
   148381 start: ;
   148382 
   148383 %%
   148384 
   148385 void
   148386 foo::parser::error (const foo::parser::location_type &loc,
   148387                      const std::string &msg)
   148388 {
   148389   std::cerr << "At " << loc << ": " << msg << std::endl;
   148390 }
   148391 
   148392 int
   148393 main (void)
   148394 {
   148395   foo::parser p;
   148396   return p.parse ();
   148397 }
   148398 _ATEOF
   148399 
   148400 
   148401 
   148402 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   148403   at_save_special_files
   148404   mkdir xml-tests
   148405     # Don't combine these Bison invocations since we want to be sure that
   148406   # --report=all isn't required to get the full XML file.
   148407   { set +x
   148408 $as_echo "$at_srcdir/c++.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   148409                   --graph=xml-tests/test.dot -o input.cc input.y"
   148410 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:161"
   148411 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   148412                   --graph=xml-tests/test.dot -o input.cc input.y
   148413 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148414 at_status=$? at_failed=false
   148415 $at_check_filter
   148416 echo stderr:; cat "$at_stderr"
   148417 echo stdout:; cat "$at_stdout"
   148418 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148419 $at_failed && at_fn_log_failure
   148420 $at_traceon; }
   148421 
   148422   { set +x
   148423 $as_echo "$at_srcdir/c++.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   148424 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:161"
   148425 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   148426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148427 at_status=$? at_failed=false
   148428 $at_check_filter
   148429 echo stderr:; cat "$at_stderr"
   148430 echo stdout:; cat "$at_stdout"
   148431 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148432 $at_failed && at_fn_log_failure
   148433 $at_traceon; }
   148434 
   148435     cp xml-tests/test.output expout
   148436   { set +x
   148437 $as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\
   148438              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   148439              xml-tests/test.xml"
   148440 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161"
   148441 ( $at_check_trace; $XSLTPROC \
   148442              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   148443              xml-tests/test.xml
   148444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148445 at_status=$? at_failed=false
   148446 $at_check_filter
   148447 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148448 $at_diff expout "$at_stdout" || at_failed=:
   148449 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148450 $at_failed && at_fn_log_failure
   148451 $at_traceon; }
   148452 
   148453   sort xml-tests/test.dot > expout
   148454   { set +x
   148455 $as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\
   148456              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   148457              xml-tests/test.xml | sort"
   148458 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161"
   148459 ( $at_check_trace; $XSLTPROC \
   148460              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   148461              xml-tests/test.xml | sort
   148462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148463 at_status=$? at_failed=false
   148464 $at_check_filter
   148465 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148466 $at_diff expout "$at_stdout" || at_failed=:
   148467 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148468 $at_failed && at_fn_log_failure
   148469 $at_traceon; }
   148470 
   148471   rm -rf xml-tests expout
   148472   at_restore_special_files
   148473 fi
   148474 { set +x
   148475 $as_echo "$at_srcdir/c++.at:161: bison -o input.cc input.y"
   148476 at_fn_check_prepare_trace "c++.at:161"
   148477 ( $at_check_trace; bison -o input.cc input.y
   148478 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148479 at_status=$? at_failed=false
   148480 $at_check_filter
   148481 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148482 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148483 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148484 $at_failed && at_fn_log_failure
   148485 $at_traceon; }
   148486 
   148487 
   148488 
   148489 
   148490 { set +x
   148491 $as_echo "$at_srcdir/c++.at:161: \$BISON_CXX_WORKS"
   148492 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:161"
   148493 ( $at_check_trace; $BISON_CXX_WORKS
   148494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148495 at_status=$? at_failed=false
   148496 $at_check_filter
   148497 echo stderr:; cat "$at_stderr"
   148498 echo stdout:; cat "$at_stdout"
   148499 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148500 $at_failed && at_fn_log_failure
   148501 $at_traceon; }
   148502 
   148503 { set +x
   148504 $as_echo "$at_srcdir/c++.at:161: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   148505 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:161"
   148506 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   148507 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148508 at_status=$? at_failed=false
   148509 $at_check_filter
   148510 echo stderr:; cat "$at_stderr"
   148511 echo stdout:; cat "$at_stdout"
   148512 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148513 $at_failed && at_fn_log_failure
   148514 $at_traceon; }
   148515 
   148516 { set +x
   148517 $as_echo "$at_srcdir/c++.at:161:  \$PREPARSER ./input"
   148518 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:161"
   148519 ( $at_check_trace;  $PREPARSER ./input
   148520 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148521 at_status=$? at_failed=false
   148522 $at_check_filter
   148523 echo stderr:; tee stderr <"$at_stderr"
   148524 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148525 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148526 $at_failed && at_fn_log_failure
   148527 $at_traceon; }
   148528 
   148529 { set +x
   148530 $as_echo "$at_srcdir/c++.at:161: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   148531 at_fn_check_prepare_trace "c++.at:161"
   148532 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   148533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148534 at_status=$? at_failed=false
   148535 $at_check_filter
   148536 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148537 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148538 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
   148539 $at_failed && at_fn_log_failure
   148540 $at_traceon; }
   148541 
   148542 
   148543 
   148544 
   148545 
   148546 
   148547 cat >input.y <<'_ATEOF'
   148548 %code top {
   148549 #include <config.h>
   148550 /* We don't need perfect functions for these tests. */
   148551 #undef malloc
   148552 #undef memcmp
   148553 #undef realloc
   148554 }
   148555 
   148556 %language "C++"
   148557 %defines
   148558 %define namespace "foo::bar"
   148559 %union { int i; }
   148560 %define global_tokens_and_yystype
   148561 
   148562 %code {
   148563   // YYSTYPE contains a namespace reference.
   148564   int yylex (YYSTYPE *lval) {
   148565     lval->i = 3;
   148566     return 0;
   148567   }
   148568 }
   148569 
   148570 %%
   148571 
   148572 start: ;
   148573 
   148574 %%
   148575 
   148576 void
   148577 foo::bar::parser::error (const foo::bar::parser::location_type &loc,
   148578                      const std::string &msg)
   148579 {
   148580   std::cerr << "At " << loc << ": " << msg << std::endl;
   148581 }
   148582 
   148583 int
   148584 main (void)
   148585 {
   148586   foo::bar::parser p;
   148587   return p.parse ();
   148588 }
   148589 _ATEOF
   148590 
   148591 
   148592 
   148593 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   148594   at_save_special_files
   148595   mkdir xml-tests
   148596     # Don't combine these Bison invocations since we want to be sure that
   148597   # --report=all isn't required to get the full XML file.
   148598   { set +x
   148599 $as_echo "$at_srcdir/c++.at:162: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   148600                   --graph=xml-tests/test.dot -o input.cc input.y"
   148601 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:162"
   148602 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   148603                   --graph=xml-tests/test.dot -o input.cc input.y
   148604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148605 at_status=$? at_failed=false
   148606 $at_check_filter
   148607 echo stderr:; cat "$at_stderr"
   148608 echo stdout:; cat "$at_stdout"
   148609 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148610 $at_failed && at_fn_log_failure
   148611 $at_traceon; }
   148612 
   148613   { set +x
   148614 $as_echo "$at_srcdir/c++.at:162: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   148615 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:162"
   148616 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   148617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148618 at_status=$? at_failed=false
   148619 $at_check_filter
   148620 echo stderr:; cat "$at_stderr"
   148621 echo stdout:; cat "$at_stdout"
   148622 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148623 $at_failed && at_fn_log_failure
   148624 $at_traceon; }
   148625 
   148626     cp xml-tests/test.output expout
   148627   { set +x
   148628 $as_echo "$at_srcdir/c++.at:162: \$XSLTPROC \\
   148629              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   148630              xml-tests/test.xml"
   148631 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:162"
   148632 ( $at_check_trace; $XSLTPROC \
   148633              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   148634              xml-tests/test.xml
   148635 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148636 at_status=$? at_failed=false
   148637 $at_check_filter
   148638 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148639 $at_diff expout "$at_stdout" || at_failed=:
   148640 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148641 $at_failed && at_fn_log_failure
   148642 $at_traceon; }
   148643 
   148644   sort xml-tests/test.dot > expout
   148645   { set +x
   148646 $as_echo "$at_srcdir/c++.at:162: \$XSLTPROC \\
   148647              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   148648              xml-tests/test.xml | sort"
   148649 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:162"
   148650 ( $at_check_trace; $XSLTPROC \
   148651              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   148652              xml-tests/test.xml | sort
   148653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148654 at_status=$? at_failed=false
   148655 $at_check_filter
   148656 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148657 $at_diff expout "$at_stdout" || at_failed=:
   148658 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148659 $at_failed && at_fn_log_failure
   148660 $at_traceon; }
   148661 
   148662   rm -rf xml-tests expout
   148663   at_restore_special_files
   148664 fi
   148665 { set +x
   148666 $as_echo "$at_srcdir/c++.at:162: bison -o input.cc input.y"
   148667 at_fn_check_prepare_trace "c++.at:162"
   148668 ( $at_check_trace; bison -o input.cc input.y
   148669 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148670 at_status=$? at_failed=false
   148671 $at_check_filter
   148672 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148673 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148674 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148675 $at_failed && at_fn_log_failure
   148676 $at_traceon; }
   148677 
   148678 
   148679 
   148680 
   148681 { set +x
   148682 $as_echo "$at_srcdir/c++.at:162: \$BISON_CXX_WORKS"
   148683 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:162"
   148684 ( $at_check_trace; $BISON_CXX_WORKS
   148685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148686 at_status=$? at_failed=false
   148687 $at_check_filter
   148688 echo stderr:; cat "$at_stderr"
   148689 echo stdout:; cat "$at_stdout"
   148690 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148691 $at_failed && at_fn_log_failure
   148692 $at_traceon; }
   148693 
   148694 { set +x
   148695 $as_echo "$at_srcdir/c++.at:162: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   148696 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:162"
   148697 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   148698 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148699 at_status=$? at_failed=false
   148700 $at_check_filter
   148701 echo stderr:; cat "$at_stderr"
   148702 echo stdout:; cat "$at_stdout"
   148703 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148704 $at_failed && at_fn_log_failure
   148705 $at_traceon; }
   148706 
   148707 { set +x
   148708 $as_echo "$at_srcdir/c++.at:162:  \$PREPARSER ./input"
   148709 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:162"
   148710 ( $at_check_trace;  $PREPARSER ./input
   148711 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148712 at_status=$? at_failed=false
   148713 $at_check_filter
   148714 echo stderr:; tee stderr <"$at_stderr"
   148715 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148716 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148717 $at_failed && at_fn_log_failure
   148718 $at_traceon; }
   148719 
   148720 { set +x
   148721 $as_echo "$at_srcdir/c++.at:162: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   148722 at_fn_check_prepare_trace "c++.at:162"
   148723 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   148724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148725 at_status=$? at_failed=false
   148726 $at_check_filter
   148727 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148728 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148729 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
   148730 $at_failed && at_fn_log_failure
   148731 $at_traceon; }
   148732 
   148733 
   148734 
   148735 
   148736 
   148737 
   148738 cat >input.y <<'_ATEOF'
   148739 %code top {
   148740 #include <config.h>
   148741 /* We don't need perfect functions for these tests. */
   148742 #undef malloc
   148743 #undef memcmp
   148744 #undef realloc
   148745 }
   148746 
   148747 %language "C++"
   148748 %defines
   148749 %define namespace "foo::bar::baz"
   148750 %union { int i; }
   148751 %define global_tokens_and_yystype
   148752 
   148753 %code {
   148754   // YYSTYPE contains a namespace reference.
   148755   int yylex (YYSTYPE *lval) {
   148756     lval->i = 3;
   148757     return 0;
   148758   }
   148759 }
   148760 
   148761 %%
   148762 
   148763 start: ;
   148764 
   148765 %%
   148766 
   148767 void
   148768 foo::bar::baz::parser::error (const foo::bar::baz::parser::location_type &loc,
   148769                      const std::string &msg)
   148770 {
   148771   std::cerr << "At " << loc << ": " << msg << std::endl;
   148772 }
   148773 
   148774 int
   148775 main (void)
   148776 {
   148777   foo::bar::baz::parser p;
   148778   return p.parse ();
   148779 }
   148780 _ATEOF
   148781 
   148782 
   148783 
   148784 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   148785   at_save_special_files
   148786   mkdir xml-tests
   148787     # Don't combine these Bison invocations since we want to be sure that
   148788   # --report=all isn't required to get the full XML file.
   148789   { set +x
   148790 $as_echo "$at_srcdir/c++.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   148791                   --graph=xml-tests/test.dot -o input.cc input.y"
   148792 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:163"
   148793 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   148794                   --graph=xml-tests/test.dot -o input.cc input.y
   148795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148796 at_status=$? at_failed=false
   148797 $at_check_filter
   148798 echo stderr:; cat "$at_stderr"
   148799 echo stdout:; cat "$at_stdout"
   148800 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148801 $at_failed && at_fn_log_failure
   148802 $at_traceon; }
   148803 
   148804   { set +x
   148805 $as_echo "$at_srcdir/c++.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   148806 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:163"
   148807 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   148808 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148809 at_status=$? at_failed=false
   148810 $at_check_filter
   148811 echo stderr:; cat "$at_stderr"
   148812 echo stdout:; cat "$at_stdout"
   148813 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148814 $at_failed && at_fn_log_failure
   148815 $at_traceon; }
   148816 
   148817     cp xml-tests/test.output expout
   148818   { set +x
   148819 $as_echo "$at_srcdir/c++.at:163: \$XSLTPROC \\
   148820              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   148821              xml-tests/test.xml"
   148822 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:163"
   148823 ( $at_check_trace; $XSLTPROC \
   148824              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   148825              xml-tests/test.xml
   148826 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148827 at_status=$? at_failed=false
   148828 $at_check_filter
   148829 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148830 $at_diff expout "$at_stdout" || at_failed=:
   148831 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148832 $at_failed && at_fn_log_failure
   148833 $at_traceon; }
   148834 
   148835   sort xml-tests/test.dot > expout
   148836   { set +x
   148837 $as_echo "$at_srcdir/c++.at:163: \$XSLTPROC \\
   148838              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   148839              xml-tests/test.xml | sort"
   148840 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:163"
   148841 ( $at_check_trace; $XSLTPROC \
   148842              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   148843              xml-tests/test.xml | sort
   148844 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148845 at_status=$? at_failed=false
   148846 $at_check_filter
   148847 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148848 $at_diff expout "$at_stdout" || at_failed=:
   148849 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148850 $at_failed && at_fn_log_failure
   148851 $at_traceon; }
   148852 
   148853   rm -rf xml-tests expout
   148854   at_restore_special_files
   148855 fi
   148856 { set +x
   148857 $as_echo "$at_srcdir/c++.at:163: bison -o input.cc input.y"
   148858 at_fn_check_prepare_trace "c++.at:163"
   148859 ( $at_check_trace; bison -o input.cc input.y
   148860 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148861 at_status=$? at_failed=false
   148862 $at_check_filter
   148863 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148864 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148865 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148866 $at_failed && at_fn_log_failure
   148867 $at_traceon; }
   148868 
   148869 
   148870 
   148871 
   148872 { set +x
   148873 $as_echo "$at_srcdir/c++.at:163: \$BISON_CXX_WORKS"
   148874 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:163"
   148875 ( $at_check_trace; $BISON_CXX_WORKS
   148876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148877 at_status=$? at_failed=false
   148878 $at_check_filter
   148879 echo stderr:; cat "$at_stderr"
   148880 echo stdout:; cat "$at_stdout"
   148881 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148882 $at_failed && at_fn_log_failure
   148883 $at_traceon; }
   148884 
   148885 { set +x
   148886 $as_echo "$at_srcdir/c++.at:163: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   148887 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:163"
   148888 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   148889 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148890 at_status=$? at_failed=false
   148891 $at_check_filter
   148892 echo stderr:; cat "$at_stderr"
   148893 echo stdout:; cat "$at_stdout"
   148894 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148895 $at_failed && at_fn_log_failure
   148896 $at_traceon; }
   148897 
   148898 { set +x
   148899 $as_echo "$at_srcdir/c++.at:163:  \$PREPARSER ./input"
   148900 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:163"
   148901 ( $at_check_trace;  $PREPARSER ./input
   148902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148903 at_status=$? at_failed=false
   148904 $at_check_filter
   148905 echo stderr:; tee stderr <"$at_stderr"
   148906 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148907 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148908 $at_failed && at_fn_log_failure
   148909 $at_traceon; }
   148910 
   148911 { set +x
   148912 $as_echo "$at_srcdir/c++.at:163: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   148913 at_fn_check_prepare_trace "c++.at:163"
   148914 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   148915 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   148916 at_status=$? at_failed=false
   148917 $at_check_filter
   148918 at_fn_diff_devnull "$at_stderr" || at_failed=:
   148919 at_fn_diff_devnull "$at_stdout" || at_failed=:
   148920 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
   148921 $at_failed && at_fn_log_failure
   148922 $at_traceon; }
   148923 
   148924 
   148925 
   148926 
   148927   set +x
   148928   $at_times_p && times >"$at_times_file"
   148929 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   148930 read at_status <"$at_status_file"
   148931 #AT_STOP_303
   148932 #AT_START_304
   148933 at_fn_group_banner 304 'c++.at:166' \
   148934   "Absolute namespace references" "                  " 18
   148935 at_xfail=no
   148936 (
   148937   $as_echo "304. $at_setup_line: testing $at_desc ..."
   148938   $at_traceon
   148939 
   148940 
   148941 
   148942 cat >input.y <<'_ATEOF'
   148943 %code top {
   148944 #include <config.h>
   148945 /* We don't need perfect functions for these tests. */
   148946 #undef malloc
   148947 #undef memcmp
   148948 #undef realloc
   148949 }
   148950 
   148951 %language "C++"
   148952 %defines
   148953 %define namespace "::foo"
   148954 %union { int i; }
   148955 %define global_tokens_and_yystype
   148956 
   148957 %code {
   148958   // YYSTYPE contains a namespace reference.
   148959   int yylex (YYSTYPE *lval) {
   148960     lval->i = 3;
   148961     return 0;
   148962   }
   148963 }
   148964 
   148965 %%
   148966 
   148967 start: ;
   148968 
   148969 %%
   148970 
   148971 void
   148972 ::foo::parser::error (const ::foo::parser::location_type &loc,
   148973                      const std::string &msg)
   148974 {
   148975   std::cerr << "At " << loc << ": " << msg << std::endl;
   148976 }
   148977 
   148978 int
   148979 main (void)
   148980 {
   148981   ::foo::parser p;
   148982   return p.parse ();
   148983 }
   148984 _ATEOF
   148985 
   148986 
   148987 
   148988 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   148989   at_save_special_files
   148990   mkdir xml-tests
   148991     # Don't combine these Bison invocations since we want to be sure that
   148992   # --report=all isn't required to get the full XML file.
   148993   { set +x
   148994 $as_echo "$at_srcdir/c++.at:167: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   148995                   --graph=xml-tests/test.dot -o input.cc input.y"
   148996 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:167"
   148997 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   148998                   --graph=xml-tests/test.dot -o input.cc input.y
   148999 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149000 at_status=$? at_failed=false
   149001 $at_check_filter
   149002 echo stderr:; cat "$at_stderr"
   149003 echo stdout:; cat "$at_stdout"
   149004 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149005 $at_failed && at_fn_log_failure
   149006 $at_traceon; }
   149007 
   149008   { set +x
   149009 $as_echo "$at_srcdir/c++.at:167: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   149010 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:167"
   149011 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   149012 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149013 at_status=$? at_failed=false
   149014 $at_check_filter
   149015 echo stderr:; cat "$at_stderr"
   149016 echo stdout:; cat "$at_stdout"
   149017 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149018 $at_failed && at_fn_log_failure
   149019 $at_traceon; }
   149020 
   149021     cp xml-tests/test.output expout
   149022   { set +x
   149023 $as_echo "$at_srcdir/c++.at:167: \$XSLTPROC \\
   149024              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   149025              xml-tests/test.xml"
   149026 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:167"
   149027 ( $at_check_trace; $XSLTPROC \
   149028              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   149029              xml-tests/test.xml
   149030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149031 at_status=$? at_failed=false
   149032 $at_check_filter
   149033 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149034 $at_diff expout "$at_stdout" || at_failed=:
   149035 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149036 $at_failed && at_fn_log_failure
   149037 $at_traceon; }
   149038 
   149039   sort xml-tests/test.dot > expout
   149040   { set +x
   149041 $as_echo "$at_srcdir/c++.at:167: \$XSLTPROC \\
   149042              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   149043              xml-tests/test.xml | sort"
   149044 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:167"
   149045 ( $at_check_trace; $XSLTPROC \
   149046              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   149047              xml-tests/test.xml | sort
   149048 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149049 at_status=$? at_failed=false
   149050 $at_check_filter
   149051 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149052 $at_diff expout "$at_stdout" || at_failed=:
   149053 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149054 $at_failed && at_fn_log_failure
   149055 $at_traceon; }
   149056 
   149057   rm -rf xml-tests expout
   149058   at_restore_special_files
   149059 fi
   149060 { set +x
   149061 $as_echo "$at_srcdir/c++.at:167: bison -o input.cc input.y"
   149062 at_fn_check_prepare_trace "c++.at:167"
   149063 ( $at_check_trace; bison -o input.cc input.y
   149064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149065 at_status=$? at_failed=false
   149066 $at_check_filter
   149067 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149068 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149069 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149070 $at_failed && at_fn_log_failure
   149071 $at_traceon; }
   149072 
   149073 
   149074 
   149075 
   149076 { set +x
   149077 $as_echo "$at_srcdir/c++.at:167: \$BISON_CXX_WORKS"
   149078 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:167"
   149079 ( $at_check_trace; $BISON_CXX_WORKS
   149080 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149081 at_status=$? at_failed=false
   149082 $at_check_filter
   149083 echo stderr:; cat "$at_stderr"
   149084 echo stdout:; cat "$at_stdout"
   149085 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149086 $at_failed && at_fn_log_failure
   149087 $at_traceon; }
   149088 
   149089 { set +x
   149090 $as_echo "$at_srcdir/c++.at:167: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   149091 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:167"
   149092 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   149093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149094 at_status=$? at_failed=false
   149095 $at_check_filter
   149096 echo stderr:; cat "$at_stderr"
   149097 echo stdout:; cat "$at_stdout"
   149098 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149099 $at_failed && at_fn_log_failure
   149100 $at_traceon; }
   149101 
   149102 { set +x
   149103 $as_echo "$at_srcdir/c++.at:167:  \$PREPARSER ./input"
   149104 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:167"
   149105 ( $at_check_trace;  $PREPARSER ./input
   149106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149107 at_status=$? at_failed=false
   149108 $at_check_filter
   149109 echo stderr:; tee stderr <"$at_stderr"
   149110 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149111 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149112 $at_failed && at_fn_log_failure
   149113 $at_traceon; }
   149114 
   149115 { set +x
   149116 $as_echo "$at_srcdir/c++.at:167: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   149117 at_fn_check_prepare_trace "c++.at:167"
   149118 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   149119 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149120 at_status=$? at_failed=false
   149121 $at_check_filter
   149122 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149123 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149124 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
   149125 $at_failed && at_fn_log_failure
   149126 $at_traceon; }
   149127 
   149128 
   149129 
   149130 
   149131 
   149132 
   149133 cat >input.y <<'_ATEOF'
   149134 %code top {
   149135 #include <config.h>
   149136 /* We don't need perfect functions for these tests. */
   149137 #undef malloc
   149138 #undef memcmp
   149139 #undef realloc
   149140 }
   149141 
   149142 %language "C++"
   149143 %defines
   149144 %define namespace "::foo::bar"
   149145 %union { int i; }
   149146 %define global_tokens_and_yystype
   149147 
   149148 %code {
   149149   // YYSTYPE contains a namespace reference.
   149150   int yylex (YYSTYPE *lval) {
   149151     lval->i = 3;
   149152     return 0;
   149153   }
   149154 }
   149155 
   149156 %%
   149157 
   149158 start: ;
   149159 
   149160 %%
   149161 
   149162 void
   149163 ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc,
   149164                      const std::string &msg)
   149165 {
   149166   std::cerr << "At " << loc << ": " << msg << std::endl;
   149167 }
   149168 
   149169 int
   149170 main (void)
   149171 {
   149172   ::foo::bar::parser p;
   149173   return p.parse ();
   149174 }
   149175 _ATEOF
   149176 
   149177 
   149178 
   149179 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   149180   at_save_special_files
   149181   mkdir xml-tests
   149182     # Don't combine these Bison invocations since we want to be sure that
   149183   # --report=all isn't required to get the full XML file.
   149184   { set +x
   149185 $as_echo "$at_srcdir/c++.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   149186                   --graph=xml-tests/test.dot -o input.cc input.y"
   149187 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:168"
   149188 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   149189                   --graph=xml-tests/test.dot -o input.cc input.y
   149190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149191 at_status=$? at_failed=false
   149192 $at_check_filter
   149193 echo stderr:; cat "$at_stderr"
   149194 echo stdout:; cat "$at_stdout"
   149195 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149196 $at_failed && at_fn_log_failure
   149197 $at_traceon; }
   149198 
   149199   { set +x
   149200 $as_echo "$at_srcdir/c++.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   149201 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:168"
   149202 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   149203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149204 at_status=$? at_failed=false
   149205 $at_check_filter
   149206 echo stderr:; cat "$at_stderr"
   149207 echo stdout:; cat "$at_stdout"
   149208 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149209 $at_failed && at_fn_log_failure
   149210 $at_traceon; }
   149211 
   149212     cp xml-tests/test.output expout
   149213   { set +x
   149214 $as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\
   149215              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   149216              xml-tests/test.xml"
   149217 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168"
   149218 ( $at_check_trace; $XSLTPROC \
   149219              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   149220              xml-tests/test.xml
   149221 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149222 at_status=$? at_failed=false
   149223 $at_check_filter
   149224 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149225 $at_diff expout "$at_stdout" || at_failed=:
   149226 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149227 $at_failed && at_fn_log_failure
   149228 $at_traceon; }
   149229 
   149230   sort xml-tests/test.dot > expout
   149231   { set +x
   149232 $as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\
   149233              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   149234              xml-tests/test.xml | sort"
   149235 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168"
   149236 ( $at_check_trace; $XSLTPROC \
   149237              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   149238              xml-tests/test.xml | sort
   149239 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149240 at_status=$? at_failed=false
   149241 $at_check_filter
   149242 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149243 $at_diff expout "$at_stdout" || at_failed=:
   149244 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149245 $at_failed && at_fn_log_failure
   149246 $at_traceon; }
   149247 
   149248   rm -rf xml-tests expout
   149249   at_restore_special_files
   149250 fi
   149251 { set +x
   149252 $as_echo "$at_srcdir/c++.at:168: bison -o input.cc input.y"
   149253 at_fn_check_prepare_trace "c++.at:168"
   149254 ( $at_check_trace; bison -o input.cc input.y
   149255 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149256 at_status=$? at_failed=false
   149257 $at_check_filter
   149258 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149259 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149260 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149261 $at_failed && at_fn_log_failure
   149262 $at_traceon; }
   149263 
   149264 
   149265 
   149266 
   149267 { set +x
   149268 $as_echo "$at_srcdir/c++.at:168: \$BISON_CXX_WORKS"
   149269 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:168"
   149270 ( $at_check_trace; $BISON_CXX_WORKS
   149271 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149272 at_status=$? at_failed=false
   149273 $at_check_filter
   149274 echo stderr:; cat "$at_stderr"
   149275 echo stdout:; cat "$at_stdout"
   149276 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149277 $at_failed && at_fn_log_failure
   149278 $at_traceon; }
   149279 
   149280 { set +x
   149281 $as_echo "$at_srcdir/c++.at:168: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   149282 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:168"
   149283 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   149284 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149285 at_status=$? at_failed=false
   149286 $at_check_filter
   149287 echo stderr:; cat "$at_stderr"
   149288 echo stdout:; cat "$at_stdout"
   149289 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149290 $at_failed && at_fn_log_failure
   149291 $at_traceon; }
   149292 
   149293 { set +x
   149294 $as_echo "$at_srcdir/c++.at:168:  \$PREPARSER ./input"
   149295 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:168"
   149296 ( $at_check_trace;  $PREPARSER ./input
   149297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149298 at_status=$? at_failed=false
   149299 $at_check_filter
   149300 echo stderr:; tee stderr <"$at_stderr"
   149301 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149302 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149303 $at_failed && at_fn_log_failure
   149304 $at_traceon; }
   149305 
   149306 { set +x
   149307 $as_echo "$at_srcdir/c++.at:168: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   149308 at_fn_check_prepare_trace "c++.at:168"
   149309 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   149310 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149311 at_status=$? at_failed=false
   149312 $at_check_filter
   149313 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149314 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149315 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
   149316 $at_failed && at_fn_log_failure
   149317 $at_traceon; }
   149318 
   149319 
   149320 
   149321 
   149322 
   149323 
   149324 cat >input.y <<'_ATEOF'
   149325 %code top {
   149326 #include <config.h>
   149327 /* We don't need perfect functions for these tests. */
   149328 #undef malloc
   149329 #undef memcmp
   149330 #undef realloc
   149331 }
   149332 
   149333 %language "C++"
   149334 %defines
   149335 %define namespace "::foo::bar::baz"
   149336 %union { int i; }
   149337 %define global_tokens_and_yystype
   149338 
   149339 %code {
   149340   // YYSTYPE contains a namespace reference.
   149341   int yylex (YYSTYPE *lval) {
   149342     lval->i = 3;
   149343     return 0;
   149344   }
   149345 }
   149346 
   149347 %%
   149348 
   149349 start: ;
   149350 
   149351 %%
   149352 
   149353 void
   149354 ::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc,
   149355                      const std::string &msg)
   149356 {
   149357   std::cerr << "At " << loc << ": " << msg << std::endl;
   149358 }
   149359 
   149360 int
   149361 main (void)
   149362 {
   149363   ::foo::bar::baz::parser p;
   149364   return p.parse ();
   149365 }
   149366 _ATEOF
   149367 
   149368 
   149369 
   149370 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   149371   at_save_special_files
   149372   mkdir xml-tests
   149373     # Don't combine these Bison invocations since we want to be sure that
   149374   # --report=all isn't required to get the full XML file.
   149375   { set +x
   149376 $as_echo "$at_srcdir/c++.at:169: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   149377                   --graph=xml-tests/test.dot -o input.cc input.y"
   149378 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:169"
   149379 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   149380                   --graph=xml-tests/test.dot -o input.cc input.y
   149381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149382 at_status=$? at_failed=false
   149383 $at_check_filter
   149384 echo stderr:; cat "$at_stderr"
   149385 echo stdout:; cat "$at_stdout"
   149386 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149387 $at_failed && at_fn_log_failure
   149388 $at_traceon; }
   149389 
   149390   { set +x
   149391 $as_echo "$at_srcdir/c++.at:169: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   149392 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:169"
   149393 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   149394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149395 at_status=$? at_failed=false
   149396 $at_check_filter
   149397 echo stderr:; cat "$at_stderr"
   149398 echo stdout:; cat "$at_stdout"
   149399 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149400 $at_failed && at_fn_log_failure
   149401 $at_traceon; }
   149402 
   149403     cp xml-tests/test.output expout
   149404   { set +x
   149405 $as_echo "$at_srcdir/c++.at:169: \$XSLTPROC \\
   149406              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   149407              xml-tests/test.xml"
   149408 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:169"
   149409 ( $at_check_trace; $XSLTPROC \
   149410              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   149411              xml-tests/test.xml
   149412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149413 at_status=$? at_failed=false
   149414 $at_check_filter
   149415 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149416 $at_diff expout "$at_stdout" || at_failed=:
   149417 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149418 $at_failed && at_fn_log_failure
   149419 $at_traceon; }
   149420 
   149421   sort xml-tests/test.dot > expout
   149422   { set +x
   149423 $as_echo "$at_srcdir/c++.at:169: \$XSLTPROC \\
   149424              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   149425              xml-tests/test.xml | sort"
   149426 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:169"
   149427 ( $at_check_trace; $XSLTPROC \
   149428              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   149429              xml-tests/test.xml | sort
   149430 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149431 at_status=$? at_failed=false
   149432 $at_check_filter
   149433 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149434 $at_diff expout "$at_stdout" || at_failed=:
   149435 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149436 $at_failed && at_fn_log_failure
   149437 $at_traceon; }
   149438 
   149439   rm -rf xml-tests expout
   149440   at_restore_special_files
   149441 fi
   149442 { set +x
   149443 $as_echo "$at_srcdir/c++.at:169: bison -o input.cc input.y"
   149444 at_fn_check_prepare_trace "c++.at:169"
   149445 ( $at_check_trace; bison -o input.cc input.y
   149446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149447 at_status=$? at_failed=false
   149448 $at_check_filter
   149449 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149450 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149451 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149452 $at_failed && at_fn_log_failure
   149453 $at_traceon; }
   149454 
   149455 
   149456 
   149457 
   149458 { set +x
   149459 $as_echo "$at_srcdir/c++.at:169: \$BISON_CXX_WORKS"
   149460 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:169"
   149461 ( $at_check_trace; $BISON_CXX_WORKS
   149462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149463 at_status=$? at_failed=false
   149464 $at_check_filter
   149465 echo stderr:; cat "$at_stderr"
   149466 echo stdout:; cat "$at_stdout"
   149467 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149468 $at_failed && at_fn_log_failure
   149469 $at_traceon; }
   149470 
   149471 { set +x
   149472 $as_echo "$at_srcdir/c++.at:169: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   149473 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:169"
   149474 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   149475 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149476 at_status=$? at_failed=false
   149477 $at_check_filter
   149478 echo stderr:; cat "$at_stderr"
   149479 echo stdout:; cat "$at_stdout"
   149480 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149481 $at_failed && at_fn_log_failure
   149482 $at_traceon; }
   149483 
   149484 { set +x
   149485 $as_echo "$at_srcdir/c++.at:169:  \$PREPARSER ./input"
   149486 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:169"
   149487 ( $at_check_trace;  $PREPARSER ./input
   149488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149489 at_status=$? at_failed=false
   149490 $at_check_filter
   149491 echo stderr:; tee stderr <"$at_stderr"
   149492 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149493 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149494 $at_failed && at_fn_log_failure
   149495 $at_traceon; }
   149496 
   149497 { set +x
   149498 $as_echo "$at_srcdir/c++.at:169: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   149499 at_fn_check_prepare_trace "c++.at:169"
   149500 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   149501 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149502 at_status=$? at_failed=false
   149503 $at_check_filter
   149504 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149505 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149506 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
   149507 $at_failed && at_fn_log_failure
   149508 $at_traceon; }
   149509 
   149510 
   149511 
   149512 
   149513 
   149514 
   149515 cat >input.y <<'_ATEOF'
   149516 %code top {
   149517 #include <config.h>
   149518 /* We don't need perfect functions for these tests. */
   149519 #undef malloc
   149520 #undef memcmp
   149521 #undef realloc
   149522 }
   149523 
   149524 %language "C++"
   149525 %defines
   149526 %define namespace "	::foo"
   149527 %union { int i; }
   149528 %define global_tokens_and_yystype
   149529 
   149530 %code {
   149531   // YYSTYPE contains a namespace reference.
   149532   int yylex (YYSTYPE *lval) {
   149533     lval->i = 3;
   149534     return 0;
   149535   }
   149536 }
   149537 
   149538 %%
   149539 
   149540 start: ;
   149541 
   149542 %%
   149543 
   149544 void
   149545 	::foo::parser::error (const 	::foo::parser::location_type &loc,
   149546                      const std::string &msg)
   149547 {
   149548   std::cerr << "At " << loc << ": " << msg << std::endl;
   149549 }
   149550 
   149551 int
   149552 main (void)
   149553 {
   149554   	::foo::parser p;
   149555   return p.parse ();
   149556 }
   149557 _ATEOF
   149558 
   149559 
   149560 
   149561 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   149562   at_save_special_files
   149563   mkdir xml-tests
   149564     # Don't combine these Bison invocations since we want to be sure that
   149565   # --report=all isn't required to get the full XML file.
   149566   { set +x
   149567 $as_echo "$at_srcdir/c++.at:170: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   149568                   --graph=xml-tests/test.dot -o input.cc input.y"
   149569 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:170"
   149570 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   149571                   --graph=xml-tests/test.dot -o input.cc input.y
   149572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149573 at_status=$? at_failed=false
   149574 $at_check_filter
   149575 echo stderr:; cat "$at_stderr"
   149576 echo stdout:; cat "$at_stdout"
   149577 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149578 $at_failed && at_fn_log_failure
   149579 $at_traceon; }
   149580 
   149581   { set +x
   149582 $as_echo "$at_srcdir/c++.at:170: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   149583 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:170"
   149584 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   149585 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149586 at_status=$? at_failed=false
   149587 $at_check_filter
   149588 echo stderr:; cat "$at_stderr"
   149589 echo stdout:; cat "$at_stdout"
   149590 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149591 $at_failed && at_fn_log_failure
   149592 $at_traceon; }
   149593 
   149594     cp xml-tests/test.output expout
   149595   { set +x
   149596 $as_echo "$at_srcdir/c++.at:170: \$XSLTPROC \\
   149597              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   149598              xml-tests/test.xml"
   149599 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:170"
   149600 ( $at_check_trace; $XSLTPROC \
   149601              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   149602              xml-tests/test.xml
   149603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149604 at_status=$? at_failed=false
   149605 $at_check_filter
   149606 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149607 $at_diff expout "$at_stdout" || at_failed=:
   149608 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149609 $at_failed && at_fn_log_failure
   149610 $at_traceon; }
   149611 
   149612   sort xml-tests/test.dot > expout
   149613   { set +x
   149614 $as_echo "$at_srcdir/c++.at:170: \$XSLTPROC \\
   149615              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   149616              xml-tests/test.xml | sort"
   149617 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:170"
   149618 ( $at_check_trace; $XSLTPROC \
   149619              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   149620              xml-tests/test.xml | sort
   149621 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149622 at_status=$? at_failed=false
   149623 $at_check_filter
   149624 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149625 $at_diff expout "$at_stdout" || at_failed=:
   149626 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149627 $at_failed && at_fn_log_failure
   149628 $at_traceon; }
   149629 
   149630   rm -rf xml-tests expout
   149631   at_restore_special_files
   149632 fi
   149633 { set +x
   149634 $as_echo "$at_srcdir/c++.at:170: bison -o input.cc input.y"
   149635 at_fn_check_prepare_trace "c++.at:170"
   149636 ( $at_check_trace; bison -o input.cc input.y
   149637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149638 at_status=$? at_failed=false
   149639 $at_check_filter
   149640 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149641 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149642 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149643 $at_failed && at_fn_log_failure
   149644 $at_traceon; }
   149645 
   149646 
   149647 
   149648 
   149649 { set +x
   149650 $as_echo "$at_srcdir/c++.at:170: \$BISON_CXX_WORKS"
   149651 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:170"
   149652 ( $at_check_trace; $BISON_CXX_WORKS
   149653 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149654 at_status=$? at_failed=false
   149655 $at_check_filter
   149656 echo stderr:; cat "$at_stderr"
   149657 echo stdout:; cat "$at_stdout"
   149658 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149659 $at_failed && at_fn_log_failure
   149660 $at_traceon; }
   149661 
   149662 { set +x
   149663 $as_echo "$at_srcdir/c++.at:170: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   149664 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:170"
   149665 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   149666 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149667 at_status=$? at_failed=false
   149668 $at_check_filter
   149669 echo stderr:; cat "$at_stderr"
   149670 echo stdout:; cat "$at_stdout"
   149671 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149672 $at_failed && at_fn_log_failure
   149673 $at_traceon; }
   149674 
   149675 { set +x
   149676 $as_echo "$at_srcdir/c++.at:170:  \$PREPARSER ./input"
   149677 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:170"
   149678 ( $at_check_trace;  $PREPARSER ./input
   149679 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149680 at_status=$? at_failed=false
   149681 $at_check_filter
   149682 echo stderr:; tee stderr <"$at_stderr"
   149683 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149684 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149685 $at_failed && at_fn_log_failure
   149686 $at_traceon; }
   149687 
   149688 { set +x
   149689 $as_echo "$at_srcdir/c++.at:170: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   149690 at_fn_check_prepare_trace "c++.at:170"
   149691 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   149692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149693 at_status=$? at_failed=false
   149694 $at_check_filter
   149695 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149696 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149697 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
   149698 $at_failed && at_fn_log_failure
   149699 $at_traceon; }
   149700 
   149701 
   149702 
   149703 
   149704 
   149705 
   149706 cat >input.y <<'_ATEOF'
   149707 %code top {
   149708 #include <config.h>
   149709 /* We don't need perfect functions for these tests. */
   149710 #undef malloc
   149711 #undef memcmp
   149712 #undef realloc
   149713 }
   149714 
   149715 %language "C++"
   149716 %defines
   149717 %define namespace "  	 ::foo::bar"
   149718 %union { int i; }
   149719 %define global_tokens_and_yystype
   149720 
   149721 %code {
   149722   // YYSTYPE contains a namespace reference.
   149723   int yylex (YYSTYPE *lval) {
   149724     lval->i = 3;
   149725     return 0;
   149726   }
   149727 }
   149728 
   149729 %%
   149730 
   149731 start: ;
   149732 
   149733 %%
   149734 
   149735 void
   149736   	 ::foo::bar::parser::error (const   	 ::foo::bar::parser::location_type &loc,
   149737                      const std::string &msg)
   149738 {
   149739   std::cerr << "At " << loc << ": " << msg << std::endl;
   149740 }
   149741 
   149742 int
   149743 main (void)
   149744 {
   149745     	 ::foo::bar::parser p;
   149746   return p.parse ();
   149747 }
   149748 _ATEOF
   149749 
   149750 
   149751 
   149752 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   149753   at_save_special_files
   149754   mkdir xml-tests
   149755     # Don't combine these Bison invocations since we want to be sure that
   149756   # --report=all isn't required to get the full XML file.
   149757   { set +x
   149758 $as_echo "$at_srcdir/c++.at:171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   149759                   --graph=xml-tests/test.dot -o input.cc input.y"
   149760 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:171"
   149761 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   149762                   --graph=xml-tests/test.dot -o input.cc input.y
   149763 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149764 at_status=$? at_failed=false
   149765 $at_check_filter
   149766 echo stderr:; cat "$at_stderr"
   149767 echo stdout:; cat "$at_stdout"
   149768 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149769 $at_failed && at_fn_log_failure
   149770 $at_traceon; }
   149771 
   149772   { set +x
   149773 $as_echo "$at_srcdir/c++.at:171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   149774 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:171"
   149775 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   149776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149777 at_status=$? at_failed=false
   149778 $at_check_filter
   149779 echo stderr:; cat "$at_stderr"
   149780 echo stdout:; cat "$at_stdout"
   149781 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149782 $at_failed && at_fn_log_failure
   149783 $at_traceon; }
   149784 
   149785     cp xml-tests/test.output expout
   149786   { set +x
   149787 $as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\
   149788              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   149789              xml-tests/test.xml"
   149790 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171"
   149791 ( $at_check_trace; $XSLTPROC \
   149792              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   149793              xml-tests/test.xml
   149794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149795 at_status=$? at_failed=false
   149796 $at_check_filter
   149797 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149798 $at_diff expout "$at_stdout" || at_failed=:
   149799 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149800 $at_failed && at_fn_log_failure
   149801 $at_traceon; }
   149802 
   149803   sort xml-tests/test.dot > expout
   149804   { set +x
   149805 $as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\
   149806              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   149807              xml-tests/test.xml | sort"
   149808 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171"
   149809 ( $at_check_trace; $XSLTPROC \
   149810              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   149811              xml-tests/test.xml | sort
   149812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149813 at_status=$? at_failed=false
   149814 $at_check_filter
   149815 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149816 $at_diff expout "$at_stdout" || at_failed=:
   149817 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149818 $at_failed && at_fn_log_failure
   149819 $at_traceon; }
   149820 
   149821   rm -rf xml-tests expout
   149822   at_restore_special_files
   149823 fi
   149824 { set +x
   149825 $as_echo "$at_srcdir/c++.at:171: bison -o input.cc input.y"
   149826 at_fn_check_prepare_trace "c++.at:171"
   149827 ( $at_check_trace; bison -o input.cc input.y
   149828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149829 at_status=$? at_failed=false
   149830 $at_check_filter
   149831 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149832 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149833 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149834 $at_failed && at_fn_log_failure
   149835 $at_traceon; }
   149836 
   149837 
   149838 
   149839 
   149840 { set +x
   149841 $as_echo "$at_srcdir/c++.at:171: \$BISON_CXX_WORKS"
   149842 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:171"
   149843 ( $at_check_trace; $BISON_CXX_WORKS
   149844 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149845 at_status=$? at_failed=false
   149846 $at_check_filter
   149847 echo stderr:; cat "$at_stderr"
   149848 echo stdout:; cat "$at_stdout"
   149849 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149850 $at_failed && at_fn_log_failure
   149851 $at_traceon; }
   149852 
   149853 { set +x
   149854 $as_echo "$at_srcdir/c++.at:171: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   149855 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:171"
   149856 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   149857 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149858 at_status=$? at_failed=false
   149859 $at_check_filter
   149860 echo stderr:; cat "$at_stderr"
   149861 echo stdout:; cat "$at_stdout"
   149862 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149863 $at_failed && at_fn_log_failure
   149864 $at_traceon; }
   149865 
   149866 { set +x
   149867 $as_echo "$at_srcdir/c++.at:171:  \$PREPARSER ./input"
   149868 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:171"
   149869 ( $at_check_trace;  $PREPARSER ./input
   149870 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149871 at_status=$? at_failed=false
   149872 $at_check_filter
   149873 echo stderr:; tee stderr <"$at_stderr"
   149874 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149875 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149876 $at_failed && at_fn_log_failure
   149877 $at_traceon; }
   149878 
   149879 { set +x
   149880 $as_echo "$at_srcdir/c++.at:171: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   149881 at_fn_check_prepare_trace "c++.at:171"
   149882 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   149883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149884 at_status=$? at_failed=false
   149885 $at_check_filter
   149886 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149887 at_fn_diff_devnull "$at_stdout" || at_failed=:
   149888 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
   149889 $at_failed && at_fn_log_failure
   149890 $at_traceon; }
   149891 
   149892 
   149893 
   149894 
   149895 
   149896 
   149897 cat >input.y <<'_ATEOF'
   149898 %code top {
   149899 #include <config.h>
   149900 /* We don't need perfect functions for these tests. */
   149901 #undef malloc
   149902 #undef memcmp
   149903 #undef realloc
   149904 }
   149905 
   149906 %language "C++"
   149907 %defines
   149908 %define namespace "  ::foo::bar::baz"
   149909 %union { int i; }
   149910 %define global_tokens_and_yystype
   149911 
   149912 %code {
   149913   // YYSTYPE contains a namespace reference.
   149914   int yylex (YYSTYPE *lval) {
   149915     lval->i = 3;
   149916     return 0;
   149917   }
   149918 }
   149919 
   149920 %%
   149921 
   149922 start: ;
   149923 
   149924 %%
   149925 
   149926 void
   149927   ::foo::bar::baz::parser::error (const   ::foo::bar::baz::parser::location_type &loc,
   149928                      const std::string &msg)
   149929 {
   149930   std::cerr << "At " << loc << ": " << msg << std::endl;
   149931 }
   149932 
   149933 int
   149934 main (void)
   149935 {
   149936     ::foo::bar::baz::parser p;
   149937   return p.parse ();
   149938 }
   149939 _ATEOF
   149940 
   149941 
   149942 
   149943 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   149944   at_save_special_files
   149945   mkdir xml-tests
   149946     # Don't combine these Bison invocations since we want to be sure that
   149947   # --report=all isn't required to get the full XML file.
   149948   { set +x
   149949 $as_echo "$at_srcdir/c++.at:172: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   149950                   --graph=xml-tests/test.dot -o input.cc input.y"
   149951 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:172"
   149952 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   149953                   --graph=xml-tests/test.dot -o input.cc input.y
   149954 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149955 at_status=$? at_failed=false
   149956 $at_check_filter
   149957 echo stderr:; cat "$at_stderr"
   149958 echo stdout:; cat "$at_stdout"
   149959 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   149960 $at_failed && at_fn_log_failure
   149961 $at_traceon; }
   149962 
   149963   { set +x
   149964 $as_echo "$at_srcdir/c++.at:172: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   149965 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:172"
   149966 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   149967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149968 at_status=$? at_failed=false
   149969 $at_check_filter
   149970 echo stderr:; cat "$at_stderr"
   149971 echo stdout:; cat "$at_stdout"
   149972 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   149973 $at_failed && at_fn_log_failure
   149974 $at_traceon; }
   149975 
   149976     cp xml-tests/test.output expout
   149977   { set +x
   149978 $as_echo "$at_srcdir/c++.at:172: \$XSLTPROC \\
   149979              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   149980              xml-tests/test.xml"
   149981 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:172"
   149982 ( $at_check_trace; $XSLTPROC \
   149983              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   149984              xml-tests/test.xml
   149985 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   149986 at_status=$? at_failed=false
   149987 $at_check_filter
   149988 at_fn_diff_devnull "$at_stderr" || at_failed=:
   149989 $at_diff expout "$at_stdout" || at_failed=:
   149990 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   149991 $at_failed && at_fn_log_failure
   149992 $at_traceon; }
   149993 
   149994   sort xml-tests/test.dot > expout
   149995   { set +x
   149996 $as_echo "$at_srcdir/c++.at:172: \$XSLTPROC \\
   149997              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   149998              xml-tests/test.xml | sort"
   149999 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:172"
   150000 ( $at_check_trace; $XSLTPROC \
   150001              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   150002              xml-tests/test.xml | sort
   150003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150004 at_status=$? at_failed=false
   150005 $at_check_filter
   150006 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150007 $at_diff expout "$at_stdout" || at_failed=:
   150008 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   150009 $at_failed && at_fn_log_failure
   150010 $at_traceon; }
   150011 
   150012   rm -rf xml-tests expout
   150013   at_restore_special_files
   150014 fi
   150015 { set +x
   150016 $as_echo "$at_srcdir/c++.at:172: bison -o input.cc input.y"
   150017 at_fn_check_prepare_trace "c++.at:172"
   150018 ( $at_check_trace; bison -o input.cc input.y
   150019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150020 at_status=$? at_failed=false
   150021 $at_check_filter
   150022 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150023 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150024 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   150025 $at_failed && at_fn_log_failure
   150026 $at_traceon; }
   150027 
   150028 
   150029 
   150030 
   150031 { set +x
   150032 $as_echo "$at_srcdir/c++.at:172: \$BISON_CXX_WORKS"
   150033 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:172"
   150034 ( $at_check_trace; $BISON_CXX_WORKS
   150035 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150036 at_status=$? at_failed=false
   150037 $at_check_filter
   150038 echo stderr:; cat "$at_stderr"
   150039 echo stdout:; cat "$at_stdout"
   150040 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   150041 $at_failed && at_fn_log_failure
   150042 $at_traceon; }
   150043 
   150044 { set +x
   150045 $as_echo "$at_srcdir/c++.at:172: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   150046 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:172"
   150047 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   150048 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150049 at_status=$? at_failed=false
   150050 $at_check_filter
   150051 echo stderr:; cat "$at_stderr"
   150052 echo stdout:; cat "$at_stdout"
   150053 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   150054 $at_failed && at_fn_log_failure
   150055 $at_traceon; }
   150056 
   150057 { set +x
   150058 $as_echo "$at_srcdir/c++.at:172:  \$PREPARSER ./input"
   150059 at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:172"
   150060 ( $at_check_trace;  $PREPARSER ./input
   150061 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150062 at_status=$? at_failed=false
   150063 $at_check_filter
   150064 echo stderr:; tee stderr <"$at_stderr"
   150065 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150066 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   150067 $at_failed && at_fn_log_failure
   150068 $at_traceon; }
   150069 
   150070 { set +x
   150071 $as_echo "$at_srcdir/c++.at:172: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   150072 at_fn_check_prepare_trace "c++.at:172"
   150073 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   150074 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150075 at_status=$? at_failed=false
   150076 $at_check_filter
   150077 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150078 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150079 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
   150080 $at_failed && at_fn_log_failure
   150081 $at_traceon; }
   150082 
   150083 
   150084 
   150085 
   150086   set +x
   150087   $at_times_p && times >"$at_times_file"
   150088 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   150089 read at_status <"$at_status_file"
   150090 #AT_STOP_304
   150091 #AT_START_305
   150092 at_fn_group_banner 305 'c++.at:175' \
   150093   "Syntactically invalid namespace references" "     " 18
   150094 at_xfail=no
   150095 (
   150096   $as_echo "305. $at_setup_line: testing $at_desc ..."
   150097   $at_traceon
   150098 
   150099 
   150100 
   150101 cat >input.y <<'_ATEOF'
   150102 %code top {
   150103 #include <config.h>
   150104 /* We don't need perfect functions for these tests. */
   150105 #undef malloc
   150106 #undef memcmp
   150107 #undef realloc
   150108 }
   150109 
   150110 %language "C++"
   150111 %defines
   150112 %define namespace ":foo:bar"
   150113 %union { int i; }
   150114 %define global_tokens_and_yystype
   150115 
   150116 %code {
   150117   // YYSTYPE contains a namespace reference.
   150118   int yylex (YYSTYPE *lval) {
   150119     lval->i = 3;
   150120     return 0;
   150121   }
   150122 }
   150123 
   150124 %%
   150125 
   150126 start: ;
   150127 
   150128 %%
   150129 
   150130 void
   150131 :foo:bar::parser::error (const :foo:bar::parser::location_type &loc,
   150132                      const std::string &msg)
   150133 {
   150134   std::cerr << "At " << loc << ": " << msg << std::endl;
   150135 }
   150136 
   150137 int
   150138 main (void)
   150139 {
   150140   :foo:bar::parser p;
   150141   return p.parse ();
   150142 }
   150143 _ATEOF
   150144 
   150145 
   150146 
   150147 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   150148   at_save_special_files
   150149   mkdir xml-tests
   150150     # Don't combine these Bison invocations since we want to be sure that
   150151   # --report=all isn't required to get the full XML file.
   150152   { set +x
   150153 $as_echo "$at_srcdir/c++.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   150154                   --graph=xml-tests/test.dot -o input.cc input.y"
   150155 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:176"
   150156 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   150157                   --graph=xml-tests/test.dot -o input.cc input.y
   150158 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150159 at_status=$? at_failed=false
   150160 $at_check_filter
   150161 echo stderr:; cat "$at_stderr"
   150162 echo stdout:; cat "$at_stdout"
   150163 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
   150164 $at_failed && at_fn_log_failure
   150165 $at_traceon; }
   150166 
   150167   { set +x
   150168 $as_echo "$at_srcdir/c++.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   150169 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:176"
   150170 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   150171 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150172 at_status=$? at_failed=false
   150173 $at_check_filter
   150174 echo stderr:; cat "$at_stderr"
   150175 echo stdout:; cat "$at_stdout"
   150176 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
   150177 $at_failed && at_fn_log_failure
   150178 $at_traceon; }
   150179 
   150180     cp xml-tests/test.output expout
   150181   { set +x
   150182 $as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\
   150183              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   150184              xml-tests/test.xml"
   150185 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176"
   150186 ( $at_check_trace; $XSLTPROC \
   150187              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   150188              xml-tests/test.xml
   150189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150190 at_status=$? at_failed=false
   150191 $at_check_filter
   150192 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150193 $at_diff expout "$at_stdout" || at_failed=:
   150194 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
   150195 $at_failed && at_fn_log_failure
   150196 $at_traceon; }
   150197 
   150198   sort xml-tests/test.dot > expout
   150199   { set +x
   150200 $as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\
   150201              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   150202              xml-tests/test.xml | sort"
   150203 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176"
   150204 ( $at_check_trace; $XSLTPROC \
   150205              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   150206              xml-tests/test.xml | sort
   150207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150208 at_status=$? at_failed=false
   150209 $at_check_filter
   150210 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150211 $at_diff expout "$at_stdout" || at_failed=:
   150212 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
   150213 $at_failed && at_fn_log_failure
   150214 $at_traceon; }
   150215 
   150216   rm -rf xml-tests expout
   150217   at_restore_special_files
   150218 fi
   150219 { set +x
   150220 $as_echo "$at_srcdir/c++.at:176: bison -o input.cc input.y"
   150221 at_fn_check_prepare_trace "c++.at:176"
   150222 ( $at_check_trace; bison -o input.cc input.y
   150223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150224 at_status=$? at_failed=false
   150225 $at_check_filter
   150226 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150227 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150228 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
   150229 $at_failed && at_fn_log_failure
   150230 $at_traceon; }
   150231 
   150232 
   150233 
   150234 
   150235 
   150236 
   150237 
   150238 
   150239 cat >input.y <<'_ATEOF'
   150240 %code top {
   150241 #include <config.h>
   150242 /* We don't need perfect functions for these tests. */
   150243 #undef malloc
   150244 #undef memcmp
   150245 #undef realloc
   150246 }
   150247 
   150248 %language "C++"
   150249 %defines
   150250 %define namespace "foo: :bar"
   150251 %union { int i; }
   150252 %define global_tokens_and_yystype
   150253 
   150254 %code {
   150255   // YYSTYPE contains a namespace reference.
   150256   int yylex (YYSTYPE *lval) {
   150257     lval->i = 3;
   150258     return 0;
   150259   }
   150260 }
   150261 
   150262 %%
   150263 
   150264 start: ;
   150265 
   150266 %%
   150267 
   150268 void
   150269 foo: :bar::parser::error (const foo: :bar::parser::location_type &loc,
   150270                      const std::string &msg)
   150271 {
   150272   std::cerr << "At " << loc << ": " << msg << std::endl;
   150273 }
   150274 
   150275 int
   150276 main (void)
   150277 {
   150278   foo: :bar::parser p;
   150279   return p.parse ();
   150280 }
   150281 _ATEOF
   150282 
   150283 
   150284 
   150285 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   150286   at_save_special_files
   150287   mkdir xml-tests
   150288     # Don't combine these Bison invocations since we want to be sure that
   150289   # --report=all isn't required to get the full XML file.
   150290   { set +x
   150291 $as_echo "$at_srcdir/c++.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   150292                   --graph=xml-tests/test.dot -o input.cc input.y"
   150293 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:177"
   150294 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   150295                   --graph=xml-tests/test.dot -o input.cc input.y
   150296 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150297 at_status=$? at_failed=false
   150298 $at_check_filter
   150299 echo stderr:; cat "$at_stderr"
   150300 echo stdout:; cat "$at_stdout"
   150301 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
   150302 $at_failed && at_fn_log_failure
   150303 $at_traceon; }
   150304 
   150305   { set +x
   150306 $as_echo "$at_srcdir/c++.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   150307 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:177"
   150308 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   150309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150310 at_status=$? at_failed=false
   150311 $at_check_filter
   150312 echo stderr:; cat "$at_stderr"
   150313 echo stdout:; cat "$at_stdout"
   150314 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
   150315 $at_failed && at_fn_log_failure
   150316 $at_traceon; }
   150317 
   150318     cp xml-tests/test.output expout
   150319   { set +x
   150320 $as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\
   150321              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   150322              xml-tests/test.xml"
   150323 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177"
   150324 ( $at_check_trace; $XSLTPROC \
   150325              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   150326              xml-tests/test.xml
   150327 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150328 at_status=$? at_failed=false
   150329 $at_check_filter
   150330 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150331 $at_diff expout "$at_stdout" || at_failed=:
   150332 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
   150333 $at_failed && at_fn_log_failure
   150334 $at_traceon; }
   150335 
   150336   sort xml-tests/test.dot > expout
   150337   { set +x
   150338 $as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\
   150339              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   150340              xml-tests/test.xml | sort"
   150341 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177"
   150342 ( $at_check_trace; $XSLTPROC \
   150343              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   150344              xml-tests/test.xml | sort
   150345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150346 at_status=$? at_failed=false
   150347 $at_check_filter
   150348 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150349 $at_diff expout "$at_stdout" || at_failed=:
   150350 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
   150351 $at_failed && at_fn_log_failure
   150352 $at_traceon; }
   150353 
   150354   rm -rf xml-tests expout
   150355   at_restore_special_files
   150356 fi
   150357 { set +x
   150358 $as_echo "$at_srcdir/c++.at:177: bison -o input.cc input.y"
   150359 at_fn_check_prepare_trace "c++.at:177"
   150360 ( $at_check_trace; bison -o input.cc input.y
   150361 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150362 at_status=$? at_failed=false
   150363 $at_check_filter
   150364 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150365 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150366 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
   150367 $at_failed && at_fn_log_failure
   150368 $at_traceon; }
   150369 
   150370 
   150371 
   150372 
   150373 
   150374 
   150375 # This one is interesting because `[3]' is encoded as `[3]', which
   150376 # contains single occurrences of `:'.
   150377 
   150378 
   150379 cat >input.y <<'_ATEOF'
   150380 %code top {
   150381 #include <config.h>
   150382 /* We don't need perfect functions for these tests. */
   150383 #undef malloc
   150384 #undef memcmp
   150385 #undef realloc
   150386 }
   150387 
   150388 %language "C++"
   150389 %defines
   150390 %define namespace "foo[3]::bar::baz"
   150391 %union { int i; }
   150392 %define global_tokens_and_yystype
   150393 
   150394 %code {
   150395   // YYSTYPE contains a namespace reference.
   150396   int yylex (YYSTYPE *lval) {
   150397     lval->i = 3;
   150398     return 0;
   150399   }
   150400 }
   150401 
   150402 %%
   150403 
   150404 start: ;
   150405 
   150406 %%
   150407 
   150408 void
   150409 foo[3]::bar::baz::parser::error (const foo[3]::bar::baz::parser::location_type &loc,
   150410                      const std::string &msg)
   150411 {
   150412   std::cerr << "At " << loc << ": " << msg << std::endl;
   150413 }
   150414 
   150415 int
   150416 main (void)
   150417 {
   150418   foo[3]::bar::baz::parser p;
   150419   return p.parse ();
   150420 }
   150421 _ATEOF
   150422 
   150423 
   150424 
   150425 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   150426   at_save_special_files
   150427   mkdir xml-tests
   150428     # Don't combine these Bison invocations since we want to be sure that
   150429   # --report=all isn't required to get the full XML file.
   150430   { set +x
   150431 $as_echo "$at_srcdir/c++.at:180: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   150432                   --graph=xml-tests/test.dot -o input.cc input.y"
   150433 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:180"
   150434 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   150435                   --graph=xml-tests/test.dot -o input.cc input.y
   150436 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150437 at_status=$? at_failed=false
   150438 $at_check_filter
   150439 echo stderr:; cat "$at_stderr"
   150440 echo stdout:; cat "$at_stdout"
   150441 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
   150442 $at_failed && at_fn_log_failure
   150443 $at_traceon; }
   150444 
   150445   { set +x
   150446 $as_echo "$at_srcdir/c++.at:180: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   150447 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:180"
   150448 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   150449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150450 at_status=$? at_failed=false
   150451 $at_check_filter
   150452 echo stderr:; cat "$at_stderr"
   150453 echo stdout:; cat "$at_stdout"
   150454 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
   150455 $at_failed && at_fn_log_failure
   150456 $at_traceon; }
   150457 
   150458     cp xml-tests/test.output expout
   150459   { set +x
   150460 $as_echo "$at_srcdir/c++.at:180: \$XSLTPROC \\
   150461              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   150462              xml-tests/test.xml"
   150463 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:180"
   150464 ( $at_check_trace; $XSLTPROC \
   150465              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   150466              xml-tests/test.xml
   150467 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150468 at_status=$? at_failed=false
   150469 $at_check_filter
   150470 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150471 $at_diff expout "$at_stdout" || at_failed=:
   150472 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
   150473 $at_failed && at_fn_log_failure
   150474 $at_traceon; }
   150475 
   150476   sort xml-tests/test.dot > expout
   150477   { set +x
   150478 $as_echo "$at_srcdir/c++.at:180: \$XSLTPROC \\
   150479              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   150480              xml-tests/test.xml | sort"
   150481 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:180"
   150482 ( $at_check_trace; $XSLTPROC \
   150483              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   150484              xml-tests/test.xml | sort
   150485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150486 at_status=$? at_failed=false
   150487 $at_check_filter
   150488 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150489 $at_diff expout "$at_stdout" || at_failed=:
   150490 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
   150491 $at_failed && at_fn_log_failure
   150492 $at_traceon; }
   150493 
   150494   rm -rf xml-tests expout
   150495   at_restore_special_files
   150496 fi
   150497 { set +x
   150498 $as_echo "$at_srcdir/c++.at:180: bison -o input.cc input.y"
   150499 at_fn_check_prepare_trace "c++.at:180"
   150500 ( $at_check_trace; bison -o input.cc input.y
   150501 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150502 at_status=$? at_failed=false
   150503 $at_check_filter
   150504 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150505 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150506 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
   150507 $at_failed && at_fn_log_failure
   150508 $at_traceon; }
   150509 
   150510 
   150511 
   150512 
   150513 
   150514 
   150515 
   150516 
   150517 cat >input.y <<'_ATEOF'
   150518 %code top {
   150519 #include <config.h>
   150520 /* We don't need perfect functions for these tests. */
   150521 #undef malloc
   150522 #undef memcmp
   150523 #undef realloc
   150524 }
   150525 
   150526 %language "C++"
   150527 %defines
   150528 %define namespace "foo::bar,baz"
   150529 %union { int i; }
   150530 %define global_tokens_and_yystype
   150531 
   150532 %code {
   150533   // YYSTYPE contains a namespace reference.
   150534   int yylex (YYSTYPE *lval) {
   150535     lval->i = 3;
   150536     return 0;
   150537   }
   150538 }
   150539 
   150540 %%
   150541 
   150542 start: ;
   150543 
   150544 %%
   150545 
   150546 void
   150547 foo::bar,baz::parser::error (const foo::bar,baz::parser::location_type &loc,
   150548                      const std::string &msg)
   150549 {
   150550   std::cerr << "At " << loc << ": " << msg << std::endl;
   150551 }
   150552 
   150553 int
   150554 main (void)
   150555 {
   150556   foo::bar,baz::parser p;
   150557   return p.parse ();
   150558 }
   150559 _ATEOF
   150560 
   150561 
   150562 
   150563 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   150564   at_save_special_files
   150565   mkdir xml-tests
   150566     # Don't combine these Bison invocations since we want to be sure that
   150567   # --report=all isn't required to get the full XML file.
   150568   { set +x
   150569 $as_echo "$at_srcdir/c++.at:181: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   150570                   --graph=xml-tests/test.dot -o input.cc input.y"
   150571 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:181"
   150572 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   150573                   --graph=xml-tests/test.dot -o input.cc input.y
   150574 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150575 at_status=$? at_failed=false
   150576 $at_check_filter
   150577 echo stderr:; cat "$at_stderr"
   150578 echo stdout:; cat "$at_stdout"
   150579 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
   150580 $at_failed && at_fn_log_failure
   150581 $at_traceon; }
   150582 
   150583   { set +x
   150584 $as_echo "$at_srcdir/c++.at:181: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   150585 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:181"
   150586 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   150587 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150588 at_status=$? at_failed=false
   150589 $at_check_filter
   150590 echo stderr:; cat "$at_stderr"
   150591 echo stdout:; cat "$at_stdout"
   150592 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
   150593 $at_failed && at_fn_log_failure
   150594 $at_traceon; }
   150595 
   150596     cp xml-tests/test.output expout
   150597   { set +x
   150598 $as_echo "$at_srcdir/c++.at:181: \$XSLTPROC \\
   150599              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   150600              xml-tests/test.xml"
   150601 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:181"
   150602 ( $at_check_trace; $XSLTPROC \
   150603              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   150604              xml-tests/test.xml
   150605 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150606 at_status=$? at_failed=false
   150607 $at_check_filter
   150608 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150609 $at_diff expout "$at_stdout" || at_failed=:
   150610 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
   150611 $at_failed && at_fn_log_failure
   150612 $at_traceon; }
   150613 
   150614   sort xml-tests/test.dot > expout
   150615   { set +x
   150616 $as_echo "$at_srcdir/c++.at:181: \$XSLTPROC \\
   150617              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   150618              xml-tests/test.xml | sort"
   150619 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:181"
   150620 ( $at_check_trace; $XSLTPROC \
   150621              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   150622              xml-tests/test.xml | sort
   150623 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150624 at_status=$? at_failed=false
   150625 $at_check_filter
   150626 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150627 $at_diff expout "$at_stdout" || at_failed=:
   150628 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
   150629 $at_failed && at_fn_log_failure
   150630 $at_traceon; }
   150631 
   150632   rm -rf xml-tests expout
   150633   at_restore_special_files
   150634 fi
   150635 { set +x
   150636 $as_echo "$at_srcdir/c++.at:181: bison -o input.cc input.y"
   150637 at_fn_check_prepare_trace "c++.at:181"
   150638 ( $at_check_trace; bison -o input.cc input.y
   150639 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150640 at_status=$? at_failed=false
   150641 $at_check_filter
   150642 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150643 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150644 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
   150645 $at_failed && at_fn_log_failure
   150646 $at_traceon; }
   150647 
   150648 
   150649 
   150650 
   150651 
   150652 
   150653 
   150654 
   150655 cat >input.y <<'_ATEOF'
   150656 %code top {
   150657 #include <config.h>
   150658 /* We don't need perfect functions for these tests. */
   150659 #undef malloc
   150660 #undef memcmp
   150661 #undef realloc
   150662 }
   150663 
   150664 %language "C++"
   150665 %defines
   150666 %define namespace "foo::bar::(baz"
   150667 %union { int i; }
   150668 %define global_tokens_and_yystype
   150669 
   150670 %code {
   150671   // YYSTYPE contains a namespace reference.
   150672   int yylex (YYSTYPE *lval) {
   150673     lval->i = 3;
   150674     return 0;
   150675   }
   150676 }
   150677 
   150678 %%
   150679 
   150680 start: ;
   150681 
   150682 %%
   150683 
   150684 void
   150685 foo::bar::(baz::parser::error (const foo::bar::(baz::parser::location_type &loc,
   150686                      const std::string &msg)
   150687 {
   150688   std::cerr << "At " << loc << ": " << msg << std::endl;
   150689 }
   150690 
   150691 int
   150692 main (void)
   150693 {
   150694   foo::bar::(baz::parser p;
   150695   return p.parse ();
   150696 }
   150697 _ATEOF
   150698 
   150699 
   150700 
   150701 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   150702   at_save_special_files
   150703   mkdir xml-tests
   150704     # Don't combine these Bison invocations since we want to be sure that
   150705   # --report=all isn't required to get the full XML file.
   150706   { set +x
   150707 $as_echo "$at_srcdir/c++.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   150708                   --graph=xml-tests/test.dot -o input.cc input.y"
   150709 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:182"
   150710 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   150711                   --graph=xml-tests/test.dot -o input.cc input.y
   150712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150713 at_status=$? at_failed=false
   150714 $at_check_filter
   150715 echo stderr:; cat "$at_stderr"
   150716 echo stdout:; cat "$at_stdout"
   150717 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
   150718 $at_failed && at_fn_log_failure
   150719 $at_traceon; }
   150720 
   150721   { set +x
   150722 $as_echo "$at_srcdir/c++.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y"
   150723 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:182"
   150724 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y
   150725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150726 at_status=$? at_failed=false
   150727 $at_check_filter
   150728 echo stderr:; cat "$at_stderr"
   150729 echo stdout:; cat "$at_stdout"
   150730 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
   150731 $at_failed && at_fn_log_failure
   150732 $at_traceon; }
   150733 
   150734     cp xml-tests/test.output expout
   150735   { set +x
   150736 $as_echo "$at_srcdir/c++.at:182: \$XSLTPROC \\
   150737              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   150738              xml-tests/test.xml"
   150739 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:182"
   150740 ( $at_check_trace; $XSLTPROC \
   150741              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   150742              xml-tests/test.xml
   150743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150744 at_status=$? at_failed=false
   150745 $at_check_filter
   150746 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150747 $at_diff expout "$at_stdout" || at_failed=:
   150748 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
   150749 $at_failed && at_fn_log_failure
   150750 $at_traceon; }
   150751 
   150752   sort xml-tests/test.dot > expout
   150753   { set +x
   150754 $as_echo "$at_srcdir/c++.at:182: \$XSLTPROC \\
   150755              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   150756              xml-tests/test.xml | sort"
   150757 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:182"
   150758 ( $at_check_trace; $XSLTPROC \
   150759              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   150760              xml-tests/test.xml | sort
   150761 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150762 at_status=$? at_failed=false
   150763 $at_check_filter
   150764 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150765 $at_diff expout "$at_stdout" || at_failed=:
   150766 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
   150767 $at_failed && at_fn_log_failure
   150768 $at_traceon; }
   150769 
   150770   rm -rf xml-tests expout
   150771   at_restore_special_files
   150772 fi
   150773 { set +x
   150774 $as_echo "$at_srcdir/c++.at:182: bison -o input.cc input.y"
   150775 at_fn_check_prepare_trace "c++.at:182"
   150776 ( $at_check_trace; bison -o input.cc input.y
   150777 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   150778 at_status=$? at_failed=false
   150779 $at_check_filter
   150780 at_fn_diff_devnull "$at_stderr" || at_failed=:
   150781 at_fn_diff_devnull "$at_stdout" || at_failed=:
   150782 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
   150783 $at_failed && at_fn_log_failure
   150784 $at_traceon; }
   150785 
   150786 
   150787 
   150788 
   150789 
   150790 
   150791   set +x
   150792   $at_times_p && times >"$at_times_file"
   150793 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   150794 read at_status <"$at_status_file"
   150795 #AT_STOP_305
   150796 #AT_START_306
   150797 at_fn_group_banner 306 'c++.at:190' \
   150798   "Exception safety" "                               " 18
   150799 at_xfail=no
   150800 (
   150801   $as_echo "306. $at_setup_line: testing $at_desc ..."
   150802   $at_traceon
   150803 
   150804 
   150805 
   150806 
   150807 cat >input.yy <<'_ATEOF'
   150808 %code top {
   150809 #include <config.h>
   150810 /* We don't need perfect functions for these tests. */
   150811 #undef malloc
   150812 #undef memcmp
   150813 #undef realloc
   150814 }
   150815 
   150816 %skeleton "lalr1.cc"
   150817 %defines // FIXME: Mandated in 2.6.
   150818 %debug
   150819 %error-verbose
   150820 
   150821 %code requires
   150822 {
   150823   #include <cassert>
   150824   #include <cstdlib> // size_t and getenv.
   150825   #include <iostream>
   150826   #include <list>
   150827 
   150828   bool debug = false;
   150829 
   150830   /// A class that counts its number of instances.
   150831   struct Object
   150832   {
   150833     typedef std::list<const Object*> objects;
   150834     static objects instances;
   150835     char val;
   150836 
   150837     static bool
   150838     empty ()
   150839     {
   150840       return instances.empty();
   150841     }
   150842 
   150843     static void
   150844     log (Object const *o, const std::string& msg)
   150845     {
   150846       if (debug)
   150847         {
   150848           if (o)
   150849             std::cerr << o << "->";
   150850           std::cerr << msg << " {";
   150851           const char* sep = " ";
   150852           for (objects::const_iterator i = instances.begin(),
   150853                                        i_end = instances.end();
   150854                i != i_end;
   150855                ++i)
   150856             {
   150857               std::cerr << sep << *i;
   150858               sep = ", ";
   150859             }
   150860           std::cerr << " }" << std::endl;
   150861         }
   150862     }
   150863 
   150864     Object (char v)
   150865       : val (v)
   150866     {
   150867       instances.push_back(this);
   150868       log (this, "Object::Object");
   150869     }
   150870 
   150871     ~Object ()
   150872     {
   150873       instances.remove(this);
   150874       log (this, "Object::~Object");
   150875     }
   150876   };
   150877 }
   150878 
   150879 %code
   150880 {
   150881   #include <cassert>
   150882   #include <cstring> // strchr
   150883   #include <stdexcept>
   150884   int yylex (yy::parser::semantic_type *);
   150885   Object::objects Object::instances;
   150886   static char const *input;
   150887 }
   150888 
   150889 %union
   150890 {
   150891   Object *obj;
   150892 }
   150893 
   150894 %initial-action
   150895 {
   150896   if (strchr (input, 'i'))
   150897     throw std::runtime_error ("initial-action");
   150898 }
   150899 
   150900 %destructor { delete $$; } <obj>;
   150901 %printer
   150902 {
   150903   yyo << $$ << " '" << $$->val << '\'';
   150904   if ($$->val == 'p')
   150905     throw std::runtime_error ("printer");
   150906 } <obj>;
   150907 
   150908 %token <obj> 'a' 'E' 'e' 'p' 'R' 's' 'T'
   150909 %type  <obj> list item
   150910 
   150911 %%
   150912 
   150913 start: list { delete $1; };
   150914 
   150915 list:
   150916   item       { $$ = $1; }
   150917 | item list  { $$ = $1; delete $2; } // Right recursion to load the stack.
   150918 ;
   150919 
   150920 item:
   150921   'a'  { $$ = $1; }
   150922 | 'e'  { YYUSE ($$); YYUSE($1); error (location_type(), "syntax error"); }
   150923 // Not just 'E', otherwise we reduce when 'E' is the lookahead, and
   150924 // then the stack is emptied, defeating the point of the test.
   150925 | 'E' 'a' { YYUSE($1); $$ = $2; }
   150926 | 'R'  { $$ = YY_NULL; delete $1; YYERROR; }
   150927 | 'p'  { $$ = $1; }
   150928 | 's'  { $$ = $1; throw std::runtime_error ("reduction"); }
   150929 | 'T'  { $$ = YY_NULL; delete $1; YYABORT; }
   150930 | error { $$ = YY_NULL; yyerrok; }
   150931 ;
   150932 %%
   150933 
   150934 int
   150935 yylex (yy::parser::semantic_type *lvalp)
   150936 {
   150937   // 'a': no error.
   150938   // 'e': user action calls error.
   150939   // 'E': syntax error, with yyerror that throws.
   150940   // 'i': initial action throws.
   150941   // 'l': yylex throws.
   150942   // 'R': call YYERROR in the action
   150943   // 's': reduction throws.
   150944   // 'T': call YYABORT in the action
   150945   switch (int res = *input++)
   150946   {
   150947     case 'l':
   150948       throw std::runtime_error ("yylex");
   150949     default:
   150950       lvalp->obj = new Object (res);
   150951       // Fall through.
   150952     case 0:
   150953       return res;
   150954   }
   150955 }
   150956 
   150957 /* A C++ error reporting function.  */
   150958 void
   150959 yy::parser::error (const location_type& l, const std::string& m)
   150960 {
   150961   YYUSE (l);
   150962   throw std::runtime_error (m);
   150963 }
   150964 
   150965 int
   150966 main (int argc, const char *argv[])
   150967 {
   150968   switch (argc)
   150969   {
   150970     case 2:
   150971       input = argv[1];
   150972       break;
   150973     case 3:
   150974       assert (!strcmp (argv[1], "--debug"));
   150975       debug = 1;
   150976       input = argv[2];
   150977       break;
   150978     default:
   150979       abort ();
   150980   }
   150981 
   150982   yy::parser parser;
   150983   debug |= !!getenv ("YYDEBUG");
   150984   parser.set_debug_level (debug);
   150985   int res = 2;
   150986   try
   150987   {
   150988     res = parser.parse ();
   150989   }
   150990   catch (const std::exception& e)
   150991   {
   150992     std::cerr << "exception caught: " << e.what () << std::endl;
   150993   }
   150994   catch (...)
   150995   {
   150996     std::cerr << "unknown exception caught" << std::endl;
   150997   }
   150998   Object::log (YY_NULL, "end");
   150999   assert (Object::empty());
   151000   return res;
   151001 }
   151002 _ATEOF
   151003 
   151004 
   151005 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   151006   at_save_special_files
   151007   mkdir xml-tests
   151008     # Don't combine these Bison invocations since we want to be sure that
   151009   # --report=all isn't required to get the full XML file.
   151010   { set +x
   151011 $as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   151012                   --graph=xml-tests/test.dot -o input.cc --report=all input.yy"
   151013 at_fn_check_prepare_notrace 'an embedded newline' "c++.at:382"
   151014 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   151015                   --graph=xml-tests/test.dot -o input.cc --report=all input.yy
   151016 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151017 at_status=$? at_failed=false
   151018 $at_check_filter
   151019 echo stderr:; cat "$at_stderr"
   151020 echo stdout:; cat "$at_stdout"
   151021 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382"
   151022 $at_failed && at_fn_log_failure
   151023 $at_traceon; }
   151024 
   151025   { set +x
   151026 $as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy"
   151027 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:382"
   151028 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy
   151029 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151030 at_status=$? at_failed=false
   151031 $at_check_filter
   151032 echo stderr:; cat "$at_stderr"
   151033 echo stdout:; cat "$at_stdout"
   151034 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382"
   151035 $at_failed && at_fn_log_failure
   151036 $at_traceon; }
   151037 
   151038     cp xml-tests/test.output expout
   151039   { set +x
   151040 $as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\
   151041              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   151042              xml-tests/test.xml"
   151043 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382"
   151044 ( $at_check_trace; $XSLTPROC \
   151045              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   151046              xml-tests/test.xml
   151047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151048 at_status=$? at_failed=false
   151049 $at_check_filter
   151050 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151051 $at_diff expout "$at_stdout" || at_failed=:
   151052 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382"
   151053 $at_failed && at_fn_log_failure
   151054 $at_traceon; }
   151055 
   151056   sort xml-tests/test.dot > expout
   151057   { set +x
   151058 $as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\
   151059              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   151060              xml-tests/test.xml | sort"
   151061 at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382"
   151062 ( $at_check_trace; $XSLTPROC \
   151063              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   151064              xml-tests/test.xml | sort
   151065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151066 at_status=$? at_failed=false
   151067 $at_check_filter
   151068 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151069 $at_diff expout "$at_stdout" || at_failed=:
   151070 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382"
   151071 $at_failed && at_fn_log_failure
   151072 $at_traceon; }
   151073 
   151074   rm -rf xml-tests expout
   151075   at_restore_special_files
   151076 fi
   151077 { set +x
   151078 $as_echo "$at_srcdir/c++.at:382: bison -o input.cc --report=all input.yy"
   151079 at_fn_check_prepare_trace "c++.at:382"
   151080 ( $at_check_trace; bison -o input.cc --report=all input.yy
   151081 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151082 at_status=$? at_failed=false
   151083 $at_check_filter
   151084 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151085 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151086 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382"
   151087 $at_failed && at_fn_log_failure
   151088 $at_traceon; }
   151089 
   151090 
   151091 
   151092 { set +x
   151093 $as_echo "$at_srcdir/c++.at:383: \$BISON_CXX_WORKS"
   151094 at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:383"
   151095 ( $at_check_trace; $BISON_CXX_WORKS
   151096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151097 at_status=$? at_failed=false
   151098 $at_check_filter
   151099 echo stderr:; cat "$at_stderr"
   151100 echo stdout:; cat "$at_stdout"
   151101 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383"
   151102 $at_failed && at_fn_log_failure
   151103 $at_traceon; }
   151104 
   151105 { set +x
   151106 $as_echo "$at_srcdir/c++.at:383: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   151107 at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:383"
   151108 ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
   151109 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151110 at_status=$? at_failed=false
   151111 $at_check_filter
   151112 echo stderr:; cat "$at_stderr"
   151113 echo stdout:; cat "$at_stdout"
   151114 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383"
   151115 $at_failed && at_fn_log_failure
   151116 $at_traceon; }
   151117 
   151118 
   151119 { set +x
   151120 $as_echo "$at_srcdir/c++.at:385:  \$PREPARSER ./input aaaas"
   151121 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:385"
   151122 ( $at_check_trace;  $PREPARSER ./input aaaas
   151123 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151124 at_status=$? at_failed=false
   151125 $at_check_filter
   151126 echo stderr:; tee stderr <"$at_stderr"
   151127 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151128 at_fn_check_status 2 $at_status "$at_srcdir/c++.at:385"
   151129 $at_failed && at_fn_log_failure
   151130 $at_traceon; }
   151131 
   151132 { set +x
   151133 $as_echo "$at_srcdir/c++.at:385: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151134 at_fn_check_prepare_trace "c++.at:385"
   151135 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151136 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151137 at_status=$? at_failed=false
   151138 $at_check_filter
   151139 echo >>"$at_stderr"; $as_echo "exception caught: reduction
   151140 " | \
   151141   $at_diff - "$at_stderr" || at_failed=:
   151142 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151143 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:385"
   151144 $at_failed && at_fn_log_failure
   151145 $at_traceon; }
   151146 
   151147 
   151148 
   151149 { set +x
   151150 $as_echo "$at_srcdir/c++.at:389:  \$PREPARSER ./input aaaal"
   151151 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:389"
   151152 ( $at_check_trace;  $PREPARSER ./input aaaal
   151153 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151154 at_status=$? at_failed=false
   151155 $at_check_filter
   151156 echo stderr:; tee stderr <"$at_stderr"
   151157 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151158 at_fn_check_status 2 $at_status "$at_srcdir/c++.at:389"
   151159 $at_failed && at_fn_log_failure
   151160 $at_traceon; }
   151161 
   151162 { set +x
   151163 $as_echo "$at_srcdir/c++.at:389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151164 at_fn_check_prepare_trace "c++.at:389"
   151165 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151166 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151167 at_status=$? at_failed=false
   151168 $at_check_filter
   151169 echo >>"$at_stderr"; $as_echo "exception caught: yylex
   151170 " | \
   151171   $at_diff - "$at_stderr" || at_failed=:
   151172 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151173 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:389"
   151174 $at_failed && at_fn_log_failure
   151175 $at_traceon; }
   151176 
   151177 
   151178 
   151179 { set +x
   151180 $as_echo "$at_srcdir/c++.at:393:  \$PREPARSER ./input i"
   151181 at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:393"
   151182 ( $at_check_trace;  $PREPARSER ./input i
   151183 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151184 at_status=$? at_failed=false
   151185 $at_check_filter
   151186 echo stderr:; tee stderr <"$at_stderr"
   151187 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151188 at_fn_check_status 2 $at_status "$at_srcdir/c++.at:393"
   151189 $at_failed && at_fn_log_failure
   151190 $at_traceon; }
   151191 
   151192 { set +x
   151193 $as_echo "$at_srcdir/c++.at:393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151194 at_fn_check_prepare_trace "c++.at:393"
   151195 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151197 at_status=$? at_failed=false
   151198 $at_check_filter
   151199 echo >>"$at_stderr"; $as_echo "exception caught: initial-action
   151200 " | \
   151201   $at_diff - "$at_stderr" || at_failed=:
   151202 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151203 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:393"
   151204 $at_failed && at_fn_log_failure
   151205 $at_traceon; }
   151206 
   151207 
   151208 
   151209 { set +x
   151210 $as_echo "$at_srcdir/c++.at:397:  \$PREPARSER ./input aaaap"
   151211 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:397"
   151212 ( $at_check_trace;  $PREPARSER ./input aaaap
   151213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151214 at_status=$? at_failed=false
   151215 $at_check_filter
   151216 echo stderr:; tee stderr <"$at_stderr"
   151217 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151218 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:397"
   151219 $at_failed && at_fn_log_failure
   151220 $at_traceon; }
   151221 
   151222 { set +x
   151223 $as_echo "$at_srcdir/c++.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151224 at_fn_check_prepare_trace "c++.at:397"
   151225 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151226 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151227 at_status=$? at_failed=false
   151228 $at_check_filter
   151229 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151230 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151231 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:397"
   151232 $at_failed && at_fn_log_failure
   151233 $at_traceon; }
   151234 
   151235 
   151236 
   151237 { set +x
   151238 $as_echo "$at_srcdir/c++.at:399:  \$PREPARSER ./input --debug aaaap"
   151239 at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:399"
   151240 ( $at_check_trace;  $PREPARSER ./input --debug aaaap
   151241 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151242 at_status=$? at_failed=false
   151243 $at_check_filter
   151244 echo stderr:; tee stderr <"$at_stderr"
   151245 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151246 at_fn_check_status 2 $at_status "$at_srcdir/c++.at:399"
   151247 $at_failed && at_fn_log_failure
   151248 $at_traceon; }
   151249 
   151250 { set +x
   151251 $as_echo "$at_srcdir/c++.at:399: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151252 at_fn_check_prepare_trace "c++.at:399"
   151253 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151255 at_status=$? at_failed=false
   151256 $at_check_filter
   151257 echo stderr:; tee stderr <"$at_stderr"
   151258 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151259 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:399"
   151260 $at_failed && at_fn_log_failure
   151261 $at_traceon; }
   151262 
   151263 
   151264 { set +x
   151265 $as_echo "$at_srcdir/c++.at:400: grep '^exception caught: printer\$' stderr"
   151266 at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:400"
   151267 ( $at_check_trace; grep '^exception caught: printer$' stderr
   151268 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151269 at_status=$? at_failed=false
   151270 $at_check_filter
   151271 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151272 echo stdout:; cat "$at_stdout"
   151273 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:400"
   151274 $at_failed && at_fn_log_failure
   151275 $at_traceon; }
   151276 
   151277 
   151278 { set +x
   151279 $as_echo "$at_srcdir/c++.at:402:  \$PREPARSER ./input aaaae"
   151280 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:402"
   151281 ( $at_check_trace;  $PREPARSER ./input aaaae
   151282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151283 at_status=$? at_failed=false
   151284 $at_check_filter
   151285 echo stderr:; tee stderr <"$at_stderr"
   151286 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151287 at_fn_check_status 2 $at_status "$at_srcdir/c++.at:402"
   151288 $at_failed && at_fn_log_failure
   151289 $at_traceon; }
   151290 
   151291 { set +x
   151292 $as_echo "$at_srcdir/c++.at:402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151293 at_fn_check_prepare_trace "c++.at:402"
   151294 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151295 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151296 at_status=$? at_failed=false
   151297 $at_check_filter
   151298 echo >>"$at_stderr"; $as_echo "exception caught: syntax error
   151299 " | \
   151300   $at_diff - "$at_stderr" || at_failed=:
   151301 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151302 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:402"
   151303 $at_failed && at_fn_log_failure
   151304 $at_traceon; }
   151305 
   151306 
   151307 
   151308 { set +x
   151309 $as_echo "$at_srcdir/c++.at:406:  \$PREPARSER ./input aaaaE"
   151310 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:406"
   151311 ( $at_check_trace;  $PREPARSER ./input aaaaE
   151312 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151313 at_status=$? at_failed=false
   151314 $at_check_filter
   151315 echo stderr:; tee stderr <"$at_stderr"
   151316 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151317 at_fn_check_status 2 $at_status "$at_srcdir/c++.at:406"
   151318 $at_failed && at_fn_log_failure
   151319 $at_traceon; }
   151320 
   151321 { set +x
   151322 $as_echo "$at_srcdir/c++.at:406: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151323 at_fn_check_prepare_trace "c++.at:406"
   151324 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151326 at_status=$? at_failed=false
   151327 $at_check_filter
   151328 echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a'
   151329 " | \
   151330   $at_diff - "$at_stderr" || at_failed=:
   151331 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151332 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:406"
   151333 $at_failed && at_fn_log_failure
   151334 $at_traceon; }
   151335 
   151336 
   151337 
   151338 { set +x
   151339 $as_echo "$at_srcdir/c++.at:410:  \$PREPARSER ./input aaaaT"
   151340 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:410"
   151341 ( $at_check_trace;  $PREPARSER ./input aaaaT
   151342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151343 at_status=$? at_failed=false
   151344 $at_check_filter
   151345 echo stderr:; tee stderr <"$at_stderr"
   151346 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151347 at_fn_check_status 1 $at_status "$at_srcdir/c++.at:410"
   151348 $at_failed && at_fn_log_failure
   151349 $at_traceon; }
   151350 
   151351 { set +x
   151352 $as_echo "$at_srcdir/c++.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151353 at_fn_check_prepare_trace "c++.at:410"
   151354 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151356 at_status=$? at_failed=false
   151357 $at_check_filter
   151358 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151359 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151360 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:410"
   151361 $at_failed && at_fn_log_failure
   151362 $at_traceon; }
   151363 
   151364 
   151365 
   151366 # There is error-recovery, so exit success.
   151367 { set +x
   151368 $as_echo "$at_srcdir/c++.at:413:  \$PREPARSER ./input aaaaR"
   151369 at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:413"
   151370 ( $at_check_trace;  $PREPARSER ./input aaaaR
   151371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151372 at_status=$? at_failed=false
   151373 $at_check_filter
   151374 echo stderr:; tee stderr <"$at_stderr"
   151375 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151376 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:413"
   151377 $at_failed && at_fn_log_failure
   151378 $at_traceon; }
   151379 
   151380 { set +x
   151381 $as_echo "$at_srcdir/c++.at:413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   151382 at_fn_check_prepare_trace "c++.at:413"
   151383 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   151384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151385 at_status=$? at_failed=false
   151386 $at_check_filter
   151387 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151388 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151389 at_fn_check_status 0 $at_status "$at_srcdir/c++.at:413"
   151390 $at_failed && at_fn_log_failure
   151391 $at_traceon; }
   151392 
   151393 
   151394 
   151395 
   151396 
   151397   set +x
   151398   $at_times_p && times >"$at_times_file"
   151399 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   151400 read at_status <"$at_status_file"
   151401 #AT_STOP_306
   151402 #AT_START_307
   151403 at_fn_group_banner 307 'java.at:360' \
   151404   "Calculator " "                                    " 19
   151405 at_xfail=no
   151406 (
   151407   $as_echo "307. $at_setup_line: testing $at_desc ..."
   151408   $at_traceon
   151409 
   151410 
   151411 
   151412 
   151413 
   151414 cat >Calc.y <<'_ATEOF'
   151415 /* Infix notation calculator--calc */
   151416 %language "Java"
   151417 %name-prefix "Calc"
   151418 %define parser_class_name "Calc"
   151419 %define public
   151420 
   151421 
   151422 %code {
   151423 
   151424   public static void main (String args[]) throws IOException
   151425   {
   151426     CalcLexer l = new CalcLexer (System.in);
   151427     Calc p = new Calc (l);
   151428     p.parse ();
   151429   }
   151430 
   151431 }
   151432 
   151433 %code imports {
   151434   import java.io.StreamTokenizer;
   151435   import java.io.InputStream;
   151436   import java.io.InputStreamReader;
   151437   import java.io.Reader;
   151438   import java.io.IOException;
   151439 }
   151440 
   151441 /* Bison Declarations */
   151442 %token <Integer> NUM "number"
   151443 %type  <Integer> exp
   151444 
   151445 %nonassoc '=' /* comparison            */
   151446 %left '-' '+'
   151447 %left '*' '/'
   151448 %left NEG     /* negation--unary minus */
   151449 %right '^'    /* exponentiation        */
   151450 
   151451 /* Grammar follows */
   151452 %%
   151453 input:
   151454   line
   151455 | input line
   151456 ;
   151457 
   151458 line:
   151459   '\n'
   151460 | exp '\n'
   151461 | error '\n'
   151462 ;
   151463 
   151464 exp:
   151465   NUM                { $$ = $1;                                             }
   151466 | exp '=' exp
   151467   {
   151468     if ($1.intValue () != $3.intValue ())
   151469       yyerror ( "calc: error: " + $1 + " != " + $3);
   151470   }
   151471 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   151472 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   151473 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   151474 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   151475 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   151476 | exp '^' exp        { $$ = new Integer ((int)
   151477                                          Math.pow ($1.intValue (),
   151478                                                    $3.intValue ()));        }
   151479 | '(' exp ')'        { $$ = $2;                                             }
   151480 | '(' error ')'      { $$ = new Integer (1111);                             }
   151481 | '!'                { $$ = new Integer (0); return YYERROR;                }
   151482 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   151483 ;
   151484 
   151485 
   151486 %%
   151487 class CalcLexer implements Calc.Lexer {
   151488 
   151489   StreamTokenizer st;
   151490 
   151491   public CalcLexer (InputStream is)
   151492   {
   151493     st = new StreamTokenizer (new InputStreamReader (is));
   151494     st.resetSyntax ();
   151495     st.eolIsSignificant (true);
   151496     st.whitespaceChars (9, 9);
   151497     st.whitespaceChars (32, 32);
   151498     st.wordChars (48, 57);
   151499   }
   151500 
   151501 
   151502 
   151503   public void yyerror (String s)
   151504   {
   151505     System.err.println (s);
   151506   }
   151507 
   151508   Integer yylval;
   151509 
   151510   public Object getLVal() {
   151511     return yylval;
   151512   }
   151513 
   151514   public int yylex () throws IOException {
   151515     int ttype = st.nextToken ();
   151516 
   151517     if (ttype == st.TT_EOF)
   151518       return Calc.EOF;
   151519 
   151520     else if (ttype == st.TT_EOL)
   151521       {
   151522 
   151523         return (int) '\n';
   151524       }
   151525 
   151526     else if (ttype == st.TT_WORD)
   151527       {
   151528         yylval = new Integer (st.sval);
   151529         return Calc.NUM;
   151530       }
   151531 
   151532     else
   151533       return st.ttype;
   151534   }
   151535 
   151536 
   151537 
   151538 }
   151539 
   151540 
   151541 class Position {
   151542   public int line;
   151543   public int token;
   151544 
   151545   public Position ()
   151546   {
   151547     line = 0;
   151548     token = 0;
   151549   }
   151550 
   151551   public Position (int l, int t)
   151552   {
   151553     line = l;
   151554     token = t;
   151555   }
   151556 
   151557   public boolean equals (Position l)
   151558   {
   151559     return l.line == line && l.token == token;
   151560   }
   151561 
   151562   public String toString ()
   151563   {
   151564     return Integer.toString (line) + "." + Integer.toString(token);
   151565   }
   151566 
   151567   public int lineno ()
   151568   {
   151569     return line;
   151570   }
   151571 
   151572   public int token ()
   151573   {
   151574     return token;
   151575   }
   151576 }
   151577 
   151578 _ATEOF
   151579 
   151580 
   151581 
   151582 
   151583 
   151584 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   151585   at_save_special_files
   151586   mkdir xml-tests
   151587     # Don't combine these Bison invocations since we want to be sure that
   151588   # --report=all isn't required to get the full XML file.
   151589   { set +x
   151590 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   151591                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   151592 at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
   151593 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   151594                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   151595 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151596 at_status=$? at_failed=false
   151597 $at_check_filter
   151598 echo stderr:; cat "$at_stderr"
   151599 echo stdout:; cat "$at_stdout"
   151600 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151601 $at_failed && at_fn_log_failure
   151602 $at_traceon; }
   151603 
   151604   { set +x
   151605 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   151606 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
   151607 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   151608 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151609 at_status=$? at_failed=false
   151610 $at_check_filter
   151611 echo stderr:; cat "$at_stderr"
   151612 echo stdout:; cat "$at_stdout"
   151613 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151614 $at_failed && at_fn_log_failure
   151615 $at_traceon; }
   151616 
   151617     cp xml-tests/test.output expout
   151618   { set +x
   151619 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   151620              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   151621              xml-tests/test.xml"
   151622 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   151623 ( $at_check_trace; $XSLTPROC \
   151624              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   151625              xml-tests/test.xml
   151626 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151627 at_status=$? at_failed=false
   151628 $at_check_filter
   151629 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151630 $at_diff expout "$at_stdout" || at_failed=:
   151631 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151632 $at_failed && at_fn_log_failure
   151633 $at_traceon; }
   151634 
   151635   sort xml-tests/test.dot > expout
   151636   { set +x
   151637 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   151638              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   151639              xml-tests/test.xml | sort"
   151640 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   151641 ( $at_check_trace; $XSLTPROC \
   151642              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   151643              xml-tests/test.xml | sort
   151644 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151645 at_status=$? at_failed=false
   151646 $at_check_filter
   151647 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151648 $at_diff expout "$at_stdout" || at_failed=:
   151649 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151650 $at_failed && at_fn_log_failure
   151651 $at_traceon; }
   151652 
   151653   rm -rf xml-tests expout
   151654   at_restore_special_files
   151655 fi
   151656 { set +x
   151657 $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
   151658 at_fn_check_prepare_trace "java.at:360"
   151659 ( $at_check_trace; bison -o Calc.java Calc.y
   151660 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151661 at_status=$? at_failed=false
   151662 $at_check_filter
   151663 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151664 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151665 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151666 $at_failed && at_fn_log_failure
   151667 $at_traceon; }
   151668 
   151669 
   151670 
   151671 $as_echo "java.at:360" >"$at_check_line_file"
   151672 (test -z "$CONF_JAVAC") \
   151673   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   151674 $as_echo "java.at:360" >"$at_check_line_file"
   151675 (test -z "$CONF_JAVA") \
   151676   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   151677 { set +x
   151678 $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
   151679 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
   151680 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   151681 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151682 at_status=$? at_failed=false
   151683 $at_check_filter
   151684 echo stderr:; cat "$at_stderr"
   151685 echo stdout:; cat "$at_stdout"
   151686 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151687 $at_failed && at_fn_log_failure
   151688 $at_traceon; }
   151689 
   151690 
   151691 # Test the priorities.
   151692 cat >input <<'_ATEOF'
   151693 1 + 2 * 3 = 7
   151694 1 + 2 * -3 = -5
   151695 
   151696 -1^2 = -1
   151697 (-1)^2 = 1
   151698 
   151699 ---1 = -1
   151700 
   151701 1 - 2 - 3 = -4
   151702 1 - (2 - 3) = 2
   151703 
   151704 2^2^3 = 256
   151705 (2^2)^3 = 64
   151706 _ATEOF
   151707 
   151708 { set +x
   151709 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   151710 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   151711 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   151712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151713 at_status=$? at_failed=false
   151714 $at_check_filter
   151715 echo stderr:; tee stderr <"$at_stderr"
   151716 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151717 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151718 $at_failed && at_fn_log_failure
   151719 $at_traceon; }
   151720 
   151721 
   151722 
   151723 # Some syntax errors.
   151724 cat >input <<'_ATEOF'
   151725 0 0
   151726 _ATEOF
   151727 
   151728 { set +x
   151729 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   151730 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   151731 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   151732 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151733 at_status=$? at_failed=false
   151734 $at_check_filter
   151735 echo stderr:; tee stderr <"$at_stderr"
   151736 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151737 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151738 $at_failed && at_fn_log_failure
   151739 $at_traceon; }
   151740 
   151741 
   151742 # Normalize the observed and expected error messages, depending upon the
   151743 # options.
   151744 # 1. Create the reference error message.
   151745 cat >expout <<'_ATEOF'
   151746 1.2: syntax error, unexpected number
   151747 _ATEOF
   151748 
   151749 # 2. If locations are not used, remove them.
   151750 sed 's/^[-0-9.]*: //' expout >at-expout
   151751 mv at-expout expout
   151752 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   151753 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   151754 mv at-expout expout
   151755 # 4. Check
   151756 { set +x
   151757 $as_echo "$at_srcdir/java.at:360: cat stderr"
   151758 at_fn_check_prepare_trace "java.at:360"
   151759 ( $at_check_trace; cat stderr
   151760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151761 at_status=$? at_failed=false
   151762 $at_check_filter
   151763 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151764 $at_diff expout "$at_stdout" || at_failed=:
   151765 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151766 $at_failed && at_fn_log_failure
   151767 $at_traceon; }
   151768 
   151769 
   151770 cat >input <<'_ATEOF'
   151771 1//2
   151772 _ATEOF
   151773 
   151774 { set +x
   151775 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   151776 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   151777 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   151778 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151779 at_status=$? at_failed=false
   151780 $at_check_filter
   151781 echo stderr:; tee stderr <"$at_stderr"
   151782 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151783 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151784 $at_failed && at_fn_log_failure
   151785 $at_traceon; }
   151786 
   151787 
   151788 # Normalize the observed and expected error messages, depending upon the
   151789 # options.
   151790 # 1. Create the reference error message.
   151791 cat >expout <<'_ATEOF'
   151792 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   151793 _ATEOF
   151794 
   151795 # 2. If locations are not used, remove them.
   151796 sed 's/^[-0-9.]*: //' expout >at-expout
   151797 mv at-expout expout
   151798 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   151799 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   151800 mv at-expout expout
   151801 # 4. Check
   151802 { set +x
   151803 $as_echo "$at_srcdir/java.at:360: cat stderr"
   151804 at_fn_check_prepare_trace "java.at:360"
   151805 ( $at_check_trace; cat stderr
   151806 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151807 at_status=$? at_failed=false
   151808 $at_check_filter
   151809 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151810 $at_diff expout "$at_stdout" || at_failed=:
   151811 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151812 $at_failed && at_fn_log_failure
   151813 $at_traceon; }
   151814 
   151815 
   151816 cat >input <<'_ATEOF'
   151817 error
   151818 _ATEOF
   151819 
   151820 { set +x
   151821 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   151822 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   151823 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   151824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151825 at_status=$? at_failed=false
   151826 $at_check_filter
   151827 echo stderr:; tee stderr <"$at_stderr"
   151828 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151829 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151830 $at_failed && at_fn_log_failure
   151831 $at_traceon; }
   151832 
   151833 
   151834 # Normalize the observed and expected error messages, depending upon the
   151835 # options.
   151836 # 1. Create the reference error message.
   151837 cat >expout <<'_ATEOF'
   151838 1.1: syntax error, unexpected $undefined
   151839 _ATEOF
   151840 
   151841 # 2. If locations are not used, remove them.
   151842 sed 's/^[-0-9.]*: //' expout >at-expout
   151843 mv at-expout expout
   151844 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   151845 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   151846 mv at-expout expout
   151847 # 4. Check
   151848 { set +x
   151849 $as_echo "$at_srcdir/java.at:360: cat stderr"
   151850 at_fn_check_prepare_trace "java.at:360"
   151851 ( $at_check_trace; cat stderr
   151852 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151853 at_status=$? at_failed=false
   151854 $at_check_filter
   151855 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151856 $at_diff expout "$at_stdout" || at_failed=:
   151857 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151858 $at_failed && at_fn_log_failure
   151859 $at_traceon; }
   151860 
   151861 
   151862 cat >input <<'_ATEOF'
   151863 1 = 2 = 3
   151864 _ATEOF
   151865 
   151866 { set +x
   151867 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   151868 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   151869 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   151870 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151871 at_status=$? at_failed=false
   151872 $at_check_filter
   151873 echo stderr:; tee stderr <"$at_stderr"
   151874 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151875 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151876 $at_failed && at_fn_log_failure
   151877 $at_traceon; }
   151878 
   151879 
   151880 # Normalize the observed and expected error messages, depending upon the
   151881 # options.
   151882 # 1. Create the reference error message.
   151883 cat >expout <<'_ATEOF'
   151884 1.4: syntax error, unexpected '='
   151885 _ATEOF
   151886 
   151887 # 2. If locations are not used, remove them.
   151888 sed 's/^[-0-9.]*: //' expout >at-expout
   151889 mv at-expout expout
   151890 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   151891 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   151892 mv at-expout expout
   151893 # 4. Check
   151894 { set +x
   151895 $as_echo "$at_srcdir/java.at:360: cat stderr"
   151896 at_fn_check_prepare_trace "java.at:360"
   151897 ( $at_check_trace; cat stderr
   151898 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151899 at_status=$? at_failed=false
   151900 $at_check_filter
   151901 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151902 $at_diff expout "$at_stdout" || at_failed=:
   151903 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151904 $at_failed && at_fn_log_failure
   151905 $at_traceon; }
   151906 
   151907 
   151908 cat >input <<'_ATEOF'
   151909 
   151910 +1
   151911 _ATEOF
   151912 
   151913 { set +x
   151914 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   151915 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   151916 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   151917 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151918 at_status=$? at_failed=false
   151919 $at_check_filter
   151920 echo stderr:; tee stderr <"$at_stderr"
   151921 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151922 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151923 $at_failed && at_fn_log_failure
   151924 $at_traceon; }
   151925 
   151926 
   151927 # Normalize the observed and expected error messages, depending upon the
   151928 # options.
   151929 # 1. Create the reference error message.
   151930 cat >expout <<'_ATEOF'
   151931 2.1: syntax error, unexpected '+'
   151932 _ATEOF
   151933 
   151934 # 2. If locations are not used, remove them.
   151935 sed 's/^[-0-9.]*: //' expout >at-expout
   151936 mv at-expout expout
   151937 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   151938 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   151939 mv at-expout expout
   151940 # 4. Check
   151941 { set +x
   151942 $as_echo "$at_srcdir/java.at:360: cat stderr"
   151943 at_fn_check_prepare_trace "java.at:360"
   151944 ( $at_check_trace; cat stderr
   151945 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151946 at_status=$? at_failed=false
   151947 $at_check_filter
   151948 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151949 $at_diff expout "$at_stdout" || at_failed=:
   151950 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151951 $at_failed && at_fn_log_failure
   151952 $at_traceon; }
   151953 
   151954 
   151955 # Exercise error messages with EOF: work on an empty file.
   151956 { set +x
   151957 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   151958 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
   151959 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   151960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151961 at_status=$? at_failed=false
   151962 $at_check_filter
   151963 echo stderr:; tee stderr <"$at_stderr"
   151964 at_fn_diff_devnull "$at_stdout" || at_failed=:
   151965 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151966 $at_failed && at_fn_log_failure
   151967 $at_traceon; }
   151968 
   151969 
   151970 # Normalize the observed and expected error messages, depending upon the
   151971 # options.
   151972 # 1. Create the reference error message.
   151973 cat >expout <<'_ATEOF'
   151974 1.1: syntax error, unexpected end of input
   151975 _ATEOF
   151976 
   151977 # 2. If locations are not used, remove them.
   151978 sed 's/^[-0-9.]*: //' expout >at-expout
   151979 mv at-expout expout
   151980 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   151981 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   151982 mv at-expout expout
   151983 # 4. Check
   151984 { set +x
   151985 $as_echo "$at_srcdir/java.at:360: cat stderr"
   151986 at_fn_check_prepare_trace "java.at:360"
   151987 ( $at_check_trace; cat stderr
   151988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   151989 at_status=$? at_failed=false
   151990 $at_check_filter
   151991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   151992 $at_diff expout "$at_stdout" || at_failed=:
   151993 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   151994 $at_failed && at_fn_log_failure
   151995 $at_traceon; }
   151996 
   151997 
   151998 
   151999 # Exercise the error token: without it, we die at the first error,
   152000 # hence be sure to
   152001 #
   152002 # - have several errors which exercise different shift/discardings
   152003 #   - (): nothing to pop, nothing to discard
   152004 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   152005 #   - (* * *): nothing to pop, a lot to discard
   152006 #   - (1 + 2 * *): some to pop and discard
   152007 #
   152008 # - test the action associated to `error'
   152009 #
   152010 # - check the lookahead that triggers an error is not discarded
   152011 #   when we enter error recovery.  Below, the lookahead causing the
   152012 #   first error is ")", which is needed to recover from the error and
   152013 #   produce the "0" that triggers the "0 != 1" error.
   152014 #
   152015 cat >input <<'_ATEOF'
   152016 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   152017 _ATEOF
   152018 
   152019 { set +x
   152020 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152021 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152022 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152023 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152024 at_status=$? at_failed=false
   152025 $at_check_filter
   152026 echo stderr:; tee stderr <"$at_stderr"
   152027 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152028 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152029 $at_failed && at_fn_log_failure
   152030 $at_traceon; }
   152031 
   152032 
   152033 # Normalize the observed and expected error messages, depending upon the
   152034 # options.
   152035 # 1. Create the reference error message.
   152036 cat >expout <<'_ATEOF'
   152037 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   152038 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   152039 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   152040 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   152041 1.1-1.27: calc: error: 4444 != 1
   152042 _ATEOF
   152043 
   152044 # 2. If locations are not used, remove them.
   152045 sed 's/^[-0-9.]*: //' expout >at-expout
   152046 mv at-expout expout
   152047 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152048 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   152049 mv at-expout expout
   152050 # 4. Check
   152051 { set +x
   152052 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152053 at_fn_check_prepare_trace "java.at:360"
   152054 ( $at_check_trace; cat stderr
   152055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152056 at_status=$? at_failed=false
   152057 $at_check_filter
   152058 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152059 $at_diff expout "$at_stdout" || at_failed=:
   152060 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152061 $at_failed && at_fn_log_failure
   152062 $at_traceon; }
   152063 
   152064 
   152065 
   152066 # The same, but this time exercising explicitly triggered syntax errors.
   152067 # POSIX says the lookahead causing the error should not be discarded.
   152068 cat >input <<'_ATEOF'
   152069 (!) + (0 0) = 1
   152070 _ATEOF
   152071 
   152072 { set +x
   152073 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152074 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152075 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152077 at_status=$? at_failed=false
   152078 $at_check_filter
   152079 echo stderr:; tee stderr <"$at_stderr"
   152080 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152081 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152082 $at_failed && at_fn_log_failure
   152083 $at_traceon; }
   152084 
   152085 
   152086 # Normalize the observed and expected error messages, depending upon the
   152087 # options.
   152088 # 1. Create the reference error message.
   152089 cat >expout <<'_ATEOF'
   152090 1.7: syntax error, unexpected number
   152091 1.1-1.10: calc: error: 2222 != 1
   152092 _ATEOF
   152093 
   152094 # 2. If locations are not used, remove them.
   152095 sed 's/^[-0-9.]*: //' expout >at-expout
   152096 mv at-expout expout
   152097 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152098 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   152099 mv at-expout expout
   152100 # 4. Check
   152101 { set +x
   152102 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152103 at_fn_check_prepare_trace "java.at:360"
   152104 ( $at_check_trace; cat stderr
   152105 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152106 at_status=$? at_failed=false
   152107 $at_check_filter
   152108 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152109 $at_diff expout "$at_stdout" || at_failed=:
   152110 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152111 $at_failed && at_fn_log_failure
   152112 $at_traceon; }
   152113 
   152114 
   152115 cat >input <<'_ATEOF'
   152116 (- *) + (0 0) = 1
   152117 _ATEOF
   152118 
   152119 { set +x
   152120 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152121 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152122 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152123 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152124 at_status=$? at_failed=false
   152125 $at_check_filter
   152126 echo stderr:; tee stderr <"$at_stderr"
   152127 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152128 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152129 $at_failed && at_fn_log_failure
   152130 $at_traceon; }
   152131 
   152132 
   152133 # Normalize the observed and expected error messages, depending upon the
   152134 # options.
   152135 # 1. Create the reference error message.
   152136 cat >expout <<'_ATEOF'
   152137 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   152138 1.8: syntax error, unexpected number
   152139 1.1-1.11: calc: error: 2222 != 1
   152140 _ATEOF
   152141 
   152142 # 2. If locations are not used, remove them.
   152143 sed 's/^[-0-9.]*: //' expout >at-expout
   152144 mv at-expout expout
   152145 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152146 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   152147 mv at-expout expout
   152148 # 4. Check
   152149 { set +x
   152150 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152151 at_fn_check_prepare_trace "java.at:360"
   152152 ( $at_check_trace; cat stderr
   152153 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152154 at_status=$? at_failed=false
   152155 $at_check_filter
   152156 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152157 $at_diff expout "$at_stdout" || at_failed=:
   152158 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152159 $at_failed && at_fn_log_failure
   152160 $at_traceon; }
   152161 
   152162 
   152163 
   152164 
   152165   set +x
   152166   $at_times_p && times >"$at_times_file"
   152167 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   152168 read at_status <"$at_status_file"
   152169 #AT_STOP_307
   152170 #AT_START_308
   152171 at_fn_group_banner 308 'java.at:360' \
   152172   "Calculator %error-verbose " "                     " 19
   152173 at_xfail=no
   152174 (
   152175   $as_echo "308. $at_setup_line: testing $at_desc ..."
   152176   $at_traceon
   152177 
   152178 
   152179 
   152180 
   152181 
   152182 cat >Calc.y <<'_ATEOF'
   152183 /* Infix notation calculator--calc */
   152184 %language "Java"
   152185 %name-prefix "Calc"
   152186 %define parser_class_name "Calc"
   152187 %define public
   152188 
   152189 %error-verbose
   152190 %code {
   152191 
   152192   public static void main (String args[]) throws IOException
   152193   {
   152194     CalcLexer l = new CalcLexer (System.in);
   152195     Calc p = new Calc (l);
   152196     p.parse ();
   152197   }
   152198 
   152199 }
   152200 
   152201 %code imports {
   152202   import java.io.StreamTokenizer;
   152203   import java.io.InputStream;
   152204   import java.io.InputStreamReader;
   152205   import java.io.Reader;
   152206   import java.io.IOException;
   152207 }
   152208 
   152209 /* Bison Declarations */
   152210 %token <Integer> NUM "number"
   152211 %type  <Integer> exp
   152212 
   152213 %nonassoc '=' /* comparison            */
   152214 %left '-' '+'
   152215 %left '*' '/'
   152216 %left NEG     /* negation--unary minus */
   152217 %right '^'    /* exponentiation        */
   152218 
   152219 /* Grammar follows */
   152220 %%
   152221 input:
   152222   line
   152223 | input line
   152224 ;
   152225 
   152226 line:
   152227   '\n'
   152228 | exp '\n'
   152229 | error '\n'
   152230 ;
   152231 
   152232 exp:
   152233   NUM                { $$ = $1;                                             }
   152234 | exp '=' exp
   152235   {
   152236     if ($1.intValue () != $3.intValue ())
   152237       yyerror ( "calc: error: " + $1 + " != " + $3);
   152238   }
   152239 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   152240 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   152241 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   152242 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   152243 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   152244 | exp '^' exp        { $$ = new Integer ((int)
   152245                                          Math.pow ($1.intValue (),
   152246                                                    $3.intValue ()));        }
   152247 | '(' exp ')'        { $$ = $2;                                             }
   152248 | '(' error ')'      { $$ = new Integer (1111);                             }
   152249 | '!'                { $$ = new Integer (0); return YYERROR;                }
   152250 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   152251 ;
   152252 
   152253 
   152254 %%
   152255 class CalcLexer implements Calc.Lexer {
   152256 
   152257   StreamTokenizer st;
   152258 
   152259   public CalcLexer (InputStream is)
   152260   {
   152261     st = new StreamTokenizer (new InputStreamReader (is));
   152262     st.resetSyntax ();
   152263     st.eolIsSignificant (true);
   152264     st.whitespaceChars (9, 9);
   152265     st.whitespaceChars (32, 32);
   152266     st.wordChars (48, 57);
   152267   }
   152268 
   152269 
   152270 
   152271   public void yyerror (String s)
   152272   {
   152273     System.err.println (s);
   152274   }
   152275 
   152276   Integer yylval;
   152277 
   152278   public Object getLVal() {
   152279     return yylval;
   152280   }
   152281 
   152282   public int yylex () throws IOException {
   152283     int ttype = st.nextToken ();
   152284 
   152285     if (ttype == st.TT_EOF)
   152286       return Calc.EOF;
   152287 
   152288     else if (ttype == st.TT_EOL)
   152289       {
   152290 
   152291         return (int) '\n';
   152292       }
   152293 
   152294     else if (ttype == st.TT_WORD)
   152295       {
   152296         yylval = new Integer (st.sval);
   152297         return Calc.NUM;
   152298       }
   152299 
   152300     else
   152301       return st.ttype;
   152302   }
   152303 
   152304 
   152305 
   152306 }
   152307 
   152308 
   152309 class Position {
   152310   public int line;
   152311   public int token;
   152312 
   152313   public Position ()
   152314   {
   152315     line = 0;
   152316     token = 0;
   152317   }
   152318 
   152319   public Position (int l, int t)
   152320   {
   152321     line = l;
   152322     token = t;
   152323   }
   152324 
   152325   public boolean equals (Position l)
   152326   {
   152327     return l.line == line && l.token == token;
   152328   }
   152329 
   152330   public String toString ()
   152331   {
   152332     return Integer.toString (line) + "." + Integer.toString(token);
   152333   }
   152334 
   152335   public int lineno ()
   152336   {
   152337     return line;
   152338   }
   152339 
   152340   public int token ()
   152341   {
   152342     return token;
   152343   }
   152344 }
   152345 
   152346 _ATEOF
   152347 
   152348 
   152349 
   152350 
   152351 
   152352 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   152353   at_save_special_files
   152354   mkdir xml-tests
   152355     # Don't combine these Bison invocations since we want to be sure that
   152356   # --report=all isn't required to get the full XML file.
   152357   { set +x
   152358 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   152359                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   152360 at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
   152361 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   152362                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   152363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152364 at_status=$? at_failed=false
   152365 $at_check_filter
   152366 echo stderr:; cat "$at_stderr"
   152367 echo stdout:; cat "$at_stdout"
   152368 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152369 $at_failed && at_fn_log_failure
   152370 $at_traceon; }
   152371 
   152372   { set +x
   152373 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   152374 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
   152375 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   152376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152377 at_status=$? at_failed=false
   152378 $at_check_filter
   152379 echo stderr:; cat "$at_stderr"
   152380 echo stdout:; cat "$at_stdout"
   152381 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152382 $at_failed && at_fn_log_failure
   152383 $at_traceon; }
   152384 
   152385     cp xml-tests/test.output expout
   152386   { set +x
   152387 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   152388              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   152389              xml-tests/test.xml"
   152390 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   152391 ( $at_check_trace; $XSLTPROC \
   152392              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   152393              xml-tests/test.xml
   152394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152395 at_status=$? at_failed=false
   152396 $at_check_filter
   152397 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152398 $at_diff expout "$at_stdout" || at_failed=:
   152399 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152400 $at_failed && at_fn_log_failure
   152401 $at_traceon; }
   152402 
   152403   sort xml-tests/test.dot > expout
   152404   { set +x
   152405 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   152406              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   152407              xml-tests/test.xml | sort"
   152408 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   152409 ( $at_check_trace; $XSLTPROC \
   152410              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   152411              xml-tests/test.xml | sort
   152412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152413 at_status=$? at_failed=false
   152414 $at_check_filter
   152415 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152416 $at_diff expout "$at_stdout" || at_failed=:
   152417 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152418 $at_failed && at_fn_log_failure
   152419 $at_traceon; }
   152420 
   152421   rm -rf xml-tests expout
   152422   at_restore_special_files
   152423 fi
   152424 { set +x
   152425 $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
   152426 at_fn_check_prepare_trace "java.at:360"
   152427 ( $at_check_trace; bison -o Calc.java Calc.y
   152428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152429 at_status=$? at_failed=false
   152430 $at_check_filter
   152431 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152432 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152433 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152434 $at_failed && at_fn_log_failure
   152435 $at_traceon; }
   152436 
   152437 
   152438 
   152439 $as_echo "java.at:360" >"$at_check_line_file"
   152440 (test -z "$CONF_JAVAC") \
   152441   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   152442 $as_echo "java.at:360" >"$at_check_line_file"
   152443 (test -z "$CONF_JAVA") \
   152444   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   152445 { set +x
   152446 $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
   152447 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
   152448 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   152449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152450 at_status=$? at_failed=false
   152451 $at_check_filter
   152452 echo stderr:; cat "$at_stderr"
   152453 echo stdout:; cat "$at_stdout"
   152454 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152455 $at_failed && at_fn_log_failure
   152456 $at_traceon; }
   152457 
   152458 
   152459 # Test the priorities.
   152460 cat >input <<'_ATEOF'
   152461 1 + 2 * 3 = 7
   152462 1 + 2 * -3 = -5
   152463 
   152464 -1^2 = -1
   152465 (-1)^2 = 1
   152466 
   152467 ---1 = -1
   152468 
   152469 1 - 2 - 3 = -4
   152470 1 - (2 - 3) = 2
   152471 
   152472 2^2^3 = 256
   152473 (2^2)^3 = 64
   152474 _ATEOF
   152475 
   152476 { set +x
   152477 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152478 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152479 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152480 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152481 at_status=$? at_failed=false
   152482 $at_check_filter
   152483 echo stderr:; tee stderr <"$at_stderr"
   152484 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152485 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152486 $at_failed && at_fn_log_failure
   152487 $at_traceon; }
   152488 
   152489 
   152490 
   152491 # Some syntax errors.
   152492 cat >input <<'_ATEOF'
   152493 0 0
   152494 _ATEOF
   152495 
   152496 { set +x
   152497 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152498 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152499 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152500 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152501 at_status=$? at_failed=false
   152502 $at_check_filter
   152503 echo stderr:; tee stderr <"$at_stderr"
   152504 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152505 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152506 $at_failed && at_fn_log_failure
   152507 $at_traceon; }
   152508 
   152509 
   152510 # Normalize the observed and expected error messages, depending upon the
   152511 # options.
   152512 # 1. Create the reference error message.
   152513 cat >expout <<'_ATEOF'
   152514 1.2: syntax error, unexpected number
   152515 _ATEOF
   152516 
   152517 # 2. If locations are not used, remove them.
   152518 sed 's/^[-0-9.]*: //' expout >at-expout
   152519 mv at-expout expout
   152520 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152521 
   152522 # 4. Check
   152523 { set +x
   152524 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152525 at_fn_check_prepare_trace "java.at:360"
   152526 ( $at_check_trace; cat stderr
   152527 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152528 at_status=$? at_failed=false
   152529 $at_check_filter
   152530 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152531 $at_diff expout "$at_stdout" || at_failed=:
   152532 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152533 $at_failed && at_fn_log_failure
   152534 $at_traceon; }
   152535 
   152536 
   152537 cat >input <<'_ATEOF'
   152538 1//2
   152539 _ATEOF
   152540 
   152541 { set +x
   152542 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152543 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152544 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152545 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152546 at_status=$? at_failed=false
   152547 $at_check_filter
   152548 echo stderr:; tee stderr <"$at_stderr"
   152549 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152550 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152551 $at_failed && at_fn_log_failure
   152552 $at_traceon; }
   152553 
   152554 
   152555 # Normalize the observed and expected error messages, depending upon the
   152556 # options.
   152557 # 1. Create the reference error message.
   152558 cat >expout <<'_ATEOF'
   152559 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   152560 _ATEOF
   152561 
   152562 # 2. If locations are not used, remove them.
   152563 sed 's/^[-0-9.]*: //' expout >at-expout
   152564 mv at-expout expout
   152565 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152566 
   152567 # 4. Check
   152568 { set +x
   152569 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152570 at_fn_check_prepare_trace "java.at:360"
   152571 ( $at_check_trace; cat stderr
   152572 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152573 at_status=$? at_failed=false
   152574 $at_check_filter
   152575 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152576 $at_diff expout "$at_stdout" || at_failed=:
   152577 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152578 $at_failed && at_fn_log_failure
   152579 $at_traceon; }
   152580 
   152581 
   152582 cat >input <<'_ATEOF'
   152583 error
   152584 _ATEOF
   152585 
   152586 { set +x
   152587 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152588 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152589 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152590 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152591 at_status=$? at_failed=false
   152592 $at_check_filter
   152593 echo stderr:; tee stderr <"$at_stderr"
   152594 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152595 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152596 $at_failed && at_fn_log_failure
   152597 $at_traceon; }
   152598 
   152599 
   152600 # Normalize the observed and expected error messages, depending upon the
   152601 # options.
   152602 # 1. Create the reference error message.
   152603 cat >expout <<'_ATEOF'
   152604 1.1: syntax error, unexpected $undefined
   152605 _ATEOF
   152606 
   152607 # 2. If locations are not used, remove them.
   152608 sed 's/^[-0-9.]*: //' expout >at-expout
   152609 mv at-expout expout
   152610 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152611 
   152612 # 4. Check
   152613 { set +x
   152614 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152615 at_fn_check_prepare_trace "java.at:360"
   152616 ( $at_check_trace; cat stderr
   152617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152618 at_status=$? at_failed=false
   152619 $at_check_filter
   152620 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152621 $at_diff expout "$at_stdout" || at_failed=:
   152622 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152623 $at_failed && at_fn_log_failure
   152624 $at_traceon; }
   152625 
   152626 
   152627 cat >input <<'_ATEOF'
   152628 1 = 2 = 3
   152629 _ATEOF
   152630 
   152631 { set +x
   152632 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152633 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152634 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152635 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152636 at_status=$? at_failed=false
   152637 $at_check_filter
   152638 echo stderr:; tee stderr <"$at_stderr"
   152639 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152640 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152641 $at_failed && at_fn_log_failure
   152642 $at_traceon; }
   152643 
   152644 
   152645 # Normalize the observed and expected error messages, depending upon the
   152646 # options.
   152647 # 1. Create the reference error message.
   152648 cat >expout <<'_ATEOF'
   152649 1.4: syntax error, unexpected '='
   152650 _ATEOF
   152651 
   152652 # 2. If locations are not used, remove them.
   152653 sed 's/^[-0-9.]*: //' expout >at-expout
   152654 mv at-expout expout
   152655 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152656 
   152657 # 4. Check
   152658 { set +x
   152659 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152660 at_fn_check_prepare_trace "java.at:360"
   152661 ( $at_check_trace; cat stderr
   152662 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152663 at_status=$? at_failed=false
   152664 $at_check_filter
   152665 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152666 $at_diff expout "$at_stdout" || at_failed=:
   152667 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152668 $at_failed && at_fn_log_failure
   152669 $at_traceon; }
   152670 
   152671 
   152672 cat >input <<'_ATEOF'
   152673 
   152674 +1
   152675 _ATEOF
   152676 
   152677 { set +x
   152678 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152679 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152680 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152681 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152682 at_status=$? at_failed=false
   152683 $at_check_filter
   152684 echo stderr:; tee stderr <"$at_stderr"
   152685 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152686 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152687 $at_failed && at_fn_log_failure
   152688 $at_traceon; }
   152689 
   152690 
   152691 # Normalize the observed and expected error messages, depending upon the
   152692 # options.
   152693 # 1. Create the reference error message.
   152694 cat >expout <<'_ATEOF'
   152695 2.1: syntax error, unexpected '+'
   152696 _ATEOF
   152697 
   152698 # 2. If locations are not used, remove them.
   152699 sed 's/^[-0-9.]*: //' expout >at-expout
   152700 mv at-expout expout
   152701 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152702 
   152703 # 4. Check
   152704 { set +x
   152705 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152706 at_fn_check_prepare_trace "java.at:360"
   152707 ( $at_check_trace; cat stderr
   152708 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152709 at_status=$? at_failed=false
   152710 $at_check_filter
   152711 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152712 $at_diff expout "$at_stdout" || at_failed=:
   152713 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152714 $at_failed && at_fn_log_failure
   152715 $at_traceon; }
   152716 
   152717 
   152718 # Exercise error messages with EOF: work on an empty file.
   152719 { set +x
   152720 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   152721 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
   152722 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   152723 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152724 at_status=$? at_failed=false
   152725 $at_check_filter
   152726 echo stderr:; tee stderr <"$at_stderr"
   152727 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152728 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152729 $at_failed && at_fn_log_failure
   152730 $at_traceon; }
   152731 
   152732 
   152733 # Normalize the observed and expected error messages, depending upon the
   152734 # options.
   152735 # 1. Create the reference error message.
   152736 cat >expout <<'_ATEOF'
   152737 1.1: syntax error, unexpected end of input
   152738 _ATEOF
   152739 
   152740 # 2. If locations are not used, remove them.
   152741 sed 's/^[-0-9.]*: //' expout >at-expout
   152742 mv at-expout expout
   152743 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152744 
   152745 # 4. Check
   152746 { set +x
   152747 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152748 at_fn_check_prepare_trace "java.at:360"
   152749 ( $at_check_trace; cat stderr
   152750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152751 at_status=$? at_failed=false
   152752 $at_check_filter
   152753 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152754 $at_diff expout "$at_stdout" || at_failed=:
   152755 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152756 $at_failed && at_fn_log_failure
   152757 $at_traceon; }
   152758 
   152759 
   152760 
   152761 # Exercise the error token: without it, we die at the first error,
   152762 # hence be sure to
   152763 #
   152764 # - have several errors which exercise different shift/discardings
   152765 #   - (): nothing to pop, nothing to discard
   152766 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   152767 #   - (* * *): nothing to pop, a lot to discard
   152768 #   - (1 + 2 * *): some to pop and discard
   152769 #
   152770 # - test the action associated to `error'
   152771 #
   152772 # - check the lookahead that triggers an error is not discarded
   152773 #   when we enter error recovery.  Below, the lookahead causing the
   152774 #   first error is ")", which is needed to recover from the error and
   152775 #   produce the "0" that triggers the "0 != 1" error.
   152776 #
   152777 cat >input <<'_ATEOF'
   152778 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   152779 _ATEOF
   152780 
   152781 { set +x
   152782 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152783 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152784 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152785 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152786 at_status=$? at_failed=false
   152787 $at_check_filter
   152788 echo stderr:; tee stderr <"$at_stderr"
   152789 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152790 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152791 $at_failed && at_fn_log_failure
   152792 $at_traceon; }
   152793 
   152794 
   152795 # Normalize the observed and expected error messages, depending upon the
   152796 # options.
   152797 # 1. Create the reference error message.
   152798 cat >expout <<'_ATEOF'
   152799 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   152800 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   152801 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   152802 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   152803 1.1-1.27: calc: error: 4444 != 1
   152804 _ATEOF
   152805 
   152806 # 2. If locations are not used, remove them.
   152807 sed 's/^[-0-9.]*: //' expout >at-expout
   152808 mv at-expout expout
   152809 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152810 
   152811 # 4. Check
   152812 { set +x
   152813 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152814 at_fn_check_prepare_trace "java.at:360"
   152815 ( $at_check_trace; cat stderr
   152816 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152817 at_status=$? at_failed=false
   152818 $at_check_filter
   152819 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152820 $at_diff expout "$at_stdout" || at_failed=:
   152821 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152822 $at_failed && at_fn_log_failure
   152823 $at_traceon; }
   152824 
   152825 
   152826 
   152827 # The same, but this time exercising explicitly triggered syntax errors.
   152828 # POSIX says the lookahead causing the error should not be discarded.
   152829 cat >input <<'_ATEOF'
   152830 (!) + (0 0) = 1
   152831 _ATEOF
   152832 
   152833 { set +x
   152834 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152835 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152836 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152838 at_status=$? at_failed=false
   152839 $at_check_filter
   152840 echo stderr:; tee stderr <"$at_stderr"
   152841 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152842 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152843 $at_failed && at_fn_log_failure
   152844 $at_traceon; }
   152845 
   152846 
   152847 # Normalize the observed and expected error messages, depending upon the
   152848 # options.
   152849 # 1. Create the reference error message.
   152850 cat >expout <<'_ATEOF'
   152851 1.7: syntax error, unexpected number
   152852 1.1-1.10: calc: error: 2222 != 1
   152853 _ATEOF
   152854 
   152855 # 2. If locations are not used, remove them.
   152856 sed 's/^[-0-9.]*: //' expout >at-expout
   152857 mv at-expout expout
   152858 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152859 
   152860 # 4. Check
   152861 { set +x
   152862 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152863 at_fn_check_prepare_trace "java.at:360"
   152864 ( $at_check_trace; cat stderr
   152865 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152866 at_status=$? at_failed=false
   152867 $at_check_filter
   152868 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152869 $at_diff expout "$at_stdout" || at_failed=:
   152870 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152871 $at_failed && at_fn_log_failure
   152872 $at_traceon; }
   152873 
   152874 
   152875 cat >input <<'_ATEOF'
   152876 (- *) + (0 0) = 1
   152877 _ATEOF
   152878 
   152879 { set +x
   152880 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   152881 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   152882 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   152883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152884 at_status=$? at_failed=false
   152885 $at_check_filter
   152886 echo stderr:; tee stderr <"$at_stderr"
   152887 at_fn_diff_devnull "$at_stdout" || at_failed=:
   152888 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152889 $at_failed && at_fn_log_failure
   152890 $at_traceon; }
   152891 
   152892 
   152893 # Normalize the observed and expected error messages, depending upon the
   152894 # options.
   152895 # 1. Create the reference error message.
   152896 cat >expout <<'_ATEOF'
   152897 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   152898 1.8: syntax error, unexpected number
   152899 1.1-1.11: calc: error: 2222 != 1
   152900 _ATEOF
   152901 
   152902 # 2. If locations are not used, remove them.
   152903 sed 's/^[-0-9.]*: //' expout >at-expout
   152904 mv at-expout expout
   152905 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   152906 
   152907 # 4. Check
   152908 { set +x
   152909 $as_echo "$at_srcdir/java.at:360: cat stderr"
   152910 at_fn_check_prepare_trace "java.at:360"
   152911 ( $at_check_trace; cat stderr
   152912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   152913 at_status=$? at_failed=false
   152914 $at_check_filter
   152915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   152916 $at_diff expout "$at_stdout" || at_failed=:
   152917 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   152918 $at_failed && at_fn_log_failure
   152919 $at_traceon; }
   152920 
   152921 
   152922 
   152923 
   152924   set +x
   152925   $at_times_p && times >"$at_times_file"
   152926 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   152927 read at_status <"$at_status_file"
   152928 #AT_STOP_308
   152929 #AT_START_309
   152930 at_fn_group_banner 309 'java.at:360' \
   152931   "Calculator %locations " "                         " 19
   152932 at_xfail=no
   152933 (
   152934   $as_echo "309. $at_setup_line: testing $at_desc ..."
   152935   $at_traceon
   152936 
   152937 
   152938 
   152939 
   152940 
   152941 cat >Calc.y <<'_ATEOF'
   152942 /* Infix notation calculator--calc */
   152943 %language "Java"
   152944 %name-prefix "Calc"
   152945 %define parser_class_name "Calc"
   152946 %define public
   152947 
   152948 %locations
   152949 %code {
   152950 
   152951   public static void main (String args[]) throws IOException
   152952   {
   152953     CalcLexer l = new CalcLexer (System.in);
   152954     Calc p = new Calc (l);
   152955     p.parse ();
   152956   }
   152957 
   152958 }
   152959 
   152960 %code imports {
   152961   import java.io.StreamTokenizer;
   152962   import java.io.InputStream;
   152963   import java.io.InputStreamReader;
   152964   import java.io.Reader;
   152965   import java.io.IOException;
   152966 }
   152967 
   152968 /* Bison Declarations */
   152969 %token <Integer> NUM "number"
   152970 %type  <Integer> exp
   152971 
   152972 %nonassoc '=' /* comparison            */
   152973 %left '-' '+'
   152974 %left '*' '/'
   152975 %left NEG     /* negation--unary minus */
   152976 %right '^'    /* exponentiation        */
   152977 
   152978 /* Grammar follows */
   152979 %%
   152980 input:
   152981   line
   152982 | input line
   152983 ;
   152984 
   152985 line:
   152986   '\n'
   152987 | exp '\n'
   152988 | error '\n'
   152989 ;
   152990 
   152991 exp:
   152992   NUM                { $$ = $1;                                             }
   152993 | exp '=' exp
   152994   {
   152995     if ($1.intValue () != $3.intValue ())
   152996       yyerror (@$, "calc: error: " + $1 + " != " + $3);
   152997   }
   152998 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   152999 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   153000 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   153001 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   153002 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   153003 | exp '^' exp        { $$ = new Integer ((int)
   153004                                          Math.pow ($1.intValue (),
   153005                                                    $3.intValue ()));        }
   153006 | '(' exp ')'        { $$ = $2;                                             }
   153007 | '(' error ')'      { $$ = new Integer (1111);                             }
   153008 | '!'                { $$ = new Integer (0); return YYERROR;                }
   153009 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   153010 ;
   153011 
   153012 
   153013 %%
   153014 class CalcLexer implements Calc.Lexer {
   153015 
   153016   StreamTokenizer st;
   153017 
   153018   public CalcLexer (InputStream is)
   153019   {
   153020     st = new StreamTokenizer (new InputStreamReader (is));
   153021     st.resetSyntax ();
   153022     st.eolIsSignificant (true);
   153023     st.whitespaceChars (9, 9);
   153024     st.whitespaceChars (32, 32);
   153025     st.wordChars (48, 57);
   153026   }
   153027 
   153028 
   153029   Position yypos = new Position (1, 0);
   153030 
   153031   public Position getStartPos() {
   153032     return yypos;
   153033   }
   153034 
   153035   public Position getEndPos() {
   153036     return yypos;
   153037   }
   153038 
   153039   public void yyerror (Calc.Location l, String s)
   153040   {
   153041     if (l == null)
   153042       System.err.println (s);
   153043     else
   153044       System.err.println (l + ": " + s);
   153045   }
   153046 
   153047 
   153048   Integer yylval;
   153049 
   153050   public Object getLVal() {
   153051     return yylval;
   153052   }
   153053 
   153054   public int yylex () throws IOException {
   153055     int ttype = st.nextToken ();
   153056     yypos = new Position (yypos.lineno (),
   153057                                             yypos.token () + 1);
   153058     if (ttype == st.TT_EOF)
   153059       return Calc.EOF;
   153060 
   153061     else if (ttype == st.TT_EOL)
   153062       {
   153063         yypos = new Position (yypos.lineno () + 1, 0);
   153064         return (int) '\n';
   153065       }
   153066 
   153067     else if (ttype == st.TT_WORD)
   153068       {
   153069         yylval = new Integer (st.sval);
   153070         return Calc.NUM;
   153071       }
   153072 
   153073     else
   153074       return st.ttype;
   153075   }
   153076 
   153077 
   153078 
   153079 }
   153080 
   153081 
   153082 class Position {
   153083   public int line;
   153084   public int token;
   153085 
   153086   public Position ()
   153087   {
   153088     line = 0;
   153089     token = 0;
   153090   }
   153091 
   153092   public Position (int l, int t)
   153093   {
   153094     line = l;
   153095     token = t;
   153096   }
   153097 
   153098   public boolean equals (Position l)
   153099   {
   153100     return l.line == line && l.token == token;
   153101   }
   153102 
   153103   public String toString ()
   153104   {
   153105     return Integer.toString (line) + "." + Integer.toString(token);
   153106   }
   153107 
   153108   public int lineno ()
   153109   {
   153110     return line;
   153111   }
   153112 
   153113   public int token ()
   153114   {
   153115     return token;
   153116   }
   153117 }
   153118 
   153119 _ATEOF
   153120 
   153121 
   153122 
   153123 
   153124 
   153125 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   153126   at_save_special_files
   153127   mkdir xml-tests
   153128     # Don't combine these Bison invocations since we want to be sure that
   153129   # --report=all isn't required to get the full XML file.
   153130   { set +x
   153131 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   153132                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   153133 at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
   153134 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   153135                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   153136 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153137 at_status=$? at_failed=false
   153138 $at_check_filter
   153139 echo stderr:; cat "$at_stderr"
   153140 echo stdout:; cat "$at_stdout"
   153141 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153142 $at_failed && at_fn_log_failure
   153143 $at_traceon; }
   153144 
   153145   { set +x
   153146 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   153147 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
   153148 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   153149 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153150 at_status=$? at_failed=false
   153151 $at_check_filter
   153152 echo stderr:; cat "$at_stderr"
   153153 echo stdout:; cat "$at_stdout"
   153154 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153155 $at_failed && at_fn_log_failure
   153156 $at_traceon; }
   153157 
   153158     cp xml-tests/test.output expout
   153159   { set +x
   153160 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   153161              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   153162              xml-tests/test.xml"
   153163 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   153164 ( $at_check_trace; $XSLTPROC \
   153165              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   153166              xml-tests/test.xml
   153167 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153168 at_status=$? at_failed=false
   153169 $at_check_filter
   153170 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153171 $at_diff expout "$at_stdout" || at_failed=:
   153172 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153173 $at_failed && at_fn_log_failure
   153174 $at_traceon; }
   153175 
   153176   sort xml-tests/test.dot > expout
   153177   { set +x
   153178 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   153179              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   153180              xml-tests/test.xml | sort"
   153181 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   153182 ( $at_check_trace; $XSLTPROC \
   153183              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   153184              xml-tests/test.xml | sort
   153185 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153186 at_status=$? at_failed=false
   153187 $at_check_filter
   153188 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153189 $at_diff expout "$at_stdout" || at_failed=:
   153190 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153191 $at_failed && at_fn_log_failure
   153192 $at_traceon; }
   153193 
   153194   rm -rf xml-tests expout
   153195   at_restore_special_files
   153196 fi
   153197 { set +x
   153198 $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
   153199 at_fn_check_prepare_trace "java.at:360"
   153200 ( $at_check_trace; bison -o Calc.java Calc.y
   153201 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153202 at_status=$? at_failed=false
   153203 $at_check_filter
   153204 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153205 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153206 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153207 $at_failed && at_fn_log_failure
   153208 $at_traceon; }
   153209 
   153210 
   153211 
   153212 $as_echo "java.at:360" >"$at_check_line_file"
   153213 (test -z "$CONF_JAVAC") \
   153214   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   153215 $as_echo "java.at:360" >"$at_check_line_file"
   153216 (test -z "$CONF_JAVA") \
   153217   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   153218 { set +x
   153219 $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
   153220 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
   153221 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   153222 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153223 at_status=$? at_failed=false
   153224 $at_check_filter
   153225 echo stderr:; cat "$at_stderr"
   153226 echo stdout:; cat "$at_stdout"
   153227 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153228 $at_failed && at_fn_log_failure
   153229 $at_traceon; }
   153230 
   153231 
   153232 # Test the priorities.
   153233 cat >input <<'_ATEOF'
   153234 1 + 2 * 3 = 7
   153235 1 + 2 * -3 = -5
   153236 
   153237 -1^2 = -1
   153238 (-1)^2 = 1
   153239 
   153240 ---1 = -1
   153241 
   153242 1 - 2 - 3 = -4
   153243 1 - (2 - 3) = 2
   153244 
   153245 2^2^3 = 256
   153246 (2^2)^3 = 64
   153247 _ATEOF
   153248 
   153249 { set +x
   153250 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153251 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153252 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153253 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153254 at_status=$? at_failed=false
   153255 $at_check_filter
   153256 echo stderr:; tee stderr <"$at_stderr"
   153257 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153258 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153259 $at_failed && at_fn_log_failure
   153260 $at_traceon; }
   153261 
   153262 
   153263 
   153264 # Some syntax errors.
   153265 cat >input <<'_ATEOF'
   153266 0 0
   153267 _ATEOF
   153268 
   153269 { set +x
   153270 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153271 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153272 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153273 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153274 at_status=$? at_failed=false
   153275 $at_check_filter
   153276 echo stderr:; tee stderr <"$at_stderr"
   153277 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153278 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153279 $at_failed && at_fn_log_failure
   153280 $at_traceon; }
   153281 
   153282 
   153283 # Normalize the observed and expected error messages, depending upon the
   153284 # options.
   153285 # 1. Create the reference error message.
   153286 cat >expout <<'_ATEOF'
   153287 1.2: syntax error, unexpected number
   153288 _ATEOF
   153289 
   153290 # 2. If locations are not used, remove them.
   153291 
   153292 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153293 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153294 mv at-expout expout
   153295 # 4. Check
   153296 { set +x
   153297 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153298 at_fn_check_prepare_trace "java.at:360"
   153299 ( $at_check_trace; cat stderr
   153300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153301 at_status=$? at_failed=false
   153302 $at_check_filter
   153303 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153304 $at_diff expout "$at_stdout" || at_failed=:
   153305 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153306 $at_failed && at_fn_log_failure
   153307 $at_traceon; }
   153308 
   153309 
   153310 cat >input <<'_ATEOF'
   153311 1//2
   153312 _ATEOF
   153313 
   153314 { set +x
   153315 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153316 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153317 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153318 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153319 at_status=$? at_failed=false
   153320 $at_check_filter
   153321 echo stderr:; tee stderr <"$at_stderr"
   153322 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153323 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153324 $at_failed && at_fn_log_failure
   153325 $at_traceon; }
   153326 
   153327 
   153328 # Normalize the observed and expected error messages, depending upon the
   153329 # options.
   153330 # 1. Create the reference error message.
   153331 cat >expout <<'_ATEOF'
   153332 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   153333 _ATEOF
   153334 
   153335 # 2. If locations are not used, remove them.
   153336 
   153337 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153338 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153339 mv at-expout expout
   153340 # 4. Check
   153341 { set +x
   153342 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153343 at_fn_check_prepare_trace "java.at:360"
   153344 ( $at_check_trace; cat stderr
   153345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153346 at_status=$? at_failed=false
   153347 $at_check_filter
   153348 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153349 $at_diff expout "$at_stdout" || at_failed=:
   153350 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153351 $at_failed && at_fn_log_failure
   153352 $at_traceon; }
   153353 
   153354 
   153355 cat >input <<'_ATEOF'
   153356 error
   153357 _ATEOF
   153358 
   153359 { set +x
   153360 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153361 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153362 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153364 at_status=$? at_failed=false
   153365 $at_check_filter
   153366 echo stderr:; tee stderr <"$at_stderr"
   153367 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153368 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153369 $at_failed && at_fn_log_failure
   153370 $at_traceon; }
   153371 
   153372 
   153373 # Normalize the observed and expected error messages, depending upon the
   153374 # options.
   153375 # 1. Create the reference error message.
   153376 cat >expout <<'_ATEOF'
   153377 1.1: syntax error, unexpected $undefined
   153378 _ATEOF
   153379 
   153380 # 2. If locations are not used, remove them.
   153381 
   153382 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153383 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153384 mv at-expout expout
   153385 # 4. Check
   153386 { set +x
   153387 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153388 at_fn_check_prepare_trace "java.at:360"
   153389 ( $at_check_trace; cat stderr
   153390 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153391 at_status=$? at_failed=false
   153392 $at_check_filter
   153393 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153394 $at_diff expout "$at_stdout" || at_failed=:
   153395 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153396 $at_failed && at_fn_log_failure
   153397 $at_traceon; }
   153398 
   153399 
   153400 cat >input <<'_ATEOF'
   153401 1 = 2 = 3
   153402 _ATEOF
   153403 
   153404 { set +x
   153405 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153406 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153407 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153408 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153409 at_status=$? at_failed=false
   153410 $at_check_filter
   153411 echo stderr:; tee stderr <"$at_stderr"
   153412 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153413 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153414 $at_failed && at_fn_log_failure
   153415 $at_traceon; }
   153416 
   153417 
   153418 # Normalize the observed and expected error messages, depending upon the
   153419 # options.
   153420 # 1. Create the reference error message.
   153421 cat >expout <<'_ATEOF'
   153422 1.4: syntax error, unexpected '='
   153423 _ATEOF
   153424 
   153425 # 2. If locations are not used, remove them.
   153426 
   153427 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153428 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153429 mv at-expout expout
   153430 # 4. Check
   153431 { set +x
   153432 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153433 at_fn_check_prepare_trace "java.at:360"
   153434 ( $at_check_trace; cat stderr
   153435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153436 at_status=$? at_failed=false
   153437 $at_check_filter
   153438 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153439 $at_diff expout "$at_stdout" || at_failed=:
   153440 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153441 $at_failed && at_fn_log_failure
   153442 $at_traceon; }
   153443 
   153444 
   153445 cat >input <<'_ATEOF'
   153446 
   153447 +1
   153448 _ATEOF
   153449 
   153450 { set +x
   153451 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153452 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153453 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153455 at_status=$? at_failed=false
   153456 $at_check_filter
   153457 echo stderr:; tee stderr <"$at_stderr"
   153458 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153459 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153460 $at_failed && at_fn_log_failure
   153461 $at_traceon; }
   153462 
   153463 
   153464 # Normalize the observed and expected error messages, depending upon the
   153465 # options.
   153466 # 1. Create the reference error message.
   153467 cat >expout <<'_ATEOF'
   153468 2.1: syntax error, unexpected '+'
   153469 _ATEOF
   153470 
   153471 # 2. If locations are not used, remove them.
   153472 
   153473 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153474 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153475 mv at-expout expout
   153476 # 4. Check
   153477 { set +x
   153478 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153479 at_fn_check_prepare_trace "java.at:360"
   153480 ( $at_check_trace; cat stderr
   153481 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153482 at_status=$? at_failed=false
   153483 $at_check_filter
   153484 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153485 $at_diff expout "$at_stdout" || at_failed=:
   153486 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153487 $at_failed && at_fn_log_failure
   153488 $at_traceon; }
   153489 
   153490 
   153491 # Exercise error messages with EOF: work on an empty file.
   153492 { set +x
   153493 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   153494 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
   153495 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   153496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153497 at_status=$? at_failed=false
   153498 $at_check_filter
   153499 echo stderr:; tee stderr <"$at_stderr"
   153500 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153501 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153502 $at_failed && at_fn_log_failure
   153503 $at_traceon; }
   153504 
   153505 
   153506 # Normalize the observed and expected error messages, depending upon the
   153507 # options.
   153508 # 1. Create the reference error message.
   153509 cat >expout <<'_ATEOF'
   153510 1.1: syntax error, unexpected end of input
   153511 _ATEOF
   153512 
   153513 # 2. If locations are not used, remove them.
   153514 
   153515 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153516 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153517 mv at-expout expout
   153518 # 4. Check
   153519 { set +x
   153520 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153521 at_fn_check_prepare_trace "java.at:360"
   153522 ( $at_check_trace; cat stderr
   153523 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153524 at_status=$? at_failed=false
   153525 $at_check_filter
   153526 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153527 $at_diff expout "$at_stdout" || at_failed=:
   153528 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153529 $at_failed && at_fn_log_failure
   153530 $at_traceon; }
   153531 
   153532 
   153533 
   153534 # Exercise the error token: without it, we die at the first error,
   153535 # hence be sure to
   153536 #
   153537 # - have several errors which exercise different shift/discardings
   153538 #   - (): nothing to pop, nothing to discard
   153539 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   153540 #   - (* * *): nothing to pop, a lot to discard
   153541 #   - (1 + 2 * *): some to pop and discard
   153542 #
   153543 # - test the action associated to `error'
   153544 #
   153545 # - check the lookahead that triggers an error is not discarded
   153546 #   when we enter error recovery.  Below, the lookahead causing the
   153547 #   first error is ")", which is needed to recover from the error and
   153548 #   produce the "0" that triggers the "0 != 1" error.
   153549 #
   153550 cat >input <<'_ATEOF'
   153551 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   153552 _ATEOF
   153553 
   153554 { set +x
   153555 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153556 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153557 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153558 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153559 at_status=$? at_failed=false
   153560 $at_check_filter
   153561 echo stderr:; tee stderr <"$at_stderr"
   153562 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153563 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153564 $at_failed && at_fn_log_failure
   153565 $at_traceon; }
   153566 
   153567 
   153568 # Normalize the observed and expected error messages, depending upon the
   153569 # options.
   153570 # 1. Create the reference error message.
   153571 cat >expout <<'_ATEOF'
   153572 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   153573 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   153574 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   153575 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   153576 1.1-1.27: calc: error: 4444 != 1
   153577 _ATEOF
   153578 
   153579 # 2. If locations are not used, remove them.
   153580 
   153581 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153582 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153583 mv at-expout expout
   153584 # 4. Check
   153585 { set +x
   153586 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153587 at_fn_check_prepare_trace "java.at:360"
   153588 ( $at_check_trace; cat stderr
   153589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153590 at_status=$? at_failed=false
   153591 $at_check_filter
   153592 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153593 $at_diff expout "$at_stdout" || at_failed=:
   153594 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153595 $at_failed && at_fn_log_failure
   153596 $at_traceon; }
   153597 
   153598 
   153599 
   153600 # The same, but this time exercising explicitly triggered syntax errors.
   153601 # POSIX says the lookahead causing the error should not be discarded.
   153602 cat >input <<'_ATEOF'
   153603 (!) + (0 0) = 1
   153604 _ATEOF
   153605 
   153606 { set +x
   153607 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153608 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153609 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153610 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153611 at_status=$? at_failed=false
   153612 $at_check_filter
   153613 echo stderr:; tee stderr <"$at_stderr"
   153614 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153615 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153616 $at_failed && at_fn_log_failure
   153617 $at_traceon; }
   153618 
   153619 
   153620 # Normalize the observed and expected error messages, depending upon the
   153621 # options.
   153622 # 1. Create the reference error message.
   153623 cat >expout <<'_ATEOF'
   153624 1.7: syntax error, unexpected number
   153625 1.1-1.10: calc: error: 2222 != 1
   153626 _ATEOF
   153627 
   153628 # 2. If locations are not used, remove them.
   153629 
   153630 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153631 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153632 mv at-expout expout
   153633 # 4. Check
   153634 { set +x
   153635 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153636 at_fn_check_prepare_trace "java.at:360"
   153637 ( $at_check_trace; cat stderr
   153638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153639 at_status=$? at_failed=false
   153640 $at_check_filter
   153641 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153642 $at_diff expout "$at_stdout" || at_failed=:
   153643 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153644 $at_failed && at_fn_log_failure
   153645 $at_traceon; }
   153646 
   153647 
   153648 cat >input <<'_ATEOF'
   153649 (- *) + (0 0) = 1
   153650 _ATEOF
   153651 
   153652 { set +x
   153653 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   153654 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   153655 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   153656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153657 at_status=$? at_failed=false
   153658 $at_check_filter
   153659 echo stderr:; tee stderr <"$at_stderr"
   153660 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153661 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153662 $at_failed && at_fn_log_failure
   153663 $at_traceon; }
   153664 
   153665 
   153666 # Normalize the observed and expected error messages, depending upon the
   153667 # options.
   153668 # 1. Create the reference error message.
   153669 cat >expout <<'_ATEOF'
   153670 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   153671 1.8: syntax error, unexpected number
   153672 1.1-1.11: calc: error: 2222 != 1
   153673 _ATEOF
   153674 
   153675 # 2. If locations are not used, remove them.
   153676 
   153677 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   153678 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   153679 mv at-expout expout
   153680 # 4. Check
   153681 { set +x
   153682 $as_echo "$at_srcdir/java.at:360: cat stderr"
   153683 at_fn_check_prepare_trace "java.at:360"
   153684 ( $at_check_trace; cat stderr
   153685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153686 at_status=$? at_failed=false
   153687 $at_check_filter
   153688 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153689 $at_diff expout "$at_stdout" || at_failed=:
   153690 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153691 $at_failed && at_fn_log_failure
   153692 $at_traceon; }
   153693 
   153694 
   153695 
   153696 
   153697   set +x
   153698   $at_times_p && times >"$at_times_file"
   153699 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   153700 read at_status <"$at_status_file"
   153701 #AT_STOP_309
   153702 #AT_START_310
   153703 at_fn_group_banner 310 'java.at:360' \
   153704   "Calculator %error-verbose %locations " "          " 19
   153705 at_xfail=no
   153706 (
   153707   $as_echo "310. $at_setup_line: testing $at_desc ..."
   153708   $at_traceon
   153709 
   153710 
   153711 
   153712 
   153713 
   153714 cat >Calc.y <<'_ATEOF'
   153715 /* Infix notation calculator--calc */
   153716 %language "Java"
   153717 %name-prefix "Calc"
   153718 %define parser_class_name "Calc"
   153719 %define public
   153720 
   153721 %error-verbose %locations
   153722 %code {
   153723 
   153724   public static void main (String args[]) throws IOException
   153725   {
   153726     CalcLexer l = new CalcLexer (System.in);
   153727     Calc p = new Calc (l);
   153728     p.parse ();
   153729   }
   153730 
   153731 }
   153732 
   153733 %code imports {
   153734   import java.io.StreamTokenizer;
   153735   import java.io.InputStream;
   153736   import java.io.InputStreamReader;
   153737   import java.io.Reader;
   153738   import java.io.IOException;
   153739 }
   153740 
   153741 /* Bison Declarations */
   153742 %token <Integer> NUM "number"
   153743 %type  <Integer> exp
   153744 
   153745 %nonassoc '=' /* comparison            */
   153746 %left '-' '+'
   153747 %left '*' '/'
   153748 %left NEG     /* negation--unary minus */
   153749 %right '^'    /* exponentiation        */
   153750 
   153751 /* Grammar follows */
   153752 %%
   153753 input:
   153754   line
   153755 | input line
   153756 ;
   153757 
   153758 line:
   153759   '\n'
   153760 | exp '\n'
   153761 | error '\n'
   153762 ;
   153763 
   153764 exp:
   153765   NUM                { $$ = $1;                                             }
   153766 | exp '=' exp
   153767   {
   153768     if ($1.intValue () != $3.intValue ())
   153769       yyerror (@$, "calc: error: " + $1 + " != " + $3);
   153770   }
   153771 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   153772 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   153773 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   153774 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   153775 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   153776 | exp '^' exp        { $$ = new Integer ((int)
   153777                                          Math.pow ($1.intValue (),
   153778                                                    $3.intValue ()));        }
   153779 | '(' exp ')'        { $$ = $2;                                             }
   153780 | '(' error ')'      { $$ = new Integer (1111);                             }
   153781 | '!'                { $$ = new Integer (0); return YYERROR;                }
   153782 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   153783 ;
   153784 
   153785 
   153786 %%
   153787 class CalcLexer implements Calc.Lexer {
   153788 
   153789   StreamTokenizer st;
   153790 
   153791   public CalcLexer (InputStream is)
   153792   {
   153793     st = new StreamTokenizer (new InputStreamReader (is));
   153794     st.resetSyntax ();
   153795     st.eolIsSignificant (true);
   153796     st.whitespaceChars (9, 9);
   153797     st.whitespaceChars (32, 32);
   153798     st.wordChars (48, 57);
   153799   }
   153800 
   153801 
   153802   Position yypos = new Position (1, 0);
   153803 
   153804   public Position getStartPos() {
   153805     return yypos;
   153806   }
   153807 
   153808   public Position getEndPos() {
   153809     return yypos;
   153810   }
   153811 
   153812   public void yyerror (Calc.Location l, String s)
   153813   {
   153814     if (l == null)
   153815       System.err.println (s);
   153816     else
   153817       System.err.println (l + ": " + s);
   153818   }
   153819 
   153820 
   153821   Integer yylval;
   153822 
   153823   public Object getLVal() {
   153824     return yylval;
   153825   }
   153826 
   153827   public int yylex () throws IOException {
   153828     int ttype = st.nextToken ();
   153829     yypos = new Position (yypos.lineno (),
   153830                                             yypos.token () + 1);
   153831     if (ttype == st.TT_EOF)
   153832       return Calc.EOF;
   153833 
   153834     else if (ttype == st.TT_EOL)
   153835       {
   153836         yypos = new Position (yypos.lineno () + 1, 0);
   153837         return (int) '\n';
   153838       }
   153839 
   153840     else if (ttype == st.TT_WORD)
   153841       {
   153842         yylval = new Integer (st.sval);
   153843         return Calc.NUM;
   153844       }
   153845 
   153846     else
   153847       return st.ttype;
   153848   }
   153849 
   153850 
   153851 
   153852 }
   153853 
   153854 
   153855 class Position {
   153856   public int line;
   153857   public int token;
   153858 
   153859   public Position ()
   153860   {
   153861     line = 0;
   153862     token = 0;
   153863   }
   153864 
   153865   public Position (int l, int t)
   153866   {
   153867     line = l;
   153868     token = t;
   153869   }
   153870 
   153871   public boolean equals (Position l)
   153872   {
   153873     return l.line == line && l.token == token;
   153874   }
   153875 
   153876   public String toString ()
   153877   {
   153878     return Integer.toString (line) + "." + Integer.toString(token);
   153879   }
   153880 
   153881   public int lineno ()
   153882   {
   153883     return line;
   153884   }
   153885 
   153886   public int token ()
   153887   {
   153888     return token;
   153889   }
   153890 }
   153891 
   153892 _ATEOF
   153893 
   153894 
   153895 
   153896 
   153897 
   153898 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   153899   at_save_special_files
   153900   mkdir xml-tests
   153901     # Don't combine these Bison invocations since we want to be sure that
   153902   # --report=all isn't required to get the full XML file.
   153903   { set +x
   153904 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   153905                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   153906 at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
   153907 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   153908                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   153909 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153910 at_status=$? at_failed=false
   153911 $at_check_filter
   153912 echo stderr:; cat "$at_stderr"
   153913 echo stdout:; cat "$at_stdout"
   153914 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153915 $at_failed && at_fn_log_failure
   153916 $at_traceon; }
   153917 
   153918   { set +x
   153919 $as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   153920 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
   153921 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   153922 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153923 at_status=$? at_failed=false
   153924 $at_check_filter
   153925 echo stderr:; cat "$at_stderr"
   153926 echo stdout:; cat "$at_stdout"
   153927 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153928 $at_failed && at_fn_log_failure
   153929 $at_traceon; }
   153930 
   153931     cp xml-tests/test.output expout
   153932   { set +x
   153933 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   153934              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   153935              xml-tests/test.xml"
   153936 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   153937 ( $at_check_trace; $XSLTPROC \
   153938              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   153939              xml-tests/test.xml
   153940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153941 at_status=$? at_failed=false
   153942 $at_check_filter
   153943 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153944 $at_diff expout "$at_stdout" || at_failed=:
   153945 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153946 $at_failed && at_fn_log_failure
   153947 $at_traceon; }
   153948 
   153949   sort xml-tests/test.dot > expout
   153950   { set +x
   153951 $as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
   153952              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   153953              xml-tests/test.xml | sort"
   153954 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
   153955 ( $at_check_trace; $XSLTPROC \
   153956              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   153957              xml-tests/test.xml | sort
   153958 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153959 at_status=$? at_failed=false
   153960 $at_check_filter
   153961 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153962 $at_diff expout "$at_stdout" || at_failed=:
   153963 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153964 $at_failed && at_fn_log_failure
   153965 $at_traceon; }
   153966 
   153967   rm -rf xml-tests expout
   153968   at_restore_special_files
   153969 fi
   153970 { set +x
   153971 $as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y"
   153972 at_fn_check_prepare_trace "java.at:360"
   153973 ( $at_check_trace; bison -o Calc.java Calc.y
   153974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153975 at_status=$? at_failed=false
   153976 $at_check_filter
   153977 at_fn_diff_devnull "$at_stderr" || at_failed=:
   153978 at_fn_diff_devnull "$at_stdout" || at_failed=:
   153979 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   153980 $at_failed && at_fn_log_failure
   153981 $at_traceon; }
   153982 
   153983 
   153984 
   153985 $as_echo "java.at:360" >"$at_check_line_file"
   153986 (test -z "$CONF_JAVAC") \
   153987   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   153988 $as_echo "java.at:360" >"$at_check_line_file"
   153989 (test -z "$CONF_JAVA") \
   153990   && at_fn_check_skip 77 "$at_srcdir/java.at:360"
   153991 { set +x
   153992 $as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
   153993 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
   153994 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   153995 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   153996 at_status=$? at_failed=false
   153997 $at_check_filter
   153998 echo stderr:; cat "$at_stderr"
   153999 echo stdout:; cat "$at_stdout"
   154000 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154001 $at_failed && at_fn_log_failure
   154002 $at_traceon; }
   154003 
   154004 
   154005 # Test the priorities.
   154006 cat >input <<'_ATEOF'
   154007 1 + 2 * 3 = 7
   154008 1 + 2 * -3 = -5
   154009 
   154010 -1^2 = -1
   154011 (-1)^2 = 1
   154012 
   154013 ---1 = -1
   154014 
   154015 1 - 2 - 3 = -4
   154016 1 - (2 - 3) = 2
   154017 
   154018 2^2^3 = 256
   154019 (2^2)^3 = 64
   154020 _ATEOF
   154021 
   154022 { set +x
   154023 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154024 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154025 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154026 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154027 at_status=$? at_failed=false
   154028 $at_check_filter
   154029 echo stderr:; tee stderr <"$at_stderr"
   154030 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154031 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154032 $at_failed && at_fn_log_failure
   154033 $at_traceon; }
   154034 
   154035 
   154036 
   154037 # Some syntax errors.
   154038 cat >input <<'_ATEOF'
   154039 0 0
   154040 _ATEOF
   154041 
   154042 { set +x
   154043 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154044 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154045 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154047 at_status=$? at_failed=false
   154048 $at_check_filter
   154049 echo stderr:; tee stderr <"$at_stderr"
   154050 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154051 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154052 $at_failed && at_fn_log_failure
   154053 $at_traceon; }
   154054 
   154055 
   154056 # Normalize the observed and expected error messages, depending upon the
   154057 # options.
   154058 # 1. Create the reference error message.
   154059 cat >expout <<'_ATEOF'
   154060 1.2: syntax error, unexpected number
   154061 _ATEOF
   154062 
   154063 # 2. If locations are not used, remove them.
   154064 
   154065 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154066 
   154067 # 4. Check
   154068 { set +x
   154069 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154070 at_fn_check_prepare_trace "java.at:360"
   154071 ( $at_check_trace; cat stderr
   154072 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154073 at_status=$? at_failed=false
   154074 $at_check_filter
   154075 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154076 $at_diff expout "$at_stdout" || at_failed=:
   154077 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154078 $at_failed && at_fn_log_failure
   154079 $at_traceon; }
   154080 
   154081 
   154082 cat >input <<'_ATEOF'
   154083 1//2
   154084 _ATEOF
   154085 
   154086 { set +x
   154087 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154088 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154089 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154091 at_status=$? at_failed=false
   154092 $at_check_filter
   154093 echo stderr:; tee stderr <"$at_stderr"
   154094 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154095 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154096 $at_failed && at_fn_log_failure
   154097 $at_traceon; }
   154098 
   154099 
   154100 # Normalize the observed and expected error messages, depending upon the
   154101 # options.
   154102 # 1. Create the reference error message.
   154103 cat >expout <<'_ATEOF'
   154104 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   154105 _ATEOF
   154106 
   154107 # 2. If locations are not used, remove them.
   154108 
   154109 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154110 
   154111 # 4. Check
   154112 { set +x
   154113 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154114 at_fn_check_prepare_trace "java.at:360"
   154115 ( $at_check_trace; cat stderr
   154116 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154117 at_status=$? at_failed=false
   154118 $at_check_filter
   154119 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154120 $at_diff expout "$at_stdout" || at_failed=:
   154121 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154122 $at_failed && at_fn_log_failure
   154123 $at_traceon; }
   154124 
   154125 
   154126 cat >input <<'_ATEOF'
   154127 error
   154128 _ATEOF
   154129 
   154130 { set +x
   154131 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154132 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154133 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154134 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154135 at_status=$? at_failed=false
   154136 $at_check_filter
   154137 echo stderr:; tee stderr <"$at_stderr"
   154138 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154139 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154140 $at_failed && at_fn_log_failure
   154141 $at_traceon; }
   154142 
   154143 
   154144 # Normalize the observed and expected error messages, depending upon the
   154145 # options.
   154146 # 1. Create the reference error message.
   154147 cat >expout <<'_ATEOF'
   154148 1.1: syntax error, unexpected $undefined
   154149 _ATEOF
   154150 
   154151 # 2. If locations are not used, remove them.
   154152 
   154153 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154154 
   154155 # 4. Check
   154156 { set +x
   154157 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154158 at_fn_check_prepare_trace "java.at:360"
   154159 ( $at_check_trace; cat stderr
   154160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154161 at_status=$? at_failed=false
   154162 $at_check_filter
   154163 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154164 $at_diff expout "$at_stdout" || at_failed=:
   154165 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154166 $at_failed && at_fn_log_failure
   154167 $at_traceon; }
   154168 
   154169 
   154170 cat >input <<'_ATEOF'
   154171 1 = 2 = 3
   154172 _ATEOF
   154173 
   154174 { set +x
   154175 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154176 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154177 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154178 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154179 at_status=$? at_failed=false
   154180 $at_check_filter
   154181 echo stderr:; tee stderr <"$at_stderr"
   154182 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154183 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154184 $at_failed && at_fn_log_failure
   154185 $at_traceon; }
   154186 
   154187 
   154188 # Normalize the observed and expected error messages, depending upon the
   154189 # options.
   154190 # 1. Create the reference error message.
   154191 cat >expout <<'_ATEOF'
   154192 1.4: syntax error, unexpected '='
   154193 _ATEOF
   154194 
   154195 # 2. If locations are not used, remove them.
   154196 
   154197 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154198 
   154199 # 4. Check
   154200 { set +x
   154201 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154202 at_fn_check_prepare_trace "java.at:360"
   154203 ( $at_check_trace; cat stderr
   154204 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154205 at_status=$? at_failed=false
   154206 $at_check_filter
   154207 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154208 $at_diff expout "$at_stdout" || at_failed=:
   154209 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154210 $at_failed && at_fn_log_failure
   154211 $at_traceon; }
   154212 
   154213 
   154214 cat >input <<'_ATEOF'
   154215 
   154216 +1
   154217 _ATEOF
   154218 
   154219 { set +x
   154220 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154221 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154222 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154223 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154224 at_status=$? at_failed=false
   154225 $at_check_filter
   154226 echo stderr:; tee stderr <"$at_stderr"
   154227 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154228 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154229 $at_failed && at_fn_log_failure
   154230 $at_traceon; }
   154231 
   154232 
   154233 # Normalize the observed and expected error messages, depending upon the
   154234 # options.
   154235 # 1. Create the reference error message.
   154236 cat >expout <<'_ATEOF'
   154237 2.1: syntax error, unexpected '+'
   154238 _ATEOF
   154239 
   154240 # 2. If locations are not used, remove them.
   154241 
   154242 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154243 
   154244 # 4. Check
   154245 { set +x
   154246 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154247 at_fn_check_prepare_trace "java.at:360"
   154248 ( $at_check_trace; cat stderr
   154249 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154250 at_status=$? at_failed=false
   154251 $at_check_filter
   154252 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154253 $at_diff expout "$at_stdout" || at_failed=:
   154254 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154255 $at_failed && at_fn_log_failure
   154256 $at_traceon; }
   154257 
   154258 
   154259 # Exercise error messages with EOF: work on an empty file.
   154260 { set +x
   154261 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   154262 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
   154263 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   154264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154265 at_status=$? at_failed=false
   154266 $at_check_filter
   154267 echo stderr:; tee stderr <"$at_stderr"
   154268 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154269 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154270 $at_failed && at_fn_log_failure
   154271 $at_traceon; }
   154272 
   154273 
   154274 # Normalize the observed and expected error messages, depending upon the
   154275 # options.
   154276 # 1. Create the reference error message.
   154277 cat >expout <<'_ATEOF'
   154278 1.1: syntax error, unexpected end of input
   154279 _ATEOF
   154280 
   154281 # 2. If locations are not used, remove them.
   154282 
   154283 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154284 
   154285 # 4. Check
   154286 { set +x
   154287 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154288 at_fn_check_prepare_trace "java.at:360"
   154289 ( $at_check_trace; cat stderr
   154290 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154291 at_status=$? at_failed=false
   154292 $at_check_filter
   154293 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154294 $at_diff expout "$at_stdout" || at_failed=:
   154295 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154296 $at_failed && at_fn_log_failure
   154297 $at_traceon; }
   154298 
   154299 
   154300 
   154301 # Exercise the error token: without it, we die at the first error,
   154302 # hence be sure to
   154303 #
   154304 # - have several errors which exercise different shift/discardings
   154305 #   - (): nothing to pop, nothing to discard
   154306 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   154307 #   - (* * *): nothing to pop, a lot to discard
   154308 #   - (1 + 2 * *): some to pop and discard
   154309 #
   154310 # - test the action associated to `error'
   154311 #
   154312 # - check the lookahead that triggers an error is not discarded
   154313 #   when we enter error recovery.  Below, the lookahead causing the
   154314 #   first error is ")", which is needed to recover from the error and
   154315 #   produce the "0" that triggers the "0 != 1" error.
   154316 #
   154317 cat >input <<'_ATEOF'
   154318 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   154319 _ATEOF
   154320 
   154321 { set +x
   154322 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154323 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154324 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154326 at_status=$? at_failed=false
   154327 $at_check_filter
   154328 echo stderr:; tee stderr <"$at_stderr"
   154329 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154330 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154331 $at_failed && at_fn_log_failure
   154332 $at_traceon; }
   154333 
   154334 
   154335 # Normalize the observed and expected error messages, depending upon the
   154336 # options.
   154337 # 1. Create the reference error message.
   154338 cat >expout <<'_ATEOF'
   154339 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   154340 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   154341 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   154342 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   154343 1.1-1.27: calc: error: 4444 != 1
   154344 _ATEOF
   154345 
   154346 # 2. If locations are not used, remove them.
   154347 
   154348 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154349 
   154350 # 4. Check
   154351 { set +x
   154352 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154353 at_fn_check_prepare_trace "java.at:360"
   154354 ( $at_check_trace; cat stderr
   154355 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154356 at_status=$? at_failed=false
   154357 $at_check_filter
   154358 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154359 $at_diff expout "$at_stdout" || at_failed=:
   154360 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154361 $at_failed && at_fn_log_failure
   154362 $at_traceon; }
   154363 
   154364 
   154365 
   154366 # The same, but this time exercising explicitly triggered syntax errors.
   154367 # POSIX says the lookahead causing the error should not be discarded.
   154368 cat >input <<'_ATEOF'
   154369 (!) + (0 0) = 1
   154370 _ATEOF
   154371 
   154372 { set +x
   154373 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154374 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154375 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154377 at_status=$? at_failed=false
   154378 $at_check_filter
   154379 echo stderr:; tee stderr <"$at_stderr"
   154380 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154381 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154382 $at_failed && at_fn_log_failure
   154383 $at_traceon; }
   154384 
   154385 
   154386 # Normalize the observed and expected error messages, depending upon the
   154387 # options.
   154388 # 1. Create the reference error message.
   154389 cat >expout <<'_ATEOF'
   154390 1.7: syntax error, unexpected number
   154391 1.1-1.10: calc: error: 2222 != 1
   154392 _ATEOF
   154393 
   154394 # 2. If locations are not used, remove them.
   154395 
   154396 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154397 
   154398 # 4. Check
   154399 { set +x
   154400 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154401 at_fn_check_prepare_trace "java.at:360"
   154402 ( $at_check_trace; cat stderr
   154403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154404 at_status=$? at_failed=false
   154405 $at_check_filter
   154406 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154407 $at_diff expout "$at_stdout" || at_failed=:
   154408 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154409 $at_failed && at_fn_log_failure
   154410 $at_traceon; }
   154411 
   154412 
   154413 cat >input <<'_ATEOF'
   154414 (- *) + (0 0) = 1
   154415 _ATEOF
   154416 
   154417 { set +x
   154418 $as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
   154419 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
   154420 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154422 at_status=$? at_failed=false
   154423 $at_check_filter
   154424 echo stderr:; tee stderr <"$at_stderr"
   154425 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154426 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154427 $at_failed && at_fn_log_failure
   154428 $at_traceon; }
   154429 
   154430 
   154431 # Normalize the observed and expected error messages, depending upon the
   154432 # options.
   154433 # 1. Create the reference error message.
   154434 cat >expout <<'_ATEOF'
   154435 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   154436 1.8: syntax error, unexpected number
   154437 1.1-1.11: calc: error: 2222 != 1
   154438 _ATEOF
   154439 
   154440 # 2. If locations are not used, remove them.
   154441 
   154442 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154443 
   154444 # 4. Check
   154445 { set +x
   154446 $as_echo "$at_srcdir/java.at:360: cat stderr"
   154447 at_fn_check_prepare_trace "java.at:360"
   154448 ( $at_check_trace; cat stderr
   154449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154450 at_status=$? at_failed=false
   154451 $at_check_filter
   154452 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154453 $at_diff expout "$at_stdout" || at_failed=:
   154454 at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
   154455 $at_failed && at_fn_log_failure
   154456 $at_traceon; }
   154457 
   154458 
   154459 
   154460 
   154461   set +x
   154462   $at_times_p && times >"$at_times_file"
   154463 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   154464 read at_status <"$at_status_file"
   154465 #AT_STOP_310
   154466 #AT_START_311
   154467 at_fn_group_banner 311 'java.at:369' \
   154468   "Calculator %lex-param { InputStream is } " "      " 19
   154469 at_xfail=no
   154470 (
   154471   $as_echo "311. $at_setup_line: testing $at_desc ..."
   154472   $at_traceon
   154473 
   154474 
   154475 
   154476 
   154477 
   154478 cat >Calc.y <<'_ATEOF'
   154479 /* Infix notation calculator--calc */
   154480 %language "Java"
   154481 %name-prefix "Calc"
   154482 %define parser_class_name "Calc"
   154483 %define public
   154484 
   154485 %lex-param { InputStream is }
   154486 %code {
   154487 
   154488   public static void main (String args[]) throws IOException
   154489   {
   154490     new Calc (System.in).parse ();
   154491   }
   154492 
   154493 }
   154494 
   154495 %code imports {
   154496   import java.io.StreamTokenizer;
   154497   import java.io.InputStream;
   154498   import java.io.InputStreamReader;
   154499   import java.io.Reader;
   154500   import java.io.IOException;
   154501 }
   154502 
   154503 /* Bison Declarations */
   154504 %token <Integer> NUM "number"
   154505 %type  <Integer> exp
   154506 
   154507 %nonassoc '=' /* comparison            */
   154508 %left '-' '+'
   154509 %left '*' '/'
   154510 %left NEG     /* negation--unary minus */
   154511 %right '^'    /* exponentiation        */
   154512 
   154513 /* Grammar follows */
   154514 %%
   154515 input:
   154516   line
   154517 | input line
   154518 ;
   154519 
   154520 line:
   154521   '\n'
   154522 | exp '\n'
   154523 | error '\n'
   154524 ;
   154525 
   154526 exp:
   154527   NUM                { $$ = $1;                                             }
   154528 | exp '=' exp
   154529   {
   154530     if ($1.intValue () != $3.intValue ())
   154531       yyerror ( "calc: error: " + $1 + " != " + $3);
   154532   }
   154533 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   154534 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   154535 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   154536 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   154537 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   154538 | exp '^' exp        { $$ = new Integer ((int)
   154539                                          Math.pow ($1.intValue (),
   154540                                                    $3.intValue ()));        }
   154541 | '(' exp ')'        { $$ = $2;                                             }
   154542 | '(' error ')'      { $$ = new Integer (1111);                             }
   154543 | '!'                { $$ = new Integer (0); return YYERROR;                }
   154544 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   154545 ;
   154546 
   154547 
   154548 %code lexer {
   154549 
   154550   StreamTokenizer st;
   154551 
   154552   public YYLexer (InputStream is)
   154553   {
   154554     st = new StreamTokenizer (new InputStreamReader (is));
   154555     st.resetSyntax ();
   154556     st.eolIsSignificant (true);
   154557     st.whitespaceChars (9, 9);
   154558     st.whitespaceChars (32, 32);
   154559     st.wordChars (48, 57);
   154560   }
   154561 
   154562 
   154563 
   154564   public void yyerror (String s)
   154565   {
   154566     System.err.println (s);
   154567   }
   154568 
   154569   Integer yylval;
   154570 
   154571   public Object getLVal() {
   154572     return yylval;
   154573   }
   154574 
   154575   public int yylex () throws IOException {
   154576     int ttype = st.nextToken ();
   154577 
   154578     if (ttype == st.TT_EOF)
   154579       return Calc.EOF;
   154580 
   154581     else if (ttype == st.TT_EOL)
   154582       {
   154583 
   154584         return (int) '\n';
   154585       }
   154586 
   154587     else if (ttype == st.TT_WORD)
   154588       {
   154589         yylval = new Integer (st.sval);
   154590         return Calc.NUM;
   154591       }
   154592 
   154593     else
   154594       return st.ttype;
   154595   }
   154596 
   154597 
   154598 
   154599 };
   154600 %%
   154601 
   154602 
   154603 class Position {
   154604   public int line;
   154605   public int token;
   154606 
   154607   public Position ()
   154608   {
   154609     line = 0;
   154610     token = 0;
   154611   }
   154612 
   154613   public Position (int l, int t)
   154614   {
   154615     line = l;
   154616     token = t;
   154617   }
   154618 
   154619   public boolean equals (Position l)
   154620   {
   154621     return l.line == line && l.token == token;
   154622   }
   154623 
   154624   public String toString ()
   154625   {
   154626     return Integer.toString (line) + "." + Integer.toString(token);
   154627   }
   154628 
   154629   public int lineno ()
   154630   {
   154631     return line;
   154632   }
   154633 
   154634   public int token ()
   154635   {
   154636     return token;
   154637   }
   154638 }
   154639 
   154640 _ATEOF
   154641 
   154642 
   154643 
   154644 
   154645 
   154646 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   154647   at_save_special_files
   154648   mkdir xml-tests
   154649     # Don't combine these Bison invocations since we want to be sure that
   154650   # --report=all isn't required to get the full XML file.
   154651   { set +x
   154652 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   154653                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   154654 at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
   154655 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   154656                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   154657 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154658 at_status=$? at_failed=false
   154659 $at_check_filter
   154660 echo stderr:; cat "$at_stderr"
   154661 echo stdout:; cat "$at_stdout"
   154662 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154663 $at_failed && at_fn_log_failure
   154664 $at_traceon; }
   154665 
   154666   { set +x
   154667 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   154668 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
   154669 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   154670 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154671 at_status=$? at_failed=false
   154672 $at_check_filter
   154673 echo stderr:; cat "$at_stderr"
   154674 echo stdout:; cat "$at_stdout"
   154675 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154676 $at_failed && at_fn_log_failure
   154677 $at_traceon; }
   154678 
   154679     cp xml-tests/test.output expout
   154680   { set +x
   154681 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   154682              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   154683              xml-tests/test.xml"
   154684 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   154685 ( $at_check_trace; $XSLTPROC \
   154686              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   154687              xml-tests/test.xml
   154688 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154689 at_status=$? at_failed=false
   154690 $at_check_filter
   154691 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154692 $at_diff expout "$at_stdout" || at_failed=:
   154693 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154694 $at_failed && at_fn_log_failure
   154695 $at_traceon; }
   154696 
   154697   sort xml-tests/test.dot > expout
   154698   { set +x
   154699 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   154700              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   154701              xml-tests/test.xml | sort"
   154702 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   154703 ( $at_check_trace; $XSLTPROC \
   154704              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   154705              xml-tests/test.xml | sort
   154706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154707 at_status=$? at_failed=false
   154708 $at_check_filter
   154709 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154710 $at_diff expout "$at_stdout" || at_failed=:
   154711 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154712 $at_failed && at_fn_log_failure
   154713 $at_traceon; }
   154714 
   154715   rm -rf xml-tests expout
   154716   at_restore_special_files
   154717 fi
   154718 { set +x
   154719 $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
   154720 at_fn_check_prepare_trace "java.at:369"
   154721 ( $at_check_trace; bison -o Calc.java Calc.y
   154722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154723 at_status=$? at_failed=false
   154724 $at_check_filter
   154725 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154726 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154727 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154728 $at_failed && at_fn_log_failure
   154729 $at_traceon; }
   154730 
   154731 
   154732 
   154733 $as_echo "java.at:369" >"$at_check_line_file"
   154734 (test -z "$CONF_JAVAC") \
   154735   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   154736 $as_echo "java.at:369" >"$at_check_line_file"
   154737 (test -z "$CONF_JAVA") \
   154738   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   154739 { set +x
   154740 $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
   154741 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
   154742 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   154743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154744 at_status=$? at_failed=false
   154745 $at_check_filter
   154746 echo stderr:; cat "$at_stderr"
   154747 echo stdout:; cat "$at_stdout"
   154748 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154749 $at_failed && at_fn_log_failure
   154750 $at_traceon; }
   154751 
   154752 
   154753 # Test the priorities.
   154754 cat >input <<'_ATEOF'
   154755 1 + 2 * 3 = 7
   154756 1 + 2 * -3 = -5
   154757 
   154758 -1^2 = -1
   154759 (-1)^2 = 1
   154760 
   154761 ---1 = -1
   154762 
   154763 1 - 2 - 3 = -4
   154764 1 - (2 - 3) = 2
   154765 
   154766 2^2^3 = 256
   154767 (2^2)^3 = 64
   154768 _ATEOF
   154769 
   154770 { set +x
   154771 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   154772 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   154773 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154774 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154775 at_status=$? at_failed=false
   154776 $at_check_filter
   154777 echo stderr:; tee stderr <"$at_stderr"
   154778 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154779 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154780 $at_failed && at_fn_log_failure
   154781 $at_traceon; }
   154782 
   154783 
   154784 
   154785 # Some syntax errors.
   154786 cat >input <<'_ATEOF'
   154787 0 0
   154788 _ATEOF
   154789 
   154790 { set +x
   154791 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   154792 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   154793 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154795 at_status=$? at_failed=false
   154796 $at_check_filter
   154797 echo stderr:; tee stderr <"$at_stderr"
   154798 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154799 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154800 $at_failed && at_fn_log_failure
   154801 $at_traceon; }
   154802 
   154803 
   154804 # Normalize the observed and expected error messages, depending upon the
   154805 # options.
   154806 # 1. Create the reference error message.
   154807 cat >expout <<'_ATEOF'
   154808 1.2: syntax error, unexpected number
   154809 _ATEOF
   154810 
   154811 # 2. If locations are not used, remove them.
   154812 sed 's/^[-0-9.]*: //' expout >at-expout
   154813 mv at-expout expout
   154814 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154815 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   154816 mv at-expout expout
   154817 # 4. Check
   154818 { set +x
   154819 $as_echo "$at_srcdir/java.at:369: cat stderr"
   154820 at_fn_check_prepare_trace "java.at:369"
   154821 ( $at_check_trace; cat stderr
   154822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154823 at_status=$? at_failed=false
   154824 $at_check_filter
   154825 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154826 $at_diff expout "$at_stdout" || at_failed=:
   154827 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154828 $at_failed && at_fn_log_failure
   154829 $at_traceon; }
   154830 
   154831 
   154832 cat >input <<'_ATEOF'
   154833 1//2
   154834 _ATEOF
   154835 
   154836 { set +x
   154837 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   154838 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   154839 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154840 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154841 at_status=$? at_failed=false
   154842 $at_check_filter
   154843 echo stderr:; tee stderr <"$at_stderr"
   154844 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154845 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154846 $at_failed && at_fn_log_failure
   154847 $at_traceon; }
   154848 
   154849 
   154850 # Normalize the observed and expected error messages, depending upon the
   154851 # options.
   154852 # 1. Create the reference error message.
   154853 cat >expout <<'_ATEOF'
   154854 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   154855 _ATEOF
   154856 
   154857 # 2. If locations are not used, remove them.
   154858 sed 's/^[-0-9.]*: //' expout >at-expout
   154859 mv at-expout expout
   154860 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154861 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   154862 mv at-expout expout
   154863 # 4. Check
   154864 { set +x
   154865 $as_echo "$at_srcdir/java.at:369: cat stderr"
   154866 at_fn_check_prepare_trace "java.at:369"
   154867 ( $at_check_trace; cat stderr
   154868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154869 at_status=$? at_failed=false
   154870 $at_check_filter
   154871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154872 $at_diff expout "$at_stdout" || at_failed=:
   154873 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154874 $at_failed && at_fn_log_failure
   154875 $at_traceon; }
   154876 
   154877 
   154878 cat >input <<'_ATEOF'
   154879 error
   154880 _ATEOF
   154881 
   154882 { set +x
   154883 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   154884 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   154885 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154886 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154887 at_status=$? at_failed=false
   154888 $at_check_filter
   154889 echo stderr:; tee stderr <"$at_stderr"
   154890 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154891 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154892 $at_failed && at_fn_log_failure
   154893 $at_traceon; }
   154894 
   154895 
   154896 # Normalize the observed and expected error messages, depending upon the
   154897 # options.
   154898 # 1. Create the reference error message.
   154899 cat >expout <<'_ATEOF'
   154900 1.1: syntax error, unexpected $undefined
   154901 _ATEOF
   154902 
   154903 # 2. If locations are not used, remove them.
   154904 sed 's/^[-0-9.]*: //' expout >at-expout
   154905 mv at-expout expout
   154906 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154907 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   154908 mv at-expout expout
   154909 # 4. Check
   154910 { set +x
   154911 $as_echo "$at_srcdir/java.at:369: cat stderr"
   154912 at_fn_check_prepare_trace "java.at:369"
   154913 ( $at_check_trace; cat stderr
   154914 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154915 at_status=$? at_failed=false
   154916 $at_check_filter
   154917 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154918 $at_diff expout "$at_stdout" || at_failed=:
   154919 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154920 $at_failed && at_fn_log_failure
   154921 $at_traceon; }
   154922 
   154923 
   154924 cat >input <<'_ATEOF'
   154925 1 = 2 = 3
   154926 _ATEOF
   154927 
   154928 { set +x
   154929 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   154930 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   154931 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154932 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154933 at_status=$? at_failed=false
   154934 $at_check_filter
   154935 echo stderr:; tee stderr <"$at_stderr"
   154936 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154937 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154938 $at_failed && at_fn_log_failure
   154939 $at_traceon; }
   154940 
   154941 
   154942 # Normalize the observed and expected error messages, depending upon the
   154943 # options.
   154944 # 1. Create the reference error message.
   154945 cat >expout <<'_ATEOF'
   154946 1.4: syntax error, unexpected '='
   154947 _ATEOF
   154948 
   154949 # 2. If locations are not used, remove them.
   154950 sed 's/^[-0-9.]*: //' expout >at-expout
   154951 mv at-expout expout
   154952 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   154953 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   154954 mv at-expout expout
   154955 # 4. Check
   154956 { set +x
   154957 $as_echo "$at_srcdir/java.at:369: cat stderr"
   154958 at_fn_check_prepare_trace "java.at:369"
   154959 ( $at_check_trace; cat stderr
   154960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154961 at_status=$? at_failed=false
   154962 $at_check_filter
   154963 at_fn_diff_devnull "$at_stderr" || at_failed=:
   154964 $at_diff expout "$at_stdout" || at_failed=:
   154965 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154966 $at_failed && at_fn_log_failure
   154967 $at_traceon; }
   154968 
   154969 
   154970 cat >input <<'_ATEOF'
   154971 
   154972 +1
   154973 _ATEOF
   154974 
   154975 { set +x
   154976 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   154977 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   154978 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   154979 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   154980 at_status=$? at_failed=false
   154981 $at_check_filter
   154982 echo stderr:; tee stderr <"$at_stderr"
   154983 at_fn_diff_devnull "$at_stdout" || at_failed=:
   154984 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   154985 $at_failed && at_fn_log_failure
   154986 $at_traceon; }
   154987 
   154988 
   154989 # Normalize the observed and expected error messages, depending upon the
   154990 # options.
   154991 # 1. Create the reference error message.
   154992 cat >expout <<'_ATEOF'
   154993 2.1: syntax error, unexpected '+'
   154994 _ATEOF
   154995 
   154996 # 2. If locations are not used, remove them.
   154997 sed 's/^[-0-9.]*: //' expout >at-expout
   154998 mv at-expout expout
   154999 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155000 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   155001 mv at-expout expout
   155002 # 4. Check
   155003 { set +x
   155004 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155005 at_fn_check_prepare_trace "java.at:369"
   155006 ( $at_check_trace; cat stderr
   155007 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155008 at_status=$? at_failed=false
   155009 $at_check_filter
   155010 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155011 $at_diff expout "$at_stdout" || at_failed=:
   155012 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155013 $at_failed && at_fn_log_failure
   155014 $at_traceon; }
   155015 
   155016 
   155017 # Exercise error messages with EOF: work on an empty file.
   155018 { set +x
   155019 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   155020 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
   155021 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   155022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155023 at_status=$? at_failed=false
   155024 $at_check_filter
   155025 echo stderr:; tee stderr <"$at_stderr"
   155026 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155027 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155028 $at_failed && at_fn_log_failure
   155029 $at_traceon; }
   155030 
   155031 
   155032 # Normalize the observed and expected error messages, depending upon the
   155033 # options.
   155034 # 1. Create the reference error message.
   155035 cat >expout <<'_ATEOF'
   155036 1.1: syntax error, unexpected end of input
   155037 _ATEOF
   155038 
   155039 # 2. If locations are not used, remove them.
   155040 sed 's/^[-0-9.]*: //' expout >at-expout
   155041 mv at-expout expout
   155042 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155043 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   155044 mv at-expout expout
   155045 # 4. Check
   155046 { set +x
   155047 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155048 at_fn_check_prepare_trace "java.at:369"
   155049 ( $at_check_trace; cat stderr
   155050 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155051 at_status=$? at_failed=false
   155052 $at_check_filter
   155053 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155054 $at_diff expout "$at_stdout" || at_failed=:
   155055 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155056 $at_failed && at_fn_log_failure
   155057 $at_traceon; }
   155058 
   155059 
   155060 
   155061 # Exercise the error token: without it, we die at the first error,
   155062 # hence be sure to
   155063 #
   155064 # - have several errors which exercise different shift/discardings
   155065 #   - (): nothing to pop, nothing to discard
   155066 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   155067 #   - (* * *): nothing to pop, a lot to discard
   155068 #   - (1 + 2 * *): some to pop and discard
   155069 #
   155070 # - test the action associated to `error'
   155071 #
   155072 # - check the lookahead that triggers an error is not discarded
   155073 #   when we enter error recovery.  Below, the lookahead causing the
   155074 #   first error is ")", which is needed to recover from the error and
   155075 #   produce the "0" that triggers the "0 != 1" error.
   155076 #
   155077 cat >input <<'_ATEOF'
   155078 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   155079 _ATEOF
   155080 
   155081 { set +x
   155082 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155083 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155084 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155085 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155086 at_status=$? at_failed=false
   155087 $at_check_filter
   155088 echo stderr:; tee stderr <"$at_stderr"
   155089 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155090 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155091 $at_failed && at_fn_log_failure
   155092 $at_traceon; }
   155093 
   155094 
   155095 # Normalize the observed and expected error messages, depending upon the
   155096 # options.
   155097 # 1. Create the reference error message.
   155098 cat >expout <<'_ATEOF'
   155099 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   155100 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   155101 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   155102 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   155103 1.1-1.27: calc: error: 4444 != 1
   155104 _ATEOF
   155105 
   155106 # 2. If locations are not used, remove them.
   155107 sed 's/^[-0-9.]*: //' expout >at-expout
   155108 mv at-expout expout
   155109 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155110 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   155111 mv at-expout expout
   155112 # 4. Check
   155113 { set +x
   155114 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155115 at_fn_check_prepare_trace "java.at:369"
   155116 ( $at_check_trace; cat stderr
   155117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155118 at_status=$? at_failed=false
   155119 $at_check_filter
   155120 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155121 $at_diff expout "$at_stdout" || at_failed=:
   155122 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155123 $at_failed && at_fn_log_failure
   155124 $at_traceon; }
   155125 
   155126 
   155127 
   155128 # The same, but this time exercising explicitly triggered syntax errors.
   155129 # POSIX says the lookahead causing the error should not be discarded.
   155130 cat >input <<'_ATEOF'
   155131 (!) + (0 0) = 1
   155132 _ATEOF
   155133 
   155134 { set +x
   155135 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155136 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155137 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155139 at_status=$? at_failed=false
   155140 $at_check_filter
   155141 echo stderr:; tee stderr <"$at_stderr"
   155142 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155143 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155144 $at_failed && at_fn_log_failure
   155145 $at_traceon; }
   155146 
   155147 
   155148 # Normalize the observed and expected error messages, depending upon the
   155149 # options.
   155150 # 1. Create the reference error message.
   155151 cat >expout <<'_ATEOF'
   155152 1.7: syntax error, unexpected number
   155153 1.1-1.10: calc: error: 2222 != 1
   155154 _ATEOF
   155155 
   155156 # 2. If locations are not used, remove them.
   155157 sed 's/^[-0-9.]*: //' expout >at-expout
   155158 mv at-expout expout
   155159 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155160 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   155161 mv at-expout expout
   155162 # 4. Check
   155163 { set +x
   155164 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155165 at_fn_check_prepare_trace "java.at:369"
   155166 ( $at_check_trace; cat stderr
   155167 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155168 at_status=$? at_failed=false
   155169 $at_check_filter
   155170 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155171 $at_diff expout "$at_stdout" || at_failed=:
   155172 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155173 $at_failed && at_fn_log_failure
   155174 $at_traceon; }
   155175 
   155176 
   155177 cat >input <<'_ATEOF'
   155178 (- *) + (0 0) = 1
   155179 _ATEOF
   155180 
   155181 { set +x
   155182 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155183 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155184 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155185 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155186 at_status=$? at_failed=false
   155187 $at_check_filter
   155188 echo stderr:; tee stderr <"$at_stderr"
   155189 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155190 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155191 $at_failed && at_fn_log_failure
   155192 $at_traceon; }
   155193 
   155194 
   155195 # Normalize the observed and expected error messages, depending upon the
   155196 # options.
   155197 # 1. Create the reference error message.
   155198 cat >expout <<'_ATEOF'
   155199 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   155200 1.8: syntax error, unexpected number
   155201 1.1-1.11: calc: error: 2222 != 1
   155202 _ATEOF
   155203 
   155204 # 2. If locations are not used, remove them.
   155205 sed 's/^[-0-9.]*: //' expout >at-expout
   155206 mv at-expout expout
   155207 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155208 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   155209 mv at-expout expout
   155210 # 4. Check
   155211 { set +x
   155212 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155213 at_fn_check_prepare_trace "java.at:369"
   155214 ( $at_check_trace; cat stderr
   155215 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155216 at_status=$? at_failed=false
   155217 $at_check_filter
   155218 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155219 $at_diff expout "$at_stdout" || at_failed=:
   155220 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155221 $at_failed && at_fn_log_failure
   155222 $at_traceon; }
   155223 
   155224 
   155225 
   155226 
   155227   set +x
   155228   $at_times_p && times >"$at_times_file"
   155229 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   155230 read at_status <"$at_status_file"
   155231 #AT_STOP_311
   155232 #AT_START_312
   155233 at_fn_group_banner 312 'java.at:369' \
   155234   "Calculator %error-verbose %lex-param { InputStream is } " "" 19
   155235 at_xfail=no
   155236 (
   155237   $as_echo "312. $at_setup_line: testing $at_desc ..."
   155238   $at_traceon
   155239 
   155240 
   155241 
   155242 
   155243 
   155244 cat >Calc.y <<'_ATEOF'
   155245 /* Infix notation calculator--calc */
   155246 %language "Java"
   155247 %name-prefix "Calc"
   155248 %define parser_class_name "Calc"
   155249 %define public
   155250 
   155251 %error-verbose %lex-param { InputStream is }
   155252 %code {
   155253 
   155254   public static void main (String args[]) throws IOException
   155255   {
   155256     new Calc (System.in).parse ();
   155257   }
   155258 
   155259 }
   155260 
   155261 %code imports {
   155262   import java.io.StreamTokenizer;
   155263   import java.io.InputStream;
   155264   import java.io.InputStreamReader;
   155265   import java.io.Reader;
   155266   import java.io.IOException;
   155267 }
   155268 
   155269 /* Bison Declarations */
   155270 %token <Integer> NUM "number"
   155271 %type  <Integer> exp
   155272 
   155273 %nonassoc '=' /* comparison            */
   155274 %left '-' '+'
   155275 %left '*' '/'
   155276 %left NEG     /* negation--unary minus */
   155277 %right '^'    /* exponentiation        */
   155278 
   155279 /* Grammar follows */
   155280 %%
   155281 input:
   155282   line
   155283 | input line
   155284 ;
   155285 
   155286 line:
   155287   '\n'
   155288 | exp '\n'
   155289 | error '\n'
   155290 ;
   155291 
   155292 exp:
   155293   NUM                { $$ = $1;                                             }
   155294 | exp '=' exp
   155295   {
   155296     if ($1.intValue () != $3.intValue ())
   155297       yyerror ( "calc: error: " + $1 + " != " + $3);
   155298   }
   155299 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   155300 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   155301 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   155302 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   155303 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   155304 | exp '^' exp        { $$ = new Integer ((int)
   155305                                          Math.pow ($1.intValue (),
   155306                                                    $3.intValue ()));        }
   155307 | '(' exp ')'        { $$ = $2;                                             }
   155308 | '(' error ')'      { $$ = new Integer (1111);                             }
   155309 | '!'                { $$ = new Integer (0); return YYERROR;                }
   155310 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   155311 ;
   155312 
   155313 
   155314 %code lexer {
   155315 
   155316   StreamTokenizer st;
   155317 
   155318   public YYLexer (InputStream is)
   155319   {
   155320     st = new StreamTokenizer (new InputStreamReader (is));
   155321     st.resetSyntax ();
   155322     st.eolIsSignificant (true);
   155323     st.whitespaceChars (9, 9);
   155324     st.whitespaceChars (32, 32);
   155325     st.wordChars (48, 57);
   155326   }
   155327 
   155328 
   155329 
   155330   public void yyerror (String s)
   155331   {
   155332     System.err.println (s);
   155333   }
   155334 
   155335   Integer yylval;
   155336 
   155337   public Object getLVal() {
   155338     return yylval;
   155339   }
   155340 
   155341   public int yylex () throws IOException {
   155342     int ttype = st.nextToken ();
   155343 
   155344     if (ttype == st.TT_EOF)
   155345       return Calc.EOF;
   155346 
   155347     else if (ttype == st.TT_EOL)
   155348       {
   155349 
   155350         return (int) '\n';
   155351       }
   155352 
   155353     else if (ttype == st.TT_WORD)
   155354       {
   155355         yylval = new Integer (st.sval);
   155356         return Calc.NUM;
   155357       }
   155358 
   155359     else
   155360       return st.ttype;
   155361   }
   155362 
   155363 
   155364 
   155365 };
   155366 %%
   155367 
   155368 
   155369 class Position {
   155370   public int line;
   155371   public int token;
   155372 
   155373   public Position ()
   155374   {
   155375     line = 0;
   155376     token = 0;
   155377   }
   155378 
   155379   public Position (int l, int t)
   155380   {
   155381     line = l;
   155382     token = t;
   155383   }
   155384 
   155385   public boolean equals (Position l)
   155386   {
   155387     return l.line == line && l.token == token;
   155388   }
   155389 
   155390   public String toString ()
   155391   {
   155392     return Integer.toString (line) + "." + Integer.toString(token);
   155393   }
   155394 
   155395   public int lineno ()
   155396   {
   155397     return line;
   155398   }
   155399 
   155400   public int token ()
   155401   {
   155402     return token;
   155403   }
   155404 }
   155405 
   155406 _ATEOF
   155407 
   155408 
   155409 
   155410 
   155411 
   155412 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   155413   at_save_special_files
   155414   mkdir xml-tests
   155415     # Don't combine these Bison invocations since we want to be sure that
   155416   # --report=all isn't required to get the full XML file.
   155417   { set +x
   155418 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   155419                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   155420 at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
   155421 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   155422                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   155423 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155424 at_status=$? at_failed=false
   155425 $at_check_filter
   155426 echo stderr:; cat "$at_stderr"
   155427 echo stdout:; cat "$at_stdout"
   155428 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155429 $at_failed && at_fn_log_failure
   155430 $at_traceon; }
   155431 
   155432   { set +x
   155433 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   155434 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
   155435 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   155436 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155437 at_status=$? at_failed=false
   155438 $at_check_filter
   155439 echo stderr:; cat "$at_stderr"
   155440 echo stdout:; cat "$at_stdout"
   155441 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155442 $at_failed && at_fn_log_failure
   155443 $at_traceon; }
   155444 
   155445     cp xml-tests/test.output expout
   155446   { set +x
   155447 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   155448              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   155449              xml-tests/test.xml"
   155450 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   155451 ( $at_check_trace; $XSLTPROC \
   155452              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   155453              xml-tests/test.xml
   155454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155455 at_status=$? at_failed=false
   155456 $at_check_filter
   155457 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155458 $at_diff expout "$at_stdout" || at_failed=:
   155459 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155460 $at_failed && at_fn_log_failure
   155461 $at_traceon; }
   155462 
   155463   sort xml-tests/test.dot > expout
   155464   { set +x
   155465 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   155466              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   155467              xml-tests/test.xml | sort"
   155468 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   155469 ( $at_check_trace; $XSLTPROC \
   155470              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   155471              xml-tests/test.xml | sort
   155472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155473 at_status=$? at_failed=false
   155474 $at_check_filter
   155475 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155476 $at_diff expout "$at_stdout" || at_failed=:
   155477 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155478 $at_failed && at_fn_log_failure
   155479 $at_traceon; }
   155480 
   155481   rm -rf xml-tests expout
   155482   at_restore_special_files
   155483 fi
   155484 { set +x
   155485 $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
   155486 at_fn_check_prepare_trace "java.at:369"
   155487 ( $at_check_trace; bison -o Calc.java Calc.y
   155488 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155489 at_status=$? at_failed=false
   155490 $at_check_filter
   155491 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155492 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155493 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155494 $at_failed && at_fn_log_failure
   155495 $at_traceon; }
   155496 
   155497 
   155498 
   155499 $as_echo "java.at:369" >"$at_check_line_file"
   155500 (test -z "$CONF_JAVAC") \
   155501   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   155502 $as_echo "java.at:369" >"$at_check_line_file"
   155503 (test -z "$CONF_JAVA") \
   155504   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   155505 { set +x
   155506 $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
   155507 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
   155508 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   155509 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155510 at_status=$? at_failed=false
   155511 $at_check_filter
   155512 echo stderr:; cat "$at_stderr"
   155513 echo stdout:; cat "$at_stdout"
   155514 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155515 $at_failed && at_fn_log_failure
   155516 $at_traceon; }
   155517 
   155518 
   155519 # Test the priorities.
   155520 cat >input <<'_ATEOF'
   155521 1 + 2 * 3 = 7
   155522 1 + 2 * -3 = -5
   155523 
   155524 -1^2 = -1
   155525 (-1)^2 = 1
   155526 
   155527 ---1 = -1
   155528 
   155529 1 - 2 - 3 = -4
   155530 1 - (2 - 3) = 2
   155531 
   155532 2^2^3 = 256
   155533 (2^2)^3 = 64
   155534 _ATEOF
   155535 
   155536 { set +x
   155537 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155538 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155539 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155541 at_status=$? at_failed=false
   155542 $at_check_filter
   155543 echo stderr:; tee stderr <"$at_stderr"
   155544 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155545 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155546 $at_failed && at_fn_log_failure
   155547 $at_traceon; }
   155548 
   155549 
   155550 
   155551 # Some syntax errors.
   155552 cat >input <<'_ATEOF'
   155553 0 0
   155554 _ATEOF
   155555 
   155556 { set +x
   155557 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155558 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155559 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155560 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155561 at_status=$? at_failed=false
   155562 $at_check_filter
   155563 echo stderr:; tee stderr <"$at_stderr"
   155564 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155565 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155566 $at_failed && at_fn_log_failure
   155567 $at_traceon; }
   155568 
   155569 
   155570 # Normalize the observed and expected error messages, depending upon the
   155571 # options.
   155572 # 1. Create the reference error message.
   155573 cat >expout <<'_ATEOF'
   155574 1.2: syntax error, unexpected number
   155575 _ATEOF
   155576 
   155577 # 2. If locations are not used, remove them.
   155578 sed 's/^[-0-9.]*: //' expout >at-expout
   155579 mv at-expout expout
   155580 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155581 
   155582 # 4. Check
   155583 { set +x
   155584 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155585 at_fn_check_prepare_trace "java.at:369"
   155586 ( $at_check_trace; cat stderr
   155587 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155588 at_status=$? at_failed=false
   155589 $at_check_filter
   155590 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155591 $at_diff expout "$at_stdout" || at_failed=:
   155592 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155593 $at_failed && at_fn_log_failure
   155594 $at_traceon; }
   155595 
   155596 
   155597 cat >input <<'_ATEOF'
   155598 1//2
   155599 _ATEOF
   155600 
   155601 { set +x
   155602 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155603 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155604 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155605 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155606 at_status=$? at_failed=false
   155607 $at_check_filter
   155608 echo stderr:; tee stderr <"$at_stderr"
   155609 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155610 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155611 $at_failed && at_fn_log_failure
   155612 $at_traceon; }
   155613 
   155614 
   155615 # Normalize the observed and expected error messages, depending upon the
   155616 # options.
   155617 # 1. Create the reference error message.
   155618 cat >expout <<'_ATEOF'
   155619 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   155620 _ATEOF
   155621 
   155622 # 2. If locations are not used, remove them.
   155623 sed 's/^[-0-9.]*: //' expout >at-expout
   155624 mv at-expout expout
   155625 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155626 
   155627 # 4. Check
   155628 { set +x
   155629 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155630 at_fn_check_prepare_trace "java.at:369"
   155631 ( $at_check_trace; cat stderr
   155632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155633 at_status=$? at_failed=false
   155634 $at_check_filter
   155635 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155636 $at_diff expout "$at_stdout" || at_failed=:
   155637 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155638 $at_failed && at_fn_log_failure
   155639 $at_traceon; }
   155640 
   155641 
   155642 cat >input <<'_ATEOF'
   155643 error
   155644 _ATEOF
   155645 
   155646 { set +x
   155647 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155648 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155649 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155651 at_status=$? at_failed=false
   155652 $at_check_filter
   155653 echo stderr:; tee stderr <"$at_stderr"
   155654 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155655 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155656 $at_failed && at_fn_log_failure
   155657 $at_traceon; }
   155658 
   155659 
   155660 # Normalize the observed and expected error messages, depending upon the
   155661 # options.
   155662 # 1. Create the reference error message.
   155663 cat >expout <<'_ATEOF'
   155664 1.1: syntax error, unexpected $undefined
   155665 _ATEOF
   155666 
   155667 # 2. If locations are not used, remove them.
   155668 sed 's/^[-0-9.]*: //' expout >at-expout
   155669 mv at-expout expout
   155670 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155671 
   155672 # 4. Check
   155673 { set +x
   155674 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155675 at_fn_check_prepare_trace "java.at:369"
   155676 ( $at_check_trace; cat stderr
   155677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155678 at_status=$? at_failed=false
   155679 $at_check_filter
   155680 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155681 $at_diff expout "$at_stdout" || at_failed=:
   155682 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155683 $at_failed && at_fn_log_failure
   155684 $at_traceon; }
   155685 
   155686 
   155687 cat >input <<'_ATEOF'
   155688 1 = 2 = 3
   155689 _ATEOF
   155690 
   155691 { set +x
   155692 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155693 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155694 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155695 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155696 at_status=$? at_failed=false
   155697 $at_check_filter
   155698 echo stderr:; tee stderr <"$at_stderr"
   155699 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155700 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155701 $at_failed && at_fn_log_failure
   155702 $at_traceon; }
   155703 
   155704 
   155705 # Normalize the observed and expected error messages, depending upon the
   155706 # options.
   155707 # 1. Create the reference error message.
   155708 cat >expout <<'_ATEOF'
   155709 1.4: syntax error, unexpected '='
   155710 _ATEOF
   155711 
   155712 # 2. If locations are not used, remove them.
   155713 sed 's/^[-0-9.]*: //' expout >at-expout
   155714 mv at-expout expout
   155715 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155716 
   155717 # 4. Check
   155718 { set +x
   155719 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155720 at_fn_check_prepare_trace "java.at:369"
   155721 ( $at_check_trace; cat stderr
   155722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155723 at_status=$? at_failed=false
   155724 $at_check_filter
   155725 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155726 $at_diff expout "$at_stdout" || at_failed=:
   155727 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155728 $at_failed && at_fn_log_failure
   155729 $at_traceon; }
   155730 
   155731 
   155732 cat >input <<'_ATEOF'
   155733 
   155734 +1
   155735 _ATEOF
   155736 
   155737 { set +x
   155738 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155739 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155740 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155742 at_status=$? at_failed=false
   155743 $at_check_filter
   155744 echo stderr:; tee stderr <"$at_stderr"
   155745 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155746 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155747 $at_failed && at_fn_log_failure
   155748 $at_traceon; }
   155749 
   155750 
   155751 # Normalize the observed and expected error messages, depending upon the
   155752 # options.
   155753 # 1. Create the reference error message.
   155754 cat >expout <<'_ATEOF'
   155755 2.1: syntax error, unexpected '+'
   155756 _ATEOF
   155757 
   155758 # 2. If locations are not used, remove them.
   155759 sed 's/^[-0-9.]*: //' expout >at-expout
   155760 mv at-expout expout
   155761 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155762 
   155763 # 4. Check
   155764 { set +x
   155765 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155766 at_fn_check_prepare_trace "java.at:369"
   155767 ( $at_check_trace; cat stderr
   155768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155769 at_status=$? at_failed=false
   155770 $at_check_filter
   155771 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155772 $at_diff expout "$at_stdout" || at_failed=:
   155773 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155774 $at_failed && at_fn_log_failure
   155775 $at_traceon; }
   155776 
   155777 
   155778 # Exercise error messages with EOF: work on an empty file.
   155779 { set +x
   155780 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   155781 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
   155782 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   155783 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155784 at_status=$? at_failed=false
   155785 $at_check_filter
   155786 echo stderr:; tee stderr <"$at_stderr"
   155787 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155788 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155789 $at_failed && at_fn_log_failure
   155790 $at_traceon; }
   155791 
   155792 
   155793 # Normalize the observed and expected error messages, depending upon the
   155794 # options.
   155795 # 1. Create the reference error message.
   155796 cat >expout <<'_ATEOF'
   155797 1.1: syntax error, unexpected end of input
   155798 _ATEOF
   155799 
   155800 # 2. If locations are not used, remove them.
   155801 sed 's/^[-0-9.]*: //' expout >at-expout
   155802 mv at-expout expout
   155803 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155804 
   155805 # 4. Check
   155806 { set +x
   155807 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155808 at_fn_check_prepare_trace "java.at:369"
   155809 ( $at_check_trace; cat stderr
   155810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155811 at_status=$? at_failed=false
   155812 $at_check_filter
   155813 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155814 $at_diff expout "$at_stdout" || at_failed=:
   155815 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155816 $at_failed && at_fn_log_failure
   155817 $at_traceon; }
   155818 
   155819 
   155820 
   155821 # Exercise the error token: without it, we die at the first error,
   155822 # hence be sure to
   155823 #
   155824 # - have several errors which exercise different shift/discardings
   155825 #   - (): nothing to pop, nothing to discard
   155826 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   155827 #   - (* * *): nothing to pop, a lot to discard
   155828 #   - (1 + 2 * *): some to pop and discard
   155829 #
   155830 # - test the action associated to `error'
   155831 #
   155832 # - check the lookahead that triggers an error is not discarded
   155833 #   when we enter error recovery.  Below, the lookahead causing the
   155834 #   first error is ")", which is needed to recover from the error and
   155835 #   produce the "0" that triggers the "0 != 1" error.
   155836 #
   155837 cat >input <<'_ATEOF'
   155838 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   155839 _ATEOF
   155840 
   155841 { set +x
   155842 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155843 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155844 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155845 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155846 at_status=$? at_failed=false
   155847 $at_check_filter
   155848 echo stderr:; tee stderr <"$at_stderr"
   155849 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155850 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155851 $at_failed && at_fn_log_failure
   155852 $at_traceon; }
   155853 
   155854 
   155855 # Normalize the observed and expected error messages, depending upon the
   155856 # options.
   155857 # 1. Create the reference error message.
   155858 cat >expout <<'_ATEOF'
   155859 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   155860 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   155861 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   155862 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   155863 1.1-1.27: calc: error: 4444 != 1
   155864 _ATEOF
   155865 
   155866 # 2. If locations are not used, remove them.
   155867 sed 's/^[-0-9.]*: //' expout >at-expout
   155868 mv at-expout expout
   155869 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155870 
   155871 # 4. Check
   155872 { set +x
   155873 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155874 at_fn_check_prepare_trace "java.at:369"
   155875 ( $at_check_trace; cat stderr
   155876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155877 at_status=$? at_failed=false
   155878 $at_check_filter
   155879 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155880 $at_diff expout "$at_stdout" || at_failed=:
   155881 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155882 $at_failed && at_fn_log_failure
   155883 $at_traceon; }
   155884 
   155885 
   155886 
   155887 # The same, but this time exercising explicitly triggered syntax errors.
   155888 # POSIX says the lookahead causing the error should not be discarded.
   155889 cat >input <<'_ATEOF'
   155890 (!) + (0 0) = 1
   155891 _ATEOF
   155892 
   155893 { set +x
   155894 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155895 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155896 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155898 at_status=$? at_failed=false
   155899 $at_check_filter
   155900 echo stderr:; tee stderr <"$at_stderr"
   155901 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155902 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155903 $at_failed && at_fn_log_failure
   155904 $at_traceon; }
   155905 
   155906 
   155907 # Normalize the observed and expected error messages, depending upon the
   155908 # options.
   155909 # 1. Create the reference error message.
   155910 cat >expout <<'_ATEOF'
   155911 1.7: syntax error, unexpected number
   155912 1.1-1.10: calc: error: 2222 != 1
   155913 _ATEOF
   155914 
   155915 # 2. If locations are not used, remove them.
   155916 sed 's/^[-0-9.]*: //' expout >at-expout
   155917 mv at-expout expout
   155918 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155919 
   155920 # 4. Check
   155921 { set +x
   155922 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155923 at_fn_check_prepare_trace "java.at:369"
   155924 ( $at_check_trace; cat stderr
   155925 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155926 at_status=$? at_failed=false
   155927 $at_check_filter
   155928 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155929 $at_diff expout "$at_stdout" || at_failed=:
   155930 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155931 $at_failed && at_fn_log_failure
   155932 $at_traceon; }
   155933 
   155934 
   155935 cat >input <<'_ATEOF'
   155936 (- *) + (0 0) = 1
   155937 _ATEOF
   155938 
   155939 { set +x
   155940 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   155941 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   155942 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   155943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155944 at_status=$? at_failed=false
   155945 $at_check_filter
   155946 echo stderr:; tee stderr <"$at_stderr"
   155947 at_fn_diff_devnull "$at_stdout" || at_failed=:
   155948 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155949 $at_failed && at_fn_log_failure
   155950 $at_traceon; }
   155951 
   155952 
   155953 # Normalize the observed and expected error messages, depending upon the
   155954 # options.
   155955 # 1. Create the reference error message.
   155956 cat >expout <<'_ATEOF'
   155957 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   155958 1.8: syntax error, unexpected number
   155959 1.1-1.11: calc: error: 2222 != 1
   155960 _ATEOF
   155961 
   155962 # 2. If locations are not used, remove them.
   155963 sed 's/^[-0-9.]*: //' expout >at-expout
   155964 mv at-expout expout
   155965 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   155966 
   155967 # 4. Check
   155968 { set +x
   155969 $as_echo "$at_srcdir/java.at:369: cat stderr"
   155970 at_fn_check_prepare_trace "java.at:369"
   155971 ( $at_check_trace; cat stderr
   155972 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   155973 at_status=$? at_failed=false
   155974 $at_check_filter
   155975 at_fn_diff_devnull "$at_stderr" || at_failed=:
   155976 $at_diff expout "$at_stdout" || at_failed=:
   155977 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   155978 $at_failed && at_fn_log_failure
   155979 $at_traceon; }
   155980 
   155981 
   155982 
   155983 
   155984   set +x
   155985   $at_times_p && times >"$at_times_file"
   155986 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   155987 read at_status <"$at_status_file"
   155988 #AT_STOP_312
   155989 #AT_START_313
   155990 at_fn_group_banner 313 'java.at:369' \
   155991   "Calculator %locations %lex-param { InputStream is } " "" 19
   155992 at_xfail=no
   155993 (
   155994   $as_echo "313. $at_setup_line: testing $at_desc ..."
   155995   $at_traceon
   155996 
   155997 
   155998 
   155999 
   156000 
   156001 cat >Calc.y <<'_ATEOF'
   156002 /* Infix notation calculator--calc */
   156003 %language "Java"
   156004 %name-prefix "Calc"
   156005 %define parser_class_name "Calc"
   156006 %define public
   156007 
   156008 %locations %lex-param { InputStream is }
   156009 %code {
   156010 
   156011   public static void main (String args[]) throws IOException
   156012   {
   156013     new Calc (System.in).parse ();
   156014   }
   156015 
   156016 }
   156017 
   156018 %code imports {
   156019   import java.io.StreamTokenizer;
   156020   import java.io.InputStream;
   156021   import java.io.InputStreamReader;
   156022   import java.io.Reader;
   156023   import java.io.IOException;
   156024 }
   156025 
   156026 /* Bison Declarations */
   156027 %token <Integer> NUM "number"
   156028 %type  <Integer> exp
   156029 
   156030 %nonassoc '=' /* comparison            */
   156031 %left '-' '+'
   156032 %left '*' '/'
   156033 %left NEG     /* negation--unary minus */
   156034 %right '^'    /* exponentiation        */
   156035 
   156036 /* Grammar follows */
   156037 %%
   156038 input:
   156039   line
   156040 | input line
   156041 ;
   156042 
   156043 line:
   156044   '\n'
   156045 | exp '\n'
   156046 | error '\n'
   156047 ;
   156048 
   156049 exp:
   156050   NUM                { $$ = $1;                                             }
   156051 | exp '=' exp
   156052   {
   156053     if ($1.intValue () != $3.intValue ())
   156054       yyerror (@$, "calc: error: " + $1 + " != " + $3);
   156055   }
   156056 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   156057 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   156058 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   156059 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   156060 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   156061 | exp '^' exp        { $$ = new Integer ((int)
   156062                                          Math.pow ($1.intValue (),
   156063                                                    $3.intValue ()));        }
   156064 | '(' exp ')'        { $$ = $2;                                             }
   156065 | '(' error ')'      { $$ = new Integer (1111);                             }
   156066 | '!'                { $$ = new Integer (0); return YYERROR;                }
   156067 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   156068 ;
   156069 
   156070 
   156071 %code lexer {
   156072 
   156073   StreamTokenizer st;
   156074 
   156075   public YYLexer (InputStream is)
   156076   {
   156077     st = new StreamTokenizer (new InputStreamReader (is));
   156078     st.resetSyntax ();
   156079     st.eolIsSignificant (true);
   156080     st.whitespaceChars (9, 9);
   156081     st.whitespaceChars (32, 32);
   156082     st.wordChars (48, 57);
   156083   }
   156084 
   156085 
   156086   Position yypos = new Position (1, 0);
   156087 
   156088   public Position getStartPos() {
   156089     return yypos;
   156090   }
   156091 
   156092   public Position getEndPos() {
   156093     return yypos;
   156094   }
   156095 
   156096   public void yyerror (Calc.Location l, String s)
   156097   {
   156098     if (l == null)
   156099       System.err.println (s);
   156100     else
   156101       System.err.println (l + ": " + s);
   156102   }
   156103 
   156104 
   156105   Integer yylval;
   156106 
   156107   public Object getLVal() {
   156108     return yylval;
   156109   }
   156110 
   156111   public int yylex () throws IOException {
   156112     int ttype = st.nextToken ();
   156113     yypos = new Position (yypos.lineno (),
   156114                                             yypos.token () + 1);
   156115     if (ttype == st.TT_EOF)
   156116       return Calc.EOF;
   156117 
   156118     else if (ttype == st.TT_EOL)
   156119       {
   156120         yypos = new Position (yypos.lineno () + 1, 0);
   156121         return (int) '\n';
   156122       }
   156123 
   156124     else if (ttype == st.TT_WORD)
   156125       {
   156126         yylval = new Integer (st.sval);
   156127         return Calc.NUM;
   156128       }
   156129 
   156130     else
   156131       return st.ttype;
   156132   }
   156133 
   156134 
   156135 
   156136 };
   156137 %%
   156138 
   156139 
   156140 class Position {
   156141   public int line;
   156142   public int token;
   156143 
   156144   public Position ()
   156145   {
   156146     line = 0;
   156147     token = 0;
   156148   }
   156149 
   156150   public Position (int l, int t)
   156151   {
   156152     line = l;
   156153     token = t;
   156154   }
   156155 
   156156   public boolean equals (Position l)
   156157   {
   156158     return l.line == line && l.token == token;
   156159   }
   156160 
   156161   public String toString ()
   156162   {
   156163     return Integer.toString (line) + "." + Integer.toString(token);
   156164   }
   156165 
   156166   public int lineno ()
   156167   {
   156168     return line;
   156169   }
   156170 
   156171   public int token ()
   156172   {
   156173     return token;
   156174   }
   156175 }
   156176 
   156177 _ATEOF
   156178 
   156179 
   156180 
   156181 
   156182 
   156183 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   156184   at_save_special_files
   156185   mkdir xml-tests
   156186     # Don't combine these Bison invocations since we want to be sure that
   156187   # --report=all isn't required to get the full XML file.
   156188   { set +x
   156189 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   156190                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   156191 at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
   156192 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   156193                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   156194 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156195 at_status=$? at_failed=false
   156196 $at_check_filter
   156197 echo stderr:; cat "$at_stderr"
   156198 echo stdout:; cat "$at_stdout"
   156199 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156200 $at_failed && at_fn_log_failure
   156201 $at_traceon; }
   156202 
   156203   { set +x
   156204 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   156205 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
   156206 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   156207 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156208 at_status=$? at_failed=false
   156209 $at_check_filter
   156210 echo stderr:; cat "$at_stderr"
   156211 echo stdout:; cat "$at_stdout"
   156212 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156213 $at_failed && at_fn_log_failure
   156214 $at_traceon; }
   156215 
   156216     cp xml-tests/test.output expout
   156217   { set +x
   156218 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   156219              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   156220              xml-tests/test.xml"
   156221 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   156222 ( $at_check_trace; $XSLTPROC \
   156223              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   156224              xml-tests/test.xml
   156225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156226 at_status=$? at_failed=false
   156227 $at_check_filter
   156228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156229 $at_diff expout "$at_stdout" || at_failed=:
   156230 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156231 $at_failed && at_fn_log_failure
   156232 $at_traceon; }
   156233 
   156234   sort xml-tests/test.dot > expout
   156235   { set +x
   156236 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   156237              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   156238              xml-tests/test.xml | sort"
   156239 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   156240 ( $at_check_trace; $XSLTPROC \
   156241              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   156242              xml-tests/test.xml | sort
   156243 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156244 at_status=$? at_failed=false
   156245 $at_check_filter
   156246 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156247 $at_diff expout "$at_stdout" || at_failed=:
   156248 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156249 $at_failed && at_fn_log_failure
   156250 $at_traceon; }
   156251 
   156252   rm -rf xml-tests expout
   156253   at_restore_special_files
   156254 fi
   156255 { set +x
   156256 $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
   156257 at_fn_check_prepare_trace "java.at:369"
   156258 ( $at_check_trace; bison -o Calc.java Calc.y
   156259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156260 at_status=$? at_failed=false
   156261 $at_check_filter
   156262 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156263 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156264 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156265 $at_failed && at_fn_log_failure
   156266 $at_traceon; }
   156267 
   156268 
   156269 
   156270 $as_echo "java.at:369" >"$at_check_line_file"
   156271 (test -z "$CONF_JAVAC") \
   156272   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   156273 $as_echo "java.at:369" >"$at_check_line_file"
   156274 (test -z "$CONF_JAVA") \
   156275   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   156276 { set +x
   156277 $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
   156278 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
   156279 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   156280 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156281 at_status=$? at_failed=false
   156282 $at_check_filter
   156283 echo stderr:; cat "$at_stderr"
   156284 echo stdout:; cat "$at_stdout"
   156285 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156286 $at_failed && at_fn_log_failure
   156287 $at_traceon; }
   156288 
   156289 
   156290 # Test the priorities.
   156291 cat >input <<'_ATEOF'
   156292 1 + 2 * 3 = 7
   156293 1 + 2 * -3 = -5
   156294 
   156295 -1^2 = -1
   156296 (-1)^2 = 1
   156297 
   156298 ---1 = -1
   156299 
   156300 1 - 2 - 3 = -4
   156301 1 - (2 - 3) = 2
   156302 
   156303 2^2^3 = 256
   156304 (2^2)^3 = 64
   156305 _ATEOF
   156306 
   156307 { set +x
   156308 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156309 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156310 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156312 at_status=$? at_failed=false
   156313 $at_check_filter
   156314 echo stderr:; tee stderr <"$at_stderr"
   156315 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156316 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156317 $at_failed && at_fn_log_failure
   156318 $at_traceon; }
   156319 
   156320 
   156321 
   156322 # Some syntax errors.
   156323 cat >input <<'_ATEOF'
   156324 0 0
   156325 _ATEOF
   156326 
   156327 { set +x
   156328 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156329 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156330 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156332 at_status=$? at_failed=false
   156333 $at_check_filter
   156334 echo stderr:; tee stderr <"$at_stderr"
   156335 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156336 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156337 $at_failed && at_fn_log_failure
   156338 $at_traceon; }
   156339 
   156340 
   156341 # Normalize the observed and expected error messages, depending upon the
   156342 # options.
   156343 # 1. Create the reference error message.
   156344 cat >expout <<'_ATEOF'
   156345 1.2: syntax error, unexpected number
   156346 _ATEOF
   156347 
   156348 # 2. If locations are not used, remove them.
   156349 
   156350 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156351 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156352 mv at-expout expout
   156353 # 4. Check
   156354 { set +x
   156355 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156356 at_fn_check_prepare_trace "java.at:369"
   156357 ( $at_check_trace; cat stderr
   156358 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156359 at_status=$? at_failed=false
   156360 $at_check_filter
   156361 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156362 $at_diff expout "$at_stdout" || at_failed=:
   156363 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156364 $at_failed && at_fn_log_failure
   156365 $at_traceon; }
   156366 
   156367 
   156368 cat >input <<'_ATEOF'
   156369 1//2
   156370 _ATEOF
   156371 
   156372 { set +x
   156373 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156374 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156375 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156377 at_status=$? at_failed=false
   156378 $at_check_filter
   156379 echo stderr:; tee stderr <"$at_stderr"
   156380 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156381 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156382 $at_failed && at_fn_log_failure
   156383 $at_traceon; }
   156384 
   156385 
   156386 # Normalize the observed and expected error messages, depending upon the
   156387 # options.
   156388 # 1. Create the reference error message.
   156389 cat >expout <<'_ATEOF'
   156390 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   156391 _ATEOF
   156392 
   156393 # 2. If locations are not used, remove them.
   156394 
   156395 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156396 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156397 mv at-expout expout
   156398 # 4. Check
   156399 { set +x
   156400 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156401 at_fn_check_prepare_trace "java.at:369"
   156402 ( $at_check_trace; cat stderr
   156403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156404 at_status=$? at_failed=false
   156405 $at_check_filter
   156406 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156407 $at_diff expout "$at_stdout" || at_failed=:
   156408 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156409 $at_failed && at_fn_log_failure
   156410 $at_traceon; }
   156411 
   156412 
   156413 cat >input <<'_ATEOF'
   156414 error
   156415 _ATEOF
   156416 
   156417 { set +x
   156418 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156419 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156420 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156421 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156422 at_status=$? at_failed=false
   156423 $at_check_filter
   156424 echo stderr:; tee stderr <"$at_stderr"
   156425 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156426 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156427 $at_failed && at_fn_log_failure
   156428 $at_traceon; }
   156429 
   156430 
   156431 # Normalize the observed and expected error messages, depending upon the
   156432 # options.
   156433 # 1. Create the reference error message.
   156434 cat >expout <<'_ATEOF'
   156435 1.1: syntax error, unexpected $undefined
   156436 _ATEOF
   156437 
   156438 # 2. If locations are not used, remove them.
   156439 
   156440 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156441 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156442 mv at-expout expout
   156443 # 4. Check
   156444 { set +x
   156445 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156446 at_fn_check_prepare_trace "java.at:369"
   156447 ( $at_check_trace; cat stderr
   156448 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156449 at_status=$? at_failed=false
   156450 $at_check_filter
   156451 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156452 $at_diff expout "$at_stdout" || at_failed=:
   156453 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156454 $at_failed && at_fn_log_failure
   156455 $at_traceon; }
   156456 
   156457 
   156458 cat >input <<'_ATEOF'
   156459 1 = 2 = 3
   156460 _ATEOF
   156461 
   156462 { set +x
   156463 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156464 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156465 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156466 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156467 at_status=$? at_failed=false
   156468 $at_check_filter
   156469 echo stderr:; tee stderr <"$at_stderr"
   156470 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156471 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156472 $at_failed && at_fn_log_failure
   156473 $at_traceon; }
   156474 
   156475 
   156476 # Normalize the observed and expected error messages, depending upon the
   156477 # options.
   156478 # 1. Create the reference error message.
   156479 cat >expout <<'_ATEOF'
   156480 1.4: syntax error, unexpected '='
   156481 _ATEOF
   156482 
   156483 # 2. If locations are not used, remove them.
   156484 
   156485 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156486 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156487 mv at-expout expout
   156488 # 4. Check
   156489 { set +x
   156490 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156491 at_fn_check_prepare_trace "java.at:369"
   156492 ( $at_check_trace; cat stderr
   156493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156494 at_status=$? at_failed=false
   156495 $at_check_filter
   156496 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156497 $at_diff expout "$at_stdout" || at_failed=:
   156498 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156499 $at_failed && at_fn_log_failure
   156500 $at_traceon; }
   156501 
   156502 
   156503 cat >input <<'_ATEOF'
   156504 
   156505 +1
   156506 _ATEOF
   156507 
   156508 { set +x
   156509 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156510 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156511 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156513 at_status=$? at_failed=false
   156514 $at_check_filter
   156515 echo stderr:; tee stderr <"$at_stderr"
   156516 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156517 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156518 $at_failed && at_fn_log_failure
   156519 $at_traceon; }
   156520 
   156521 
   156522 # Normalize the observed and expected error messages, depending upon the
   156523 # options.
   156524 # 1. Create the reference error message.
   156525 cat >expout <<'_ATEOF'
   156526 2.1: syntax error, unexpected '+'
   156527 _ATEOF
   156528 
   156529 # 2. If locations are not used, remove them.
   156530 
   156531 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156532 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156533 mv at-expout expout
   156534 # 4. Check
   156535 { set +x
   156536 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156537 at_fn_check_prepare_trace "java.at:369"
   156538 ( $at_check_trace; cat stderr
   156539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156540 at_status=$? at_failed=false
   156541 $at_check_filter
   156542 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156543 $at_diff expout "$at_stdout" || at_failed=:
   156544 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156545 $at_failed && at_fn_log_failure
   156546 $at_traceon; }
   156547 
   156548 
   156549 # Exercise error messages with EOF: work on an empty file.
   156550 { set +x
   156551 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   156552 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
   156553 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   156554 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156555 at_status=$? at_failed=false
   156556 $at_check_filter
   156557 echo stderr:; tee stderr <"$at_stderr"
   156558 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156559 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156560 $at_failed && at_fn_log_failure
   156561 $at_traceon; }
   156562 
   156563 
   156564 # Normalize the observed and expected error messages, depending upon the
   156565 # options.
   156566 # 1. Create the reference error message.
   156567 cat >expout <<'_ATEOF'
   156568 1.1: syntax error, unexpected end of input
   156569 _ATEOF
   156570 
   156571 # 2. If locations are not used, remove them.
   156572 
   156573 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156574 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156575 mv at-expout expout
   156576 # 4. Check
   156577 { set +x
   156578 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156579 at_fn_check_prepare_trace "java.at:369"
   156580 ( $at_check_trace; cat stderr
   156581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156582 at_status=$? at_failed=false
   156583 $at_check_filter
   156584 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156585 $at_diff expout "$at_stdout" || at_failed=:
   156586 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156587 $at_failed && at_fn_log_failure
   156588 $at_traceon; }
   156589 
   156590 
   156591 
   156592 # Exercise the error token: without it, we die at the first error,
   156593 # hence be sure to
   156594 #
   156595 # - have several errors which exercise different shift/discardings
   156596 #   - (): nothing to pop, nothing to discard
   156597 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   156598 #   - (* * *): nothing to pop, a lot to discard
   156599 #   - (1 + 2 * *): some to pop and discard
   156600 #
   156601 # - test the action associated to `error'
   156602 #
   156603 # - check the lookahead that triggers an error is not discarded
   156604 #   when we enter error recovery.  Below, the lookahead causing the
   156605 #   first error is ")", which is needed to recover from the error and
   156606 #   produce the "0" that triggers the "0 != 1" error.
   156607 #
   156608 cat >input <<'_ATEOF'
   156609 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   156610 _ATEOF
   156611 
   156612 { set +x
   156613 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156614 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156615 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156616 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156617 at_status=$? at_failed=false
   156618 $at_check_filter
   156619 echo stderr:; tee stderr <"$at_stderr"
   156620 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156621 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156622 $at_failed && at_fn_log_failure
   156623 $at_traceon; }
   156624 
   156625 
   156626 # Normalize the observed and expected error messages, depending upon the
   156627 # options.
   156628 # 1. Create the reference error message.
   156629 cat >expout <<'_ATEOF'
   156630 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   156631 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   156632 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   156633 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   156634 1.1-1.27: calc: error: 4444 != 1
   156635 _ATEOF
   156636 
   156637 # 2. If locations are not used, remove them.
   156638 
   156639 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156640 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156641 mv at-expout expout
   156642 # 4. Check
   156643 { set +x
   156644 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156645 at_fn_check_prepare_trace "java.at:369"
   156646 ( $at_check_trace; cat stderr
   156647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156648 at_status=$? at_failed=false
   156649 $at_check_filter
   156650 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156651 $at_diff expout "$at_stdout" || at_failed=:
   156652 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156653 $at_failed && at_fn_log_failure
   156654 $at_traceon; }
   156655 
   156656 
   156657 
   156658 # The same, but this time exercising explicitly triggered syntax errors.
   156659 # POSIX says the lookahead causing the error should not be discarded.
   156660 cat >input <<'_ATEOF'
   156661 (!) + (0 0) = 1
   156662 _ATEOF
   156663 
   156664 { set +x
   156665 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156666 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156667 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156669 at_status=$? at_failed=false
   156670 $at_check_filter
   156671 echo stderr:; tee stderr <"$at_stderr"
   156672 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156673 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156674 $at_failed && at_fn_log_failure
   156675 $at_traceon; }
   156676 
   156677 
   156678 # Normalize the observed and expected error messages, depending upon the
   156679 # options.
   156680 # 1. Create the reference error message.
   156681 cat >expout <<'_ATEOF'
   156682 1.7: syntax error, unexpected number
   156683 1.1-1.10: calc: error: 2222 != 1
   156684 _ATEOF
   156685 
   156686 # 2. If locations are not used, remove them.
   156687 
   156688 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156689 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156690 mv at-expout expout
   156691 # 4. Check
   156692 { set +x
   156693 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156694 at_fn_check_prepare_trace "java.at:369"
   156695 ( $at_check_trace; cat stderr
   156696 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156697 at_status=$? at_failed=false
   156698 $at_check_filter
   156699 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156700 $at_diff expout "$at_stdout" || at_failed=:
   156701 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156702 $at_failed && at_fn_log_failure
   156703 $at_traceon; }
   156704 
   156705 
   156706 cat >input <<'_ATEOF'
   156707 (- *) + (0 0) = 1
   156708 _ATEOF
   156709 
   156710 { set +x
   156711 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   156712 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   156713 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   156714 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156715 at_status=$? at_failed=false
   156716 $at_check_filter
   156717 echo stderr:; tee stderr <"$at_stderr"
   156718 at_fn_diff_devnull "$at_stdout" || at_failed=:
   156719 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156720 $at_failed && at_fn_log_failure
   156721 $at_traceon; }
   156722 
   156723 
   156724 # Normalize the observed and expected error messages, depending upon the
   156725 # options.
   156726 # 1. Create the reference error message.
   156727 cat >expout <<'_ATEOF'
   156728 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   156729 1.8: syntax error, unexpected number
   156730 1.1-1.11: calc: error: 2222 != 1
   156731 _ATEOF
   156732 
   156733 # 2. If locations are not used, remove them.
   156734 
   156735 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   156736 sed 's/syntax error, .*$/syntax error/' expout >at-expout
   156737 mv at-expout expout
   156738 # 4. Check
   156739 { set +x
   156740 $as_echo "$at_srcdir/java.at:369: cat stderr"
   156741 at_fn_check_prepare_trace "java.at:369"
   156742 ( $at_check_trace; cat stderr
   156743 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156744 at_status=$? at_failed=false
   156745 $at_check_filter
   156746 at_fn_diff_devnull "$at_stderr" || at_failed=:
   156747 $at_diff expout "$at_stdout" || at_failed=:
   156748 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156749 $at_failed && at_fn_log_failure
   156750 $at_traceon; }
   156751 
   156752 
   156753 
   156754 
   156755   set +x
   156756   $at_times_p && times >"$at_times_file"
   156757 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   156758 read at_status <"$at_status_file"
   156759 #AT_STOP_313
   156760 #AT_START_314
   156761 at_fn_group_banner 314 'java.at:369' \
   156762   "Calculator %error-verbose %locations %lex-param { InputStream is } " "" 19
   156763 at_xfail=no
   156764 (
   156765   $as_echo "314. $at_setup_line: testing $at_desc ..."
   156766   $at_traceon
   156767 
   156768 
   156769 
   156770 
   156771 
   156772 cat >Calc.y <<'_ATEOF'
   156773 /* Infix notation calculator--calc */
   156774 %language "Java"
   156775 %name-prefix "Calc"
   156776 %define parser_class_name "Calc"
   156777 %define public
   156778 
   156779 %error-verbose %locations %lex-param { InputStream is }
   156780 %code {
   156781 
   156782   public static void main (String args[]) throws IOException
   156783   {
   156784     new Calc (System.in).parse ();
   156785   }
   156786 
   156787 }
   156788 
   156789 %code imports {
   156790   import java.io.StreamTokenizer;
   156791   import java.io.InputStream;
   156792   import java.io.InputStreamReader;
   156793   import java.io.Reader;
   156794   import java.io.IOException;
   156795 }
   156796 
   156797 /* Bison Declarations */
   156798 %token <Integer> NUM "number"
   156799 %type  <Integer> exp
   156800 
   156801 %nonassoc '=' /* comparison            */
   156802 %left '-' '+'
   156803 %left '*' '/'
   156804 %left NEG     /* negation--unary minus */
   156805 %right '^'    /* exponentiation        */
   156806 
   156807 /* Grammar follows */
   156808 %%
   156809 input:
   156810   line
   156811 | input line
   156812 ;
   156813 
   156814 line:
   156815   '\n'
   156816 | exp '\n'
   156817 | error '\n'
   156818 ;
   156819 
   156820 exp:
   156821   NUM                { $$ = $1;                                             }
   156822 | exp '=' exp
   156823   {
   156824     if ($1.intValue () != $3.intValue ())
   156825       yyerror (@$, "calc: error: " + $1 + " != " + $3);
   156826   }
   156827 | exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
   156828 | exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
   156829 | exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
   156830 | exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
   156831 | '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
   156832 | exp '^' exp        { $$ = new Integer ((int)
   156833                                          Math.pow ($1.intValue (),
   156834                                                    $3.intValue ()));        }
   156835 | '(' exp ')'        { $$ = $2;                                             }
   156836 | '(' error ')'      { $$ = new Integer (1111);                             }
   156837 | '!'                { $$ = new Integer (0); return YYERROR;                }
   156838 | '-' error          { $$ = new Integer (0); return YYERROR;                }
   156839 ;
   156840 
   156841 
   156842 %code lexer {
   156843 
   156844   StreamTokenizer st;
   156845 
   156846   public YYLexer (InputStream is)
   156847   {
   156848     st = new StreamTokenizer (new InputStreamReader (is));
   156849     st.resetSyntax ();
   156850     st.eolIsSignificant (true);
   156851     st.whitespaceChars (9, 9);
   156852     st.whitespaceChars (32, 32);
   156853     st.wordChars (48, 57);
   156854   }
   156855 
   156856 
   156857   Position yypos = new Position (1, 0);
   156858 
   156859   public Position getStartPos() {
   156860     return yypos;
   156861   }
   156862 
   156863   public Position getEndPos() {
   156864     return yypos;
   156865   }
   156866 
   156867   public void yyerror (Calc.Location l, String s)
   156868   {
   156869     if (l == null)
   156870       System.err.println (s);
   156871     else
   156872       System.err.println (l + ": " + s);
   156873   }
   156874 
   156875 
   156876   Integer yylval;
   156877 
   156878   public Object getLVal() {
   156879     return yylval;
   156880   }
   156881 
   156882   public int yylex () throws IOException {
   156883     int ttype = st.nextToken ();
   156884     yypos = new Position (yypos.lineno (),
   156885                                             yypos.token () + 1);
   156886     if (ttype == st.TT_EOF)
   156887       return Calc.EOF;
   156888 
   156889     else if (ttype == st.TT_EOL)
   156890       {
   156891         yypos = new Position (yypos.lineno () + 1, 0);
   156892         return (int) '\n';
   156893       }
   156894 
   156895     else if (ttype == st.TT_WORD)
   156896       {
   156897         yylval = new Integer (st.sval);
   156898         return Calc.NUM;
   156899       }
   156900 
   156901     else
   156902       return st.ttype;
   156903   }
   156904 
   156905 
   156906 
   156907 };
   156908 %%
   156909 
   156910 
   156911 class Position {
   156912   public int line;
   156913   public int token;
   156914 
   156915   public Position ()
   156916   {
   156917     line = 0;
   156918     token = 0;
   156919   }
   156920 
   156921   public Position (int l, int t)
   156922   {
   156923     line = l;
   156924     token = t;
   156925   }
   156926 
   156927   public boolean equals (Position l)
   156928   {
   156929     return l.line == line && l.token == token;
   156930   }
   156931 
   156932   public String toString ()
   156933   {
   156934     return Integer.toString (line) + "." + Integer.toString(token);
   156935   }
   156936 
   156937   public int lineno ()
   156938   {
   156939     return line;
   156940   }
   156941 
   156942   public int token ()
   156943   {
   156944     return token;
   156945   }
   156946 }
   156947 
   156948 _ATEOF
   156949 
   156950 
   156951 
   156952 
   156953 
   156954 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   156955   at_save_special_files
   156956   mkdir xml-tests
   156957     # Don't combine these Bison invocations since we want to be sure that
   156958   # --report=all isn't required to get the full XML file.
   156959   { set +x
   156960 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   156961                   --graph=xml-tests/test.dot -o Calc.java Calc.y"
   156962 at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
   156963 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   156964                   --graph=xml-tests/test.dot -o Calc.java Calc.y
   156965 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156966 at_status=$? at_failed=false
   156967 $at_check_filter
   156968 echo stderr:; cat "$at_stderr"
   156969 echo stdout:; cat "$at_stdout"
   156970 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156971 $at_failed && at_fn_log_failure
   156972 $at_traceon; }
   156973 
   156974   { set +x
   156975 $as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
   156976 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
   156977 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
   156978 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156979 at_status=$? at_failed=false
   156980 $at_check_filter
   156981 echo stderr:; cat "$at_stderr"
   156982 echo stdout:; cat "$at_stdout"
   156983 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   156984 $at_failed && at_fn_log_failure
   156985 $at_traceon; }
   156986 
   156987     cp xml-tests/test.output expout
   156988   { set +x
   156989 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   156990              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   156991              xml-tests/test.xml"
   156992 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   156993 ( $at_check_trace; $XSLTPROC \
   156994              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   156995              xml-tests/test.xml
   156996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   156997 at_status=$? at_failed=false
   156998 $at_check_filter
   156999 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157000 $at_diff expout "$at_stdout" || at_failed=:
   157001 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157002 $at_failed && at_fn_log_failure
   157003 $at_traceon; }
   157004 
   157005   sort xml-tests/test.dot > expout
   157006   { set +x
   157007 $as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
   157008              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   157009              xml-tests/test.xml | sort"
   157010 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
   157011 ( $at_check_trace; $XSLTPROC \
   157012              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   157013              xml-tests/test.xml | sort
   157014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157015 at_status=$? at_failed=false
   157016 $at_check_filter
   157017 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157018 $at_diff expout "$at_stdout" || at_failed=:
   157019 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157020 $at_failed && at_fn_log_failure
   157021 $at_traceon; }
   157022 
   157023   rm -rf xml-tests expout
   157024   at_restore_special_files
   157025 fi
   157026 { set +x
   157027 $as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y"
   157028 at_fn_check_prepare_trace "java.at:369"
   157029 ( $at_check_trace; bison -o Calc.java Calc.y
   157030 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157031 at_status=$? at_failed=false
   157032 $at_check_filter
   157033 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157034 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157035 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157036 $at_failed && at_fn_log_failure
   157037 $at_traceon; }
   157038 
   157039 
   157040 
   157041 $as_echo "java.at:369" >"$at_check_line_file"
   157042 (test -z "$CONF_JAVAC") \
   157043   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   157044 $as_echo "java.at:369" >"$at_check_line_file"
   157045 (test -z "$CONF_JAVA") \
   157046   && at_fn_check_skip 77 "$at_srcdir/java.at:369"
   157047 { set +x
   157048 $as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
   157049 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
   157050 ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
   157051 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157052 at_status=$? at_failed=false
   157053 $at_check_filter
   157054 echo stderr:; cat "$at_stderr"
   157055 echo stdout:; cat "$at_stdout"
   157056 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157057 $at_failed && at_fn_log_failure
   157058 $at_traceon; }
   157059 
   157060 
   157061 # Test the priorities.
   157062 cat >input <<'_ATEOF'
   157063 1 + 2 * 3 = 7
   157064 1 + 2 * -3 = -5
   157065 
   157066 -1^2 = -1
   157067 (-1)^2 = 1
   157068 
   157069 ---1 = -1
   157070 
   157071 1 - 2 - 3 = -4
   157072 1 - (2 - 3) = 2
   157073 
   157074 2^2^3 = 256
   157075 (2^2)^3 = 64
   157076 _ATEOF
   157077 
   157078 { set +x
   157079 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157080 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157081 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157083 at_status=$? at_failed=false
   157084 $at_check_filter
   157085 echo stderr:; tee stderr <"$at_stderr"
   157086 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157087 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157088 $at_failed && at_fn_log_failure
   157089 $at_traceon; }
   157090 
   157091 
   157092 
   157093 # Some syntax errors.
   157094 cat >input <<'_ATEOF'
   157095 0 0
   157096 _ATEOF
   157097 
   157098 { set +x
   157099 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157100 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157101 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157102 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157103 at_status=$? at_failed=false
   157104 $at_check_filter
   157105 echo stderr:; tee stderr <"$at_stderr"
   157106 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157107 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157108 $at_failed && at_fn_log_failure
   157109 $at_traceon; }
   157110 
   157111 
   157112 # Normalize the observed and expected error messages, depending upon the
   157113 # options.
   157114 # 1. Create the reference error message.
   157115 cat >expout <<'_ATEOF'
   157116 1.2: syntax error, unexpected number
   157117 _ATEOF
   157118 
   157119 # 2. If locations are not used, remove them.
   157120 
   157121 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157122 
   157123 # 4. Check
   157124 { set +x
   157125 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157126 at_fn_check_prepare_trace "java.at:369"
   157127 ( $at_check_trace; cat stderr
   157128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157129 at_status=$? at_failed=false
   157130 $at_check_filter
   157131 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157132 $at_diff expout "$at_stdout" || at_failed=:
   157133 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157134 $at_failed && at_fn_log_failure
   157135 $at_traceon; }
   157136 
   157137 
   157138 cat >input <<'_ATEOF'
   157139 1//2
   157140 _ATEOF
   157141 
   157142 { set +x
   157143 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157144 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157145 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157147 at_status=$? at_failed=false
   157148 $at_check_filter
   157149 echo stderr:; tee stderr <"$at_stderr"
   157150 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157151 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157152 $at_failed && at_fn_log_failure
   157153 $at_traceon; }
   157154 
   157155 
   157156 # Normalize the observed and expected error messages, depending upon the
   157157 # options.
   157158 # 1. Create the reference error message.
   157159 cat >expout <<'_ATEOF'
   157160 1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
   157161 _ATEOF
   157162 
   157163 # 2. If locations are not used, remove them.
   157164 
   157165 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157166 
   157167 # 4. Check
   157168 { set +x
   157169 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157170 at_fn_check_prepare_trace "java.at:369"
   157171 ( $at_check_trace; cat stderr
   157172 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157173 at_status=$? at_failed=false
   157174 $at_check_filter
   157175 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157176 $at_diff expout "$at_stdout" || at_failed=:
   157177 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157178 $at_failed && at_fn_log_failure
   157179 $at_traceon; }
   157180 
   157181 
   157182 cat >input <<'_ATEOF'
   157183 error
   157184 _ATEOF
   157185 
   157186 { set +x
   157187 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157188 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157189 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157191 at_status=$? at_failed=false
   157192 $at_check_filter
   157193 echo stderr:; tee stderr <"$at_stderr"
   157194 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157195 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157196 $at_failed && at_fn_log_failure
   157197 $at_traceon; }
   157198 
   157199 
   157200 # Normalize the observed and expected error messages, depending upon the
   157201 # options.
   157202 # 1. Create the reference error message.
   157203 cat >expout <<'_ATEOF'
   157204 1.1: syntax error, unexpected $undefined
   157205 _ATEOF
   157206 
   157207 # 2. If locations are not used, remove them.
   157208 
   157209 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157210 
   157211 # 4. Check
   157212 { set +x
   157213 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157214 at_fn_check_prepare_trace "java.at:369"
   157215 ( $at_check_trace; cat stderr
   157216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157217 at_status=$? at_failed=false
   157218 $at_check_filter
   157219 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157220 $at_diff expout "$at_stdout" || at_failed=:
   157221 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157222 $at_failed && at_fn_log_failure
   157223 $at_traceon; }
   157224 
   157225 
   157226 cat >input <<'_ATEOF'
   157227 1 = 2 = 3
   157228 _ATEOF
   157229 
   157230 { set +x
   157231 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157232 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157233 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157235 at_status=$? at_failed=false
   157236 $at_check_filter
   157237 echo stderr:; tee stderr <"$at_stderr"
   157238 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157239 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157240 $at_failed && at_fn_log_failure
   157241 $at_traceon; }
   157242 
   157243 
   157244 # Normalize the observed and expected error messages, depending upon the
   157245 # options.
   157246 # 1. Create the reference error message.
   157247 cat >expout <<'_ATEOF'
   157248 1.4: syntax error, unexpected '='
   157249 _ATEOF
   157250 
   157251 # 2. If locations are not used, remove them.
   157252 
   157253 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157254 
   157255 # 4. Check
   157256 { set +x
   157257 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157258 at_fn_check_prepare_trace "java.at:369"
   157259 ( $at_check_trace; cat stderr
   157260 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157261 at_status=$? at_failed=false
   157262 $at_check_filter
   157263 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157264 $at_diff expout "$at_stdout" || at_failed=:
   157265 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157266 $at_failed && at_fn_log_failure
   157267 $at_traceon; }
   157268 
   157269 
   157270 cat >input <<'_ATEOF'
   157271 
   157272 +1
   157273 _ATEOF
   157274 
   157275 { set +x
   157276 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157277 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157278 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157279 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157280 at_status=$? at_failed=false
   157281 $at_check_filter
   157282 echo stderr:; tee stderr <"$at_stderr"
   157283 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157284 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157285 $at_failed && at_fn_log_failure
   157286 $at_traceon; }
   157287 
   157288 
   157289 # Normalize the observed and expected error messages, depending upon the
   157290 # options.
   157291 # 1. Create the reference error message.
   157292 cat >expout <<'_ATEOF'
   157293 2.1: syntax error, unexpected '+'
   157294 _ATEOF
   157295 
   157296 # 2. If locations are not used, remove them.
   157297 
   157298 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157299 
   157300 # 4. Check
   157301 { set +x
   157302 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157303 at_fn_check_prepare_trace "java.at:369"
   157304 ( $at_check_trace; cat stderr
   157305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157306 at_status=$? at_failed=false
   157307 $at_check_filter
   157308 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157309 $at_diff expout "$at_stdout" || at_failed=:
   157310 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157311 $at_failed && at_fn_log_failure
   157312 $at_traceon; }
   157313 
   157314 
   157315 # Exercise error messages with EOF: work on an empty file.
   157316 { set +x
   157317 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
   157318 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
   157319 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
   157320 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157321 at_status=$? at_failed=false
   157322 $at_check_filter
   157323 echo stderr:; tee stderr <"$at_stderr"
   157324 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157325 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157326 $at_failed && at_fn_log_failure
   157327 $at_traceon; }
   157328 
   157329 
   157330 # Normalize the observed and expected error messages, depending upon the
   157331 # options.
   157332 # 1. Create the reference error message.
   157333 cat >expout <<'_ATEOF'
   157334 1.1: syntax error, unexpected end of input
   157335 _ATEOF
   157336 
   157337 # 2. If locations are not used, remove them.
   157338 
   157339 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157340 
   157341 # 4. Check
   157342 { set +x
   157343 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157344 at_fn_check_prepare_trace "java.at:369"
   157345 ( $at_check_trace; cat stderr
   157346 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157347 at_status=$? at_failed=false
   157348 $at_check_filter
   157349 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157350 $at_diff expout "$at_stdout" || at_failed=:
   157351 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157352 $at_failed && at_fn_log_failure
   157353 $at_traceon; }
   157354 
   157355 
   157356 
   157357 # Exercise the error token: without it, we die at the first error,
   157358 # hence be sure to
   157359 #
   157360 # - have several errors which exercise different shift/discardings
   157361 #   - (): nothing to pop, nothing to discard
   157362 #   - (1 + 1 + 1 +): a lot to pop, nothing to discard
   157363 #   - (* * *): nothing to pop, a lot to discard
   157364 #   - (1 + 2 * *): some to pop and discard
   157365 #
   157366 # - test the action associated to `error'
   157367 #
   157368 # - check the lookahead that triggers an error is not discarded
   157369 #   when we enter error recovery.  Below, the lookahead causing the
   157370 #   first error is ")", which is needed to recover from the error and
   157371 #   produce the "0" that triggers the "0 != 1" error.
   157372 #
   157373 cat >input <<'_ATEOF'
   157374 () + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
   157375 _ATEOF
   157376 
   157377 { set +x
   157378 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157379 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157380 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157382 at_status=$? at_failed=false
   157383 $at_check_filter
   157384 echo stderr:; tee stderr <"$at_stderr"
   157385 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157386 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157387 $at_failed && at_fn_log_failure
   157388 $at_traceon; }
   157389 
   157390 
   157391 # Normalize the observed and expected error messages, depending upon the
   157392 # options.
   157393 # 1. Create the reference error message.
   157394 cat >expout <<'_ATEOF'
   157395 1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   157396 1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
   157397 1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   157398 1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   157399 1.1-1.27: calc: error: 4444 != 1
   157400 _ATEOF
   157401 
   157402 # 2. If locations are not used, remove them.
   157403 
   157404 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157405 
   157406 # 4. Check
   157407 { set +x
   157408 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157409 at_fn_check_prepare_trace "java.at:369"
   157410 ( $at_check_trace; cat stderr
   157411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157412 at_status=$? at_failed=false
   157413 $at_check_filter
   157414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157415 $at_diff expout "$at_stdout" || at_failed=:
   157416 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157417 $at_failed && at_fn_log_failure
   157418 $at_traceon; }
   157419 
   157420 
   157421 
   157422 # The same, but this time exercising explicitly triggered syntax errors.
   157423 # POSIX says the lookahead causing the error should not be discarded.
   157424 cat >input <<'_ATEOF'
   157425 (!) + (0 0) = 1
   157426 _ATEOF
   157427 
   157428 { set +x
   157429 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157430 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157431 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157433 at_status=$? at_failed=false
   157434 $at_check_filter
   157435 echo stderr:; tee stderr <"$at_stderr"
   157436 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157437 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157438 $at_failed && at_fn_log_failure
   157439 $at_traceon; }
   157440 
   157441 
   157442 # Normalize the observed and expected error messages, depending upon the
   157443 # options.
   157444 # 1. Create the reference error message.
   157445 cat >expout <<'_ATEOF'
   157446 1.7: syntax error, unexpected number
   157447 1.1-1.10: calc: error: 2222 != 1
   157448 _ATEOF
   157449 
   157450 # 2. If locations are not used, remove them.
   157451 
   157452 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157453 
   157454 # 4. Check
   157455 { set +x
   157456 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157457 at_fn_check_prepare_trace "java.at:369"
   157458 ( $at_check_trace; cat stderr
   157459 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157460 at_status=$? at_failed=false
   157461 $at_check_filter
   157462 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157463 $at_diff expout "$at_stdout" || at_failed=:
   157464 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157465 $at_failed && at_fn_log_failure
   157466 $at_traceon; }
   157467 
   157468 
   157469 cat >input <<'_ATEOF'
   157470 (- *) + (0 0) = 1
   157471 _ATEOF
   157472 
   157473 { set +x
   157474 $as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
   157475 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
   157476 ( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
   157477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157478 at_status=$? at_failed=false
   157479 $at_check_filter
   157480 echo stderr:; tee stderr <"$at_stderr"
   157481 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157482 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157483 $at_failed && at_fn_log_failure
   157484 $at_traceon; }
   157485 
   157486 
   157487 # Normalize the observed and expected error messages, depending upon the
   157488 # options.
   157489 # 1. Create the reference error message.
   157490 cat >expout <<'_ATEOF'
   157491 1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
   157492 1.8: syntax error, unexpected number
   157493 1.1-1.11: calc: error: 2222 != 1
   157494 _ATEOF
   157495 
   157496 # 2. If locations are not used, remove them.
   157497 
   157498 # 3. If error-verbose is not used, strip the`, unexpected....' part.
   157499 
   157500 # 4. Check
   157501 { set +x
   157502 $as_echo "$at_srcdir/java.at:369: cat stderr"
   157503 at_fn_check_prepare_trace "java.at:369"
   157504 ( $at_check_trace; cat stderr
   157505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157506 at_status=$? at_failed=false
   157507 $at_check_filter
   157508 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157509 $at_diff expout "$at_stdout" || at_failed=:
   157510 at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
   157511 $at_failed && at_fn_log_failure
   157512 $at_traceon; }
   157513 
   157514 
   157515 
   157516 
   157517   set +x
   157518   $at_times_p && times >"$at_times_file"
   157519 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   157520 read at_status <"$at_status_file"
   157521 #AT_STOP_314
   157522 #AT_START_315
   157523 at_fn_group_banner 315 'java.at:455' \
   157524   "Java parser class and package names" "            " 20
   157525 at_xfail=no
   157526 (
   157527   $as_echo "315. $at_setup_line: testing $at_desc ..."
   157528   $at_traceon
   157529 
   157530 
   157531 
   157532 cat >YYParser.y <<'_ATEOF'
   157533 
   157534 %language "Java"
   157535 %locations
   157536 %debug
   157537 %error-verbose
   157538 %token-table
   157539 
   157540 %%
   157541 start: "end" {};
   157542 %%
   157543 class Position {}
   157544 _ATEOF
   157545 
   157546 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   157547   at_save_special_files
   157548   mkdir xml-tests
   157549     # Don't combine these Bison invocations since we want to be sure that
   157550   # --report=all isn't required to get the full XML file.
   157551   { set +x
   157552 $as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   157553                   --graph=xml-tests/test.dot YYParser.y"
   157554 at_fn_check_prepare_notrace 'an embedded newline' "java.at:457"
   157555 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   157556                   --graph=xml-tests/test.dot YYParser.y
   157557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157558 at_status=$? at_failed=false
   157559 $at_check_filter
   157560 echo stderr:; cat "$at_stderr"
   157561 echo stdout:; cat "$at_stdout"
   157562 at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
   157563 $at_failed && at_fn_log_failure
   157564 $at_traceon; }
   157565 
   157566   { set +x
   157567 $as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   157568 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:457"
   157569 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   157570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157571 at_status=$? at_failed=false
   157572 $at_check_filter
   157573 echo stderr:; cat "$at_stderr"
   157574 echo stdout:; cat "$at_stdout"
   157575 at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
   157576 $at_failed && at_fn_log_failure
   157577 $at_traceon; }
   157578 
   157579     cp xml-tests/test.output expout
   157580   { set +x
   157581 $as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\
   157582              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   157583              xml-tests/test.xml"
   157584 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457"
   157585 ( $at_check_trace; $XSLTPROC \
   157586              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   157587              xml-tests/test.xml
   157588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157589 at_status=$? at_failed=false
   157590 $at_check_filter
   157591 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157592 $at_diff expout "$at_stdout" || at_failed=:
   157593 at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
   157594 $at_failed && at_fn_log_failure
   157595 $at_traceon; }
   157596 
   157597   sort xml-tests/test.dot > expout
   157598   { set +x
   157599 $as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\
   157600              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   157601              xml-tests/test.xml | sort"
   157602 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457"
   157603 ( $at_check_trace; $XSLTPROC \
   157604              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   157605              xml-tests/test.xml | sort
   157606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157607 at_status=$? at_failed=false
   157608 $at_check_filter
   157609 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157610 $at_diff expout "$at_stdout" || at_failed=:
   157611 at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
   157612 $at_failed && at_fn_log_failure
   157613 $at_traceon; }
   157614 
   157615   rm -rf xml-tests expout
   157616   at_restore_special_files
   157617 fi
   157618 { set +x
   157619 $as_echo "$at_srcdir/java.at:457: bison YYParser.y"
   157620 at_fn_check_prepare_trace "java.at:457"
   157621 ( $at_check_trace; bison YYParser.y
   157622 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157623 at_status=$? at_failed=false
   157624 $at_check_filter
   157625 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157626 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157627 at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
   157628 $at_failed && at_fn_log_failure
   157629 $at_traceon; }
   157630 
   157631 
   157632 { set +x
   157633 $as_echo "$at_srcdir/java.at:457: grep '[mb]4_' YYParser.y"
   157634 at_fn_check_prepare_trace "java.at:457"
   157635 ( $at_check_trace; grep '[mb]4_' YYParser.y
   157636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157637 at_status=$? at_failed=false
   157638 $at_check_filter
   157639 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157640 echo stdout:; cat "$at_stdout"
   157641 at_fn_check_status 1 $at_status "$at_srcdir/java.at:457"
   157642 $at_failed && at_fn_log_failure
   157643 $at_traceon; }
   157644 
   157645 
   157646 $as_echo "java.at:457" >"$at_check_line_file"
   157647 (test -z "$CONF_JAVAC") \
   157648   && at_fn_check_skip 77 "$at_srcdir/java.at:457"
   157649 $as_echo "java.at:457" >"$at_check_line_file"
   157650 (test -z "$CONF_JAVA") \
   157651   && at_fn_check_skip 77 "$at_srcdir/java.at:457"
   157652 { set +x
   157653 $as_echo "$at_srcdir/java.at:457: \$SHELL ../../../javacomp.sh YYParser.java"
   157654 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:457"
   157655 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   157656 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157657 at_status=$? at_failed=false
   157658 $at_check_filter
   157659 echo stderr:; cat "$at_stderr"
   157660 echo stdout:; cat "$at_stdout"
   157661 at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
   157662 $at_failed && at_fn_log_failure
   157663 $at_traceon; }
   157664 
   157665 
   157666 { set +x
   157667 $as_echo "$at_srcdir/java.at:458: grep -c '^class YYParser\$' YYParser.java"
   157668 at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:458"
   157669 ( $at_check_trace; grep -c '^class YYParser$' YYParser.java
   157670 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157671 at_status=$? at_failed=false
   157672 $at_check_filter
   157673 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157674 echo >>"$at_stdout"; $as_echo "1
   157675 " | \
   157676   $at_diff - "$at_stdout" || at_failed=:
   157677 at_fn_check_status 0 $at_status "$at_srcdir/java.at:458"
   157678 $at_failed && at_fn_log_failure
   157679 $at_traceon; }
   157680 
   157681 
   157682 
   157683 
   157684 cat >YYParser.y <<'_ATEOF'
   157685 
   157686 %language "Java"
   157687 %locations
   157688 %debug
   157689 %error-verbose
   157690 %token-table
   157691 %name-prefix "Prefix"
   157692 %%
   157693 start: "end" {};
   157694 %%
   157695 class Position {}
   157696 _ATEOF
   157697 
   157698 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   157699   at_save_special_files
   157700   mkdir xml-tests
   157701     # Don't combine these Bison invocations since we want to be sure that
   157702   # --report=all isn't required to get the full XML file.
   157703   { set +x
   157704 $as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   157705                   --graph=xml-tests/test.dot YYParser.y"
   157706 at_fn_check_prepare_notrace 'an embedded newline' "java.at:460"
   157707 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   157708                   --graph=xml-tests/test.dot YYParser.y
   157709 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157710 at_status=$? at_failed=false
   157711 $at_check_filter
   157712 echo stderr:; cat "$at_stderr"
   157713 echo stdout:; cat "$at_stdout"
   157714 at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
   157715 $at_failed && at_fn_log_failure
   157716 $at_traceon; }
   157717 
   157718   { set +x
   157719 $as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   157720 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:460"
   157721 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   157722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157723 at_status=$? at_failed=false
   157724 $at_check_filter
   157725 echo stderr:; cat "$at_stderr"
   157726 echo stdout:; cat "$at_stdout"
   157727 at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
   157728 $at_failed && at_fn_log_failure
   157729 $at_traceon; }
   157730 
   157731     cp xml-tests/test.output expout
   157732   { set +x
   157733 $as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\
   157734              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   157735              xml-tests/test.xml"
   157736 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460"
   157737 ( $at_check_trace; $XSLTPROC \
   157738              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   157739              xml-tests/test.xml
   157740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157741 at_status=$? at_failed=false
   157742 $at_check_filter
   157743 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157744 $at_diff expout "$at_stdout" || at_failed=:
   157745 at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
   157746 $at_failed && at_fn_log_failure
   157747 $at_traceon; }
   157748 
   157749   sort xml-tests/test.dot > expout
   157750   { set +x
   157751 $as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\
   157752              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   157753              xml-tests/test.xml | sort"
   157754 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460"
   157755 ( $at_check_trace; $XSLTPROC \
   157756              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   157757              xml-tests/test.xml | sort
   157758 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157759 at_status=$? at_failed=false
   157760 $at_check_filter
   157761 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157762 $at_diff expout "$at_stdout" || at_failed=:
   157763 at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
   157764 $at_failed && at_fn_log_failure
   157765 $at_traceon; }
   157766 
   157767   rm -rf xml-tests expout
   157768   at_restore_special_files
   157769 fi
   157770 { set +x
   157771 $as_echo "$at_srcdir/java.at:460: bison YYParser.y"
   157772 at_fn_check_prepare_trace "java.at:460"
   157773 ( $at_check_trace; bison YYParser.y
   157774 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157775 at_status=$? at_failed=false
   157776 $at_check_filter
   157777 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157778 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157779 at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
   157780 $at_failed && at_fn_log_failure
   157781 $at_traceon; }
   157782 
   157783 
   157784 { set +x
   157785 $as_echo "$at_srcdir/java.at:460: grep '[mb]4_' YYParser.y"
   157786 at_fn_check_prepare_trace "java.at:460"
   157787 ( $at_check_trace; grep '[mb]4_' YYParser.y
   157788 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157789 at_status=$? at_failed=false
   157790 $at_check_filter
   157791 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157792 echo stdout:; cat "$at_stdout"
   157793 at_fn_check_status 1 $at_status "$at_srcdir/java.at:460"
   157794 $at_failed && at_fn_log_failure
   157795 $at_traceon; }
   157796 
   157797 
   157798 $as_echo "java.at:460" >"$at_check_line_file"
   157799 (test -z "$CONF_JAVAC") \
   157800   && at_fn_check_skip 77 "$at_srcdir/java.at:460"
   157801 $as_echo "java.at:460" >"$at_check_line_file"
   157802 (test -z "$CONF_JAVA") \
   157803   && at_fn_check_skip 77 "$at_srcdir/java.at:460"
   157804 { set +x
   157805 $as_echo "$at_srcdir/java.at:460: \$SHELL ../../../javacomp.sh YYParser.java"
   157806 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:460"
   157807 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   157808 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157809 at_status=$? at_failed=false
   157810 $at_check_filter
   157811 echo stderr:; cat "$at_stderr"
   157812 echo stdout:; cat "$at_stdout"
   157813 at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
   157814 $at_failed && at_fn_log_failure
   157815 $at_traceon; }
   157816 
   157817 
   157818 { set +x
   157819 $as_echo "$at_srcdir/java.at:461: grep -c '^class PrefixParser\$' YYParser.java"
   157820 at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:461"
   157821 ( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java
   157822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157823 at_status=$? at_failed=false
   157824 $at_check_filter
   157825 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157826 echo >>"$at_stdout"; $as_echo "1
   157827 " | \
   157828   $at_diff - "$at_stdout" || at_failed=:
   157829 at_fn_check_status 0 $at_status "$at_srcdir/java.at:461"
   157830 $at_failed && at_fn_log_failure
   157831 $at_traceon; }
   157832 
   157833 
   157834 
   157835 
   157836 cat >YYParser.y <<'_ATEOF'
   157837 
   157838 %language "Java"
   157839 %locations
   157840 %debug
   157841 %error-verbose
   157842 %token-table
   157843 %define parser_class_name "ParserClassName"
   157844 %%
   157845 start: "end" {};
   157846 %%
   157847 class Position {}
   157848 _ATEOF
   157849 
   157850 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   157851   at_save_special_files
   157852   mkdir xml-tests
   157853     # Don't combine these Bison invocations since we want to be sure that
   157854   # --report=all isn't required to get the full XML file.
   157855   { set +x
   157856 $as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   157857                   --graph=xml-tests/test.dot YYParser.y"
   157858 at_fn_check_prepare_notrace 'an embedded newline' "java.at:463"
   157859 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   157860                   --graph=xml-tests/test.dot YYParser.y
   157861 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157862 at_status=$? at_failed=false
   157863 $at_check_filter
   157864 echo stderr:; cat "$at_stderr"
   157865 echo stdout:; cat "$at_stdout"
   157866 at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
   157867 $at_failed && at_fn_log_failure
   157868 $at_traceon; }
   157869 
   157870   { set +x
   157871 $as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   157872 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:463"
   157873 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   157874 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157875 at_status=$? at_failed=false
   157876 $at_check_filter
   157877 echo stderr:; cat "$at_stderr"
   157878 echo stdout:; cat "$at_stdout"
   157879 at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
   157880 $at_failed && at_fn_log_failure
   157881 $at_traceon; }
   157882 
   157883     cp xml-tests/test.output expout
   157884   { set +x
   157885 $as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\
   157886              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   157887              xml-tests/test.xml"
   157888 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463"
   157889 ( $at_check_trace; $XSLTPROC \
   157890              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   157891              xml-tests/test.xml
   157892 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157893 at_status=$? at_failed=false
   157894 $at_check_filter
   157895 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157896 $at_diff expout "$at_stdout" || at_failed=:
   157897 at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
   157898 $at_failed && at_fn_log_failure
   157899 $at_traceon; }
   157900 
   157901   sort xml-tests/test.dot > expout
   157902   { set +x
   157903 $as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\
   157904              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   157905              xml-tests/test.xml | sort"
   157906 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463"
   157907 ( $at_check_trace; $XSLTPROC \
   157908              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   157909              xml-tests/test.xml | sort
   157910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157911 at_status=$? at_failed=false
   157912 $at_check_filter
   157913 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157914 $at_diff expout "$at_stdout" || at_failed=:
   157915 at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
   157916 $at_failed && at_fn_log_failure
   157917 $at_traceon; }
   157918 
   157919   rm -rf xml-tests expout
   157920   at_restore_special_files
   157921 fi
   157922 { set +x
   157923 $as_echo "$at_srcdir/java.at:463: bison YYParser.y"
   157924 at_fn_check_prepare_trace "java.at:463"
   157925 ( $at_check_trace; bison YYParser.y
   157926 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157927 at_status=$? at_failed=false
   157928 $at_check_filter
   157929 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157930 at_fn_diff_devnull "$at_stdout" || at_failed=:
   157931 at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
   157932 $at_failed && at_fn_log_failure
   157933 $at_traceon; }
   157934 
   157935 
   157936 { set +x
   157937 $as_echo "$at_srcdir/java.at:463: grep '[mb]4_' YYParser.y"
   157938 at_fn_check_prepare_trace "java.at:463"
   157939 ( $at_check_trace; grep '[mb]4_' YYParser.y
   157940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157941 at_status=$? at_failed=false
   157942 $at_check_filter
   157943 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157944 echo stdout:; cat "$at_stdout"
   157945 at_fn_check_status 1 $at_status "$at_srcdir/java.at:463"
   157946 $at_failed && at_fn_log_failure
   157947 $at_traceon; }
   157948 
   157949 
   157950 $as_echo "java.at:463" >"$at_check_line_file"
   157951 (test -z "$CONF_JAVAC") \
   157952   && at_fn_check_skip 77 "$at_srcdir/java.at:463"
   157953 $as_echo "java.at:463" >"$at_check_line_file"
   157954 (test -z "$CONF_JAVA") \
   157955   && at_fn_check_skip 77 "$at_srcdir/java.at:463"
   157956 { set +x
   157957 $as_echo "$at_srcdir/java.at:463: \$SHELL ../../../javacomp.sh YYParser.java"
   157958 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:463"
   157959 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   157960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157961 at_status=$? at_failed=false
   157962 $at_check_filter
   157963 echo stderr:; cat "$at_stderr"
   157964 echo stdout:; cat "$at_stdout"
   157965 at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
   157966 $at_failed && at_fn_log_failure
   157967 $at_traceon; }
   157968 
   157969 
   157970 { set +x
   157971 $as_echo "$at_srcdir/java.at:464: grep -c '^class ParserClassName\$' YYParser.java"
   157972 at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:464"
   157973 ( $at_check_trace; grep -c '^class ParserClassName$' YYParser.java
   157974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   157975 at_status=$? at_failed=false
   157976 $at_check_filter
   157977 at_fn_diff_devnull "$at_stderr" || at_failed=:
   157978 echo >>"$at_stdout"; $as_echo "1
   157979 " | \
   157980   $at_diff - "$at_stdout" || at_failed=:
   157981 at_fn_check_status 0 $at_status "$at_srcdir/java.at:464"
   157982 $at_failed && at_fn_log_failure
   157983 $at_traceon; }
   157984 
   157985 
   157986 
   157987 
   157988 cat >YYParser.y <<'_ATEOF'
   157989 
   157990 %language "Java"
   157991 %locations
   157992 %debug
   157993 %error-verbose
   157994 %token-table
   157995 %define package "user_java_package"
   157996 %%
   157997 start: "end" {};
   157998 %%
   157999 class Position {}
   158000 _ATEOF
   158001 
   158002 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158003   at_save_special_files
   158004   mkdir xml-tests
   158005     # Don't combine these Bison invocations since we want to be sure that
   158006   # --report=all isn't required to get the full XML file.
   158007   { set +x
   158008 $as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158009                   --graph=xml-tests/test.dot YYParser.y"
   158010 at_fn_check_prepare_notrace 'an embedded newline' "java.at:466"
   158011 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158012                   --graph=xml-tests/test.dot YYParser.y
   158013 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158014 at_status=$? at_failed=false
   158015 $at_check_filter
   158016 echo stderr:; cat "$at_stderr"
   158017 echo stdout:; cat "$at_stdout"
   158018 at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
   158019 $at_failed && at_fn_log_failure
   158020 $at_traceon; }
   158021 
   158022   { set +x
   158023 $as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158024 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:466"
   158025 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158026 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158027 at_status=$? at_failed=false
   158028 $at_check_filter
   158029 echo stderr:; cat "$at_stderr"
   158030 echo stdout:; cat "$at_stdout"
   158031 at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
   158032 $at_failed && at_fn_log_failure
   158033 $at_traceon; }
   158034 
   158035     cp xml-tests/test.output expout
   158036   { set +x
   158037 $as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\
   158038              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158039              xml-tests/test.xml"
   158040 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466"
   158041 ( $at_check_trace; $XSLTPROC \
   158042              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158043              xml-tests/test.xml
   158044 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158045 at_status=$? at_failed=false
   158046 $at_check_filter
   158047 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158048 $at_diff expout "$at_stdout" || at_failed=:
   158049 at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
   158050 $at_failed && at_fn_log_failure
   158051 $at_traceon; }
   158052 
   158053   sort xml-tests/test.dot > expout
   158054   { set +x
   158055 $as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\
   158056              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158057              xml-tests/test.xml | sort"
   158058 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466"
   158059 ( $at_check_trace; $XSLTPROC \
   158060              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158061              xml-tests/test.xml | sort
   158062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158063 at_status=$? at_failed=false
   158064 $at_check_filter
   158065 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158066 $at_diff expout "$at_stdout" || at_failed=:
   158067 at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
   158068 $at_failed && at_fn_log_failure
   158069 $at_traceon; }
   158070 
   158071   rm -rf xml-tests expout
   158072   at_restore_special_files
   158073 fi
   158074 { set +x
   158075 $as_echo "$at_srcdir/java.at:466: bison YYParser.y"
   158076 at_fn_check_prepare_trace "java.at:466"
   158077 ( $at_check_trace; bison YYParser.y
   158078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158079 at_status=$? at_failed=false
   158080 $at_check_filter
   158081 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158082 at_fn_diff_devnull "$at_stdout" || at_failed=:
   158083 at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
   158084 $at_failed && at_fn_log_failure
   158085 $at_traceon; }
   158086 
   158087 
   158088 { set +x
   158089 $as_echo "$at_srcdir/java.at:466: grep '[mb]4_' YYParser.y"
   158090 at_fn_check_prepare_trace "java.at:466"
   158091 ( $at_check_trace; grep '[mb]4_' YYParser.y
   158092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158093 at_status=$? at_failed=false
   158094 $at_check_filter
   158095 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158096 echo stdout:; cat "$at_stdout"
   158097 at_fn_check_status 1 $at_status "$at_srcdir/java.at:466"
   158098 $at_failed && at_fn_log_failure
   158099 $at_traceon; }
   158100 
   158101 
   158102 $as_echo "java.at:466" >"$at_check_line_file"
   158103 (test -z "$CONF_JAVAC") \
   158104   && at_fn_check_skip 77 "$at_srcdir/java.at:466"
   158105 $as_echo "java.at:466" >"$at_check_line_file"
   158106 (test -z "$CONF_JAVA") \
   158107   && at_fn_check_skip 77 "$at_srcdir/java.at:466"
   158108 { set +x
   158109 $as_echo "$at_srcdir/java.at:466: \$SHELL ../../../javacomp.sh YYParser.java"
   158110 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:466"
   158111 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   158112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158113 at_status=$? at_failed=false
   158114 $at_check_filter
   158115 echo stderr:; cat "$at_stderr"
   158116 echo stdout:; cat "$at_stdout"
   158117 at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
   158118 $at_failed && at_fn_log_failure
   158119 $at_traceon; }
   158120 
   158121 
   158122 { set +x
   158123 $as_echo "$at_srcdir/java.at:467: grep -c '^package user_java_package;\$' YYParser.java"
   158124 at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:467"
   158125 ( $at_check_trace; grep -c '^package user_java_package;$' YYParser.java
   158126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158127 at_status=$? at_failed=false
   158128 $at_check_filter
   158129 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158130 echo >>"$at_stdout"; $as_echo "1
   158131 " | \
   158132   $at_diff - "$at_stdout" || at_failed=:
   158133 at_fn_check_status 0 $at_status "$at_srcdir/java.at:467"
   158134 $at_failed && at_fn_log_failure
   158135 $at_traceon; }
   158136 
   158137 
   158138 
   158139   set +x
   158140   $at_times_p && times >"$at_times_file"
   158141 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   158142 read at_status <"$at_status_file"
   158143 #AT_STOP_315
   158144 #AT_START_316
   158145 at_fn_group_banner 316 'java.at:476' \
   158146   "Java parser class modifiers" "                    " 20
   158147 at_xfail=no
   158148 (
   158149   $as_echo "316. $at_setup_line: testing $at_desc ..."
   158150   $at_traceon
   158151 
   158152 
   158153 
   158154 cat >YYParser.y <<'_ATEOF'
   158155 
   158156 %language "Java"
   158157 %locations
   158158 %debug
   158159 %error-verbose
   158160 %token-table
   158161 %define abstract
   158162 %%
   158163 start: "end" {};
   158164 %%
   158165 class Position {}
   158166 _ATEOF
   158167 
   158168 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158169   at_save_special_files
   158170   mkdir xml-tests
   158171     # Don't combine these Bison invocations since we want to be sure that
   158172   # --report=all isn't required to get the full XML file.
   158173   { set +x
   158174 $as_echo "$at_srcdir/java.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158175                   --graph=xml-tests/test.dot YYParser.y"
   158176 at_fn_check_prepare_notrace 'an embedded newline' "java.at:478"
   158177 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158178                   --graph=xml-tests/test.dot YYParser.y
   158179 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158180 at_status=$? at_failed=false
   158181 $at_check_filter
   158182 echo stderr:; cat "$at_stderr"
   158183 echo stdout:; cat "$at_stdout"
   158184 at_fn_check_status 0 $at_status "$at_srcdir/java.at:478"
   158185 $at_failed && at_fn_log_failure
   158186 $at_traceon; }
   158187 
   158188   { set +x
   158189 $as_echo "$at_srcdir/java.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158190 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:478"
   158191 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158192 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158193 at_status=$? at_failed=false
   158194 $at_check_filter
   158195 echo stderr:; cat "$at_stderr"
   158196 echo stdout:; cat "$at_stdout"
   158197 at_fn_check_status 0 $at_status "$at_srcdir/java.at:478"
   158198 $at_failed && at_fn_log_failure
   158199 $at_traceon; }
   158200 
   158201     cp xml-tests/test.output expout
   158202   { set +x
   158203 $as_echo "$at_srcdir/java.at:478: \$XSLTPROC \\
   158204              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158205              xml-tests/test.xml"
   158206 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:478"
   158207 ( $at_check_trace; $XSLTPROC \
   158208              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158209              xml-tests/test.xml
   158210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158211 at_status=$? at_failed=false
   158212 $at_check_filter
   158213 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158214 $at_diff expout "$at_stdout" || at_failed=:
   158215 at_fn_check_status 0 $at_status "$at_srcdir/java.at:478"
   158216 $at_failed && at_fn_log_failure
   158217 $at_traceon; }
   158218 
   158219   sort xml-tests/test.dot > expout
   158220   { set +x
   158221 $as_echo "$at_srcdir/java.at:478: \$XSLTPROC \\
   158222              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158223              xml-tests/test.xml | sort"
   158224 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:478"
   158225 ( $at_check_trace; $XSLTPROC \
   158226              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158227              xml-tests/test.xml | sort
   158228 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158229 at_status=$? at_failed=false
   158230 $at_check_filter
   158231 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158232 $at_diff expout "$at_stdout" || at_failed=:
   158233 at_fn_check_status 0 $at_status "$at_srcdir/java.at:478"
   158234 $at_failed && at_fn_log_failure
   158235 $at_traceon; }
   158236 
   158237   rm -rf xml-tests expout
   158238   at_restore_special_files
   158239 fi
   158240 { set +x
   158241 $as_echo "$at_srcdir/java.at:478: bison YYParser.y"
   158242 at_fn_check_prepare_trace "java.at:478"
   158243 ( $at_check_trace; bison YYParser.y
   158244 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158245 at_status=$? at_failed=false
   158246 $at_check_filter
   158247 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158248 at_fn_diff_devnull "$at_stdout" || at_failed=:
   158249 at_fn_check_status 0 $at_status "$at_srcdir/java.at:478"
   158250 $at_failed && at_fn_log_failure
   158251 $at_traceon; }
   158252 
   158253 
   158254 { set +x
   158255 $as_echo "$at_srcdir/java.at:478: grep '[mb]4_' YYParser.y"
   158256 at_fn_check_prepare_trace "java.at:478"
   158257 ( $at_check_trace; grep '[mb]4_' YYParser.y
   158258 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158259 at_status=$? at_failed=false
   158260 $at_check_filter
   158261 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158262 echo stdout:; cat "$at_stdout"
   158263 at_fn_check_status 1 $at_status "$at_srcdir/java.at:478"
   158264 $at_failed && at_fn_log_failure
   158265 $at_traceon; }
   158266 
   158267 
   158268 $as_echo "java.at:478" >"$at_check_line_file"
   158269 (test -z "$CONF_JAVAC") \
   158270   && at_fn_check_skip 77 "$at_srcdir/java.at:478"
   158271 $as_echo "java.at:478" >"$at_check_line_file"
   158272 (test -z "$CONF_JAVA") \
   158273   && at_fn_check_skip 77 "$at_srcdir/java.at:478"
   158274 { set +x
   158275 $as_echo "$at_srcdir/java.at:478: \$SHELL ../../../javacomp.sh YYParser.java"
   158276 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:478"
   158277 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   158278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158279 at_status=$? at_failed=false
   158280 $at_check_filter
   158281 echo stderr:; cat "$at_stderr"
   158282 echo stdout:; cat "$at_stdout"
   158283 at_fn_check_status 0 $at_status "$at_srcdir/java.at:478"
   158284 $at_failed && at_fn_log_failure
   158285 $at_traceon; }
   158286 
   158287 
   158288 { set +x
   158289 $as_echo "$at_srcdir/java.at:479: grep -c '^abstract class YYParser\$' YYParser.java"
   158290 at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:479"
   158291 ( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.java
   158292 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158293 at_status=$? at_failed=false
   158294 $at_check_filter
   158295 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158296 echo >>"$at_stdout"; $as_echo "1
   158297 " | \
   158298   $at_diff - "$at_stdout" || at_failed=:
   158299 at_fn_check_status 0 $at_status "$at_srcdir/java.at:479"
   158300 $at_failed && at_fn_log_failure
   158301 $at_traceon; }
   158302 
   158303 
   158304 
   158305 
   158306 cat >YYParser.y <<'_ATEOF'
   158307 
   158308 %language "Java"
   158309 %locations
   158310 %debug
   158311 %error-verbose
   158312 %token-table
   158313 %define final
   158314 %%
   158315 start: "end" {};
   158316 %%
   158317 class Position {}
   158318 _ATEOF
   158319 
   158320 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158321   at_save_special_files
   158322   mkdir xml-tests
   158323     # Don't combine these Bison invocations since we want to be sure that
   158324   # --report=all isn't required to get the full XML file.
   158325   { set +x
   158326 $as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158327                   --graph=xml-tests/test.dot YYParser.y"
   158328 at_fn_check_prepare_notrace 'an embedded newline' "java.at:481"
   158329 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158330                   --graph=xml-tests/test.dot YYParser.y
   158331 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158332 at_status=$? at_failed=false
   158333 $at_check_filter
   158334 echo stderr:; cat "$at_stderr"
   158335 echo stdout:; cat "$at_stdout"
   158336 at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
   158337 $at_failed && at_fn_log_failure
   158338 $at_traceon; }
   158339 
   158340   { set +x
   158341 $as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158342 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:481"
   158343 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158345 at_status=$? at_failed=false
   158346 $at_check_filter
   158347 echo stderr:; cat "$at_stderr"
   158348 echo stdout:; cat "$at_stdout"
   158349 at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
   158350 $at_failed && at_fn_log_failure
   158351 $at_traceon; }
   158352 
   158353     cp xml-tests/test.output expout
   158354   { set +x
   158355 $as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\
   158356              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158357              xml-tests/test.xml"
   158358 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481"
   158359 ( $at_check_trace; $XSLTPROC \
   158360              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158361              xml-tests/test.xml
   158362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158363 at_status=$? at_failed=false
   158364 $at_check_filter
   158365 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158366 $at_diff expout "$at_stdout" || at_failed=:
   158367 at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
   158368 $at_failed && at_fn_log_failure
   158369 $at_traceon; }
   158370 
   158371   sort xml-tests/test.dot > expout
   158372   { set +x
   158373 $as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\
   158374              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158375              xml-tests/test.xml | sort"
   158376 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481"
   158377 ( $at_check_trace; $XSLTPROC \
   158378              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158379              xml-tests/test.xml | sort
   158380 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158381 at_status=$? at_failed=false
   158382 $at_check_filter
   158383 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158384 $at_diff expout "$at_stdout" || at_failed=:
   158385 at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
   158386 $at_failed && at_fn_log_failure
   158387 $at_traceon; }
   158388 
   158389   rm -rf xml-tests expout
   158390   at_restore_special_files
   158391 fi
   158392 { set +x
   158393 $as_echo "$at_srcdir/java.at:481: bison YYParser.y"
   158394 at_fn_check_prepare_trace "java.at:481"
   158395 ( $at_check_trace; bison YYParser.y
   158396 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158397 at_status=$? at_failed=false
   158398 $at_check_filter
   158399 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158400 at_fn_diff_devnull "$at_stdout" || at_failed=:
   158401 at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
   158402 $at_failed && at_fn_log_failure
   158403 $at_traceon; }
   158404 
   158405 
   158406 { set +x
   158407 $as_echo "$at_srcdir/java.at:481: grep '[mb]4_' YYParser.y"
   158408 at_fn_check_prepare_trace "java.at:481"
   158409 ( $at_check_trace; grep '[mb]4_' YYParser.y
   158410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158411 at_status=$? at_failed=false
   158412 $at_check_filter
   158413 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158414 echo stdout:; cat "$at_stdout"
   158415 at_fn_check_status 1 $at_status "$at_srcdir/java.at:481"
   158416 $at_failed && at_fn_log_failure
   158417 $at_traceon; }
   158418 
   158419 
   158420 $as_echo "java.at:481" >"$at_check_line_file"
   158421 (test -z "$CONF_JAVAC") \
   158422   && at_fn_check_skip 77 "$at_srcdir/java.at:481"
   158423 $as_echo "java.at:481" >"$at_check_line_file"
   158424 (test -z "$CONF_JAVA") \
   158425   && at_fn_check_skip 77 "$at_srcdir/java.at:481"
   158426 { set +x
   158427 $as_echo "$at_srcdir/java.at:481: \$SHELL ../../../javacomp.sh YYParser.java"
   158428 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:481"
   158429 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   158430 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158431 at_status=$? at_failed=false
   158432 $at_check_filter
   158433 echo stderr:; cat "$at_stderr"
   158434 echo stdout:; cat "$at_stdout"
   158435 at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
   158436 $at_failed && at_fn_log_failure
   158437 $at_traceon; }
   158438 
   158439 
   158440 { set +x
   158441 $as_echo "$at_srcdir/java.at:482: grep -c '^final class YYParser\$' YYParser.java"
   158442 at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:482"
   158443 ( $at_check_trace; grep -c '^final class YYParser$' YYParser.java
   158444 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158445 at_status=$? at_failed=false
   158446 $at_check_filter
   158447 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158448 echo >>"$at_stdout"; $as_echo "1
   158449 " | \
   158450   $at_diff - "$at_stdout" || at_failed=:
   158451 at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
   158452 $at_failed && at_fn_log_failure
   158453 $at_traceon; }
   158454 
   158455 
   158456 
   158457 
   158458 cat >YYParser.y <<'_ATEOF'
   158459 
   158460 %language "Java"
   158461 %locations
   158462 %debug
   158463 %error-verbose
   158464 %token-table
   158465 %define strictfp
   158466 %%
   158467 start: "end" {};
   158468 %%
   158469 class Position {}
   158470 _ATEOF
   158471 
   158472 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158473   at_save_special_files
   158474   mkdir xml-tests
   158475     # Don't combine these Bison invocations since we want to be sure that
   158476   # --report=all isn't required to get the full XML file.
   158477   { set +x
   158478 $as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158479                   --graph=xml-tests/test.dot YYParser.y"
   158480 at_fn_check_prepare_notrace 'an embedded newline' "java.at:484"
   158481 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158482                   --graph=xml-tests/test.dot YYParser.y
   158483 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158484 at_status=$? at_failed=false
   158485 $at_check_filter
   158486 echo stderr:; cat "$at_stderr"
   158487 echo stdout:; cat "$at_stdout"
   158488 at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
   158489 $at_failed && at_fn_log_failure
   158490 $at_traceon; }
   158491 
   158492   { set +x
   158493 $as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158494 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:484"
   158495 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158497 at_status=$? at_failed=false
   158498 $at_check_filter
   158499 echo stderr:; cat "$at_stderr"
   158500 echo stdout:; cat "$at_stdout"
   158501 at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
   158502 $at_failed && at_fn_log_failure
   158503 $at_traceon; }
   158504 
   158505     cp xml-tests/test.output expout
   158506   { set +x
   158507 $as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\
   158508              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158509              xml-tests/test.xml"
   158510 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484"
   158511 ( $at_check_trace; $XSLTPROC \
   158512              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158513              xml-tests/test.xml
   158514 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158515 at_status=$? at_failed=false
   158516 $at_check_filter
   158517 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158518 $at_diff expout "$at_stdout" || at_failed=:
   158519 at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
   158520 $at_failed && at_fn_log_failure
   158521 $at_traceon; }
   158522 
   158523   sort xml-tests/test.dot > expout
   158524   { set +x
   158525 $as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\
   158526              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158527              xml-tests/test.xml | sort"
   158528 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484"
   158529 ( $at_check_trace; $XSLTPROC \
   158530              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158531              xml-tests/test.xml | sort
   158532 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158533 at_status=$? at_failed=false
   158534 $at_check_filter
   158535 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158536 $at_diff expout "$at_stdout" || at_failed=:
   158537 at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
   158538 $at_failed && at_fn_log_failure
   158539 $at_traceon; }
   158540 
   158541   rm -rf xml-tests expout
   158542   at_restore_special_files
   158543 fi
   158544 { set +x
   158545 $as_echo "$at_srcdir/java.at:484: bison YYParser.y"
   158546 at_fn_check_prepare_trace "java.at:484"
   158547 ( $at_check_trace; bison YYParser.y
   158548 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158549 at_status=$? at_failed=false
   158550 $at_check_filter
   158551 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158552 at_fn_diff_devnull "$at_stdout" || at_failed=:
   158553 at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
   158554 $at_failed && at_fn_log_failure
   158555 $at_traceon; }
   158556 
   158557 
   158558 { set +x
   158559 $as_echo "$at_srcdir/java.at:484: grep '[mb]4_' YYParser.y"
   158560 at_fn_check_prepare_trace "java.at:484"
   158561 ( $at_check_trace; grep '[mb]4_' YYParser.y
   158562 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158563 at_status=$? at_failed=false
   158564 $at_check_filter
   158565 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158566 echo stdout:; cat "$at_stdout"
   158567 at_fn_check_status 1 $at_status "$at_srcdir/java.at:484"
   158568 $at_failed && at_fn_log_failure
   158569 $at_traceon; }
   158570 
   158571 
   158572 $as_echo "java.at:484" >"$at_check_line_file"
   158573 (test -z "$CONF_JAVAC") \
   158574   && at_fn_check_skip 77 "$at_srcdir/java.at:484"
   158575 $as_echo "java.at:484" >"$at_check_line_file"
   158576 (test -z "$CONF_JAVA") \
   158577   && at_fn_check_skip 77 "$at_srcdir/java.at:484"
   158578 { set +x
   158579 $as_echo "$at_srcdir/java.at:484: \$SHELL ../../../javacomp.sh YYParser.java"
   158580 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:484"
   158581 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   158582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158583 at_status=$? at_failed=false
   158584 $at_check_filter
   158585 echo stderr:; cat "$at_stderr"
   158586 echo stdout:; cat "$at_stdout"
   158587 at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
   158588 $at_failed && at_fn_log_failure
   158589 $at_traceon; }
   158590 
   158591 
   158592 { set +x
   158593 $as_echo "$at_srcdir/java.at:485: grep -c '^strictfp class YYParser\$' YYParser.java"
   158594 at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:485"
   158595 ( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.java
   158596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158597 at_status=$? at_failed=false
   158598 $at_check_filter
   158599 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158600 echo >>"$at_stdout"; $as_echo "1
   158601 " | \
   158602   $at_diff - "$at_stdout" || at_failed=:
   158603 at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
   158604 $at_failed && at_fn_log_failure
   158605 $at_traceon; }
   158606 
   158607 
   158608 
   158609 
   158610 cat >YYParser.y <<'_ATEOF'
   158611 
   158612 %language "Java"
   158613 %locations
   158614 %debug
   158615 %error-verbose
   158616 %token-table
   158617 
   158618 %define abstract
   158619 %define strictfp
   158620 %%
   158621 start: "end" {};
   158622 %%
   158623 class Position {}
   158624 _ATEOF
   158625 
   158626 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158627   at_save_special_files
   158628   mkdir xml-tests
   158629     # Don't combine these Bison invocations since we want to be sure that
   158630   # --report=all isn't required to get the full XML file.
   158631   { set +x
   158632 $as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158633                   --graph=xml-tests/test.dot YYParser.y"
   158634 at_fn_check_prepare_notrace 'an embedded newline' "java.at:487"
   158635 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158636                   --graph=xml-tests/test.dot YYParser.y
   158637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158638 at_status=$? at_failed=false
   158639 $at_check_filter
   158640 echo stderr:; cat "$at_stderr"
   158641 echo stdout:; cat "$at_stdout"
   158642 at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
   158643 $at_failed && at_fn_log_failure
   158644 $at_traceon; }
   158645 
   158646   { set +x
   158647 $as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158648 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:487"
   158649 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158651 at_status=$? at_failed=false
   158652 $at_check_filter
   158653 echo stderr:; cat "$at_stderr"
   158654 echo stdout:; cat "$at_stdout"
   158655 at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
   158656 $at_failed && at_fn_log_failure
   158657 $at_traceon; }
   158658 
   158659     cp xml-tests/test.output expout
   158660   { set +x
   158661 $as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\
   158662              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158663              xml-tests/test.xml"
   158664 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487"
   158665 ( $at_check_trace; $XSLTPROC \
   158666              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158667              xml-tests/test.xml
   158668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158669 at_status=$? at_failed=false
   158670 $at_check_filter
   158671 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158672 $at_diff expout "$at_stdout" || at_failed=:
   158673 at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
   158674 $at_failed && at_fn_log_failure
   158675 $at_traceon; }
   158676 
   158677   sort xml-tests/test.dot > expout
   158678   { set +x
   158679 $as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\
   158680              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158681              xml-tests/test.xml | sort"
   158682 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487"
   158683 ( $at_check_trace; $XSLTPROC \
   158684              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158685              xml-tests/test.xml | sort
   158686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158687 at_status=$? at_failed=false
   158688 $at_check_filter
   158689 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158690 $at_diff expout "$at_stdout" || at_failed=:
   158691 at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
   158692 $at_failed && at_fn_log_failure
   158693 $at_traceon; }
   158694 
   158695   rm -rf xml-tests expout
   158696   at_restore_special_files
   158697 fi
   158698 { set +x
   158699 $as_echo "$at_srcdir/java.at:487: bison YYParser.y"
   158700 at_fn_check_prepare_trace "java.at:487"
   158701 ( $at_check_trace; bison YYParser.y
   158702 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158703 at_status=$? at_failed=false
   158704 $at_check_filter
   158705 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158706 at_fn_diff_devnull "$at_stdout" || at_failed=:
   158707 at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
   158708 $at_failed && at_fn_log_failure
   158709 $at_traceon; }
   158710 
   158711 
   158712 { set +x
   158713 $as_echo "$at_srcdir/java.at:487: grep '[mb]4_' YYParser.y"
   158714 at_fn_check_prepare_trace "java.at:487"
   158715 ( $at_check_trace; grep '[mb]4_' YYParser.y
   158716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158717 at_status=$? at_failed=false
   158718 $at_check_filter
   158719 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158720 echo stdout:; cat "$at_stdout"
   158721 at_fn_check_status 1 $at_status "$at_srcdir/java.at:487"
   158722 $at_failed && at_fn_log_failure
   158723 $at_traceon; }
   158724 
   158725 
   158726 $as_echo "java.at:487" >"$at_check_line_file"
   158727 (test -z "$CONF_JAVAC") \
   158728   && at_fn_check_skip 77 "$at_srcdir/java.at:487"
   158729 $as_echo "java.at:487" >"$at_check_line_file"
   158730 (test -z "$CONF_JAVA") \
   158731   && at_fn_check_skip 77 "$at_srcdir/java.at:487"
   158732 { set +x
   158733 $as_echo "$at_srcdir/java.at:487: \$SHELL ../../../javacomp.sh YYParser.java"
   158734 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:487"
   158735 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   158736 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158737 at_status=$? at_failed=false
   158738 $at_check_filter
   158739 echo stderr:; cat "$at_stderr"
   158740 echo stdout:; cat "$at_stdout"
   158741 at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
   158742 $at_failed && at_fn_log_failure
   158743 $at_traceon; }
   158744 
   158745 
   158746 { set +x
   158747 $as_echo "$at_srcdir/java.at:490: grep -c '^abstract strictfp class YYParser\$' YYParser.java"
   158748 at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:490"
   158749 ( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.java
   158750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158751 at_status=$? at_failed=false
   158752 $at_check_filter
   158753 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158754 echo >>"$at_stdout"; $as_echo "1
   158755 " | \
   158756   $at_diff - "$at_stdout" || at_failed=:
   158757 at_fn_check_status 0 $at_status "$at_srcdir/java.at:490"
   158758 $at_failed && at_fn_log_failure
   158759 $at_traceon; }
   158760 
   158761 
   158762 
   158763 
   158764 cat >YYParser.y <<'_ATEOF'
   158765 
   158766 %language "Java"
   158767 %locations
   158768 %debug
   158769 %error-verbose
   158770 %token-table
   158771 
   158772 %define final
   158773 %define strictfp
   158774 %%
   158775 start: "end" {};
   158776 %%
   158777 class Position {}
   158778 _ATEOF
   158779 
   158780 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158781   at_save_special_files
   158782   mkdir xml-tests
   158783     # Don't combine these Bison invocations since we want to be sure that
   158784   # --report=all isn't required to get the full XML file.
   158785   { set +x
   158786 $as_echo "$at_srcdir/java.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158787                   --graph=xml-tests/test.dot YYParser.y"
   158788 at_fn_check_prepare_notrace 'an embedded newline' "java.at:492"
   158789 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158790                   --graph=xml-tests/test.dot YYParser.y
   158791 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158792 at_status=$? at_failed=false
   158793 $at_check_filter
   158794 echo stderr:; cat "$at_stderr"
   158795 echo stdout:; cat "$at_stdout"
   158796 at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
   158797 $at_failed && at_fn_log_failure
   158798 $at_traceon; }
   158799 
   158800   { set +x
   158801 $as_echo "$at_srcdir/java.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158802 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:492"
   158803 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158805 at_status=$? at_failed=false
   158806 $at_check_filter
   158807 echo stderr:; cat "$at_stderr"
   158808 echo stdout:; cat "$at_stdout"
   158809 at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
   158810 $at_failed && at_fn_log_failure
   158811 $at_traceon; }
   158812 
   158813     cp xml-tests/test.output expout
   158814   { set +x
   158815 $as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\
   158816              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158817              xml-tests/test.xml"
   158818 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:492"
   158819 ( $at_check_trace; $XSLTPROC \
   158820              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158821              xml-tests/test.xml
   158822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158823 at_status=$? at_failed=false
   158824 $at_check_filter
   158825 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158826 $at_diff expout "$at_stdout" || at_failed=:
   158827 at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
   158828 $at_failed && at_fn_log_failure
   158829 $at_traceon; }
   158830 
   158831   sort xml-tests/test.dot > expout
   158832   { set +x
   158833 $as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\
   158834              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158835              xml-tests/test.xml | sort"
   158836 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:492"
   158837 ( $at_check_trace; $XSLTPROC \
   158838              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158839              xml-tests/test.xml | sort
   158840 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158841 at_status=$? at_failed=false
   158842 $at_check_filter
   158843 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158844 $at_diff expout "$at_stdout" || at_failed=:
   158845 at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
   158846 $at_failed && at_fn_log_failure
   158847 $at_traceon; }
   158848 
   158849   rm -rf xml-tests expout
   158850   at_restore_special_files
   158851 fi
   158852 { set +x
   158853 $as_echo "$at_srcdir/java.at:492: bison YYParser.y"
   158854 at_fn_check_prepare_trace "java.at:492"
   158855 ( $at_check_trace; bison YYParser.y
   158856 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158857 at_status=$? at_failed=false
   158858 $at_check_filter
   158859 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158860 at_fn_diff_devnull "$at_stdout" || at_failed=:
   158861 at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
   158862 $at_failed && at_fn_log_failure
   158863 $at_traceon; }
   158864 
   158865 
   158866 { set +x
   158867 $as_echo "$at_srcdir/java.at:492: grep '[mb]4_' YYParser.y"
   158868 at_fn_check_prepare_trace "java.at:492"
   158869 ( $at_check_trace; grep '[mb]4_' YYParser.y
   158870 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158871 at_status=$? at_failed=false
   158872 $at_check_filter
   158873 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158874 echo stdout:; cat "$at_stdout"
   158875 at_fn_check_status 1 $at_status "$at_srcdir/java.at:492"
   158876 $at_failed && at_fn_log_failure
   158877 $at_traceon; }
   158878 
   158879 
   158880 $as_echo "java.at:492" >"$at_check_line_file"
   158881 (test -z "$CONF_JAVAC") \
   158882   && at_fn_check_skip 77 "$at_srcdir/java.at:492"
   158883 $as_echo "java.at:492" >"$at_check_line_file"
   158884 (test -z "$CONF_JAVA") \
   158885   && at_fn_check_skip 77 "$at_srcdir/java.at:492"
   158886 { set +x
   158887 $as_echo "$at_srcdir/java.at:492: \$SHELL ../../../javacomp.sh YYParser.java"
   158888 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:492"
   158889 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   158890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158891 at_status=$? at_failed=false
   158892 $at_check_filter
   158893 echo stderr:; cat "$at_stderr"
   158894 echo stdout:; cat "$at_stdout"
   158895 at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
   158896 $at_failed && at_fn_log_failure
   158897 $at_traceon; }
   158898 
   158899 
   158900 { set +x
   158901 $as_echo "$at_srcdir/java.at:495: grep -c '^final strictfp class YYParser\$' YYParser.java"
   158902 at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:495"
   158903 ( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.java
   158904 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158905 at_status=$? at_failed=false
   158906 $at_check_filter
   158907 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158908 echo >>"$at_stdout"; $as_echo "1
   158909 " | \
   158910   $at_diff - "$at_stdout" || at_failed=:
   158911 at_fn_check_status 0 $at_status "$at_srcdir/java.at:495"
   158912 $at_failed && at_fn_log_failure
   158913 $at_traceon; }
   158914 
   158915 
   158916 
   158917 
   158918 cat >YYParser.y <<'_ATEOF'
   158919 
   158920 %language "Java"
   158921 %locations
   158922 %debug
   158923 %error-verbose
   158924 %token-table
   158925 %define public
   158926 %%
   158927 start: "end" {};
   158928 %%
   158929 class Position {}
   158930 _ATEOF
   158931 
   158932 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   158933   at_save_special_files
   158934   mkdir xml-tests
   158935     # Don't combine these Bison invocations since we want to be sure that
   158936   # --report=all isn't required to get the full XML file.
   158937   { set +x
   158938 $as_echo "$at_srcdir/java.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   158939                   --graph=xml-tests/test.dot YYParser.y"
   158940 at_fn_check_prepare_notrace 'an embedded newline' "java.at:497"
   158941 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   158942                   --graph=xml-tests/test.dot YYParser.y
   158943 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158944 at_status=$? at_failed=false
   158945 $at_check_filter
   158946 echo stderr:; cat "$at_stderr"
   158947 echo stdout:; cat "$at_stdout"
   158948 at_fn_check_status 0 $at_status "$at_srcdir/java.at:497"
   158949 $at_failed && at_fn_log_failure
   158950 $at_traceon; }
   158951 
   158952   { set +x
   158953 $as_echo "$at_srcdir/java.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   158954 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:497"
   158955 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   158956 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158957 at_status=$? at_failed=false
   158958 $at_check_filter
   158959 echo stderr:; cat "$at_stderr"
   158960 echo stdout:; cat "$at_stdout"
   158961 at_fn_check_status 0 $at_status "$at_srcdir/java.at:497"
   158962 $at_failed && at_fn_log_failure
   158963 $at_traceon; }
   158964 
   158965     cp xml-tests/test.output expout
   158966   { set +x
   158967 $as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\
   158968              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   158969              xml-tests/test.xml"
   158970 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:497"
   158971 ( $at_check_trace; $XSLTPROC \
   158972              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   158973              xml-tests/test.xml
   158974 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158975 at_status=$? at_failed=false
   158976 $at_check_filter
   158977 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158978 $at_diff expout "$at_stdout" || at_failed=:
   158979 at_fn_check_status 0 $at_status "$at_srcdir/java.at:497"
   158980 $at_failed && at_fn_log_failure
   158981 $at_traceon; }
   158982 
   158983   sort xml-tests/test.dot > expout
   158984   { set +x
   158985 $as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\
   158986              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   158987              xml-tests/test.xml | sort"
   158988 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:497"
   158989 ( $at_check_trace; $XSLTPROC \
   158990              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   158991              xml-tests/test.xml | sort
   158992 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   158993 at_status=$? at_failed=false
   158994 $at_check_filter
   158995 at_fn_diff_devnull "$at_stderr" || at_failed=:
   158996 $at_diff expout "$at_stdout" || at_failed=:
   158997 at_fn_check_status 0 $at_status "$at_srcdir/java.at:497"
   158998 $at_failed && at_fn_log_failure
   158999 $at_traceon; }
   159000 
   159001   rm -rf xml-tests expout
   159002   at_restore_special_files
   159003 fi
   159004 { set +x
   159005 $as_echo "$at_srcdir/java.at:497: bison YYParser.y"
   159006 at_fn_check_prepare_trace "java.at:497"
   159007 ( $at_check_trace; bison YYParser.y
   159008 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159009 at_status=$? at_failed=false
   159010 $at_check_filter
   159011 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159012 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159013 at_fn_check_status 0 $at_status "$at_srcdir/java.at:497"
   159014 $at_failed && at_fn_log_failure
   159015 $at_traceon; }
   159016 
   159017 
   159018 { set +x
   159019 $as_echo "$at_srcdir/java.at:497: grep '[mb]4_' YYParser.y"
   159020 at_fn_check_prepare_trace "java.at:497"
   159021 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159023 at_status=$? at_failed=false
   159024 $at_check_filter
   159025 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159026 echo stdout:; cat "$at_stdout"
   159027 at_fn_check_status 1 $at_status "$at_srcdir/java.at:497"
   159028 $at_failed && at_fn_log_failure
   159029 $at_traceon; }
   159030 
   159031 
   159032 $as_echo "java.at:497" >"$at_check_line_file"
   159033 (test -z "$CONF_JAVAC") \
   159034   && at_fn_check_skip 77 "$at_srcdir/java.at:497"
   159035 $as_echo "java.at:497" >"$at_check_line_file"
   159036 (test -z "$CONF_JAVA") \
   159037   && at_fn_check_skip 77 "$at_srcdir/java.at:497"
   159038 { set +x
   159039 $as_echo "$at_srcdir/java.at:497: \$SHELL ../../../javacomp.sh YYParser.java"
   159040 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:497"
   159041 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159042 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159043 at_status=$? at_failed=false
   159044 $at_check_filter
   159045 echo stderr:; cat "$at_stderr"
   159046 echo stdout:; cat "$at_stdout"
   159047 at_fn_check_status 0 $at_status "$at_srcdir/java.at:497"
   159048 $at_failed && at_fn_log_failure
   159049 $at_traceon; }
   159050 
   159051 
   159052 { set +x
   159053 $as_echo "$at_srcdir/java.at:498: grep -c '^public class YYParser\$' YYParser.java"
   159054 at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:498"
   159055 ( $at_check_trace; grep -c '^public class YYParser$' YYParser.java
   159056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159057 at_status=$? at_failed=false
   159058 $at_check_filter
   159059 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159060 echo >>"$at_stdout"; $as_echo "1
   159061 " | \
   159062   $at_diff - "$at_stdout" || at_failed=:
   159063 at_fn_check_status 0 $at_status "$at_srcdir/java.at:498"
   159064 $at_failed && at_fn_log_failure
   159065 $at_traceon; }
   159066 
   159067 
   159068 
   159069 
   159070 cat >YYParser.y <<'_ATEOF'
   159071 
   159072 %language "Java"
   159073 %locations
   159074 %debug
   159075 %error-verbose
   159076 %token-table
   159077 
   159078 %define public
   159079 %define abstract
   159080 %%
   159081 start: "end" {};
   159082 %%
   159083 class Position {}
   159084 _ATEOF
   159085 
   159086 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   159087   at_save_special_files
   159088   mkdir xml-tests
   159089     # Don't combine these Bison invocations since we want to be sure that
   159090   # --report=all isn't required to get the full XML file.
   159091   { set +x
   159092 $as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   159093                   --graph=xml-tests/test.dot YYParser.y"
   159094 at_fn_check_prepare_notrace 'an embedded newline' "java.at:500"
   159095 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   159096                   --graph=xml-tests/test.dot YYParser.y
   159097 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159098 at_status=$? at_failed=false
   159099 $at_check_filter
   159100 echo stderr:; cat "$at_stderr"
   159101 echo stdout:; cat "$at_stdout"
   159102 at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
   159103 $at_failed && at_fn_log_failure
   159104 $at_traceon; }
   159105 
   159106   { set +x
   159107 $as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   159108 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:500"
   159109 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   159110 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159111 at_status=$? at_failed=false
   159112 $at_check_filter
   159113 echo stderr:; cat "$at_stderr"
   159114 echo stdout:; cat "$at_stdout"
   159115 at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
   159116 $at_failed && at_fn_log_failure
   159117 $at_traceon; }
   159118 
   159119     cp xml-tests/test.output expout
   159120   { set +x
   159121 $as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\
   159122              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   159123              xml-tests/test.xml"
   159124 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500"
   159125 ( $at_check_trace; $XSLTPROC \
   159126              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   159127              xml-tests/test.xml
   159128 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159129 at_status=$? at_failed=false
   159130 $at_check_filter
   159131 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159132 $at_diff expout "$at_stdout" || at_failed=:
   159133 at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
   159134 $at_failed && at_fn_log_failure
   159135 $at_traceon; }
   159136 
   159137   sort xml-tests/test.dot > expout
   159138   { set +x
   159139 $as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\
   159140              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   159141              xml-tests/test.xml | sort"
   159142 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500"
   159143 ( $at_check_trace; $XSLTPROC \
   159144              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   159145              xml-tests/test.xml | sort
   159146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159147 at_status=$? at_failed=false
   159148 $at_check_filter
   159149 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159150 $at_diff expout "$at_stdout" || at_failed=:
   159151 at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
   159152 $at_failed && at_fn_log_failure
   159153 $at_traceon; }
   159154 
   159155   rm -rf xml-tests expout
   159156   at_restore_special_files
   159157 fi
   159158 { set +x
   159159 $as_echo "$at_srcdir/java.at:500: bison YYParser.y"
   159160 at_fn_check_prepare_trace "java.at:500"
   159161 ( $at_check_trace; bison YYParser.y
   159162 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159163 at_status=$? at_failed=false
   159164 $at_check_filter
   159165 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159166 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159167 at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
   159168 $at_failed && at_fn_log_failure
   159169 $at_traceon; }
   159170 
   159171 
   159172 { set +x
   159173 $as_echo "$at_srcdir/java.at:500: grep '[mb]4_' YYParser.y"
   159174 at_fn_check_prepare_trace "java.at:500"
   159175 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159176 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159177 at_status=$? at_failed=false
   159178 $at_check_filter
   159179 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159180 echo stdout:; cat "$at_stdout"
   159181 at_fn_check_status 1 $at_status "$at_srcdir/java.at:500"
   159182 $at_failed && at_fn_log_failure
   159183 $at_traceon; }
   159184 
   159185 
   159186 $as_echo "java.at:500" >"$at_check_line_file"
   159187 (test -z "$CONF_JAVAC") \
   159188   && at_fn_check_skip 77 "$at_srcdir/java.at:500"
   159189 $as_echo "java.at:500" >"$at_check_line_file"
   159190 (test -z "$CONF_JAVA") \
   159191   && at_fn_check_skip 77 "$at_srcdir/java.at:500"
   159192 { set +x
   159193 $as_echo "$at_srcdir/java.at:500: \$SHELL ../../../javacomp.sh YYParser.java"
   159194 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:500"
   159195 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159197 at_status=$? at_failed=false
   159198 $at_check_filter
   159199 echo stderr:; cat "$at_stderr"
   159200 echo stdout:; cat "$at_stdout"
   159201 at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
   159202 $at_failed && at_fn_log_failure
   159203 $at_traceon; }
   159204 
   159205 
   159206 { set +x
   159207 $as_echo "$at_srcdir/java.at:503: grep -c '^public abstract class YYParser\$' YYParser.java"
   159208 at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:503"
   159209 ( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.java
   159210 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159211 at_status=$? at_failed=false
   159212 $at_check_filter
   159213 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159214 echo >>"$at_stdout"; $as_echo "1
   159215 " | \
   159216   $at_diff - "$at_stdout" || at_failed=:
   159217 at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
   159218 $at_failed && at_fn_log_failure
   159219 $at_traceon; }
   159220 
   159221 
   159222 
   159223 
   159224 cat >YYParser.y <<'_ATEOF'
   159225 
   159226 %language "Java"
   159227 %locations
   159228 %debug
   159229 %error-verbose
   159230 %token-table
   159231 
   159232 %define public
   159233 %define final
   159234 %%
   159235 start: "end" {};
   159236 %%
   159237 class Position {}
   159238 _ATEOF
   159239 
   159240 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   159241   at_save_special_files
   159242   mkdir xml-tests
   159243     # Don't combine these Bison invocations since we want to be sure that
   159244   # --report=all isn't required to get the full XML file.
   159245   { set +x
   159246 $as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   159247                   --graph=xml-tests/test.dot YYParser.y"
   159248 at_fn_check_prepare_notrace 'an embedded newline' "java.at:505"
   159249 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   159250                   --graph=xml-tests/test.dot YYParser.y
   159251 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159252 at_status=$? at_failed=false
   159253 $at_check_filter
   159254 echo stderr:; cat "$at_stderr"
   159255 echo stdout:; cat "$at_stdout"
   159256 at_fn_check_status 0 $at_status "$at_srcdir/java.at:505"
   159257 $at_failed && at_fn_log_failure
   159258 $at_traceon; }
   159259 
   159260   { set +x
   159261 $as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   159262 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:505"
   159263 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   159264 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159265 at_status=$? at_failed=false
   159266 $at_check_filter
   159267 echo stderr:; cat "$at_stderr"
   159268 echo stdout:; cat "$at_stdout"
   159269 at_fn_check_status 0 $at_status "$at_srcdir/java.at:505"
   159270 $at_failed && at_fn_log_failure
   159271 $at_traceon; }
   159272 
   159273     cp xml-tests/test.output expout
   159274   { set +x
   159275 $as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\
   159276              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   159277              xml-tests/test.xml"
   159278 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505"
   159279 ( $at_check_trace; $XSLTPROC \
   159280              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   159281              xml-tests/test.xml
   159282 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159283 at_status=$? at_failed=false
   159284 $at_check_filter
   159285 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159286 $at_diff expout "$at_stdout" || at_failed=:
   159287 at_fn_check_status 0 $at_status "$at_srcdir/java.at:505"
   159288 $at_failed && at_fn_log_failure
   159289 $at_traceon; }
   159290 
   159291   sort xml-tests/test.dot > expout
   159292   { set +x
   159293 $as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\
   159294              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   159295              xml-tests/test.xml | sort"
   159296 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505"
   159297 ( $at_check_trace; $XSLTPROC \
   159298              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   159299              xml-tests/test.xml | sort
   159300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159301 at_status=$? at_failed=false
   159302 $at_check_filter
   159303 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159304 $at_diff expout "$at_stdout" || at_failed=:
   159305 at_fn_check_status 0 $at_status "$at_srcdir/java.at:505"
   159306 $at_failed && at_fn_log_failure
   159307 $at_traceon; }
   159308 
   159309   rm -rf xml-tests expout
   159310   at_restore_special_files
   159311 fi
   159312 { set +x
   159313 $as_echo "$at_srcdir/java.at:505: bison YYParser.y"
   159314 at_fn_check_prepare_trace "java.at:505"
   159315 ( $at_check_trace; bison YYParser.y
   159316 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159317 at_status=$? at_failed=false
   159318 $at_check_filter
   159319 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159320 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159321 at_fn_check_status 0 $at_status "$at_srcdir/java.at:505"
   159322 $at_failed && at_fn_log_failure
   159323 $at_traceon; }
   159324 
   159325 
   159326 { set +x
   159327 $as_echo "$at_srcdir/java.at:505: grep '[mb]4_' YYParser.y"
   159328 at_fn_check_prepare_trace "java.at:505"
   159329 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159330 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159331 at_status=$? at_failed=false
   159332 $at_check_filter
   159333 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159334 echo stdout:; cat "$at_stdout"
   159335 at_fn_check_status 1 $at_status "$at_srcdir/java.at:505"
   159336 $at_failed && at_fn_log_failure
   159337 $at_traceon; }
   159338 
   159339 
   159340 $as_echo "java.at:505" >"$at_check_line_file"
   159341 (test -z "$CONF_JAVAC") \
   159342   && at_fn_check_skip 77 "$at_srcdir/java.at:505"
   159343 $as_echo "java.at:505" >"$at_check_line_file"
   159344 (test -z "$CONF_JAVA") \
   159345   && at_fn_check_skip 77 "$at_srcdir/java.at:505"
   159346 { set +x
   159347 $as_echo "$at_srcdir/java.at:505: \$SHELL ../../../javacomp.sh YYParser.java"
   159348 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:505"
   159349 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159351 at_status=$? at_failed=false
   159352 $at_check_filter
   159353 echo stderr:; cat "$at_stderr"
   159354 echo stdout:; cat "$at_stdout"
   159355 at_fn_check_status 0 $at_status "$at_srcdir/java.at:505"
   159356 $at_failed && at_fn_log_failure
   159357 $at_traceon; }
   159358 
   159359 
   159360 { set +x
   159361 $as_echo "$at_srcdir/java.at:508: grep -c '^public final class YYParser\$' YYParser.java"
   159362 at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:508"
   159363 ( $at_check_trace; grep -c '^public final class YYParser$' YYParser.java
   159364 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159365 at_status=$? at_failed=false
   159366 $at_check_filter
   159367 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159368 echo >>"$at_stdout"; $as_echo "1
   159369 " | \
   159370   $at_diff - "$at_stdout" || at_failed=:
   159371 at_fn_check_status 0 $at_status "$at_srcdir/java.at:508"
   159372 $at_failed && at_fn_log_failure
   159373 $at_traceon; }
   159374 
   159375 
   159376 
   159377 
   159378 cat >YYParser.y <<'_ATEOF'
   159379 
   159380 %language "Java"
   159381 %locations
   159382 %debug
   159383 %error-verbose
   159384 %token-table
   159385 
   159386 %define public
   159387 %define strictfp
   159388 %%
   159389 start: "end" {};
   159390 %%
   159391 class Position {}
   159392 _ATEOF
   159393 
   159394 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   159395   at_save_special_files
   159396   mkdir xml-tests
   159397     # Don't combine these Bison invocations since we want to be sure that
   159398   # --report=all isn't required to get the full XML file.
   159399   { set +x
   159400 $as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   159401                   --graph=xml-tests/test.dot YYParser.y"
   159402 at_fn_check_prepare_notrace 'an embedded newline' "java.at:510"
   159403 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   159404                   --graph=xml-tests/test.dot YYParser.y
   159405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159406 at_status=$? at_failed=false
   159407 $at_check_filter
   159408 echo stderr:; cat "$at_stderr"
   159409 echo stdout:; cat "$at_stdout"
   159410 at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
   159411 $at_failed && at_fn_log_failure
   159412 $at_traceon; }
   159413 
   159414   { set +x
   159415 $as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   159416 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:510"
   159417 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   159418 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159419 at_status=$? at_failed=false
   159420 $at_check_filter
   159421 echo stderr:; cat "$at_stderr"
   159422 echo stdout:; cat "$at_stdout"
   159423 at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
   159424 $at_failed && at_fn_log_failure
   159425 $at_traceon; }
   159426 
   159427     cp xml-tests/test.output expout
   159428   { set +x
   159429 $as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\
   159430              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   159431              xml-tests/test.xml"
   159432 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510"
   159433 ( $at_check_trace; $XSLTPROC \
   159434              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   159435              xml-tests/test.xml
   159436 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159437 at_status=$? at_failed=false
   159438 $at_check_filter
   159439 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159440 $at_diff expout "$at_stdout" || at_failed=:
   159441 at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
   159442 $at_failed && at_fn_log_failure
   159443 $at_traceon; }
   159444 
   159445   sort xml-tests/test.dot > expout
   159446   { set +x
   159447 $as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\
   159448              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   159449              xml-tests/test.xml | sort"
   159450 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510"
   159451 ( $at_check_trace; $XSLTPROC \
   159452              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   159453              xml-tests/test.xml | sort
   159454 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159455 at_status=$? at_failed=false
   159456 $at_check_filter
   159457 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159458 $at_diff expout "$at_stdout" || at_failed=:
   159459 at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
   159460 $at_failed && at_fn_log_failure
   159461 $at_traceon; }
   159462 
   159463   rm -rf xml-tests expout
   159464   at_restore_special_files
   159465 fi
   159466 { set +x
   159467 $as_echo "$at_srcdir/java.at:510: bison YYParser.y"
   159468 at_fn_check_prepare_trace "java.at:510"
   159469 ( $at_check_trace; bison YYParser.y
   159470 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159471 at_status=$? at_failed=false
   159472 $at_check_filter
   159473 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159474 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159475 at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
   159476 $at_failed && at_fn_log_failure
   159477 $at_traceon; }
   159478 
   159479 
   159480 { set +x
   159481 $as_echo "$at_srcdir/java.at:510: grep '[mb]4_' YYParser.y"
   159482 at_fn_check_prepare_trace "java.at:510"
   159483 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159484 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159485 at_status=$? at_failed=false
   159486 $at_check_filter
   159487 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159488 echo stdout:; cat "$at_stdout"
   159489 at_fn_check_status 1 $at_status "$at_srcdir/java.at:510"
   159490 $at_failed && at_fn_log_failure
   159491 $at_traceon; }
   159492 
   159493 
   159494 $as_echo "java.at:510" >"$at_check_line_file"
   159495 (test -z "$CONF_JAVAC") \
   159496   && at_fn_check_skip 77 "$at_srcdir/java.at:510"
   159497 $as_echo "java.at:510" >"$at_check_line_file"
   159498 (test -z "$CONF_JAVA") \
   159499   && at_fn_check_skip 77 "$at_srcdir/java.at:510"
   159500 { set +x
   159501 $as_echo "$at_srcdir/java.at:510: \$SHELL ../../../javacomp.sh YYParser.java"
   159502 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:510"
   159503 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159504 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159505 at_status=$? at_failed=false
   159506 $at_check_filter
   159507 echo stderr:; cat "$at_stderr"
   159508 echo stdout:; cat "$at_stdout"
   159509 at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
   159510 $at_failed && at_fn_log_failure
   159511 $at_traceon; }
   159512 
   159513 
   159514 { set +x
   159515 $as_echo "$at_srcdir/java.at:513: grep -c '^public strictfp class YYParser\$' YYParser.java"
   159516 at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:513"
   159517 ( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.java
   159518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159519 at_status=$? at_failed=false
   159520 $at_check_filter
   159521 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159522 echo >>"$at_stdout"; $as_echo "1
   159523 " | \
   159524   $at_diff - "$at_stdout" || at_failed=:
   159525 at_fn_check_status 0 $at_status "$at_srcdir/java.at:513"
   159526 $at_failed && at_fn_log_failure
   159527 $at_traceon; }
   159528 
   159529 
   159530 
   159531 
   159532 cat >YYParser.y <<'_ATEOF'
   159533 
   159534 %language "Java"
   159535 %locations
   159536 %debug
   159537 %error-verbose
   159538 %token-table
   159539 
   159540 %define public
   159541 %define abstract
   159542 %define strictfp
   159543 %%
   159544 start: "end" {};
   159545 %%
   159546 class Position {}
   159547 _ATEOF
   159548 
   159549 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   159550   at_save_special_files
   159551   mkdir xml-tests
   159552     # Don't combine these Bison invocations since we want to be sure that
   159553   # --report=all isn't required to get the full XML file.
   159554   { set +x
   159555 $as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   159556                   --graph=xml-tests/test.dot YYParser.y"
   159557 at_fn_check_prepare_notrace 'an embedded newline' "java.at:515"
   159558 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   159559                   --graph=xml-tests/test.dot YYParser.y
   159560 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159561 at_status=$? at_failed=false
   159562 $at_check_filter
   159563 echo stderr:; cat "$at_stderr"
   159564 echo stdout:; cat "$at_stdout"
   159565 at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
   159566 $at_failed && at_fn_log_failure
   159567 $at_traceon; }
   159568 
   159569   { set +x
   159570 $as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   159571 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:515"
   159572 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   159573 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159574 at_status=$? at_failed=false
   159575 $at_check_filter
   159576 echo stderr:; cat "$at_stderr"
   159577 echo stdout:; cat "$at_stdout"
   159578 at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
   159579 $at_failed && at_fn_log_failure
   159580 $at_traceon; }
   159581 
   159582     cp xml-tests/test.output expout
   159583   { set +x
   159584 $as_echo "$at_srcdir/java.at:515: \$XSLTPROC \\
   159585              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   159586              xml-tests/test.xml"
   159587 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:515"
   159588 ( $at_check_trace; $XSLTPROC \
   159589              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   159590              xml-tests/test.xml
   159591 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159592 at_status=$? at_failed=false
   159593 $at_check_filter
   159594 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159595 $at_diff expout "$at_stdout" || at_failed=:
   159596 at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
   159597 $at_failed && at_fn_log_failure
   159598 $at_traceon; }
   159599 
   159600   sort xml-tests/test.dot > expout
   159601   { set +x
   159602 $as_echo "$at_srcdir/java.at:515: \$XSLTPROC \\
   159603              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   159604              xml-tests/test.xml | sort"
   159605 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:515"
   159606 ( $at_check_trace; $XSLTPROC \
   159607              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   159608              xml-tests/test.xml | sort
   159609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159610 at_status=$? at_failed=false
   159611 $at_check_filter
   159612 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159613 $at_diff expout "$at_stdout" || at_failed=:
   159614 at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
   159615 $at_failed && at_fn_log_failure
   159616 $at_traceon; }
   159617 
   159618   rm -rf xml-tests expout
   159619   at_restore_special_files
   159620 fi
   159621 { set +x
   159622 $as_echo "$at_srcdir/java.at:515: bison YYParser.y"
   159623 at_fn_check_prepare_trace "java.at:515"
   159624 ( $at_check_trace; bison YYParser.y
   159625 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159626 at_status=$? at_failed=false
   159627 $at_check_filter
   159628 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159629 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159630 at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
   159631 $at_failed && at_fn_log_failure
   159632 $at_traceon; }
   159633 
   159634 
   159635 { set +x
   159636 $as_echo "$at_srcdir/java.at:515: grep '[mb]4_' YYParser.y"
   159637 at_fn_check_prepare_trace "java.at:515"
   159638 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159639 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159640 at_status=$? at_failed=false
   159641 $at_check_filter
   159642 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159643 echo stdout:; cat "$at_stdout"
   159644 at_fn_check_status 1 $at_status "$at_srcdir/java.at:515"
   159645 $at_failed && at_fn_log_failure
   159646 $at_traceon; }
   159647 
   159648 
   159649 $as_echo "java.at:515" >"$at_check_line_file"
   159650 (test -z "$CONF_JAVAC") \
   159651   && at_fn_check_skip 77 "$at_srcdir/java.at:515"
   159652 $as_echo "java.at:515" >"$at_check_line_file"
   159653 (test -z "$CONF_JAVA") \
   159654   && at_fn_check_skip 77 "$at_srcdir/java.at:515"
   159655 { set +x
   159656 $as_echo "$at_srcdir/java.at:515: \$SHELL ../../../javacomp.sh YYParser.java"
   159657 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:515"
   159658 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159659 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159660 at_status=$? at_failed=false
   159661 $at_check_filter
   159662 echo stderr:; cat "$at_stderr"
   159663 echo stdout:; cat "$at_stdout"
   159664 at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
   159665 $at_failed && at_fn_log_failure
   159666 $at_traceon; }
   159667 
   159668 
   159669 { set +x
   159670 $as_echo "$at_srcdir/java.at:519: grep -c '^public abstract strictfp class YYParser\$' YYParser.java"
   159671 at_fn_check_prepare_dynamic "grep -c '^public abstract strictfp class YYParser$' YYParser.java" "java.at:519"
   159672 ( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.java
   159673 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159674 at_status=$? at_failed=false
   159675 $at_check_filter
   159676 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159677 echo >>"$at_stdout"; $as_echo "1
   159678 " | \
   159679   $at_diff - "$at_stdout" || at_failed=:
   159680 at_fn_check_status 0 $at_status "$at_srcdir/java.at:519"
   159681 $at_failed && at_fn_log_failure
   159682 $at_traceon; }
   159683 
   159684 
   159685 
   159686 
   159687 cat >YYParser.y <<'_ATEOF'
   159688 
   159689 %language "Java"
   159690 %locations
   159691 %debug
   159692 %error-verbose
   159693 %token-table
   159694 
   159695 %define public
   159696 %define final
   159697 %define strictfp
   159698 %%
   159699 start: "end" {};
   159700 %%
   159701 class Position {}
   159702 _ATEOF
   159703 
   159704 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   159705   at_save_special_files
   159706   mkdir xml-tests
   159707     # Don't combine these Bison invocations since we want to be sure that
   159708   # --report=all isn't required to get the full XML file.
   159709   { set +x
   159710 $as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   159711                   --graph=xml-tests/test.dot YYParser.y"
   159712 at_fn_check_prepare_notrace 'an embedded newline' "java.at:521"
   159713 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   159714                   --graph=xml-tests/test.dot YYParser.y
   159715 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159716 at_status=$? at_failed=false
   159717 $at_check_filter
   159718 echo stderr:; cat "$at_stderr"
   159719 echo stdout:; cat "$at_stdout"
   159720 at_fn_check_status 0 $at_status "$at_srcdir/java.at:521"
   159721 $at_failed && at_fn_log_failure
   159722 $at_traceon; }
   159723 
   159724   { set +x
   159725 $as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   159726 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:521"
   159727 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   159728 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159729 at_status=$? at_failed=false
   159730 $at_check_filter
   159731 echo stderr:; cat "$at_stderr"
   159732 echo stdout:; cat "$at_stdout"
   159733 at_fn_check_status 0 $at_status "$at_srcdir/java.at:521"
   159734 $at_failed && at_fn_log_failure
   159735 $at_traceon; }
   159736 
   159737     cp xml-tests/test.output expout
   159738   { set +x
   159739 $as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\
   159740              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   159741              xml-tests/test.xml"
   159742 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521"
   159743 ( $at_check_trace; $XSLTPROC \
   159744              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   159745              xml-tests/test.xml
   159746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159747 at_status=$? at_failed=false
   159748 $at_check_filter
   159749 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159750 $at_diff expout "$at_stdout" || at_failed=:
   159751 at_fn_check_status 0 $at_status "$at_srcdir/java.at:521"
   159752 $at_failed && at_fn_log_failure
   159753 $at_traceon; }
   159754 
   159755   sort xml-tests/test.dot > expout
   159756   { set +x
   159757 $as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\
   159758              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   159759              xml-tests/test.xml | sort"
   159760 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521"
   159761 ( $at_check_trace; $XSLTPROC \
   159762              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   159763              xml-tests/test.xml | sort
   159764 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159765 at_status=$? at_failed=false
   159766 $at_check_filter
   159767 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159768 $at_diff expout "$at_stdout" || at_failed=:
   159769 at_fn_check_status 0 $at_status "$at_srcdir/java.at:521"
   159770 $at_failed && at_fn_log_failure
   159771 $at_traceon; }
   159772 
   159773   rm -rf xml-tests expout
   159774   at_restore_special_files
   159775 fi
   159776 { set +x
   159777 $as_echo "$at_srcdir/java.at:521: bison YYParser.y"
   159778 at_fn_check_prepare_trace "java.at:521"
   159779 ( $at_check_trace; bison YYParser.y
   159780 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159781 at_status=$? at_failed=false
   159782 $at_check_filter
   159783 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159784 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159785 at_fn_check_status 0 $at_status "$at_srcdir/java.at:521"
   159786 $at_failed && at_fn_log_failure
   159787 $at_traceon; }
   159788 
   159789 
   159790 { set +x
   159791 $as_echo "$at_srcdir/java.at:521: grep '[mb]4_' YYParser.y"
   159792 at_fn_check_prepare_trace "java.at:521"
   159793 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159794 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159795 at_status=$? at_failed=false
   159796 $at_check_filter
   159797 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159798 echo stdout:; cat "$at_stdout"
   159799 at_fn_check_status 1 $at_status "$at_srcdir/java.at:521"
   159800 $at_failed && at_fn_log_failure
   159801 $at_traceon; }
   159802 
   159803 
   159804 $as_echo "java.at:521" >"$at_check_line_file"
   159805 (test -z "$CONF_JAVAC") \
   159806   && at_fn_check_skip 77 "$at_srcdir/java.at:521"
   159807 $as_echo "java.at:521" >"$at_check_line_file"
   159808 (test -z "$CONF_JAVA") \
   159809   && at_fn_check_skip 77 "$at_srcdir/java.at:521"
   159810 { set +x
   159811 $as_echo "$at_srcdir/java.at:521: \$SHELL ../../../javacomp.sh YYParser.java"
   159812 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:521"
   159813 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159814 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159815 at_status=$? at_failed=false
   159816 $at_check_filter
   159817 echo stderr:; cat "$at_stderr"
   159818 echo stdout:; cat "$at_stdout"
   159819 at_fn_check_status 0 $at_status "$at_srcdir/java.at:521"
   159820 $at_failed && at_fn_log_failure
   159821 $at_traceon; }
   159822 
   159823 
   159824 { set +x
   159825 $as_echo "$at_srcdir/java.at:525: grep -c '^public final strictfp class YYParser\$' YYParser.java"
   159826 at_fn_check_prepare_dynamic "grep -c '^public final strictfp class YYParser$' YYParser.java" "java.at:525"
   159827 ( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.java
   159828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159829 at_status=$? at_failed=false
   159830 $at_check_filter
   159831 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159832 echo >>"$at_stdout"; $as_echo "1
   159833 " | \
   159834   $at_diff - "$at_stdout" || at_failed=:
   159835 at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
   159836 $at_failed && at_fn_log_failure
   159837 $at_traceon; }
   159838 
   159839 
   159840 
   159841   set +x
   159842   $at_times_p && times >"$at_times_file"
   159843 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   159844 read at_status <"$at_status_file"
   159845 #AT_STOP_316
   159846 #AT_START_317
   159847 at_fn_group_banner 317 'java.at:534' \
   159848   "Java parser class extends and implements" "       " 20
   159849 at_xfail=no
   159850 (
   159851   $as_echo "317. $at_setup_line: testing $at_desc ..."
   159852   $at_traceon
   159853 
   159854 
   159855 
   159856 cat >YYParser.y <<'_ATEOF'
   159857 
   159858 %language "Java"
   159859 %locations
   159860 %debug
   159861 %error-verbose
   159862 %token-table
   159863 %define extends "Thread"
   159864 %%
   159865 start: "end" {};
   159866 %%
   159867 class Position {}
   159868 _ATEOF
   159869 
   159870 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   159871   at_save_special_files
   159872   mkdir xml-tests
   159873     # Don't combine these Bison invocations since we want to be sure that
   159874   # --report=all isn't required to get the full XML file.
   159875   { set +x
   159876 $as_echo "$at_srcdir/java.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   159877                   --graph=xml-tests/test.dot YYParser.y"
   159878 at_fn_check_prepare_notrace 'an embedded newline' "java.at:536"
   159879 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   159880                   --graph=xml-tests/test.dot YYParser.y
   159881 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159882 at_status=$? at_failed=false
   159883 $at_check_filter
   159884 echo stderr:; cat "$at_stderr"
   159885 echo stdout:; cat "$at_stdout"
   159886 at_fn_check_status 0 $at_status "$at_srcdir/java.at:536"
   159887 $at_failed && at_fn_log_failure
   159888 $at_traceon; }
   159889 
   159890   { set +x
   159891 $as_echo "$at_srcdir/java.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   159892 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:536"
   159893 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   159894 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159895 at_status=$? at_failed=false
   159896 $at_check_filter
   159897 echo stderr:; cat "$at_stderr"
   159898 echo stdout:; cat "$at_stdout"
   159899 at_fn_check_status 0 $at_status "$at_srcdir/java.at:536"
   159900 $at_failed && at_fn_log_failure
   159901 $at_traceon; }
   159902 
   159903     cp xml-tests/test.output expout
   159904   { set +x
   159905 $as_echo "$at_srcdir/java.at:536: \$XSLTPROC \\
   159906              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   159907              xml-tests/test.xml"
   159908 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:536"
   159909 ( $at_check_trace; $XSLTPROC \
   159910              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   159911              xml-tests/test.xml
   159912 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159913 at_status=$? at_failed=false
   159914 $at_check_filter
   159915 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159916 $at_diff expout "$at_stdout" || at_failed=:
   159917 at_fn_check_status 0 $at_status "$at_srcdir/java.at:536"
   159918 $at_failed && at_fn_log_failure
   159919 $at_traceon; }
   159920 
   159921   sort xml-tests/test.dot > expout
   159922   { set +x
   159923 $as_echo "$at_srcdir/java.at:536: \$XSLTPROC \\
   159924              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   159925              xml-tests/test.xml | sort"
   159926 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:536"
   159927 ( $at_check_trace; $XSLTPROC \
   159928              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   159929              xml-tests/test.xml | sort
   159930 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159931 at_status=$? at_failed=false
   159932 $at_check_filter
   159933 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159934 $at_diff expout "$at_stdout" || at_failed=:
   159935 at_fn_check_status 0 $at_status "$at_srcdir/java.at:536"
   159936 $at_failed && at_fn_log_failure
   159937 $at_traceon; }
   159938 
   159939   rm -rf xml-tests expout
   159940   at_restore_special_files
   159941 fi
   159942 { set +x
   159943 $as_echo "$at_srcdir/java.at:536: bison YYParser.y"
   159944 at_fn_check_prepare_trace "java.at:536"
   159945 ( $at_check_trace; bison YYParser.y
   159946 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159947 at_status=$? at_failed=false
   159948 $at_check_filter
   159949 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159950 at_fn_diff_devnull "$at_stdout" || at_failed=:
   159951 at_fn_check_status 0 $at_status "$at_srcdir/java.at:536"
   159952 $at_failed && at_fn_log_failure
   159953 $at_traceon; }
   159954 
   159955 
   159956 { set +x
   159957 $as_echo "$at_srcdir/java.at:536: grep '[mb]4_' YYParser.y"
   159958 at_fn_check_prepare_trace "java.at:536"
   159959 ( $at_check_trace; grep '[mb]4_' YYParser.y
   159960 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159961 at_status=$? at_failed=false
   159962 $at_check_filter
   159963 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159964 echo stdout:; cat "$at_stdout"
   159965 at_fn_check_status 1 $at_status "$at_srcdir/java.at:536"
   159966 $at_failed && at_fn_log_failure
   159967 $at_traceon; }
   159968 
   159969 
   159970 $as_echo "java.at:536" >"$at_check_line_file"
   159971 (test -z "$CONF_JAVAC") \
   159972   && at_fn_check_skip 77 "$at_srcdir/java.at:536"
   159973 $as_echo "java.at:536" >"$at_check_line_file"
   159974 (test -z "$CONF_JAVA") \
   159975   && at_fn_check_skip 77 "$at_srcdir/java.at:536"
   159976 { set +x
   159977 $as_echo "$at_srcdir/java.at:536: \$SHELL ../../../javacomp.sh YYParser.java"
   159978 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:536"
   159979 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   159980 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159981 at_status=$? at_failed=false
   159982 $at_check_filter
   159983 echo stderr:; cat "$at_stderr"
   159984 echo stdout:; cat "$at_stdout"
   159985 at_fn_check_status 0 $at_status "$at_srcdir/java.at:536"
   159986 $at_failed && at_fn_log_failure
   159987 $at_traceon; }
   159988 
   159989 
   159990 { set +x
   159991 $as_echo "$at_srcdir/java.at:537: grep -c '^class YYParser extends Thread\$' YYParser.java"
   159992 at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:537"
   159993 ( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.java
   159994 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   159995 at_status=$? at_failed=false
   159996 $at_check_filter
   159997 at_fn_diff_devnull "$at_stderr" || at_failed=:
   159998 echo >>"$at_stdout"; $as_echo "1
   159999 " | \
   160000   $at_diff - "$at_stdout" || at_failed=:
   160001 at_fn_check_status 0 $at_status "$at_srcdir/java.at:537"
   160002 $at_failed && at_fn_log_failure
   160003 $at_traceon; }
   160004 
   160005 
   160006 
   160007 
   160008 cat >YYParser.y <<'_ATEOF'
   160009 
   160010 %language "Java"
   160011 %locations
   160012 %debug
   160013 %error-verbose
   160014 %token-table
   160015 %define implements "Cloneable"
   160016 %%
   160017 start: "end" {};
   160018 %%
   160019 class Position {}
   160020 _ATEOF
   160021 
   160022 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   160023   at_save_special_files
   160024   mkdir xml-tests
   160025     # Don't combine these Bison invocations since we want to be sure that
   160026   # --report=all isn't required to get the full XML file.
   160027   { set +x
   160028 $as_echo "$at_srcdir/java.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   160029                   --graph=xml-tests/test.dot YYParser.y"
   160030 at_fn_check_prepare_notrace 'an embedded newline' "java.at:539"
   160031 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   160032                   --graph=xml-tests/test.dot YYParser.y
   160033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160034 at_status=$? at_failed=false
   160035 $at_check_filter
   160036 echo stderr:; cat "$at_stderr"
   160037 echo stdout:; cat "$at_stdout"
   160038 at_fn_check_status 0 $at_status "$at_srcdir/java.at:539"
   160039 $at_failed && at_fn_log_failure
   160040 $at_traceon; }
   160041 
   160042   { set +x
   160043 $as_echo "$at_srcdir/java.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   160044 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:539"
   160045 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   160046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160047 at_status=$? at_failed=false
   160048 $at_check_filter
   160049 echo stderr:; cat "$at_stderr"
   160050 echo stdout:; cat "$at_stdout"
   160051 at_fn_check_status 0 $at_status "$at_srcdir/java.at:539"
   160052 $at_failed && at_fn_log_failure
   160053 $at_traceon; }
   160054 
   160055     cp xml-tests/test.output expout
   160056   { set +x
   160057 $as_echo "$at_srcdir/java.at:539: \$XSLTPROC \\
   160058              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   160059              xml-tests/test.xml"
   160060 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:539"
   160061 ( $at_check_trace; $XSLTPROC \
   160062              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   160063              xml-tests/test.xml
   160064 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160065 at_status=$? at_failed=false
   160066 $at_check_filter
   160067 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160068 $at_diff expout "$at_stdout" || at_failed=:
   160069 at_fn_check_status 0 $at_status "$at_srcdir/java.at:539"
   160070 $at_failed && at_fn_log_failure
   160071 $at_traceon; }
   160072 
   160073   sort xml-tests/test.dot > expout
   160074   { set +x
   160075 $as_echo "$at_srcdir/java.at:539: \$XSLTPROC \\
   160076              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   160077              xml-tests/test.xml | sort"
   160078 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:539"
   160079 ( $at_check_trace; $XSLTPROC \
   160080              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   160081              xml-tests/test.xml | sort
   160082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160083 at_status=$? at_failed=false
   160084 $at_check_filter
   160085 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160086 $at_diff expout "$at_stdout" || at_failed=:
   160087 at_fn_check_status 0 $at_status "$at_srcdir/java.at:539"
   160088 $at_failed && at_fn_log_failure
   160089 $at_traceon; }
   160090 
   160091   rm -rf xml-tests expout
   160092   at_restore_special_files
   160093 fi
   160094 { set +x
   160095 $as_echo "$at_srcdir/java.at:539: bison YYParser.y"
   160096 at_fn_check_prepare_trace "java.at:539"
   160097 ( $at_check_trace; bison YYParser.y
   160098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160099 at_status=$? at_failed=false
   160100 $at_check_filter
   160101 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160102 at_fn_diff_devnull "$at_stdout" || at_failed=:
   160103 at_fn_check_status 0 $at_status "$at_srcdir/java.at:539"
   160104 $at_failed && at_fn_log_failure
   160105 $at_traceon; }
   160106 
   160107 
   160108 { set +x
   160109 $as_echo "$at_srcdir/java.at:539: grep '[mb]4_' YYParser.y"
   160110 at_fn_check_prepare_trace "java.at:539"
   160111 ( $at_check_trace; grep '[mb]4_' YYParser.y
   160112 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160113 at_status=$? at_failed=false
   160114 $at_check_filter
   160115 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160116 echo stdout:; cat "$at_stdout"
   160117 at_fn_check_status 1 $at_status "$at_srcdir/java.at:539"
   160118 $at_failed && at_fn_log_failure
   160119 $at_traceon; }
   160120 
   160121 
   160122 $as_echo "java.at:539" >"$at_check_line_file"
   160123 (test -z "$CONF_JAVAC") \
   160124   && at_fn_check_skip 77 "$at_srcdir/java.at:539"
   160125 $as_echo "java.at:539" >"$at_check_line_file"
   160126 (test -z "$CONF_JAVA") \
   160127   && at_fn_check_skip 77 "$at_srcdir/java.at:539"
   160128 { set +x
   160129 $as_echo "$at_srcdir/java.at:539: \$SHELL ../../../javacomp.sh YYParser.java"
   160130 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:539"
   160131 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   160132 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160133 at_status=$? at_failed=false
   160134 $at_check_filter
   160135 echo stderr:; cat "$at_stderr"
   160136 echo stdout:; cat "$at_stdout"
   160137 at_fn_check_status 0 $at_status "$at_srcdir/java.at:539"
   160138 $at_failed && at_fn_log_failure
   160139 $at_traceon; }
   160140 
   160141 
   160142 { set +x
   160143 $as_echo "$at_srcdir/java.at:540: grep -c '^class YYParser implements Cloneable\$' YYParser.java"
   160144 at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:540"
   160145 ( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.java
   160146 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160147 at_status=$? at_failed=false
   160148 $at_check_filter
   160149 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160150 echo >>"$at_stdout"; $as_echo "1
   160151 " | \
   160152   $at_diff - "$at_stdout" || at_failed=:
   160153 at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
   160154 $at_failed && at_fn_log_failure
   160155 $at_traceon; }
   160156 
   160157 
   160158 
   160159 
   160160 cat >YYParser.y <<'_ATEOF'
   160161 
   160162 %language "Java"
   160163 %locations
   160164 %debug
   160165 %error-verbose
   160166 %token-table
   160167 
   160168 %define extends "Thread"
   160169 %define implements "Cloneable"
   160170 %%
   160171 start: "end" {};
   160172 %%
   160173 class Position {}
   160174 _ATEOF
   160175 
   160176 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   160177   at_save_special_files
   160178   mkdir xml-tests
   160179     # Don't combine these Bison invocations since we want to be sure that
   160180   # --report=all isn't required to get the full XML file.
   160181   { set +x
   160182 $as_echo "$at_srcdir/java.at:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   160183                   --graph=xml-tests/test.dot YYParser.y"
   160184 at_fn_check_prepare_notrace 'an embedded newline' "java.at:542"
   160185 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   160186                   --graph=xml-tests/test.dot YYParser.y
   160187 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160188 at_status=$? at_failed=false
   160189 $at_check_filter
   160190 echo stderr:; cat "$at_stderr"
   160191 echo stdout:; cat "$at_stdout"
   160192 at_fn_check_status 0 $at_status "$at_srcdir/java.at:542"
   160193 $at_failed && at_fn_log_failure
   160194 $at_traceon; }
   160195 
   160196   { set +x
   160197 $as_echo "$at_srcdir/java.at:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   160198 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:542"
   160199 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   160200 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160201 at_status=$? at_failed=false
   160202 $at_check_filter
   160203 echo stderr:; cat "$at_stderr"
   160204 echo stdout:; cat "$at_stdout"
   160205 at_fn_check_status 0 $at_status "$at_srcdir/java.at:542"
   160206 $at_failed && at_fn_log_failure
   160207 $at_traceon; }
   160208 
   160209     cp xml-tests/test.output expout
   160210   { set +x
   160211 $as_echo "$at_srcdir/java.at:542: \$XSLTPROC \\
   160212              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   160213              xml-tests/test.xml"
   160214 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:542"
   160215 ( $at_check_trace; $XSLTPROC \
   160216              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   160217              xml-tests/test.xml
   160218 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160219 at_status=$? at_failed=false
   160220 $at_check_filter
   160221 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160222 $at_diff expout "$at_stdout" || at_failed=:
   160223 at_fn_check_status 0 $at_status "$at_srcdir/java.at:542"
   160224 $at_failed && at_fn_log_failure
   160225 $at_traceon; }
   160226 
   160227   sort xml-tests/test.dot > expout
   160228   { set +x
   160229 $as_echo "$at_srcdir/java.at:542: \$XSLTPROC \\
   160230              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   160231              xml-tests/test.xml | sort"
   160232 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:542"
   160233 ( $at_check_trace; $XSLTPROC \
   160234              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   160235              xml-tests/test.xml | sort
   160236 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160237 at_status=$? at_failed=false
   160238 $at_check_filter
   160239 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160240 $at_diff expout "$at_stdout" || at_failed=:
   160241 at_fn_check_status 0 $at_status "$at_srcdir/java.at:542"
   160242 $at_failed && at_fn_log_failure
   160243 $at_traceon; }
   160244 
   160245   rm -rf xml-tests expout
   160246   at_restore_special_files
   160247 fi
   160248 { set +x
   160249 $as_echo "$at_srcdir/java.at:542: bison YYParser.y"
   160250 at_fn_check_prepare_trace "java.at:542"
   160251 ( $at_check_trace; bison YYParser.y
   160252 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160253 at_status=$? at_failed=false
   160254 $at_check_filter
   160255 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160256 at_fn_diff_devnull "$at_stdout" || at_failed=:
   160257 at_fn_check_status 0 $at_status "$at_srcdir/java.at:542"
   160258 $at_failed && at_fn_log_failure
   160259 $at_traceon; }
   160260 
   160261 
   160262 { set +x
   160263 $as_echo "$at_srcdir/java.at:542: grep '[mb]4_' YYParser.y"
   160264 at_fn_check_prepare_trace "java.at:542"
   160265 ( $at_check_trace; grep '[mb]4_' YYParser.y
   160266 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160267 at_status=$? at_failed=false
   160268 $at_check_filter
   160269 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160270 echo stdout:; cat "$at_stdout"
   160271 at_fn_check_status 1 $at_status "$at_srcdir/java.at:542"
   160272 $at_failed && at_fn_log_failure
   160273 $at_traceon; }
   160274 
   160275 
   160276 $as_echo "java.at:542" >"$at_check_line_file"
   160277 (test -z "$CONF_JAVAC") \
   160278   && at_fn_check_skip 77 "$at_srcdir/java.at:542"
   160279 $as_echo "java.at:542" >"$at_check_line_file"
   160280 (test -z "$CONF_JAVA") \
   160281   && at_fn_check_skip 77 "$at_srcdir/java.at:542"
   160282 { set +x
   160283 $as_echo "$at_srcdir/java.at:542: \$SHELL ../../../javacomp.sh YYParser.java"
   160284 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:542"
   160285 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   160286 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160287 at_status=$? at_failed=false
   160288 $at_check_filter
   160289 echo stderr:; cat "$at_stderr"
   160290 echo stdout:; cat "$at_stdout"
   160291 at_fn_check_status 0 $at_status "$at_srcdir/java.at:542"
   160292 $at_failed && at_fn_log_failure
   160293 $at_traceon; }
   160294 
   160295 
   160296 { set +x
   160297 $as_echo "$at_srcdir/java.at:545: grep -c '^class YYParser extends Thread implements Cloneable\$' YYParser.java"
   160298 at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java" "java.at:545"
   160299 ( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java
   160300 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160301 at_status=$? at_failed=false
   160302 $at_check_filter
   160303 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160304 echo >>"$at_stdout"; $as_echo "1
   160305 " | \
   160306   $at_diff - "$at_stdout" || at_failed=:
   160307 at_fn_check_status 0 $at_status "$at_srcdir/java.at:545"
   160308 $at_failed && at_fn_log_failure
   160309 $at_traceon; }
   160310 
   160311 
   160312 
   160313   set +x
   160314   $at_times_p && times >"$at_times_file"
   160315 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   160316 read at_status <"$at_status_file"
   160317 #AT_STOP_317
   160318 #AT_START_318
   160319 at_fn_group_banner 318 'java.at:554' \
   160320   "Java %parse-param and %lex-param" "               " 20
   160321 at_xfail=no
   160322 (
   160323   $as_echo "318. $at_setup_line: testing $at_desc ..."
   160324   $at_traceon
   160325 
   160326 
   160327 
   160328 cat >YYParser.y <<'_ATEOF'
   160329 
   160330 %language "Java"
   160331 %locations
   160332 %debug
   160333 %error-verbose
   160334 %token-table
   160335 
   160336 %%
   160337 start: "end" {};
   160338 %%
   160339 class Position {}
   160340 _ATEOF
   160341 
   160342 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   160343   at_save_special_files
   160344   mkdir xml-tests
   160345     # Don't combine these Bison invocations since we want to be sure that
   160346   # --report=all isn't required to get the full XML file.
   160347   { set +x
   160348 $as_echo "$at_srcdir/java.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   160349                   --graph=xml-tests/test.dot YYParser.y"
   160350 at_fn_check_prepare_notrace 'an embedded newline' "java.at:556"
   160351 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   160352                   --graph=xml-tests/test.dot YYParser.y
   160353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160354 at_status=$? at_failed=false
   160355 $at_check_filter
   160356 echo stderr:; cat "$at_stderr"
   160357 echo stdout:; cat "$at_stdout"
   160358 at_fn_check_status 0 $at_status "$at_srcdir/java.at:556"
   160359 $at_failed && at_fn_log_failure
   160360 $at_traceon; }
   160361 
   160362   { set +x
   160363 $as_echo "$at_srcdir/java.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   160364 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:556"
   160365 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   160366 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160367 at_status=$? at_failed=false
   160368 $at_check_filter
   160369 echo stderr:; cat "$at_stderr"
   160370 echo stdout:; cat "$at_stdout"
   160371 at_fn_check_status 0 $at_status "$at_srcdir/java.at:556"
   160372 $at_failed && at_fn_log_failure
   160373 $at_traceon; }
   160374 
   160375     cp xml-tests/test.output expout
   160376   { set +x
   160377 $as_echo "$at_srcdir/java.at:556: \$XSLTPROC \\
   160378              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   160379              xml-tests/test.xml"
   160380 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:556"
   160381 ( $at_check_trace; $XSLTPROC \
   160382              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   160383              xml-tests/test.xml
   160384 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160385 at_status=$? at_failed=false
   160386 $at_check_filter
   160387 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160388 $at_diff expout "$at_stdout" || at_failed=:
   160389 at_fn_check_status 0 $at_status "$at_srcdir/java.at:556"
   160390 $at_failed && at_fn_log_failure
   160391 $at_traceon; }
   160392 
   160393   sort xml-tests/test.dot > expout
   160394   { set +x
   160395 $as_echo "$at_srcdir/java.at:556: \$XSLTPROC \\
   160396              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   160397              xml-tests/test.xml | sort"
   160398 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:556"
   160399 ( $at_check_trace; $XSLTPROC \
   160400              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   160401              xml-tests/test.xml | sort
   160402 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160403 at_status=$? at_failed=false
   160404 $at_check_filter
   160405 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160406 $at_diff expout "$at_stdout" || at_failed=:
   160407 at_fn_check_status 0 $at_status "$at_srcdir/java.at:556"
   160408 $at_failed && at_fn_log_failure
   160409 $at_traceon; }
   160410 
   160411   rm -rf xml-tests expout
   160412   at_restore_special_files
   160413 fi
   160414 { set +x
   160415 $as_echo "$at_srcdir/java.at:556: bison YYParser.y"
   160416 at_fn_check_prepare_trace "java.at:556"
   160417 ( $at_check_trace; bison YYParser.y
   160418 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160419 at_status=$? at_failed=false
   160420 $at_check_filter
   160421 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160422 at_fn_diff_devnull "$at_stdout" || at_failed=:
   160423 at_fn_check_status 0 $at_status "$at_srcdir/java.at:556"
   160424 $at_failed && at_fn_log_failure
   160425 $at_traceon; }
   160426 
   160427 
   160428 { set +x
   160429 $as_echo "$at_srcdir/java.at:556: grep '[mb]4_' YYParser.y"
   160430 at_fn_check_prepare_trace "java.at:556"
   160431 ( $at_check_trace; grep '[mb]4_' YYParser.y
   160432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160433 at_status=$? at_failed=false
   160434 $at_check_filter
   160435 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160436 echo stdout:; cat "$at_stdout"
   160437 at_fn_check_status 1 $at_status "$at_srcdir/java.at:556"
   160438 $at_failed && at_fn_log_failure
   160439 $at_traceon; }
   160440 
   160441 
   160442 $as_echo "java.at:556" >"$at_check_line_file"
   160443 (test -z "$CONF_JAVAC") \
   160444   && at_fn_check_skip 77 "$at_srcdir/java.at:556"
   160445 $as_echo "java.at:556" >"$at_check_line_file"
   160446 (test -z "$CONF_JAVA") \
   160447   && at_fn_check_skip 77 "$at_srcdir/java.at:556"
   160448 { set +x
   160449 $as_echo "$at_srcdir/java.at:556: \$SHELL ../../../javacomp.sh YYParser.java"
   160450 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:556"
   160451 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   160452 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160453 at_status=$? at_failed=false
   160454 $at_check_filter
   160455 echo stderr:; cat "$at_stderr"
   160456 echo stdout:; cat "$at_stdout"
   160457 at_fn_check_status 0 $at_status "$at_srcdir/java.at:556"
   160458 $at_failed && at_fn_log_failure
   160459 $at_traceon; }
   160460 
   160461 
   160462 { set +x
   160463 $as_echo "$at_srcdir/java.at:557: grep -c '^ *public YYParser (Lexer yylexer) {\$' YYParser.java"
   160464 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java" "java.at:557"
   160465 ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java
   160466 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160467 at_status=$? at_failed=false
   160468 $at_check_filter
   160469 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160470 echo >>"$at_stdout"; $as_echo "1
   160471 " | \
   160472   $at_diff - "$at_stdout" || at_failed=:
   160473 at_fn_check_status 0 $at_status "$at_srcdir/java.at:557"
   160474 $at_failed && at_fn_log_failure
   160475 $at_traceon; }
   160476 
   160477 
   160478 
   160479 
   160480 cat >YYParser.y <<'_ATEOF'
   160481 
   160482 %language "Java"
   160483 %locations
   160484 %debug
   160485 %error-verbose
   160486 %token-table
   160487 %parse-param {int parse_param1}
   160488 %%
   160489 start: "end" {};
   160490 %%
   160491 class Position {}
   160492 _ATEOF
   160493 
   160494 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   160495   at_save_special_files
   160496   mkdir xml-tests
   160497     # Don't combine these Bison invocations since we want to be sure that
   160498   # --report=all isn't required to get the full XML file.
   160499   { set +x
   160500 $as_echo "$at_srcdir/java.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   160501                   --graph=xml-tests/test.dot YYParser.y"
   160502 at_fn_check_prepare_notrace 'an embedded newline' "java.at:559"
   160503 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   160504                   --graph=xml-tests/test.dot YYParser.y
   160505 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160506 at_status=$? at_failed=false
   160507 $at_check_filter
   160508 echo stderr:; cat "$at_stderr"
   160509 echo stdout:; cat "$at_stdout"
   160510 at_fn_check_status 0 $at_status "$at_srcdir/java.at:559"
   160511 $at_failed && at_fn_log_failure
   160512 $at_traceon; }
   160513 
   160514   { set +x
   160515 $as_echo "$at_srcdir/java.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   160516 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:559"
   160517 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   160518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160519 at_status=$? at_failed=false
   160520 $at_check_filter
   160521 echo stderr:; cat "$at_stderr"
   160522 echo stdout:; cat "$at_stdout"
   160523 at_fn_check_status 0 $at_status "$at_srcdir/java.at:559"
   160524 $at_failed && at_fn_log_failure
   160525 $at_traceon; }
   160526 
   160527     cp xml-tests/test.output expout
   160528   { set +x
   160529 $as_echo "$at_srcdir/java.at:559: \$XSLTPROC \\
   160530              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   160531              xml-tests/test.xml"
   160532 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:559"
   160533 ( $at_check_trace; $XSLTPROC \
   160534              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   160535              xml-tests/test.xml
   160536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160537 at_status=$? at_failed=false
   160538 $at_check_filter
   160539 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160540 $at_diff expout "$at_stdout" || at_failed=:
   160541 at_fn_check_status 0 $at_status "$at_srcdir/java.at:559"
   160542 $at_failed && at_fn_log_failure
   160543 $at_traceon; }
   160544 
   160545   sort xml-tests/test.dot > expout
   160546   { set +x
   160547 $as_echo "$at_srcdir/java.at:559: \$XSLTPROC \\
   160548              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   160549              xml-tests/test.xml | sort"
   160550 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:559"
   160551 ( $at_check_trace; $XSLTPROC \
   160552              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   160553              xml-tests/test.xml | sort
   160554 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160555 at_status=$? at_failed=false
   160556 $at_check_filter
   160557 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160558 $at_diff expout "$at_stdout" || at_failed=:
   160559 at_fn_check_status 0 $at_status "$at_srcdir/java.at:559"
   160560 $at_failed && at_fn_log_failure
   160561 $at_traceon; }
   160562 
   160563   rm -rf xml-tests expout
   160564   at_restore_special_files
   160565 fi
   160566 { set +x
   160567 $as_echo "$at_srcdir/java.at:559: bison YYParser.y"
   160568 at_fn_check_prepare_trace "java.at:559"
   160569 ( $at_check_trace; bison YYParser.y
   160570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160571 at_status=$? at_failed=false
   160572 $at_check_filter
   160573 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160574 at_fn_diff_devnull "$at_stdout" || at_failed=:
   160575 at_fn_check_status 0 $at_status "$at_srcdir/java.at:559"
   160576 $at_failed && at_fn_log_failure
   160577 $at_traceon; }
   160578 
   160579 
   160580 { set +x
   160581 $as_echo "$at_srcdir/java.at:559: grep '[mb]4_' YYParser.y"
   160582 at_fn_check_prepare_trace "java.at:559"
   160583 ( $at_check_trace; grep '[mb]4_' YYParser.y
   160584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160585 at_status=$? at_failed=false
   160586 $at_check_filter
   160587 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160588 echo stdout:; cat "$at_stdout"
   160589 at_fn_check_status 1 $at_status "$at_srcdir/java.at:559"
   160590 $at_failed && at_fn_log_failure
   160591 $at_traceon; }
   160592 
   160593 
   160594 $as_echo "java.at:559" >"$at_check_line_file"
   160595 (test -z "$CONF_JAVAC") \
   160596   && at_fn_check_skip 77 "$at_srcdir/java.at:559"
   160597 $as_echo "java.at:559" >"$at_check_line_file"
   160598 (test -z "$CONF_JAVA") \
   160599   && at_fn_check_skip 77 "$at_srcdir/java.at:559"
   160600 { set +x
   160601 $as_echo "$at_srcdir/java.at:559: \$SHELL ../../../javacomp.sh YYParser.java"
   160602 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:559"
   160603 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   160604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160605 at_status=$? at_failed=false
   160606 $at_check_filter
   160607 echo stderr:; cat "$at_stderr"
   160608 echo stdout:; cat "$at_stdout"
   160609 at_fn_check_status 0 $at_status "$at_srcdir/java.at:559"
   160610 $at_failed && at_fn_log_failure
   160611 $at_traceon; }
   160612 
   160613 
   160614 { set +x
   160615 $as_echo "$at_srcdir/java.at:560: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
   160616 at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:560"
   160617 ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
   160618 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160619 at_status=$? at_failed=false
   160620 $at_check_filter
   160621 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160622 echo >>"$at_stdout"; $as_echo "1
   160623 " | \
   160624   $at_diff - "$at_stdout" || at_failed=:
   160625 at_fn_check_status 0 $at_status "$at_srcdir/java.at:560"
   160626 $at_failed && at_fn_log_failure
   160627 $at_traceon; }
   160628 
   160629 
   160630 { set +x
   160631 $as_echo "$at_srcdir/java.at:561: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {\$' YYParser.java"
   160632 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java" "java.at:561"
   160633 ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java
   160634 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160635 at_status=$? at_failed=false
   160636 $at_check_filter
   160637 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160638 echo >>"$at_stdout"; $as_echo "1
   160639 " | \
   160640   $at_diff - "$at_stdout" || at_failed=:
   160641 at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
   160642 $at_failed && at_fn_log_failure
   160643 $at_traceon; }
   160644 
   160645 
   160646 { set +x
   160647 $as_echo "$at_srcdir/java.at:562: grep -c '^[	 ]*this.parse_param1 = parse_param1;\$' YYParser.java"
   160648 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:562"
   160649 ( $at_check_trace; grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java
   160650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160651 at_status=$? at_failed=false
   160652 $at_check_filter
   160653 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160654 echo >>"$at_stdout"; $as_echo "1
   160655 " | \
   160656   $at_diff - "$at_stdout" || at_failed=:
   160657 at_fn_check_status 0 $at_status "$at_srcdir/java.at:562"
   160658 $at_failed && at_fn_log_failure
   160659 $at_traceon; }
   160660 
   160661 
   160662 
   160663 
   160664 cat >YYParser.y <<'_ATEOF'
   160665 
   160666 %language "Java"
   160667 %locations
   160668 %debug
   160669 %error-verbose
   160670 %token-table
   160671 
   160672 %parse-param {int parse_param1}
   160673 %parse-param {long parse_param2}
   160674 %%
   160675 start: "end" {};
   160676 %%
   160677 class Position {}
   160678 _ATEOF
   160679 
   160680 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   160681   at_save_special_files
   160682   mkdir xml-tests
   160683     # Don't combine these Bison invocations since we want to be sure that
   160684   # --report=all isn't required to get the full XML file.
   160685   { set +x
   160686 $as_echo "$at_srcdir/java.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   160687                   --graph=xml-tests/test.dot YYParser.y"
   160688 at_fn_check_prepare_notrace 'an embedded newline' "java.at:564"
   160689 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   160690                   --graph=xml-tests/test.dot YYParser.y
   160691 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160692 at_status=$? at_failed=false
   160693 $at_check_filter
   160694 echo stderr:; cat "$at_stderr"
   160695 echo stdout:; cat "$at_stdout"
   160696 at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
   160697 $at_failed && at_fn_log_failure
   160698 $at_traceon; }
   160699 
   160700   { set +x
   160701 $as_echo "$at_srcdir/java.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   160702 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:564"
   160703 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   160704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160705 at_status=$? at_failed=false
   160706 $at_check_filter
   160707 echo stderr:; cat "$at_stderr"
   160708 echo stdout:; cat "$at_stdout"
   160709 at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
   160710 $at_failed && at_fn_log_failure
   160711 $at_traceon; }
   160712 
   160713     cp xml-tests/test.output expout
   160714   { set +x
   160715 $as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\
   160716              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   160717              xml-tests/test.xml"
   160718 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564"
   160719 ( $at_check_trace; $XSLTPROC \
   160720              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   160721              xml-tests/test.xml
   160722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160723 at_status=$? at_failed=false
   160724 $at_check_filter
   160725 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160726 $at_diff expout "$at_stdout" || at_failed=:
   160727 at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
   160728 $at_failed && at_fn_log_failure
   160729 $at_traceon; }
   160730 
   160731   sort xml-tests/test.dot > expout
   160732   { set +x
   160733 $as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\
   160734              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   160735              xml-tests/test.xml | sort"
   160736 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564"
   160737 ( $at_check_trace; $XSLTPROC \
   160738              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   160739              xml-tests/test.xml | sort
   160740 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160741 at_status=$? at_failed=false
   160742 $at_check_filter
   160743 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160744 $at_diff expout "$at_stdout" || at_failed=:
   160745 at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
   160746 $at_failed && at_fn_log_failure
   160747 $at_traceon; }
   160748 
   160749   rm -rf xml-tests expout
   160750   at_restore_special_files
   160751 fi
   160752 { set +x
   160753 $as_echo "$at_srcdir/java.at:564: bison YYParser.y"
   160754 at_fn_check_prepare_trace "java.at:564"
   160755 ( $at_check_trace; bison YYParser.y
   160756 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160757 at_status=$? at_failed=false
   160758 $at_check_filter
   160759 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160760 at_fn_diff_devnull "$at_stdout" || at_failed=:
   160761 at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
   160762 $at_failed && at_fn_log_failure
   160763 $at_traceon; }
   160764 
   160765 
   160766 { set +x
   160767 $as_echo "$at_srcdir/java.at:564: grep '[mb]4_' YYParser.y"
   160768 at_fn_check_prepare_trace "java.at:564"
   160769 ( $at_check_trace; grep '[mb]4_' YYParser.y
   160770 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160771 at_status=$? at_failed=false
   160772 $at_check_filter
   160773 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160774 echo stdout:; cat "$at_stdout"
   160775 at_fn_check_status 1 $at_status "$at_srcdir/java.at:564"
   160776 $at_failed && at_fn_log_failure
   160777 $at_traceon; }
   160778 
   160779 
   160780 $as_echo "java.at:564" >"$at_check_line_file"
   160781 (test -z "$CONF_JAVAC") \
   160782   && at_fn_check_skip 77 "$at_srcdir/java.at:564"
   160783 $as_echo "java.at:564" >"$at_check_line_file"
   160784 (test -z "$CONF_JAVA") \
   160785   && at_fn_check_skip 77 "$at_srcdir/java.at:564"
   160786 { set +x
   160787 $as_echo "$at_srcdir/java.at:564: \$SHELL ../../../javacomp.sh YYParser.java"
   160788 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:564"
   160789 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   160790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160791 at_status=$? at_failed=false
   160792 $at_check_filter
   160793 echo stderr:; cat "$at_stderr"
   160794 echo stdout:; cat "$at_stdout"
   160795 at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
   160796 $at_failed && at_fn_log_failure
   160797 $at_traceon; }
   160798 
   160799 
   160800 { set +x
   160801 $as_echo "$at_srcdir/java.at:567: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
   160802 at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:567"
   160803 ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
   160804 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160805 at_status=$? at_failed=false
   160806 $at_check_filter
   160807 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160808 echo >>"$at_stdout"; $as_echo "1
   160809 " | \
   160810   $at_diff - "$at_stdout" || at_failed=:
   160811 at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
   160812 $at_failed && at_fn_log_failure
   160813 $at_traceon; }
   160814 
   160815 
   160816 { set +x
   160817 $as_echo "$at_srcdir/java.at:568: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
   160818 at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:568"
   160819 ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java
   160820 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160821 at_status=$? at_failed=false
   160822 $at_check_filter
   160823 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160824 echo >>"$at_stdout"; $as_echo "1
   160825 " | \
   160826   $at_diff - "$at_stdout" || at_failed=:
   160827 at_fn_check_status 0 $at_status "$at_srcdir/java.at:568"
   160828 $at_failed && at_fn_log_failure
   160829 $at_traceon; }
   160830 
   160831 
   160832 { set +x
   160833 $as_echo "$at_srcdir/java.at:569: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java"
   160834 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:569"
   160835 ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java
   160836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160837 at_status=$? at_failed=false
   160838 $at_check_filter
   160839 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160840 echo >>"$at_stdout"; $as_echo "1
   160841 " | \
   160842   $at_diff - "$at_stdout" || at_failed=:
   160843 at_fn_check_status 0 $at_status "$at_srcdir/java.at:569"
   160844 $at_failed && at_fn_log_failure
   160845 $at_traceon; }
   160846 
   160847 
   160848 { set +x
   160849 $as_echo "$at_srcdir/java.at:570: grep -c '^[	 ]*this.parse_param1 = parse_param1;\$' YYParser.java"
   160850 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:570"
   160851 ( $at_check_trace; grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java
   160852 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160853 at_status=$? at_failed=false
   160854 $at_check_filter
   160855 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160856 echo >>"$at_stdout"; $as_echo "1
   160857 " | \
   160858   $at_diff - "$at_stdout" || at_failed=:
   160859 at_fn_check_status 0 $at_status "$at_srcdir/java.at:570"
   160860 $at_failed && at_fn_log_failure
   160861 $at_traceon; }
   160862 
   160863 
   160864 { set +x
   160865 $as_echo "$at_srcdir/java.at:571: grep -c '^[	 ]*this.parse_param2 = parse_param2;\$' YYParser.java"
   160866 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:571"
   160867 ( $at_check_trace; grep -c '^[	 ]*this.parse_param2 = parse_param2;$' YYParser.java
   160868 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160869 at_status=$? at_failed=false
   160870 $at_check_filter
   160871 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160872 echo >>"$at_stdout"; $as_echo "1
   160873 " | \
   160874   $at_diff - "$at_stdout" || at_failed=:
   160875 at_fn_check_status 0 $at_status "$at_srcdir/java.at:571"
   160876 $at_failed && at_fn_log_failure
   160877 $at_traceon; }
   160878 
   160879 
   160880 
   160881 
   160882 cat >YYParser.y <<'_ATEOF'
   160883 
   160884 %language "Java"
   160885 %locations
   160886 %debug
   160887 %error-verbose
   160888 %token-table
   160889 
   160890 
   160891 %code lexer
   160892 {
   160893   Object yylval;
   160894   public Object getLVal() { return yylval; }
   160895 
   160896   public Position getStartPos() { return null; }
   160897   public Position getEndPos()   { return null; }
   160898 
   160899   public void yyerror (Location loc, String s)
   160900   {
   160901     System.err.println (loc + ": " + s);
   160902   }
   160903 
   160904   public int yylex ()
   160905   {
   160906     return EOF;
   160907   }
   160908 
   160909 
   160910 }
   160911 %%
   160912 start: "end" {};
   160913 %%
   160914 class Position {}
   160915 _ATEOF
   160916 
   160917 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   160918   at_save_special_files
   160919   mkdir xml-tests
   160920     # Don't combine these Bison invocations since we want to be sure that
   160921   # --report=all isn't required to get the full XML file.
   160922   { set +x
   160923 $as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   160924                   --graph=xml-tests/test.dot YYParser.y"
   160925 at_fn_check_prepare_notrace 'an embedded newline' "java.at:573"
   160926 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   160927                   --graph=xml-tests/test.dot YYParser.y
   160928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160929 at_status=$? at_failed=false
   160930 $at_check_filter
   160931 echo stderr:; cat "$at_stderr"
   160932 echo stdout:; cat "$at_stdout"
   160933 at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
   160934 $at_failed && at_fn_log_failure
   160935 $at_traceon; }
   160936 
   160937   { set +x
   160938 $as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   160939 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:573"
   160940 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   160941 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160942 at_status=$? at_failed=false
   160943 $at_check_filter
   160944 echo stderr:; cat "$at_stderr"
   160945 echo stdout:; cat "$at_stdout"
   160946 at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
   160947 $at_failed && at_fn_log_failure
   160948 $at_traceon; }
   160949 
   160950     cp xml-tests/test.output expout
   160951   { set +x
   160952 $as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\
   160953              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   160954              xml-tests/test.xml"
   160955 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573"
   160956 ( $at_check_trace; $XSLTPROC \
   160957              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   160958              xml-tests/test.xml
   160959 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160960 at_status=$? at_failed=false
   160961 $at_check_filter
   160962 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160963 $at_diff expout "$at_stdout" || at_failed=:
   160964 at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
   160965 $at_failed && at_fn_log_failure
   160966 $at_traceon; }
   160967 
   160968   sort xml-tests/test.dot > expout
   160969   { set +x
   160970 $as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\
   160971              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   160972              xml-tests/test.xml | sort"
   160973 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573"
   160974 ( $at_check_trace; $XSLTPROC \
   160975              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   160976              xml-tests/test.xml | sort
   160977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160978 at_status=$? at_failed=false
   160979 $at_check_filter
   160980 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160981 $at_diff expout "$at_stdout" || at_failed=:
   160982 at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
   160983 $at_failed && at_fn_log_failure
   160984 $at_traceon; }
   160985 
   160986   rm -rf xml-tests expout
   160987   at_restore_special_files
   160988 fi
   160989 { set +x
   160990 $as_echo "$at_srcdir/java.at:573: bison YYParser.y"
   160991 at_fn_check_prepare_trace "java.at:573"
   160992 ( $at_check_trace; bison YYParser.y
   160993 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   160994 at_status=$? at_failed=false
   160995 $at_check_filter
   160996 at_fn_diff_devnull "$at_stderr" || at_failed=:
   160997 at_fn_diff_devnull "$at_stdout" || at_failed=:
   160998 at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
   160999 $at_failed && at_fn_log_failure
   161000 $at_traceon; }
   161001 
   161002 
   161003 { set +x
   161004 $as_echo "$at_srcdir/java.at:573: grep '[mb]4_' YYParser.y"
   161005 at_fn_check_prepare_trace "java.at:573"
   161006 ( $at_check_trace; grep '[mb]4_' YYParser.y
   161007 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161008 at_status=$? at_failed=false
   161009 $at_check_filter
   161010 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161011 echo stdout:; cat "$at_stdout"
   161012 at_fn_check_status 1 $at_status "$at_srcdir/java.at:573"
   161013 $at_failed && at_fn_log_failure
   161014 $at_traceon; }
   161015 
   161016 
   161017 $as_echo "java.at:573" >"$at_check_line_file"
   161018 (test -z "$CONF_JAVAC") \
   161019   && at_fn_check_skip 77 "$at_srcdir/java.at:573"
   161020 $as_echo "java.at:573" >"$at_check_line_file"
   161021 (test -z "$CONF_JAVA") \
   161022   && at_fn_check_skip 77 "$at_srcdir/java.at:573"
   161023 { set +x
   161024 $as_echo "$at_srcdir/java.at:573: \$SHELL ../../../javacomp.sh YYParser.java"
   161025 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:573"
   161026 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   161027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161028 at_status=$? at_failed=false
   161029 $at_check_filter
   161030 echo stderr:; cat "$at_stderr"
   161031 echo stdout:; cat "$at_stdout"
   161032 at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
   161033 $at_failed && at_fn_log_failure
   161034 $at_traceon; }
   161035 
   161036 
   161037 { set +x
   161038 $as_echo "$at_srcdir/java.at:574: grep -c '^ *public YYParser () {\$' YYParser.java"
   161039 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () {$' YYParser.java" "java.at:574"
   161040 ( $at_check_trace; grep -c '^ *public YYParser () {$' YYParser.java
   161041 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161042 at_status=$? at_failed=false
   161043 $at_check_filter
   161044 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161045 echo >>"$at_stdout"; $as_echo "1
   161046 " | \
   161047   $at_diff - "$at_stdout" || at_failed=:
   161048 at_fn_check_status 0 $at_status "$at_srcdir/java.at:574"
   161049 $at_failed && at_fn_log_failure
   161050 $at_traceon; }
   161051 
   161052 
   161053 { set +x
   161054 $as_echo "$at_srcdir/java.at:575: grep -c '^ *protected YYParser (Lexer yylexer) {\$' YYParser.java"
   161055 at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java" "java.at:575"
   161056 ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java
   161057 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161058 at_status=$? at_failed=false
   161059 $at_check_filter
   161060 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161061 echo >>"$at_stdout"; $as_echo "1
   161062 " | \
   161063   $at_diff - "$at_stdout" || at_failed=:
   161064 at_fn_check_status 0 $at_status "$at_srcdir/java.at:575"
   161065 $at_failed && at_fn_log_failure
   161066 $at_traceon; }
   161067 
   161068 
   161069 
   161070 
   161071 cat >YYParser.y <<'_ATEOF'
   161072 
   161073 %language "Java"
   161074 %locations
   161075 %debug
   161076 %error-verbose
   161077 %token-table
   161078 %parse-param {int parse_param1}
   161079 
   161080 %code lexer
   161081 {
   161082   Object yylval;
   161083   public Object getLVal() { return yylval; }
   161084 
   161085   public Position getStartPos() { return null; }
   161086   public Position getEndPos()   { return null; }
   161087 
   161088   public void yyerror (Location loc, String s)
   161089   {
   161090     System.err.println (loc + ": " + s);
   161091   }
   161092 
   161093   public int yylex ()
   161094   {
   161095     return EOF;
   161096   }
   161097 
   161098 
   161099 }
   161100 %%
   161101 start: "end" {};
   161102 %%
   161103 class Position {}
   161104 _ATEOF
   161105 
   161106 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   161107   at_save_special_files
   161108   mkdir xml-tests
   161109     # Don't combine these Bison invocations since we want to be sure that
   161110   # --report=all isn't required to get the full XML file.
   161111   { set +x
   161112 $as_echo "$at_srcdir/java.at:577: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   161113                   --graph=xml-tests/test.dot YYParser.y"
   161114 at_fn_check_prepare_notrace 'an embedded newline' "java.at:577"
   161115 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   161116                   --graph=xml-tests/test.dot YYParser.y
   161117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161118 at_status=$? at_failed=false
   161119 $at_check_filter
   161120 echo stderr:; cat "$at_stderr"
   161121 echo stdout:; cat "$at_stdout"
   161122 at_fn_check_status 0 $at_status "$at_srcdir/java.at:577"
   161123 $at_failed && at_fn_log_failure
   161124 $at_traceon; }
   161125 
   161126   { set +x
   161127 $as_echo "$at_srcdir/java.at:577: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   161128 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:577"
   161129 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   161130 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161131 at_status=$? at_failed=false
   161132 $at_check_filter
   161133 echo stderr:; cat "$at_stderr"
   161134 echo stdout:; cat "$at_stdout"
   161135 at_fn_check_status 0 $at_status "$at_srcdir/java.at:577"
   161136 $at_failed && at_fn_log_failure
   161137 $at_traceon; }
   161138 
   161139     cp xml-tests/test.output expout
   161140   { set +x
   161141 $as_echo "$at_srcdir/java.at:577: \$XSLTPROC \\
   161142              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   161143              xml-tests/test.xml"
   161144 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:577"
   161145 ( $at_check_trace; $XSLTPROC \
   161146              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   161147              xml-tests/test.xml
   161148 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161149 at_status=$? at_failed=false
   161150 $at_check_filter
   161151 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161152 $at_diff expout "$at_stdout" || at_failed=:
   161153 at_fn_check_status 0 $at_status "$at_srcdir/java.at:577"
   161154 $at_failed && at_fn_log_failure
   161155 $at_traceon; }
   161156 
   161157   sort xml-tests/test.dot > expout
   161158   { set +x
   161159 $as_echo "$at_srcdir/java.at:577: \$XSLTPROC \\
   161160              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   161161              xml-tests/test.xml | sort"
   161162 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:577"
   161163 ( $at_check_trace; $XSLTPROC \
   161164              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   161165              xml-tests/test.xml | sort
   161166 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161167 at_status=$? at_failed=false
   161168 $at_check_filter
   161169 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161170 $at_diff expout "$at_stdout" || at_failed=:
   161171 at_fn_check_status 0 $at_status "$at_srcdir/java.at:577"
   161172 $at_failed && at_fn_log_failure
   161173 $at_traceon; }
   161174 
   161175   rm -rf xml-tests expout
   161176   at_restore_special_files
   161177 fi
   161178 { set +x
   161179 $as_echo "$at_srcdir/java.at:577: bison YYParser.y"
   161180 at_fn_check_prepare_trace "java.at:577"
   161181 ( $at_check_trace; bison YYParser.y
   161182 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161183 at_status=$? at_failed=false
   161184 $at_check_filter
   161185 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161186 at_fn_diff_devnull "$at_stdout" || at_failed=:
   161187 at_fn_check_status 0 $at_status "$at_srcdir/java.at:577"
   161188 $at_failed && at_fn_log_failure
   161189 $at_traceon; }
   161190 
   161191 
   161192 { set +x
   161193 $as_echo "$at_srcdir/java.at:577: grep '[mb]4_' YYParser.y"
   161194 at_fn_check_prepare_trace "java.at:577"
   161195 ( $at_check_trace; grep '[mb]4_' YYParser.y
   161196 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161197 at_status=$? at_failed=false
   161198 $at_check_filter
   161199 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161200 echo stdout:; cat "$at_stdout"
   161201 at_fn_check_status 1 $at_status "$at_srcdir/java.at:577"
   161202 $at_failed && at_fn_log_failure
   161203 $at_traceon; }
   161204 
   161205 
   161206 $as_echo "java.at:577" >"$at_check_line_file"
   161207 (test -z "$CONF_JAVAC") \
   161208   && at_fn_check_skip 77 "$at_srcdir/java.at:577"
   161209 $as_echo "java.at:577" >"$at_check_line_file"
   161210 (test -z "$CONF_JAVA") \
   161211   && at_fn_check_skip 77 "$at_srcdir/java.at:577"
   161212 { set +x
   161213 $as_echo "$at_srcdir/java.at:577: \$SHELL ../../../javacomp.sh YYParser.java"
   161214 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:577"
   161215 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   161216 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161217 at_status=$? at_failed=false
   161218 $at_check_filter
   161219 echo stderr:; cat "$at_stderr"
   161220 echo stdout:; cat "$at_stdout"
   161221 at_fn_check_status 0 $at_status "$at_srcdir/java.at:577"
   161222 $at_failed && at_fn_log_failure
   161223 $at_traceon; }
   161224 
   161225 
   161226 { set +x
   161227 $as_echo "$at_srcdir/java.at:579: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
   161228 at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:579"
   161229 ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
   161230 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161231 at_status=$? at_failed=false
   161232 $at_check_filter
   161233 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161234 echo >>"$at_stdout"; $as_echo "1
   161235 " | \
   161236   $at_diff - "$at_stdout" || at_failed=:
   161237 at_fn_check_status 0 $at_status "$at_srcdir/java.at:579"
   161238 $at_failed && at_fn_log_failure
   161239 $at_traceon; }
   161240 
   161241 
   161242 { set +x
   161243 $as_echo "$at_srcdir/java.at:580: grep -c '^ *public YYParser (int parse_param1) {\$' YYParser.java"
   161244 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java" "java.at:580"
   161245 ( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java
   161246 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161247 at_status=$? at_failed=false
   161248 $at_check_filter
   161249 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161250 echo >>"$at_stdout"; $as_echo "1
   161251 " | \
   161252   $at_diff - "$at_stdout" || at_failed=:
   161253 at_fn_check_status 0 $at_status "$at_srcdir/java.at:580"
   161254 $at_failed && at_fn_log_failure
   161255 $at_traceon; }
   161256 
   161257 
   161258 { set +x
   161259 $as_echo "$at_srcdir/java.at:581: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {\$' YYParser.java"
   161260 at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java" "java.at:581"
   161261 ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java
   161262 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161263 at_status=$? at_failed=false
   161264 $at_check_filter
   161265 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161266 echo >>"$at_stdout"; $as_echo "1
   161267 " | \
   161268   $at_diff - "$at_stdout" || at_failed=:
   161269 at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
   161270 $at_failed && at_fn_log_failure
   161271 $at_traceon; }
   161272 
   161273 
   161274 { set +x
   161275 $as_echo "$at_srcdir/java.at:582: grep -c '^[	 ]*this.parse_param1 = parse_param1;\$' YYParser.java"
   161276 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:582"
   161277 ( $at_check_trace; grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java
   161278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161279 at_status=$? at_failed=false
   161280 $at_check_filter
   161281 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161282 echo >>"$at_stdout"; $as_echo "2
   161283 " | \
   161284   $at_diff - "$at_stdout" || at_failed=:
   161285 at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
   161286 $at_failed && at_fn_log_failure
   161287 $at_traceon; }
   161288 
   161289 
   161290 
   161291 
   161292 cat >YYParser.y <<'_ATEOF'
   161293 
   161294 %language "Java"
   161295 %locations
   161296 %debug
   161297 %error-verbose
   161298 %token-table
   161299 
   161300 %parse-param {int parse_param1}
   161301 %parse-param {long parse_param2}
   161302 
   161303 %code lexer
   161304 {
   161305   Object yylval;
   161306   public Object getLVal() { return yylval; }
   161307 
   161308   public Position getStartPos() { return null; }
   161309   public Position getEndPos()   { return null; }
   161310 
   161311   public void yyerror (Location loc, String s)
   161312   {
   161313     System.err.println (loc + ": " + s);
   161314   }
   161315 
   161316   public int yylex ()
   161317   {
   161318     return EOF;
   161319   }
   161320 
   161321 
   161322 }
   161323 %%
   161324 start: "end" {};
   161325 %%
   161326 class Position {}
   161327 _ATEOF
   161328 
   161329 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   161330   at_save_special_files
   161331   mkdir xml-tests
   161332     # Don't combine these Bison invocations since we want to be sure that
   161333   # --report=all isn't required to get the full XML file.
   161334   { set +x
   161335 $as_echo "$at_srcdir/java.at:584: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   161336                   --graph=xml-tests/test.dot YYParser.y"
   161337 at_fn_check_prepare_notrace 'an embedded newline' "java.at:584"
   161338 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   161339                   --graph=xml-tests/test.dot YYParser.y
   161340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161341 at_status=$? at_failed=false
   161342 $at_check_filter
   161343 echo stderr:; cat "$at_stderr"
   161344 echo stdout:; cat "$at_stdout"
   161345 at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
   161346 $at_failed && at_fn_log_failure
   161347 $at_traceon; }
   161348 
   161349   { set +x
   161350 $as_echo "$at_srcdir/java.at:584: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   161351 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:584"
   161352 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   161353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161354 at_status=$? at_failed=false
   161355 $at_check_filter
   161356 echo stderr:; cat "$at_stderr"
   161357 echo stdout:; cat "$at_stdout"
   161358 at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
   161359 $at_failed && at_fn_log_failure
   161360 $at_traceon; }
   161361 
   161362     cp xml-tests/test.output expout
   161363   { set +x
   161364 $as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\
   161365              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   161366              xml-tests/test.xml"
   161367 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584"
   161368 ( $at_check_trace; $XSLTPROC \
   161369              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   161370              xml-tests/test.xml
   161371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161372 at_status=$? at_failed=false
   161373 $at_check_filter
   161374 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161375 $at_diff expout "$at_stdout" || at_failed=:
   161376 at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
   161377 $at_failed && at_fn_log_failure
   161378 $at_traceon; }
   161379 
   161380   sort xml-tests/test.dot > expout
   161381   { set +x
   161382 $as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\
   161383              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   161384              xml-tests/test.xml | sort"
   161385 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584"
   161386 ( $at_check_trace; $XSLTPROC \
   161387              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   161388              xml-tests/test.xml | sort
   161389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161390 at_status=$? at_failed=false
   161391 $at_check_filter
   161392 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161393 $at_diff expout "$at_stdout" || at_failed=:
   161394 at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
   161395 $at_failed && at_fn_log_failure
   161396 $at_traceon; }
   161397 
   161398   rm -rf xml-tests expout
   161399   at_restore_special_files
   161400 fi
   161401 { set +x
   161402 $as_echo "$at_srcdir/java.at:584: bison YYParser.y"
   161403 at_fn_check_prepare_trace "java.at:584"
   161404 ( $at_check_trace; bison YYParser.y
   161405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161406 at_status=$? at_failed=false
   161407 $at_check_filter
   161408 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161409 at_fn_diff_devnull "$at_stdout" || at_failed=:
   161410 at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
   161411 $at_failed && at_fn_log_failure
   161412 $at_traceon; }
   161413 
   161414 
   161415 { set +x
   161416 $as_echo "$at_srcdir/java.at:584: grep '[mb]4_' YYParser.y"
   161417 at_fn_check_prepare_trace "java.at:584"
   161418 ( $at_check_trace; grep '[mb]4_' YYParser.y
   161419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161420 at_status=$? at_failed=false
   161421 $at_check_filter
   161422 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161423 echo stdout:; cat "$at_stdout"
   161424 at_fn_check_status 1 $at_status "$at_srcdir/java.at:584"
   161425 $at_failed && at_fn_log_failure
   161426 $at_traceon; }
   161427 
   161428 
   161429 $as_echo "java.at:584" >"$at_check_line_file"
   161430 (test -z "$CONF_JAVAC") \
   161431   && at_fn_check_skip 77 "$at_srcdir/java.at:584"
   161432 $as_echo "java.at:584" >"$at_check_line_file"
   161433 (test -z "$CONF_JAVA") \
   161434   && at_fn_check_skip 77 "$at_srcdir/java.at:584"
   161435 { set +x
   161436 $as_echo "$at_srcdir/java.at:584: \$SHELL ../../../javacomp.sh YYParser.java"
   161437 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:584"
   161438 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   161439 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161440 at_status=$? at_failed=false
   161441 $at_check_filter
   161442 echo stderr:; cat "$at_stderr"
   161443 echo stdout:; cat "$at_stdout"
   161444 at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
   161445 $at_failed && at_fn_log_failure
   161446 $at_traceon; }
   161447 
   161448 
   161449 { set +x
   161450 $as_echo "$at_srcdir/java.at:588: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
   161451 at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:588"
   161452 ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
   161453 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161454 at_status=$? at_failed=false
   161455 $at_check_filter
   161456 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161457 echo >>"$at_stdout"; $as_echo "1
   161458 " | \
   161459   $at_diff - "$at_stdout" || at_failed=:
   161460 at_fn_check_status 0 $at_status "$at_srcdir/java.at:588"
   161461 $at_failed && at_fn_log_failure
   161462 $at_traceon; }
   161463 
   161464 
   161465 { set +x
   161466 $as_echo "$at_srcdir/java.at:589: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
   161467 at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:589"
   161468 ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java
   161469 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161470 at_status=$? at_failed=false
   161471 $at_check_filter
   161472 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161473 echo >>"$at_stdout"; $as_echo "1
   161474 " | \
   161475   $at_diff - "$at_stdout" || at_failed=:
   161476 at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
   161477 $at_failed && at_fn_log_failure
   161478 $at_traceon; }
   161479 
   161480 
   161481 { set +x
   161482 $as_echo "$at_srcdir/java.at:590: grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {\$' YYParser.java"
   161483 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:590"
   161484 ( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java
   161485 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161486 at_status=$? at_failed=false
   161487 $at_check_filter
   161488 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161489 echo >>"$at_stdout"; $as_echo "1
   161490 " | \
   161491   $at_diff - "$at_stdout" || at_failed=:
   161492 at_fn_check_status 0 $at_status "$at_srcdir/java.at:590"
   161493 $at_failed && at_fn_log_failure
   161494 $at_traceon; }
   161495 
   161496 
   161497 { set +x
   161498 $as_echo "$at_srcdir/java.at:591: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java"
   161499 at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:591"
   161500 ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java
   161501 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161502 at_status=$? at_failed=false
   161503 $at_check_filter
   161504 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161505 echo >>"$at_stdout"; $as_echo "1
   161506 " | \
   161507   $at_diff - "$at_stdout" || at_failed=:
   161508 at_fn_check_status 0 $at_status "$at_srcdir/java.at:591"
   161509 $at_failed && at_fn_log_failure
   161510 $at_traceon; }
   161511 
   161512 
   161513 { set +x
   161514 $as_echo "$at_srcdir/java.at:592: grep -c '^[	 ]*this.parse_param1 = parse_param1;\$' YYParser.java"
   161515 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:592"
   161516 ( $at_check_trace; grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java
   161517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161518 at_status=$? at_failed=false
   161519 $at_check_filter
   161520 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161521 echo >>"$at_stdout"; $as_echo "2
   161522 " | \
   161523   $at_diff - "$at_stdout" || at_failed=:
   161524 at_fn_check_status 0 $at_status "$at_srcdir/java.at:592"
   161525 $at_failed && at_fn_log_failure
   161526 $at_traceon; }
   161527 
   161528 
   161529 { set +x
   161530 $as_echo "$at_srcdir/java.at:593: grep -c '^[	 ]*this.parse_param2 = parse_param2;\$' YYParser.java"
   161531 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:593"
   161532 ( $at_check_trace; grep -c '^[	 ]*this.parse_param2 = parse_param2;$' YYParser.java
   161533 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161534 at_status=$? at_failed=false
   161535 $at_check_filter
   161536 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161537 echo >>"$at_stdout"; $as_echo "2
   161538 " | \
   161539   $at_diff - "$at_stdout" || at_failed=:
   161540 at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
   161541 $at_failed && at_fn_log_failure
   161542 $at_traceon; }
   161543 
   161544 
   161545 
   161546 
   161547 cat >YYParser.y <<'_ATEOF'
   161548 
   161549 %language "Java"
   161550 %locations
   161551 %debug
   161552 %error-verbose
   161553 %token-table
   161554 %lex-param {char lex_param1}
   161555 
   161556 %code lexer
   161557 {
   161558   Object yylval;
   161559   public Object getLVal() { return yylval; }
   161560 
   161561   public Position getStartPos() { return null; }
   161562   public Position getEndPos()   { return null; }
   161563 
   161564   public void yyerror (Location loc, String s)
   161565   {
   161566     System.err.println (loc + ": " + s);
   161567   }
   161568 
   161569   public int yylex ()
   161570   {
   161571     return EOF;
   161572   }
   161573 
   161574   YYLexer (char lex_param1) {}
   161575 }
   161576 %%
   161577 start: "end" {};
   161578 %%
   161579 class Position {}
   161580 _ATEOF
   161581 
   161582 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   161583   at_save_special_files
   161584   mkdir xml-tests
   161585     # Don't combine these Bison invocations since we want to be sure that
   161586   # --report=all isn't required to get the full XML file.
   161587   { set +x
   161588 $as_echo "$at_srcdir/java.at:595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   161589                   --graph=xml-tests/test.dot YYParser.y"
   161590 at_fn_check_prepare_notrace 'an embedded newline' "java.at:595"
   161591 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   161592                   --graph=xml-tests/test.dot YYParser.y
   161593 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161594 at_status=$? at_failed=false
   161595 $at_check_filter
   161596 echo stderr:; cat "$at_stderr"
   161597 echo stdout:; cat "$at_stdout"
   161598 at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
   161599 $at_failed && at_fn_log_failure
   161600 $at_traceon; }
   161601 
   161602   { set +x
   161603 $as_echo "$at_srcdir/java.at:595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   161604 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:595"
   161605 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   161606 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161607 at_status=$? at_failed=false
   161608 $at_check_filter
   161609 echo stderr:; cat "$at_stderr"
   161610 echo stdout:; cat "$at_stdout"
   161611 at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
   161612 $at_failed && at_fn_log_failure
   161613 $at_traceon; }
   161614 
   161615     cp xml-tests/test.output expout
   161616   { set +x
   161617 $as_echo "$at_srcdir/java.at:595: \$XSLTPROC \\
   161618              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   161619              xml-tests/test.xml"
   161620 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:595"
   161621 ( $at_check_trace; $XSLTPROC \
   161622              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   161623              xml-tests/test.xml
   161624 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161625 at_status=$? at_failed=false
   161626 $at_check_filter
   161627 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161628 $at_diff expout "$at_stdout" || at_failed=:
   161629 at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
   161630 $at_failed && at_fn_log_failure
   161631 $at_traceon; }
   161632 
   161633   sort xml-tests/test.dot > expout
   161634   { set +x
   161635 $as_echo "$at_srcdir/java.at:595: \$XSLTPROC \\
   161636              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   161637              xml-tests/test.xml | sort"
   161638 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:595"
   161639 ( $at_check_trace; $XSLTPROC \
   161640              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   161641              xml-tests/test.xml | sort
   161642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161643 at_status=$? at_failed=false
   161644 $at_check_filter
   161645 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161646 $at_diff expout "$at_stdout" || at_failed=:
   161647 at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
   161648 $at_failed && at_fn_log_failure
   161649 $at_traceon; }
   161650 
   161651   rm -rf xml-tests expout
   161652   at_restore_special_files
   161653 fi
   161654 { set +x
   161655 $as_echo "$at_srcdir/java.at:595: bison YYParser.y"
   161656 at_fn_check_prepare_trace "java.at:595"
   161657 ( $at_check_trace; bison YYParser.y
   161658 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161659 at_status=$? at_failed=false
   161660 $at_check_filter
   161661 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161662 at_fn_diff_devnull "$at_stdout" || at_failed=:
   161663 at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
   161664 $at_failed && at_fn_log_failure
   161665 $at_traceon; }
   161666 
   161667 
   161668 { set +x
   161669 $as_echo "$at_srcdir/java.at:595: grep '[mb]4_' YYParser.y"
   161670 at_fn_check_prepare_trace "java.at:595"
   161671 ( $at_check_trace; grep '[mb]4_' YYParser.y
   161672 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161673 at_status=$? at_failed=false
   161674 $at_check_filter
   161675 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161676 echo stdout:; cat "$at_stdout"
   161677 at_fn_check_status 1 $at_status "$at_srcdir/java.at:595"
   161678 $at_failed && at_fn_log_failure
   161679 $at_traceon; }
   161680 
   161681 
   161682 $as_echo "java.at:595" >"$at_check_line_file"
   161683 (test -z "$CONF_JAVAC") \
   161684   && at_fn_check_skip 77 "$at_srcdir/java.at:595"
   161685 $as_echo "java.at:595" >"$at_check_line_file"
   161686 (test -z "$CONF_JAVA") \
   161687   && at_fn_check_skip 77 "$at_srcdir/java.at:595"
   161688 { set +x
   161689 $as_echo "$at_srcdir/java.at:595: \$SHELL ../../../javacomp.sh YYParser.java"
   161690 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:595"
   161691 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   161692 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161693 at_status=$? at_failed=false
   161694 $at_check_filter
   161695 echo stderr:; cat "$at_stderr"
   161696 echo stdout:; cat "$at_stdout"
   161697 at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
   161698 $at_failed && at_fn_log_failure
   161699 $at_traceon; }
   161700 
   161701 
   161702 { set +x
   161703 $as_echo "$at_srcdir/java.at:597: grep -c '^ *public YYParser (char lex_param1) {\$' YYParser.java"
   161704 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java" "java.at:597"
   161705 ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java
   161706 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161707 at_status=$? at_failed=false
   161708 $at_check_filter
   161709 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161710 echo >>"$at_stdout"; $as_echo "1
   161711 " | \
   161712   $at_diff - "$at_stdout" || at_failed=:
   161713 at_fn_check_status 0 $at_status "$at_srcdir/java.at:597"
   161714 $at_failed && at_fn_log_failure
   161715 $at_traceon; }
   161716 
   161717 
   161718 { set +x
   161719 $as_echo "$at_srcdir/java.at:598: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java"
   161720 at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:598"
   161721 ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java
   161722 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161723 at_status=$? at_failed=false
   161724 $at_check_filter
   161725 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161726 echo >>"$at_stdout"; $as_echo "1
   161727 " | \
   161728   $at_diff - "$at_stdout" || at_failed=:
   161729 at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
   161730 $at_failed && at_fn_log_failure
   161731 $at_traceon; }
   161732 
   161733 
   161734 
   161735 
   161736 cat >YYParser.y <<'_ATEOF'
   161737 
   161738 %language "Java"
   161739 %locations
   161740 %debug
   161741 %error-verbose
   161742 %token-table
   161743 
   161744 %lex-param {char lex_param1}
   161745 %lex-param {short lex_param2}
   161746 
   161747 %code lexer
   161748 {
   161749   Object yylval;
   161750   public Object getLVal() { return yylval; }
   161751 
   161752   public Position getStartPos() { return null; }
   161753   public Position getEndPos()   { return null; }
   161754 
   161755   public void yyerror (Location loc, String s)
   161756   {
   161757     System.err.println (loc + ": " + s);
   161758   }
   161759 
   161760   public int yylex ()
   161761   {
   161762     return EOF;
   161763   }
   161764 
   161765   YYLexer (char lex_param1, short lex_param2) {}
   161766 }
   161767 %%
   161768 start: "end" {};
   161769 %%
   161770 class Position {}
   161771 _ATEOF
   161772 
   161773 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   161774   at_save_special_files
   161775   mkdir xml-tests
   161776     # Don't combine these Bison invocations since we want to be sure that
   161777   # --report=all isn't required to get the full XML file.
   161778   { set +x
   161779 $as_echo "$at_srcdir/java.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   161780                   --graph=xml-tests/test.dot YYParser.y"
   161781 at_fn_check_prepare_notrace 'an embedded newline' "java.at:600"
   161782 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   161783                   --graph=xml-tests/test.dot YYParser.y
   161784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161785 at_status=$? at_failed=false
   161786 $at_check_filter
   161787 echo stderr:; cat "$at_stderr"
   161788 echo stdout:; cat "$at_stdout"
   161789 at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
   161790 $at_failed && at_fn_log_failure
   161791 $at_traceon; }
   161792 
   161793   { set +x
   161794 $as_echo "$at_srcdir/java.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   161795 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:600"
   161796 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   161797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161798 at_status=$? at_failed=false
   161799 $at_check_filter
   161800 echo stderr:; cat "$at_stderr"
   161801 echo stdout:; cat "$at_stdout"
   161802 at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
   161803 $at_failed && at_fn_log_failure
   161804 $at_traceon; }
   161805 
   161806     cp xml-tests/test.output expout
   161807   { set +x
   161808 $as_echo "$at_srcdir/java.at:600: \$XSLTPROC \\
   161809              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   161810              xml-tests/test.xml"
   161811 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:600"
   161812 ( $at_check_trace; $XSLTPROC \
   161813              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   161814              xml-tests/test.xml
   161815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161816 at_status=$? at_failed=false
   161817 $at_check_filter
   161818 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161819 $at_diff expout "$at_stdout" || at_failed=:
   161820 at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
   161821 $at_failed && at_fn_log_failure
   161822 $at_traceon; }
   161823 
   161824   sort xml-tests/test.dot > expout
   161825   { set +x
   161826 $as_echo "$at_srcdir/java.at:600: \$XSLTPROC \\
   161827              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   161828              xml-tests/test.xml | sort"
   161829 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:600"
   161830 ( $at_check_trace; $XSLTPROC \
   161831              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   161832              xml-tests/test.xml | sort
   161833 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161834 at_status=$? at_failed=false
   161835 $at_check_filter
   161836 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161837 $at_diff expout "$at_stdout" || at_failed=:
   161838 at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
   161839 $at_failed && at_fn_log_failure
   161840 $at_traceon; }
   161841 
   161842   rm -rf xml-tests expout
   161843   at_restore_special_files
   161844 fi
   161845 { set +x
   161846 $as_echo "$at_srcdir/java.at:600: bison YYParser.y"
   161847 at_fn_check_prepare_trace "java.at:600"
   161848 ( $at_check_trace; bison YYParser.y
   161849 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161850 at_status=$? at_failed=false
   161851 $at_check_filter
   161852 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161853 at_fn_diff_devnull "$at_stdout" || at_failed=:
   161854 at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
   161855 $at_failed && at_fn_log_failure
   161856 $at_traceon; }
   161857 
   161858 
   161859 { set +x
   161860 $as_echo "$at_srcdir/java.at:600: grep '[mb]4_' YYParser.y"
   161861 at_fn_check_prepare_trace "java.at:600"
   161862 ( $at_check_trace; grep '[mb]4_' YYParser.y
   161863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161864 at_status=$? at_failed=false
   161865 $at_check_filter
   161866 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161867 echo stdout:; cat "$at_stdout"
   161868 at_fn_check_status 1 $at_status "$at_srcdir/java.at:600"
   161869 $at_failed && at_fn_log_failure
   161870 $at_traceon; }
   161871 
   161872 
   161873 $as_echo "java.at:600" >"$at_check_line_file"
   161874 (test -z "$CONF_JAVAC") \
   161875   && at_fn_check_skip 77 "$at_srcdir/java.at:600"
   161876 $as_echo "java.at:600" >"$at_check_line_file"
   161877 (test -z "$CONF_JAVA") \
   161878   && at_fn_check_skip 77 "$at_srcdir/java.at:600"
   161879 { set +x
   161880 $as_echo "$at_srcdir/java.at:600: \$SHELL ../../../javacomp.sh YYParser.java"
   161881 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:600"
   161882 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   161883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161884 at_status=$? at_failed=false
   161885 $at_check_filter
   161886 echo stderr:; cat "$at_stderr"
   161887 echo stdout:; cat "$at_stdout"
   161888 at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
   161889 $at_failed && at_fn_log_failure
   161890 $at_traceon; }
   161891 
   161892 
   161893 { set +x
   161894 $as_echo "$at_srcdir/java.at:604: grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {\$' YYParser.java"
   161895 at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java" "java.at:604"
   161896 ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java
   161897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161898 at_status=$? at_failed=false
   161899 $at_check_filter
   161900 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161901 echo >>"$at_stdout"; $as_echo "1
   161902 " | \
   161903   $at_diff - "$at_stdout" || at_failed=:
   161904 at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
   161905 $at_failed && at_fn_log_failure
   161906 $at_traceon; }
   161907 
   161908 
   161909 { set +x
   161910 $as_echo "$at_srcdir/java.at:605: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java"
   161911 at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:605"
   161912 ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java
   161913 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161914 at_status=$? at_failed=false
   161915 $at_check_filter
   161916 at_fn_diff_devnull "$at_stderr" || at_failed=:
   161917 echo >>"$at_stdout"; $as_echo "1
   161918 " | \
   161919   $at_diff - "$at_stdout" || at_failed=:
   161920 at_fn_check_status 0 $at_status "$at_srcdir/java.at:605"
   161921 $at_failed && at_fn_log_failure
   161922 $at_traceon; }
   161923 
   161924 
   161925 
   161926 
   161927 cat >YYParser.y <<'_ATEOF'
   161928 
   161929 %language "Java"
   161930 %locations
   161931 %debug
   161932 %error-verbose
   161933 %token-table
   161934 
   161935 %parse-param {int parse_param1}
   161936 %parse-param {long parse_param2}
   161937 %lex-param {char lex_param1}
   161938 %lex-param {short lex_param2}
   161939 
   161940 %code lexer
   161941 {
   161942   Object yylval;
   161943   public Object getLVal() { return yylval; }
   161944 
   161945   public Position getStartPos() { return null; }
   161946   public Position getEndPos()   { return null; }
   161947 
   161948   public void yyerror (Location loc, String s)
   161949   {
   161950     System.err.println (loc + ": " + s);
   161951   }
   161952 
   161953   public int yylex ()
   161954   {
   161955     return EOF;
   161956   }
   161957 
   161958   YYLexer (char lex_param1, short lex_param2) {}
   161959 }
   161960 %%
   161961 start: "end" {};
   161962 %%
   161963 class Position {}
   161964 _ATEOF
   161965 
   161966 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   161967   at_save_special_files
   161968   mkdir xml-tests
   161969     # Don't combine these Bison invocations since we want to be sure that
   161970   # --report=all isn't required to get the full XML file.
   161971   { set +x
   161972 $as_echo "$at_srcdir/java.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   161973                   --graph=xml-tests/test.dot YYParser.y"
   161974 at_fn_check_prepare_notrace 'an embedded newline' "java.at:607"
   161975 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   161976                   --graph=xml-tests/test.dot YYParser.y
   161977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161978 at_status=$? at_failed=false
   161979 $at_check_filter
   161980 echo stderr:; cat "$at_stderr"
   161981 echo stdout:; cat "$at_stdout"
   161982 at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
   161983 $at_failed && at_fn_log_failure
   161984 $at_traceon; }
   161985 
   161986   { set +x
   161987 $as_echo "$at_srcdir/java.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   161988 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:607"
   161989 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   161990 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   161991 at_status=$? at_failed=false
   161992 $at_check_filter
   161993 echo stderr:; cat "$at_stderr"
   161994 echo stdout:; cat "$at_stdout"
   161995 at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
   161996 $at_failed && at_fn_log_failure
   161997 $at_traceon; }
   161998 
   161999     cp xml-tests/test.output expout
   162000   { set +x
   162001 $as_echo "$at_srcdir/java.at:607: \$XSLTPROC \\
   162002              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   162003              xml-tests/test.xml"
   162004 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:607"
   162005 ( $at_check_trace; $XSLTPROC \
   162006              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   162007              xml-tests/test.xml
   162008 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162009 at_status=$? at_failed=false
   162010 $at_check_filter
   162011 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162012 $at_diff expout "$at_stdout" || at_failed=:
   162013 at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
   162014 $at_failed && at_fn_log_failure
   162015 $at_traceon; }
   162016 
   162017   sort xml-tests/test.dot > expout
   162018   { set +x
   162019 $as_echo "$at_srcdir/java.at:607: \$XSLTPROC \\
   162020              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   162021              xml-tests/test.xml | sort"
   162022 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:607"
   162023 ( $at_check_trace; $XSLTPROC \
   162024              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   162025              xml-tests/test.xml | sort
   162026 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162027 at_status=$? at_failed=false
   162028 $at_check_filter
   162029 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162030 $at_diff expout "$at_stdout" || at_failed=:
   162031 at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
   162032 $at_failed && at_fn_log_failure
   162033 $at_traceon; }
   162034 
   162035   rm -rf xml-tests expout
   162036   at_restore_special_files
   162037 fi
   162038 { set +x
   162039 $as_echo "$at_srcdir/java.at:607: bison YYParser.y"
   162040 at_fn_check_prepare_trace "java.at:607"
   162041 ( $at_check_trace; bison YYParser.y
   162042 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162043 at_status=$? at_failed=false
   162044 $at_check_filter
   162045 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162046 at_fn_diff_devnull "$at_stdout" || at_failed=:
   162047 at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
   162048 $at_failed && at_fn_log_failure
   162049 $at_traceon; }
   162050 
   162051 
   162052 { set +x
   162053 $as_echo "$at_srcdir/java.at:607: grep '[mb]4_' YYParser.y"
   162054 at_fn_check_prepare_trace "java.at:607"
   162055 ( $at_check_trace; grep '[mb]4_' YYParser.y
   162056 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162057 at_status=$? at_failed=false
   162058 $at_check_filter
   162059 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162060 echo stdout:; cat "$at_stdout"
   162061 at_fn_check_status 1 $at_status "$at_srcdir/java.at:607"
   162062 $at_failed && at_fn_log_failure
   162063 $at_traceon; }
   162064 
   162065 
   162066 $as_echo "java.at:607" >"$at_check_line_file"
   162067 (test -z "$CONF_JAVAC") \
   162068   && at_fn_check_skip 77 "$at_srcdir/java.at:607"
   162069 $as_echo "java.at:607" >"$at_check_line_file"
   162070 (test -z "$CONF_JAVA") \
   162071   && at_fn_check_skip 77 "$at_srcdir/java.at:607"
   162072 { set +x
   162073 $as_echo "$at_srcdir/java.at:607: \$SHELL ../../../javacomp.sh YYParser.java"
   162074 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:607"
   162075 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   162076 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162077 at_status=$? at_failed=false
   162078 $at_check_filter
   162079 echo stderr:; cat "$at_stderr"
   162080 echo stdout:; cat "$at_stdout"
   162081 at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
   162082 $at_failed && at_fn_log_failure
   162083 $at_traceon; }
   162084 
   162085 
   162086 { set +x
   162087 $as_echo "$at_srcdir/java.at:613: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
   162088 at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:613"
   162089 ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
   162090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162091 at_status=$? at_failed=false
   162092 $at_check_filter
   162093 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162094 echo >>"$at_stdout"; $as_echo "1
   162095 " | \
   162096   $at_diff - "$at_stdout" || at_failed=:
   162097 at_fn_check_status 0 $at_status "$at_srcdir/java.at:613"
   162098 $at_failed && at_fn_log_failure
   162099 $at_traceon; }
   162100 
   162101 
   162102 { set +x
   162103 $as_echo "$at_srcdir/java.at:614: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
   162104 at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:614"
   162105 ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java
   162106 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162107 at_status=$? at_failed=false
   162108 $at_check_filter
   162109 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162110 echo >>"$at_stdout"; $as_echo "1
   162111 " | \
   162112   $at_diff - "$at_stdout" || at_failed=:
   162113 at_fn_check_status 0 $at_status "$at_srcdir/java.at:614"
   162114 $at_failed && at_fn_log_failure
   162115 $at_traceon; }
   162116 
   162117 
   162118 { set +x
   162119 $as_echo "$at_srcdir/java.at:615: grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {\$' YYParser.java"
   162120 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:615"
   162121 ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {$' YYParser.java
   162122 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162123 at_status=$? at_failed=false
   162124 $at_check_filter
   162125 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162126 echo >>"$at_stdout"; $as_echo "1
   162127 " | \
   162128   $at_diff - "$at_stdout" || at_failed=:
   162129 at_fn_check_status 0 $at_status "$at_srcdir/java.at:615"
   162130 $at_failed && at_fn_log_failure
   162131 $at_traceon; }
   162132 
   162133 
   162134 { set +x
   162135 $as_echo "$at_srcdir/java.at:616: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java"
   162136 at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:616"
   162137 ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java
   162138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162139 at_status=$? at_failed=false
   162140 $at_check_filter
   162141 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162142 echo >>"$at_stdout"; $as_echo "1
   162143 " | \
   162144   $at_diff - "$at_stdout" || at_failed=:
   162145 at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
   162146 $at_failed && at_fn_log_failure
   162147 $at_traceon; }
   162148 
   162149 
   162150 { set +x
   162151 $as_echo "$at_srcdir/java.at:617: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java"
   162152 at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:617"
   162153 ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java
   162154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162155 at_status=$? at_failed=false
   162156 $at_check_filter
   162157 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162158 echo >>"$at_stdout"; $as_echo "1
   162159 " | \
   162160   $at_diff - "$at_stdout" || at_failed=:
   162161 at_fn_check_status 0 $at_status "$at_srcdir/java.at:617"
   162162 $at_failed && at_fn_log_failure
   162163 $at_traceon; }
   162164 
   162165 
   162166 { set +x
   162167 $as_echo "$at_srcdir/java.at:618: grep -c '^[	 ]*this.parse_param1 = parse_param1;\$' YYParser.java"
   162168 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:618"
   162169 ( $at_check_trace; grep -c '^[	 ]*this.parse_param1 = parse_param1;$' YYParser.java
   162170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162171 at_status=$? at_failed=false
   162172 $at_check_filter
   162173 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162174 echo >>"$at_stdout"; $as_echo "2
   162175 " | \
   162176   $at_diff - "$at_stdout" || at_failed=:
   162177 at_fn_check_status 0 $at_status "$at_srcdir/java.at:618"
   162178 $at_failed && at_fn_log_failure
   162179 $at_traceon; }
   162180 
   162181 
   162182 { set +x
   162183 $as_echo "$at_srcdir/java.at:619: grep -c '^[	 ]*this.parse_param2 = parse_param2;\$' YYParser.java"
   162184 at_fn_check_prepare_dynamic "grep -c '^[	 ]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:619"
   162185 ( $at_check_trace; grep -c '^[	 ]*this.parse_param2 = parse_param2;$' YYParser.java
   162186 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162187 at_status=$? at_failed=false
   162188 $at_check_filter
   162189 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162190 echo >>"$at_stdout"; $as_echo "2
   162191 " | \
   162192   $at_diff - "$at_stdout" || at_failed=:
   162193 at_fn_check_status 0 $at_status "$at_srcdir/java.at:619"
   162194 $at_failed && at_fn_log_failure
   162195 $at_traceon; }
   162196 
   162197 
   162198 
   162199   set +x
   162200   $at_times_p && times >"$at_times_file"
   162201 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   162202 read at_status <"$at_status_file"
   162203 #AT_STOP_318
   162204 #AT_START_319
   162205 at_fn_group_banner 319 'java.at:628' \
   162206   "Java throws specifications" "                     " 20
   162207 at_xfail=no
   162208 (
   162209   $as_echo "319. $at_setup_line: testing $at_desc ..."
   162210   $at_traceon
   162211 
   162212 
   162213 # %define throws	- 0 1 2
   162214 # %define lex-throws	- 0 1 2
   162215 # %code lexer		  0 1
   162216 
   162217 
   162218 
   162219 
   162220 
   162221 
   162222 
   162223 
   162224 
   162225 
   162226 
   162227 
   162228 
   162229 
   162230 
   162231 
   162232 
   162233 
   162234 
   162235 
   162236 
   162237 cat >YYParser.y <<'_ATEOF'
   162238 
   162239 %language "Java"
   162240 %locations
   162241 %debug
   162242 %error-verbose
   162243 %token-table
   162244 
   162245 
   162246 
   162247 
   162248 %%
   162249 start: "end" {};
   162250 %%
   162251 class Position {}
   162252 _ATEOF
   162253 
   162254 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   162255   at_save_special_files
   162256   mkdir xml-tests
   162257     # Don't combine these Bison invocations since we want to be sure that
   162258   # --report=all isn't required to get the full XML file.
   162259   { set +x
   162260 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   162261                   --graph=xml-tests/test.dot YYParser.y"
   162262 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   162263 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   162264                   --graph=xml-tests/test.dot YYParser.y
   162265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162266 at_status=$? at_failed=false
   162267 $at_check_filter
   162268 echo stderr:; cat "$at_stderr"
   162269 echo stdout:; cat "$at_stdout"
   162270 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162271 $at_failed && at_fn_log_failure
   162272 $at_traceon; }
   162273 
   162274   { set +x
   162275 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   162276 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   162277 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   162278 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162279 at_status=$? at_failed=false
   162280 $at_check_filter
   162281 echo stderr:; cat "$at_stderr"
   162282 echo stdout:; cat "$at_stdout"
   162283 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162284 $at_failed && at_fn_log_failure
   162285 $at_traceon; }
   162286 
   162287     cp xml-tests/test.output expout
   162288   { set +x
   162289 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162290              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   162291              xml-tests/test.xml"
   162292 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162293 ( $at_check_trace; $XSLTPROC \
   162294              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   162295              xml-tests/test.xml
   162296 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162297 at_status=$? at_failed=false
   162298 $at_check_filter
   162299 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162300 $at_diff expout "$at_stdout" || at_failed=:
   162301 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162302 $at_failed && at_fn_log_failure
   162303 $at_traceon; }
   162304 
   162305   sort xml-tests/test.dot > expout
   162306   { set +x
   162307 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162308              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   162309              xml-tests/test.xml | sort"
   162310 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162311 ( $at_check_trace; $XSLTPROC \
   162312              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   162313              xml-tests/test.xml | sort
   162314 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162315 at_status=$? at_failed=false
   162316 $at_check_filter
   162317 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162318 $at_diff expout "$at_stdout" || at_failed=:
   162319 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162320 $at_failed && at_fn_log_failure
   162321 $at_traceon; }
   162322 
   162323   rm -rf xml-tests expout
   162324   at_restore_special_files
   162325 fi
   162326 { set +x
   162327 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   162328 at_fn_check_prepare_trace "java.at:688"
   162329 ( $at_check_trace; bison YYParser.y
   162330 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162331 at_status=$? at_failed=false
   162332 $at_check_filter
   162333 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162334 at_fn_diff_devnull "$at_stdout" || at_failed=:
   162335 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162336 $at_failed && at_fn_log_failure
   162337 $at_traceon; }
   162338 
   162339 
   162340 { set +x
   162341 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   162342 at_fn_check_prepare_trace "java.at:688"
   162343 ( $at_check_trace; grep '[mb]4_' YYParser.y
   162344 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162345 at_status=$? at_failed=false
   162346 $at_check_filter
   162347 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162348 echo stdout:; cat "$at_stdout"
   162349 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   162350 $at_failed && at_fn_log_failure
   162351 $at_traceon; }
   162352 
   162353 
   162354 $as_echo "java.at:688" >"$at_check_line_file"
   162355 (test -z "$CONF_JAVAC") \
   162356   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162357 $as_echo "java.at:688" >"$at_check_line_file"
   162358 (test -z "$CONF_JAVA") \
   162359   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162360 { set +x
   162361 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   162362 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   162363 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   162364 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162365 at_status=$? at_failed=false
   162366 $at_check_filter
   162367 echo stderr:; cat "$at_stderr"
   162368 echo stdout:; cat "$at_stdout"
   162369 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162370 $at_failed && at_fn_log_failure
   162371 $at_traceon; }
   162372 
   162373 
   162374 { set +x
   162375 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   162376 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   162377 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   162378 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162379 at_status=$? at_failed=false
   162380 $at_check_filter
   162381 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162382 echo >>"$at_stdout"; $as_echo "1
   162383 " | \
   162384   $at_diff - "$at_stdout" || at_failed=:
   162385 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162386 $at_failed && at_fn_log_failure
   162387 $at_traceon; }
   162388 
   162389 
   162390 { set +x
   162391 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   162392 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   162393 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   162394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162395 at_status=$? at_failed=false
   162396 $at_check_filter
   162397 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162398 echo >>"$at_stdout"; $as_echo "1
   162399 " | \
   162400   $at_diff - "$at_stdout" || at_failed=:
   162401 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162402 $at_failed && at_fn_log_failure
   162403 $at_traceon; }
   162404 
   162405 
   162406 { set +x
   162407 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
   162408 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688"
   162409 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
   162410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162411 at_status=$? at_failed=false
   162412 $at_check_filter
   162413 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162414 echo >>"$at_stdout"; $as_echo "1
   162415 " | \
   162416   $at_diff - "$at_stdout" || at_failed=:
   162417 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162418 $at_failed && at_fn_log_failure
   162419 $at_traceon; }
   162420 
   162421 
   162422 
   162423 cat >YYParser.y <<'_ATEOF'
   162424 
   162425 %language "Java"
   162426 %locations
   162427 %debug
   162428 %error-verbose
   162429 %token-table
   162430 
   162431 %define throws ""
   162432 
   162433 
   162434 %%
   162435 start: "end" {};
   162436 %%
   162437 class Position {}
   162438 _ATEOF
   162439 
   162440 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   162441   at_save_special_files
   162442   mkdir xml-tests
   162443     # Don't combine these Bison invocations since we want to be sure that
   162444   # --report=all isn't required to get the full XML file.
   162445   { set +x
   162446 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   162447                   --graph=xml-tests/test.dot YYParser.y"
   162448 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   162449 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   162450                   --graph=xml-tests/test.dot YYParser.y
   162451 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162452 at_status=$? at_failed=false
   162453 $at_check_filter
   162454 echo stderr:; cat "$at_stderr"
   162455 echo stdout:; cat "$at_stdout"
   162456 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162457 $at_failed && at_fn_log_failure
   162458 $at_traceon; }
   162459 
   162460   { set +x
   162461 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   162462 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   162463 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   162464 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162465 at_status=$? at_failed=false
   162466 $at_check_filter
   162467 echo stderr:; cat "$at_stderr"
   162468 echo stdout:; cat "$at_stdout"
   162469 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162470 $at_failed && at_fn_log_failure
   162471 $at_traceon; }
   162472 
   162473     cp xml-tests/test.output expout
   162474   { set +x
   162475 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162476              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   162477              xml-tests/test.xml"
   162478 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162479 ( $at_check_trace; $XSLTPROC \
   162480              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   162481              xml-tests/test.xml
   162482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162483 at_status=$? at_failed=false
   162484 $at_check_filter
   162485 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162486 $at_diff expout "$at_stdout" || at_failed=:
   162487 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162488 $at_failed && at_fn_log_failure
   162489 $at_traceon; }
   162490 
   162491   sort xml-tests/test.dot > expout
   162492   { set +x
   162493 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162494              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   162495              xml-tests/test.xml | sort"
   162496 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162497 ( $at_check_trace; $XSLTPROC \
   162498              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   162499              xml-tests/test.xml | sort
   162500 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162501 at_status=$? at_failed=false
   162502 $at_check_filter
   162503 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162504 $at_diff expout "$at_stdout" || at_failed=:
   162505 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162506 $at_failed && at_fn_log_failure
   162507 $at_traceon; }
   162508 
   162509   rm -rf xml-tests expout
   162510   at_restore_special_files
   162511 fi
   162512 { set +x
   162513 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   162514 at_fn_check_prepare_trace "java.at:688"
   162515 ( $at_check_trace; bison YYParser.y
   162516 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162517 at_status=$? at_failed=false
   162518 $at_check_filter
   162519 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162520 at_fn_diff_devnull "$at_stdout" || at_failed=:
   162521 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162522 $at_failed && at_fn_log_failure
   162523 $at_traceon; }
   162524 
   162525 
   162526 { set +x
   162527 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   162528 at_fn_check_prepare_trace "java.at:688"
   162529 ( $at_check_trace; grep '[mb]4_' YYParser.y
   162530 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162531 at_status=$? at_failed=false
   162532 $at_check_filter
   162533 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162534 echo stdout:; cat "$at_stdout"
   162535 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   162536 $at_failed && at_fn_log_failure
   162537 $at_traceon; }
   162538 
   162539 
   162540 $as_echo "java.at:688" >"$at_check_line_file"
   162541 (test -z "$CONF_JAVAC") \
   162542   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162543 $as_echo "java.at:688" >"$at_check_line_file"
   162544 (test -z "$CONF_JAVA") \
   162545   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162546 { set +x
   162547 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   162548 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   162549 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   162550 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162551 at_status=$? at_failed=false
   162552 $at_check_filter
   162553 echo stderr:; cat "$at_stderr"
   162554 echo stdout:; cat "$at_stdout"
   162555 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162556 $at_failed && at_fn_log_failure
   162557 $at_traceon; }
   162558 
   162559 
   162560 { set +x
   162561 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   162562 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   162563 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   162564 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162565 at_status=$? at_failed=false
   162566 $at_check_filter
   162567 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162568 echo >>"$at_stdout"; $as_echo "1
   162569 " | \
   162570   $at_diff - "$at_stdout" || at_failed=:
   162571 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162572 $at_failed && at_fn_log_failure
   162573 $at_traceon; }
   162574 
   162575 
   162576 { set +x
   162577 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   162578 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   162579 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   162580 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162581 at_status=$? at_failed=false
   162582 $at_check_filter
   162583 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162584 echo >>"$at_stdout"; $as_echo "1
   162585 " | \
   162586   $at_diff - "$at_stdout" || at_failed=:
   162587 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162588 $at_failed && at_fn_log_failure
   162589 $at_traceon; }
   162590 
   162591 
   162592 { set +x
   162593 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
   162594 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688"
   162595 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
   162596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162597 at_status=$? at_failed=false
   162598 $at_check_filter
   162599 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162600 echo >>"$at_stdout"; $as_echo "1
   162601 " | \
   162602   $at_diff - "$at_stdout" || at_failed=:
   162603 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162604 $at_failed && at_fn_log_failure
   162605 $at_traceon; }
   162606 
   162607 
   162608 
   162609 cat >YYParser.y <<'_ATEOF'
   162610 
   162611 %language "Java"
   162612 %locations
   162613 %debug
   162614 %error-verbose
   162615 %token-table
   162616 
   162617 %define throws "ClassNotFoundException"
   162618 
   162619 %initial-action {if (true) throw new ClassNotFoundException();}
   162620 %%
   162621 start: "end" {throw new ClassNotFoundException();};
   162622 %%
   162623 class Position {}
   162624 _ATEOF
   162625 
   162626 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   162627   at_save_special_files
   162628   mkdir xml-tests
   162629     # Don't combine these Bison invocations since we want to be sure that
   162630   # --report=all isn't required to get the full XML file.
   162631   { set +x
   162632 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   162633                   --graph=xml-tests/test.dot YYParser.y"
   162634 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   162635 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   162636                   --graph=xml-tests/test.dot YYParser.y
   162637 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162638 at_status=$? at_failed=false
   162639 $at_check_filter
   162640 echo stderr:; cat "$at_stderr"
   162641 echo stdout:; cat "$at_stdout"
   162642 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162643 $at_failed && at_fn_log_failure
   162644 $at_traceon; }
   162645 
   162646   { set +x
   162647 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   162648 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   162649 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   162650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162651 at_status=$? at_failed=false
   162652 $at_check_filter
   162653 echo stderr:; cat "$at_stderr"
   162654 echo stdout:; cat "$at_stdout"
   162655 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162656 $at_failed && at_fn_log_failure
   162657 $at_traceon; }
   162658 
   162659     cp xml-tests/test.output expout
   162660   { set +x
   162661 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162662              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   162663              xml-tests/test.xml"
   162664 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162665 ( $at_check_trace; $XSLTPROC \
   162666              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   162667              xml-tests/test.xml
   162668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162669 at_status=$? at_failed=false
   162670 $at_check_filter
   162671 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162672 $at_diff expout "$at_stdout" || at_failed=:
   162673 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162674 $at_failed && at_fn_log_failure
   162675 $at_traceon; }
   162676 
   162677   sort xml-tests/test.dot > expout
   162678   { set +x
   162679 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162680              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   162681              xml-tests/test.xml | sort"
   162682 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162683 ( $at_check_trace; $XSLTPROC \
   162684              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   162685              xml-tests/test.xml | sort
   162686 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162687 at_status=$? at_failed=false
   162688 $at_check_filter
   162689 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162690 $at_diff expout "$at_stdout" || at_failed=:
   162691 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162692 $at_failed && at_fn_log_failure
   162693 $at_traceon; }
   162694 
   162695   rm -rf xml-tests expout
   162696   at_restore_special_files
   162697 fi
   162698 { set +x
   162699 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   162700 at_fn_check_prepare_trace "java.at:688"
   162701 ( $at_check_trace; bison YYParser.y
   162702 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162703 at_status=$? at_failed=false
   162704 $at_check_filter
   162705 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162706 at_fn_diff_devnull "$at_stdout" || at_failed=:
   162707 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162708 $at_failed && at_fn_log_failure
   162709 $at_traceon; }
   162710 
   162711 
   162712 { set +x
   162713 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   162714 at_fn_check_prepare_trace "java.at:688"
   162715 ( $at_check_trace; grep '[mb]4_' YYParser.y
   162716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162717 at_status=$? at_failed=false
   162718 $at_check_filter
   162719 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162720 echo stdout:; cat "$at_stdout"
   162721 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   162722 $at_failed && at_fn_log_failure
   162723 $at_traceon; }
   162724 
   162725 
   162726 $as_echo "java.at:688" >"$at_check_line_file"
   162727 (test -z "$CONF_JAVAC") \
   162728   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162729 $as_echo "java.at:688" >"$at_check_line_file"
   162730 (test -z "$CONF_JAVA") \
   162731   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162732 { set +x
   162733 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   162734 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   162735 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   162736 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162737 at_status=$? at_failed=false
   162738 $at_check_filter
   162739 echo stderr:; cat "$at_stderr"
   162740 echo stdout:; cat "$at_stdout"
   162741 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162742 $at_failed && at_fn_log_failure
   162743 $at_traceon; }
   162744 
   162745 
   162746 { set +x
   162747 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   162748 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   162749 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   162750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162751 at_status=$? at_failed=false
   162752 $at_check_filter
   162753 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162754 echo >>"$at_stdout"; $as_echo "1
   162755 " | \
   162756   $at_diff - "$at_stdout" || at_failed=:
   162757 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162758 $at_failed && at_fn_log_failure
   162759 $at_traceon; }
   162760 
   162761 
   162762 { set +x
   162763 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   162764 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   162765 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   162766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162767 at_status=$? at_failed=false
   162768 $at_check_filter
   162769 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162770 echo >>"$at_stdout"; $as_echo "1
   162771 " | \
   162772   $at_diff - "$at_stdout" || at_failed=:
   162773 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162774 $at_failed && at_fn_log_failure
   162775 $at_traceon; }
   162776 
   162777 
   162778 { set +x
   162779 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java"
   162780 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:688"
   162781 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java
   162782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162783 at_status=$? at_failed=false
   162784 $at_check_filter
   162785 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162786 echo >>"$at_stdout"; $as_echo "1
   162787 " | \
   162788   $at_diff - "$at_stdout" || at_failed=:
   162789 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162790 $at_failed && at_fn_log_failure
   162791 $at_traceon; }
   162792 
   162793 
   162794 
   162795 cat >YYParser.y <<'_ATEOF'
   162796 
   162797 %language "Java"
   162798 %locations
   162799 %debug
   162800 %error-verbose
   162801 %token-table
   162802 
   162803 %define throws "ClassNotFoundException, InstantiationException"
   162804 
   162805 %initial-action {if (true) throw new InstantiationException();}
   162806 %%
   162807 start: "end" {throw new ClassNotFoundException();};
   162808 %%
   162809 class Position {}
   162810 _ATEOF
   162811 
   162812 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   162813   at_save_special_files
   162814   mkdir xml-tests
   162815     # Don't combine these Bison invocations since we want to be sure that
   162816   # --report=all isn't required to get the full XML file.
   162817   { set +x
   162818 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   162819                   --graph=xml-tests/test.dot YYParser.y"
   162820 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   162821 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   162822                   --graph=xml-tests/test.dot YYParser.y
   162823 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162824 at_status=$? at_failed=false
   162825 $at_check_filter
   162826 echo stderr:; cat "$at_stderr"
   162827 echo stdout:; cat "$at_stdout"
   162828 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162829 $at_failed && at_fn_log_failure
   162830 $at_traceon; }
   162831 
   162832   { set +x
   162833 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   162834 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   162835 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   162836 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162837 at_status=$? at_failed=false
   162838 $at_check_filter
   162839 echo stderr:; cat "$at_stderr"
   162840 echo stdout:; cat "$at_stdout"
   162841 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162842 $at_failed && at_fn_log_failure
   162843 $at_traceon; }
   162844 
   162845     cp xml-tests/test.output expout
   162846   { set +x
   162847 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162848              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   162849              xml-tests/test.xml"
   162850 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162851 ( $at_check_trace; $XSLTPROC \
   162852              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   162853              xml-tests/test.xml
   162854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162855 at_status=$? at_failed=false
   162856 $at_check_filter
   162857 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162858 $at_diff expout "$at_stdout" || at_failed=:
   162859 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162860 $at_failed && at_fn_log_failure
   162861 $at_traceon; }
   162862 
   162863   sort xml-tests/test.dot > expout
   162864   { set +x
   162865 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   162866              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   162867              xml-tests/test.xml | sort"
   162868 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   162869 ( $at_check_trace; $XSLTPROC \
   162870              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   162871              xml-tests/test.xml | sort
   162872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162873 at_status=$? at_failed=false
   162874 $at_check_filter
   162875 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162876 $at_diff expout "$at_stdout" || at_failed=:
   162877 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162878 $at_failed && at_fn_log_failure
   162879 $at_traceon; }
   162880 
   162881   rm -rf xml-tests expout
   162882   at_restore_special_files
   162883 fi
   162884 { set +x
   162885 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   162886 at_fn_check_prepare_trace "java.at:688"
   162887 ( $at_check_trace; bison YYParser.y
   162888 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162889 at_status=$? at_failed=false
   162890 $at_check_filter
   162891 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162892 at_fn_diff_devnull "$at_stdout" || at_failed=:
   162893 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162894 $at_failed && at_fn_log_failure
   162895 $at_traceon; }
   162896 
   162897 
   162898 { set +x
   162899 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   162900 at_fn_check_prepare_trace "java.at:688"
   162901 ( $at_check_trace; grep '[mb]4_' YYParser.y
   162902 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162903 at_status=$? at_failed=false
   162904 $at_check_filter
   162905 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162906 echo stdout:; cat "$at_stdout"
   162907 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   162908 $at_failed && at_fn_log_failure
   162909 $at_traceon; }
   162910 
   162911 
   162912 $as_echo "java.at:688" >"$at_check_line_file"
   162913 (test -z "$CONF_JAVAC") \
   162914   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162915 $as_echo "java.at:688" >"$at_check_line_file"
   162916 (test -z "$CONF_JAVA") \
   162917   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   162918 { set +x
   162919 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   162920 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   162921 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   162922 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162923 at_status=$? at_failed=false
   162924 $at_check_filter
   162925 echo stderr:; cat "$at_stderr"
   162926 echo stdout:; cat "$at_stdout"
   162927 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162928 $at_failed && at_fn_log_failure
   162929 $at_traceon; }
   162930 
   162931 
   162932 { set +x
   162933 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   162934 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   162935 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   162936 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162937 at_status=$? at_failed=false
   162938 $at_check_filter
   162939 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162940 echo >>"$at_stdout"; $as_echo "1
   162941 " | \
   162942   $at_diff - "$at_stdout" || at_failed=:
   162943 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162944 $at_failed && at_fn_log_failure
   162945 $at_traceon; }
   162946 
   162947 
   162948 { set +x
   162949 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   162950 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   162951 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   162952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162953 at_status=$? at_failed=false
   162954 $at_check_filter
   162955 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162956 echo >>"$at_stdout"; $as_echo "1
   162957 " | \
   162958   $at_diff - "$at_stdout" || at_failed=:
   162959 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162960 $at_failed && at_fn_log_failure
   162961 $at_traceon; }
   162962 
   162963 
   162964 { set +x
   162965 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
   162966 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   162967 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java
   162968 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   162969 at_status=$? at_failed=false
   162970 $at_check_filter
   162971 at_fn_diff_devnull "$at_stderr" || at_failed=:
   162972 echo >>"$at_stdout"; $as_echo "1
   162973 " | \
   162974   $at_diff - "$at_stdout" || at_failed=:
   162975 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   162976 $at_failed && at_fn_log_failure
   162977 $at_traceon; }
   162978 
   162979 
   162980 
   162981 cat >YYParser.y <<'_ATEOF'
   162982 
   162983 %language "Java"
   162984 %locations
   162985 %debug
   162986 %error-verbose
   162987 %token-table
   162988 
   162989 
   162990 %define lex_throws ""
   162991 
   162992 %%
   162993 start: "end" {};
   162994 %%
   162995 class Position {}
   162996 _ATEOF
   162997 
   162998 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   162999   at_save_special_files
   163000   mkdir xml-tests
   163001     # Don't combine these Bison invocations since we want to be sure that
   163002   # --report=all isn't required to get the full XML file.
   163003   { set +x
   163004 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   163005                   --graph=xml-tests/test.dot YYParser.y"
   163006 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   163007 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   163008                   --graph=xml-tests/test.dot YYParser.y
   163009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163010 at_status=$? at_failed=false
   163011 $at_check_filter
   163012 echo stderr:; cat "$at_stderr"
   163013 echo stdout:; cat "$at_stdout"
   163014 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163015 $at_failed && at_fn_log_failure
   163016 $at_traceon; }
   163017 
   163018   { set +x
   163019 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   163020 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   163021 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   163022 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163023 at_status=$? at_failed=false
   163024 $at_check_filter
   163025 echo stderr:; cat "$at_stderr"
   163026 echo stdout:; cat "$at_stdout"
   163027 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163028 $at_failed && at_fn_log_failure
   163029 $at_traceon; }
   163030 
   163031     cp xml-tests/test.output expout
   163032   { set +x
   163033 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163034              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   163035              xml-tests/test.xml"
   163036 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163037 ( $at_check_trace; $XSLTPROC \
   163038              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   163039              xml-tests/test.xml
   163040 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163041 at_status=$? at_failed=false
   163042 $at_check_filter
   163043 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163044 $at_diff expout "$at_stdout" || at_failed=:
   163045 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163046 $at_failed && at_fn_log_failure
   163047 $at_traceon; }
   163048 
   163049   sort xml-tests/test.dot > expout
   163050   { set +x
   163051 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163052              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   163053              xml-tests/test.xml | sort"
   163054 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163055 ( $at_check_trace; $XSLTPROC \
   163056              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   163057              xml-tests/test.xml | sort
   163058 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163059 at_status=$? at_failed=false
   163060 $at_check_filter
   163061 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163062 $at_diff expout "$at_stdout" || at_failed=:
   163063 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163064 $at_failed && at_fn_log_failure
   163065 $at_traceon; }
   163066 
   163067   rm -rf xml-tests expout
   163068   at_restore_special_files
   163069 fi
   163070 { set +x
   163071 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   163072 at_fn_check_prepare_trace "java.at:688"
   163073 ( $at_check_trace; bison YYParser.y
   163074 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163075 at_status=$? at_failed=false
   163076 $at_check_filter
   163077 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163078 at_fn_diff_devnull "$at_stdout" || at_failed=:
   163079 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163080 $at_failed && at_fn_log_failure
   163081 $at_traceon; }
   163082 
   163083 
   163084 { set +x
   163085 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   163086 at_fn_check_prepare_trace "java.at:688"
   163087 ( $at_check_trace; grep '[mb]4_' YYParser.y
   163088 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163089 at_status=$? at_failed=false
   163090 $at_check_filter
   163091 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163092 echo stdout:; cat "$at_stdout"
   163093 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   163094 $at_failed && at_fn_log_failure
   163095 $at_traceon; }
   163096 
   163097 
   163098 $as_echo "java.at:688" >"$at_check_line_file"
   163099 (test -z "$CONF_JAVAC") \
   163100   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163101 $as_echo "java.at:688" >"$at_check_line_file"
   163102 (test -z "$CONF_JAVA") \
   163103   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163104 { set +x
   163105 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   163106 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   163107 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   163108 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163109 at_status=$? at_failed=false
   163110 $at_check_filter
   163111 echo stderr:; cat "$at_stderr"
   163112 echo stdout:; cat "$at_stdout"
   163113 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163114 $at_failed && at_fn_log_failure
   163115 $at_traceon; }
   163116 
   163117 
   163118 { set +x
   163119 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   163120 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   163121 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   163122 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163123 at_status=$? at_failed=false
   163124 $at_check_filter
   163125 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163126 echo >>"$at_stdout"; $as_echo "1
   163127 " | \
   163128   $at_diff - "$at_stdout" || at_failed=:
   163129 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163130 $at_failed && at_fn_log_failure
   163131 $at_traceon; }
   163132 
   163133 
   163134 { set +x
   163135 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   163136 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   163137 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   163138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163139 at_status=$? at_failed=false
   163140 $at_check_filter
   163141 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163142 echo >>"$at_stdout"; $as_echo "1
   163143 " | \
   163144   $at_diff - "$at_stdout" || at_failed=:
   163145 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163146 $at_failed && at_fn_log_failure
   163147 $at_traceon; }
   163148 
   163149 
   163150 { set +x
   163151 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java"
   163152 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688"
   163153 ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
   163154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163155 at_status=$? at_failed=false
   163156 $at_check_filter
   163157 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163158 echo >>"$at_stdout"; $as_echo "1
   163159 " | \
   163160   $at_diff - "$at_stdout" || at_failed=:
   163161 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163162 $at_failed && at_fn_log_failure
   163163 $at_traceon; }
   163164 
   163165 
   163166 
   163167 cat >YYParser.y <<'_ATEOF'
   163168 
   163169 %language "Java"
   163170 %locations
   163171 %debug
   163172 %error-verbose
   163173 %token-table
   163174 
   163175 %define throws ""
   163176 %define lex_throws ""
   163177 
   163178 %%
   163179 start: "end" {};
   163180 %%
   163181 class Position {}
   163182 _ATEOF
   163183 
   163184 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   163185   at_save_special_files
   163186   mkdir xml-tests
   163187     # Don't combine these Bison invocations since we want to be sure that
   163188   # --report=all isn't required to get the full XML file.
   163189   { set +x
   163190 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   163191                   --graph=xml-tests/test.dot YYParser.y"
   163192 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   163193 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   163194                   --graph=xml-tests/test.dot YYParser.y
   163195 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163196 at_status=$? at_failed=false
   163197 $at_check_filter
   163198 echo stderr:; cat "$at_stderr"
   163199 echo stdout:; cat "$at_stdout"
   163200 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163201 $at_failed && at_fn_log_failure
   163202 $at_traceon; }
   163203 
   163204   { set +x
   163205 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   163206 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   163207 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   163208 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163209 at_status=$? at_failed=false
   163210 $at_check_filter
   163211 echo stderr:; cat "$at_stderr"
   163212 echo stdout:; cat "$at_stdout"
   163213 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163214 $at_failed && at_fn_log_failure
   163215 $at_traceon; }
   163216 
   163217     cp xml-tests/test.output expout
   163218   { set +x
   163219 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163220              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   163221              xml-tests/test.xml"
   163222 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163223 ( $at_check_trace; $XSLTPROC \
   163224              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   163225              xml-tests/test.xml
   163226 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163227 at_status=$? at_failed=false
   163228 $at_check_filter
   163229 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163230 $at_diff expout "$at_stdout" || at_failed=:
   163231 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163232 $at_failed && at_fn_log_failure
   163233 $at_traceon; }
   163234 
   163235   sort xml-tests/test.dot > expout
   163236   { set +x
   163237 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163238              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   163239              xml-tests/test.xml | sort"
   163240 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163241 ( $at_check_trace; $XSLTPROC \
   163242              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   163243              xml-tests/test.xml | sort
   163244 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163245 at_status=$? at_failed=false
   163246 $at_check_filter
   163247 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163248 $at_diff expout "$at_stdout" || at_failed=:
   163249 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163250 $at_failed && at_fn_log_failure
   163251 $at_traceon; }
   163252 
   163253   rm -rf xml-tests expout
   163254   at_restore_special_files
   163255 fi
   163256 { set +x
   163257 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   163258 at_fn_check_prepare_trace "java.at:688"
   163259 ( $at_check_trace; bison YYParser.y
   163260 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163261 at_status=$? at_failed=false
   163262 $at_check_filter
   163263 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163264 at_fn_diff_devnull "$at_stdout" || at_failed=:
   163265 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163266 $at_failed && at_fn_log_failure
   163267 $at_traceon; }
   163268 
   163269 
   163270 { set +x
   163271 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   163272 at_fn_check_prepare_trace "java.at:688"
   163273 ( $at_check_trace; grep '[mb]4_' YYParser.y
   163274 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163275 at_status=$? at_failed=false
   163276 $at_check_filter
   163277 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163278 echo stdout:; cat "$at_stdout"
   163279 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   163280 $at_failed && at_fn_log_failure
   163281 $at_traceon; }
   163282 
   163283 
   163284 $as_echo "java.at:688" >"$at_check_line_file"
   163285 (test -z "$CONF_JAVAC") \
   163286   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163287 $as_echo "java.at:688" >"$at_check_line_file"
   163288 (test -z "$CONF_JAVA") \
   163289   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163290 { set +x
   163291 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   163292 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   163293 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   163294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163295 at_status=$? at_failed=false
   163296 $at_check_filter
   163297 echo stderr:; cat "$at_stderr"
   163298 echo stdout:; cat "$at_stdout"
   163299 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163300 $at_failed && at_fn_log_failure
   163301 $at_traceon; }
   163302 
   163303 
   163304 { set +x
   163305 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   163306 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   163307 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   163308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163309 at_status=$? at_failed=false
   163310 $at_check_filter
   163311 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163312 echo >>"$at_stdout"; $as_echo "1
   163313 " | \
   163314   $at_diff - "$at_stdout" || at_failed=:
   163315 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163316 $at_failed && at_fn_log_failure
   163317 $at_traceon; }
   163318 
   163319 
   163320 { set +x
   163321 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   163322 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   163323 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   163324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163325 at_status=$? at_failed=false
   163326 $at_check_filter
   163327 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163328 echo >>"$at_stdout"; $as_echo "1
   163329 " | \
   163330   $at_diff - "$at_stdout" || at_failed=:
   163331 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163332 $at_failed && at_fn_log_failure
   163333 $at_traceon; }
   163334 
   163335 
   163336 { set +x
   163337 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java"
   163338 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688"
   163339 ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
   163340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163341 at_status=$? at_failed=false
   163342 $at_check_filter
   163343 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163344 echo >>"$at_stdout"; $as_echo "1
   163345 " | \
   163346   $at_diff - "$at_stdout" || at_failed=:
   163347 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163348 $at_failed && at_fn_log_failure
   163349 $at_traceon; }
   163350 
   163351 
   163352 
   163353 cat >YYParser.y <<'_ATEOF'
   163354 
   163355 %language "Java"
   163356 %locations
   163357 %debug
   163358 %error-verbose
   163359 %token-table
   163360 
   163361 %define throws "ClassNotFoundException"
   163362 %define lex_throws ""
   163363 %initial-action {if (true) throw new ClassNotFoundException();}
   163364 %%
   163365 start: "end" {throw new ClassNotFoundException();};
   163366 %%
   163367 class Position {}
   163368 _ATEOF
   163369 
   163370 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   163371   at_save_special_files
   163372   mkdir xml-tests
   163373     # Don't combine these Bison invocations since we want to be sure that
   163374   # --report=all isn't required to get the full XML file.
   163375   { set +x
   163376 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   163377                   --graph=xml-tests/test.dot YYParser.y"
   163378 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   163379 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   163380                   --graph=xml-tests/test.dot YYParser.y
   163381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163382 at_status=$? at_failed=false
   163383 $at_check_filter
   163384 echo stderr:; cat "$at_stderr"
   163385 echo stdout:; cat "$at_stdout"
   163386 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163387 $at_failed && at_fn_log_failure
   163388 $at_traceon; }
   163389 
   163390   { set +x
   163391 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   163392 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   163393 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   163394 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163395 at_status=$? at_failed=false
   163396 $at_check_filter
   163397 echo stderr:; cat "$at_stderr"
   163398 echo stdout:; cat "$at_stdout"
   163399 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163400 $at_failed && at_fn_log_failure
   163401 $at_traceon; }
   163402 
   163403     cp xml-tests/test.output expout
   163404   { set +x
   163405 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163406              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   163407              xml-tests/test.xml"
   163408 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163409 ( $at_check_trace; $XSLTPROC \
   163410              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   163411              xml-tests/test.xml
   163412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163413 at_status=$? at_failed=false
   163414 $at_check_filter
   163415 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163416 $at_diff expout "$at_stdout" || at_failed=:
   163417 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163418 $at_failed && at_fn_log_failure
   163419 $at_traceon; }
   163420 
   163421   sort xml-tests/test.dot > expout
   163422   { set +x
   163423 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163424              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   163425              xml-tests/test.xml | sort"
   163426 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163427 ( $at_check_trace; $XSLTPROC \
   163428              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   163429              xml-tests/test.xml | sort
   163430 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163431 at_status=$? at_failed=false
   163432 $at_check_filter
   163433 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163434 $at_diff expout "$at_stdout" || at_failed=:
   163435 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163436 $at_failed && at_fn_log_failure
   163437 $at_traceon; }
   163438 
   163439   rm -rf xml-tests expout
   163440   at_restore_special_files
   163441 fi
   163442 { set +x
   163443 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   163444 at_fn_check_prepare_trace "java.at:688"
   163445 ( $at_check_trace; bison YYParser.y
   163446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163447 at_status=$? at_failed=false
   163448 $at_check_filter
   163449 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163450 at_fn_diff_devnull "$at_stdout" || at_failed=:
   163451 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163452 $at_failed && at_fn_log_failure
   163453 $at_traceon; }
   163454 
   163455 
   163456 { set +x
   163457 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   163458 at_fn_check_prepare_trace "java.at:688"
   163459 ( $at_check_trace; grep '[mb]4_' YYParser.y
   163460 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163461 at_status=$? at_failed=false
   163462 $at_check_filter
   163463 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163464 echo stdout:; cat "$at_stdout"
   163465 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   163466 $at_failed && at_fn_log_failure
   163467 $at_traceon; }
   163468 
   163469 
   163470 $as_echo "java.at:688" >"$at_check_line_file"
   163471 (test -z "$CONF_JAVAC") \
   163472   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163473 $as_echo "java.at:688" >"$at_check_line_file"
   163474 (test -z "$CONF_JAVA") \
   163475   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163476 { set +x
   163477 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   163478 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   163479 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   163480 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163481 at_status=$? at_failed=false
   163482 $at_check_filter
   163483 echo stderr:; cat "$at_stderr"
   163484 echo stdout:; cat "$at_stdout"
   163485 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163486 $at_failed && at_fn_log_failure
   163487 $at_traceon; }
   163488 
   163489 
   163490 { set +x
   163491 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   163492 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   163493 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   163494 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163495 at_status=$? at_failed=false
   163496 $at_check_filter
   163497 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163498 echo >>"$at_stdout"; $as_echo "1
   163499 " | \
   163500   $at_diff - "$at_stdout" || at_failed=:
   163501 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163502 $at_failed && at_fn_log_failure
   163503 $at_traceon; }
   163504 
   163505 
   163506 { set +x
   163507 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   163508 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   163509 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   163510 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163511 at_status=$? at_failed=false
   163512 $at_check_filter
   163513 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163514 echo >>"$at_stdout"; $as_echo "1
   163515 " | \
   163516   $at_diff - "$at_stdout" || at_failed=:
   163517 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163518 $at_failed && at_fn_log_failure
   163519 $at_traceon; }
   163520 
   163521 
   163522 { set +x
   163523 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java"
   163524 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   163525 ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java
   163526 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163527 at_status=$? at_failed=false
   163528 $at_check_filter
   163529 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163530 echo >>"$at_stdout"; $as_echo "1
   163531 " | \
   163532   $at_diff - "$at_stdout" || at_failed=:
   163533 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163534 $at_failed && at_fn_log_failure
   163535 $at_traceon; }
   163536 
   163537 
   163538 
   163539 cat >YYParser.y <<'_ATEOF'
   163540 
   163541 %language "Java"
   163542 %locations
   163543 %debug
   163544 %error-verbose
   163545 %token-table
   163546 
   163547 %define throws "ClassNotFoundException, InstantiationException"
   163548 %define lex_throws ""
   163549 %initial-action {if (true) throw new InstantiationException();}
   163550 %%
   163551 start: "end" {throw new ClassNotFoundException();};
   163552 %%
   163553 class Position {}
   163554 _ATEOF
   163555 
   163556 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   163557   at_save_special_files
   163558   mkdir xml-tests
   163559     # Don't combine these Bison invocations since we want to be sure that
   163560   # --report=all isn't required to get the full XML file.
   163561   { set +x
   163562 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   163563                   --graph=xml-tests/test.dot YYParser.y"
   163564 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   163565 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   163566                   --graph=xml-tests/test.dot YYParser.y
   163567 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163568 at_status=$? at_failed=false
   163569 $at_check_filter
   163570 echo stderr:; cat "$at_stderr"
   163571 echo stdout:; cat "$at_stdout"
   163572 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163573 $at_failed && at_fn_log_failure
   163574 $at_traceon; }
   163575 
   163576   { set +x
   163577 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   163578 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   163579 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   163580 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163581 at_status=$? at_failed=false
   163582 $at_check_filter
   163583 echo stderr:; cat "$at_stderr"
   163584 echo stdout:; cat "$at_stdout"
   163585 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163586 $at_failed && at_fn_log_failure
   163587 $at_traceon; }
   163588 
   163589     cp xml-tests/test.output expout
   163590   { set +x
   163591 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163592              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   163593              xml-tests/test.xml"
   163594 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163595 ( $at_check_trace; $XSLTPROC \
   163596              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   163597              xml-tests/test.xml
   163598 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163599 at_status=$? at_failed=false
   163600 $at_check_filter
   163601 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163602 $at_diff expout "$at_stdout" || at_failed=:
   163603 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163604 $at_failed && at_fn_log_failure
   163605 $at_traceon; }
   163606 
   163607   sort xml-tests/test.dot > expout
   163608   { set +x
   163609 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163610              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   163611              xml-tests/test.xml | sort"
   163612 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163613 ( $at_check_trace; $XSLTPROC \
   163614              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   163615              xml-tests/test.xml | sort
   163616 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163617 at_status=$? at_failed=false
   163618 $at_check_filter
   163619 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163620 $at_diff expout "$at_stdout" || at_failed=:
   163621 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163622 $at_failed && at_fn_log_failure
   163623 $at_traceon; }
   163624 
   163625   rm -rf xml-tests expout
   163626   at_restore_special_files
   163627 fi
   163628 { set +x
   163629 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   163630 at_fn_check_prepare_trace "java.at:688"
   163631 ( $at_check_trace; bison YYParser.y
   163632 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163633 at_status=$? at_failed=false
   163634 $at_check_filter
   163635 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163636 at_fn_diff_devnull "$at_stdout" || at_failed=:
   163637 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163638 $at_failed && at_fn_log_failure
   163639 $at_traceon; }
   163640 
   163641 
   163642 { set +x
   163643 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   163644 at_fn_check_prepare_trace "java.at:688"
   163645 ( $at_check_trace; grep '[mb]4_' YYParser.y
   163646 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163647 at_status=$? at_failed=false
   163648 $at_check_filter
   163649 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163650 echo stdout:; cat "$at_stdout"
   163651 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   163652 $at_failed && at_fn_log_failure
   163653 $at_traceon; }
   163654 
   163655 
   163656 $as_echo "java.at:688" >"$at_check_line_file"
   163657 (test -z "$CONF_JAVAC") \
   163658   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163659 $as_echo "java.at:688" >"$at_check_line_file"
   163660 (test -z "$CONF_JAVA") \
   163661   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163662 { set +x
   163663 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   163664 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   163665 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   163666 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163667 at_status=$? at_failed=false
   163668 $at_check_filter
   163669 echo stderr:; cat "$at_stderr"
   163670 echo stdout:; cat "$at_stdout"
   163671 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163672 $at_failed && at_fn_log_failure
   163673 $at_traceon; }
   163674 
   163675 
   163676 { set +x
   163677 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   163678 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   163679 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   163680 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163681 at_status=$? at_failed=false
   163682 $at_check_filter
   163683 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163684 echo >>"$at_stdout"; $as_echo "1
   163685 " | \
   163686   $at_diff - "$at_stdout" || at_failed=:
   163687 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163688 $at_failed && at_fn_log_failure
   163689 $at_traceon; }
   163690 
   163691 
   163692 { set +x
   163693 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   163694 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   163695 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   163696 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163697 at_status=$? at_failed=false
   163698 $at_check_filter
   163699 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163700 echo >>"$at_stdout"; $as_echo "1
   163701 " | \
   163702   $at_diff - "$at_stdout" || at_failed=:
   163703 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163704 $at_failed && at_fn_log_failure
   163705 $at_traceon; }
   163706 
   163707 
   163708 { set +x
   163709 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   163710 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   163711 ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java
   163712 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163713 at_status=$? at_failed=false
   163714 $at_check_filter
   163715 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163716 echo >>"$at_stdout"; $as_echo "1
   163717 " | \
   163718   $at_diff - "$at_stdout" || at_failed=:
   163719 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163720 $at_failed && at_fn_log_failure
   163721 $at_traceon; }
   163722 
   163723 
   163724 
   163725 cat >YYParser.y <<'_ATEOF'
   163726 
   163727 %language "Java"
   163728 %locations
   163729 %debug
   163730 %error-verbose
   163731 %token-table
   163732 
   163733 
   163734 %define lex_throws "InterruptedException"
   163735 
   163736 %%
   163737 start: "end" {};
   163738 %%
   163739 class Position {}
   163740 _ATEOF
   163741 
   163742 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   163743   at_save_special_files
   163744   mkdir xml-tests
   163745     # Don't combine these Bison invocations since we want to be sure that
   163746   # --report=all isn't required to get the full XML file.
   163747   { set +x
   163748 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   163749                   --graph=xml-tests/test.dot YYParser.y"
   163750 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   163751 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   163752                   --graph=xml-tests/test.dot YYParser.y
   163753 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163754 at_status=$? at_failed=false
   163755 $at_check_filter
   163756 echo stderr:; cat "$at_stderr"
   163757 echo stdout:; cat "$at_stdout"
   163758 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163759 $at_failed && at_fn_log_failure
   163760 $at_traceon; }
   163761 
   163762   { set +x
   163763 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   163764 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   163765 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   163766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163767 at_status=$? at_failed=false
   163768 $at_check_filter
   163769 echo stderr:; cat "$at_stderr"
   163770 echo stdout:; cat "$at_stdout"
   163771 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163772 $at_failed && at_fn_log_failure
   163773 $at_traceon; }
   163774 
   163775     cp xml-tests/test.output expout
   163776   { set +x
   163777 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163778              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   163779              xml-tests/test.xml"
   163780 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163781 ( $at_check_trace; $XSLTPROC \
   163782              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   163783              xml-tests/test.xml
   163784 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163785 at_status=$? at_failed=false
   163786 $at_check_filter
   163787 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163788 $at_diff expout "$at_stdout" || at_failed=:
   163789 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163790 $at_failed && at_fn_log_failure
   163791 $at_traceon; }
   163792 
   163793   sort xml-tests/test.dot > expout
   163794   { set +x
   163795 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163796              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   163797              xml-tests/test.xml | sort"
   163798 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163799 ( $at_check_trace; $XSLTPROC \
   163800              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   163801              xml-tests/test.xml | sort
   163802 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163803 at_status=$? at_failed=false
   163804 $at_check_filter
   163805 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163806 $at_diff expout "$at_stdout" || at_failed=:
   163807 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163808 $at_failed && at_fn_log_failure
   163809 $at_traceon; }
   163810 
   163811   rm -rf xml-tests expout
   163812   at_restore_special_files
   163813 fi
   163814 { set +x
   163815 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   163816 at_fn_check_prepare_trace "java.at:688"
   163817 ( $at_check_trace; bison YYParser.y
   163818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163819 at_status=$? at_failed=false
   163820 $at_check_filter
   163821 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163822 at_fn_diff_devnull "$at_stdout" || at_failed=:
   163823 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163824 $at_failed && at_fn_log_failure
   163825 $at_traceon; }
   163826 
   163827 
   163828 { set +x
   163829 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   163830 at_fn_check_prepare_trace "java.at:688"
   163831 ( $at_check_trace; grep '[mb]4_' YYParser.y
   163832 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163833 at_status=$? at_failed=false
   163834 $at_check_filter
   163835 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163836 echo stdout:; cat "$at_stdout"
   163837 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   163838 $at_failed && at_fn_log_failure
   163839 $at_traceon; }
   163840 
   163841 
   163842 $as_echo "java.at:688" >"$at_check_line_file"
   163843 (test -z "$CONF_JAVAC") \
   163844   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163845 $as_echo "java.at:688" >"$at_check_line_file"
   163846 (test -z "$CONF_JAVA") \
   163847   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   163848 { set +x
   163849 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   163850 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   163851 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   163852 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163853 at_status=$? at_failed=false
   163854 $at_check_filter
   163855 echo stderr:; cat "$at_stderr"
   163856 echo stdout:; cat "$at_stdout"
   163857 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163858 $at_failed && at_fn_log_failure
   163859 $at_traceon; }
   163860 
   163861 
   163862 { set +x
   163863 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   163864 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   163865 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   163866 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163867 at_status=$? at_failed=false
   163868 $at_check_filter
   163869 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163870 echo >>"$at_stdout"; $as_echo "1
   163871 " | \
   163872   $at_diff - "$at_stdout" || at_failed=:
   163873 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163874 $at_failed && at_fn_log_failure
   163875 $at_traceon; }
   163876 
   163877 
   163878 { set +x
   163879 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   163880 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   163881 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   163882 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163883 at_status=$? at_failed=false
   163884 $at_check_filter
   163885 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163886 echo >>"$at_stdout"; $as_echo "1
   163887 " | \
   163888   $at_diff - "$at_stdout" || at_failed=:
   163889 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163890 $at_failed && at_fn_log_failure
   163891 $at_traceon; }
   163892 
   163893 
   163894 { set +x
   163895 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
   163896 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688"
   163897 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
   163898 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163899 at_status=$? at_failed=false
   163900 $at_check_filter
   163901 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163902 echo >>"$at_stdout"; $as_echo "1
   163903 " | \
   163904   $at_diff - "$at_stdout" || at_failed=:
   163905 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163906 $at_failed && at_fn_log_failure
   163907 $at_traceon; }
   163908 
   163909 
   163910 
   163911 cat >YYParser.y <<'_ATEOF'
   163912 
   163913 %language "Java"
   163914 %locations
   163915 %debug
   163916 %error-verbose
   163917 %token-table
   163918 
   163919 %define throws ""
   163920 %define lex_throws "InterruptedException"
   163921 
   163922 %%
   163923 start: "end" {};
   163924 %%
   163925 class Position {}
   163926 _ATEOF
   163927 
   163928 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   163929   at_save_special_files
   163930   mkdir xml-tests
   163931     # Don't combine these Bison invocations since we want to be sure that
   163932   # --report=all isn't required to get the full XML file.
   163933   { set +x
   163934 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   163935                   --graph=xml-tests/test.dot YYParser.y"
   163936 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   163937 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   163938                   --graph=xml-tests/test.dot YYParser.y
   163939 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163940 at_status=$? at_failed=false
   163941 $at_check_filter
   163942 echo stderr:; cat "$at_stderr"
   163943 echo stdout:; cat "$at_stdout"
   163944 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163945 $at_failed && at_fn_log_failure
   163946 $at_traceon; }
   163947 
   163948   { set +x
   163949 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   163950 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   163951 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   163952 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163953 at_status=$? at_failed=false
   163954 $at_check_filter
   163955 echo stderr:; cat "$at_stderr"
   163956 echo stdout:; cat "$at_stdout"
   163957 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163958 $at_failed && at_fn_log_failure
   163959 $at_traceon; }
   163960 
   163961     cp xml-tests/test.output expout
   163962   { set +x
   163963 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163964              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   163965              xml-tests/test.xml"
   163966 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163967 ( $at_check_trace; $XSLTPROC \
   163968              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   163969              xml-tests/test.xml
   163970 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163971 at_status=$? at_failed=false
   163972 $at_check_filter
   163973 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163974 $at_diff expout "$at_stdout" || at_failed=:
   163975 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163976 $at_failed && at_fn_log_failure
   163977 $at_traceon; }
   163978 
   163979   sort xml-tests/test.dot > expout
   163980   { set +x
   163981 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   163982              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   163983              xml-tests/test.xml | sort"
   163984 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   163985 ( $at_check_trace; $XSLTPROC \
   163986              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   163987              xml-tests/test.xml | sort
   163988 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   163989 at_status=$? at_failed=false
   163990 $at_check_filter
   163991 at_fn_diff_devnull "$at_stderr" || at_failed=:
   163992 $at_diff expout "$at_stdout" || at_failed=:
   163993 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   163994 $at_failed && at_fn_log_failure
   163995 $at_traceon; }
   163996 
   163997   rm -rf xml-tests expout
   163998   at_restore_special_files
   163999 fi
   164000 { set +x
   164001 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   164002 at_fn_check_prepare_trace "java.at:688"
   164003 ( $at_check_trace; bison YYParser.y
   164004 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164005 at_status=$? at_failed=false
   164006 $at_check_filter
   164007 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164008 at_fn_diff_devnull "$at_stdout" || at_failed=:
   164009 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164010 $at_failed && at_fn_log_failure
   164011 $at_traceon; }
   164012 
   164013 
   164014 { set +x
   164015 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   164016 at_fn_check_prepare_trace "java.at:688"
   164017 ( $at_check_trace; grep '[mb]4_' YYParser.y
   164018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164019 at_status=$? at_failed=false
   164020 $at_check_filter
   164021 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164022 echo stdout:; cat "$at_stdout"
   164023 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   164024 $at_failed && at_fn_log_failure
   164025 $at_traceon; }
   164026 
   164027 
   164028 $as_echo "java.at:688" >"$at_check_line_file"
   164029 (test -z "$CONF_JAVAC") \
   164030   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164031 $as_echo "java.at:688" >"$at_check_line_file"
   164032 (test -z "$CONF_JAVA") \
   164033   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164034 { set +x
   164035 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   164036 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   164037 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   164038 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164039 at_status=$? at_failed=false
   164040 $at_check_filter
   164041 echo stderr:; cat "$at_stderr"
   164042 echo stdout:; cat "$at_stdout"
   164043 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164044 $at_failed && at_fn_log_failure
   164045 $at_traceon; }
   164046 
   164047 
   164048 { set +x
   164049 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   164050 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   164051 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   164052 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164053 at_status=$? at_failed=false
   164054 $at_check_filter
   164055 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164056 echo >>"$at_stdout"; $as_echo "1
   164057 " | \
   164058   $at_diff - "$at_stdout" || at_failed=:
   164059 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164060 $at_failed && at_fn_log_failure
   164061 $at_traceon; }
   164062 
   164063 
   164064 { set +x
   164065 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   164066 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   164067 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   164068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164069 at_status=$? at_failed=false
   164070 $at_check_filter
   164071 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164072 echo >>"$at_stdout"; $as_echo "1
   164073 " | \
   164074   $at_diff - "$at_stdout" || at_failed=:
   164075 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164076 $at_failed && at_fn_log_failure
   164077 $at_traceon; }
   164078 
   164079 
   164080 { set +x
   164081 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
   164082 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688"
   164083 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
   164084 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164085 at_status=$? at_failed=false
   164086 $at_check_filter
   164087 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164088 echo >>"$at_stdout"; $as_echo "1
   164089 " | \
   164090   $at_diff - "$at_stdout" || at_failed=:
   164091 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164092 $at_failed && at_fn_log_failure
   164093 $at_traceon; }
   164094 
   164095 
   164096 
   164097 cat >YYParser.y <<'_ATEOF'
   164098 
   164099 %language "Java"
   164100 %locations
   164101 %debug
   164102 %error-verbose
   164103 %token-table
   164104 
   164105 %define throws "ClassNotFoundException"
   164106 %define lex_throws "InterruptedException"
   164107 %initial-action {if (true) throw new ClassNotFoundException();}
   164108 %%
   164109 start: "end" {throw new ClassNotFoundException();};
   164110 %%
   164111 class Position {}
   164112 _ATEOF
   164113 
   164114 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   164115   at_save_special_files
   164116   mkdir xml-tests
   164117     # Don't combine these Bison invocations since we want to be sure that
   164118   # --report=all isn't required to get the full XML file.
   164119   { set +x
   164120 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   164121                   --graph=xml-tests/test.dot YYParser.y"
   164122 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   164123 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   164124                   --graph=xml-tests/test.dot YYParser.y
   164125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164126 at_status=$? at_failed=false
   164127 $at_check_filter
   164128 echo stderr:; cat "$at_stderr"
   164129 echo stdout:; cat "$at_stdout"
   164130 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164131 $at_failed && at_fn_log_failure
   164132 $at_traceon; }
   164133 
   164134   { set +x
   164135 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   164136 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   164137 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   164138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164139 at_status=$? at_failed=false
   164140 $at_check_filter
   164141 echo stderr:; cat "$at_stderr"
   164142 echo stdout:; cat "$at_stdout"
   164143 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164144 $at_failed && at_fn_log_failure
   164145 $at_traceon; }
   164146 
   164147     cp xml-tests/test.output expout
   164148   { set +x
   164149 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164150              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   164151              xml-tests/test.xml"
   164152 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164153 ( $at_check_trace; $XSLTPROC \
   164154              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   164155              xml-tests/test.xml
   164156 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164157 at_status=$? at_failed=false
   164158 $at_check_filter
   164159 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164160 $at_diff expout "$at_stdout" || at_failed=:
   164161 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164162 $at_failed && at_fn_log_failure
   164163 $at_traceon; }
   164164 
   164165   sort xml-tests/test.dot > expout
   164166   { set +x
   164167 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164168              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   164169              xml-tests/test.xml | sort"
   164170 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164171 ( $at_check_trace; $XSLTPROC \
   164172              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   164173              xml-tests/test.xml | sort
   164174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164175 at_status=$? at_failed=false
   164176 $at_check_filter
   164177 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164178 $at_diff expout "$at_stdout" || at_failed=:
   164179 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164180 $at_failed && at_fn_log_failure
   164181 $at_traceon; }
   164182 
   164183   rm -rf xml-tests expout
   164184   at_restore_special_files
   164185 fi
   164186 { set +x
   164187 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   164188 at_fn_check_prepare_trace "java.at:688"
   164189 ( $at_check_trace; bison YYParser.y
   164190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164191 at_status=$? at_failed=false
   164192 $at_check_filter
   164193 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164194 at_fn_diff_devnull "$at_stdout" || at_failed=:
   164195 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164196 $at_failed && at_fn_log_failure
   164197 $at_traceon; }
   164198 
   164199 
   164200 { set +x
   164201 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   164202 at_fn_check_prepare_trace "java.at:688"
   164203 ( $at_check_trace; grep '[mb]4_' YYParser.y
   164204 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164205 at_status=$? at_failed=false
   164206 $at_check_filter
   164207 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164208 echo stdout:; cat "$at_stdout"
   164209 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   164210 $at_failed && at_fn_log_failure
   164211 $at_traceon; }
   164212 
   164213 
   164214 $as_echo "java.at:688" >"$at_check_line_file"
   164215 (test -z "$CONF_JAVAC") \
   164216   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164217 $as_echo "java.at:688" >"$at_check_line_file"
   164218 (test -z "$CONF_JAVA") \
   164219   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164220 { set +x
   164221 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   164222 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   164223 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   164224 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164225 at_status=$? at_failed=false
   164226 $at_check_filter
   164227 echo stderr:; cat "$at_stderr"
   164228 echo stdout:; cat "$at_stdout"
   164229 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164230 $at_failed && at_fn_log_failure
   164231 $at_traceon; }
   164232 
   164233 
   164234 { set +x
   164235 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   164236 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   164237 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   164238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164239 at_status=$? at_failed=false
   164240 $at_check_filter
   164241 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164242 echo >>"$at_stdout"; $as_echo "1
   164243 " | \
   164244   $at_diff - "$at_stdout" || at_failed=:
   164245 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164246 $at_failed && at_fn_log_failure
   164247 $at_traceon; }
   164248 
   164249 
   164250 { set +x
   164251 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   164252 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   164253 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   164254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164255 at_status=$? at_failed=false
   164256 $at_check_filter
   164257 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164258 echo >>"$at_stdout"; $as_echo "1
   164259 " | \
   164260   $at_diff - "$at_stdout" || at_failed=:
   164261 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164262 $at_failed && at_fn_log_failure
   164263 $at_traceon; }
   164264 
   164265 
   164266 { set +x
   164267 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java"
   164268 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:688"
   164269 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java
   164270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164271 at_status=$? at_failed=false
   164272 $at_check_filter
   164273 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164274 echo >>"$at_stdout"; $as_echo "1
   164275 " | \
   164276   $at_diff - "$at_stdout" || at_failed=:
   164277 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164278 $at_failed && at_fn_log_failure
   164279 $at_traceon; }
   164280 
   164281 
   164282 
   164283 cat >YYParser.y <<'_ATEOF'
   164284 
   164285 %language "Java"
   164286 %locations
   164287 %debug
   164288 %error-verbose
   164289 %token-table
   164290 
   164291 %define throws "ClassNotFoundException, InstantiationException"
   164292 %define lex_throws "InterruptedException"
   164293 %initial-action {if (true) throw new InstantiationException();}
   164294 %%
   164295 start: "end" {throw new ClassNotFoundException();};
   164296 %%
   164297 class Position {}
   164298 _ATEOF
   164299 
   164300 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   164301   at_save_special_files
   164302   mkdir xml-tests
   164303     # Don't combine these Bison invocations since we want to be sure that
   164304   # --report=all isn't required to get the full XML file.
   164305   { set +x
   164306 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   164307                   --graph=xml-tests/test.dot YYParser.y"
   164308 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   164309 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   164310                   --graph=xml-tests/test.dot YYParser.y
   164311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164312 at_status=$? at_failed=false
   164313 $at_check_filter
   164314 echo stderr:; cat "$at_stderr"
   164315 echo stdout:; cat "$at_stdout"
   164316 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164317 $at_failed && at_fn_log_failure
   164318 $at_traceon; }
   164319 
   164320   { set +x
   164321 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   164322 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   164323 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   164324 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164325 at_status=$? at_failed=false
   164326 $at_check_filter
   164327 echo stderr:; cat "$at_stderr"
   164328 echo stdout:; cat "$at_stdout"
   164329 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164330 $at_failed && at_fn_log_failure
   164331 $at_traceon; }
   164332 
   164333     cp xml-tests/test.output expout
   164334   { set +x
   164335 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164336              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   164337              xml-tests/test.xml"
   164338 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164339 ( $at_check_trace; $XSLTPROC \
   164340              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   164341              xml-tests/test.xml
   164342 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164343 at_status=$? at_failed=false
   164344 $at_check_filter
   164345 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164346 $at_diff expout "$at_stdout" || at_failed=:
   164347 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164348 $at_failed && at_fn_log_failure
   164349 $at_traceon; }
   164350 
   164351   sort xml-tests/test.dot > expout
   164352   { set +x
   164353 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164354              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   164355              xml-tests/test.xml | sort"
   164356 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164357 ( $at_check_trace; $XSLTPROC \
   164358              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   164359              xml-tests/test.xml | sort
   164360 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164361 at_status=$? at_failed=false
   164362 $at_check_filter
   164363 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164364 $at_diff expout "$at_stdout" || at_failed=:
   164365 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164366 $at_failed && at_fn_log_failure
   164367 $at_traceon; }
   164368 
   164369   rm -rf xml-tests expout
   164370   at_restore_special_files
   164371 fi
   164372 { set +x
   164373 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   164374 at_fn_check_prepare_trace "java.at:688"
   164375 ( $at_check_trace; bison YYParser.y
   164376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164377 at_status=$? at_failed=false
   164378 $at_check_filter
   164379 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164380 at_fn_diff_devnull "$at_stdout" || at_failed=:
   164381 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164382 $at_failed && at_fn_log_failure
   164383 $at_traceon; }
   164384 
   164385 
   164386 { set +x
   164387 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   164388 at_fn_check_prepare_trace "java.at:688"
   164389 ( $at_check_trace; grep '[mb]4_' YYParser.y
   164390 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164391 at_status=$? at_failed=false
   164392 $at_check_filter
   164393 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164394 echo stdout:; cat "$at_stdout"
   164395 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   164396 $at_failed && at_fn_log_failure
   164397 $at_traceon; }
   164398 
   164399 
   164400 $as_echo "java.at:688" >"$at_check_line_file"
   164401 (test -z "$CONF_JAVAC") \
   164402   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164403 $as_echo "java.at:688" >"$at_check_line_file"
   164404 (test -z "$CONF_JAVA") \
   164405   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164406 { set +x
   164407 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   164408 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   164409 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   164410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164411 at_status=$? at_failed=false
   164412 $at_check_filter
   164413 echo stderr:; cat "$at_stderr"
   164414 echo stdout:; cat "$at_stdout"
   164415 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164416 $at_failed && at_fn_log_failure
   164417 $at_traceon; }
   164418 
   164419 
   164420 { set +x
   164421 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   164422 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   164423 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   164424 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164425 at_status=$? at_failed=false
   164426 $at_check_filter
   164427 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164428 echo >>"$at_stdout"; $as_echo "1
   164429 " | \
   164430   $at_diff - "$at_stdout" || at_failed=:
   164431 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164432 $at_failed && at_fn_log_failure
   164433 $at_traceon; }
   164434 
   164435 
   164436 { set +x
   164437 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   164438 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   164439 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   164440 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164441 at_status=$? at_failed=false
   164442 $at_check_filter
   164443 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164444 echo >>"$at_stdout"; $as_echo "1
   164445 " | \
   164446   $at_diff - "$at_stdout" || at_failed=:
   164447 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164448 $at_failed && at_fn_log_failure
   164449 $at_traceon; }
   164450 
   164451 
   164452 { set +x
   164453 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
   164454 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   164455 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java
   164456 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164457 at_status=$? at_failed=false
   164458 $at_check_filter
   164459 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164460 echo >>"$at_stdout"; $as_echo "1
   164461 " | \
   164462   $at_diff - "$at_stdout" || at_failed=:
   164463 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164464 $at_failed && at_fn_log_failure
   164465 $at_traceon; }
   164466 
   164467 
   164468 
   164469 cat >YYParser.y <<'_ATEOF'
   164470 
   164471 %language "Java"
   164472 %locations
   164473 %debug
   164474 %error-verbose
   164475 %token-table
   164476 
   164477 
   164478 %define lex_throws "InterruptedException, IllegalAccessException"
   164479 
   164480 %%
   164481 start: "end" {};
   164482 %%
   164483 class Position {}
   164484 _ATEOF
   164485 
   164486 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   164487   at_save_special_files
   164488   mkdir xml-tests
   164489     # Don't combine these Bison invocations since we want to be sure that
   164490   # --report=all isn't required to get the full XML file.
   164491   { set +x
   164492 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   164493                   --graph=xml-tests/test.dot YYParser.y"
   164494 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   164495 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   164496                   --graph=xml-tests/test.dot YYParser.y
   164497 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164498 at_status=$? at_failed=false
   164499 $at_check_filter
   164500 echo stderr:; cat "$at_stderr"
   164501 echo stdout:; cat "$at_stdout"
   164502 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164503 $at_failed && at_fn_log_failure
   164504 $at_traceon; }
   164505 
   164506   { set +x
   164507 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   164508 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   164509 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   164510 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164511 at_status=$? at_failed=false
   164512 $at_check_filter
   164513 echo stderr:; cat "$at_stderr"
   164514 echo stdout:; cat "$at_stdout"
   164515 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164516 $at_failed && at_fn_log_failure
   164517 $at_traceon; }
   164518 
   164519     cp xml-tests/test.output expout
   164520   { set +x
   164521 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164522              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   164523              xml-tests/test.xml"
   164524 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164525 ( $at_check_trace; $XSLTPROC \
   164526              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   164527              xml-tests/test.xml
   164528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164529 at_status=$? at_failed=false
   164530 $at_check_filter
   164531 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164532 $at_diff expout "$at_stdout" || at_failed=:
   164533 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164534 $at_failed && at_fn_log_failure
   164535 $at_traceon; }
   164536 
   164537   sort xml-tests/test.dot > expout
   164538   { set +x
   164539 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164540              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   164541              xml-tests/test.xml | sort"
   164542 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164543 ( $at_check_trace; $XSLTPROC \
   164544              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   164545              xml-tests/test.xml | sort
   164546 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164547 at_status=$? at_failed=false
   164548 $at_check_filter
   164549 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164550 $at_diff expout "$at_stdout" || at_failed=:
   164551 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164552 $at_failed && at_fn_log_failure
   164553 $at_traceon; }
   164554 
   164555   rm -rf xml-tests expout
   164556   at_restore_special_files
   164557 fi
   164558 { set +x
   164559 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   164560 at_fn_check_prepare_trace "java.at:688"
   164561 ( $at_check_trace; bison YYParser.y
   164562 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164563 at_status=$? at_failed=false
   164564 $at_check_filter
   164565 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164566 at_fn_diff_devnull "$at_stdout" || at_failed=:
   164567 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164568 $at_failed && at_fn_log_failure
   164569 $at_traceon; }
   164570 
   164571 
   164572 { set +x
   164573 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   164574 at_fn_check_prepare_trace "java.at:688"
   164575 ( $at_check_trace; grep '[mb]4_' YYParser.y
   164576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164577 at_status=$? at_failed=false
   164578 $at_check_filter
   164579 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164580 echo stdout:; cat "$at_stdout"
   164581 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   164582 $at_failed && at_fn_log_failure
   164583 $at_traceon; }
   164584 
   164585 
   164586 $as_echo "java.at:688" >"$at_check_line_file"
   164587 (test -z "$CONF_JAVAC") \
   164588   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164589 $as_echo "java.at:688" >"$at_check_line_file"
   164590 (test -z "$CONF_JAVA") \
   164591   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164592 { set +x
   164593 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   164594 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   164595 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   164596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164597 at_status=$? at_failed=false
   164598 $at_check_filter
   164599 echo stderr:; cat "$at_stderr"
   164600 echo stdout:; cat "$at_stdout"
   164601 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164602 $at_failed && at_fn_log_failure
   164603 $at_traceon; }
   164604 
   164605 
   164606 { set +x
   164607 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   164608 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   164609 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   164610 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164611 at_status=$? at_failed=false
   164612 $at_check_filter
   164613 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164614 echo >>"$at_stdout"; $as_echo "1
   164615 " | \
   164616   $at_diff - "$at_stdout" || at_failed=:
   164617 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164618 $at_failed && at_fn_log_failure
   164619 $at_traceon; }
   164620 
   164621 
   164622 { set +x
   164623 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   164624 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   164625 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   164626 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164627 at_status=$? at_failed=false
   164628 $at_check_filter
   164629 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164630 echo >>"$at_stdout"; $as_echo "1
   164631 " | \
   164632   $at_diff - "$at_stdout" || at_failed=:
   164633 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164634 $at_failed && at_fn_log_failure
   164635 $at_traceon; }
   164636 
   164637 
   164638 { set +x
   164639 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
   164640 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688"
   164641 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
   164642 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164643 at_status=$? at_failed=false
   164644 $at_check_filter
   164645 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164646 echo >>"$at_stdout"; $as_echo "1
   164647 " | \
   164648   $at_diff - "$at_stdout" || at_failed=:
   164649 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164650 $at_failed && at_fn_log_failure
   164651 $at_traceon; }
   164652 
   164653 
   164654 
   164655 cat >YYParser.y <<'_ATEOF'
   164656 
   164657 %language "Java"
   164658 %locations
   164659 %debug
   164660 %error-verbose
   164661 %token-table
   164662 
   164663 %define throws ""
   164664 %define lex_throws "InterruptedException, IllegalAccessException"
   164665 
   164666 %%
   164667 start: "end" {};
   164668 %%
   164669 class Position {}
   164670 _ATEOF
   164671 
   164672 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   164673   at_save_special_files
   164674   mkdir xml-tests
   164675     # Don't combine these Bison invocations since we want to be sure that
   164676   # --report=all isn't required to get the full XML file.
   164677   { set +x
   164678 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   164679                   --graph=xml-tests/test.dot YYParser.y"
   164680 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   164681 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   164682                   --graph=xml-tests/test.dot YYParser.y
   164683 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164684 at_status=$? at_failed=false
   164685 $at_check_filter
   164686 echo stderr:; cat "$at_stderr"
   164687 echo stdout:; cat "$at_stdout"
   164688 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164689 $at_failed && at_fn_log_failure
   164690 $at_traceon; }
   164691 
   164692   { set +x
   164693 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   164694 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   164695 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   164696 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164697 at_status=$? at_failed=false
   164698 $at_check_filter
   164699 echo stderr:; cat "$at_stderr"
   164700 echo stdout:; cat "$at_stdout"
   164701 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164702 $at_failed && at_fn_log_failure
   164703 $at_traceon; }
   164704 
   164705     cp xml-tests/test.output expout
   164706   { set +x
   164707 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164708              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   164709              xml-tests/test.xml"
   164710 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164711 ( $at_check_trace; $XSLTPROC \
   164712              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   164713              xml-tests/test.xml
   164714 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164715 at_status=$? at_failed=false
   164716 $at_check_filter
   164717 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164718 $at_diff expout "$at_stdout" || at_failed=:
   164719 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164720 $at_failed && at_fn_log_failure
   164721 $at_traceon; }
   164722 
   164723   sort xml-tests/test.dot > expout
   164724   { set +x
   164725 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164726              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   164727              xml-tests/test.xml | sort"
   164728 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164729 ( $at_check_trace; $XSLTPROC \
   164730              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   164731              xml-tests/test.xml | sort
   164732 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164733 at_status=$? at_failed=false
   164734 $at_check_filter
   164735 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164736 $at_diff expout "$at_stdout" || at_failed=:
   164737 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164738 $at_failed && at_fn_log_failure
   164739 $at_traceon; }
   164740 
   164741   rm -rf xml-tests expout
   164742   at_restore_special_files
   164743 fi
   164744 { set +x
   164745 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   164746 at_fn_check_prepare_trace "java.at:688"
   164747 ( $at_check_trace; bison YYParser.y
   164748 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164749 at_status=$? at_failed=false
   164750 $at_check_filter
   164751 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164752 at_fn_diff_devnull "$at_stdout" || at_failed=:
   164753 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164754 $at_failed && at_fn_log_failure
   164755 $at_traceon; }
   164756 
   164757 
   164758 { set +x
   164759 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   164760 at_fn_check_prepare_trace "java.at:688"
   164761 ( $at_check_trace; grep '[mb]4_' YYParser.y
   164762 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164763 at_status=$? at_failed=false
   164764 $at_check_filter
   164765 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164766 echo stdout:; cat "$at_stdout"
   164767 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   164768 $at_failed && at_fn_log_failure
   164769 $at_traceon; }
   164770 
   164771 
   164772 $as_echo "java.at:688" >"$at_check_line_file"
   164773 (test -z "$CONF_JAVAC") \
   164774   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164775 $as_echo "java.at:688" >"$at_check_line_file"
   164776 (test -z "$CONF_JAVA") \
   164777   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164778 { set +x
   164779 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   164780 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   164781 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   164782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164783 at_status=$? at_failed=false
   164784 $at_check_filter
   164785 echo stderr:; cat "$at_stderr"
   164786 echo stdout:; cat "$at_stdout"
   164787 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164788 $at_failed && at_fn_log_failure
   164789 $at_traceon; }
   164790 
   164791 
   164792 { set +x
   164793 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   164794 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   164795 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   164796 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164797 at_status=$? at_failed=false
   164798 $at_check_filter
   164799 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164800 echo >>"$at_stdout"; $as_echo "1
   164801 " | \
   164802   $at_diff - "$at_stdout" || at_failed=:
   164803 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164804 $at_failed && at_fn_log_failure
   164805 $at_traceon; }
   164806 
   164807 
   164808 { set +x
   164809 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   164810 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   164811 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   164812 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164813 at_status=$? at_failed=false
   164814 $at_check_filter
   164815 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164816 echo >>"$at_stdout"; $as_echo "1
   164817 " | \
   164818   $at_diff - "$at_stdout" || at_failed=:
   164819 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164820 $at_failed && at_fn_log_failure
   164821 $at_traceon; }
   164822 
   164823 
   164824 { set +x
   164825 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
   164826 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688"
   164827 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
   164828 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164829 at_status=$? at_failed=false
   164830 $at_check_filter
   164831 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164832 echo >>"$at_stdout"; $as_echo "1
   164833 " | \
   164834   $at_diff - "$at_stdout" || at_failed=:
   164835 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164836 $at_failed && at_fn_log_failure
   164837 $at_traceon; }
   164838 
   164839 
   164840 
   164841 cat >YYParser.y <<'_ATEOF'
   164842 
   164843 %language "Java"
   164844 %locations
   164845 %debug
   164846 %error-verbose
   164847 %token-table
   164848 
   164849 %define throws "ClassNotFoundException"
   164850 %define lex_throws "InterruptedException, IllegalAccessException"
   164851 %initial-action {if (true) throw new ClassNotFoundException();}
   164852 %%
   164853 start: "end" {throw new ClassNotFoundException();};
   164854 %%
   164855 class Position {}
   164856 _ATEOF
   164857 
   164858 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   164859   at_save_special_files
   164860   mkdir xml-tests
   164861     # Don't combine these Bison invocations since we want to be sure that
   164862   # --report=all isn't required to get the full XML file.
   164863   { set +x
   164864 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   164865                   --graph=xml-tests/test.dot YYParser.y"
   164866 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   164867 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   164868                   --graph=xml-tests/test.dot YYParser.y
   164869 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164870 at_status=$? at_failed=false
   164871 $at_check_filter
   164872 echo stderr:; cat "$at_stderr"
   164873 echo stdout:; cat "$at_stdout"
   164874 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164875 $at_failed && at_fn_log_failure
   164876 $at_traceon; }
   164877 
   164878   { set +x
   164879 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   164880 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   164881 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   164882 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164883 at_status=$? at_failed=false
   164884 $at_check_filter
   164885 echo stderr:; cat "$at_stderr"
   164886 echo stdout:; cat "$at_stdout"
   164887 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164888 $at_failed && at_fn_log_failure
   164889 $at_traceon; }
   164890 
   164891     cp xml-tests/test.output expout
   164892   { set +x
   164893 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164894              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   164895              xml-tests/test.xml"
   164896 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164897 ( $at_check_trace; $XSLTPROC \
   164898              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   164899              xml-tests/test.xml
   164900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164901 at_status=$? at_failed=false
   164902 $at_check_filter
   164903 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164904 $at_diff expout "$at_stdout" || at_failed=:
   164905 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164906 $at_failed && at_fn_log_failure
   164907 $at_traceon; }
   164908 
   164909   sort xml-tests/test.dot > expout
   164910   { set +x
   164911 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   164912              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   164913              xml-tests/test.xml | sort"
   164914 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   164915 ( $at_check_trace; $XSLTPROC \
   164916              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   164917              xml-tests/test.xml | sort
   164918 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164919 at_status=$? at_failed=false
   164920 $at_check_filter
   164921 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164922 $at_diff expout "$at_stdout" || at_failed=:
   164923 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164924 $at_failed && at_fn_log_failure
   164925 $at_traceon; }
   164926 
   164927   rm -rf xml-tests expout
   164928   at_restore_special_files
   164929 fi
   164930 { set +x
   164931 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   164932 at_fn_check_prepare_trace "java.at:688"
   164933 ( $at_check_trace; bison YYParser.y
   164934 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164935 at_status=$? at_failed=false
   164936 $at_check_filter
   164937 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164938 at_fn_diff_devnull "$at_stdout" || at_failed=:
   164939 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164940 $at_failed && at_fn_log_failure
   164941 $at_traceon; }
   164942 
   164943 
   164944 { set +x
   164945 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   164946 at_fn_check_prepare_trace "java.at:688"
   164947 ( $at_check_trace; grep '[mb]4_' YYParser.y
   164948 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164949 at_status=$? at_failed=false
   164950 $at_check_filter
   164951 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164952 echo stdout:; cat "$at_stdout"
   164953 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   164954 $at_failed && at_fn_log_failure
   164955 $at_traceon; }
   164956 
   164957 
   164958 $as_echo "java.at:688" >"$at_check_line_file"
   164959 (test -z "$CONF_JAVAC") \
   164960   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164961 $as_echo "java.at:688" >"$at_check_line_file"
   164962 (test -z "$CONF_JAVA") \
   164963   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   164964 { set +x
   164965 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   164966 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   164967 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   164968 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164969 at_status=$? at_failed=false
   164970 $at_check_filter
   164971 echo stderr:; cat "$at_stderr"
   164972 echo stdout:; cat "$at_stdout"
   164973 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164974 $at_failed && at_fn_log_failure
   164975 $at_traceon; }
   164976 
   164977 
   164978 { set +x
   164979 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   164980 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   164981 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   164982 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164983 at_status=$? at_failed=false
   164984 $at_check_filter
   164985 at_fn_diff_devnull "$at_stderr" || at_failed=:
   164986 echo >>"$at_stdout"; $as_echo "1
   164987 " | \
   164988   $at_diff - "$at_stdout" || at_failed=:
   164989 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   164990 $at_failed && at_fn_log_failure
   164991 $at_traceon; }
   164992 
   164993 
   164994 { set +x
   164995 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   164996 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   164997 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   164998 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   164999 at_status=$? at_failed=false
   165000 $at_check_filter
   165001 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165002 echo >>"$at_stdout"; $as_echo "1
   165003 " | \
   165004   $at_diff - "$at_stdout" || at_failed=:
   165005 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165006 $at_failed && at_fn_log_failure
   165007 $at_traceon; }
   165008 
   165009 
   165010 { set +x
   165011 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java"
   165012 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:688"
   165013 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java
   165014 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165015 at_status=$? at_failed=false
   165016 $at_check_filter
   165017 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165018 echo >>"$at_stdout"; $as_echo "1
   165019 " | \
   165020   $at_diff - "$at_stdout" || at_failed=:
   165021 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165022 $at_failed && at_fn_log_failure
   165023 $at_traceon; }
   165024 
   165025 
   165026 
   165027 cat >YYParser.y <<'_ATEOF'
   165028 
   165029 %language "Java"
   165030 %locations
   165031 %debug
   165032 %error-verbose
   165033 %token-table
   165034 
   165035 %define throws "ClassNotFoundException, InstantiationException"
   165036 %define lex_throws "InterruptedException, IllegalAccessException"
   165037 %initial-action {if (true) throw new InstantiationException();}
   165038 %%
   165039 start: "end" {throw new ClassNotFoundException();};
   165040 %%
   165041 class Position {}
   165042 _ATEOF
   165043 
   165044 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   165045   at_save_special_files
   165046   mkdir xml-tests
   165047     # Don't combine these Bison invocations since we want to be sure that
   165048   # --report=all isn't required to get the full XML file.
   165049   { set +x
   165050 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   165051                   --graph=xml-tests/test.dot YYParser.y"
   165052 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   165053 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   165054                   --graph=xml-tests/test.dot YYParser.y
   165055 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165056 at_status=$? at_failed=false
   165057 $at_check_filter
   165058 echo stderr:; cat "$at_stderr"
   165059 echo stdout:; cat "$at_stdout"
   165060 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165061 $at_failed && at_fn_log_failure
   165062 $at_traceon; }
   165063 
   165064   { set +x
   165065 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   165066 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   165067 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   165068 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165069 at_status=$? at_failed=false
   165070 $at_check_filter
   165071 echo stderr:; cat "$at_stderr"
   165072 echo stdout:; cat "$at_stdout"
   165073 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165074 $at_failed && at_fn_log_failure
   165075 $at_traceon; }
   165076 
   165077     cp xml-tests/test.output expout
   165078   { set +x
   165079 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165080              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   165081              xml-tests/test.xml"
   165082 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165083 ( $at_check_trace; $XSLTPROC \
   165084              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   165085              xml-tests/test.xml
   165086 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165087 at_status=$? at_failed=false
   165088 $at_check_filter
   165089 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165090 $at_diff expout "$at_stdout" || at_failed=:
   165091 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165092 $at_failed && at_fn_log_failure
   165093 $at_traceon; }
   165094 
   165095   sort xml-tests/test.dot > expout
   165096   { set +x
   165097 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165098              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   165099              xml-tests/test.xml | sort"
   165100 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165101 ( $at_check_trace; $XSLTPROC \
   165102              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   165103              xml-tests/test.xml | sort
   165104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165105 at_status=$? at_failed=false
   165106 $at_check_filter
   165107 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165108 $at_diff expout "$at_stdout" || at_failed=:
   165109 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165110 $at_failed && at_fn_log_failure
   165111 $at_traceon; }
   165112 
   165113   rm -rf xml-tests expout
   165114   at_restore_special_files
   165115 fi
   165116 { set +x
   165117 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   165118 at_fn_check_prepare_trace "java.at:688"
   165119 ( $at_check_trace; bison YYParser.y
   165120 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165121 at_status=$? at_failed=false
   165122 $at_check_filter
   165123 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165124 at_fn_diff_devnull "$at_stdout" || at_failed=:
   165125 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165126 $at_failed && at_fn_log_failure
   165127 $at_traceon; }
   165128 
   165129 
   165130 { set +x
   165131 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   165132 at_fn_check_prepare_trace "java.at:688"
   165133 ( $at_check_trace; grep '[mb]4_' YYParser.y
   165134 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165135 at_status=$? at_failed=false
   165136 $at_check_filter
   165137 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165138 echo stdout:; cat "$at_stdout"
   165139 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   165140 $at_failed && at_fn_log_failure
   165141 $at_traceon; }
   165142 
   165143 
   165144 $as_echo "java.at:688" >"$at_check_line_file"
   165145 (test -z "$CONF_JAVAC") \
   165146   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165147 $as_echo "java.at:688" >"$at_check_line_file"
   165148 (test -z "$CONF_JAVA") \
   165149   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165150 { set +x
   165151 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   165152 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   165153 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   165154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165155 at_status=$? at_failed=false
   165156 $at_check_filter
   165157 echo stderr:; cat "$at_stderr"
   165158 echo stdout:; cat "$at_stdout"
   165159 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165160 $at_failed && at_fn_log_failure
   165161 $at_traceon; }
   165162 
   165163 
   165164 { set +x
   165165 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   165166 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   165167 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   165168 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165169 at_status=$? at_failed=false
   165170 $at_check_filter
   165171 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165172 echo >>"$at_stdout"; $as_echo "1
   165173 " | \
   165174   $at_diff - "$at_stdout" || at_failed=:
   165175 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165176 $at_failed && at_fn_log_failure
   165177 $at_traceon; }
   165178 
   165179 
   165180 { set +x
   165181 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   165182 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   165183 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   165184 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165185 at_status=$? at_failed=false
   165186 $at_check_filter
   165187 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165188 echo >>"$at_stdout"; $as_echo "1
   165189 " | \
   165190   $at_diff - "$at_stdout" || at_failed=:
   165191 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165192 $at_failed && at_fn_log_failure
   165193 $at_traceon; }
   165194 
   165195 
   165196 { set +x
   165197 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
   165198 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   165199 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java
   165200 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165201 at_status=$? at_failed=false
   165202 $at_check_filter
   165203 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165204 echo >>"$at_stdout"; $as_echo "1
   165205 " | \
   165206   $at_diff - "$at_stdout" || at_failed=:
   165207 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165208 $at_failed && at_fn_log_failure
   165209 $at_traceon; }
   165210 
   165211 
   165212 
   165213 cat >YYParser.y <<'_ATEOF'
   165214 
   165215 %language "Java"
   165216 %locations
   165217 %debug
   165218 %error-verbose
   165219 %token-table
   165220 
   165221 
   165222 
   165223 
   165224 
   165225 %code lexer
   165226 {
   165227   Object yylval;
   165228   public Object getLVal() { return yylval; }
   165229 
   165230   public Position getStartPos() { return null; }
   165231   public Position getEndPos()   { return null; }
   165232 
   165233   public void yyerror (Location loc, String s)
   165234   {
   165235     System.err.println (loc + ": " + s);
   165236   }
   165237 
   165238   public int yylex () throws java.io.IOException
   165239   {
   165240     throw new java.io.IOException();
   165241   }
   165242 
   165243 
   165244 }
   165245 %%
   165246 start: "end" {};
   165247 %%
   165248 class Position {}
   165249 _ATEOF
   165250 
   165251 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   165252   at_save_special_files
   165253   mkdir xml-tests
   165254     # Don't combine these Bison invocations since we want to be sure that
   165255   # --report=all isn't required to get the full XML file.
   165256   { set +x
   165257 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   165258                   --graph=xml-tests/test.dot YYParser.y"
   165259 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   165260 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   165261                   --graph=xml-tests/test.dot YYParser.y
   165262 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165263 at_status=$? at_failed=false
   165264 $at_check_filter
   165265 echo stderr:; cat "$at_stderr"
   165266 echo stdout:; cat "$at_stdout"
   165267 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165268 $at_failed && at_fn_log_failure
   165269 $at_traceon; }
   165270 
   165271   { set +x
   165272 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   165273 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   165274 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   165275 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165276 at_status=$? at_failed=false
   165277 $at_check_filter
   165278 echo stderr:; cat "$at_stderr"
   165279 echo stdout:; cat "$at_stdout"
   165280 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165281 $at_failed && at_fn_log_failure
   165282 $at_traceon; }
   165283 
   165284     cp xml-tests/test.output expout
   165285   { set +x
   165286 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165287              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   165288              xml-tests/test.xml"
   165289 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165290 ( $at_check_trace; $XSLTPROC \
   165291              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   165292              xml-tests/test.xml
   165293 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165294 at_status=$? at_failed=false
   165295 $at_check_filter
   165296 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165297 $at_diff expout "$at_stdout" || at_failed=:
   165298 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165299 $at_failed && at_fn_log_failure
   165300 $at_traceon; }
   165301 
   165302   sort xml-tests/test.dot > expout
   165303   { set +x
   165304 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165305              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   165306              xml-tests/test.xml | sort"
   165307 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165308 ( $at_check_trace; $XSLTPROC \
   165309              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   165310              xml-tests/test.xml | sort
   165311 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165312 at_status=$? at_failed=false
   165313 $at_check_filter
   165314 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165315 $at_diff expout "$at_stdout" || at_failed=:
   165316 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165317 $at_failed && at_fn_log_failure
   165318 $at_traceon; }
   165319 
   165320   rm -rf xml-tests expout
   165321   at_restore_special_files
   165322 fi
   165323 { set +x
   165324 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   165325 at_fn_check_prepare_trace "java.at:688"
   165326 ( $at_check_trace; bison YYParser.y
   165327 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165328 at_status=$? at_failed=false
   165329 $at_check_filter
   165330 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165331 at_fn_diff_devnull "$at_stdout" || at_failed=:
   165332 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165333 $at_failed && at_fn_log_failure
   165334 $at_traceon; }
   165335 
   165336 
   165337 { set +x
   165338 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   165339 at_fn_check_prepare_trace "java.at:688"
   165340 ( $at_check_trace; grep '[mb]4_' YYParser.y
   165341 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165342 at_status=$? at_failed=false
   165343 $at_check_filter
   165344 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165345 echo stdout:; cat "$at_stdout"
   165346 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   165347 $at_failed && at_fn_log_failure
   165348 $at_traceon; }
   165349 
   165350 
   165351 $as_echo "java.at:688" >"$at_check_line_file"
   165352 (test -z "$CONF_JAVAC") \
   165353   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165354 $as_echo "java.at:688" >"$at_check_line_file"
   165355 (test -z "$CONF_JAVA") \
   165356   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165357 { set +x
   165358 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   165359 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   165360 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   165361 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165362 at_status=$? at_failed=false
   165363 $at_check_filter
   165364 echo stderr:; cat "$at_stderr"
   165365 echo stdout:; cat "$at_stdout"
   165366 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165367 $at_failed && at_fn_log_failure
   165368 $at_traceon; }
   165369 
   165370 
   165371 { set +x
   165372 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   165373 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   165374 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   165375 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165376 at_status=$? at_failed=false
   165377 $at_check_filter
   165378 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165379 echo >>"$at_stdout"; $as_echo "1
   165380 " | \
   165381   $at_diff - "$at_stdout" || at_failed=:
   165382 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165383 $at_failed && at_fn_log_failure
   165384 $at_traceon; }
   165385 
   165386 
   165387 { set +x
   165388 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   165389 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   165390 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   165391 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165392 at_status=$? at_failed=false
   165393 $at_check_filter
   165394 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165395 echo >>"$at_stdout"; $as_echo "1
   165396 " | \
   165397   $at_diff - "$at_stdout" || at_failed=:
   165398 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165399 $at_failed && at_fn_log_failure
   165400 $at_traceon; }
   165401 
   165402 
   165403 { set +x
   165404 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
   165405 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688"
   165406 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
   165407 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165408 at_status=$? at_failed=false
   165409 $at_check_filter
   165410 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165411 echo >>"$at_stdout"; $as_echo "1
   165412 " | \
   165413   $at_diff - "$at_stdout" || at_failed=:
   165414 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165415 $at_failed && at_fn_log_failure
   165416 $at_traceon; }
   165417 
   165418 
   165419 
   165420 cat >YYParser.y <<'_ATEOF'
   165421 
   165422 %language "Java"
   165423 %locations
   165424 %debug
   165425 %error-verbose
   165426 %token-table
   165427 
   165428 %define throws ""
   165429 
   165430 
   165431 
   165432 %code lexer
   165433 {
   165434   Object yylval;
   165435   public Object getLVal() { return yylval; }
   165436 
   165437   public Position getStartPos() { return null; }
   165438   public Position getEndPos()   { return null; }
   165439 
   165440   public void yyerror (Location loc, String s)
   165441   {
   165442     System.err.println (loc + ": " + s);
   165443   }
   165444 
   165445   public int yylex () throws java.io.IOException
   165446   {
   165447     throw new java.io.IOException();
   165448   }
   165449 
   165450 
   165451 }
   165452 %%
   165453 start: "end" {};
   165454 %%
   165455 class Position {}
   165456 _ATEOF
   165457 
   165458 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   165459   at_save_special_files
   165460   mkdir xml-tests
   165461     # Don't combine these Bison invocations since we want to be sure that
   165462   # --report=all isn't required to get the full XML file.
   165463   { set +x
   165464 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   165465                   --graph=xml-tests/test.dot YYParser.y"
   165466 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   165467 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   165468                   --graph=xml-tests/test.dot YYParser.y
   165469 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165470 at_status=$? at_failed=false
   165471 $at_check_filter
   165472 echo stderr:; cat "$at_stderr"
   165473 echo stdout:; cat "$at_stdout"
   165474 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165475 $at_failed && at_fn_log_failure
   165476 $at_traceon; }
   165477 
   165478   { set +x
   165479 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   165480 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   165481 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   165482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165483 at_status=$? at_failed=false
   165484 $at_check_filter
   165485 echo stderr:; cat "$at_stderr"
   165486 echo stdout:; cat "$at_stdout"
   165487 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165488 $at_failed && at_fn_log_failure
   165489 $at_traceon; }
   165490 
   165491     cp xml-tests/test.output expout
   165492   { set +x
   165493 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165494              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   165495              xml-tests/test.xml"
   165496 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165497 ( $at_check_trace; $XSLTPROC \
   165498              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   165499              xml-tests/test.xml
   165500 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165501 at_status=$? at_failed=false
   165502 $at_check_filter
   165503 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165504 $at_diff expout "$at_stdout" || at_failed=:
   165505 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165506 $at_failed && at_fn_log_failure
   165507 $at_traceon; }
   165508 
   165509   sort xml-tests/test.dot > expout
   165510   { set +x
   165511 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165512              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   165513              xml-tests/test.xml | sort"
   165514 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165515 ( $at_check_trace; $XSLTPROC \
   165516              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   165517              xml-tests/test.xml | sort
   165518 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165519 at_status=$? at_failed=false
   165520 $at_check_filter
   165521 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165522 $at_diff expout "$at_stdout" || at_failed=:
   165523 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165524 $at_failed && at_fn_log_failure
   165525 $at_traceon; }
   165526 
   165527   rm -rf xml-tests expout
   165528   at_restore_special_files
   165529 fi
   165530 { set +x
   165531 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   165532 at_fn_check_prepare_trace "java.at:688"
   165533 ( $at_check_trace; bison YYParser.y
   165534 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165535 at_status=$? at_failed=false
   165536 $at_check_filter
   165537 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165538 at_fn_diff_devnull "$at_stdout" || at_failed=:
   165539 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165540 $at_failed && at_fn_log_failure
   165541 $at_traceon; }
   165542 
   165543 
   165544 { set +x
   165545 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   165546 at_fn_check_prepare_trace "java.at:688"
   165547 ( $at_check_trace; grep '[mb]4_' YYParser.y
   165548 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165549 at_status=$? at_failed=false
   165550 $at_check_filter
   165551 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165552 echo stdout:; cat "$at_stdout"
   165553 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   165554 $at_failed && at_fn_log_failure
   165555 $at_traceon; }
   165556 
   165557 
   165558 $as_echo "java.at:688" >"$at_check_line_file"
   165559 (test -z "$CONF_JAVAC") \
   165560   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165561 $as_echo "java.at:688" >"$at_check_line_file"
   165562 (test -z "$CONF_JAVA") \
   165563   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165564 { set +x
   165565 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   165566 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   165567 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   165568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165569 at_status=$? at_failed=false
   165570 $at_check_filter
   165571 echo stderr:; cat "$at_stderr"
   165572 echo stdout:; cat "$at_stdout"
   165573 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165574 $at_failed && at_fn_log_failure
   165575 $at_traceon; }
   165576 
   165577 
   165578 { set +x
   165579 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   165580 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   165581 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   165582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165583 at_status=$? at_failed=false
   165584 $at_check_filter
   165585 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165586 echo >>"$at_stdout"; $as_echo "1
   165587 " | \
   165588   $at_diff - "$at_stdout" || at_failed=:
   165589 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165590 $at_failed && at_fn_log_failure
   165591 $at_traceon; }
   165592 
   165593 
   165594 { set +x
   165595 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   165596 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   165597 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   165598 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165599 at_status=$? at_failed=false
   165600 $at_check_filter
   165601 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165602 echo >>"$at_stdout"; $as_echo "1
   165603 " | \
   165604   $at_diff - "$at_stdout" || at_failed=:
   165605 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165606 $at_failed && at_fn_log_failure
   165607 $at_traceon; }
   165608 
   165609 
   165610 { set +x
   165611 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
   165612 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:688"
   165613 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
   165614 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165615 at_status=$? at_failed=false
   165616 $at_check_filter
   165617 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165618 echo >>"$at_stdout"; $as_echo "1
   165619 " | \
   165620   $at_diff - "$at_stdout" || at_failed=:
   165621 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165622 $at_failed && at_fn_log_failure
   165623 $at_traceon; }
   165624 
   165625 
   165626 
   165627 cat >YYParser.y <<'_ATEOF'
   165628 
   165629 %language "Java"
   165630 %locations
   165631 %debug
   165632 %error-verbose
   165633 %token-table
   165634 
   165635 %define throws "ClassNotFoundException"
   165636 
   165637 %initial-action {if (true) throw new ClassNotFoundException();}
   165638 
   165639 %code lexer
   165640 {
   165641   Object yylval;
   165642   public Object getLVal() { return yylval; }
   165643 
   165644   public Position getStartPos() { return null; }
   165645   public Position getEndPos()   { return null; }
   165646 
   165647   public void yyerror (Location loc, String s)
   165648   {
   165649     System.err.println (loc + ": " + s);
   165650   }
   165651 
   165652   public int yylex () throws java.io.IOException
   165653   {
   165654     throw new java.io.IOException();
   165655   }
   165656 
   165657 
   165658 }
   165659 %%
   165660 start: "end" {throw new ClassNotFoundException();};
   165661 %%
   165662 class Position {}
   165663 _ATEOF
   165664 
   165665 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   165666   at_save_special_files
   165667   mkdir xml-tests
   165668     # Don't combine these Bison invocations since we want to be sure that
   165669   # --report=all isn't required to get the full XML file.
   165670   { set +x
   165671 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   165672                   --graph=xml-tests/test.dot YYParser.y"
   165673 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   165674 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   165675                   --graph=xml-tests/test.dot YYParser.y
   165676 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165677 at_status=$? at_failed=false
   165678 $at_check_filter
   165679 echo stderr:; cat "$at_stderr"
   165680 echo stdout:; cat "$at_stdout"
   165681 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165682 $at_failed && at_fn_log_failure
   165683 $at_traceon; }
   165684 
   165685   { set +x
   165686 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   165687 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   165688 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   165689 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165690 at_status=$? at_failed=false
   165691 $at_check_filter
   165692 echo stderr:; cat "$at_stderr"
   165693 echo stdout:; cat "$at_stdout"
   165694 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165695 $at_failed && at_fn_log_failure
   165696 $at_traceon; }
   165697 
   165698     cp xml-tests/test.output expout
   165699   { set +x
   165700 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165701              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   165702              xml-tests/test.xml"
   165703 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165704 ( $at_check_trace; $XSLTPROC \
   165705              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   165706              xml-tests/test.xml
   165707 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165708 at_status=$? at_failed=false
   165709 $at_check_filter
   165710 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165711 $at_diff expout "$at_stdout" || at_failed=:
   165712 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165713 $at_failed && at_fn_log_failure
   165714 $at_traceon; }
   165715 
   165716   sort xml-tests/test.dot > expout
   165717   { set +x
   165718 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165719              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   165720              xml-tests/test.xml | sort"
   165721 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165722 ( $at_check_trace; $XSLTPROC \
   165723              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   165724              xml-tests/test.xml | sort
   165725 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165726 at_status=$? at_failed=false
   165727 $at_check_filter
   165728 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165729 $at_diff expout "$at_stdout" || at_failed=:
   165730 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165731 $at_failed && at_fn_log_failure
   165732 $at_traceon; }
   165733 
   165734   rm -rf xml-tests expout
   165735   at_restore_special_files
   165736 fi
   165737 { set +x
   165738 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   165739 at_fn_check_prepare_trace "java.at:688"
   165740 ( $at_check_trace; bison YYParser.y
   165741 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165742 at_status=$? at_failed=false
   165743 $at_check_filter
   165744 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165745 at_fn_diff_devnull "$at_stdout" || at_failed=:
   165746 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165747 $at_failed && at_fn_log_failure
   165748 $at_traceon; }
   165749 
   165750 
   165751 { set +x
   165752 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   165753 at_fn_check_prepare_trace "java.at:688"
   165754 ( $at_check_trace; grep '[mb]4_' YYParser.y
   165755 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165756 at_status=$? at_failed=false
   165757 $at_check_filter
   165758 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165759 echo stdout:; cat "$at_stdout"
   165760 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   165761 $at_failed && at_fn_log_failure
   165762 $at_traceon; }
   165763 
   165764 
   165765 $as_echo "java.at:688" >"$at_check_line_file"
   165766 (test -z "$CONF_JAVAC") \
   165767   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165768 $as_echo "java.at:688" >"$at_check_line_file"
   165769 (test -z "$CONF_JAVA") \
   165770   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165771 { set +x
   165772 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   165773 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   165774 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   165775 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165776 at_status=$? at_failed=false
   165777 $at_check_filter
   165778 echo stderr:; cat "$at_stderr"
   165779 echo stdout:; cat "$at_stdout"
   165780 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165781 $at_failed && at_fn_log_failure
   165782 $at_traceon; }
   165783 
   165784 
   165785 { set +x
   165786 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   165787 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   165788 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   165789 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165790 at_status=$? at_failed=false
   165791 $at_check_filter
   165792 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165793 echo >>"$at_stdout"; $as_echo "1
   165794 " | \
   165795   $at_diff - "$at_stdout" || at_failed=:
   165796 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165797 $at_failed && at_fn_log_failure
   165798 $at_traceon; }
   165799 
   165800 
   165801 { set +x
   165802 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   165803 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   165804 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   165805 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165806 at_status=$? at_failed=false
   165807 $at_check_filter
   165808 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165809 echo >>"$at_stdout"; $as_echo "1
   165810 " | \
   165811   $at_diff - "$at_stdout" || at_failed=:
   165812 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165813 $at_failed && at_fn_log_failure
   165814 $at_traceon; }
   165815 
   165816 
   165817 { set +x
   165818 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java"
   165819 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:688"
   165820 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java
   165821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165822 at_status=$? at_failed=false
   165823 $at_check_filter
   165824 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165825 echo >>"$at_stdout"; $as_echo "1
   165826 " | \
   165827   $at_diff - "$at_stdout" || at_failed=:
   165828 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165829 $at_failed && at_fn_log_failure
   165830 $at_traceon; }
   165831 
   165832 
   165833 
   165834 cat >YYParser.y <<'_ATEOF'
   165835 
   165836 %language "Java"
   165837 %locations
   165838 %debug
   165839 %error-verbose
   165840 %token-table
   165841 
   165842 %define throws "ClassNotFoundException, InstantiationException"
   165843 
   165844 %initial-action {if (true) throw new InstantiationException();}
   165845 
   165846 %code lexer
   165847 {
   165848   Object yylval;
   165849   public Object getLVal() { return yylval; }
   165850 
   165851   public Position getStartPos() { return null; }
   165852   public Position getEndPos()   { return null; }
   165853 
   165854   public void yyerror (Location loc, String s)
   165855   {
   165856     System.err.println (loc + ": " + s);
   165857   }
   165858 
   165859   public int yylex () throws java.io.IOException
   165860   {
   165861     throw new java.io.IOException();
   165862   }
   165863 
   165864 
   165865 }
   165866 %%
   165867 start: "end" {throw new ClassNotFoundException();};
   165868 %%
   165869 class Position {}
   165870 _ATEOF
   165871 
   165872 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   165873   at_save_special_files
   165874   mkdir xml-tests
   165875     # Don't combine these Bison invocations since we want to be sure that
   165876   # --report=all isn't required to get the full XML file.
   165877   { set +x
   165878 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   165879                   --graph=xml-tests/test.dot YYParser.y"
   165880 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   165881 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   165882                   --graph=xml-tests/test.dot YYParser.y
   165883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165884 at_status=$? at_failed=false
   165885 $at_check_filter
   165886 echo stderr:; cat "$at_stderr"
   165887 echo stdout:; cat "$at_stdout"
   165888 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165889 $at_failed && at_fn_log_failure
   165890 $at_traceon; }
   165891 
   165892   { set +x
   165893 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   165894 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   165895 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   165896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165897 at_status=$? at_failed=false
   165898 $at_check_filter
   165899 echo stderr:; cat "$at_stderr"
   165900 echo stdout:; cat "$at_stdout"
   165901 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165902 $at_failed && at_fn_log_failure
   165903 $at_traceon; }
   165904 
   165905     cp xml-tests/test.output expout
   165906   { set +x
   165907 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165908              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   165909              xml-tests/test.xml"
   165910 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165911 ( $at_check_trace; $XSLTPROC \
   165912              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   165913              xml-tests/test.xml
   165914 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165915 at_status=$? at_failed=false
   165916 $at_check_filter
   165917 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165918 $at_diff expout "$at_stdout" || at_failed=:
   165919 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165920 $at_failed && at_fn_log_failure
   165921 $at_traceon; }
   165922 
   165923   sort xml-tests/test.dot > expout
   165924   { set +x
   165925 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   165926              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   165927              xml-tests/test.xml | sort"
   165928 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   165929 ( $at_check_trace; $XSLTPROC \
   165930              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   165931              xml-tests/test.xml | sort
   165932 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165933 at_status=$? at_failed=false
   165934 $at_check_filter
   165935 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165936 $at_diff expout "$at_stdout" || at_failed=:
   165937 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165938 $at_failed && at_fn_log_failure
   165939 $at_traceon; }
   165940 
   165941   rm -rf xml-tests expout
   165942   at_restore_special_files
   165943 fi
   165944 { set +x
   165945 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   165946 at_fn_check_prepare_trace "java.at:688"
   165947 ( $at_check_trace; bison YYParser.y
   165948 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165949 at_status=$? at_failed=false
   165950 $at_check_filter
   165951 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165952 at_fn_diff_devnull "$at_stdout" || at_failed=:
   165953 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165954 $at_failed && at_fn_log_failure
   165955 $at_traceon; }
   165956 
   165957 
   165958 { set +x
   165959 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   165960 at_fn_check_prepare_trace "java.at:688"
   165961 ( $at_check_trace; grep '[mb]4_' YYParser.y
   165962 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165963 at_status=$? at_failed=false
   165964 $at_check_filter
   165965 at_fn_diff_devnull "$at_stderr" || at_failed=:
   165966 echo stdout:; cat "$at_stdout"
   165967 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   165968 $at_failed && at_fn_log_failure
   165969 $at_traceon; }
   165970 
   165971 
   165972 $as_echo "java.at:688" >"$at_check_line_file"
   165973 (test -z "$CONF_JAVAC") \
   165974   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165975 $as_echo "java.at:688" >"$at_check_line_file"
   165976 (test -z "$CONF_JAVA") \
   165977   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   165978 { set +x
   165979 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   165980 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   165981 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   165982 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165983 at_status=$? at_failed=false
   165984 $at_check_filter
   165985 echo stderr:; cat "$at_stderr"
   165986 echo stdout:; cat "$at_stdout"
   165987 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   165988 $at_failed && at_fn_log_failure
   165989 $at_traceon; }
   165990 
   165991 
   165992 { set +x
   165993 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
   165994 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:688"
   165995 ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
   165996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   165997 at_status=$? at_failed=false
   165998 $at_check_filter
   165999 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166000 echo >>"$at_stdout"; $as_echo "1
   166001 " | \
   166002   $at_diff - "$at_stdout" || at_failed=:
   166003 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166004 $at_failed && at_fn_log_failure
   166005 $at_traceon; }
   166006 
   166007 
   166008 { set +x
   166009 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   166010 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   166011 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   166012 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166013 at_status=$? at_failed=false
   166014 $at_check_filter
   166015 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166016 echo >>"$at_stdout"; $as_echo "1
   166017 " | \
   166018   $at_diff - "$at_stdout" || at_failed=:
   166019 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166020 $at_failed && at_fn_log_failure
   166021 $at_traceon; }
   166022 
   166023 
   166024 { set +x
   166025 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
   166026 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   166027 ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java
   166028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166029 at_status=$? at_failed=false
   166030 $at_check_filter
   166031 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166032 echo >>"$at_stdout"; $as_echo "1
   166033 " | \
   166034   $at_diff - "$at_stdout" || at_failed=:
   166035 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166036 $at_failed && at_fn_log_failure
   166037 $at_traceon; }
   166038 
   166039 
   166040 
   166041 cat >YYParser.y <<'_ATEOF'
   166042 
   166043 %language "Java"
   166044 %locations
   166045 %debug
   166046 %error-verbose
   166047 %token-table
   166048 
   166049 
   166050 %define lex_throws ""
   166051 
   166052 
   166053 %code lexer
   166054 {
   166055   Object yylval;
   166056   public Object getLVal() { return yylval; }
   166057 
   166058   public Position getStartPos() { return null; }
   166059   public Position getEndPos()   { return null; }
   166060 
   166061   public void yyerror (Location loc, String s)
   166062   {
   166063     System.err.println (loc + ": " + s);
   166064   }
   166065 
   166066   public int yylex ()
   166067   {
   166068     return EOF;
   166069   }
   166070 
   166071 
   166072 }
   166073 %%
   166074 start: "end" {};
   166075 %%
   166076 class Position {}
   166077 _ATEOF
   166078 
   166079 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   166080   at_save_special_files
   166081   mkdir xml-tests
   166082     # Don't combine these Bison invocations since we want to be sure that
   166083   # --report=all isn't required to get the full XML file.
   166084   { set +x
   166085 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   166086                   --graph=xml-tests/test.dot YYParser.y"
   166087 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   166088 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   166089                   --graph=xml-tests/test.dot YYParser.y
   166090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166091 at_status=$? at_failed=false
   166092 $at_check_filter
   166093 echo stderr:; cat "$at_stderr"
   166094 echo stdout:; cat "$at_stdout"
   166095 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166096 $at_failed && at_fn_log_failure
   166097 $at_traceon; }
   166098 
   166099   { set +x
   166100 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   166101 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   166102 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   166103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166104 at_status=$? at_failed=false
   166105 $at_check_filter
   166106 echo stderr:; cat "$at_stderr"
   166107 echo stdout:; cat "$at_stdout"
   166108 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166109 $at_failed && at_fn_log_failure
   166110 $at_traceon; }
   166111 
   166112     cp xml-tests/test.output expout
   166113   { set +x
   166114 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166115              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   166116              xml-tests/test.xml"
   166117 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166118 ( $at_check_trace; $XSLTPROC \
   166119              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   166120              xml-tests/test.xml
   166121 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166122 at_status=$? at_failed=false
   166123 $at_check_filter
   166124 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166125 $at_diff expout "$at_stdout" || at_failed=:
   166126 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166127 $at_failed && at_fn_log_failure
   166128 $at_traceon; }
   166129 
   166130   sort xml-tests/test.dot > expout
   166131   { set +x
   166132 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166133              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   166134              xml-tests/test.xml | sort"
   166135 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166136 ( $at_check_trace; $XSLTPROC \
   166137              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   166138              xml-tests/test.xml | sort
   166139 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166140 at_status=$? at_failed=false
   166141 $at_check_filter
   166142 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166143 $at_diff expout "$at_stdout" || at_failed=:
   166144 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166145 $at_failed && at_fn_log_failure
   166146 $at_traceon; }
   166147 
   166148   rm -rf xml-tests expout
   166149   at_restore_special_files
   166150 fi
   166151 { set +x
   166152 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   166153 at_fn_check_prepare_trace "java.at:688"
   166154 ( $at_check_trace; bison YYParser.y
   166155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166156 at_status=$? at_failed=false
   166157 $at_check_filter
   166158 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166159 at_fn_diff_devnull "$at_stdout" || at_failed=:
   166160 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166161 $at_failed && at_fn_log_failure
   166162 $at_traceon; }
   166163 
   166164 
   166165 { set +x
   166166 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   166167 at_fn_check_prepare_trace "java.at:688"
   166168 ( $at_check_trace; grep '[mb]4_' YYParser.y
   166169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166170 at_status=$? at_failed=false
   166171 $at_check_filter
   166172 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166173 echo stdout:; cat "$at_stdout"
   166174 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   166175 $at_failed && at_fn_log_failure
   166176 $at_traceon; }
   166177 
   166178 
   166179 $as_echo "java.at:688" >"$at_check_line_file"
   166180 (test -z "$CONF_JAVAC") \
   166181   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166182 $as_echo "java.at:688" >"$at_check_line_file"
   166183 (test -z "$CONF_JAVA") \
   166184   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166185 { set +x
   166186 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   166187 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   166188 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   166189 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166190 at_status=$? at_failed=false
   166191 $at_check_filter
   166192 echo stderr:; cat "$at_stderr"
   166193 echo stdout:; cat "$at_stdout"
   166194 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166195 $at_failed && at_fn_log_failure
   166196 $at_traceon; }
   166197 
   166198 
   166199 { set +x
   166200 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   166201 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   166202 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   166203 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166204 at_status=$? at_failed=false
   166205 $at_check_filter
   166206 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166207 echo >>"$at_stdout"; $as_echo "1
   166208 " | \
   166209   $at_diff - "$at_stdout" || at_failed=:
   166210 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166211 $at_failed && at_fn_log_failure
   166212 $at_traceon; }
   166213 
   166214 
   166215 { set +x
   166216 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   166217 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   166218 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   166219 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166220 at_status=$? at_failed=false
   166221 $at_check_filter
   166222 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166223 echo >>"$at_stdout"; $as_echo "1
   166224 " | \
   166225   $at_diff - "$at_stdout" || at_failed=:
   166226 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166227 $at_failed && at_fn_log_failure
   166228 $at_traceon; }
   166229 
   166230 
   166231 { set +x
   166232 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java"
   166233 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688"
   166234 ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
   166235 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166236 at_status=$? at_failed=false
   166237 $at_check_filter
   166238 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166239 echo >>"$at_stdout"; $as_echo "1
   166240 " | \
   166241   $at_diff - "$at_stdout" || at_failed=:
   166242 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166243 $at_failed && at_fn_log_failure
   166244 $at_traceon; }
   166245 
   166246 
   166247 
   166248 cat >YYParser.y <<'_ATEOF'
   166249 
   166250 %language "Java"
   166251 %locations
   166252 %debug
   166253 %error-verbose
   166254 %token-table
   166255 
   166256 %define throws ""
   166257 %define lex_throws ""
   166258 
   166259 
   166260 %code lexer
   166261 {
   166262   Object yylval;
   166263   public Object getLVal() { return yylval; }
   166264 
   166265   public Position getStartPos() { return null; }
   166266   public Position getEndPos()   { return null; }
   166267 
   166268   public void yyerror (Location loc, String s)
   166269   {
   166270     System.err.println (loc + ": " + s);
   166271   }
   166272 
   166273   public int yylex ()
   166274   {
   166275     return EOF;
   166276   }
   166277 
   166278 
   166279 }
   166280 %%
   166281 start: "end" {};
   166282 %%
   166283 class Position {}
   166284 _ATEOF
   166285 
   166286 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   166287   at_save_special_files
   166288   mkdir xml-tests
   166289     # Don't combine these Bison invocations since we want to be sure that
   166290   # --report=all isn't required to get the full XML file.
   166291   { set +x
   166292 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   166293                   --graph=xml-tests/test.dot YYParser.y"
   166294 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   166295 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   166296                   --graph=xml-tests/test.dot YYParser.y
   166297 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166298 at_status=$? at_failed=false
   166299 $at_check_filter
   166300 echo stderr:; cat "$at_stderr"
   166301 echo stdout:; cat "$at_stdout"
   166302 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166303 $at_failed && at_fn_log_failure
   166304 $at_traceon; }
   166305 
   166306   { set +x
   166307 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   166308 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   166309 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   166310 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166311 at_status=$? at_failed=false
   166312 $at_check_filter
   166313 echo stderr:; cat "$at_stderr"
   166314 echo stdout:; cat "$at_stdout"
   166315 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166316 $at_failed && at_fn_log_failure
   166317 $at_traceon; }
   166318 
   166319     cp xml-tests/test.output expout
   166320   { set +x
   166321 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166322              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   166323              xml-tests/test.xml"
   166324 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166325 ( $at_check_trace; $XSLTPROC \
   166326              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   166327              xml-tests/test.xml
   166328 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166329 at_status=$? at_failed=false
   166330 $at_check_filter
   166331 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166332 $at_diff expout "$at_stdout" || at_failed=:
   166333 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166334 $at_failed && at_fn_log_failure
   166335 $at_traceon; }
   166336 
   166337   sort xml-tests/test.dot > expout
   166338   { set +x
   166339 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166340              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   166341              xml-tests/test.xml | sort"
   166342 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166343 ( $at_check_trace; $XSLTPROC \
   166344              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   166345              xml-tests/test.xml | sort
   166346 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166347 at_status=$? at_failed=false
   166348 $at_check_filter
   166349 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166350 $at_diff expout "$at_stdout" || at_failed=:
   166351 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166352 $at_failed && at_fn_log_failure
   166353 $at_traceon; }
   166354 
   166355   rm -rf xml-tests expout
   166356   at_restore_special_files
   166357 fi
   166358 { set +x
   166359 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   166360 at_fn_check_prepare_trace "java.at:688"
   166361 ( $at_check_trace; bison YYParser.y
   166362 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166363 at_status=$? at_failed=false
   166364 $at_check_filter
   166365 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166366 at_fn_diff_devnull "$at_stdout" || at_failed=:
   166367 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166368 $at_failed && at_fn_log_failure
   166369 $at_traceon; }
   166370 
   166371 
   166372 { set +x
   166373 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   166374 at_fn_check_prepare_trace "java.at:688"
   166375 ( $at_check_trace; grep '[mb]4_' YYParser.y
   166376 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166377 at_status=$? at_failed=false
   166378 $at_check_filter
   166379 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166380 echo stdout:; cat "$at_stdout"
   166381 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   166382 $at_failed && at_fn_log_failure
   166383 $at_traceon; }
   166384 
   166385 
   166386 $as_echo "java.at:688" >"$at_check_line_file"
   166387 (test -z "$CONF_JAVAC") \
   166388   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166389 $as_echo "java.at:688" >"$at_check_line_file"
   166390 (test -z "$CONF_JAVA") \
   166391   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166392 { set +x
   166393 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   166394 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   166395 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   166396 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166397 at_status=$? at_failed=false
   166398 $at_check_filter
   166399 echo stderr:; cat "$at_stderr"
   166400 echo stdout:; cat "$at_stdout"
   166401 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166402 $at_failed && at_fn_log_failure
   166403 $at_traceon; }
   166404 
   166405 
   166406 { set +x
   166407 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   166408 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   166409 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   166410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166411 at_status=$? at_failed=false
   166412 $at_check_filter
   166413 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166414 echo >>"$at_stdout"; $as_echo "1
   166415 " | \
   166416   $at_diff - "$at_stdout" || at_failed=:
   166417 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166418 $at_failed && at_fn_log_failure
   166419 $at_traceon; }
   166420 
   166421 
   166422 { set +x
   166423 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   166424 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   166425 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   166426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166427 at_status=$? at_failed=false
   166428 $at_check_filter
   166429 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166430 echo >>"$at_stdout"; $as_echo "1
   166431 " | \
   166432   $at_diff - "$at_stdout" || at_failed=:
   166433 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166434 $at_failed && at_fn_log_failure
   166435 $at_traceon; }
   166436 
   166437 
   166438 { set +x
   166439 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java"
   166440 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688"
   166441 ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
   166442 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166443 at_status=$? at_failed=false
   166444 $at_check_filter
   166445 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166446 echo >>"$at_stdout"; $as_echo "1
   166447 " | \
   166448   $at_diff - "$at_stdout" || at_failed=:
   166449 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166450 $at_failed && at_fn_log_failure
   166451 $at_traceon; }
   166452 
   166453 
   166454 
   166455 cat >YYParser.y <<'_ATEOF'
   166456 
   166457 %language "Java"
   166458 %locations
   166459 %debug
   166460 %error-verbose
   166461 %token-table
   166462 
   166463 %define throws "ClassNotFoundException"
   166464 %define lex_throws ""
   166465 %initial-action {if (true) throw new ClassNotFoundException();}
   166466 
   166467 %code lexer
   166468 {
   166469   Object yylval;
   166470   public Object getLVal() { return yylval; }
   166471 
   166472   public Position getStartPos() { return null; }
   166473   public Position getEndPos()   { return null; }
   166474 
   166475   public void yyerror (Location loc, String s)
   166476   {
   166477     System.err.println (loc + ": " + s);
   166478   }
   166479 
   166480   public int yylex ()
   166481   {
   166482     return EOF;
   166483   }
   166484 
   166485 
   166486 }
   166487 %%
   166488 start: "end" {throw new ClassNotFoundException();};
   166489 %%
   166490 class Position {}
   166491 _ATEOF
   166492 
   166493 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   166494   at_save_special_files
   166495   mkdir xml-tests
   166496     # Don't combine these Bison invocations since we want to be sure that
   166497   # --report=all isn't required to get the full XML file.
   166498   { set +x
   166499 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   166500                   --graph=xml-tests/test.dot YYParser.y"
   166501 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   166502 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   166503                   --graph=xml-tests/test.dot YYParser.y
   166504 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166505 at_status=$? at_failed=false
   166506 $at_check_filter
   166507 echo stderr:; cat "$at_stderr"
   166508 echo stdout:; cat "$at_stdout"
   166509 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166510 $at_failed && at_fn_log_failure
   166511 $at_traceon; }
   166512 
   166513   { set +x
   166514 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   166515 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   166516 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   166517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166518 at_status=$? at_failed=false
   166519 $at_check_filter
   166520 echo stderr:; cat "$at_stderr"
   166521 echo stdout:; cat "$at_stdout"
   166522 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166523 $at_failed && at_fn_log_failure
   166524 $at_traceon; }
   166525 
   166526     cp xml-tests/test.output expout
   166527   { set +x
   166528 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166529              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   166530              xml-tests/test.xml"
   166531 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166532 ( $at_check_trace; $XSLTPROC \
   166533              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   166534              xml-tests/test.xml
   166535 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166536 at_status=$? at_failed=false
   166537 $at_check_filter
   166538 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166539 $at_diff expout "$at_stdout" || at_failed=:
   166540 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166541 $at_failed && at_fn_log_failure
   166542 $at_traceon; }
   166543 
   166544   sort xml-tests/test.dot > expout
   166545   { set +x
   166546 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166547              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   166548              xml-tests/test.xml | sort"
   166549 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166550 ( $at_check_trace; $XSLTPROC \
   166551              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   166552              xml-tests/test.xml | sort
   166553 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166554 at_status=$? at_failed=false
   166555 $at_check_filter
   166556 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166557 $at_diff expout "$at_stdout" || at_failed=:
   166558 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166559 $at_failed && at_fn_log_failure
   166560 $at_traceon; }
   166561 
   166562   rm -rf xml-tests expout
   166563   at_restore_special_files
   166564 fi
   166565 { set +x
   166566 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   166567 at_fn_check_prepare_trace "java.at:688"
   166568 ( $at_check_trace; bison YYParser.y
   166569 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166570 at_status=$? at_failed=false
   166571 $at_check_filter
   166572 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166573 at_fn_diff_devnull "$at_stdout" || at_failed=:
   166574 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166575 $at_failed && at_fn_log_failure
   166576 $at_traceon; }
   166577 
   166578 
   166579 { set +x
   166580 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   166581 at_fn_check_prepare_trace "java.at:688"
   166582 ( $at_check_trace; grep '[mb]4_' YYParser.y
   166583 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166584 at_status=$? at_failed=false
   166585 $at_check_filter
   166586 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166587 echo stdout:; cat "$at_stdout"
   166588 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   166589 $at_failed && at_fn_log_failure
   166590 $at_traceon; }
   166591 
   166592 
   166593 $as_echo "java.at:688" >"$at_check_line_file"
   166594 (test -z "$CONF_JAVAC") \
   166595   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166596 $as_echo "java.at:688" >"$at_check_line_file"
   166597 (test -z "$CONF_JAVA") \
   166598   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166599 { set +x
   166600 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   166601 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   166602 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   166603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166604 at_status=$? at_failed=false
   166605 $at_check_filter
   166606 echo stderr:; cat "$at_stderr"
   166607 echo stdout:; cat "$at_stdout"
   166608 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166609 $at_failed && at_fn_log_failure
   166610 $at_traceon; }
   166611 
   166612 
   166613 { set +x
   166614 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   166615 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   166616 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   166617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166618 at_status=$? at_failed=false
   166619 $at_check_filter
   166620 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166621 echo >>"$at_stdout"; $as_echo "1
   166622 " | \
   166623   $at_diff - "$at_stdout" || at_failed=:
   166624 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166625 $at_failed && at_fn_log_failure
   166626 $at_traceon; }
   166627 
   166628 
   166629 { set +x
   166630 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   166631 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   166632 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   166633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166634 at_status=$? at_failed=false
   166635 $at_check_filter
   166636 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166637 echo >>"$at_stdout"; $as_echo "1
   166638 " | \
   166639   $at_diff - "$at_stdout" || at_failed=:
   166640 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166641 $at_failed && at_fn_log_failure
   166642 $at_traceon; }
   166643 
   166644 
   166645 { set +x
   166646 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java"
   166647 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   166648 ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java
   166649 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166650 at_status=$? at_failed=false
   166651 $at_check_filter
   166652 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166653 echo >>"$at_stdout"; $as_echo "1
   166654 " | \
   166655   $at_diff - "$at_stdout" || at_failed=:
   166656 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166657 $at_failed && at_fn_log_failure
   166658 $at_traceon; }
   166659 
   166660 
   166661 
   166662 cat >YYParser.y <<'_ATEOF'
   166663 
   166664 %language "Java"
   166665 %locations
   166666 %debug
   166667 %error-verbose
   166668 %token-table
   166669 
   166670 %define throws "ClassNotFoundException, InstantiationException"
   166671 %define lex_throws ""
   166672 %initial-action {if (true) throw new InstantiationException();}
   166673 
   166674 %code lexer
   166675 {
   166676   Object yylval;
   166677   public Object getLVal() { return yylval; }
   166678 
   166679   public Position getStartPos() { return null; }
   166680   public Position getEndPos()   { return null; }
   166681 
   166682   public void yyerror (Location loc, String s)
   166683   {
   166684     System.err.println (loc + ": " + s);
   166685   }
   166686 
   166687   public int yylex ()
   166688   {
   166689     return EOF;
   166690   }
   166691 
   166692 
   166693 }
   166694 %%
   166695 start: "end" {throw new ClassNotFoundException();};
   166696 %%
   166697 class Position {}
   166698 _ATEOF
   166699 
   166700 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   166701   at_save_special_files
   166702   mkdir xml-tests
   166703     # Don't combine these Bison invocations since we want to be sure that
   166704   # --report=all isn't required to get the full XML file.
   166705   { set +x
   166706 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   166707                   --graph=xml-tests/test.dot YYParser.y"
   166708 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   166709 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   166710                   --graph=xml-tests/test.dot YYParser.y
   166711 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166712 at_status=$? at_failed=false
   166713 $at_check_filter
   166714 echo stderr:; cat "$at_stderr"
   166715 echo stdout:; cat "$at_stdout"
   166716 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166717 $at_failed && at_fn_log_failure
   166718 $at_traceon; }
   166719 
   166720   { set +x
   166721 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   166722 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   166723 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   166724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166725 at_status=$? at_failed=false
   166726 $at_check_filter
   166727 echo stderr:; cat "$at_stderr"
   166728 echo stdout:; cat "$at_stdout"
   166729 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166730 $at_failed && at_fn_log_failure
   166731 $at_traceon; }
   166732 
   166733     cp xml-tests/test.output expout
   166734   { set +x
   166735 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166736              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   166737              xml-tests/test.xml"
   166738 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166739 ( $at_check_trace; $XSLTPROC \
   166740              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   166741              xml-tests/test.xml
   166742 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166743 at_status=$? at_failed=false
   166744 $at_check_filter
   166745 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166746 $at_diff expout "$at_stdout" || at_failed=:
   166747 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166748 $at_failed && at_fn_log_failure
   166749 $at_traceon; }
   166750 
   166751   sort xml-tests/test.dot > expout
   166752   { set +x
   166753 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166754              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   166755              xml-tests/test.xml | sort"
   166756 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166757 ( $at_check_trace; $XSLTPROC \
   166758              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   166759              xml-tests/test.xml | sort
   166760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166761 at_status=$? at_failed=false
   166762 $at_check_filter
   166763 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166764 $at_diff expout "$at_stdout" || at_failed=:
   166765 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166766 $at_failed && at_fn_log_failure
   166767 $at_traceon; }
   166768 
   166769   rm -rf xml-tests expout
   166770   at_restore_special_files
   166771 fi
   166772 { set +x
   166773 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   166774 at_fn_check_prepare_trace "java.at:688"
   166775 ( $at_check_trace; bison YYParser.y
   166776 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166777 at_status=$? at_failed=false
   166778 $at_check_filter
   166779 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166780 at_fn_diff_devnull "$at_stdout" || at_failed=:
   166781 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166782 $at_failed && at_fn_log_failure
   166783 $at_traceon; }
   166784 
   166785 
   166786 { set +x
   166787 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   166788 at_fn_check_prepare_trace "java.at:688"
   166789 ( $at_check_trace; grep '[mb]4_' YYParser.y
   166790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166791 at_status=$? at_failed=false
   166792 $at_check_filter
   166793 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166794 echo stdout:; cat "$at_stdout"
   166795 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   166796 $at_failed && at_fn_log_failure
   166797 $at_traceon; }
   166798 
   166799 
   166800 $as_echo "java.at:688" >"$at_check_line_file"
   166801 (test -z "$CONF_JAVAC") \
   166802   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166803 $as_echo "java.at:688" >"$at_check_line_file"
   166804 (test -z "$CONF_JAVA") \
   166805   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   166806 { set +x
   166807 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   166808 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   166809 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   166810 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166811 at_status=$? at_failed=false
   166812 $at_check_filter
   166813 echo stderr:; cat "$at_stderr"
   166814 echo stdout:; cat "$at_stdout"
   166815 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166816 $at_failed && at_fn_log_failure
   166817 $at_traceon; }
   166818 
   166819 
   166820 { set +x
   166821 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java"
   166822 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688"
   166823 ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
   166824 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166825 at_status=$? at_failed=false
   166826 $at_check_filter
   166827 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166828 echo >>"$at_stdout"; $as_echo "1
   166829 " | \
   166830   $at_diff - "$at_stdout" || at_failed=:
   166831 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166832 $at_failed && at_fn_log_failure
   166833 $at_traceon; }
   166834 
   166835 
   166836 { set +x
   166837 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   166838 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   166839 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   166840 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166841 at_status=$? at_failed=false
   166842 $at_check_filter
   166843 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166844 echo >>"$at_stdout"; $as_echo "1
   166845 " | \
   166846   $at_diff - "$at_stdout" || at_failed=:
   166847 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166848 $at_failed && at_fn_log_failure
   166849 $at_traceon; }
   166850 
   166851 
   166852 { set +x
   166853 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   166854 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   166855 ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java
   166856 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166857 at_status=$? at_failed=false
   166858 $at_check_filter
   166859 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166860 echo >>"$at_stdout"; $as_echo "1
   166861 " | \
   166862   $at_diff - "$at_stdout" || at_failed=:
   166863 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166864 $at_failed && at_fn_log_failure
   166865 $at_traceon; }
   166866 
   166867 
   166868 
   166869 cat >YYParser.y <<'_ATEOF'
   166870 
   166871 %language "Java"
   166872 %locations
   166873 %debug
   166874 %error-verbose
   166875 %token-table
   166876 
   166877 
   166878 %define lex_throws "InterruptedException"
   166879 
   166880 
   166881 %code lexer
   166882 {
   166883   Object yylval;
   166884   public Object getLVal() { return yylval; }
   166885 
   166886   public Position getStartPos() { return null; }
   166887   public Position getEndPos()   { return null; }
   166888 
   166889   public void yyerror (Location loc, String s)
   166890   {
   166891     System.err.println (loc + ": " + s);
   166892   }
   166893 
   166894   public int yylex () throws InterruptedException
   166895   {
   166896     throw new InterruptedException();
   166897   }
   166898 
   166899 
   166900 }
   166901 %%
   166902 start: "end" {};
   166903 %%
   166904 class Position {}
   166905 _ATEOF
   166906 
   166907 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   166908   at_save_special_files
   166909   mkdir xml-tests
   166910     # Don't combine these Bison invocations since we want to be sure that
   166911   # --report=all isn't required to get the full XML file.
   166912   { set +x
   166913 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   166914                   --graph=xml-tests/test.dot YYParser.y"
   166915 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   166916 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   166917                   --graph=xml-tests/test.dot YYParser.y
   166918 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166919 at_status=$? at_failed=false
   166920 $at_check_filter
   166921 echo stderr:; cat "$at_stderr"
   166922 echo stdout:; cat "$at_stdout"
   166923 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166924 $at_failed && at_fn_log_failure
   166925 $at_traceon; }
   166926 
   166927   { set +x
   166928 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   166929 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   166930 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   166931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166932 at_status=$? at_failed=false
   166933 $at_check_filter
   166934 echo stderr:; cat "$at_stderr"
   166935 echo stdout:; cat "$at_stdout"
   166936 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166937 $at_failed && at_fn_log_failure
   166938 $at_traceon; }
   166939 
   166940     cp xml-tests/test.output expout
   166941   { set +x
   166942 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166943              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   166944              xml-tests/test.xml"
   166945 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166946 ( $at_check_trace; $XSLTPROC \
   166947              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   166948              xml-tests/test.xml
   166949 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166950 at_status=$? at_failed=false
   166951 $at_check_filter
   166952 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166953 $at_diff expout "$at_stdout" || at_failed=:
   166954 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166955 $at_failed && at_fn_log_failure
   166956 $at_traceon; }
   166957 
   166958   sort xml-tests/test.dot > expout
   166959   { set +x
   166960 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   166961              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   166962              xml-tests/test.xml | sort"
   166963 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   166964 ( $at_check_trace; $XSLTPROC \
   166965              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   166966              xml-tests/test.xml | sort
   166967 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166968 at_status=$? at_failed=false
   166969 $at_check_filter
   166970 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166971 $at_diff expout "$at_stdout" || at_failed=:
   166972 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166973 $at_failed && at_fn_log_failure
   166974 $at_traceon; }
   166975 
   166976   rm -rf xml-tests expout
   166977   at_restore_special_files
   166978 fi
   166979 { set +x
   166980 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   166981 at_fn_check_prepare_trace "java.at:688"
   166982 ( $at_check_trace; bison YYParser.y
   166983 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166984 at_status=$? at_failed=false
   166985 $at_check_filter
   166986 at_fn_diff_devnull "$at_stderr" || at_failed=:
   166987 at_fn_diff_devnull "$at_stdout" || at_failed=:
   166988 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   166989 $at_failed && at_fn_log_failure
   166990 $at_traceon; }
   166991 
   166992 
   166993 { set +x
   166994 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   166995 at_fn_check_prepare_trace "java.at:688"
   166996 ( $at_check_trace; grep '[mb]4_' YYParser.y
   166997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   166998 at_status=$? at_failed=false
   166999 $at_check_filter
   167000 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167001 echo stdout:; cat "$at_stdout"
   167002 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   167003 $at_failed && at_fn_log_failure
   167004 $at_traceon; }
   167005 
   167006 
   167007 $as_echo "java.at:688" >"$at_check_line_file"
   167008 (test -z "$CONF_JAVAC") \
   167009   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167010 $as_echo "java.at:688" >"$at_check_line_file"
   167011 (test -z "$CONF_JAVA") \
   167012   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167013 { set +x
   167014 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   167015 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   167016 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   167017 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167018 at_status=$? at_failed=false
   167019 $at_check_filter
   167020 echo stderr:; cat "$at_stderr"
   167021 echo stdout:; cat "$at_stdout"
   167022 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167023 $at_failed && at_fn_log_failure
   167024 $at_traceon; }
   167025 
   167026 
   167027 { set +x
   167028 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   167029 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   167030 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   167031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167032 at_status=$? at_failed=false
   167033 $at_check_filter
   167034 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167035 echo >>"$at_stdout"; $as_echo "1
   167036 " | \
   167037   $at_diff - "$at_stdout" || at_failed=:
   167038 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167039 $at_failed && at_fn_log_failure
   167040 $at_traceon; }
   167041 
   167042 
   167043 { set +x
   167044 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   167045 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   167046 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   167047 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167048 at_status=$? at_failed=false
   167049 $at_check_filter
   167050 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167051 echo >>"$at_stdout"; $as_echo "1
   167052 " | \
   167053   $at_diff - "$at_stdout" || at_failed=:
   167054 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167055 $at_failed && at_fn_log_failure
   167056 $at_traceon; }
   167057 
   167058 
   167059 { set +x
   167060 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
   167061 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688"
   167062 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
   167063 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167064 at_status=$? at_failed=false
   167065 $at_check_filter
   167066 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167067 echo >>"$at_stdout"; $as_echo "1
   167068 " | \
   167069   $at_diff - "$at_stdout" || at_failed=:
   167070 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167071 $at_failed && at_fn_log_failure
   167072 $at_traceon; }
   167073 
   167074 
   167075 
   167076 cat >YYParser.y <<'_ATEOF'
   167077 
   167078 %language "Java"
   167079 %locations
   167080 %debug
   167081 %error-verbose
   167082 %token-table
   167083 
   167084 %define throws ""
   167085 %define lex_throws "InterruptedException"
   167086 
   167087 
   167088 %code lexer
   167089 {
   167090   Object yylval;
   167091   public Object getLVal() { return yylval; }
   167092 
   167093   public Position getStartPos() { return null; }
   167094   public Position getEndPos()   { return null; }
   167095 
   167096   public void yyerror (Location loc, String s)
   167097   {
   167098     System.err.println (loc + ": " + s);
   167099   }
   167100 
   167101   public int yylex () throws InterruptedException
   167102   {
   167103     throw new InterruptedException();
   167104   }
   167105 
   167106 
   167107 }
   167108 %%
   167109 start: "end" {};
   167110 %%
   167111 class Position {}
   167112 _ATEOF
   167113 
   167114 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   167115   at_save_special_files
   167116   mkdir xml-tests
   167117     # Don't combine these Bison invocations since we want to be sure that
   167118   # --report=all isn't required to get the full XML file.
   167119   { set +x
   167120 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   167121                   --graph=xml-tests/test.dot YYParser.y"
   167122 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   167123 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   167124                   --graph=xml-tests/test.dot YYParser.y
   167125 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167126 at_status=$? at_failed=false
   167127 $at_check_filter
   167128 echo stderr:; cat "$at_stderr"
   167129 echo stdout:; cat "$at_stdout"
   167130 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167131 $at_failed && at_fn_log_failure
   167132 $at_traceon; }
   167133 
   167134   { set +x
   167135 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   167136 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   167137 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   167138 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167139 at_status=$? at_failed=false
   167140 $at_check_filter
   167141 echo stderr:; cat "$at_stderr"
   167142 echo stdout:; cat "$at_stdout"
   167143 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167144 $at_failed && at_fn_log_failure
   167145 $at_traceon; }
   167146 
   167147     cp xml-tests/test.output expout
   167148   { set +x
   167149 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167150              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   167151              xml-tests/test.xml"
   167152 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167153 ( $at_check_trace; $XSLTPROC \
   167154              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   167155              xml-tests/test.xml
   167156 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167157 at_status=$? at_failed=false
   167158 $at_check_filter
   167159 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167160 $at_diff expout "$at_stdout" || at_failed=:
   167161 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167162 $at_failed && at_fn_log_failure
   167163 $at_traceon; }
   167164 
   167165   sort xml-tests/test.dot > expout
   167166   { set +x
   167167 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167168              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   167169              xml-tests/test.xml | sort"
   167170 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167171 ( $at_check_trace; $XSLTPROC \
   167172              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   167173              xml-tests/test.xml | sort
   167174 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167175 at_status=$? at_failed=false
   167176 $at_check_filter
   167177 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167178 $at_diff expout "$at_stdout" || at_failed=:
   167179 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167180 $at_failed && at_fn_log_failure
   167181 $at_traceon; }
   167182 
   167183   rm -rf xml-tests expout
   167184   at_restore_special_files
   167185 fi
   167186 { set +x
   167187 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   167188 at_fn_check_prepare_trace "java.at:688"
   167189 ( $at_check_trace; bison YYParser.y
   167190 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167191 at_status=$? at_failed=false
   167192 $at_check_filter
   167193 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167194 at_fn_diff_devnull "$at_stdout" || at_failed=:
   167195 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167196 $at_failed && at_fn_log_failure
   167197 $at_traceon; }
   167198 
   167199 
   167200 { set +x
   167201 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   167202 at_fn_check_prepare_trace "java.at:688"
   167203 ( $at_check_trace; grep '[mb]4_' YYParser.y
   167204 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167205 at_status=$? at_failed=false
   167206 $at_check_filter
   167207 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167208 echo stdout:; cat "$at_stdout"
   167209 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   167210 $at_failed && at_fn_log_failure
   167211 $at_traceon; }
   167212 
   167213 
   167214 $as_echo "java.at:688" >"$at_check_line_file"
   167215 (test -z "$CONF_JAVAC") \
   167216   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167217 $as_echo "java.at:688" >"$at_check_line_file"
   167218 (test -z "$CONF_JAVA") \
   167219   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167220 { set +x
   167221 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   167222 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   167223 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   167224 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167225 at_status=$? at_failed=false
   167226 $at_check_filter
   167227 echo stderr:; cat "$at_stderr"
   167228 echo stdout:; cat "$at_stdout"
   167229 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167230 $at_failed && at_fn_log_failure
   167231 $at_traceon; }
   167232 
   167233 
   167234 { set +x
   167235 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   167236 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   167237 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   167238 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167239 at_status=$? at_failed=false
   167240 $at_check_filter
   167241 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167242 echo >>"$at_stdout"; $as_echo "1
   167243 " | \
   167244   $at_diff - "$at_stdout" || at_failed=:
   167245 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167246 $at_failed && at_fn_log_failure
   167247 $at_traceon; }
   167248 
   167249 
   167250 { set +x
   167251 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   167252 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   167253 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   167254 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167255 at_status=$? at_failed=false
   167256 $at_check_filter
   167257 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167258 echo >>"$at_stdout"; $as_echo "1
   167259 " | \
   167260   $at_diff - "$at_stdout" || at_failed=:
   167261 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167262 $at_failed && at_fn_log_failure
   167263 $at_traceon; }
   167264 
   167265 
   167266 { set +x
   167267 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
   167268 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:688"
   167269 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
   167270 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167271 at_status=$? at_failed=false
   167272 $at_check_filter
   167273 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167274 echo >>"$at_stdout"; $as_echo "1
   167275 " | \
   167276   $at_diff - "$at_stdout" || at_failed=:
   167277 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167278 $at_failed && at_fn_log_failure
   167279 $at_traceon; }
   167280 
   167281 
   167282 
   167283 cat >YYParser.y <<'_ATEOF'
   167284 
   167285 %language "Java"
   167286 %locations
   167287 %debug
   167288 %error-verbose
   167289 %token-table
   167290 
   167291 %define throws "ClassNotFoundException"
   167292 %define lex_throws "InterruptedException"
   167293 %initial-action {if (true) throw new ClassNotFoundException();}
   167294 
   167295 %code lexer
   167296 {
   167297   Object yylval;
   167298   public Object getLVal() { return yylval; }
   167299 
   167300   public Position getStartPos() { return null; }
   167301   public Position getEndPos()   { return null; }
   167302 
   167303   public void yyerror (Location loc, String s)
   167304   {
   167305     System.err.println (loc + ": " + s);
   167306   }
   167307 
   167308   public int yylex () throws InterruptedException
   167309   {
   167310     throw new InterruptedException();
   167311   }
   167312 
   167313 
   167314 }
   167315 %%
   167316 start: "end" {throw new ClassNotFoundException();};
   167317 %%
   167318 class Position {}
   167319 _ATEOF
   167320 
   167321 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   167322   at_save_special_files
   167323   mkdir xml-tests
   167324     # Don't combine these Bison invocations since we want to be sure that
   167325   # --report=all isn't required to get the full XML file.
   167326   { set +x
   167327 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   167328                   --graph=xml-tests/test.dot YYParser.y"
   167329 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   167330 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   167331                   --graph=xml-tests/test.dot YYParser.y
   167332 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167333 at_status=$? at_failed=false
   167334 $at_check_filter
   167335 echo stderr:; cat "$at_stderr"
   167336 echo stdout:; cat "$at_stdout"
   167337 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167338 $at_failed && at_fn_log_failure
   167339 $at_traceon; }
   167340 
   167341   { set +x
   167342 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   167343 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   167344 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   167345 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167346 at_status=$? at_failed=false
   167347 $at_check_filter
   167348 echo stderr:; cat "$at_stderr"
   167349 echo stdout:; cat "$at_stdout"
   167350 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167351 $at_failed && at_fn_log_failure
   167352 $at_traceon; }
   167353 
   167354     cp xml-tests/test.output expout
   167355   { set +x
   167356 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167357              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   167358              xml-tests/test.xml"
   167359 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167360 ( $at_check_trace; $XSLTPROC \
   167361              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   167362              xml-tests/test.xml
   167363 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167364 at_status=$? at_failed=false
   167365 $at_check_filter
   167366 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167367 $at_diff expout "$at_stdout" || at_failed=:
   167368 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167369 $at_failed && at_fn_log_failure
   167370 $at_traceon; }
   167371 
   167372   sort xml-tests/test.dot > expout
   167373   { set +x
   167374 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167375              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   167376              xml-tests/test.xml | sort"
   167377 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167378 ( $at_check_trace; $XSLTPROC \
   167379              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   167380              xml-tests/test.xml | sort
   167381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167382 at_status=$? at_failed=false
   167383 $at_check_filter
   167384 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167385 $at_diff expout "$at_stdout" || at_failed=:
   167386 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167387 $at_failed && at_fn_log_failure
   167388 $at_traceon; }
   167389 
   167390   rm -rf xml-tests expout
   167391   at_restore_special_files
   167392 fi
   167393 { set +x
   167394 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   167395 at_fn_check_prepare_trace "java.at:688"
   167396 ( $at_check_trace; bison YYParser.y
   167397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167398 at_status=$? at_failed=false
   167399 $at_check_filter
   167400 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167401 at_fn_diff_devnull "$at_stdout" || at_failed=:
   167402 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167403 $at_failed && at_fn_log_failure
   167404 $at_traceon; }
   167405 
   167406 
   167407 { set +x
   167408 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   167409 at_fn_check_prepare_trace "java.at:688"
   167410 ( $at_check_trace; grep '[mb]4_' YYParser.y
   167411 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167412 at_status=$? at_failed=false
   167413 $at_check_filter
   167414 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167415 echo stdout:; cat "$at_stdout"
   167416 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   167417 $at_failed && at_fn_log_failure
   167418 $at_traceon; }
   167419 
   167420 
   167421 $as_echo "java.at:688" >"$at_check_line_file"
   167422 (test -z "$CONF_JAVAC") \
   167423   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167424 $as_echo "java.at:688" >"$at_check_line_file"
   167425 (test -z "$CONF_JAVA") \
   167426   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167427 { set +x
   167428 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   167429 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   167430 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   167431 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167432 at_status=$? at_failed=false
   167433 $at_check_filter
   167434 echo stderr:; cat "$at_stderr"
   167435 echo stdout:; cat "$at_stdout"
   167436 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167437 $at_failed && at_fn_log_failure
   167438 $at_traceon; }
   167439 
   167440 
   167441 { set +x
   167442 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   167443 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   167444 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   167445 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167446 at_status=$? at_failed=false
   167447 $at_check_filter
   167448 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167449 echo >>"$at_stdout"; $as_echo "1
   167450 " | \
   167451   $at_diff - "$at_stdout" || at_failed=:
   167452 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167453 $at_failed && at_fn_log_failure
   167454 $at_traceon; }
   167455 
   167456 
   167457 { set +x
   167458 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   167459 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   167460 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   167461 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167462 at_status=$? at_failed=false
   167463 $at_check_filter
   167464 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167465 echo >>"$at_stdout"; $as_echo "1
   167466 " | \
   167467   $at_diff - "$at_stdout" || at_failed=:
   167468 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167469 $at_failed && at_fn_log_failure
   167470 $at_traceon; }
   167471 
   167472 
   167473 { set +x
   167474 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java"
   167475 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:688"
   167476 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java
   167477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167478 at_status=$? at_failed=false
   167479 $at_check_filter
   167480 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167481 echo >>"$at_stdout"; $as_echo "1
   167482 " | \
   167483   $at_diff - "$at_stdout" || at_failed=:
   167484 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167485 $at_failed && at_fn_log_failure
   167486 $at_traceon; }
   167487 
   167488 
   167489 
   167490 cat >YYParser.y <<'_ATEOF'
   167491 
   167492 %language "Java"
   167493 %locations
   167494 %debug
   167495 %error-verbose
   167496 %token-table
   167497 
   167498 %define throws "ClassNotFoundException, InstantiationException"
   167499 %define lex_throws "InterruptedException"
   167500 %initial-action {if (true) throw new InstantiationException();}
   167501 
   167502 %code lexer
   167503 {
   167504   Object yylval;
   167505   public Object getLVal() { return yylval; }
   167506 
   167507   public Position getStartPos() { return null; }
   167508   public Position getEndPos()   { return null; }
   167509 
   167510   public void yyerror (Location loc, String s)
   167511   {
   167512     System.err.println (loc + ": " + s);
   167513   }
   167514 
   167515   public int yylex () throws InterruptedException
   167516   {
   167517     throw new InterruptedException();
   167518   }
   167519 
   167520 
   167521 }
   167522 %%
   167523 start: "end" {throw new ClassNotFoundException();};
   167524 %%
   167525 class Position {}
   167526 _ATEOF
   167527 
   167528 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   167529   at_save_special_files
   167530   mkdir xml-tests
   167531     # Don't combine these Bison invocations since we want to be sure that
   167532   # --report=all isn't required to get the full XML file.
   167533   { set +x
   167534 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   167535                   --graph=xml-tests/test.dot YYParser.y"
   167536 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   167537 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   167538                   --graph=xml-tests/test.dot YYParser.y
   167539 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167540 at_status=$? at_failed=false
   167541 $at_check_filter
   167542 echo stderr:; cat "$at_stderr"
   167543 echo stdout:; cat "$at_stdout"
   167544 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167545 $at_failed && at_fn_log_failure
   167546 $at_traceon; }
   167547 
   167548   { set +x
   167549 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   167550 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   167551 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   167552 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167553 at_status=$? at_failed=false
   167554 $at_check_filter
   167555 echo stderr:; cat "$at_stderr"
   167556 echo stdout:; cat "$at_stdout"
   167557 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167558 $at_failed && at_fn_log_failure
   167559 $at_traceon; }
   167560 
   167561     cp xml-tests/test.output expout
   167562   { set +x
   167563 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167564              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   167565              xml-tests/test.xml"
   167566 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167567 ( $at_check_trace; $XSLTPROC \
   167568              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   167569              xml-tests/test.xml
   167570 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167571 at_status=$? at_failed=false
   167572 $at_check_filter
   167573 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167574 $at_diff expout "$at_stdout" || at_failed=:
   167575 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167576 $at_failed && at_fn_log_failure
   167577 $at_traceon; }
   167578 
   167579   sort xml-tests/test.dot > expout
   167580   { set +x
   167581 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167582              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   167583              xml-tests/test.xml | sort"
   167584 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167585 ( $at_check_trace; $XSLTPROC \
   167586              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   167587              xml-tests/test.xml | sort
   167588 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167589 at_status=$? at_failed=false
   167590 $at_check_filter
   167591 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167592 $at_diff expout "$at_stdout" || at_failed=:
   167593 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167594 $at_failed && at_fn_log_failure
   167595 $at_traceon; }
   167596 
   167597   rm -rf xml-tests expout
   167598   at_restore_special_files
   167599 fi
   167600 { set +x
   167601 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   167602 at_fn_check_prepare_trace "java.at:688"
   167603 ( $at_check_trace; bison YYParser.y
   167604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167605 at_status=$? at_failed=false
   167606 $at_check_filter
   167607 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167608 at_fn_diff_devnull "$at_stdout" || at_failed=:
   167609 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167610 $at_failed && at_fn_log_failure
   167611 $at_traceon; }
   167612 
   167613 
   167614 { set +x
   167615 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   167616 at_fn_check_prepare_trace "java.at:688"
   167617 ( $at_check_trace; grep '[mb]4_' YYParser.y
   167618 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167619 at_status=$? at_failed=false
   167620 $at_check_filter
   167621 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167622 echo stdout:; cat "$at_stdout"
   167623 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   167624 $at_failed && at_fn_log_failure
   167625 $at_traceon; }
   167626 
   167627 
   167628 $as_echo "java.at:688" >"$at_check_line_file"
   167629 (test -z "$CONF_JAVAC") \
   167630   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167631 $as_echo "java.at:688" >"$at_check_line_file"
   167632 (test -z "$CONF_JAVA") \
   167633   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167634 { set +x
   167635 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   167636 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   167637 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   167638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167639 at_status=$? at_failed=false
   167640 $at_check_filter
   167641 echo stderr:; cat "$at_stderr"
   167642 echo stdout:; cat "$at_stdout"
   167643 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167644 $at_failed && at_fn_log_failure
   167645 $at_traceon; }
   167646 
   167647 
   167648 { set +x
   167649 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
   167650 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688"
   167651 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
   167652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167653 at_status=$? at_failed=false
   167654 $at_check_filter
   167655 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167656 echo >>"$at_stdout"; $as_echo "1
   167657 " | \
   167658   $at_diff - "$at_stdout" || at_failed=:
   167659 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167660 $at_failed && at_fn_log_failure
   167661 $at_traceon; }
   167662 
   167663 
   167664 { set +x
   167665 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   167666 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   167667 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   167668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167669 at_status=$? at_failed=false
   167670 $at_check_filter
   167671 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167672 echo >>"$at_stdout"; $as_echo "1
   167673 " | \
   167674   $at_diff - "$at_stdout" || at_failed=:
   167675 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167676 $at_failed && at_fn_log_failure
   167677 $at_traceon; }
   167678 
   167679 
   167680 { set +x
   167681 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
   167682 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   167683 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java
   167684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167685 at_status=$? at_failed=false
   167686 $at_check_filter
   167687 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167688 echo >>"$at_stdout"; $as_echo "1
   167689 " | \
   167690   $at_diff - "$at_stdout" || at_failed=:
   167691 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167692 $at_failed && at_fn_log_failure
   167693 $at_traceon; }
   167694 
   167695 
   167696 
   167697 cat >YYParser.y <<'_ATEOF'
   167698 
   167699 %language "Java"
   167700 %locations
   167701 %debug
   167702 %error-verbose
   167703 %token-table
   167704 
   167705 
   167706 %define lex_throws "InterruptedException, IllegalAccessException"
   167707 
   167708 
   167709 %code lexer
   167710 {
   167711   Object yylval;
   167712   public Object getLVal() { return yylval; }
   167713 
   167714   public Position getStartPos() { return null; }
   167715   public Position getEndPos()   { return null; }
   167716 
   167717   public void yyerror (Location loc, String s)
   167718   {
   167719     System.err.println (loc + ": " + s);
   167720   }
   167721 
   167722   public int yylex () throws InterruptedException, IllegalAccessException
   167723   {
   167724     throw new IllegalAccessException();
   167725   }
   167726 
   167727 
   167728 }
   167729 %%
   167730 start: "end" {};
   167731 %%
   167732 class Position {}
   167733 _ATEOF
   167734 
   167735 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   167736   at_save_special_files
   167737   mkdir xml-tests
   167738     # Don't combine these Bison invocations since we want to be sure that
   167739   # --report=all isn't required to get the full XML file.
   167740   { set +x
   167741 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   167742                   --graph=xml-tests/test.dot YYParser.y"
   167743 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   167744 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   167745                   --graph=xml-tests/test.dot YYParser.y
   167746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167747 at_status=$? at_failed=false
   167748 $at_check_filter
   167749 echo stderr:; cat "$at_stderr"
   167750 echo stdout:; cat "$at_stdout"
   167751 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167752 $at_failed && at_fn_log_failure
   167753 $at_traceon; }
   167754 
   167755   { set +x
   167756 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   167757 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   167758 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   167759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167760 at_status=$? at_failed=false
   167761 $at_check_filter
   167762 echo stderr:; cat "$at_stderr"
   167763 echo stdout:; cat "$at_stdout"
   167764 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167765 $at_failed && at_fn_log_failure
   167766 $at_traceon; }
   167767 
   167768     cp xml-tests/test.output expout
   167769   { set +x
   167770 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167771              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   167772              xml-tests/test.xml"
   167773 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167774 ( $at_check_trace; $XSLTPROC \
   167775              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   167776              xml-tests/test.xml
   167777 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167778 at_status=$? at_failed=false
   167779 $at_check_filter
   167780 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167781 $at_diff expout "$at_stdout" || at_failed=:
   167782 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167783 $at_failed && at_fn_log_failure
   167784 $at_traceon; }
   167785 
   167786   sort xml-tests/test.dot > expout
   167787   { set +x
   167788 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167789              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   167790              xml-tests/test.xml | sort"
   167791 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167792 ( $at_check_trace; $XSLTPROC \
   167793              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   167794              xml-tests/test.xml | sort
   167795 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167796 at_status=$? at_failed=false
   167797 $at_check_filter
   167798 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167799 $at_diff expout "$at_stdout" || at_failed=:
   167800 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167801 $at_failed && at_fn_log_failure
   167802 $at_traceon; }
   167803 
   167804   rm -rf xml-tests expout
   167805   at_restore_special_files
   167806 fi
   167807 { set +x
   167808 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   167809 at_fn_check_prepare_trace "java.at:688"
   167810 ( $at_check_trace; bison YYParser.y
   167811 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167812 at_status=$? at_failed=false
   167813 $at_check_filter
   167814 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167815 at_fn_diff_devnull "$at_stdout" || at_failed=:
   167816 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167817 $at_failed && at_fn_log_failure
   167818 $at_traceon; }
   167819 
   167820 
   167821 { set +x
   167822 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   167823 at_fn_check_prepare_trace "java.at:688"
   167824 ( $at_check_trace; grep '[mb]4_' YYParser.y
   167825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167826 at_status=$? at_failed=false
   167827 $at_check_filter
   167828 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167829 echo stdout:; cat "$at_stdout"
   167830 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   167831 $at_failed && at_fn_log_failure
   167832 $at_traceon; }
   167833 
   167834 
   167835 $as_echo "java.at:688" >"$at_check_line_file"
   167836 (test -z "$CONF_JAVAC") \
   167837   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167838 $as_echo "java.at:688" >"$at_check_line_file"
   167839 (test -z "$CONF_JAVA") \
   167840   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   167841 { set +x
   167842 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   167843 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   167844 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   167845 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167846 at_status=$? at_failed=false
   167847 $at_check_filter
   167848 echo stderr:; cat "$at_stderr"
   167849 echo stdout:; cat "$at_stdout"
   167850 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167851 $at_failed && at_fn_log_failure
   167852 $at_traceon; }
   167853 
   167854 
   167855 { set +x
   167856 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   167857 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   167858 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   167859 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167860 at_status=$? at_failed=false
   167861 $at_check_filter
   167862 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167863 echo >>"$at_stdout"; $as_echo "1
   167864 " | \
   167865   $at_diff - "$at_stdout" || at_failed=:
   167866 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167867 $at_failed && at_fn_log_failure
   167868 $at_traceon; }
   167869 
   167870 
   167871 { set +x
   167872 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   167873 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   167874 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   167875 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167876 at_status=$? at_failed=false
   167877 $at_check_filter
   167878 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167879 echo >>"$at_stdout"; $as_echo "1
   167880 " | \
   167881   $at_diff - "$at_stdout" || at_failed=:
   167882 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167883 $at_failed && at_fn_log_failure
   167884 $at_traceon; }
   167885 
   167886 
   167887 { set +x
   167888 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
   167889 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688"
   167890 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
   167891 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167892 at_status=$? at_failed=false
   167893 $at_check_filter
   167894 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167895 echo >>"$at_stdout"; $as_echo "1
   167896 " | \
   167897   $at_diff - "$at_stdout" || at_failed=:
   167898 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167899 $at_failed && at_fn_log_failure
   167900 $at_traceon; }
   167901 
   167902 
   167903 
   167904 cat >YYParser.y <<'_ATEOF'
   167905 
   167906 %language "Java"
   167907 %locations
   167908 %debug
   167909 %error-verbose
   167910 %token-table
   167911 
   167912 %define throws ""
   167913 %define lex_throws "InterruptedException, IllegalAccessException"
   167914 
   167915 
   167916 %code lexer
   167917 {
   167918   Object yylval;
   167919   public Object getLVal() { return yylval; }
   167920 
   167921   public Position getStartPos() { return null; }
   167922   public Position getEndPos()   { return null; }
   167923 
   167924   public void yyerror (Location loc, String s)
   167925   {
   167926     System.err.println (loc + ": " + s);
   167927   }
   167928 
   167929   public int yylex () throws InterruptedException, IllegalAccessException
   167930   {
   167931     throw new IllegalAccessException();
   167932   }
   167933 
   167934 
   167935 }
   167936 %%
   167937 start: "end" {};
   167938 %%
   167939 class Position {}
   167940 _ATEOF
   167941 
   167942 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   167943   at_save_special_files
   167944   mkdir xml-tests
   167945     # Don't combine these Bison invocations since we want to be sure that
   167946   # --report=all isn't required to get the full XML file.
   167947   { set +x
   167948 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   167949                   --graph=xml-tests/test.dot YYParser.y"
   167950 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   167951 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   167952                   --graph=xml-tests/test.dot YYParser.y
   167953 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167954 at_status=$? at_failed=false
   167955 $at_check_filter
   167956 echo stderr:; cat "$at_stderr"
   167957 echo stdout:; cat "$at_stdout"
   167958 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167959 $at_failed && at_fn_log_failure
   167960 $at_traceon; }
   167961 
   167962   { set +x
   167963 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   167964 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   167965 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   167966 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167967 at_status=$? at_failed=false
   167968 $at_check_filter
   167969 echo stderr:; cat "$at_stderr"
   167970 echo stdout:; cat "$at_stdout"
   167971 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167972 $at_failed && at_fn_log_failure
   167973 $at_traceon; }
   167974 
   167975     cp xml-tests/test.output expout
   167976   { set +x
   167977 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167978              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   167979              xml-tests/test.xml"
   167980 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167981 ( $at_check_trace; $XSLTPROC \
   167982              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   167983              xml-tests/test.xml
   167984 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   167985 at_status=$? at_failed=false
   167986 $at_check_filter
   167987 at_fn_diff_devnull "$at_stderr" || at_failed=:
   167988 $at_diff expout "$at_stdout" || at_failed=:
   167989 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   167990 $at_failed && at_fn_log_failure
   167991 $at_traceon; }
   167992 
   167993   sort xml-tests/test.dot > expout
   167994   { set +x
   167995 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   167996              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   167997              xml-tests/test.xml | sort"
   167998 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   167999 ( $at_check_trace; $XSLTPROC \
   168000              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   168001              xml-tests/test.xml | sort
   168002 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168003 at_status=$? at_failed=false
   168004 $at_check_filter
   168005 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168006 $at_diff expout "$at_stdout" || at_failed=:
   168007 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168008 $at_failed && at_fn_log_failure
   168009 $at_traceon; }
   168010 
   168011   rm -rf xml-tests expout
   168012   at_restore_special_files
   168013 fi
   168014 { set +x
   168015 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   168016 at_fn_check_prepare_trace "java.at:688"
   168017 ( $at_check_trace; bison YYParser.y
   168018 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168019 at_status=$? at_failed=false
   168020 $at_check_filter
   168021 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168022 at_fn_diff_devnull "$at_stdout" || at_failed=:
   168023 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168024 $at_failed && at_fn_log_failure
   168025 $at_traceon; }
   168026 
   168027 
   168028 { set +x
   168029 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   168030 at_fn_check_prepare_trace "java.at:688"
   168031 ( $at_check_trace; grep '[mb]4_' YYParser.y
   168032 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168033 at_status=$? at_failed=false
   168034 $at_check_filter
   168035 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168036 echo stdout:; cat "$at_stdout"
   168037 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   168038 $at_failed && at_fn_log_failure
   168039 $at_traceon; }
   168040 
   168041 
   168042 $as_echo "java.at:688" >"$at_check_line_file"
   168043 (test -z "$CONF_JAVAC") \
   168044   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   168045 $as_echo "java.at:688" >"$at_check_line_file"
   168046 (test -z "$CONF_JAVA") \
   168047   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   168048 { set +x
   168049 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   168050 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   168051 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   168052 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168053 at_status=$? at_failed=false
   168054 $at_check_filter
   168055 echo stderr:; cat "$at_stderr"
   168056 echo stdout:; cat "$at_stdout"
   168057 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168058 $at_failed && at_fn_log_failure
   168059 $at_traceon; }
   168060 
   168061 
   168062 { set +x
   168063 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   168064 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   168065 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   168066 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168067 at_status=$? at_failed=false
   168068 $at_check_filter
   168069 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168070 echo >>"$at_stdout"; $as_echo "1
   168071 " | \
   168072   $at_diff - "$at_stdout" || at_failed=:
   168073 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168074 $at_failed && at_fn_log_failure
   168075 $at_traceon; }
   168076 
   168077 
   168078 { set +x
   168079 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
   168080 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688"
   168081 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
   168082 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168083 at_status=$? at_failed=false
   168084 $at_check_filter
   168085 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168086 echo >>"$at_stdout"; $as_echo "1
   168087 " | \
   168088   $at_diff - "$at_stdout" || at_failed=:
   168089 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168090 $at_failed && at_fn_log_failure
   168091 $at_traceon; }
   168092 
   168093 
   168094 { set +x
   168095 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
   168096 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:688"
   168097 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
   168098 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168099 at_status=$? at_failed=false
   168100 $at_check_filter
   168101 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168102 echo >>"$at_stdout"; $as_echo "1
   168103 " | \
   168104   $at_diff - "$at_stdout" || at_failed=:
   168105 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168106 $at_failed && at_fn_log_failure
   168107 $at_traceon; }
   168108 
   168109 
   168110 
   168111 cat >YYParser.y <<'_ATEOF'
   168112 
   168113 %language "Java"
   168114 %locations
   168115 %debug
   168116 %error-verbose
   168117 %token-table
   168118 
   168119 %define throws "ClassNotFoundException"
   168120 %define lex_throws "InterruptedException, IllegalAccessException"
   168121 %initial-action {if (true) throw new ClassNotFoundException();}
   168122 
   168123 %code lexer
   168124 {
   168125   Object yylval;
   168126   public Object getLVal() { return yylval; }
   168127 
   168128   public Position getStartPos() { return null; }
   168129   public Position getEndPos()   { return null; }
   168130 
   168131   public void yyerror (Location loc, String s)
   168132   {
   168133     System.err.println (loc + ": " + s);
   168134   }
   168135 
   168136   public int yylex () throws InterruptedException, IllegalAccessException
   168137   {
   168138     throw new IllegalAccessException();
   168139   }
   168140 
   168141 
   168142 }
   168143 %%
   168144 start: "end" {throw new ClassNotFoundException();};
   168145 %%
   168146 class Position {}
   168147 _ATEOF
   168148 
   168149 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   168150   at_save_special_files
   168151   mkdir xml-tests
   168152     # Don't combine these Bison invocations since we want to be sure that
   168153   # --report=all isn't required to get the full XML file.
   168154   { set +x
   168155 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   168156                   --graph=xml-tests/test.dot YYParser.y"
   168157 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   168158 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   168159                   --graph=xml-tests/test.dot YYParser.y
   168160 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168161 at_status=$? at_failed=false
   168162 $at_check_filter
   168163 echo stderr:; cat "$at_stderr"
   168164 echo stdout:; cat "$at_stdout"
   168165 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168166 $at_failed && at_fn_log_failure
   168167 $at_traceon; }
   168168 
   168169   { set +x
   168170 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   168171 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   168172 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   168173 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168174 at_status=$? at_failed=false
   168175 $at_check_filter
   168176 echo stderr:; cat "$at_stderr"
   168177 echo stdout:; cat "$at_stdout"
   168178 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168179 $at_failed && at_fn_log_failure
   168180 $at_traceon; }
   168181 
   168182     cp xml-tests/test.output expout
   168183   { set +x
   168184 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   168185              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   168186              xml-tests/test.xml"
   168187 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   168188 ( $at_check_trace; $XSLTPROC \
   168189              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   168190              xml-tests/test.xml
   168191 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168192 at_status=$? at_failed=false
   168193 $at_check_filter
   168194 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168195 $at_diff expout "$at_stdout" || at_failed=:
   168196 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168197 $at_failed && at_fn_log_failure
   168198 $at_traceon; }
   168199 
   168200   sort xml-tests/test.dot > expout
   168201   { set +x
   168202 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   168203              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   168204              xml-tests/test.xml | sort"
   168205 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   168206 ( $at_check_trace; $XSLTPROC \
   168207              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   168208              xml-tests/test.xml | sort
   168209 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168210 at_status=$? at_failed=false
   168211 $at_check_filter
   168212 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168213 $at_diff expout "$at_stdout" || at_failed=:
   168214 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168215 $at_failed && at_fn_log_failure
   168216 $at_traceon; }
   168217 
   168218   rm -rf xml-tests expout
   168219   at_restore_special_files
   168220 fi
   168221 { set +x
   168222 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   168223 at_fn_check_prepare_trace "java.at:688"
   168224 ( $at_check_trace; bison YYParser.y
   168225 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168226 at_status=$? at_failed=false
   168227 $at_check_filter
   168228 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168229 at_fn_diff_devnull "$at_stdout" || at_failed=:
   168230 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168231 $at_failed && at_fn_log_failure
   168232 $at_traceon; }
   168233 
   168234 
   168235 { set +x
   168236 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   168237 at_fn_check_prepare_trace "java.at:688"
   168238 ( $at_check_trace; grep '[mb]4_' YYParser.y
   168239 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168240 at_status=$? at_failed=false
   168241 $at_check_filter
   168242 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168243 echo stdout:; cat "$at_stdout"
   168244 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   168245 $at_failed && at_fn_log_failure
   168246 $at_traceon; }
   168247 
   168248 
   168249 $as_echo "java.at:688" >"$at_check_line_file"
   168250 (test -z "$CONF_JAVAC") \
   168251   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   168252 $as_echo "java.at:688" >"$at_check_line_file"
   168253 (test -z "$CONF_JAVA") \
   168254   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   168255 { set +x
   168256 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   168257 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   168258 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   168259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168260 at_status=$? at_failed=false
   168261 $at_check_filter
   168262 echo stderr:; cat "$at_stderr"
   168263 echo stdout:; cat "$at_stdout"
   168264 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168265 $at_failed && at_fn_log_failure
   168266 $at_traceon; }
   168267 
   168268 
   168269 { set +x
   168270 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   168271 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   168272 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   168273 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168274 at_status=$? at_failed=false
   168275 $at_check_filter
   168276 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168277 echo >>"$at_stdout"; $as_echo "1
   168278 " | \
   168279   $at_diff - "$at_stdout" || at_failed=:
   168280 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168281 $at_failed && at_fn_log_failure
   168282 $at_traceon; }
   168283 
   168284 
   168285 { set +x
   168286 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
   168287 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:688"
   168288 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
   168289 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168290 at_status=$? at_failed=false
   168291 $at_check_filter
   168292 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168293 echo >>"$at_stdout"; $as_echo "1
   168294 " | \
   168295   $at_diff - "$at_stdout" || at_failed=:
   168296 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168297 $at_failed && at_fn_log_failure
   168298 $at_traceon; }
   168299 
   168300 
   168301 { set +x
   168302 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java"
   168303 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:688"
   168304 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java
   168305 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168306 at_status=$? at_failed=false
   168307 $at_check_filter
   168308 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168309 echo >>"$at_stdout"; $as_echo "1
   168310 " | \
   168311   $at_diff - "$at_stdout" || at_failed=:
   168312 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168313 $at_failed && at_fn_log_failure
   168314 $at_traceon; }
   168315 
   168316 
   168317 
   168318 cat >YYParser.y <<'_ATEOF'
   168319 
   168320 %language "Java"
   168321 %locations
   168322 %debug
   168323 %error-verbose
   168324 %token-table
   168325 
   168326 %define throws "ClassNotFoundException, InstantiationException"
   168327 %define lex_throws "InterruptedException, IllegalAccessException"
   168328 %initial-action {if (true) throw new InstantiationException();}
   168329 
   168330 %code lexer
   168331 {
   168332   Object yylval;
   168333   public Object getLVal() { return yylval; }
   168334 
   168335   public Position getStartPos() { return null; }
   168336   public Position getEndPos()   { return null; }
   168337 
   168338   public void yyerror (Location loc, String s)
   168339   {
   168340     System.err.println (loc + ": " + s);
   168341   }
   168342 
   168343   public int yylex () throws InterruptedException, IllegalAccessException
   168344   {
   168345     throw new IllegalAccessException();
   168346   }
   168347 
   168348 
   168349 }
   168350 %%
   168351 start: "end" {throw new ClassNotFoundException();};
   168352 %%
   168353 class Position {}
   168354 _ATEOF
   168355 
   168356 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   168357   at_save_special_files
   168358   mkdir xml-tests
   168359     # Don't combine these Bison invocations since we want to be sure that
   168360   # --report=all isn't required to get the full XML file.
   168361   { set +x
   168362 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   168363                   --graph=xml-tests/test.dot YYParser.y"
   168364 at_fn_check_prepare_notrace 'an embedded newline' "java.at:688"
   168365 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   168366                   --graph=xml-tests/test.dot YYParser.y
   168367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168368 at_status=$? at_failed=false
   168369 $at_check_filter
   168370 echo stderr:; cat "$at_stderr"
   168371 echo stdout:; cat "$at_stdout"
   168372 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168373 $at_failed && at_fn_log_failure
   168374 $at_traceon; }
   168375 
   168376   { set +x
   168377 $as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   168378 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688"
   168379 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   168380 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168381 at_status=$? at_failed=false
   168382 $at_check_filter
   168383 echo stderr:; cat "$at_stderr"
   168384 echo stdout:; cat "$at_stdout"
   168385 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168386 $at_failed && at_fn_log_failure
   168387 $at_traceon; }
   168388 
   168389     cp xml-tests/test.output expout
   168390   { set +x
   168391 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   168392              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   168393              xml-tests/test.xml"
   168394 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   168395 ( $at_check_trace; $XSLTPROC \
   168396              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   168397              xml-tests/test.xml
   168398 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168399 at_status=$? at_failed=false
   168400 $at_check_filter
   168401 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168402 $at_diff expout "$at_stdout" || at_failed=:
   168403 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168404 $at_failed && at_fn_log_failure
   168405 $at_traceon; }
   168406 
   168407   sort xml-tests/test.dot > expout
   168408   { set +x
   168409 $as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\
   168410              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   168411              xml-tests/test.xml | sort"
   168412 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688"
   168413 ( $at_check_trace; $XSLTPROC \
   168414              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   168415              xml-tests/test.xml | sort
   168416 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168417 at_status=$? at_failed=false
   168418 $at_check_filter
   168419 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168420 $at_diff expout "$at_stdout" || at_failed=:
   168421 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168422 $at_failed && at_fn_log_failure
   168423 $at_traceon; }
   168424 
   168425   rm -rf xml-tests expout
   168426   at_restore_special_files
   168427 fi
   168428 { set +x
   168429 $as_echo "$at_srcdir/java.at:688: bison YYParser.y"
   168430 at_fn_check_prepare_trace "java.at:688"
   168431 ( $at_check_trace; bison YYParser.y
   168432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168433 at_status=$? at_failed=false
   168434 $at_check_filter
   168435 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168436 at_fn_diff_devnull "$at_stdout" || at_failed=:
   168437 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168438 $at_failed && at_fn_log_failure
   168439 $at_traceon; }
   168440 
   168441 
   168442 { set +x
   168443 $as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y"
   168444 at_fn_check_prepare_trace "java.at:688"
   168445 ( $at_check_trace; grep '[mb]4_' YYParser.y
   168446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168447 at_status=$? at_failed=false
   168448 $at_check_filter
   168449 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168450 echo stdout:; cat "$at_stdout"
   168451 at_fn_check_status 1 $at_status "$at_srcdir/java.at:688"
   168452 $at_failed && at_fn_log_failure
   168453 $at_traceon; }
   168454 
   168455 
   168456 $as_echo "java.at:688" >"$at_check_line_file"
   168457 (test -z "$CONF_JAVAC") \
   168458   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   168459 $as_echo "java.at:688" >"$at_check_line_file"
   168460 (test -z "$CONF_JAVA") \
   168461   && at_fn_check_skip 77 "$at_srcdir/java.at:688"
   168462 { set +x
   168463 $as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java"
   168464 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688"
   168465 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   168466 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168467 at_status=$? at_failed=false
   168468 $at_check_filter
   168469 echo stderr:; cat "$at_stderr"
   168470 echo stdout:; cat "$at_stdout"
   168471 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168472 $at_failed && at_fn_log_failure
   168473 $at_traceon; }
   168474 
   168475 
   168476 { set +x
   168477 $as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
   168478 at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:688"
   168479 ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
   168480 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168481 at_status=$? at_failed=false
   168482 $at_check_filter
   168483 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168484 echo >>"$at_stdout"; $as_echo "1
   168485 " | \
   168486   $at_diff - "$at_stdout" || at_failed=:
   168487 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168488 $at_failed && at_fn_log_failure
   168489 $at_traceon; }
   168490 
   168491 
   168492 { set +x
   168493 $as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
   168494 at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   168495 ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
   168496 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168497 at_status=$? at_failed=false
   168498 $at_check_filter
   168499 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168500 echo >>"$at_stdout"; $as_echo "1
   168501 " | \
   168502   $at_diff - "$at_stdout" || at_failed=:
   168503 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168504 $at_failed && at_fn_log_failure
   168505 $at_traceon; }
   168506 
   168507 
   168508 { set +x
   168509 $as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
   168510 at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:688"
   168511 ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java
   168512 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168513 at_status=$? at_failed=false
   168514 $at_check_filter
   168515 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168516 echo >>"$at_stdout"; $as_echo "1
   168517 " | \
   168518   $at_diff - "$at_stdout" || at_failed=:
   168519 at_fn_check_status 0 $at_status "$at_srcdir/java.at:688"
   168520 $at_failed && at_fn_log_failure
   168521 $at_traceon; }
   168522 
   168523 
   168524 
   168525 
   168526   set +x
   168527   $at_times_p && times >"$at_times_file"
   168528 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   168529 read at_status <"$at_status_file"
   168530 #AT_STOP_319
   168531 #AT_START_320
   168532 at_fn_group_banner 320 'java.at:717' \
   168533   "Java stype, position_class and location_class" "  " 20
   168534 at_xfail=no
   168535 (
   168536   $as_echo "320. $at_setup_line: testing $at_desc ..."
   168537   $at_traceon
   168538 
   168539 
   168540 
   168541 cat >YYParser.y <<'_ATEOF'
   168542 
   168543 %language "Java"
   168544 %locations
   168545 %debug
   168546 %error-verbose
   168547 %token-table
   168548 
   168549 %define stype "java.awt.Color"
   168550 %type<java.awt.Color> start;
   168551 %define api.location.type "MyLoc"
   168552 %define api.position.type "MyPos"
   168553 %code { class MyPos {} }
   168554 %%
   168555 start: "end" {$$ = $<java.awt.Color>1;};
   168556 %%
   168557 class MyPos {}
   168558 _ATEOF
   168559 
   168560 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   168561   at_save_special_files
   168562   mkdir xml-tests
   168563     # Don't combine these Bison invocations since we want to be sure that
   168564   # --report=all isn't required to get the full XML file.
   168565   { set +x
   168566 $as_echo "$at_srcdir/java.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   168567                   --graph=xml-tests/test.dot YYParser.y"
   168568 at_fn_check_prepare_notrace 'an embedded newline' "java.at:719"
   168569 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   168570                   --graph=xml-tests/test.dot YYParser.y
   168571 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168572 at_status=$? at_failed=false
   168573 $at_check_filter
   168574 echo stderr:; cat "$at_stderr"
   168575 echo stdout:; cat "$at_stdout"
   168576 at_fn_check_status 0 $at_status "$at_srcdir/java.at:719"
   168577 $at_failed && at_fn_log_failure
   168578 $at_traceon; }
   168579 
   168580   { set +x
   168581 $as_echo "$at_srcdir/java.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   168582 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:719"
   168583 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   168584 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168585 at_status=$? at_failed=false
   168586 $at_check_filter
   168587 echo stderr:; cat "$at_stderr"
   168588 echo stdout:; cat "$at_stdout"
   168589 at_fn_check_status 0 $at_status "$at_srcdir/java.at:719"
   168590 $at_failed && at_fn_log_failure
   168591 $at_traceon; }
   168592 
   168593     cp xml-tests/test.output expout
   168594   { set +x
   168595 $as_echo "$at_srcdir/java.at:719: \$XSLTPROC \\
   168596              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   168597              xml-tests/test.xml"
   168598 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:719"
   168599 ( $at_check_trace; $XSLTPROC \
   168600              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   168601              xml-tests/test.xml
   168602 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168603 at_status=$? at_failed=false
   168604 $at_check_filter
   168605 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168606 $at_diff expout "$at_stdout" || at_failed=:
   168607 at_fn_check_status 0 $at_status "$at_srcdir/java.at:719"
   168608 $at_failed && at_fn_log_failure
   168609 $at_traceon; }
   168610 
   168611   sort xml-tests/test.dot > expout
   168612   { set +x
   168613 $as_echo "$at_srcdir/java.at:719: \$XSLTPROC \\
   168614              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   168615              xml-tests/test.xml | sort"
   168616 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:719"
   168617 ( $at_check_trace; $XSLTPROC \
   168618              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   168619              xml-tests/test.xml | sort
   168620 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168621 at_status=$? at_failed=false
   168622 $at_check_filter
   168623 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168624 $at_diff expout "$at_stdout" || at_failed=:
   168625 at_fn_check_status 0 $at_status "$at_srcdir/java.at:719"
   168626 $at_failed && at_fn_log_failure
   168627 $at_traceon; }
   168628 
   168629   rm -rf xml-tests expout
   168630   at_restore_special_files
   168631 fi
   168632 { set +x
   168633 $as_echo "$at_srcdir/java.at:719: bison YYParser.y"
   168634 at_fn_check_prepare_trace "java.at:719"
   168635 ( $at_check_trace; bison YYParser.y
   168636 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168637 at_status=$? at_failed=false
   168638 $at_check_filter
   168639 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168640 at_fn_diff_devnull "$at_stdout" || at_failed=:
   168641 at_fn_check_status 0 $at_status "$at_srcdir/java.at:719"
   168642 $at_failed && at_fn_log_failure
   168643 $at_traceon; }
   168644 
   168645 
   168646 { set +x
   168647 $as_echo "$at_srcdir/java.at:719: grep '[mb]4_' YYParser.y"
   168648 at_fn_check_prepare_trace "java.at:719"
   168649 ( $at_check_trace; grep '[mb]4_' YYParser.y
   168650 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168651 at_status=$? at_failed=false
   168652 $at_check_filter
   168653 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168654 echo stdout:; cat "$at_stdout"
   168655 at_fn_check_status 1 $at_status "$at_srcdir/java.at:719"
   168656 $at_failed && at_fn_log_failure
   168657 $at_traceon; }
   168658 
   168659 
   168660 $as_echo "java.at:719" >"$at_check_line_file"
   168661 (test -z "$CONF_JAVAC") \
   168662   && at_fn_check_skip 77 "$at_srcdir/java.at:719"
   168663 $as_echo "java.at:719" >"$at_check_line_file"
   168664 (test -z "$CONF_JAVA") \
   168665   && at_fn_check_skip 77 "$at_srcdir/java.at:719"
   168666 { set +x
   168667 $as_echo "$at_srcdir/java.at:719: \$SHELL ../../../javacomp.sh YYParser.java"
   168668 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:719"
   168669 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   168670 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168671 at_status=$? at_failed=false
   168672 $at_check_filter
   168673 echo stderr:; cat "$at_stderr"
   168674 echo stdout:; cat "$at_stdout"
   168675 at_fn_check_status 0 $at_status "$at_srcdir/java.at:719"
   168676 $at_failed && at_fn_log_failure
   168677 $at_traceon; }
   168678 
   168679 
   168680 { set +x
   168681 $as_echo "$at_srcdir/java.at:725: grep 'java.awt.Color' YYParser.java"
   168682 at_fn_check_prepare_trace "java.at:725"
   168683 ( $at_check_trace; grep 'java.awt.Color' YYParser.java
   168684 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168685 at_status=$? at_failed=false
   168686 $at_check_filter
   168687 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168688 echo stdout:; cat "$at_stdout"
   168689 at_fn_check_status 0 $at_status "$at_srcdir/java.at:725"
   168690 $at_failed && at_fn_log_failure
   168691 $at_traceon; }
   168692 
   168693 { set +x
   168694 $as_echo "$at_srcdir/java.at:726: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'"
   168695 at_fn_check_prepare_notrace 'a shell pipeline' "java.at:726"
   168696 ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position'
   168697 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168698 at_status=$? at_failed=false
   168699 $at_check_filter
   168700 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168701 echo stdout:; cat "$at_stdout"
   168702 at_fn_check_status 1 $at_status "$at_srcdir/java.at:726"
   168703 $at_failed && at_fn_log_failure
   168704 $at_traceon; }
   168705 
   168706 { set +x
   168707 $as_echo "$at_srcdir/java.at:727: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'"
   168708 at_fn_check_prepare_notrace 'a shell pipeline' "java.at:727"
   168709 ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location'
   168710 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168711 at_status=$? at_failed=false
   168712 $at_check_filter
   168713 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168714 echo stdout:; cat "$at_stdout"
   168715 at_fn_check_status 1 $at_status "$at_srcdir/java.at:727"
   168716 $at_failed && at_fn_log_failure
   168717 $at_traceon; }
   168718 
   168719 
   168720 
   168721 cat >YYParser.y <<'_ATEOF'
   168722 
   168723 %language "Java"
   168724 %locations
   168725 %debug
   168726 %error-verbose
   168727 %token-table
   168728 
   168729 %define stype "java.awt.Color"
   168730 %type<java.awt.Color> start;
   168731 %define api.location.type "MyLoc"
   168732 %define api.position.type "MyPos"
   168733 %code { class MyPos {} }
   168734 
   168735 %code lexer
   168736 {
   168737   java.awt.Color yylval;
   168738   public java.awt.Color getLVal() { return yylval; }
   168739 
   168740   public MyPos getStartPos() { return null; }
   168741   public MyPos getEndPos()   { return null; }
   168742 
   168743   public void yyerror (MyLoc loc, String s)
   168744   {
   168745     System.err.println (loc + ": " + s);
   168746   }
   168747 
   168748   public int yylex ()
   168749   {
   168750     return EOF;
   168751   }
   168752 
   168753 
   168754 }
   168755 %%
   168756 start: "end" {$$ = $<java.awt.Color>1;};
   168757 %%
   168758 class MyPos {}
   168759 _ATEOF
   168760 
   168761 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   168762   at_save_special_files
   168763   mkdir xml-tests
   168764     # Don't combine these Bison invocations since we want to be sure that
   168765   # --report=all isn't required to get the full XML file.
   168766   { set +x
   168767 $as_echo "$at_srcdir/java.at:729: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   168768                   --graph=xml-tests/test.dot YYParser.y"
   168769 at_fn_check_prepare_notrace 'an embedded newline' "java.at:729"
   168770 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   168771                   --graph=xml-tests/test.dot YYParser.y
   168772 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168773 at_status=$? at_failed=false
   168774 $at_check_filter
   168775 echo stderr:; cat "$at_stderr"
   168776 echo stdout:; cat "$at_stdout"
   168777 at_fn_check_status 0 $at_status "$at_srcdir/java.at:729"
   168778 $at_failed && at_fn_log_failure
   168779 $at_traceon; }
   168780 
   168781   { set +x
   168782 $as_echo "$at_srcdir/java.at:729: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   168783 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:729"
   168784 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   168785 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168786 at_status=$? at_failed=false
   168787 $at_check_filter
   168788 echo stderr:; cat "$at_stderr"
   168789 echo stdout:; cat "$at_stdout"
   168790 at_fn_check_status 0 $at_status "$at_srcdir/java.at:729"
   168791 $at_failed && at_fn_log_failure
   168792 $at_traceon; }
   168793 
   168794     cp xml-tests/test.output expout
   168795   { set +x
   168796 $as_echo "$at_srcdir/java.at:729: \$XSLTPROC \\
   168797              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   168798              xml-tests/test.xml"
   168799 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:729"
   168800 ( $at_check_trace; $XSLTPROC \
   168801              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   168802              xml-tests/test.xml
   168803 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168804 at_status=$? at_failed=false
   168805 $at_check_filter
   168806 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168807 $at_diff expout "$at_stdout" || at_failed=:
   168808 at_fn_check_status 0 $at_status "$at_srcdir/java.at:729"
   168809 $at_failed && at_fn_log_failure
   168810 $at_traceon; }
   168811 
   168812   sort xml-tests/test.dot > expout
   168813   { set +x
   168814 $as_echo "$at_srcdir/java.at:729: \$XSLTPROC \\
   168815              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   168816              xml-tests/test.xml | sort"
   168817 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:729"
   168818 ( $at_check_trace; $XSLTPROC \
   168819              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   168820              xml-tests/test.xml | sort
   168821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168822 at_status=$? at_failed=false
   168823 $at_check_filter
   168824 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168825 $at_diff expout "$at_stdout" || at_failed=:
   168826 at_fn_check_status 0 $at_status "$at_srcdir/java.at:729"
   168827 $at_failed && at_fn_log_failure
   168828 $at_traceon; }
   168829 
   168830   rm -rf xml-tests expout
   168831   at_restore_special_files
   168832 fi
   168833 { set +x
   168834 $as_echo "$at_srcdir/java.at:729: bison YYParser.y"
   168835 at_fn_check_prepare_trace "java.at:729"
   168836 ( $at_check_trace; bison YYParser.y
   168837 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168838 at_status=$? at_failed=false
   168839 $at_check_filter
   168840 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168841 at_fn_diff_devnull "$at_stdout" || at_failed=:
   168842 at_fn_check_status 0 $at_status "$at_srcdir/java.at:729"
   168843 $at_failed && at_fn_log_failure
   168844 $at_traceon; }
   168845 
   168846 
   168847 { set +x
   168848 $as_echo "$at_srcdir/java.at:729: grep '[mb]4_' YYParser.y"
   168849 at_fn_check_prepare_trace "java.at:729"
   168850 ( $at_check_trace; grep '[mb]4_' YYParser.y
   168851 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168852 at_status=$? at_failed=false
   168853 $at_check_filter
   168854 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168855 echo stdout:; cat "$at_stdout"
   168856 at_fn_check_status 1 $at_status "$at_srcdir/java.at:729"
   168857 $at_failed && at_fn_log_failure
   168858 $at_traceon; }
   168859 
   168860 
   168861 $as_echo "java.at:729" >"$at_check_line_file"
   168862 (test -z "$CONF_JAVAC") \
   168863   && at_fn_check_skip 77 "$at_srcdir/java.at:729"
   168864 $as_echo "java.at:729" >"$at_check_line_file"
   168865 (test -z "$CONF_JAVA") \
   168866   && at_fn_check_skip 77 "$at_srcdir/java.at:729"
   168867 { set +x
   168868 $as_echo "$at_srcdir/java.at:729: \$SHELL ../../../javacomp.sh YYParser.java"
   168869 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:729"
   168870 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   168871 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168872 at_status=$? at_failed=false
   168873 $at_check_filter
   168874 echo stderr:; cat "$at_stderr"
   168875 echo stdout:; cat "$at_stdout"
   168876 at_fn_check_status 0 $at_status "$at_srcdir/java.at:729"
   168877 $at_failed && at_fn_log_failure
   168878 $at_traceon; }
   168879 
   168880 
   168881 { set +x
   168882 $as_echo "$at_srcdir/java.at:737: grep 'java.awt.Color' YYParser.java"
   168883 at_fn_check_prepare_trace "java.at:737"
   168884 ( $at_check_trace; grep 'java.awt.Color' YYParser.java
   168885 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168886 at_status=$? at_failed=false
   168887 $at_check_filter
   168888 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168889 echo stdout:; cat "$at_stdout"
   168890 at_fn_check_status 0 $at_status "$at_srcdir/java.at:737"
   168891 $at_failed && at_fn_log_failure
   168892 $at_traceon; }
   168893 
   168894 { set +x
   168895 $as_echo "$at_srcdir/java.at:738: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'"
   168896 at_fn_check_prepare_notrace 'a shell pipeline' "java.at:738"
   168897 ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position'
   168898 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168899 at_status=$? at_failed=false
   168900 $at_check_filter
   168901 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168902 echo stdout:; cat "$at_stdout"
   168903 at_fn_check_status 1 $at_status "$at_srcdir/java.at:738"
   168904 $at_failed && at_fn_log_failure
   168905 $at_traceon; }
   168906 
   168907 { set +x
   168908 $as_echo "$at_srcdir/java.at:739: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'"
   168909 at_fn_check_prepare_notrace 'a shell pipeline' "java.at:739"
   168910 ( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location'
   168911 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168912 at_status=$? at_failed=false
   168913 $at_check_filter
   168914 at_fn_diff_devnull "$at_stderr" || at_failed=:
   168915 echo stdout:; cat "$at_stdout"
   168916 at_fn_check_status 1 $at_status "$at_srcdir/java.at:739"
   168917 $at_failed && at_fn_log_failure
   168918 $at_traceon; }
   168919 
   168920 
   168921   set +x
   168922   $at_times_p && times >"$at_times_file"
   168923 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   168924 read at_status <"$at_status_file"
   168925 #AT_STOP_320
   168926 #AT_START_321
   168927 at_fn_group_banner 321 'java.at:748' \
   168928   "Java syntax error handling without error token" " " 20
   168929 at_xfail=no
   168930 (
   168931   $as_echo "321. $at_setup_line: testing $at_desc ..."
   168932   $at_traceon
   168933 
   168934 
   168935 cat >YYParser.y <<'_ATEOF'
   168936 %language "Java"
   168937 
   168938 %lex-param { String s }
   168939 
   168940 %code imports {
   168941   import java.io.IOException;
   168942 }
   168943 
   168944 %code lexer {
   168945   String Input;
   168946   int Position;
   168947 
   168948   public YYLexer (String s)
   168949   {
   168950     Input    = s;
   168951     Position = 0;
   168952   }
   168953 
   168954   public void yyerror (String s)
   168955   {
   168956     System.err.println (s);
   168957   }
   168958 
   168959   public Object getLVal ()
   168960   {
   168961     return null;
   168962   }
   168963 
   168964   public int yylex () throws IOException
   168965   {
   168966     if (Position >= Input.length ())
   168967       return EOF;
   168968     else
   168969       return Input.charAt (Position++);
   168970   }
   168971 }
   168972 
   168973 %code {
   168974   public static void main (String args []) throws IOException
   168975   {
   168976     YYParser p = new YYParser (args [0]);
   168977     p.parse ();
   168978   }
   168979 }
   168980 %%
   168981 input:
   168982   'a' 'a'
   168983 ;
   168984 _ATEOF
   168985 
   168986 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   168987   at_save_special_files
   168988   mkdir xml-tests
   168989     # Don't combine these Bison invocations since we want to be sure that
   168990   # --report=all isn't required to get the full XML file.
   168991   { set +x
   168992 $as_echo "$at_srcdir/java.at:799: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   168993                   --graph=xml-tests/test.dot YYParser.y"
   168994 at_fn_check_prepare_notrace 'an embedded newline' "java.at:799"
   168995 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   168996                   --graph=xml-tests/test.dot YYParser.y
   168997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   168998 at_status=$? at_failed=false
   168999 $at_check_filter
   169000 echo stderr:; cat "$at_stderr"
   169001 echo stdout:; cat "$at_stdout"
   169002 at_fn_check_status 0 $at_status "$at_srcdir/java.at:799"
   169003 $at_failed && at_fn_log_failure
   169004 $at_traceon; }
   169005 
   169006   { set +x
   169007 $as_echo "$at_srcdir/java.at:799: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y"
   169008 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:799"
   169009 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y
   169010 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169011 at_status=$? at_failed=false
   169012 $at_check_filter
   169013 echo stderr:; cat "$at_stderr"
   169014 echo stdout:; cat "$at_stdout"
   169015 at_fn_check_status 0 $at_status "$at_srcdir/java.at:799"
   169016 $at_failed && at_fn_log_failure
   169017 $at_traceon; }
   169018 
   169019     cp xml-tests/test.output expout
   169020   { set +x
   169021 $as_echo "$at_srcdir/java.at:799: \$XSLTPROC \\
   169022              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   169023              xml-tests/test.xml"
   169024 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:799"
   169025 ( $at_check_trace; $XSLTPROC \
   169026              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   169027              xml-tests/test.xml
   169028 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169029 at_status=$? at_failed=false
   169030 $at_check_filter
   169031 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169032 $at_diff expout "$at_stdout" || at_failed=:
   169033 at_fn_check_status 0 $at_status "$at_srcdir/java.at:799"
   169034 $at_failed && at_fn_log_failure
   169035 $at_traceon; }
   169036 
   169037   sort xml-tests/test.dot > expout
   169038   { set +x
   169039 $as_echo "$at_srcdir/java.at:799: \$XSLTPROC \\
   169040              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   169041              xml-tests/test.xml | sort"
   169042 at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:799"
   169043 ( $at_check_trace; $XSLTPROC \
   169044              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   169045              xml-tests/test.xml | sort
   169046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169047 at_status=$? at_failed=false
   169048 $at_check_filter
   169049 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169050 $at_diff expout "$at_stdout" || at_failed=:
   169051 at_fn_check_status 0 $at_status "$at_srcdir/java.at:799"
   169052 $at_failed && at_fn_log_failure
   169053 $at_traceon; }
   169054 
   169055   rm -rf xml-tests expout
   169056   at_restore_special_files
   169057 fi
   169058 { set +x
   169059 $as_echo "$at_srcdir/java.at:799: bison YYParser.y"
   169060 at_fn_check_prepare_trace "java.at:799"
   169061 ( $at_check_trace; bison YYParser.y
   169062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169063 at_status=$? at_failed=false
   169064 $at_check_filter
   169065 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169066 at_fn_diff_devnull "$at_stdout" || at_failed=:
   169067 at_fn_check_status 0 $at_status "$at_srcdir/java.at:799"
   169068 $at_failed && at_fn_log_failure
   169069 $at_traceon; }
   169070 
   169071 
   169072 
   169073 $as_echo "java.at:800" >"$at_check_line_file"
   169074 (test -z "$CONF_JAVAC") \
   169075   && at_fn_check_skip 77 "$at_srcdir/java.at:800"
   169076 $as_echo "java.at:800" >"$at_check_line_file"
   169077 (test -z "$CONF_JAVA") \
   169078   && at_fn_check_skip 77 "$at_srcdir/java.at:800"
   169079 { set +x
   169080 $as_echo "$at_srcdir/java.at:800: \$SHELL ../../../javacomp.sh YYParser.java"
   169081 at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:800"
   169082 ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
   169083 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169084 at_status=$? at_failed=false
   169085 $at_check_filter
   169086 echo stderr:; cat "$at_stderr"
   169087 echo stdout:; cat "$at_stdout"
   169088 at_fn_check_status 0 $at_status "$at_srcdir/java.at:800"
   169089 $at_failed && at_fn_log_failure
   169090 $at_traceon; }
   169091 
   169092 { set +x
   169093 $as_echo "$at_srcdir/java.at:801:  \$SHELL ../../../javaexec.sh YYParser aa"
   169094 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser aa" "java.at:801"
   169095 ( $at_check_trace;  $SHELL ../../../javaexec.sh YYParser aa
   169096 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169097 at_status=$? at_failed=false
   169098 $at_check_filter
   169099 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169100 at_fn_diff_devnull "$at_stdout" || at_failed=:
   169101 at_fn_check_status 0 $at_status "$at_srcdir/java.at:801"
   169102 $at_failed && at_fn_log_failure
   169103 $at_traceon; }
   169104 
   169105 { set +x
   169106 $as_echo "$at_srcdir/java.at:802:  \$SHELL ../../../javaexec.sh YYParser ab"
   169107 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ab" "java.at:802"
   169108 ( $at_check_trace;  $SHELL ../../../javaexec.sh YYParser ab
   169109 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169110 at_status=$? at_failed=false
   169111 $at_check_filter
   169112 echo >>"$at_stderr"; $as_echo "syntax error
   169113 " | \
   169114   $at_diff - "$at_stderr" || at_failed=:
   169115 at_fn_diff_devnull "$at_stdout" || at_failed=:
   169116 at_fn_check_status 0 $at_status "$at_srcdir/java.at:802"
   169117 $at_failed && at_fn_log_failure
   169118 $at_traceon; }
   169119 
   169120 { set +x
   169121 $as_echo "$at_srcdir/java.at:804:  \$SHELL ../../../javaexec.sh YYParser ba"
   169122 at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ba" "java.at:804"
   169123 ( $at_check_trace;  $SHELL ../../../javaexec.sh YYParser ba
   169124 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169125 at_status=$? at_failed=false
   169126 $at_check_filter
   169127 echo >>"$at_stderr"; $as_echo "syntax error
   169128 " | \
   169129   $at_diff - "$at_stderr" || at_failed=:
   169130 at_fn_diff_devnull "$at_stdout" || at_failed=:
   169131 at_fn_check_status 0 $at_status "$at_srcdir/java.at:804"
   169132 $at_failed && at_fn_log_failure
   169133 $at_traceon; }
   169134 
   169135 
   169136   set +x
   169137   $at_times_p && times >"$at_times_file"
   169138 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   169139 read at_status <"$at_status_file"
   169140 #AT_STOP_321
   169141 #AT_START_322
   169142 at_fn_group_banner 322 'cxx-type.at:394' \
   169143   "GLR: Resolve ambiguity, impure, no locations" "   " 21
   169144 at_xfail=no
   169145 (
   169146   $as_echo "322. $at_setup_line: testing $at_desc ..."
   169147   $at_traceon
   169148 
   169149 
   169150 
   169151 cat >types.y <<'_ATEOF'
   169152 %code top {
   169153 #include <config.h>
   169154 /* We don't need perfect functions for these tests. */
   169155 #undef malloc
   169156 #undef memcmp
   169157 #undef realloc
   169158 }
   169159 
   169160 /* Simplified C++ Type and Expression Grammar.  */
   169161 
   169162 
   169163 
   169164 %code requires
   169165 {
   169166   #include <stdio.h>
   169167   union Node {
   169168     struct {
   169169       int isNterm;
   169170       int parents;
   169171     } nodeInfo;
   169172     struct {
   169173       int isNterm; /* 1 */
   169174       int parents;
   169175       char const *form;
   169176       union Node *children[3];
   169177     } nterm;
   169178     struct {
   169179       int isNterm; /* 0 */
   169180       int parents;
   169181       char *text;
   169182     } term;
   169183   };
   169184   typedef union Node Node;
   169185   #define YYSTYPE Node *
   169186 }
   169187 
   169188 %code
   169189 {
   169190   static Node *new_nterm (char const *, Node *, Node *, Node *);
   169191   static Node *new_term (char *);
   169192   static void free_node (Node *);
   169193   static char *node_to_string (Node *);
   169194 
   169195   #define YYINITDEPTH 10
   169196   #define YYSTACKEXPANDABLE 1
   169197   static void yyerror ( const char *msg);
   169198   static int yylex (void);
   169199 }
   169200 
   169201 %token TYPENAME ID
   169202 
   169203 %right '='
   169204 %left '+'
   169205 
   169206 %glr-parser
   169207 
   169208 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   169209 
   169210 %%
   169211 
   169212 prog :
   169213      | prog stmt   {
   169214                         char *output;
   169215                         output = node_to_string ($2);
   169216                         printf ("%s\n", output);
   169217                         free (output);
   169218                         free_node ($2);
   169219                    }
   169220      ;
   169221 
   169222 stmt : expr ';'  %dprec 1     { $$ = $1; }
   169223      | decl      %dprec 2
   169224      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   169225      | '@'              { YYACCEPT; }
   169226      ;
   169227 
   169228 expr : ID
   169229      | TYPENAME '(' expr ')'
   169230                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   169231      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   169232      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   169233      ;
   169234 
   169235 decl : TYPENAME declarator ';'
   169236                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   169237      | TYPENAME declarator '=' expr ';'
   169238                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   169239                                           $2, $4); }
   169240      ;
   169241 
   169242 declarator : ID
   169243      | '(' declarator ')' { $$ = $2; }
   169244      ;
   169245 
   169246 %%
   169247 
   169248 #include <ctype.h>
   169249 #include <stdlib.h>
   169250 #include <string.h>
   169251 #include <stdarg.h>
   169252 #include <assert.h>
   169253 
   169254 int
   169255 main (int argc, char **argv)
   169256 {
   169257   assert (argc == 2);
   169258   if (!freopen (argv[1], "r", stdin))
   169259     return 3;
   169260   return yyparse ();
   169261 }
   169262 
   169263 #include <stdio.h>
   169264 /* A C error reporting function.  */
   169265 static
   169266 void yyerror ( const char *msg)
   169267 {
   169268   fprintf (stderr, "%s\n", msg);
   169269 }
   169270 
   169271 int yylex (void)
   169272 {
   169273   char buffer[256];
   169274   int c;
   169275   unsigned int i;
   169276   static int lineNum = 1;
   169277   static int colNum = 0;
   169278 
   169279 #if YYPURE
   169280 # undef yylloc
   169281 # define yylloc (*llocp)
   169282 # undef yylval
   169283 # define yylval (*lvalp)
   169284 #endif
   169285 
   169286   while (1)
   169287     {
   169288       assert (!feof (stdin));
   169289       c = getchar ();
   169290       switch (c)
   169291         {
   169292         case EOF:
   169293           return 0;
   169294         case '\t':
   169295           colNum = (colNum + 7) & ~7;
   169296           break;
   169297         case ' ': case '\f':
   169298           colNum += 1;
   169299           break;
   169300         case '\n':
   169301           lineNum += 1;
   169302           colNum = 0;
   169303           break;
   169304         default:
   169305           {
   169306             int tok;
   169307             if (isalpha (c))
   169308               {
   169309                 i = 0;
   169310 
   169311                 do
   169312                   {
   169313                     buffer[i++] = c;
   169314                     colNum += 1;
   169315                     assert (i != sizeof buffer - 1);
   169316                     c = getchar ();
   169317                   }
   169318                 while (isalnum (c) || c == '_');
   169319 
   169320                 ungetc (c, stdin);
   169321                 buffer[i++] = 0;
   169322                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   169323                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   169324               }
   169325             else
   169326               {
   169327                 colNum += 1;
   169328                 tok = c;
   169329                 yylval = YY_NULL;
   169330               }
   169331             return tok;
   169332           }
   169333         }
   169334     }
   169335 }
   169336 
   169337 static Node *
   169338 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   169339 {
   169340   Node *node = (Node *) malloc (sizeof (Node));
   169341   node->nterm.isNterm = 1;
   169342   node->nterm.parents = 0;
   169343   node->nterm.form = form;
   169344   node->nterm.children[0] = child0;
   169345   if (child0)
   169346     child0->nodeInfo.parents += 1;
   169347   node->nterm.children[1] = child1;
   169348   if (child1)
   169349     child1->nodeInfo.parents += 1;
   169350   node->nterm.children[2] = child2;
   169351   if (child2)
   169352     child2->nodeInfo.parents += 1;
   169353   return node;
   169354 }
   169355 
   169356 static Node *
   169357 new_term (char *text)
   169358 {
   169359   Node *node = (Node *) malloc (sizeof (Node));
   169360   node->term.isNterm = 0;
   169361   node->term.parents = 0;
   169362   node->term.text = text;
   169363   return node;
   169364 }
   169365 
   169366 static void
   169367 free_node (Node *node)
   169368 {
   169369   if (!node)
   169370     return;
   169371   node->nodeInfo.parents -= 1;
   169372   /* Free only if 0 (last parent) or -1 (no parents).  */
   169373   if (node->nodeInfo.parents > 0)
   169374     return;
   169375   if (node->nodeInfo.isNterm == 1)
   169376     {
   169377       free_node (node->nterm.children[0]);
   169378       free_node (node->nterm.children[1]);
   169379       free_node (node->nterm.children[2]);
   169380     }
   169381   else
   169382     free (node->term.text);
   169383   free (node);
   169384 }
   169385 
   169386 static char *
   169387 node_to_string (Node *node)
   169388 {
   169389   char *child0;
   169390   char *child1;
   169391   char *child2;
   169392   char *buffer;
   169393   if (!node)
   169394     {
   169395       buffer = (char *) malloc (1);
   169396       buffer[0] = 0;
   169397     }
   169398   else if (node->nodeInfo.isNterm == 1)
   169399     {
   169400       child0 = node_to_string (node->nterm.children[0]);
   169401       child1 = node_to_string (node->nterm.children[1]);
   169402       child2 = node_to_string (node->nterm.children[2]);
   169403       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   169404                                 + strlen (child1) + strlen (child2) + 1);
   169405       sprintf (buffer, node->nterm.form, child0, child1, child2);
   169406       free (child0);
   169407       free (child1);
   169408       free (child2);
   169409     }
   169410   else
   169411     buffer = strdup (node->term.text);
   169412   return buffer;
   169413 }
   169414 
   169415 
   169416 
   169417 _ATEOF
   169418 
   169419 
   169420 
   169421 cat >test-input <<'_ATEOF'
   169422 
   169423 
   169424 z + q;
   169425 
   169426 T x;
   169427 
   169428 T x = y;
   169429 
   169430 x = y;
   169431 
   169432 T (x) + y;
   169433 
   169434 T (x);
   169435 
   169436 T (y) = z + q;
   169437 
   169438 T (y y) = z + q;
   169439 
   169440 z + q;
   169441 
   169442 @
   169443 
   169444 This is total garbage, but it should be ignored.
   169445 _ATEOF
   169446 
   169447 
   169448 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   169449   at_save_special_files
   169450   mkdir xml-tests
   169451     # Don't combine these Bison invocations since we want to be sure that
   169452   # --report=all isn't required to get the full XML file.
   169453   { set +x
   169454 $as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   169455                   --graph=xml-tests/test.dot -o types.c types.y"
   169456 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:395"
   169457 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   169458                   --graph=xml-tests/test.dot -o types.c types.y
   169459 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169460 at_status=$? at_failed=false
   169461 $at_check_filter
   169462 echo stderr:; cat "$at_stderr"
   169463 echo stdout:; cat "$at_stdout"
   169464 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169465 $at_failed && at_fn_log_failure
   169466 $at_traceon; }
   169467 
   169468   { set +x
   169469 $as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   169470 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:395"
   169471 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   169472 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169473 at_status=$? at_failed=false
   169474 $at_check_filter
   169475 echo stderr:; cat "$at_stderr"
   169476 echo stdout:; cat "$at_stdout"
   169477 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169478 $at_failed && at_fn_log_failure
   169479 $at_traceon; }
   169480 
   169481     cp xml-tests/test.output expout
   169482   { set +x
   169483 $as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\
   169484              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   169485              xml-tests/test.xml"
   169486 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395"
   169487 ( $at_check_trace; $XSLTPROC \
   169488              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   169489              xml-tests/test.xml
   169490 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169491 at_status=$? at_failed=false
   169492 $at_check_filter
   169493 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169494 $at_diff expout "$at_stdout" || at_failed=:
   169495 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169496 $at_failed && at_fn_log_failure
   169497 $at_traceon; }
   169498 
   169499   sort xml-tests/test.dot > expout
   169500   { set +x
   169501 $as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\
   169502              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   169503              xml-tests/test.xml | sort"
   169504 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395"
   169505 ( $at_check_trace; $XSLTPROC \
   169506              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   169507              xml-tests/test.xml | sort
   169508 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169509 at_status=$? at_failed=false
   169510 $at_check_filter
   169511 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169512 $at_diff expout "$at_stdout" || at_failed=:
   169513 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169514 $at_failed && at_fn_log_failure
   169515 $at_traceon; }
   169516 
   169517   rm -rf xml-tests expout
   169518   at_restore_special_files
   169519 fi
   169520 { set +x
   169521 $as_echo "$at_srcdir/cxx-type.at:395: bison -o types.c types.y"
   169522 at_fn_check_prepare_trace "cxx-type.at:395"
   169523 ( $at_check_trace; bison -o types.c types.y
   169524 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169525 at_status=$? at_failed=false
   169526 $at_check_filter
   169527 echo stderr:; cat "$at_stderr"
   169528 at_fn_diff_devnull "$at_stdout" || at_failed=:
   169529 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169530 $at_failed && at_fn_log_failure
   169531 $at_traceon; }
   169532 
   169533 
   169534 { set +x
   169535 $as_echo "$at_srcdir/cxx-type.at:395: \$BISON_C_WORKS"
   169536 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:395"
   169537 ( $at_check_trace; $BISON_C_WORKS
   169538 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169539 at_status=$? at_failed=false
   169540 $at_check_filter
   169541 echo stderr:; cat "$at_stderr"
   169542 echo stdout:; cat "$at_stdout"
   169543 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169544 $at_failed && at_fn_log_failure
   169545 $at_traceon; }
   169546 
   169547 { set +x
   169548 $as_echo "$at_srcdir/cxx-type.at:395: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   169549 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:395"
   169550 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   169551 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169552 at_status=$? at_failed=false
   169553 $at_check_filter
   169554 echo stderr:; cat "$at_stderr"
   169555 echo stdout:; cat "$at_stdout"
   169556 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
   169557 $at_failed && at_fn_log_failure
   169558 $at_traceon; }
   169559 
   169560 
   169561 
   169562 { set +x
   169563 $as_echo "$at_srcdir/cxx-type.at:397:  \$PREPARSER ./types test-input"
   169564 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:397"
   169565 ( $at_check_trace;  $PREPARSER ./types test-input
   169566 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169567 at_status=$? at_failed=false
   169568 $at_check_filter
   169569 echo stderr:; tee stderr <"$at_stderr"
   169570 echo >>"$at_stdout"; $as_echo "+(z,q)
   169571 <declare>(T,x)
   169572 <init-declare>(T,x,y)
   169573 =(x,y)
   169574 +(<cast>(x,T),y)
   169575 <declare>(T,x)
   169576 <init-declare>(T,y,+(z,q))
   169577 <error>
   169578 +(z,q)
   169579 " | \
   169580   $at_diff - "$at_stdout" || at_failed=:
   169581 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:397"
   169582 $at_failed && at_fn_log_failure
   169583 $at_traceon; }
   169584 
   169585 { set +x
   169586 $as_echo "$at_srcdir/cxx-type.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   169587 at_fn_check_prepare_trace "cxx-type.at:397"
   169588 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   169589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169590 at_status=$? at_failed=false
   169591 $at_check_filter
   169592 echo >>"$at_stderr"; $as_echo "syntax error
   169593 " | \
   169594   $at_diff - "$at_stderr" || at_failed=:
   169595 at_fn_diff_devnull "$at_stdout" || at_failed=:
   169596 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:397"
   169597 $at_failed && at_fn_log_failure
   169598 $at_traceon; }
   169599 
   169600 
   169601   set +x
   169602   $at_times_p && times >"$at_times_file"
   169603 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   169604 read at_status <"$at_status_file"
   169605 #AT_STOP_322
   169606 #AT_START_323
   169607 at_fn_group_banner 323 'cxx-type.at:401' \
   169608   "GLR: Resolve ambiguity, impure, locations" "      " 21
   169609 at_xfail=no
   169610 (
   169611   $as_echo "323. $at_setup_line: testing $at_desc ..."
   169612   $at_traceon
   169613 
   169614 
   169615 
   169616 cat >types.y <<'_ATEOF'
   169617 %code top {
   169618 #include <config.h>
   169619 /* We don't need perfect functions for these tests. */
   169620 #undef malloc
   169621 #undef memcmp
   169622 #undef realloc
   169623 }
   169624 
   169625 /* Simplified C++ Type and Expression Grammar.  */
   169626 
   169627 %locations
   169628 
   169629 %code requires
   169630 {
   169631   #include <stdio.h>
   169632   union Node {
   169633     struct {
   169634       int isNterm;
   169635       int parents;
   169636     } nodeInfo;
   169637     struct {
   169638       int isNterm; /* 1 */
   169639       int parents;
   169640       char const *form;
   169641       union Node *children[3];
   169642     } nterm;
   169643     struct {
   169644       int isNterm; /* 0 */
   169645       int parents;
   169646       char *text;
   169647     } term;
   169648   };
   169649   typedef union Node Node;
   169650   #define YYSTYPE Node *
   169651 }
   169652 
   169653 %code
   169654 {
   169655   static Node *new_nterm (char const *, Node *, Node *, Node *);
   169656   static Node *new_term (char *);
   169657   static void free_node (Node *);
   169658   static char *node_to_string (Node *);
   169659 
   169660   #define YYINITDEPTH 10
   169661   #define YYSTACKEXPANDABLE 1
   169662   static void yyerror ( const char *msg);
   169663   static int yylex (void);
   169664 }
   169665 
   169666 %token TYPENAME ID
   169667 
   169668 %right '='
   169669 %left '+'
   169670 
   169671 %glr-parser
   169672 
   169673 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   169674 
   169675 %%
   169676 
   169677 prog :
   169678      | prog stmt   {
   169679                         char *output;
   169680                         printf ("%d.%d-%d.%d: ",
   169681                              @2.first_line, @2.first_column,
   169682                              @2.last_line, @2.last_column);
   169683                         output = node_to_string ($2);
   169684                         printf ("%s\n", output);
   169685                         free (output);
   169686                         free_node ($2);
   169687                    }
   169688      ;
   169689 
   169690 stmt : expr ';'  %dprec 1     { $$ = $1; }
   169691      | decl      %dprec 2
   169692      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   169693      | '@'              { YYACCEPT; }
   169694      ;
   169695 
   169696 expr : ID
   169697      | TYPENAME '(' expr ')'
   169698                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   169699      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   169700      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   169701      ;
   169702 
   169703 decl : TYPENAME declarator ';'
   169704                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   169705      | TYPENAME declarator '=' expr ';'
   169706                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   169707                                           $2, $4); }
   169708      ;
   169709 
   169710 declarator : ID
   169711      | '(' declarator ')' { $$ = $2; }
   169712      ;
   169713 
   169714 %%
   169715 
   169716 #include <ctype.h>
   169717 #include <stdlib.h>
   169718 #include <string.h>
   169719 #include <stdarg.h>
   169720 #include <assert.h>
   169721 
   169722 int
   169723 main (int argc, char **argv)
   169724 {
   169725   assert (argc == 2);
   169726   if (!freopen (argv[1], "r", stdin))
   169727     return 3;
   169728   return yyparse ();
   169729 }
   169730 
   169731 #include <stdio.h>
   169732 /* A C error reporting function.  */
   169733 static
   169734 void yyerror ( const char *msg)
   169735 {
   169736   YY_LOCATION_PRINT (stderr, (yylloc));
   169737   fprintf (stderr, ": ");
   169738   fprintf (stderr, "%s\n", msg);
   169739 }
   169740 
   169741 int yylex (void)
   169742 {
   169743   char buffer[256];
   169744   int c;
   169745   unsigned int i;
   169746   static int lineNum = 1;
   169747   static int colNum = 0;
   169748 
   169749 #if YYPURE
   169750 # undef yylloc
   169751 # define yylloc (*llocp)
   169752 # undef yylval
   169753 # define yylval (*lvalp)
   169754 #endif
   169755 
   169756   while (1)
   169757     {
   169758       assert (!feof (stdin));
   169759       c = getchar ();
   169760       switch (c)
   169761         {
   169762         case EOF:
   169763           return 0;
   169764         case '\t':
   169765           colNum = (colNum + 7) & ~7;
   169766           break;
   169767         case ' ': case '\f':
   169768           colNum += 1;
   169769           break;
   169770         case '\n':
   169771           lineNum += 1;
   169772           colNum = 0;
   169773           break;
   169774         default:
   169775           {
   169776             int tok;
   169777             yylloc.first_line = yylloc.last_line = lineNum;
   169778             yylloc.first_column = colNum;
   169779             if (isalpha (c))
   169780               {
   169781                 i = 0;
   169782 
   169783                 do
   169784                   {
   169785                     buffer[i++] = c;
   169786                     colNum += 1;
   169787                     assert (i != sizeof buffer - 1);
   169788                     c = getchar ();
   169789                   }
   169790                 while (isalnum (c) || c == '_');
   169791 
   169792                 ungetc (c, stdin);
   169793                 buffer[i++] = 0;
   169794                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   169795                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   169796               }
   169797             else
   169798               {
   169799                 colNum += 1;
   169800                 tok = c;
   169801                 yylval = YY_NULL;
   169802               }
   169803             yylloc.last_column = colNum-1;
   169804             return tok;
   169805           }
   169806         }
   169807     }
   169808 }
   169809 
   169810 static Node *
   169811 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   169812 {
   169813   Node *node = (Node *) malloc (sizeof (Node));
   169814   node->nterm.isNterm = 1;
   169815   node->nterm.parents = 0;
   169816   node->nterm.form = form;
   169817   node->nterm.children[0] = child0;
   169818   if (child0)
   169819     child0->nodeInfo.parents += 1;
   169820   node->nterm.children[1] = child1;
   169821   if (child1)
   169822     child1->nodeInfo.parents += 1;
   169823   node->nterm.children[2] = child2;
   169824   if (child2)
   169825     child2->nodeInfo.parents += 1;
   169826   return node;
   169827 }
   169828 
   169829 static Node *
   169830 new_term (char *text)
   169831 {
   169832   Node *node = (Node *) malloc (sizeof (Node));
   169833   node->term.isNterm = 0;
   169834   node->term.parents = 0;
   169835   node->term.text = text;
   169836   return node;
   169837 }
   169838 
   169839 static void
   169840 free_node (Node *node)
   169841 {
   169842   if (!node)
   169843     return;
   169844   node->nodeInfo.parents -= 1;
   169845   /* Free only if 0 (last parent) or -1 (no parents).  */
   169846   if (node->nodeInfo.parents > 0)
   169847     return;
   169848   if (node->nodeInfo.isNterm == 1)
   169849     {
   169850       free_node (node->nterm.children[0]);
   169851       free_node (node->nterm.children[1]);
   169852       free_node (node->nterm.children[2]);
   169853     }
   169854   else
   169855     free (node->term.text);
   169856   free (node);
   169857 }
   169858 
   169859 static char *
   169860 node_to_string (Node *node)
   169861 {
   169862   char *child0;
   169863   char *child1;
   169864   char *child2;
   169865   char *buffer;
   169866   if (!node)
   169867     {
   169868       buffer = (char *) malloc (1);
   169869       buffer[0] = 0;
   169870     }
   169871   else if (node->nodeInfo.isNterm == 1)
   169872     {
   169873       child0 = node_to_string (node->nterm.children[0]);
   169874       child1 = node_to_string (node->nterm.children[1]);
   169875       child2 = node_to_string (node->nterm.children[2]);
   169876       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   169877                                 + strlen (child1) + strlen (child2) + 1);
   169878       sprintf (buffer, node->nterm.form, child0, child1, child2);
   169879       free (child0);
   169880       free (child1);
   169881       free (child2);
   169882     }
   169883   else
   169884     buffer = strdup (node->term.text);
   169885   return buffer;
   169886 }
   169887 
   169888 
   169889 
   169890 _ATEOF
   169891 
   169892 
   169893 
   169894 cat >test-input <<'_ATEOF'
   169895 
   169896 
   169897 z + q;
   169898 
   169899 T x;
   169900 
   169901 T x = y;
   169902 
   169903 x = y;
   169904 
   169905 T (x) + y;
   169906 
   169907 T (x);
   169908 
   169909 T (y) = z + q;
   169910 
   169911 T (y y) = z + q;
   169912 
   169913 z + q;
   169914 
   169915 @
   169916 
   169917 This is total garbage, but it should be ignored.
   169918 _ATEOF
   169919 
   169920 
   169921 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   169922   at_save_special_files
   169923   mkdir xml-tests
   169924     # Don't combine these Bison invocations since we want to be sure that
   169925   # --report=all isn't required to get the full XML file.
   169926   { set +x
   169927 $as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   169928                   --graph=xml-tests/test.dot -o types.c types.y"
   169929 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:402"
   169930 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   169931                   --graph=xml-tests/test.dot -o types.c types.y
   169932 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169933 at_status=$? at_failed=false
   169934 $at_check_filter
   169935 echo stderr:; cat "$at_stderr"
   169936 echo stdout:; cat "$at_stdout"
   169937 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   169938 $at_failed && at_fn_log_failure
   169939 $at_traceon; }
   169940 
   169941   { set +x
   169942 $as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   169943 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:402"
   169944 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   169945 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169946 at_status=$? at_failed=false
   169947 $at_check_filter
   169948 echo stderr:; cat "$at_stderr"
   169949 echo stdout:; cat "$at_stdout"
   169950 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   169951 $at_failed && at_fn_log_failure
   169952 $at_traceon; }
   169953 
   169954     cp xml-tests/test.output expout
   169955   { set +x
   169956 $as_echo "$at_srcdir/cxx-type.at:402: \$XSLTPROC \\
   169957              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   169958              xml-tests/test.xml"
   169959 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:402"
   169960 ( $at_check_trace; $XSLTPROC \
   169961              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   169962              xml-tests/test.xml
   169963 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169964 at_status=$? at_failed=false
   169965 $at_check_filter
   169966 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169967 $at_diff expout "$at_stdout" || at_failed=:
   169968 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   169969 $at_failed && at_fn_log_failure
   169970 $at_traceon; }
   169971 
   169972   sort xml-tests/test.dot > expout
   169973   { set +x
   169974 $as_echo "$at_srcdir/cxx-type.at:402: \$XSLTPROC \\
   169975              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   169976              xml-tests/test.xml | sort"
   169977 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:402"
   169978 ( $at_check_trace; $XSLTPROC \
   169979              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   169980              xml-tests/test.xml | sort
   169981 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169982 at_status=$? at_failed=false
   169983 $at_check_filter
   169984 at_fn_diff_devnull "$at_stderr" || at_failed=:
   169985 $at_diff expout "$at_stdout" || at_failed=:
   169986 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   169987 $at_failed && at_fn_log_failure
   169988 $at_traceon; }
   169989 
   169990   rm -rf xml-tests expout
   169991   at_restore_special_files
   169992 fi
   169993 { set +x
   169994 $as_echo "$at_srcdir/cxx-type.at:402: bison -o types.c types.y"
   169995 at_fn_check_prepare_trace "cxx-type.at:402"
   169996 ( $at_check_trace; bison -o types.c types.y
   169997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   169998 at_status=$? at_failed=false
   169999 $at_check_filter
   170000 echo stderr:; cat "$at_stderr"
   170001 at_fn_diff_devnull "$at_stdout" || at_failed=:
   170002 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   170003 $at_failed && at_fn_log_failure
   170004 $at_traceon; }
   170005 
   170006 
   170007 { set +x
   170008 $as_echo "$at_srcdir/cxx-type.at:402: \$BISON_C_WORKS"
   170009 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:402"
   170010 ( $at_check_trace; $BISON_C_WORKS
   170011 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170012 at_status=$? at_failed=false
   170013 $at_check_filter
   170014 echo stderr:; cat "$at_stderr"
   170015 echo stdout:; cat "$at_stdout"
   170016 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   170017 $at_failed && at_fn_log_failure
   170018 $at_traceon; }
   170019 
   170020 { set +x
   170021 $as_echo "$at_srcdir/cxx-type.at:402: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   170022 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:402"
   170023 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   170024 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170025 at_status=$? at_failed=false
   170026 $at_check_filter
   170027 echo stderr:; cat "$at_stderr"
   170028 echo stdout:; cat "$at_stdout"
   170029 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
   170030 $at_failed && at_fn_log_failure
   170031 $at_traceon; }
   170032 
   170033 
   170034 
   170035 { set +x
   170036 $as_echo "$at_srcdir/cxx-type.at:403:  \$PREPARSER ./types test-input"
   170037 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:403"
   170038 ( $at_check_trace;  $PREPARSER ./types test-input
   170039 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170040 at_status=$? at_failed=false
   170041 $at_check_filter
   170042 echo stderr:; tee stderr <"$at_stderr"
   170043 echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
   170044 5.0-5.3: <declare>(T,x)
   170045 7.0-7.7: <init-declare>(T,x,y)
   170046 9.0-9.5: =(x,y)
   170047 11.0-11.9: +(<cast>(x,T),y)
   170048 13.0-13.5: <declare>(T,x)
   170049 15.0-15.13: <init-declare>(T,y,+(z,q))
   170050 17.0-17.15: <error>
   170051 19.0-19.5: +(z,q)
   170052 " | \
   170053   $at_diff - "$at_stdout" || at_failed=:
   170054 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:403"
   170055 $at_failed && at_fn_log_failure
   170056 $at_traceon; }
   170057 
   170058 { set +x
   170059 $as_echo "$at_srcdir/cxx-type.at:403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   170060 at_fn_check_prepare_trace "cxx-type.at:403"
   170061 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   170062 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170063 at_status=$? at_failed=false
   170064 $at_check_filter
   170065 echo >>"$at_stderr"; $as_echo "17.5: syntax error
   170066 " | \
   170067   $at_diff - "$at_stderr" || at_failed=:
   170068 at_fn_diff_devnull "$at_stdout" || at_failed=:
   170069 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:403"
   170070 $at_failed && at_fn_log_failure
   170071 $at_traceon; }
   170072 
   170073 
   170074   set +x
   170075   $at_times_p && times >"$at_times_file"
   170076 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   170077 read at_status <"$at_status_file"
   170078 #AT_STOP_323
   170079 #AT_START_324
   170080 at_fn_group_banner 324 'cxx-type.at:407' \
   170081   "GLR: Resolve ambiguity, pure, no locations" "     " 21
   170082 at_xfail=no
   170083 (
   170084   $as_echo "324. $at_setup_line: testing $at_desc ..."
   170085   $at_traceon
   170086 
   170087 
   170088 
   170089 cat >types.y <<'_ATEOF'
   170090 %code top {
   170091 #include <config.h>
   170092 /* We don't need perfect functions for these tests. */
   170093 #undef malloc
   170094 #undef memcmp
   170095 #undef realloc
   170096 }
   170097 
   170098 /* Simplified C++ Type and Expression Grammar.  */
   170099 
   170100 %define api.pure
   170101 
   170102 %code requires
   170103 {
   170104   #include <stdio.h>
   170105   union Node {
   170106     struct {
   170107       int isNterm;
   170108       int parents;
   170109     } nodeInfo;
   170110     struct {
   170111       int isNterm; /* 1 */
   170112       int parents;
   170113       char const *form;
   170114       union Node *children[3];
   170115     } nterm;
   170116     struct {
   170117       int isNterm; /* 0 */
   170118       int parents;
   170119       char *text;
   170120     } term;
   170121   };
   170122   typedef union Node Node;
   170123   #define YYSTYPE Node *
   170124 }
   170125 
   170126 %code
   170127 {
   170128   static Node *new_nterm (char const *, Node *, Node *, Node *);
   170129   static Node *new_term (char *);
   170130   static void free_node (Node *);
   170131   static char *node_to_string (Node *);
   170132 
   170133   #define YYINITDEPTH 10
   170134   #define YYSTACKEXPANDABLE 1
   170135   static void yyerror ( const char *msg);
   170136   static int yylex (YYSTYPE *lvalp);
   170137 }
   170138 
   170139 %token TYPENAME ID
   170140 
   170141 %right '='
   170142 %left '+'
   170143 
   170144 %glr-parser
   170145 
   170146 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   170147 
   170148 %%
   170149 
   170150 prog :
   170151      | prog stmt   {
   170152                         char *output;
   170153                         output = node_to_string ($2);
   170154                         printf ("%s\n", output);
   170155                         free (output);
   170156                         free_node ($2);
   170157                    }
   170158      ;
   170159 
   170160 stmt : expr ';'  %dprec 1     { $$ = $1; }
   170161      | decl      %dprec 2
   170162      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   170163      | '@'              { YYACCEPT; }
   170164      ;
   170165 
   170166 expr : ID
   170167      | TYPENAME '(' expr ')'
   170168                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   170169      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   170170      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   170171      ;
   170172 
   170173 decl : TYPENAME declarator ';'
   170174                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   170175      | TYPENAME declarator '=' expr ';'
   170176                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   170177                                           $2, $4); }
   170178      ;
   170179 
   170180 declarator : ID
   170181      | '(' declarator ')' { $$ = $2; }
   170182      ;
   170183 
   170184 %%
   170185 
   170186 #include <ctype.h>
   170187 #include <stdlib.h>
   170188 #include <string.h>
   170189 #include <stdarg.h>
   170190 #include <assert.h>
   170191 
   170192 int
   170193 main (int argc, char **argv)
   170194 {
   170195   assert (argc == 2);
   170196   if (!freopen (argv[1], "r", stdin))
   170197     return 3;
   170198   return yyparse ();
   170199 }
   170200 
   170201 #include <stdio.h>
   170202 /* A C error reporting function.  */
   170203 static
   170204 void yyerror ( const char *msg)
   170205 {
   170206   fprintf (stderr, "%s\n", msg);
   170207 }
   170208 
   170209 int yylex (YYSTYPE *lvalp)
   170210 {
   170211   char buffer[256];
   170212   int c;
   170213   unsigned int i;
   170214   static int lineNum = 1;
   170215   static int colNum = 0;
   170216 
   170217 #if YYPURE
   170218 # undef yylloc
   170219 # define yylloc (*llocp)
   170220 # undef yylval
   170221 # define yylval (*lvalp)
   170222 #endif
   170223 
   170224   while (1)
   170225     {
   170226       assert (!feof (stdin));
   170227       c = getchar ();
   170228       switch (c)
   170229         {
   170230         case EOF:
   170231           return 0;
   170232         case '\t':
   170233           colNum = (colNum + 7) & ~7;
   170234           break;
   170235         case ' ': case '\f':
   170236           colNum += 1;
   170237           break;
   170238         case '\n':
   170239           lineNum += 1;
   170240           colNum = 0;
   170241           break;
   170242         default:
   170243           {
   170244             int tok;
   170245             if (isalpha (c))
   170246               {
   170247                 i = 0;
   170248 
   170249                 do
   170250                   {
   170251                     buffer[i++] = c;
   170252                     colNum += 1;
   170253                     assert (i != sizeof buffer - 1);
   170254                     c = getchar ();
   170255                   }
   170256                 while (isalnum (c) || c == '_');
   170257 
   170258                 ungetc (c, stdin);
   170259                 buffer[i++] = 0;
   170260                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   170261                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   170262               }
   170263             else
   170264               {
   170265                 colNum += 1;
   170266                 tok = c;
   170267                 yylval = YY_NULL;
   170268               }
   170269             return tok;
   170270           }
   170271         }
   170272     }
   170273 }
   170274 
   170275 static Node *
   170276 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   170277 {
   170278   Node *node = (Node *) malloc (sizeof (Node));
   170279   node->nterm.isNterm = 1;
   170280   node->nterm.parents = 0;
   170281   node->nterm.form = form;
   170282   node->nterm.children[0] = child0;
   170283   if (child0)
   170284     child0->nodeInfo.parents += 1;
   170285   node->nterm.children[1] = child1;
   170286   if (child1)
   170287     child1->nodeInfo.parents += 1;
   170288   node->nterm.children[2] = child2;
   170289   if (child2)
   170290     child2->nodeInfo.parents += 1;
   170291   return node;
   170292 }
   170293 
   170294 static Node *
   170295 new_term (char *text)
   170296 {
   170297   Node *node = (Node *) malloc (sizeof (Node));
   170298   node->term.isNterm = 0;
   170299   node->term.parents = 0;
   170300   node->term.text = text;
   170301   return node;
   170302 }
   170303 
   170304 static void
   170305 free_node (Node *node)
   170306 {
   170307   if (!node)
   170308     return;
   170309   node->nodeInfo.parents -= 1;
   170310   /* Free only if 0 (last parent) or -1 (no parents).  */
   170311   if (node->nodeInfo.parents > 0)
   170312     return;
   170313   if (node->nodeInfo.isNterm == 1)
   170314     {
   170315       free_node (node->nterm.children[0]);
   170316       free_node (node->nterm.children[1]);
   170317       free_node (node->nterm.children[2]);
   170318     }
   170319   else
   170320     free (node->term.text);
   170321   free (node);
   170322 }
   170323 
   170324 static char *
   170325 node_to_string (Node *node)
   170326 {
   170327   char *child0;
   170328   char *child1;
   170329   char *child2;
   170330   char *buffer;
   170331   if (!node)
   170332     {
   170333       buffer = (char *) malloc (1);
   170334       buffer[0] = 0;
   170335     }
   170336   else if (node->nodeInfo.isNterm == 1)
   170337     {
   170338       child0 = node_to_string (node->nterm.children[0]);
   170339       child1 = node_to_string (node->nterm.children[1]);
   170340       child2 = node_to_string (node->nterm.children[2]);
   170341       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   170342                                 + strlen (child1) + strlen (child2) + 1);
   170343       sprintf (buffer, node->nterm.form, child0, child1, child2);
   170344       free (child0);
   170345       free (child1);
   170346       free (child2);
   170347     }
   170348   else
   170349     buffer = strdup (node->term.text);
   170350   return buffer;
   170351 }
   170352 
   170353 
   170354 
   170355 _ATEOF
   170356 
   170357 
   170358 
   170359 cat >test-input <<'_ATEOF'
   170360 
   170361 
   170362 z + q;
   170363 
   170364 T x;
   170365 
   170366 T x = y;
   170367 
   170368 x = y;
   170369 
   170370 T (x) + y;
   170371 
   170372 T (x);
   170373 
   170374 T (y) = z + q;
   170375 
   170376 T (y y) = z + q;
   170377 
   170378 z + q;
   170379 
   170380 @
   170381 
   170382 This is total garbage, but it should be ignored.
   170383 _ATEOF
   170384 
   170385 
   170386 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   170387   at_save_special_files
   170388   mkdir xml-tests
   170389     # Don't combine these Bison invocations since we want to be sure that
   170390   # --report=all isn't required to get the full XML file.
   170391   { set +x
   170392 $as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   170393                   --graph=xml-tests/test.dot -o types.c types.y"
   170394 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:408"
   170395 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   170396                   --graph=xml-tests/test.dot -o types.c types.y
   170397 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170398 at_status=$? at_failed=false
   170399 $at_check_filter
   170400 echo stderr:; cat "$at_stderr"
   170401 echo stdout:; cat "$at_stdout"
   170402 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170403 $at_failed && at_fn_log_failure
   170404 $at_traceon; }
   170405 
   170406   { set +x
   170407 $as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   170408 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:408"
   170409 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   170410 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170411 at_status=$? at_failed=false
   170412 $at_check_filter
   170413 echo stderr:; cat "$at_stderr"
   170414 echo stdout:; cat "$at_stdout"
   170415 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170416 $at_failed && at_fn_log_failure
   170417 $at_traceon; }
   170418 
   170419     cp xml-tests/test.output expout
   170420   { set +x
   170421 $as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\
   170422              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   170423              xml-tests/test.xml"
   170424 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408"
   170425 ( $at_check_trace; $XSLTPROC \
   170426              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   170427              xml-tests/test.xml
   170428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170429 at_status=$? at_failed=false
   170430 $at_check_filter
   170431 at_fn_diff_devnull "$at_stderr" || at_failed=:
   170432 $at_diff expout "$at_stdout" || at_failed=:
   170433 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170434 $at_failed && at_fn_log_failure
   170435 $at_traceon; }
   170436 
   170437   sort xml-tests/test.dot > expout
   170438   { set +x
   170439 $as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\
   170440              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   170441              xml-tests/test.xml | sort"
   170442 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408"
   170443 ( $at_check_trace; $XSLTPROC \
   170444              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   170445              xml-tests/test.xml | sort
   170446 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170447 at_status=$? at_failed=false
   170448 $at_check_filter
   170449 at_fn_diff_devnull "$at_stderr" || at_failed=:
   170450 $at_diff expout "$at_stdout" || at_failed=:
   170451 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170452 $at_failed && at_fn_log_failure
   170453 $at_traceon; }
   170454 
   170455   rm -rf xml-tests expout
   170456   at_restore_special_files
   170457 fi
   170458 { set +x
   170459 $as_echo "$at_srcdir/cxx-type.at:408: bison -o types.c types.y"
   170460 at_fn_check_prepare_trace "cxx-type.at:408"
   170461 ( $at_check_trace; bison -o types.c types.y
   170462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170463 at_status=$? at_failed=false
   170464 $at_check_filter
   170465 echo stderr:; cat "$at_stderr"
   170466 at_fn_diff_devnull "$at_stdout" || at_failed=:
   170467 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170468 $at_failed && at_fn_log_failure
   170469 $at_traceon; }
   170470 
   170471 
   170472 { set +x
   170473 $as_echo "$at_srcdir/cxx-type.at:408: \$BISON_C_WORKS"
   170474 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:408"
   170475 ( $at_check_trace; $BISON_C_WORKS
   170476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170477 at_status=$? at_failed=false
   170478 $at_check_filter
   170479 echo stderr:; cat "$at_stderr"
   170480 echo stdout:; cat "$at_stdout"
   170481 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170482 $at_failed && at_fn_log_failure
   170483 $at_traceon; }
   170484 
   170485 { set +x
   170486 $as_echo "$at_srcdir/cxx-type.at:408: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   170487 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:408"
   170488 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   170489 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170490 at_status=$? at_failed=false
   170491 $at_check_filter
   170492 echo stderr:; cat "$at_stderr"
   170493 echo stdout:; cat "$at_stdout"
   170494 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
   170495 $at_failed && at_fn_log_failure
   170496 $at_traceon; }
   170497 
   170498 
   170499 
   170500 { set +x
   170501 $as_echo "$at_srcdir/cxx-type.at:410:  \$PREPARSER ./types test-input"
   170502 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:410"
   170503 ( $at_check_trace;  $PREPARSER ./types test-input
   170504 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170505 at_status=$? at_failed=false
   170506 $at_check_filter
   170507 echo stderr:; tee stderr <"$at_stderr"
   170508 echo >>"$at_stdout"; $as_echo "+(z,q)
   170509 <declare>(T,x)
   170510 <init-declare>(T,x,y)
   170511 =(x,y)
   170512 +(<cast>(x,T),y)
   170513 <declare>(T,x)
   170514 <init-declare>(T,y,+(z,q))
   170515 <error>
   170516 +(z,q)
   170517 " | \
   170518   $at_diff - "$at_stdout" || at_failed=:
   170519 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:410"
   170520 $at_failed && at_fn_log_failure
   170521 $at_traceon; }
   170522 
   170523 { set +x
   170524 $as_echo "$at_srcdir/cxx-type.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   170525 at_fn_check_prepare_trace "cxx-type.at:410"
   170526 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   170527 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170528 at_status=$? at_failed=false
   170529 $at_check_filter
   170530 echo >>"$at_stderr"; $as_echo "syntax error
   170531 " | \
   170532   $at_diff - "$at_stderr" || at_failed=:
   170533 at_fn_diff_devnull "$at_stdout" || at_failed=:
   170534 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:410"
   170535 $at_failed && at_fn_log_failure
   170536 $at_traceon; }
   170537 
   170538 
   170539   set +x
   170540   $at_times_p && times >"$at_times_file"
   170541 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   170542 read at_status <"$at_status_file"
   170543 #AT_STOP_324
   170544 #AT_START_325
   170545 at_fn_group_banner 325 'cxx-type.at:414' \
   170546   "GLR: Resolve ambiguity, pure, locations" "        " 21
   170547 at_xfail=no
   170548 (
   170549   $as_echo "325. $at_setup_line: testing $at_desc ..."
   170550   $at_traceon
   170551 
   170552 
   170553 
   170554 cat >types.y <<'_ATEOF'
   170555 %code top {
   170556 #include <config.h>
   170557 /* We don't need perfect functions for these tests. */
   170558 #undef malloc
   170559 #undef memcmp
   170560 #undef realloc
   170561 }
   170562 
   170563 /* Simplified C++ Type and Expression Grammar.  */
   170564 
   170565 %define api.pure %locations
   170566 
   170567 %code requires
   170568 {
   170569   #include <stdio.h>
   170570   union Node {
   170571     struct {
   170572       int isNterm;
   170573       int parents;
   170574     } nodeInfo;
   170575     struct {
   170576       int isNterm; /* 1 */
   170577       int parents;
   170578       char const *form;
   170579       union Node *children[3];
   170580     } nterm;
   170581     struct {
   170582       int isNterm; /* 0 */
   170583       int parents;
   170584       char *text;
   170585     } term;
   170586   };
   170587   typedef union Node Node;
   170588   #define YYSTYPE Node *
   170589 }
   170590 
   170591 %code
   170592 {
   170593   static Node *new_nterm (char const *, Node *, Node *, Node *);
   170594   static Node *new_term (char *);
   170595   static void free_node (Node *);
   170596   static char *node_to_string (Node *);
   170597 
   170598   #define YYINITDEPTH 10
   170599   #define YYSTACKEXPANDABLE 1
   170600   static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   170601   static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   170602 }
   170603 
   170604 %token TYPENAME ID
   170605 
   170606 %right '='
   170607 %left '+'
   170608 
   170609 %glr-parser
   170610 
   170611 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   170612 
   170613 %%
   170614 
   170615 prog :
   170616      | prog stmt   {
   170617                         char *output;
   170618                         printf ("%d.%d-%d.%d: ",
   170619                              @2.first_line, @2.first_column,
   170620                              @2.last_line, @2.last_column);
   170621                         output = node_to_string ($2);
   170622                         printf ("%s\n", output);
   170623                         free (output);
   170624                         free_node ($2);
   170625                    }
   170626      ;
   170627 
   170628 stmt : expr ';'  %dprec 1     { $$ = $1; }
   170629      | decl      %dprec 2
   170630      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   170631      | '@'              { YYACCEPT; }
   170632      ;
   170633 
   170634 expr : ID
   170635      | TYPENAME '(' expr ')'
   170636                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   170637      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   170638      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   170639      ;
   170640 
   170641 decl : TYPENAME declarator ';'
   170642                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   170643      | TYPENAME declarator '=' expr ';'
   170644                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   170645                                           $2, $4); }
   170646      ;
   170647 
   170648 declarator : ID
   170649      | '(' declarator ')' { $$ = $2; }
   170650      ;
   170651 
   170652 %%
   170653 
   170654 #include <ctype.h>
   170655 #include <stdlib.h>
   170656 #include <string.h>
   170657 #include <stdarg.h>
   170658 #include <assert.h>
   170659 
   170660 int
   170661 main (int argc, char **argv)
   170662 {
   170663   assert (argc == 2);
   170664   if (!freopen (argv[1], "r", stdin))
   170665     return 3;
   170666   return yyparse ();
   170667 }
   170668 
   170669 #include <stdio.h>
   170670 /* A C error reporting function.  */
   170671 static
   170672 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   170673 {
   170674   YY_LOCATION_PRINT (stderr, (*llocp));
   170675   fprintf (stderr, ": ");
   170676   fprintf (stderr, "%s\n", msg);
   170677 }
   170678 
   170679 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   170680 {
   170681   char buffer[256];
   170682   int c;
   170683   unsigned int i;
   170684   static int lineNum = 1;
   170685   static int colNum = 0;
   170686 
   170687 #if YYPURE
   170688 # undef yylloc
   170689 # define yylloc (*llocp)
   170690 # undef yylval
   170691 # define yylval (*lvalp)
   170692 #endif
   170693 
   170694   while (1)
   170695     {
   170696       assert (!feof (stdin));
   170697       c = getchar ();
   170698       switch (c)
   170699         {
   170700         case EOF:
   170701           return 0;
   170702         case '\t':
   170703           colNum = (colNum + 7) & ~7;
   170704           break;
   170705         case ' ': case '\f':
   170706           colNum += 1;
   170707           break;
   170708         case '\n':
   170709           lineNum += 1;
   170710           colNum = 0;
   170711           break;
   170712         default:
   170713           {
   170714             int tok;
   170715             yylloc.first_line = yylloc.last_line = lineNum;
   170716             yylloc.first_column = colNum;
   170717             if (isalpha (c))
   170718               {
   170719                 i = 0;
   170720 
   170721                 do
   170722                   {
   170723                     buffer[i++] = c;
   170724                     colNum += 1;
   170725                     assert (i != sizeof buffer - 1);
   170726                     c = getchar ();
   170727                   }
   170728                 while (isalnum (c) || c == '_');
   170729 
   170730                 ungetc (c, stdin);
   170731                 buffer[i++] = 0;
   170732                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   170733                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   170734               }
   170735             else
   170736               {
   170737                 colNum += 1;
   170738                 tok = c;
   170739                 yylval = YY_NULL;
   170740               }
   170741             yylloc.last_column = colNum-1;
   170742             return tok;
   170743           }
   170744         }
   170745     }
   170746 }
   170747 
   170748 static Node *
   170749 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   170750 {
   170751   Node *node = (Node *) malloc (sizeof (Node));
   170752   node->nterm.isNterm = 1;
   170753   node->nterm.parents = 0;
   170754   node->nterm.form = form;
   170755   node->nterm.children[0] = child0;
   170756   if (child0)
   170757     child0->nodeInfo.parents += 1;
   170758   node->nterm.children[1] = child1;
   170759   if (child1)
   170760     child1->nodeInfo.parents += 1;
   170761   node->nterm.children[2] = child2;
   170762   if (child2)
   170763     child2->nodeInfo.parents += 1;
   170764   return node;
   170765 }
   170766 
   170767 static Node *
   170768 new_term (char *text)
   170769 {
   170770   Node *node = (Node *) malloc (sizeof (Node));
   170771   node->term.isNterm = 0;
   170772   node->term.parents = 0;
   170773   node->term.text = text;
   170774   return node;
   170775 }
   170776 
   170777 static void
   170778 free_node (Node *node)
   170779 {
   170780   if (!node)
   170781     return;
   170782   node->nodeInfo.parents -= 1;
   170783   /* Free only if 0 (last parent) or -1 (no parents).  */
   170784   if (node->nodeInfo.parents > 0)
   170785     return;
   170786   if (node->nodeInfo.isNterm == 1)
   170787     {
   170788       free_node (node->nterm.children[0]);
   170789       free_node (node->nterm.children[1]);
   170790       free_node (node->nterm.children[2]);
   170791     }
   170792   else
   170793     free (node->term.text);
   170794   free (node);
   170795 }
   170796 
   170797 static char *
   170798 node_to_string (Node *node)
   170799 {
   170800   char *child0;
   170801   char *child1;
   170802   char *child2;
   170803   char *buffer;
   170804   if (!node)
   170805     {
   170806       buffer = (char *) malloc (1);
   170807       buffer[0] = 0;
   170808     }
   170809   else if (node->nodeInfo.isNterm == 1)
   170810     {
   170811       child0 = node_to_string (node->nterm.children[0]);
   170812       child1 = node_to_string (node->nterm.children[1]);
   170813       child2 = node_to_string (node->nterm.children[2]);
   170814       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   170815                                 + strlen (child1) + strlen (child2) + 1);
   170816       sprintf (buffer, node->nterm.form, child0, child1, child2);
   170817       free (child0);
   170818       free (child1);
   170819       free (child2);
   170820     }
   170821   else
   170822     buffer = strdup (node->term.text);
   170823   return buffer;
   170824 }
   170825 
   170826 
   170827 
   170828 _ATEOF
   170829 
   170830 
   170831 
   170832 cat >test-input <<'_ATEOF'
   170833 
   170834 
   170835 z + q;
   170836 
   170837 T x;
   170838 
   170839 T x = y;
   170840 
   170841 x = y;
   170842 
   170843 T (x) + y;
   170844 
   170845 T (x);
   170846 
   170847 T (y) = z + q;
   170848 
   170849 T (y y) = z + q;
   170850 
   170851 z + q;
   170852 
   170853 @
   170854 
   170855 This is total garbage, but it should be ignored.
   170856 _ATEOF
   170857 
   170858 
   170859 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   170860   at_save_special_files
   170861   mkdir xml-tests
   170862     # Don't combine these Bison invocations since we want to be sure that
   170863   # --report=all isn't required to get the full XML file.
   170864   { set +x
   170865 $as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   170866                   --graph=xml-tests/test.dot -o types.c types.y"
   170867 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:415"
   170868 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   170869                   --graph=xml-tests/test.dot -o types.c types.y
   170870 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170871 at_status=$? at_failed=false
   170872 $at_check_filter
   170873 echo stderr:; cat "$at_stderr"
   170874 echo stdout:; cat "$at_stdout"
   170875 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170876 $at_failed && at_fn_log_failure
   170877 $at_traceon; }
   170878 
   170879   { set +x
   170880 $as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   170881 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:415"
   170882 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   170883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170884 at_status=$? at_failed=false
   170885 $at_check_filter
   170886 echo stderr:; cat "$at_stderr"
   170887 echo stdout:; cat "$at_stdout"
   170888 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170889 $at_failed && at_fn_log_failure
   170890 $at_traceon; }
   170891 
   170892     cp xml-tests/test.output expout
   170893   { set +x
   170894 $as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\
   170895              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   170896              xml-tests/test.xml"
   170897 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415"
   170898 ( $at_check_trace; $XSLTPROC \
   170899              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   170900              xml-tests/test.xml
   170901 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170902 at_status=$? at_failed=false
   170903 $at_check_filter
   170904 at_fn_diff_devnull "$at_stderr" || at_failed=:
   170905 $at_diff expout "$at_stdout" || at_failed=:
   170906 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170907 $at_failed && at_fn_log_failure
   170908 $at_traceon; }
   170909 
   170910   sort xml-tests/test.dot > expout
   170911   { set +x
   170912 $as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\
   170913              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   170914              xml-tests/test.xml | sort"
   170915 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415"
   170916 ( $at_check_trace; $XSLTPROC \
   170917              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   170918              xml-tests/test.xml | sort
   170919 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170920 at_status=$? at_failed=false
   170921 $at_check_filter
   170922 at_fn_diff_devnull "$at_stderr" || at_failed=:
   170923 $at_diff expout "$at_stdout" || at_failed=:
   170924 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170925 $at_failed && at_fn_log_failure
   170926 $at_traceon; }
   170927 
   170928   rm -rf xml-tests expout
   170929   at_restore_special_files
   170930 fi
   170931 { set +x
   170932 $as_echo "$at_srcdir/cxx-type.at:415: bison -o types.c types.y"
   170933 at_fn_check_prepare_trace "cxx-type.at:415"
   170934 ( $at_check_trace; bison -o types.c types.y
   170935 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170936 at_status=$? at_failed=false
   170937 $at_check_filter
   170938 echo stderr:; cat "$at_stderr"
   170939 at_fn_diff_devnull "$at_stdout" || at_failed=:
   170940 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170941 $at_failed && at_fn_log_failure
   170942 $at_traceon; }
   170943 
   170944 
   170945 { set +x
   170946 $as_echo "$at_srcdir/cxx-type.at:415: \$BISON_C_WORKS"
   170947 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:415"
   170948 ( $at_check_trace; $BISON_C_WORKS
   170949 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170950 at_status=$? at_failed=false
   170951 $at_check_filter
   170952 echo stderr:; cat "$at_stderr"
   170953 echo stdout:; cat "$at_stdout"
   170954 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170955 $at_failed && at_fn_log_failure
   170956 $at_traceon; }
   170957 
   170958 { set +x
   170959 $as_echo "$at_srcdir/cxx-type.at:415: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   170960 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:415"
   170961 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   170962 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170963 at_status=$? at_failed=false
   170964 $at_check_filter
   170965 echo stderr:; cat "$at_stderr"
   170966 echo stdout:; cat "$at_stdout"
   170967 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
   170968 $at_failed && at_fn_log_failure
   170969 $at_traceon; }
   170970 
   170971 
   170972 
   170973 { set +x
   170974 $as_echo "$at_srcdir/cxx-type.at:417:  \$PREPARSER ./types test-input"
   170975 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:417"
   170976 ( $at_check_trace;  $PREPARSER ./types test-input
   170977 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   170978 at_status=$? at_failed=false
   170979 $at_check_filter
   170980 echo stderr:; tee stderr <"$at_stderr"
   170981 echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
   170982 5.0-5.3: <declare>(T,x)
   170983 7.0-7.7: <init-declare>(T,x,y)
   170984 9.0-9.5: =(x,y)
   170985 11.0-11.9: +(<cast>(x,T),y)
   170986 13.0-13.5: <declare>(T,x)
   170987 15.0-15.13: <init-declare>(T,y,+(z,q))
   170988 17.0-17.15: <error>
   170989 19.0-19.5: +(z,q)
   170990 " | \
   170991   $at_diff - "$at_stdout" || at_failed=:
   170992 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:417"
   170993 $at_failed && at_fn_log_failure
   170994 $at_traceon; }
   170995 
   170996 { set +x
   170997 $as_echo "$at_srcdir/cxx-type.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   170998 at_fn_check_prepare_trace "cxx-type.at:417"
   170999 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   171000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171001 at_status=$? at_failed=false
   171002 $at_check_filter
   171003 echo >>"$at_stderr"; $as_echo "17.5: syntax error
   171004 " | \
   171005   $at_diff - "$at_stderr" || at_failed=:
   171006 at_fn_diff_devnull "$at_stdout" || at_failed=:
   171007 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:417"
   171008 $at_failed && at_fn_log_failure
   171009 $at_traceon; }
   171010 
   171011 
   171012   set +x
   171013   $at_times_p && times >"$at_times_file"
   171014 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   171015 read at_status <"$at_status_file"
   171016 #AT_STOP_325
   171017 #AT_START_326
   171018 at_fn_group_banner 326 'cxx-type.at:421' \
   171019   "GLR: Merge conflicting parses, impure, no locations" "" 21
   171020 at_xfail=no
   171021 (
   171022   $as_echo "326. $at_setup_line: testing $at_desc ..."
   171023   $at_traceon
   171024 
   171025 
   171026 
   171027 cat >types.y <<'_ATEOF'
   171028 %code top {
   171029 #include <config.h>
   171030 /* We don't need perfect functions for these tests. */
   171031 #undef malloc
   171032 #undef memcmp
   171033 #undef realloc
   171034 }
   171035 
   171036 /* Simplified C++ Type and Expression Grammar.  */
   171037 
   171038 
   171039 
   171040 %code requires
   171041 {
   171042   #include <stdio.h>
   171043   union Node {
   171044     struct {
   171045       int isNterm;
   171046       int parents;
   171047     } nodeInfo;
   171048     struct {
   171049       int isNterm; /* 1 */
   171050       int parents;
   171051       char const *form;
   171052       union Node *children[3];
   171053     } nterm;
   171054     struct {
   171055       int isNterm; /* 0 */
   171056       int parents;
   171057       char *text;
   171058     } term;
   171059   };
   171060   typedef union Node Node;
   171061   #define YYSTYPE Node *
   171062 }
   171063 
   171064 %code
   171065 {
   171066   static Node *new_nterm (char const *, Node *, Node *, Node *);
   171067   static Node *new_term (char *);
   171068   static void free_node (Node *);
   171069   static char *node_to_string (Node *);
   171070  static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
   171071   #define YYINITDEPTH 10
   171072   #define YYSTACKEXPANDABLE 1
   171073   static void yyerror ( const char *msg);
   171074   static int yylex (void);
   171075 }
   171076 
   171077 %token TYPENAME ID
   171078 
   171079 %right '='
   171080 %left '+'
   171081 
   171082 %glr-parser
   171083 
   171084 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   171085 
   171086 %%
   171087 
   171088 prog :
   171089      | prog stmt   {
   171090                         char *output;
   171091                         output = node_to_string ($2);
   171092                         printf ("%s\n", output);
   171093                         free (output);
   171094                         free_node ($2);
   171095                    }
   171096      ;
   171097 
   171098 stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
   171099      | decl      %merge <stmtMerge>
   171100      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   171101      | '@'              { YYACCEPT; }
   171102      ;
   171103 
   171104 expr : ID
   171105      | TYPENAME '(' expr ')'
   171106                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   171107      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   171108      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   171109      ;
   171110 
   171111 decl : TYPENAME declarator ';'
   171112                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   171113      | TYPENAME declarator '=' expr ';'
   171114                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   171115                                           $2, $4); }
   171116      ;
   171117 
   171118 declarator : ID
   171119      | '(' declarator ')' { $$ = $2; }
   171120      ;
   171121 
   171122 %%
   171123 
   171124 #include <ctype.h>
   171125 #include <stdlib.h>
   171126 #include <string.h>
   171127 #include <stdarg.h>
   171128 #include <assert.h>
   171129 
   171130 int
   171131 main (int argc, char **argv)
   171132 {
   171133   assert (argc == 2);
   171134   if (!freopen (argv[1], "r", stdin))
   171135     return 3;
   171136   return yyparse ();
   171137 }
   171138 
   171139 #include <stdio.h>
   171140 /* A C error reporting function.  */
   171141 static
   171142 void yyerror ( const char *msg)
   171143 {
   171144   fprintf (stderr, "%s\n", msg);
   171145 }
   171146 
   171147 int yylex (void)
   171148 {
   171149   char buffer[256];
   171150   int c;
   171151   unsigned int i;
   171152   static int lineNum = 1;
   171153   static int colNum = 0;
   171154 
   171155 #if YYPURE
   171156 # undef yylloc
   171157 # define yylloc (*llocp)
   171158 # undef yylval
   171159 # define yylval (*lvalp)
   171160 #endif
   171161 
   171162   while (1)
   171163     {
   171164       assert (!feof (stdin));
   171165       c = getchar ();
   171166       switch (c)
   171167         {
   171168         case EOF:
   171169           return 0;
   171170         case '\t':
   171171           colNum = (colNum + 7) & ~7;
   171172           break;
   171173         case ' ': case '\f':
   171174           colNum += 1;
   171175           break;
   171176         case '\n':
   171177           lineNum += 1;
   171178           colNum = 0;
   171179           break;
   171180         default:
   171181           {
   171182             int tok;
   171183             if (isalpha (c))
   171184               {
   171185                 i = 0;
   171186 
   171187                 do
   171188                   {
   171189                     buffer[i++] = c;
   171190                     colNum += 1;
   171191                     assert (i != sizeof buffer - 1);
   171192                     c = getchar ();
   171193                   }
   171194                 while (isalnum (c) || c == '_');
   171195 
   171196                 ungetc (c, stdin);
   171197                 buffer[i++] = 0;
   171198                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   171199                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   171200               }
   171201             else
   171202               {
   171203                 colNum += 1;
   171204                 tok = c;
   171205                 yylval = YY_NULL;
   171206               }
   171207             return tok;
   171208           }
   171209         }
   171210     }
   171211 }
   171212 
   171213 static Node *
   171214 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   171215 {
   171216   Node *node = (Node *) malloc (sizeof (Node));
   171217   node->nterm.isNterm = 1;
   171218   node->nterm.parents = 0;
   171219   node->nterm.form = form;
   171220   node->nterm.children[0] = child0;
   171221   if (child0)
   171222     child0->nodeInfo.parents += 1;
   171223   node->nterm.children[1] = child1;
   171224   if (child1)
   171225     child1->nodeInfo.parents += 1;
   171226   node->nterm.children[2] = child2;
   171227   if (child2)
   171228     child2->nodeInfo.parents += 1;
   171229   return node;
   171230 }
   171231 
   171232 static Node *
   171233 new_term (char *text)
   171234 {
   171235   Node *node = (Node *) malloc (sizeof (Node));
   171236   node->term.isNterm = 0;
   171237   node->term.parents = 0;
   171238   node->term.text = text;
   171239   return node;
   171240 }
   171241 
   171242 static void
   171243 free_node (Node *node)
   171244 {
   171245   if (!node)
   171246     return;
   171247   node->nodeInfo.parents -= 1;
   171248   /* Free only if 0 (last parent) or -1 (no parents).  */
   171249   if (node->nodeInfo.parents > 0)
   171250     return;
   171251   if (node->nodeInfo.isNterm == 1)
   171252     {
   171253       free_node (node->nterm.children[0]);
   171254       free_node (node->nterm.children[1]);
   171255       free_node (node->nterm.children[2]);
   171256     }
   171257   else
   171258     free (node->term.text);
   171259   free (node);
   171260 }
   171261 
   171262 static char *
   171263 node_to_string (Node *node)
   171264 {
   171265   char *child0;
   171266   char *child1;
   171267   char *child2;
   171268   char *buffer;
   171269   if (!node)
   171270     {
   171271       buffer = (char *) malloc (1);
   171272       buffer[0] = 0;
   171273     }
   171274   else if (node->nodeInfo.isNterm == 1)
   171275     {
   171276       child0 = node_to_string (node->nterm.children[0]);
   171277       child1 = node_to_string (node->nterm.children[1]);
   171278       child2 = node_to_string (node->nterm.children[2]);
   171279       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   171280                                 + strlen (child1) + strlen (child2) + 1);
   171281       sprintf (buffer, node->nterm.form, child0, child1, child2);
   171282       free (child0);
   171283       free (child1);
   171284       free (child2);
   171285     }
   171286   else
   171287     buffer = strdup (node->term.text);
   171288   return buffer;
   171289 }
   171290 
   171291 
   171292 static YYSTYPE
   171293 stmtMerge (YYSTYPE x0, YYSTYPE x1)
   171294 {
   171295   return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
   171296 }
   171297 
   171298 _ATEOF
   171299 
   171300 
   171301 
   171302 cat >test-input <<'_ATEOF'
   171303 
   171304 
   171305 z + q;
   171306 
   171307 T x;
   171308 
   171309 T x = y;
   171310 
   171311 x = y;
   171312 
   171313 T (x) + y;
   171314 
   171315 T (x);
   171316 
   171317 T (y) = z + q;
   171318 
   171319 T (y y) = z + q;
   171320 
   171321 z + q;
   171322 
   171323 @
   171324 
   171325 This is total garbage, but it should be ignored.
   171326 _ATEOF
   171327 
   171328 
   171329 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   171330   at_save_special_files
   171331   mkdir xml-tests
   171332     # Don't combine these Bison invocations since we want to be sure that
   171333   # --report=all isn't required to get the full XML file.
   171334   { set +x
   171335 $as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   171336                   --graph=xml-tests/test.dot -o types.c types.y"
   171337 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:422"
   171338 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   171339                   --graph=xml-tests/test.dot -o types.c types.y
   171340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171341 at_status=$? at_failed=false
   171342 $at_check_filter
   171343 echo stderr:; cat "$at_stderr"
   171344 echo stdout:; cat "$at_stdout"
   171345 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171346 $at_failed && at_fn_log_failure
   171347 $at_traceon; }
   171348 
   171349   { set +x
   171350 $as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   171351 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:422"
   171352 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   171353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171354 at_status=$? at_failed=false
   171355 $at_check_filter
   171356 echo stderr:; cat "$at_stderr"
   171357 echo stdout:; cat "$at_stdout"
   171358 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171359 $at_failed && at_fn_log_failure
   171360 $at_traceon; }
   171361 
   171362     cp xml-tests/test.output expout
   171363   { set +x
   171364 $as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\
   171365              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   171366              xml-tests/test.xml"
   171367 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422"
   171368 ( $at_check_trace; $XSLTPROC \
   171369              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   171370              xml-tests/test.xml
   171371 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171372 at_status=$? at_failed=false
   171373 $at_check_filter
   171374 at_fn_diff_devnull "$at_stderr" || at_failed=:
   171375 $at_diff expout "$at_stdout" || at_failed=:
   171376 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171377 $at_failed && at_fn_log_failure
   171378 $at_traceon; }
   171379 
   171380   sort xml-tests/test.dot > expout
   171381   { set +x
   171382 $as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\
   171383              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   171384              xml-tests/test.xml | sort"
   171385 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422"
   171386 ( $at_check_trace; $XSLTPROC \
   171387              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   171388              xml-tests/test.xml | sort
   171389 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171390 at_status=$? at_failed=false
   171391 $at_check_filter
   171392 at_fn_diff_devnull "$at_stderr" || at_failed=:
   171393 $at_diff expout "$at_stdout" || at_failed=:
   171394 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171395 $at_failed && at_fn_log_failure
   171396 $at_traceon; }
   171397 
   171398   rm -rf xml-tests expout
   171399   at_restore_special_files
   171400 fi
   171401 { set +x
   171402 $as_echo "$at_srcdir/cxx-type.at:422: bison -o types.c types.y"
   171403 at_fn_check_prepare_trace "cxx-type.at:422"
   171404 ( $at_check_trace; bison -o types.c types.y
   171405 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171406 at_status=$? at_failed=false
   171407 $at_check_filter
   171408 echo stderr:; cat "$at_stderr"
   171409 at_fn_diff_devnull "$at_stdout" || at_failed=:
   171410 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171411 $at_failed && at_fn_log_failure
   171412 $at_traceon; }
   171413 
   171414 
   171415 { set +x
   171416 $as_echo "$at_srcdir/cxx-type.at:422: \$BISON_C_WORKS"
   171417 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:422"
   171418 ( $at_check_trace; $BISON_C_WORKS
   171419 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171420 at_status=$? at_failed=false
   171421 $at_check_filter
   171422 echo stderr:; cat "$at_stderr"
   171423 echo stdout:; cat "$at_stdout"
   171424 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171425 $at_failed && at_fn_log_failure
   171426 $at_traceon; }
   171427 
   171428 { set +x
   171429 $as_echo "$at_srcdir/cxx-type.at:422: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   171430 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:422"
   171431 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   171432 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171433 at_status=$? at_failed=false
   171434 $at_check_filter
   171435 echo stderr:; cat "$at_stderr"
   171436 echo stdout:; cat "$at_stdout"
   171437 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
   171438 $at_failed && at_fn_log_failure
   171439 $at_traceon; }
   171440 
   171441 
   171442 
   171443 { set +x
   171444 $as_echo "$at_srcdir/cxx-type.at:424:  \$PREPARSER ./types test-input"
   171445 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:424"
   171446 ( $at_check_trace;  $PREPARSER ./types test-input
   171447 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171448 at_status=$? at_failed=false
   171449 $at_check_filter
   171450 echo stderr:; tee stderr <"$at_stderr"
   171451 echo >>"$at_stdout"; $as_echo "+(z,q)
   171452 <declare>(T,x)
   171453 <init-declare>(T,x,y)
   171454 =(x,y)
   171455 +(<cast>(x,T),y)
   171456 <OR>(<declare>(T,x),<cast>(x,T))
   171457 <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
   171458 <error>
   171459 +(z,q)
   171460 " | \
   171461   $at_diff - "$at_stdout" || at_failed=:
   171462 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:424"
   171463 $at_failed && at_fn_log_failure
   171464 $at_traceon; }
   171465 
   171466 { set +x
   171467 $as_echo "$at_srcdir/cxx-type.at:424: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   171468 at_fn_check_prepare_trace "cxx-type.at:424"
   171469 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   171470 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171471 at_status=$? at_failed=false
   171472 $at_check_filter
   171473 echo >>"$at_stderr"; $as_echo "syntax error
   171474 " | \
   171475   $at_diff - "$at_stderr" || at_failed=:
   171476 at_fn_diff_devnull "$at_stdout" || at_failed=:
   171477 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:424"
   171478 $at_failed && at_fn_log_failure
   171479 $at_traceon; }
   171480 
   171481 
   171482   set +x
   171483   $at_times_p && times >"$at_times_file"
   171484 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   171485 read at_status <"$at_status_file"
   171486 #AT_STOP_326
   171487 #AT_START_327
   171488 at_fn_group_banner 327 'cxx-type.at:428' \
   171489   "GLR: Merge conflicting parses, impure, locations" "" 21
   171490 at_xfail=no
   171491 (
   171492   $as_echo "327. $at_setup_line: testing $at_desc ..."
   171493   $at_traceon
   171494 
   171495 
   171496 
   171497 cat >types.y <<'_ATEOF'
   171498 %code top {
   171499 #include <config.h>
   171500 /* We don't need perfect functions for these tests. */
   171501 #undef malloc
   171502 #undef memcmp
   171503 #undef realloc
   171504 }
   171505 
   171506 /* Simplified C++ Type and Expression Grammar.  */
   171507 
   171508 %locations
   171509 
   171510 %code requires
   171511 {
   171512   #include <stdio.h>
   171513   union Node {
   171514     struct {
   171515       int isNterm;
   171516       int parents;
   171517     } nodeInfo;
   171518     struct {
   171519       int isNterm; /* 1 */
   171520       int parents;
   171521       char const *form;
   171522       union Node *children[3];
   171523     } nterm;
   171524     struct {
   171525       int isNterm; /* 0 */
   171526       int parents;
   171527       char *text;
   171528     } term;
   171529   };
   171530   typedef union Node Node;
   171531   #define YYSTYPE Node *
   171532 }
   171533 
   171534 %code
   171535 {
   171536   static Node *new_nterm (char const *, Node *, Node *, Node *);
   171537   static Node *new_term (char *);
   171538   static void free_node (Node *);
   171539   static char *node_to_string (Node *);
   171540  static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
   171541   #define YYINITDEPTH 10
   171542   #define YYSTACKEXPANDABLE 1
   171543   static void yyerror ( const char *msg);
   171544   static int yylex (void);
   171545 }
   171546 
   171547 %token TYPENAME ID
   171548 
   171549 %right '='
   171550 %left '+'
   171551 
   171552 %glr-parser
   171553 
   171554 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   171555 
   171556 %%
   171557 
   171558 prog :
   171559      | prog stmt   {
   171560                         char *output;
   171561                         printf ("%d.%d-%d.%d: ",
   171562                              @2.first_line, @2.first_column,
   171563                              @2.last_line, @2.last_column);
   171564                         output = node_to_string ($2);
   171565                         printf ("%s\n", output);
   171566                         free (output);
   171567                         free_node ($2);
   171568                    }
   171569      ;
   171570 
   171571 stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
   171572      | decl      %merge <stmtMerge>
   171573      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   171574      | '@'              { YYACCEPT; }
   171575      ;
   171576 
   171577 expr : ID
   171578      | TYPENAME '(' expr ')'
   171579                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   171580      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   171581      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   171582      ;
   171583 
   171584 decl : TYPENAME declarator ';'
   171585                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   171586      | TYPENAME declarator '=' expr ';'
   171587                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   171588                                           $2, $4); }
   171589      ;
   171590 
   171591 declarator : ID
   171592      | '(' declarator ')' { $$ = $2; }
   171593      ;
   171594 
   171595 %%
   171596 
   171597 #include <ctype.h>
   171598 #include <stdlib.h>
   171599 #include <string.h>
   171600 #include <stdarg.h>
   171601 #include <assert.h>
   171602 
   171603 int
   171604 main (int argc, char **argv)
   171605 {
   171606   assert (argc == 2);
   171607   if (!freopen (argv[1], "r", stdin))
   171608     return 3;
   171609   return yyparse ();
   171610 }
   171611 
   171612 #include <stdio.h>
   171613 /* A C error reporting function.  */
   171614 static
   171615 void yyerror ( const char *msg)
   171616 {
   171617   YY_LOCATION_PRINT (stderr, (yylloc));
   171618   fprintf (stderr, ": ");
   171619   fprintf (stderr, "%s\n", msg);
   171620 }
   171621 
   171622 int yylex (void)
   171623 {
   171624   char buffer[256];
   171625   int c;
   171626   unsigned int i;
   171627   static int lineNum = 1;
   171628   static int colNum = 0;
   171629 
   171630 #if YYPURE
   171631 # undef yylloc
   171632 # define yylloc (*llocp)
   171633 # undef yylval
   171634 # define yylval (*lvalp)
   171635 #endif
   171636 
   171637   while (1)
   171638     {
   171639       assert (!feof (stdin));
   171640       c = getchar ();
   171641       switch (c)
   171642         {
   171643         case EOF:
   171644           return 0;
   171645         case '\t':
   171646           colNum = (colNum + 7) & ~7;
   171647           break;
   171648         case ' ': case '\f':
   171649           colNum += 1;
   171650           break;
   171651         case '\n':
   171652           lineNum += 1;
   171653           colNum = 0;
   171654           break;
   171655         default:
   171656           {
   171657             int tok;
   171658             yylloc.first_line = yylloc.last_line = lineNum;
   171659             yylloc.first_column = colNum;
   171660             if (isalpha (c))
   171661               {
   171662                 i = 0;
   171663 
   171664                 do
   171665                   {
   171666                     buffer[i++] = c;
   171667                     colNum += 1;
   171668                     assert (i != sizeof buffer - 1);
   171669                     c = getchar ();
   171670                   }
   171671                 while (isalnum (c) || c == '_');
   171672 
   171673                 ungetc (c, stdin);
   171674                 buffer[i++] = 0;
   171675                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   171676                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   171677               }
   171678             else
   171679               {
   171680                 colNum += 1;
   171681                 tok = c;
   171682                 yylval = YY_NULL;
   171683               }
   171684             yylloc.last_column = colNum-1;
   171685             return tok;
   171686           }
   171687         }
   171688     }
   171689 }
   171690 
   171691 static Node *
   171692 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   171693 {
   171694   Node *node = (Node *) malloc (sizeof (Node));
   171695   node->nterm.isNterm = 1;
   171696   node->nterm.parents = 0;
   171697   node->nterm.form = form;
   171698   node->nterm.children[0] = child0;
   171699   if (child0)
   171700     child0->nodeInfo.parents += 1;
   171701   node->nterm.children[1] = child1;
   171702   if (child1)
   171703     child1->nodeInfo.parents += 1;
   171704   node->nterm.children[2] = child2;
   171705   if (child2)
   171706     child2->nodeInfo.parents += 1;
   171707   return node;
   171708 }
   171709 
   171710 static Node *
   171711 new_term (char *text)
   171712 {
   171713   Node *node = (Node *) malloc (sizeof (Node));
   171714   node->term.isNterm = 0;
   171715   node->term.parents = 0;
   171716   node->term.text = text;
   171717   return node;
   171718 }
   171719 
   171720 static void
   171721 free_node (Node *node)
   171722 {
   171723   if (!node)
   171724     return;
   171725   node->nodeInfo.parents -= 1;
   171726   /* Free only if 0 (last parent) or -1 (no parents).  */
   171727   if (node->nodeInfo.parents > 0)
   171728     return;
   171729   if (node->nodeInfo.isNterm == 1)
   171730     {
   171731       free_node (node->nterm.children[0]);
   171732       free_node (node->nterm.children[1]);
   171733       free_node (node->nterm.children[2]);
   171734     }
   171735   else
   171736     free (node->term.text);
   171737   free (node);
   171738 }
   171739 
   171740 static char *
   171741 node_to_string (Node *node)
   171742 {
   171743   char *child0;
   171744   char *child1;
   171745   char *child2;
   171746   char *buffer;
   171747   if (!node)
   171748     {
   171749       buffer = (char *) malloc (1);
   171750       buffer[0] = 0;
   171751     }
   171752   else if (node->nodeInfo.isNterm == 1)
   171753     {
   171754       child0 = node_to_string (node->nterm.children[0]);
   171755       child1 = node_to_string (node->nterm.children[1]);
   171756       child2 = node_to_string (node->nterm.children[2]);
   171757       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   171758                                 + strlen (child1) + strlen (child2) + 1);
   171759       sprintf (buffer, node->nterm.form, child0, child1, child2);
   171760       free (child0);
   171761       free (child1);
   171762       free (child2);
   171763     }
   171764   else
   171765     buffer = strdup (node->term.text);
   171766   return buffer;
   171767 }
   171768 
   171769 
   171770 static YYSTYPE
   171771 stmtMerge (YYSTYPE x0, YYSTYPE x1)
   171772 {
   171773   return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
   171774 }
   171775 
   171776 _ATEOF
   171777 
   171778 
   171779 
   171780 cat >test-input <<'_ATEOF'
   171781 
   171782 
   171783 z + q;
   171784 
   171785 T x;
   171786 
   171787 T x = y;
   171788 
   171789 x = y;
   171790 
   171791 T (x) + y;
   171792 
   171793 T (x);
   171794 
   171795 T (y) = z + q;
   171796 
   171797 T (y y) = z + q;
   171798 
   171799 z + q;
   171800 
   171801 @
   171802 
   171803 This is total garbage, but it should be ignored.
   171804 _ATEOF
   171805 
   171806 
   171807 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   171808   at_save_special_files
   171809   mkdir xml-tests
   171810     # Don't combine these Bison invocations since we want to be sure that
   171811   # --report=all isn't required to get the full XML file.
   171812   { set +x
   171813 $as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   171814                   --graph=xml-tests/test.dot -o types.c types.y"
   171815 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:429"
   171816 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   171817                   --graph=xml-tests/test.dot -o types.c types.y
   171818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171819 at_status=$? at_failed=false
   171820 $at_check_filter
   171821 echo stderr:; cat "$at_stderr"
   171822 echo stdout:; cat "$at_stdout"
   171823 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171824 $at_failed && at_fn_log_failure
   171825 $at_traceon; }
   171826 
   171827   { set +x
   171828 $as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   171829 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:429"
   171830 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   171831 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171832 at_status=$? at_failed=false
   171833 $at_check_filter
   171834 echo stderr:; cat "$at_stderr"
   171835 echo stdout:; cat "$at_stdout"
   171836 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171837 $at_failed && at_fn_log_failure
   171838 $at_traceon; }
   171839 
   171840     cp xml-tests/test.output expout
   171841   { set +x
   171842 $as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\
   171843              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   171844              xml-tests/test.xml"
   171845 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429"
   171846 ( $at_check_trace; $XSLTPROC \
   171847              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   171848              xml-tests/test.xml
   171849 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171850 at_status=$? at_failed=false
   171851 $at_check_filter
   171852 at_fn_diff_devnull "$at_stderr" || at_failed=:
   171853 $at_diff expout "$at_stdout" || at_failed=:
   171854 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171855 $at_failed && at_fn_log_failure
   171856 $at_traceon; }
   171857 
   171858   sort xml-tests/test.dot > expout
   171859   { set +x
   171860 $as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\
   171861              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   171862              xml-tests/test.xml | sort"
   171863 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429"
   171864 ( $at_check_trace; $XSLTPROC \
   171865              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   171866              xml-tests/test.xml | sort
   171867 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171868 at_status=$? at_failed=false
   171869 $at_check_filter
   171870 at_fn_diff_devnull "$at_stderr" || at_failed=:
   171871 $at_diff expout "$at_stdout" || at_failed=:
   171872 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171873 $at_failed && at_fn_log_failure
   171874 $at_traceon; }
   171875 
   171876   rm -rf xml-tests expout
   171877   at_restore_special_files
   171878 fi
   171879 { set +x
   171880 $as_echo "$at_srcdir/cxx-type.at:429: bison -o types.c types.y"
   171881 at_fn_check_prepare_trace "cxx-type.at:429"
   171882 ( $at_check_trace; bison -o types.c types.y
   171883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171884 at_status=$? at_failed=false
   171885 $at_check_filter
   171886 echo stderr:; cat "$at_stderr"
   171887 at_fn_diff_devnull "$at_stdout" || at_failed=:
   171888 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171889 $at_failed && at_fn_log_failure
   171890 $at_traceon; }
   171891 
   171892 
   171893 { set +x
   171894 $as_echo "$at_srcdir/cxx-type.at:429: \$BISON_C_WORKS"
   171895 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:429"
   171896 ( $at_check_trace; $BISON_C_WORKS
   171897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171898 at_status=$? at_failed=false
   171899 $at_check_filter
   171900 echo stderr:; cat "$at_stderr"
   171901 echo stdout:; cat "$at_stdout"
   171902 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171903 $at_failed && at_fn_log_failure
   171904 $at_traceon; }
   171905 
   171906 { set +x
   171907 $as_echo "$at_srcdir/cxx-type.at:429: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   171908 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:429"
   171909 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   171910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171911 at_status=$? at_failed=false
   171912 $at_check_filter
   171913 echo stderr:; cat "$at_stderr"
   171914 echo stdout:; cat "$at_stdout"
   171915 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
   171916 $at_failed && at_fn_log_failure
   171917 $at_traceon; }
   171918 
   171919 
   171920 
   171921 { set +x
   171922 $as_echo "$at_srcdir/cxx-type.at:431:  \$PREPARSER ./types test-input"
   171923 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:431"
   171924 ( $at_check_trace;  $PREPARSER ./types test-input
   171925 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171926 at_status=$? at_failed=false
   171927 $at_check_filter
   171928 echo stderr:; tee stderr <"$at_stderr"
   171929 echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
   171930 5.0-5.3: <declare>(T,x)
   171931 7.0-7.7: <init-declare>(T,x,y)
   171932 9.0-9.5: =(x,y)
   171933 11.0-11.9: +(<cast>(x,T),y)
   171934 13.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
   171935 15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
   171936 17.0-17.15: <error>
   171937 19.0-19.5: +(z,q)
   171938 " | \
   171939   $at_diff - "$at_stdout" || at_failed=:
   171940 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:431"
   171941 $at_failed && at_fn_log_failure
   171942 $at_traceon; }
   171943 
   171944 { set +x
   171945 $as_echo "$at_srcdir/cxx-type.at:431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   171946 at_fn_check_prepare_trace "cxx-type.at:431"
   171947 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   171948 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   171949 at_status=$? at_failed=false
   171950 $at_check_filter
   171951 echo >>"$at_stderr"; $as_echo "17.5: syntax error
   171952 " | \
   171953   $at_diff - "$at_stderr" || at_failed=:
   171954 at_fn_diff_devnull "$at_stdout" || at_failed=:
   171955 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:431"
   171956 $at_failed && at_fn_log_failure
   171957 $at_traceon; }
   171958 
   171959 
   171960   set +x
   171961   $at_times_p && times >"$at_times_file"
   171962 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   171963 read at_status <"$at_status_file"
   171964 #AT_STOP_327
   171965 #AT_START_328
   171966 at_fn_group_banner 328 'cxx-type.at:435' \
   171967   "GLR: Merge conflicting parses, pure, no locations" "" 21
   171968 at_xfail=no
   171969 (
   171970   $as_echo "328. $at_setup_line: testing $at_desc ..."
   171971   $at_traceon
   171972 
   171973 
   171974 
   171975 cat >types.y <<'_ATEOF'
   171976 %code top {
   171977 #include <config.h>
   171978 /* We don't need perfect functions for these tests. */
   171979 #undef malloc
   171980 #undef memcmp
   171981 #undef realloc
   171982 }
   171983 
   171984 /* Simplified C++ Type and Expression Grammar.  */
   171985 
   171986 %define api.pure
   171987 
   171988 %code requires
   171989 {
   171990   #include <stdio.h>
   171991   union Node {
   171992     struct {
   171993       int isNterm;
   171994       int parents;
   171995     } nodeInfo;
   171996     struct {
   171997       int isNterm; /* 1 */
   171998       int parents;
   171999       char const *form;
   172000       union Node *children[3];
   172001     } nterm;
   172002     struct {
   172003       int isNterm; /* 0 */
   172004       int parents;
   172005       char *text;
   172006     } term;
   172007   };
   172008   typedef union Node Node;
   172009   #define YYSTYPE Node *
   172010 }
   172011 
   172012 %code
   172013 {
   172014   static Node *new_nterm (char const *, Node *, Node *, Node *);
   172015   static Node *new_term (char *);
   172016   static void free_node (Node *);
   172017   static char *node_to_string (Node *);
   172018  static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
   172019   #define YYINITDEPTH 10
   172020   #define YYSTACKEXPANDABLE 1
   172021   static void yyerror ( const char *msg);
   172022   static int yylex (YYSTYPE *lvalp);
   172023 }
   172024 
   172025 %token TYPENAME ID
   172026 
   172027 %right '='
   172028 %left '+'
   172029 
   172030 %glr-parser
   172031 
   172032 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   172033 
   172034 %%
   172035 
   172036 prog :
   172037      | prog stmt   {
   172038                         char *output;
   172039                         output = node_to_string ($2);
   172040                         printf ("%s\n", output);
   172041                         free (output);
   172042                         free_node ($2);
   172043                    }
   172044      ;
   172045 
   172046 stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
   172047      | decl      %merge <stmtMerge>
   172048      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   172049      | '@'              { YYACCEPT; }
   172050      ;
   172051 
   172052 expr : ID
   172053      | TYPENAME '(' expr ')'
   172054                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   172055      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   172056      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   172057      ;
   172058 
   172059 decl : TYPENAME declarator ';'
   172060                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   172061      | TYPENAME declarator '=' expr ';'
   172062                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   172063                                           $2, $4); }
   172064      ;
   172065 
   172066 declarator : ID
   172067      | '(' declarator ')' { $$ = $2; }
   172068      ;
   172069 
   172070 %%
   172071 
   172072 #include <ctype.h>
   172073 #include <stdlib.h>
   172074 #include <string.h>
   172075 #include <stdarg.h>
   172076 #include <assert.h>
   172077 
   172078 int
   172079 main (int argc, char **argv)
   172080 {
   172081   assert (argc == 2);
   172082   if (!freopen (argv[1], "r", stdin))
   172083     return 3;
   172084   return yyparse ();
   172085 }
   172086 
   172087 #include <stdio.h>
   172088 /* A C error reporting function.  */
   172089 static
   172090 void yyerror ( const char *msg)
   172091 {
   172092   fprintf (stderr, "%s\n", msg);
   172093 }
   172094 
   172095 int yylex (YYSTYPE *lvalp)
   172096 {
   172097   char buffer[256];
   172098   int c;
   172099   unsigned int i;
   172100   static int lineNum = 1;
   172101   static int colNum = 0;
   172102 
   172103 #if YYPURE
   172104 # undef yylloc
   172105 # define yylloc (*llocp)
   172106 # undef yylval
   172107 # define yylval (*lvalp)
   172108 #endif
   172109 
   172110   while (1)
   172111     {
   172112       assert (!feof (stdin));
   172113       c = getchar ();
   172114       switch (c)
   172115         {
   172116         case EOF:
   172117           return 0;
   172118         case '\t':
   172119           colNum = (colNum + 7) & ~7;
   172120           break;
   172121         case ' ': case '\f':
   172122           colNum += 1;
   172123           break;
   172124         case '\n':
   172125           lineNum += 1;
   172126           colNum = 0;
   172127           break;
   172128         default:
   172129           {
   172130             int tok;
   172131             if (isalpha (c))
   172132               {
   172133                 i = 0;
   172134 
   172135                 do
   172136                   {
   172137                     buffer[i++] = c;
   172138                     colNum += 1;
   172139                     assert (i != sizeof buffer - 1);
   172140                     c = getchar ();
   172141                   }
   172142                 while (isalnum (c) || c == '_');
   172143 
   172144                 ungetc (c, stdin);
   172145                 buffer[i++] = 0;
   172146                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   172147                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   172148               }
   172149             else
   172150               {
   172151                 colNum += 1;
   172152                 tok = c;
   172153                 yylval = YY_NULL;
   172154               }
   172155             return tok;
   172156           }
   172157         }
   172158     }
   172159 }
   172160 
   172161 static Node *
   172162 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   172163 {
   172164   Node *node = (Node *) malloc (sizeof (Node));
   172165   node->nterm.isNterm = 1;
   172166   node->nterm.parents = 0;
   172167   node->nterm.form = form;
   172168   node->nterm.children[0] = child0;
   172169   if (child0)
   172170     child0->nodeInfo.parents += 1;
   172171   node->nterm.children[1] = child1;
   172172   if (child1)
   172173     child1->nodeInfo.parents += 1;
   172174   node->nterm.children[2] = child2;
   172175   if (child2)
   172176     child2->nodeInfo.parents += 1;
   172177   return node;
   172178 }
   172179 
   172180 static Node *
   172181 new_term (char *text)
   172182 {
   172183   Node *node = (Node *) malloc (sizeof (Node));
   172184   node->term.isNterm = 0;
   172185   node->term.parents = 0;
   172186   node->term.text = text;
   172187   return node;
   172188 }
   172189 
   172190 static void
   172191 free_node (Node *node)
   172192 {
   172193   if (!node)
   172194     return;
   172195   node->nodeInfo.parents -= 1;
   172196   /* Free only if 0 (last parent) or -1 (no parents).  */
   172197   if (node->nodeInfo.parents > 0)
   172198     return;
   172199   if (node->nodeInfo.isNterm == 1)
   172200     {
   172201       free_node (node->nterm.children[0]);
   172202       free_node (node->nterm.children[1]);
   172203       free_node (node->nterm.children[2]);
   172204     }
   172205   else
   172206     free (node->term.text);
   172207   free (node);
   172208 }
   172209 
   172210 static char *
   172211 node_to_string (Node *node)
   172212 {
   172213   char *child0;
   172214   char *child1;
   172215   char *child2;
   172216   char *buffer;
   172217   if (!node)
   172218     {
   172219       buffer = (char *) malloc (1);
   172220       buffer[0] = 0;
   172221     }
   172222   else if (node->nodeInfo.isNterm == 1)
   172223     {
   172224       child0 = node_to_string (node->nterm.children[0]);
   172225       child1 = node_to_string (node->nterm.children[1]);
   172226       child2 = node_to_string (node->nterm.children[2]);
   172227       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   172228                                 + strlen (child1) + strlen (child2) + 1);
   172229       sprintf (buffer, node->nterm.form, child0, child1, child2);
   172230       free (child0);
   172231       free (child1);
   172232       free (child2);
   172233     }
   172234   else
   172235     buffer = strdup (node->term.text);
   172236   return buffer;
   172237 }
   172238 
   172239 
   172240 static YYSTYPE
   172241 stmtMerge (YYSTYPE x0, YYSTYPE x1)
   172242 {
   172243   return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
   172244 }
   172245 
   172246 _ATEOF
   172247 
   172248 
   172249 
   172250 cat >test-input <<'_ATEOF'
   172251 
   172252 
   172253 z + q;
   172254 
   172255 T x;
   172256 
   172257 T x = y;
   172258 
   172259 x = y;
   172260 
   172261 T (x) + y;
   172262 
   172263 T (x);
   172264 
   172265 T (y) = z + q;
   172266 
   172267 T (y y) = z + q;
   172268 
   172269 z + q;
   172270 
   172271 @
   172272 
   172273 This is total garbage, but it should be ignored.
   172274 _ATEOF
   172275 
   172276 
   172277 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   172278   at_save_special_files
   172279   mkdir xml-tests
   172280     # Don't combine these Bison invocations since we want to be sure that
   172281   # --report=all isn't required to get the full XML file.
   172282   { set +x
   172283 $as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   172284                   --graph=xml-tests/test.dot -o types.c types.y"
   172285 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:436"
   172286 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   172287                   --graph=xml-tests/test.dot -o types.c types.y
   172288 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172289 at_status=$? at_failed=false
   172290 $at_check_filter
   172291 echo stderr:; cat "$at_stderr"
   172292 echo stdout:; cat "$at_stdout"
   172293 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172294 $at_failed && at_fn_log_failure
   172295 $at_traceon; }
   172296 
   172297   { set +x
   172298 $as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   172299 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:436"
   172300 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   172301 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172302 at_status=$? at_failed=false
   172303 $at_check_filter
   172304 echo stderr:; cat "$at_stderr"
   172305 echo stdout:; cat "$at_stdout"
   172306 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172307 $at_failed && at_fn_log_failure
   172308 $at_traceon; }
   172309 
   172310     cp xml-tests/test.output expout
   172311   { set +x
   172312 $as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\
   172313              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   172314              xml-tests/test.xml"
   172315 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436"
   172316 ( $at_check_trace; $XSLTPROC \
   172317              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   172318              xml-tests/test.xml
   172319 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172320 at_status=$? at_failed=false
   172321 $at_check_filter
   172322 at_fn_diff_devnull "$at_stderr" || at_failed=:
   172323 $at_diff expout "$at_stdout" || at_failed=:
   172324 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172325 $at_failed && at_fn_log_failure
   172326 $at_traceon; }
   172327 
   172328   sort xml-tests/test.dot > expout
   172329   { set +x
   172330 $as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\
   172331              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   172332              xml-tests/test.xml | sort"
   172333 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436"
   172334 ( $at_check_trace; $XSLTPROC \
   172335              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   172336              xml-tests/test.xml | sort
   172337 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172338 at_status=$? at_failed=false
   172339 $at_check_filter
   172340 at_fn_diff_devnull "$at_stderr" || at_failed=:
   172341 $at_diff expout "$at_stdout" || at_failed=:
   172342 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172343 $at_failed && at_fn_log_failure
   172344 $at_traceon; }
   172345 
   172346   rm -rf xml-tests expout
   172347   at_restore_special_files
   172348 fi
   172349 { set +x
   172350 $as_echo "$at_srcdir/cxx-type.at:436: bison -o types.c types.y"
   172351 at_fn_check_prepare_trace "cxx-type.at:436"
   172352 ( $at_check_trace; bison -o types.c types.y
   172353 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172354 at_status=$? at_failed=false
   172355 $at_check_filter
   172356 echo stderr:; cat "$at_stderr"
   172357 at_fn_diff_devnull "$at_stdout" || at_failed=:
   172358 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172359 $at_failed && at_fn_log_failure
   172360 $at_traceon; }
   172361 
   172362 
   172363 { set +x
   172364 $as_echo "$at_srcdir/cxx-type.at:436: \$BISON_C_WORKS"
   172365 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:436"
   172366 ( $at_check_trace; $BISON_C_WORKS
   172367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172368 at_status=$? at_failed=false
   172369 $at_check_filter
   172370 echo stderr:; cat "$at_stderr"
   172371 echo stdout:; cat "$at_stdout"
   172372 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172373 $at_failed && at_fn_log_failure
   172374 $at_traceon; }
   172375 
   172376 { set +x
   172377 $as_echo "$at_srcdir/cxx-type.at:436: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   172378 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:436"
   172379 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   172380 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172381 at_status=$? at_failed=false
   172382 $at_check_filter
   172383 echo stderr:; cat "$at_stderr"
   172384 echo stdout:; cat "$at_stdout"
   172385 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
   172386 $at_failed && at_fn_log_failure
   172387 $at_traceon; }
   172388 
   172389 
   172390 
   172391 { set +x
   172392 $as_echo "$at_srcdir/cxx-type.at:438:  \$PREPARSER ./types test-input"
   172393 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:438"
   172394 ( $at_check_trace;  $PREPARSER ./types test-input
   172395 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172396 at_status=$? at_failed=false
   172397 $at_check_filter
   172398 echo stderr:; tee stderr <"$at_stderr"
   172399 echo >>"$at_stdout"; $as_echo "+(z,q)
   172400 <declare>(T,x)
   172401 <init-declare>(T,x,y)
   172402 =(x,y)
   172403 +(<cast>(x,T),y)
   172404 <OR>(<declare>(T,x),<cast>(x,T))
   172405 <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
   172406 <error>
   172407 +(z,q)
   172408 " | \
   172409   $at_diff - "$at_stdout" || at_failed=:
   172410 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:438"
   172411 $at_failed && at_fn_log_failure
   172412 $at_traceon; }
   172413 
   172414 { set +x
   172415 $as_echo "$at_srcdir/cxx-type.at:438: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   172416 at_fn_check_prepare_trace "cxx-type.at:438"
   172417 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   172418 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172419 at_status=$? at_failed=false
   172420 $at_check_filter
   172421 echo >>"$at_stderr"; $as_echo "syntax error
   172422 " | \
   172423   $at_diff - "$at_stderr" || at_failed=:
   172424 at_fn_diff_devnull "$at_stdout" || at_failed=:
   172425 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:438"
   172426 $at_failed && at_fn_log_failure
   172427 $at_traceon; }
   172428 
   172429 
   172430   set +x
   172431   $at_times_p && times >"$at_times_file"
   172432 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   172433 read at_status <"$at_status_file"
   172434 #AT_STOP_328
   172435 #AT_START_329
   172436 at_fn_group_banner 329 'cxx-type.at:441' \
   172437   "GLR: Merge conflicting parses, pure, locations" " " 21
   172438 at_xfail=no
   172439 (
   172440   $as_echo "329. $at_setup_line: testing $at_desc ..."
   172441   $at_traceon
   172442 
   172443 
   172444 
   172445 cat >types.y <<'_ATEOF'
   172446 %code top {
   172447 #include <config.h>
   172448 /* We don't need perfect functions for these tests. */
   172449 #undef malloc
   172450 #undef memcmp
   172451 #undef realloc
   172452 }
   172453 
   172454 /* Simplified C++ Type and Expression Grammar.  */
   172455 
   172456 %define api.pure %locations
   172457 
   172458 %code requires
   172459 {
   172460   #include <stdio.h>
   172461   union Node {
   172462     struct {
   172463       int isNterm;
   172464       int parents;
   172465     } nodeInfo;
   172466     struct {
   172467       int isNterm; /* 1 */
   172468       int parents;
   172469       char const *form;
   172470       union Node *children[3];
   172471     } nterm;
   172472     struct {
   172473       int isNterm; /* 0 */
   172474       int parents;
   172475       char *text;
   172476     } term;
   172477   };
   172478   typedef union Node Node;
   172479   #define YYSTYPE Node *
   172480 }
   172481 
   172482 %code
   172483 {
   172484   static Node *new_nterm (char const *, Node *, Node *, Node *);
   172485   static Node *new_term (char *);
   172486   static void free_node (Node *);
   172487   static char *node_to_string (Node *);
   172488  static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
   172489   #define YYINITDEPTH 10
   172490   #define YYSTACKEXPANDABLE 1
   172491   static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   172492   static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   172493 }
   172494 
   172495 %token TYPENAME ID
   172496 
   172497 %right '='
   172498 %left '+'
   172499 
   172500 %glr-parser
   172501 
   172502 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   172503 
   172504 %%
   172505 
   172506 prog :
   172507      | prog stmt   {
   172508                         char *output;
   172509                         printf ("%d.%d-%d.%d: ",
   172510                              @2.first_line, @2.first_column,
   172511                              @2.last_line, @2.last_column);
   172512                         output = node_to_string ($2);
   172513                         printf ("%s\n", output);
   172514                         free (output);
   172515                         free_node ($2);
   172516                    }
   172517      ;
   172518 
   172519 stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
   172520      | decl      %merge <stmtMerge>
   172521      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   172522      | '@'              { YYACCEPT; }
   172523      ;
   172524 
   172525 expr : ID
   172526      | TYPENAME '(' expr ')'
   172527                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   172528      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   172529      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   172530      ;
   172531 
   172532 decl : TYPENAME declarator ';'
   172533                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   172534      | TYPENAME declarator '=' expr ';'
   172535                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   172536                                           $2, $4); }
   172537      ;
   172538 
   172539 declarator : ID
   172540      | '(' declarator ')' { $$ = $2; }
   172541      ;
   172542 
   172543 %%
   172544 
   172545 #include <ctype.h>
   172546 #include <stdlib.h>
   172547 #include <string.h>
   172548 #include <stdarg.h>
   172549 #include <assert.h>
   172550 
   172551 int
   172552 main (int argc, char **argv)
   172553 {
   172554   assert (argc == 2);
   172555   if (!freopen (argv[1], "r", stdin))
   172556     return 3;
   172557   return yyparse ();
   172558 }
   172559 
   172560 #include <stdio.h>
   172561 /* A C error reporting function.  */
   172562 static
   172563 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   172564 {
   172565   YY_LOCATION_PRINT (stderr, (*llocp));
   172566   fprintf (stderr, ": ");
   172567   fprintf (stderr, "%s\n", msg);
   172568 }
   172569 
   172570 int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   172571 {
   172572   char buffer[256];
   172573   int c;
   172574   unsigned int i;
   172575   static int lineNum = 1;
   172576   static int colNum = 0;
   172577 
   172578 #if YYPURE
   172579 # undef yylloc
   172580 # define yylloc (*llocp)
   172581 # undef yylval
   172582 # define yylval (*lvalp)
   172583 #endif
   172584 
   172585   while (1)
   172586     {
   172587       assert (!feof (stdin));
   172588       c = getchar ();
   172589       switch (c)
   172590         {
   172591         case EOF:
   172592           return 0;
   172593         case '\t':
   172594           colNum = (colNum + 7) & ~7;
   172595           break;
   172596         case ' ': case '\f':
   172597           colNum += 1;
   172598           break;
   172599         case '\n':
   172600           lineNum += 1;
   172601           colNum = 0;
   172602           break;
   172603         default:
   172604           {
   172605             int tok;
   172606             yylloc.first_line = yylloc.last_line = lineNum;
   172607             yylloc.first_column = colNum;
   172608             if (isalpha (c))
   172609               {
   172610                 i = 0;
   172611 
   172612                 do
   172613                   {
   172614                     buffer[i++] = c;
   172615                     colNum += 1;
   172616                     assert (i != sizeof buffer - 1);
   172617                     c = getchar ();
   172618                   }
   172619                 while (isalnum (c) || c == '_');
   172620 
   172621                 ungetc (c, stdin);
   172622                 buffer[i++] = 0;
   172623                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   172624                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   172625               }
   172626             else
   172627               {
   172628                 colNum += 1;
   172629                 tok = c;
   172630                 yylval = YY_NULL;
   172631               }
   172632             yylloc.last_column = colNum-1;
   172633             return tok;
   172634           }
   172635         }
   172636     }
   172637 }
   172638 
   172639 static Node *
   172640 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   172641 {
   172642   Node *node = (Node *) malloc (sizeof (Node));
   172643   node->nterm.isNterm = 1;
   172644   node->nterm.parents = 0;
   172645   node->nterm.form = form;
   172646   node->nterm.children[0] = child0;
   172647   if (child0)
   172648     child0->nodeInfo.parents += 1;
   172649   node->nterm.children[1] = child1;
   172650   if (child1)
   172651     child1->nodeInfo.parents += 1;
   172652   node->nterm.children[2] = child2;
   172653   if (child2)
   172654     child2->nodeInfo.parents += 1;
   172655   return node;
   172656 }
   172657 
   172658 static Node *
   172659 new_term (char *text)
   172660 {
   172661   Node *node = (Node *) malloc (sizeof (Node));
   172662   node->term.isNterm = 0;
   172663   node->term.parents = 0;
   172664   node->term.text = text;
   172665   return node;
   172666 }
   172667 
   172668 static void
   172669 free_node (Node *node)
   172670 {
   172671   if (!node)
   172672     return;
   172673   node->nodeInfo.parents -= 1;
   172674   /* Free only if 0 (last parent) or -1 (no parents).  */
   172675   if (node->nodeInfo.parents > 0)
   172676     return;
   172677   if (node->nodeInfo.isNterm == 1)
   172678     {
   172679       free_node (node->nterm.children[0]);
   172680       free_node (node->nterm.children[1]);
   172681       free_node (node->nterm.children[2]);
   172682     }
   172683   else
   172684     free (node->term.text);
   172685   free (node);
   172686 }
   172687 
   172688 static char *
   172689 node_to_string (Node *node)
   172690 {
   172691   char *child0;
   172692   char *child1;
   172693   char *child2;
   172694   char *buffer;
   172695   if (!node)
   172696     {
   172697       buffer = (char *) malloc (1);
   172698       buffer[0] = 0;
   172699     }
   172700   else if (node->nodeInfo.isNterm == 1)
   172701     {
   172702       child0 = node_to_string (node->nterm.children[0]);
   172703       child1 = node_to_string (node->nterm.children[1]);
   172704       child2 = node_to_string (node->nterm.children[2]);
   172705       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   172706                                 + strlen (child1) + strlen (child2) + 1);
   172707       sprintf (buffer, node->nterm.form, child0, child1, child2);
   172708       free (child0);
   172709       free (child1);
   172710       free (child2);
   172711     }
   172712   else
   172713     buffer = strdup (node->term.text);
   172714   return buffer;
   172715 }
   172716 
   172717 
   172718 static YYSTYPE
   172719 stmtMerge (YYSTYPE x0, YYSTYPE x1)
   172720 {
   172721   return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
   172722 }
   172723 
   172724 _ATEOF
   172725 
   172726 
   172727 
   172728 cat >test-input <<'_ATEOF'
   172729 
   172730 
   172731 z + q;
   172732 
   172733 T x;
   172734 
   172735 T x = y;
   172736 
   172737 x = y;
   172738 
   172739 T (x) + y;
   172740 
   172741 T (x);
   172742 
   172743 T (y) = z + q;
   172744 
   172745 T (y y) = z + q;
   172746 
   172747 z + q;
   172748 
   172749 @
   172750 
   172751 This is total garbage, but it should be ignored.
   172752 _ATEOF
   172753 
   172754 
   172755 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   172756   at_save_special_files
   172757   mkdir xml-tests
   172758     # Don't combine these Bison invocations since we want to be sure that
   172759   # --report=all isn't required to get the full XML file.
   172760   { set +x
   172761 $as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   172762                   --graph=xml-tests/test.dot -o types.c types.y"
   172763 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:442"
   172764 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   172765                   --graph=xml-tests/test.dot -o types.c types.y
   172766 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172767 at_status=$? at_failed=false
   172768 $at_check_filter
   172769 echo stderr:; cat "$at_stderr"
   172770 echo stdout:; cat "$at_stdout"
   172771 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172772 $at_failed && at_fn_log_failure
   172773 $at_traceon; }
   172774 
   172775   { set +x
   172776 $as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   172777 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:442"
   172778 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   172779 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172780 at_status=$? at_failed=false
   172781 $at_check_filter
   172782 echo stderr:; cat "$at_stderr"
   172783 echo stdout:; cat "$at_stdout"
   172784 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172785 $at_failed && at_fn_log_failure
   172786 $at_traceon; }
   172787 
   172788     cp xml-tests/test.output expout
   172789   { set +x
   172790 $as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\
   172791              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   172792              xml-tests/test.xml"
   172793 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442"
   172794 ( $at_check_trace; $XSLTPROC \
   172795              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   172796              xml-tests/test.xml
   172797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172798 at_status=$? at_failed=false
   172799 $at_check_filter
   172800 at_fn_diff_devnull "$at_stderr" || at_failed=:
   172801 $at_diff expout "$at_stdout" || at_failed=:
   172802 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172803 $at_failed && at_fn_log_failure
   172804 $at_traceon; }
   172805 
   172806   sort xml-tests/test.dot > expout
   172807   { set +x
   172808 $as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\
   172809              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   172810              xml-tests/test.xml | sort"
   172811 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442"
   172812 ( $at_check_trace; $XSLTPROC \
   172813              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   172814              xml-tests/test.xml | sort
   172815 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172816 at_status=$? at_failed=false
   172817 $at_check_filter
   172818 at_fn_diff_devnull "$at_stderr" || at_failed=:
   172819 $at_diff expout "$at_stdout" || at_failed=:
   172820 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172821 $at_failed && at_fn_log_failure
   172822 $at_traceon; }
   172823 
   172824   rm -rf xml-tests expout
   172825   at_restore_special_files
   172826 fi
   172827 { set +x
   172828 $as_echo "$at_srcdir/cxx-type.at:442: bison -o types.c types.y"
   172829 at_fn_check_prepare_trace "cxx-type.at:442"
   172830 ( $at_check_trace; bison -o types.c types.y
   172831 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172832 at_status=$? at_failed=false
   172833 $at_check_filter
   172834 echo stderr:; cat "$at_stderr"
   172835 at_fn_diff_devnull "$at_stdout" || at_failed=:
   172836 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172837 $at_failed && at_fn_log_failure
   172838 $at_traceon; }
   172839 
   172840 
   172841 { set +x
   172842 $as_echo "$at_srcdir/cxx-type.at:442: \$BISON_C_WORKS"
   172843 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:442"
   172844 ( $at_check_trace; $BISON_C_WORKS
   172845 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172846 at_status=$? at_failed=false
   172847 $at_check_filter
   172848 echo stderr:; cat "$at_stderr"
   172849 echo stdout:; cat "$at_stdout"
   172850 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172851 $at_failed && at_fn_log_failure
   172852 $at_traceon; }
   172853 
   172854 { set +x
   172855 $as_echo "$at_srcdir/cxx-type.at:442: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   172856 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:442"
   172857 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   172858 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172859 at_status=$? at_failed=false
   172860 $at_check_filter
   172861 echo stderr:; cat "$at_stderr"
   172862 echo stdout:; cat "$at_stdout"
   172863 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
   172864 $at_failed && at_fn_log_failure
   172865 $at_traceon; }
   172866 
   172867 
   172868 
   172869 { set +x
   172870 $as_echo "$at_srcdir/cxx-type.at:444:  \$PREPARSER ./types test-input"
   172871 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:444"
   172872 ( $at_check_trace;  $PREPARSER ./types test-input
   172873 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172874 at_status=$? at_failed=false
   172875 $at_check_filter
   172876 echo stderr:; tee stderr <"$at_stderr"
   172877 echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
   172878 5.0-5.3: <declare>(T,x)
   172879 7.0-7.7: <init-declare>(T,x,y)
   172880 9.0-9.5: =(x,y)
   172881 11.0-11.9: +(<cast>(x,T),y)
   172882 13.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
   172883 15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
   172884 17.0-17.15: <error>
   172885 19.0-19.5: +(z,q)
   172886 " | \
   172887   $at_diff - "$at_stdout" || at_failed=:
   172888 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:444"
   172889 $at_failed && at_fn_log_failure
   172890 $at_traceon; }
   172891 
   172892 { set +x
   172893 $as_echo "$at_srcdir/cxx-type.at:444: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   172894 at_fn_check_prepare_trace "cxx-type.at:444"
   172895 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   172896 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   172897 at_status=$? at_failed=false
   172898 $at_check_filter
   172899 echo >>"$at_stderr"; $as_echo "17.5: syntax error
   172900 " | \
   172901   $at_diff - "$at_stderr" || at_failed=:
   172902 at_fn_diff_devnull "$at_stdout" || at_failed=:
   172903 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:444"
   172904 $at_failed && at_fn_log_failure
   172905 $at_traceon; }
   172906 
   172907 
   172908   set +x
   172909   $at_times_p && times >"$at_times_file"
   172910 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   172911 read at_status <"$at_status_file"
   172912 #AT_STOP_329
   172913 #AT_START_330
   172914 at_fn_group_banner 330 'cxx-type.at:448' \
   172915   "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 21
   172916 at_xfail=no
   172917 (
   172918   $as_echo "330. $at_setup_line: testing $at_desc ..."
   172919   $at_traceon
   172920 
   172921 
   172922 
   172923 cat >types.y <<'_ATEOF'
   172924 %code top {
   172925 #include <config.h>
   172926 /* We don't need perfect functions for these tests. */
   172927 #undef malloc
   172928 #undef memcmp
   172929 #undef realloc
   172930 }
   172931 
   172932 /* Simplified C++ Type and Expression Grammar.  */
   172933 
   172934 %error-verbose
   172935 
   172936 %code requires
   172937 {
   172938   #include <stdio.h>
   172939   union Node {
   172940     struct {
   172941       int isNterm;
   172942       int parents;
   172943     } nodeInfo;
   172944     struct {
   172945       int isNterm; /* 1 */
   172946       int parents;
   172947       char const *form;
   172948       union Node *children[3];
   172949     } nterm;
   172950     struct {
   172951       int isNterm; /* 0 */
   172952       int parents;
   172953       char *text;
   172954     } term;
   172955   };
   172956   typedef union Node Node;
   172957   #define YYSTYPE Node *
   172958 }
   172959 
   172960 %code
   172961 {
   172962   static Node *new_nterm (char const *, Node *, Node *, Node *);
   172963   static Node *new_term (char *);
   172964   static void free_node (Node *);
   172965   static char *node_to_string (Node *);
   172966  static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
   172967   #define YYINITDEPTH 10
   172968   #define YYSTACKEXPANDABLE 1
   172969   static void yyerror ( const char *msg);
   172970   static int yylex (void);
   172971 }
   172972 
   172973 %token TYPENAME ID
   172974 
   172975 %right '='
   172976 %left '+'
   172977 
   172978 %glr-parser
   172979 
   172980 %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID
   172981 
   172982 %%
   172983 
   172984 prog :
   172985      | prog stmt   {
   172986                         char *output;
   172987                         output = node_to_string ($2);
   172988                         printf ("%s\n", output);
   172989                         free (output);
   172990                         free_node ($2);
   172991                    }
   172992      ;
   172993 
   172994 stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
   172995      | decl      %merge <stmtMerge>
   172996      | error ';'        { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
   172997      | '@'              { YYACCEPT; }
   172998      ;
   172999 
   173000 expr : ID
   173001      | TYPENAME '(' expr ')'
   173002                         { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULL); }
   173003      | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); }
   173004      | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); }
   173005      ;
   173006 
   173007 decl : TYPENAME declarator ';'
   173008                         { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULL); }
   173009      | TYPENAME declarator '=' expr ';'
   173010                         { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
   173011                                           $2, $4); }
   173012      ;
   173013 
   173014 declarator : ID
   173015      | '(' declarator ')' { $$ = $2; }
   173016      ;
   173017 
   173018 %%
   173019 
   173020 #include <ctype.h>
   173021 #include <stdlib.h>
   173022 #include <string.h>
   173023 #include <stdarg.h>
   173024 #include <assert.h>
   173025 
   173026 int
   173027 main (int argc, char **argv)
   173028 {
   173029   assert (argc == 2);
   173030   if (!freopen (argv[1], "r", stdin))
   173031     return 3;
   173032   return yyparse ();
   173033 }
   173034 
   173035 #include <stdio.h>
   173036 /* A C error reporting function.  */
   173037 static
   173038 void yyerror ( const char *msg)
   173039 {
   173040   fprintf (stderr, "%s\n", msg);
   173041 }
   173042 
   173043 int yylex (void)
   173044 {
   173045   char buffer[256];
   173046   int c;
   173047   unsigned int i;
   173048   static int lineNum = 1;
   173049   static int colNum = 0;
   173050 
   173051 #if YYPURE
   173052 # undef yylloc
   173053 # define yylloc (*llocp)
   173054 # undef yylval
   173055 # define yylval (*lvalp)
   173056 #endif
   173057 
   173058   while (1)
   173059     {
   173060       assert (!feof (stdin));
   173061       c = getchar ();
   173062       switch (c)
   173063         {
   173064         case EOF:
   173065           return 0;
   173066         case '\t':
   173067           colNum = (colNum + 7) & ~7;
   173068           break;
   173069         case ' ': case '\f':
   173070           colNum += 1;
   173071           break;
   173072         case '\n':
   173073           lineNum += 1;
   173074           colNum = 0;
   173075           break;
   173076         default:
   173077           {
   173078             int tok;
   173079             if (isalpha (c))
   173080               {
   173081                 i = 0;
   173082 
   173083                 do
   173084                   {
   173085                     buffer[i++] = c;
   173086                     colNum += 1;
   173087                     assert (i != sizeof buffer - 1);
   173088                     c = getchar ();
   173089                   }
   173090                 while (isalnum (c) || c == '_');
   173091 
   173092                 ungetc (c, stdin);
   173093                 buffer[i++] = 0;
   173094                 tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
   173095                 yylval = new_term (strcpy ((char *) malloc (i), buffer));
   173096               }
   173097             else
   173098               {
   173099                 colNum += 1;
   173100                 tok = c;
   173101                 yylval = YY_NULL;
   173102               }
   173103             return tok;
   173104           }
   173105         }
   173106     }
   173107 }
   173108 
   173109 static Node *
   173110 new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
   173111 {
   173112   Node *node = (Node *) malloc (sizeof (Node));
   173113   node->nterm.isNterm = 1;
   173114   node->nterm.parents = 0;
   173115   node->nterm.form = form;
   173116   node->nterm.children[0] = child0;
   173117   if (child0)
   173118     child0->nodeInfo.parents += 1;
   173119   node->nterm.children[1] = child1;
   173120   if (child1)
   173121     child1->nodeInfo.parents += 1;
   173122   node->nterm.children[2] = child2;
   173123   if (child2)
   173124     child2->nodeInfo.parents += 1;
   173125   return node;
   173126 }
   173127 
   173128 static Node *
   173129 new_term (char *text)
   173130 {
   173131   Node *node = (Node *) malloc (sizeof (Node));
   173132   node->term.isNterm = 0;
   173133   node->term.parents = 0;
   173134   node->term.text = text;
   173135   return node;
   173136 }
   173137 
   173138 static void
   173139 free_node (Node *node)
   173140 {
   173141   if (!node)
   173142     return;
   173143   node->nodeInfo.parents -= 1;
   173144   /* Free only if 0 (last parent) or -1 (no parents).  */
   173145   if (node->nodeInfo.parents > 0)
   173146     return;
   173147   if (node->nodeInfo.isNterm == 1)
   173148     {
   173149       free_node (node->nterm.children[0]);
   173150       free_node (node->nterm.children[1]);
   173151       free_node (node->nterm.children[2]);
   173152     }
   173153   else
   173154     free (node->term.text);
   173155   free (node);
   173156 }
   173157 
   173158 static char *
   173159 node_to_string (Node *node)
   173160 {
   173161   char *child0;
   173162   char *child1;
   173163   char *child2;
   173164   char *buffer;
   173165   if (!node)
   173166     {
   173167       buffer = (char *) malloc (1);
   173168       buffer[0] = 0;
   173169     }
   173170   else if (node->nodeInfo.isNterm == 1)
   173171     {
   173172       child0 = node_to_string (node->nterm.children[0]);
   173173       child1 = node_to_string (node->nterm.children[1]);
   173174       child2 = node_to_string (node->nterm.children[2]);
   173175       buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
   173176                                 + strlen (child1) + strlen (child2) + 1);
   173177       sprintf (buffer, node->nterm.form, child0, child1, child2);
   173178       free (child0);
   173179       free (child1);
   173180       free (child2);
   173181     }
   173182   else
   173183     buffer = strdup (node->term.text);
   173184   return buffer;
   173185 }
   173186 
   173187 
   173188 static YYSTYPE
   173189 stmtMerge (YYSTYPE x0, YYSTYPE x1)
   173190 {
   173191   return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
   173192 }
   173193 
   173194 _ATEOF
   173195 
   173196 
   173197 
   173198 cat >test-input <<'_ATEOF'
   173199 
   173200 
   173201 z + q;
   173202 
   173203 T x;
   173204 
   173205 T x = y;
   173206 
   173207 x = y;
   173208 
   173209 T (x) + y;
   173210 
   173211 T (x);
   173212 
   173213 T (y) = z + q;
   173214 
   173215 T (y y) = z + q;
   173216 
   173217 z + q;
   173218 
   173219 @
   173220 
   173221 This is total garbage, but it should be ignored.
   173222 _ATEOF
   173223 
   173224 
   173225 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   173226   at_save_special_files
   173227   mkdir xml-tests
   173228     # Don't combine these Bison invocations since we want to be sure that
   173229   # --report=all isn't required to get the full XML file.
   173230   { set +x
   173231 $as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   173232                   --graph=xml-tests/test.dot -o types.c types.y"
   173233 at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:449"
   173234 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   173235                   --graph=xml-tests/test.dot -o types.c types.y
   173236 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173237 at_status=$? at_failed=false
   173238 $at_check_filter
   173239 echo stderr:; cat "$at_stderr"
   173240 echo stdout:; cat "$at_stdout"
   173241 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173242 $at_failed && at_fn_log_failure
   173243 $at_traceon; }
   173244 
   173245   { set +x
   173246 $as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y"
   173247 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:449"
   173248 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y
   173249 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173250 at_status=$? at_failed=false
   173251 $at_check_filter
   173252 echo stderr:; cat "$at_stderr"
   173253 echo stdout:; cat "$at_stdout"
   173254 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173255 $at_failed && at_fn_log_failure
   173256 $at_traceon; }
   173257 
   173258     cp xml-tests/test.output expout
   173259   { set +x
   173260 $as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\
   173261              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   173262              xml-tests/test.xml"
   173263 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449"
   173264 ( $at_check_trace; $XSLTPROC \
   173265              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   173266              xml-tests/test.xml
   173267 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173268 at_status=$? at_failed=false
   173269 $at_check_filter
   173270 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173271 $at_diff expout "$at_stdout" || at_failed=:
   173272 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173273 $at_failed && at_fn_log_failure
   173274 $at_traceon; }
   173275 
   173276   sort xml-tests/test.dot > expout
   173277   { set +x
   173278 $as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\
   173279              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   173280              xml-tests/test.xml | sort"
   173281 at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449"
   173282 ( $at_check_trace; $XSLTPROC \
   173283              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   173284              xml-tests/test.xml | sort
   173285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173286 at_status=$? at_failed=false
   173287 $at_check_filter
   173288 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173289 $at_diff expout "$at_stdout" || at_failed=:
   173290 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173291 $at_failed && at_fn_log_failure
   173292 $at_traceon; }
   173293 
   173294   rm -rf xml-tests expout
   173295   at_restore_special_files
   173296 fi
   173297 { set +x
   173298 $as_echo "$at_srcdir/cxx-type.at:449: bison -o types.c types.y"
   173299 at_fn_check_prepare_trace "cxx-type.at:449"
   173300 ( $at_check_trace; bison -o types.c types.y
   173301 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173302 at_status=$? at_failed=false
   173303 $at_check_filter
   173304 echo stderr:; cat "$at_stderr"
   173305 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173306 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173307 $at_failed && at_fn_log_failure
   173308 $at_traceon; }
   173309 
   173310 
   173311 { set +x
   173312 $as_echo "$at_srcdir/cxx-type.at:449: \$BISON_C_WORKS"
   173313 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:449"
   173314 ( $at_check_trace; $BISON_C_WORKS
   173315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173316 at_status=$? at_failed=false
   173317 $at_check_filter
   173318 echo stderr:; cat "$at_stderr"
   173319 echo stdout:; cat "$at_stdout"
   173320 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173321 $at_failed && at_fn_log_failure
   173322 $at_traceon; }
   173323 
   173324 { set +x
   173325 $as_echo "$at_srcdir/cxx-type.at:449: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
   173326 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:449"
   173327 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
   173328 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173329 at_status=$? at_failed=false
   173330 $at_check_filter
   173331 echo stderr:; cat "$at_stderr"
   173332 echo stdout:; cat "$at_stdout"
   173333 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
   173334 $at_failed && at_fn_log_failure
   173335 $at_traceon; }
   173336 
   173337 
   173338 
   173339 { set +x
   173340 $as_echo "$at_srcdir/cxx-type.at:451:  \$PREPARSER ./types test-input"
   173341 at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:451"
   173342 ( $at_check_trace;  $PREPARSER ./types test-input
   173343 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173344 at_status=$? at_failed=false
   173345 $at_check_filter
   173346 echo stderr:; tee stderr <"$at_stderr"
   173347 echo >>"$at_stdout"; $as_echo "+(z,q)
   173348 <declare>(T,x)
   173349 <init-declare>(T,x,y)
   173350 =(x,y)
   173351 +(<cast>(x,T),y)
   173352 <OR>(<declare>(T,x),<cast>(x,T))
   173353 <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
   173354 <error>
   173355 +(z,q)
   173356 " | \
   173357   $at_diff - "$at_stdout" || at_failed=:
   173358 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451"
   173359 $at_failed && at_fn_log_failure
   173360 $at_traceon; }
   173361 
   173362 { set +x
   173363 $as_echo "$at_srcdir/cxx-type.at:451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   173364 at_fn_check_prepare_trace "cxx-type.at:451"
   173365 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   173366 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173367 at_status=$? at_failed=false
   173368 $at_check_filter
   173369 echo >>"$at_stderr"; $as_echo "syntax error, unexpected ID, expecting '=' or '+' or ')'
   173370 " | \
   173371   $at_diff - "$at_stderr" || at_failed=:
   173372 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173373 at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451"
   173374 $at_failed && at_fn_log_failure
   173375 $at_traceon; }
   173376 
   173377 
   173378   set +x
   173379   $at_times_p && times >"$at_times_file"
   173380 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   173381 read at_status <"$at_status_file"
   173382 #AT_STOP_330
   173383 #AT_START_331
   173384 at_fn_group_banner 331 'glr-regression.at:25' \
   173385   "Badly Collapsed GLR States" "                     " 22
   173386 at_xfail=no
   173387 (
   173388   $as_echo "331. $at_setup_line: testing $at_desc ..."
   173389   $at_traceon
   173390 
   173391 
   173392 
   173393 cat >glr-regr1.y <<'_ATEOF'
   173394 %code top {
   173395 #include <config.h>
   173396 /* We don't need perfect functions for these tests. */
   173397 #undef malloc
   173398 #undef memcmp
   173399 #undef realloc
   173400 }
   173401 
   173402 /* Regression Test: Improper state compression */
   173403 /* Reported by Scott McPeak */
   173404 
   173405 %{
   173406 #include <stdio.h>
   173407 #include <stdlib.h>
   173408 #include <assert.h>
   173409 
   173410 #define YYSTYPE int
   173411 static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
   173412 static void yyerror ( const char *msg);
   173413 static int yylex (void);
   173414 %}
   173415 
   173416 
   173417 %glr-parser
   173418 
   173419 
   173420 /* -------- productions ------ */
   173421 %%
   173422 
   173423 StartSymbol: E  { $$=0; }                   %merge <exprMerge>
   173424            ;
   173425 
   173426 E: E 'P' E { $$=1; printf("E -> E 'P' E\n"); }  %merge <exprMerge>
   173427  | 'B'     { $$=2; printf("E -> 'B'\n"); }      %merge <exprMerge>
   173428  ;
   173429 
   173430 
   173431 
   173432 /* ---------- C code ----------- */
   173433 %%
   173434 
   173435 static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
   173436 {
   173437   (void) x0;
   173438   (void) x1;
   173439   printf ("<OR>\n");
   173440   return 0;
   173441 }
   173442 
   173443 const char *input = YY_NULL;
   173444 
   173445 int
   173446 main (int argc, const char* argv[])
   173447 {
   173448   assert (argc == 2);
   173449   input = argv[1];
   173450   return yyparse ();
   173451 }
   173452 
   173453 #include <stdio.h>
   173454 /* A C error reporting function.  */
   173455 static
   173456 void yyerror ( const char *msg)
   173457 {
   173458   fprintf (stderr, "%s\n", msg);
   173459 }
   173460 
   173461 int
   173462 yylex (void)
   173463 {
   173464   return *input++;
   173465 }
   173466 _ATEOF
   173467 
   173468 
   173469 
   173470 
   173471 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   173472   at_save_special_files
   173473   mkdir xml-tests
   173474     # Don't combine these Bison invocations since we want to be sure that
   173475   # --report=all isn't required to get the full XML file.
   173476   { set +x
   173477 $as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   173478                   --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y"
   173479 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:90"
   173480 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   173481                   --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y
   173482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173483 at_status=$? at_failed=false
   173484 $at_check_filter
   173485 echo stderr:; cat "$at_stderr"
   173486 echo stdout:; cat "$at_stdout"
   173487 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
   173488 $at_failed && at_fn_log_failure
   173489 $at_traceon; }
   173490 
   173491   { set +x
   173492 $as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y"
   173493 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" "glr-regression.at:90"
   173494 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y
   173495 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173496 at_status=$? at_failed=false
   173497 $at_check_filter
   173498 echo stderr:; cat "$at_stderr"
   173499 echo stdout:; cat "$at_stdout"
   173500 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
   173501 $at_failed && at_fn_log_failure
   173502 $at_traceon; }
   173503 
   173504     cp xml-tests/test.output expout
   173505   { set +x
   173506 $as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\
   173507              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   173508              xml-tests/test.xml"
   173509 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90"
   173510 ( $at_check_trace; $XSLTPROC \
   173511              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   173512              xml-tests/test.xml
   173513 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173514 at_status=$? at_failed=false
   173515 $at_check_filter
   173516 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173517 $at_diff expout "$at_stdout" || at_failed=:
   173518 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
   173519 $at_failed && at_fn_log_failure
   173520 $at_traceon; }
   173521 
   173522   sort xml-tests/test.dot > expout
   173523   { set +x
   173524 $as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\
   173525              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   173526              xml-tests/test.xml | sort"
   173527 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90"
   173528 ( $at_check_trace; $XSLTPROC \
   173529              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   173530              xml-tests/test.xml | sort
   173531 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173532 at_status=$? at_failed=false
   173533 $at_check_filter
   173534 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173535 $at_diff expout "$at_stdout" || at_failed=:
   173536 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
   173537 $at_failed && at_fn_log_failure
   173538 $at_traceon; }
   173539 
   173540   rm -rf xml-tests expout
   173541   at_restore_special_files
   173542 fi
   173543 { set +x
   173544 $as_echo "$at_srcdir/glr-regression.at:90: bison -o glr-regr1.c glr-regr1.y"
   173545 at_fn_check_prepare_trace "glr-regression.at:90"
   173546 ( $at_check_trace; bison -o glr-regr1.c glr-regr1.y
   173547 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173548 at_status=$? at_failed=false
   173549 $at_check_filter
   173550 echo >>"$at_stderr"; $as_echo "glr-regr1.y: conflicts: 1 shift/reduce
   173551 " | \
   173552   $at_diff - "$at_stderr" || at_failed=:
   173553 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173554 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
   173555 $at_failed && at_fn_log_failure
   173556 $at_traceon; }
   173557 
   173558 
   173559 { set +x
   173560 $as_echo "$at_srcdir/glr-regression.at:93: \$BISON_C_WORKS"
   173561 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:93"
   173562 ( $at_check_trace; $BISON_C_WORKS
   173563 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173564 at_status=$? at_failed=false
   173565 $at_check_filter
   173566 echo stderr:; cat "$at_stderr"
   173567 echo stdout:; cat "$at_stdout"
   173568 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:93"
   173569 $at_failed && at_fn_log_failure
   173570 $at_traceon; }
   173571 
   173572 { set +x
   173573 $as_echo "$at_srcdir/glr-regression.at:93: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr1 glr-regr1.c \$LIBS"
   173574 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS" "glr-regression.at:93"
   173575 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS
   173576 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173577 at_status=$? at_failed=false
   173578 $at_check_filter
   173579 echo stderr:; cat "$at_stderr"
   173580 echo stdout:; cat "$at_stdout"
   173581 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:93"
   173582 $at_failed && at_fn_log_failure
   173583 $at_traceon; }
   173584 
   173585 { set +x
   173586 $as_echo "$at_srcdir/glr-regression.at:94:  \$PREPARSER ./glr-regr1 BPBPB"
   173587 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr1 BPBPB" "glr-regression.at:94"
   173588 ( $at_check_trace;  $PREPARSER ./glr-regr1 BPBPB
   173589 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173590 at_status=$? at_failed=false
   173591 $at_check_filter
   173592 echo stderr:; tee stderr <"$at_stderr"
   173593 echo >>"$at_stdout"; $as_echo "E -> 'B'
   173594 E -> 'B'
   173595 E -> E 'P' E
   173596 E -> 'B'
   173597 E -> E 'P' E
   173598 E -> 'B'
   173599 E -> E 'P' E
   173600 E -> E 'P' E
   173601 <OR>
   173602 " | \
   173603   $at_diff - "$at_stdout" || at_failed=:
   173604 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:94"
   173605 $at_failed && at_fn_log_failure
   173606 $at_traceon; }
   173607 
   173608 { set +x
   173609 $as_echo "$at_srcdir/glr-regression.at:94: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   173610 at_fn_check_prepare_trace "glr-regression.at:94"
   173611 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   173612 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173613 at_status=$? at_failed=false
   173614 $at_check_filter
   173615 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173616 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173617 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:94"
   173618 $at_failed && at_fn_log_failure
   173619 $at_traceon; }
   173620 
   173621 
   173622 
   173623   set +x
   173624   $at_times_p && times >"$at_times_file"
   173625 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   173626 read at_status <"$at_status_file"
   173627 #AT_STOP_331
   173628 #AT_START_332
   173629 at_fn_group_banner 332 'glr-regression.at:112' \
   173630   "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 22
   173631 at_xfail=no
   173632 (
   173633   $as_echo "332. $at_setup_line: testing $at_desc ..."
   173634   $at_traceon
   173635 
   173636 
   173637 
   173638 cat >glr-regr2a.y <<'_ATEOF'
   173639 %code top {
   173640 #include <config.h>
   173641 /* We don't need perfect functions for these tests. */
   173642 #undef malloc
   173643 #undef memcmp
   173644 #undef realloc
   173645 }
   173646 
   173647 /* Regression Test: Improper handling of embedded actions and $-N  */
   173648 /* Reported by S. Eken */
   173649 
   173650 %{
   173651   #define YYSTYPE char *
   173652 
   173653   #include <ctype.h>
   173654   #include <stdio.h>
   173655   #include <stdlib.h>
   173656   #include <string.h>
   173657   #include <assert.h>
   173658   static void yyerror ( const char *msg);
   173659   static int yylex (void);
   173660 %}
   173661 
   173662 %glr-parser
   173663 
   173664 %%
   173665 
   173666 command:
   173667     's' var 't'
   173668        { printf ("Variable: '%s'\n", $2); }
   173669     'v' 'x' 'q'
   173670        { free ($2); }
   173671   | 's' var_list 't' 'e'
   173672        { printf ("Varlist: '%s'\n", $2); free ($2); }
   173673   | 's' var 't' var_printer 'x'
   173674        { free ($2); }
   173675   ;
   173676 
   173677 var:
   173678   'V'
   173679      { $$ = $1; }
   173680   ;
   173681 
   173682 var_list:
   173683   var
   173684     { $$ = $1; }
   173685   | var ',' var_list
   173686     {
   173687       char *s = (char *) realloc ($1, strlen ($1) + 1 + strlen ($3) + 1);
   173688       strcat (s, ",");
   173689       strcat (s, $3);
   173690       free ($3);
   173691       $$ = s;
   173692     }
   173693   ;
   173694 
   173695 var_printer: 'v'
   173696    { printf ("Variable: '%s'\n", $-1); }
   173697 
   173698 %%
   173699 #include <stdio.h>
   173700 /* A C error reporting function.  */
   173701 static
   173702 void yyerror ( const char *msg)
   173703 {
   173704   fprintf (stderr, "%s\n", msg);
   173705 }
   173706 FILE *input;
   173707 
   173708 int
   173709 yylex (void)
   173710 {
   173711   char buf[50];
   173712   char *s;
   173713   assert (!feof (stdin));
   173714   switch (fscanf (input, " %1[a-z,]", buf))
   173715   {
   173716   case 1:
   173717     return buf[0];
   173718   case EOF:
   173719     return 0;
   173720   default:
   173721     break;
   173722   }
   173723   if (fscanf (input, "%49s", buf) != 1)
   173724     return 0;
   173725   assert (strlen (buf) < sizeof buf - 1);
   173726   s = (char *) malloc (strlen (buf) + 1);
   173727   strcpy (s, buf);
   173728   yylval = s;
   173729   return 'V';
   173730 }
   173731 
   173732 int
   173733 main (int argc, char **argv)
   173734 {
   173735   int res;
   173736   input = stdin;
   173737   if (argc == 2 && !(input = fopen (argv[1], "r")))
   173738     return 3;
   173739   res = yyparse ();
   173740   if (argc == 2 && fclose (input))
   173741     return 4;
   173742   return res;
   173743 }
   173744 _ATEOF
   173745 
   173746 
   173747 
   173748 
   173749 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   173750   at_save_special_files
   173751   mkdir xml-tests
   173752     # Don't combine these Bison invocations since we want to be sure that
   173753   # --report=all isn't required to get the full XML file.
   173754   { set +x
   173755 $as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   173756                   --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y"
   173757 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:210"
   173758 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   173759                   --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y
   173760 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173761 at_status=$? at_failed=false
   173762 $at_check_filter
   173763 echo stderr:; cat "$at_stderr"
   173764 echo stdout:; cat "$at_stdout"
   173765 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
   173766 $at_failed && at_fn_log_failure
   173767 $at_traceon; }
   173768 
   173769   { set +x
   173770 $as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y"
   173771 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" "glr-regression.at:210"
   173772 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y
   173773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173774 at_status=$? at_failed=false
   173775 $at_check_filter
   173776 echo stderr:; cat "$at_stderr"
   173777 echo stdout:; cat "$at_stdout"
   173778 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
   173779 $at_failed && at_fn_log_failure
   173780 $at_traceon; }
   173781 
   173782     cp xml-tests/test.output expout
   173783   { set +x
   173784 $as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\
   173785              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   173786              xml-tests/test.xml"
   173787 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210"
   173788 ( $at_check_trace; $XSLTPROC \
   173789              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   173790              xml-tests/test.xml
   173791 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173792 at_status=$? at_failed=false
   173793 $at_check_filter
   173794 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173795 $at_diff expout "$at_stdout" || at_failed=:
   173796 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
   173797 $at_failed && at_fn_log_failure
   173798 $at_traceon; }
   173799 
   173800   sort xml-tests/test.dot > expout
   173801   { set +x
   173802 $as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\
   173803              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   173804              xml-tests/test.xml | sort"
   173805 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210"
   173806 ( $at_check_trace; $XSLTPROC \
   173807              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   173808              xml-tests/test.xml | sort
   173809 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173810 at_status=$? at_failed=false
   173811 $at_check_filter
   173812 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173813 $at_diff expout "$at_stdout" || at_failed=:
   173814 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
   173815 $at_failed && at_fn_log_failure
   173816 $at_traceon; }
   173817 
   173818   rm -rf xml-tests expout
   173819   at_restore_special_files
   173820 fi
   173821 { set +x
   173822 $as_echo "$at_srcdir/glr-regression.at:210: bison -o glr-regr2a.c glr-regr2a.y"
   173823 at_fn_check_prepare_trace "glr-regression.at:210"
   173824 ( $at_check_trace; bison -o glr-regr2a.c glr-regr2a.y
   173825 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173826 at_status=$? at_failed=false
   173827 $at_check_filter
   173828 echo >>"$at_stderr"; $as_echo "glr-regr2a.y: conflicts: 2 shift/reduce
   173829 " | \
   173830   $at_diff - "$at_stderr" || at_failed=:
   173831 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173832 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
   173833 $at_failed && at_fn_log_failure
   173834 $at_traceon; }
   173835 
   173836 
   173837 { set +x
   173838 $as_echo "$at_srcdir/glr-regression.at:213: \$BISON_C_WORKS"
   173839 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:213"
   173840 ( $at_check_trace; $BISON_C_WORKS
   173841 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173842 at_status=$? at_failed=false
   173843 $at_check_filter
   173844 echo stderr:; cat "$at_stderr"
   173845 echo stdout:; cat "$at_stdout"
   173846 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:213"
   173847 $at_failed && at_fn_log_failure
   173848 $at_traceon; }
   173849 
   173850 { set +x
   173851 $as_echo "$at_srcdir/glr-regression.at:213: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr2a glr-regr2a.c \$LIBS"
   173852 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS" "glr-regression.at:213"
   173853 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS
   173854 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173855 at_status=$? at_failed=false
   173856 $at_check_filter
   173857 echo stderr:; cat "$at_stderr"
   173858 echo stdout:; cat "$at_stdout"
   173859 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:213"
   173860 $at_failed && at_fn_log_failure
   173861 $at_traceon; }
   173862 
   173863 
   173864 cat >input1.txt <<'_ATEOF'
   173865 s VARIABLE_1 t v x q
   173866 _ATEOF
   173867 
   173868 { set +x
   173869 $as_echo "$at_srcdir/glr-regression.at:218:  \$PREPARSER ./glr-regr2a input1.txt"
   173870 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input1.txt" "glr-regression.at:218"
   173871 ( $at_check_trace;  $PREPARSER ./glr-regr2a input1.txt
   173872 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173873 at_status=$? at_failed=false
   173874 $at_check_filter
   173875 echo stderr:; tee stderr <"$at_stderr"
   173876 echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_1'
   173877 " | \
   173878   $at_diff - "$at_stdout" || at_failed=:
   173879 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:218"
   173880 $at_failed && at_fn_log_failure
   173881 $at_traceon; }
   173882 
   173883 { set +x
   173884 $as_echo "$at_srcdir/glr-regression.at:218: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   173885 at_fn_check_prepare_trace "glr-regression.at:218"
   173886 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   173887 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173888 at_status=$? at_failed=false
   173889 $at_check_filter
   173890 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173891 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173892 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:218"
   173893 $at_failed && at_fn_log_failure
   173894 $at_traceon; }
   173895 
   173896 
   173897 
   173898 cat >input2.txt <<'_ATEOF'
   173899 s VARIABLE_1 , ANOTHER_VARIABLE_2 t e
   173900 _ATEOF
   173901 
   173902 { set +x
   173903 $as_echo "$at_srcdir/glr-regression.at:225:  \$PREPARSER ./glr-regr2a input2.txt"
   173904 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input2.txt" "glr-regression.at:225"
   173905 ( $at_check_trace;  $PREPARSER ./glr-regr2a input2.txt
   173906 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173907 at_status=$? at_failed=false
   173908 $at_check_filter
   173909 echo stderr:; tee stderr <"$at_stderr"
   173910 echo >>"$at_stdout"; $as_echo "Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2'
   173911 " | \
   173912   $at_diff - "$at_stdout" || at_failed=:
   173913 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:225"
   173914 $at_failed && at_fn_log_failure
   173915 $at_traceon; }
   173916 
   173917 { set +x
   173918 $as_echo "$at_srcdir/glr-regression.at:225: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   173919 at_fn_check_prepare_trace "glr-regression.at:225"
   173920 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   173921 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173922 at_status=$? at_failed=false
   173923 $at_check_filter
   173924 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173925 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173926 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:225"
   173927 $at_failed && at_fn_log_failure
   173928 $at_traceon; }
   173929 
   173930 
   173931 
   173932 cat >input3.txt <<'_ATEOF'
   173933 s VARIABLE_3 t v x
   173934 _ATEOF
   173935 
   173936 { set +x
   173937 $as_echo "$at_srcdir/glr-regression.at:233:  \$PREPARSER ./glr-regr2a input3.txt"
   173938 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input3.txt" "glr-regression.at:233"
   173939 ( $at_check_trace;  $PREPARSER ./glr-regr2a input3.txt
   173940 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173941 at_status=$? at_failed=false
   173942 $at_check_filter
   173943 echo stderr:; tee stderr <"$at_stderr"
   173944 echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_3'
   173945 " | \
   173946   $at_diff - "$at_stdout" || at_failed=:
   173947 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:233"
   173948 $at_failed && at_fn_log_failure
   173949 $at_traceon; }
   173950 
   173951 { set +x
   173952 $as_echo "$at_srcdir/glr-regression.at:233: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   173953 at_fn_check_prepare_trace "glr-regression.at:233"
   173954 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   173955 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   173956 at_status=$? at_failed=false
   173957 $at_check_filter
   173958 at_fn_diff_devnull "$at_stderr" || at_failed=:
   173959 at_fn_diff_devnull "$at_stdout" || at_failed=:
   173960 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:233"
   173961 $at_failed && at_fn_log_failure
   173962 $at_traceon; }
   173963 
   173964 
   173965 
   173966 
   173967   set +x
   173968   $at_times_p && times >"$at_times_file"
   173969 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   173970 read at_status <"$at_status_file"
   173971 #AT_STOP_332
   173972 #AT_START_333
   173973 at_fn_group_banner 333 'glr-regression.at:244' \
   173974   "Improper merging of GLR delayed action sets" "    " 22
   173975 at_xfail=no
   173976 (
   173977   $as_echo "333. $at_setup_line: testing $at_desc ..."
   173978   $at_traceon
   173979 
   173980 
   173981 
   173982 cat >glr-regr3.y <<'_ATEOF'
   173983 %code top {
   173984 #include <config.h>
   173985 /* We don't need perfect functions for these tests. */
   173986 #undef malloc
   173987 #undef memcmp
   173988 #undef realloc
   173989 }
   173990 
   173991 /* Regression Test: Improper merging of GLR delayed action sets.  */
   173992 /* Reported by M. Rosien */
   173993 
   173994 %{
   173995 #include <stdio.h>
   173996 #include <stdlib.h>
   173997 #include <stdarg.h>
   173998 #include <assert.h>
   173999 
   174000 static int MergeRule (int x0, int x1);
   174001 static void yyerror ( const char *msg);
   174002 static int yylex (void);
   174003 
   174004 #define RULE(x) (1 << (x))
   174005 
   174006 %}
   174007 
   174008 %glr-parser
   174009 
   174010 %token BAD_CHAR
   174011 %token P1 P2 T1 T2 T3 T4 O1 O2
   174012 
   174013 %%
   174014 
   174015 S : P1 T4 O2 NT6 P2  { printf ("Result: %x\n", $4); }
   174016 ;
   174017 
   174018 NT1 : P1 T1 O1 T2 P2 { $$ = RULE(2); }  %merge<MergeRule>
   174019 ;
   174020 
   174021 NT2 : NT1             { $$ = RULE(3); } %merge<MergeRule>
   174022     | P1 NT1 O1 T3 P2 { $$ = RULE(4); } %merge<MergeRule>
   174023 ;
   174024 
   174025 NT3 : T3              { $$ = RULE(5); } %merge<MergeRule>
   174026     | P1 NT1 O1 T3 P2 { $$ = RULE(6); } %merge<MergeRule>
   174027 ;
   174028 
   174029 NT4 : NT3              { $$ = RULE(7); } %merge<MergeRule>
   174030     | NT2              { $$ = RULE(8); } %merge<MergeRule>
   174031     | P1 NT2 O1 NT3 P2 { $$ = RULE(9); } %merge<MergeRule>
   174032 ;
   174033 
   174034 NT5 : NT4              { $$ = RULE(10); } %merge<MergeRule>
   174035 ;
   174036 
   174037 NT6 : P1 NT1 O1 T3 P2  { $$ = RULE(11) | $2; } %merge<MergeRule>
   174038     | NT5              { $$ = RULE(12) | $1; } %merge<MergeRule>
   174039 ;
   174040 
   174041 %%
   174042 
   174043 static int
   174044 MergeRule (int x0, int x1)
   174045 {
   174046   return x0 | x1;
   174047 }
   174048 #include <stdio.h>
   174049 /* A C error reporting function.  */
   174050 static
   174051 void yyerror ( const char *msg)
   174052 {
   174053   fprintf (stderr, "%s\n", msg);
   174054 }
   174055 
   174056 FILE *input = YY_NULL;
   174057 
   174058 int P[] = { P1, P2 };
   174059 int O[] = { O1, O2 };
   174060 int T[] = { T1, T2, T3, T4 };
   174061 
   174062 int yylex (void)
   174063 {
   174064   char inp[3];
   174065   assert (!feof (stdin));
   174066   if (fscanf (input, "%2s", inp) == EOF)
   174067     return 0;
   174068   switch (inp[0])
   174069     {
   174070     case 'p': return P[inp[1] - '1'];
   174071     case 't': return T[inp[1] - '1'];
   174072     case 'o': return O[inp[1] - '1'];
   174073     }
   174074   return BAD_CHAR;
   174075 }
   174076 
   174077 int
   174078 main(int argc, char* argv[])
   174079 {
   174080   int res;
   174081   input = stdin;
   174082   if (argc == 2 && !(input = fopen (argv[1], "r")))
   174083     return 3;
   174084   res = yyparse ();
   174085   if (argc == 2 && fclose (input))
   174086     return 4;
   174087   return res;
   174088 }
   174089 _ATEOF
   174090 
   174091 
   174092 
   174093 
   174094 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   174095   at_save_special_files
   174096   mkdir xml-tests
   174097     # Don't combine these Bison invocations since we want to be sure that
   174098   # --report=all isn't required to get the full XML file.
   174099   { set +x
   174100 $as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   174101                   --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y"
   174102 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:343"
   174103 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   174104                   --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y
   174105 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174106 at_status=$? at_failed=false
   174107 $at_check_filter
   174108 echo stderr:; cat "$at_stderr"
   174109 echo stdout:; cat "$at_stdout"
   174110 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
   174111 $at_failed && at_fn_log_failure
   174112 $at_traceon; }
   174113 
   174114   { set +x
   174115 $as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y"
   174116 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" "glr-regression.at:343"
   174117 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y
   174118 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174119 at_status=$? at_failed=false
   174120 $at_check_filter
   174121 echo stderr:; cat "$at_stderr"
   174122 echo stdout:; cat "$at_stdout"
   174123 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
   174124 $at_failed && at_fn_log_failure
   174125 $at_traceon; }
   174126 
   174127     cp xml-tests/test.output expout
   174128   { set +x
   174129 $as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\
   174130              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   174131              xml-tests/test.xml"
   174132 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343"
   174133 ( $at_check_trace; $XSLTPROC \
   174134              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   174135              xml-tests/test.xml
   174136 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174137 at_status=$? at_failed=false
   174138 $at_check_filter
   174139 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174140 $at_diff expout "$at_stdout" || at_failed=:
   174141 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
   174142 $at_failed && at_fn_log_failure
   174143 $at_traceon; }
   174144 
   174145   sort xml-tests/test.dot > expout
   174146   { set +x
   174147 $as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\
   174148              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   174149              xml-tests/test.xml | sort"
   174150 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343"
   174151 ( $at_check_trace; $XSLTPROC \
   174152              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   174153              xml-tests/test.xml | sort
   174154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174155 at_status=$? at_failed=false
   174156 $at_check_filter
   174157 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174158 $at_diff expout "$at_stdout" || at_failed=:
   174159 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
   174160 $at_failed && at_fn_log_failure
   174161 $at_traceon; }
   174162 
   174163   rm -rf xml-tests expout
   174164   at_restore_special_files
   174165 fi
   174166 { set +x
   174167 $as_echo "$at_srcdir/glr-regression.at:343: bison -o glr-regr3.c glr-regr3.y"
   174168 at_fn_check_prepare_trace "glr-regression.at:343"
   174169 ( $at_check_trace; bison -o glr-regr3.c glr-regr3.y
   174170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174171 at_status=$? at_failed=false
   174172 $at_check_filter
   174173 echo >>"$at_stderr"; $as_echo "glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce
   174174 " | \
   174175   $at_diff - "$at_stderr" || at_failed=:
   174176 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174177 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
   174178 $at_failed && at_fn_log_failure
   174179 $at_traceon; }
   174180 
   174181 
   174182 { set +x
   174183 $as_echo "$at_srcdir/glr-regression.at:346: \$BISON_C_WORKS"
   174184 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:346"
   174185 ( $at_check_trace; $BISON_C_WORKS
   174186 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174187 at_status=$? at_failed=false
   174188 $at_check_filter
   174189 echo stderr:; cat "$at_stderr"
   174190 echo stdout:; cat "$at_stdout"
   174191 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346"
   174192 $at_failed && at_fn_log_failure
   174193 $at_traceon; }
   174194 
   174195 { set +x
   174196 $as_echo "$at_srcdir/glr-regression.at:346: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr3 glr-regr3.c \$LIBS"
   174197 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS" "glr-regression.at:346"
   174198 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS
   174199 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174200 at_status=$? at_failed=false
   174201 $at_check_filter
   174202 echo stderr:; cat "$at_stderr"
   174203 echo stdout:; cat "$at_stdout"
   174204 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346"
   174205 $at_failed && at_fn_log_failure
   174206 $at_traceon; }
   174207 
   174208 
   174209 cat >input.txt <<'_ATEOF'
   174210 p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2
   174211 _ATEOF
   174212 
   174213 { set +x
   174214 $as_echo "$at_srcdir/glr-regression.at:351:  \$PREPARSER ./glr-regr3 input.txt"
   174215 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr3 input.txt" "glr-regression.at:351"
   174216 ( $at_check_trace;  $PREPARSER ./glr-regr3 input.txt
   174217 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174218 at_status=$? at_failed=false
   174219 $at_check_filter
   174220 echo stderr:; tee stderr <"$at_stderr"
   174221 echo >>"$at_stdout"; $as_echo "Result: 1c04
   174222 " | \
   174223   $at_diff - "$at_stdout" || at_failed=:
   174224 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:351"
   174225 $at_failed && at_fn_log_failure
   174226 $at_traceon; }
   174227 
   174228 { set +x
   174229 $as_echo "$at_srcdir/glr-regression.at:351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   174230 at_fn_check_prepare_trace "glr-regression.at:351"
   174231 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   174232 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174233 at_status=$? at_failed=false
   174234 $at_check_filter
   174235 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174236 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174237 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:351"
   174238 $at_failed && at_fn_log_failure
   174239 $at_traceon; }
   174240 
   174241 
   174242 
   174243   set +x
   174244   $at_times_p && times >"$at_times_file"
   174245 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   174246 read at_status <"$at_status_file"
   174247 #AT_STOP_333
   174248 #AT_START_334
   174249 at_fn_group_banner 334 'glr-regression.at:364' \
   174250   "Duplicate representation of merged trees" "       " 22
   174251 at_xfail=no
   174252 (
   174253   $as_echo "334. $at_setup_line: testing $at_desc ..."
   174254   $at_traceon
   174255 
   174256 
   174257 
   174258 cat >glr-regr4.y <<'_ATEOF'
   174259 %code top {
   174260 #include <config.h>
   174261 /* We don't need perfect functions for these tests. */
   174262 #undef malloc
   174263 #undef memcmp
   174264 #undef realloc
   174265 }
   174266 
   174267 
   174268 %union { char *ptr; }
   174269 %type <ptr> S A A1 A2 B
   174270 %glr-parser
   174271 
   174272 %{
   174273   #include <stdio.h>
   174274   #include <stdlib.h>
   174275   #include <string.h>
   174276   static char *merge (YYSTYPE, YYSTYPE);
   174277   static char *make_value (char const *, char const *);
   174278   static void yyerror ( const char *msg);
   174279   static int yylex (void);
   174280   static char *ptrs[100];
   174281   static char **ptrs_next = ptrs;
   174282 %}
   174283 
   174284 %%
   174285 
   174286 tree: S { printf ("%s\n", $1); } ;
   174287 
   174288 S:
   174289   A   %merge<merge> { $$ = make_value ("S", $1); }
   174290   | B %merge<merge> { $$ = make_value ("S", $1); }
   174291   ;
   174292 
   174293 A:
   174294   A1   %merge<merge> { $$ = make_value ("A", $1); }
   174295   | A2 %merge<merge> { $$ = make_value ("A", $1); }
   174296   ;
   174297 
   174298 A1: 'a' { $$ = make_value ("A1", "'a'"); } ;
   174299 A2: 'a' { $$ = make_value ("A2", "'a'"); } ;
   174300 B:  'a' { $$ = make_value ("B", "'a'");  } ;
   174301 
   174302 %%
   174303 #include <stdio.h>
   174304 /* A C error reporting function.  */
   174305 static
   174306 void yyerror ( const char *msg)
   174307 {
   174308   fprintf (stderr, "%s\n", msg);
   174309 }
   174310 #include <assert.h>
   174311 static
   174312 int yylex (void)
   174313 {
   174314   static char const input[] = "a";
   174315   static size_t toknum = 0;
   174316   int res;
   174317   ;
   174318   assert (toknum < sizeof input / sizeof input[0]);
   174319   res = input[toknum++];
   174320   ;
   174321   return res;
   174322 }
   174323 
   174324 int
   174325 main (void)
   174326 {
   174327   int status = yyparse ();
   174328   while (ptrs_next != ptrs)
   174329     free (*--ptrs_next);
   174330   return status;
   174331 }
   174332 
   174333 static char *
   174334 make_value (char const *parent, char const *child)
   174335 {
   174336   char const format[] = "%s <- %s";
   174337   char *value = *ptrs_next++ =
   174338     (char *) malloc (strlen (parent) + strlen (child) + sizeof format);
   174339   sprintf (value, format, parent, child);
   174340   return value;
   174341 }
   174342 
   174343 static char *
   174344 merge (YYSTYPE s1, YYSTYPE s2)
   174345 {
   174346   char const format[] = "merge{ %s and %s }";
   174347   char *value = *ptrs_next++ =
   174348     (char *) malloc (strlen (s1.ptr) + strlen (s2.ptr) + sizeof format);
   174349   sprintf (value, format, s1.ptr, s2.ptr);
   174350   return value;
   174351 }
   174352 _ATEOF
   174353 
   174354 
   174355 
   174356 
   174357 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   174358   at_save_special_files
   174359   mkdir xml-tests
   174360     # Don't combine these Bison invocations since we want to be sure that
   174361   # --report=all isn't required to get the full XML file.
   174362   { set +x
   174363 $as_echo "$at_srcdir/glr-regression.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   174364                   --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y"
   174365 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:438"
   174366 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   174367                   --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y
   174368 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174369 at_status=$? at_failed=false
   174370 $at_check_filter
   174371 echo stderr:; cat "$at_stderr"
   174372 echo stdout:; cat "$at_stdout"
   174373 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438"
   174374 $at_failed && at_fn_log_failure
   174375 $at_traceon; }
   174376 
   174377   { set +x
   174378 $as_echo "$at_srcdir/glr-regression.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y"
   174379 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" "glr-regression.at:438"
   174380 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y
   174381 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174382 at_status=$? at_failed=false
   174383 $at_check_filter
   174384 echo stderr:; cat "$at_stderr"
   174385 echo stdout:; cat "$at_stdout"
   174386 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438"
   174387 $at_failed && at_fn_log_failure
   174388 $at_traceon; }
   174389 
   174390     cp xml-tests/test.output expout
   174391   { set +x
   174392 $as_echo "$at_srcdir/glr-regression.at:438: \$XSLTPROC \\
   174393              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   174394              xml-tests/test.xml"
   174395 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:438"
   174396 ( $at_check_trace; $XSLTPROC \
   174397              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   174398              xml-tests/test.xml
   174399 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174400 at_status=$? at_failed=false
   174401 $at_check_filter
   174402 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174403 $at_diff expout "$at_stdout" || at_failed=:
   174404 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438"
   174405 $at_failed && at_fn_log_failure
   174406 $at_traceon; }
   174407 
   174408   sort xml-tests/test.dot > expout
   174409   { set +x
   174410 $as_echo "$at_srcdir/glr-regression.at:438: \$XSLTPROC \\
   174411              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   174412              xml-tests/test.xml | sort"
   174413 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:438"
   174414 ( $at_check_trace; $XSLTPROC \
   174415              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   174416              xml-tests/test.xml | sort
   174417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174418 at_status=$? at_failed=false
   174419 $at_check_filter
   174420 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174421 $at_diff expout "$at_stdout" || at_failed=:
   174422 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438"
   174423 $at_failed && at_fn_log_failure
   174424 $at_traceon; }
   174425 
   174426   rm -rf xml-tests expout
   174427   at_restore_special_files
   174428 fi
   174429 { set +x
   174430 $as_echo "$at_srcdir/glr-regression.at:438: bison -o glr-regr4.c glr-regr4.y"
   174431 at_fn_check_prepare_trace "glr-regression.at:438"
   174432 ( $at_check_trace; bison -o glr-regr4.c glr-regr4.y
   174433 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174434 at_status=$? at_failed=false
   174435 $at_check_filter
   174436 echo >>"$at_stderr"; $as_echo "glr-regr4.y: conflicts: 1 reduce/reduce
   174437 " | \
   174438   $at_diff - "$at_stderr" || at_failed=:
   174439 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174440 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438"
   174441 $at_failed && at_fn_log_failure
   174442 $at_traceon; }
   174443 
   174444 
   174445 { set +x
   174446 $as_echo "$at_srcdir/glr-regression.at:441: \$BISON_C_WORKS"
   174447 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:441"
   174448 ( $at_check_trace; $BISON_C_WORKS
   174449 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174450 at_status=$? at_failed=false
   174451 $at_check_filter
   174452 echo stderr:; cat "$at_stderr"
   174453 echo stdout:; cat "$at_stdout"
   174454 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441"
   174455 $at_failed && at_fn_log_failure
   174456 $at_traceon; }
   174457 
   174458 { set +x
   174459 $as_echo "$at_srcdir/glr-regression.at:441: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr4 glr-regr4.c \$LIBS"
   174460 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS" "glr-regression.at:441"
   174461 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS
   174462 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174463 at_status=$? at_failed=false
   174464 $at_check_filter
   174465 echo stderr:; cat "$at_stderr"
   174466 echo stdout:; cat "$at_stdout"
   174467 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441"
   174468 $at_failed && at_fn_log_failure
   174469 $at_traceon; }
   174470 
   174471 
   174472 { set +x
   174473 $as_echo "$at_srcdir/glr-regression.at:443:  \$PREPARSER ./glr-regr4"
   174474 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:443"
   174475 ( $at_check_trace;  $PREPARSER ./glr-regr4
   174476 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174477 at_status=$? at_failed=false
   174478 $at_check_filter
   174479 echo stderr:; tee stderr <"$at_stderr"
   174480 echo >>"$at_stdout"; $as_echo "merge{ S <- merge{ A <- A1 <- 'a' and A <- A2 <- 'a' } and S <- B <- 'a' }
   174481 " | \
   174482   $at_diff - "$at_stdout" || at_failed=:
   174483 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:443"
   174484 $at_failed && at_fn_log_failure
   174485 $at_traceon; }
   174486 
   174487 { set +x
   174488 $as_echo "$at_srcdir/glr-regression.at:443: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   174489 at_fn_check_prepare_trace "glr-regression.at:443"
   174490 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   174491 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174492 at_status=$? at_failed=false
   174493 $at_check_filter
   174494 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174495 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174496 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:443"
   174497 $at_failed && at_fn_log_failure
   174498 $at_traceon; }
   174499 
   174500 
   174501 
   174502   set +x
   174503   $at_times_p && times >"$at_times_file"
   174504 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   174505 read at_status <"$at_status_file"
   174506 #AT_STOP_334
   174507 #AT_START_335
   174508 at_fn_group_banner 335 'glr-regression.at:455' \
   174509   "User destructor for unresolved GLR semantic value" "" 22
   174510 at_xfail=no
   174511 (
   174512   $as_echo "335. $at_setup_line: testing $at_desc ..."
   174513   $at_traceon
   174514 
   174515 
   174516 
   174517 cat >glr-regr5.y <<'_ATEOF'
   174518 %code top {
   174519 #include <config.h>
   174520 /* We don't need perfect functions for these tests. */
   174521 #undef malloc
   174522 #undef memcmp
   174523 #undef realloc
   174524 }
   174525 
   174526 
   174527 %{
   174528   #include <stdio.h>
   174529   #include <stdlib.h>
   174530   static void yyerror ( const char *msg);
   174531   static int yylex (void);
   174532   enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */
   174533 %}
   174534 
   174535 %glr-parser
   174536 %union { int value; }
   174537 %type <value> start
   174538 
   174539 %destructor {
   174540   if ($$ != MAGIC_VALUE)
   174541     {
   174542       fprintf (stderr, "Bad destructor call.\n");
   174543       exit (EXIT_FAILURE);
   174544     }
   174545 } start
   174546 
   174547 %%
   174548 
   174549 start:
   174550    'a' { $$ = MAGIC_VALUE; }
   174551    | 'a' { $$ = MAGIC_VALUE; }
   174552    ;
   174553 
   174554 %%
   174555 #include <assert.h>
   174556 static
   174557 int yylex (void)
   174558 {
   174559   static char const input[] = "a";
   174560   static size_t toknum = 0;
   174561   int res;
   174562   ;
   174563   assert (toknum < sizeof input / sizeof input[0]);
   174564   res = input[toknum++];
   174565   ;
   174566   return res;
   174567 }
   174568 #include <stdio.h>
   174569 /* A C error reporting function.  */
   174570 static
   174571 void yyerror ( const char *msg)
   174572 {
   174573   fprintf (stderr, "%s\n", msg);
   174574 }
   174575 int
   174576 main (void)
   174577 {
   174578   return yyparse () != 1;
   174579 }
   174580 _ATEOF
   174581 
   174582 
   174583 
   174584 
   174585 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   174586   at_save_special_files
   174587   mkdir xml-tests
   174588     # Don't combine these Bison invocations since we want to be sure that
   174589   # --report=all isn't required to get the full XML file.
   174590   { set +x
   174591 $as_echo "$at_srcdir/glr-regression.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   174592                   --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y"
   174593 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:498"
   174594 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   174595                   --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y
   174596 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174597 at_status=$? at_failed=false
   174598 $at_check_filter
   174599 echo stderr:; cat "$at_stderr"
   174600 echo stdout:; cat "$at_stdout"
   174601 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498"
   174602 $at_failed && at_fn_log_failure
   174603 $at_traceon; }
   174604 
   174605   { set +x
   174606 $as_echo "$at_srcdir/glr-regression.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y"
   174607 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" "glr-regression.at:498"
   174608 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y
   174609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174610 at_status=$? at_failed=false
   174611 $at_check_filter
   174612 echo stderr:; cat "$at_stderr"
   174613 echo stdout:; cat "$at_stdout"
   174614 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498"
   174615 $at_failed && at_fn_log_failure
   174616 $at_traceon; }
   174617 
   174618     cp xml-tests/test.output expout
   174619   { set +x
   174620 $as_echo "$at_srcdir/glr-regression.at:498: \$XSLTPROC \\
   174621              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   174622              xml-tests/test.xml"
   174623 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:498"
   174624 ( $at_check_trace; $XSLTPROC \
   174625              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   174626              xml-tests/test.xml
   174627 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174628 at_status=$? at_failed=false
   174629 $at_check_filter
   174630 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174631 $at_diff expout "$at_stdout" || at_failed=:
   174632 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498"
   174633 $at_failed && at_fn_log_failure
   174634 $at_traceon; }
   174635 
   174636   sort xml-tests/test.dot > expout
   174637   { set +x
   174638 $as_echo "$at_srcdir/glr-regression.at:498: \$XSLTPROC \\
   174639              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   174640              xml-tests/test.xml | sort"
   174641 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:498"
   174642 ( $at_check_trace; $XSLTPROC \
   174643              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   174644              xml-tests/test.xml | sort
   174645 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174646 at_status=$? at_failed=false
   174647 $at_check_filter
   174648 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174649 $at_diff expout "$at_stdout" || at_failed=:
   174650 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498"
   174651 $at_failed && at_fn_log_failure
   174652 $at_traceon; }
   174653 
   174654   rm -rf xml-tests expout
   174655   at_restore_special_files
   174656 fi
   174657 { set +x
   174658 $as_echo "$at_srcdir/glr-regression.at:498: bison -o glr-regr5.c glr-regr5.y"
   174659 at_fn_check_prepare_trace "glr-regression.at:498"
   174660 ( $at_check_trace; bison -o glr-regr5.c glr-regr5.y
   174661 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174662 at_status=$? at_failed=false
   174663 $at_check_filter
   174664 echo >>"$at_stderr"; $as_echo "glr-regr5.y: conflicts: 1 reduce/reduce
   174665 " | \
   174666   $at_diff - "$at_stderr" || at_failed=:
   174667 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174668 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498"
   174669 $at_failed && at_fn_log_failure
   174670 $at_traceon; }
   174671 
   174672 
   174673 { set +x
   174674 $as_echo "$at_srcdir/glr-regression.at:501: \$BISON_C_WORKS"
   174675 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:501"
   174676 ( $at_check_trace; $BISON_C_WORKS
   174677 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174678 at_status=$? at_failed=false
   174679 $at_check_filter
   174680 echo stderr:; cat "$at_stderr"
   174681 echo stdout:; cat "$at_stdout"
   174682 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:501"
   174683 $at_failed && at_fn_log_failure
   174684 $at_traceon; }
   174685 
   174686 { set +x
   174687 $as_echo "$at_srcdir/glr-regression.at:501: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr5 glr-regr5.c \$LIBS"
   174688 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS" "glr-regression.at:501"
   174689 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS
   174690 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174691 at_status=$? at_failed=false
   174692 $at_check_filter
   174693 echo stderr:; cat "$at_stderr"
   174694 echo stdout:; cat "$at_stdout"
   174695 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:501"
   174696 $at_failed && at_fn_log_failure
   174697 $at_traceon; }
   174698 
   174699 
   174700 { set +x
   174701 $as_echo "$at_srcdir/glr-regression.at:503:  \$PREPARSER ./glr-regr5"
   174702 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:503"
   174703 ( $at_check_trace;  $PREPARSER ./glr-regr5
   174704 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174705 at_status=$? at_failed=false
   174706 $at_check_filter
   174707 echo stderr:; tee stderr <"$at_stderr"
   174708 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174709 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:503"
   174710 $at_failed && at_fn_log_failure
   174711 $at_traceon; }
   174712 
   174713 { set +x
   174714 $as_echo "$at_srcdir/glr-regression.at:503: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   174715 at_fn_check_prepare_trace "glr-regression.at:503"
   174716 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   174717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174718 at_status=$? at_failed=false
   174719 $at_check_filter
   174720 echo >>"$at_stderr"; $as_echo "syntax is ambiguous
   174721 " | \
   174722   $at_diff - "$at_stderr" || at_failed=:
   174723 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174724 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:503"
   174725 $at_failed && at_fn_log_failure
   174726 $at_traceon; }
   174727 
   174728 
   174729 
   174730   set +x
   174731   $at_times_p && times >"$at_times_file"
   174732 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   174733 read at_status <"$at_status_file"
   174734 #AT_STOP_335
   174735 #AT_START_336
   174736 at_fn_group_banner 336 'glr-regression.at:515' \
   174737   "User destructor after an error during a split parse" "" 22
   174738 at_xfail=no
   174739 (
   174740   $as_echo "336. $at_setup_line: testing $at_desc ..."
   174741   $at_traceon
   174742 
   174743 
   174744 
   174745 cat >glr-regr6.y <<'_ATEOF'
   174746 %code top {
   174747 #include <config.h>
   174748 /* We don't need perfect functions for these tests. */
   174749 #undef malloc
   174750 #undef memcmp
   174751 #undef realloc
   174752 }
   174753 
   174754 
   174755 %{
   174756   #include <stdio.h>
   174757   #include <stdlib.h>
   174758   static void yyerror ( const char *msg);
   174759   static int yylex (void);
   174760 %}
   174761 
   174762 %glr-parser
   174763 %union { int value; }
   174764 %type <value> 'a'
   174765 
   174766 %destructor {
   174767   printf ("Destructor called.\n");
   174768 } 'a'
   174769 
   174770 %%
   174771 
   174772 start: 'a' | 'a' ;
   174773 
   174774 %%
   174775 #include <stdio.h>
   174776 /* A C error reporting function.  */
   174777 static
   174778 void yyerror ( const char *msg)
   174779 {
   174780   fprintf (stderr, "%s\n", msg);
   174781 }
   174782 #include <assert.h>
   174783 static
   174784 int yylex (void)
   174785 {
   174786   static char const input[] = "a";
   174787   static size_t toknum = 0;
   174788   int res;
   174789   ;
   174790   assert (toknum < sizeof input / sizeof input[0]);
   174791   res = input[toknum++];
   174792   ;
   174793   return res;
   174794 }
   174795 int
   174796 main (void)
   174797 {
   174798   return yyparse () != 1;
   174799 }
   174800 _ATEOF
   174801 
   174802 
   174803 
   174804 
   174805 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   174806   at_save_special_files
   174807   mkdir xml-tests
   174808     # Don't combine these Bison invocations since we want to be sure that
   174809   # --report=all isn't required to get the full XML file.
   174810   { set +x
   174811 $as_echo "$at_srcdir/glr-regression.at:550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   174812                   --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y"
   174813 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:550"
   174814 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   174815                   --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y
   174816 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174817 at_status=$? at_failed=false
   174818 $at_check_filter
   174819 echo stderr:; cat "$at_stderr"
   174820 echo stdout:; cat "$at_stdout"
   174821 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550"
   174822 $at_failed && at_fn_log_failure
   174823 $at_traceon; }
   174824 
   174825   { set +x
   174826 $as_echo "$at_srcdir/glr-regression.at:550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y"
   174827 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" "glr-regression.at:550"
   174828 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y
   174829 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174830 at_status=$? at_failed=false
   174831 $at_check_filter
   174832 echo stderr:; cat "$at_stderr"
   174833 echo stdout:; cat "$at_stdout"
   174834 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550"
   174835 $at_failed && at_fn_log_failure
   174836 $at_traceon; }
   174837 
   174838     cp xml-tests/test.output expout
   174839   { set +x
   174840 $as_echo "$at_srcdir/glr-regression.at:550: \$XSLTPROC \\
   174841              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   174842              xml-tests/test.xml"
   174843 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:550"
   174844 ( $at_check_trace; $XSLTPROC \
   174845              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   174846              xml-tests/test.xml
   174847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174848 at_status=$? at_failed=false
   174849 $at_check_filter
   174850 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174851 $at_diff expout "$at_stdout" || at_failed=:
   174852 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550"
   174853 $at_failed && at_fn_log_failure
   174854 $at_traceon; }
   174855 
   174856   sort xml-tests/test.dot > expout
   174857   { set +x
   174858 $as_echo "$at_srcdir/glr-regression.at:550: \$XSLTPROC \\
   174859              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   174860              xml-tests/test.xml | sort"
   174861 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:550"
   174862 ( $at_check_trace; $XSLTPROC \
   174863              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   174864              xml-tests/test.xml | sort
   174865 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174866 at_status=$? at_failed=false
   174867 $at_check_filter
   174868 at_fn_diff_devnull "$at_stderr" || at_failed=:
   174869 $at_diff expout "$at_stdout" || at_failed=:
   174870 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550"
   174871 $at_failed && at_fn_log_failure
   174872 $at_traceon; }
   174873 
   174874   rm -rf xml-tests expout
   174875   at_restore_special_files
   174876 fi
   174877 { set +x
   174878 $as_echo "$at_srcdir/glr-regression.at:550: bison -o glr-regr6.c glr-regr6.y"
   174879 at_fn_check_prepare_trace "glr-regression.at:550"
   174880 ( $at_check_trace; bison -o glr-regr6.c glr-regr6.y
   174881 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174882 at_status=$? at_failed=false
   174883 $at_check_filter
   174884 echo >>"$at_stderr"; $as_echo "glr-regr6.y: conflicts: 1 reduce/reduce
   174885 " | \
   174886   $at_diff - "$at_stderr" || at_failed=:
   174887 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174888 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:550"
   174889 $at_failed && at_fn_log_failure
   174890 $at_traceon; }
   174891 
   174892 
   174893 { set +x
   174894 $as_echo "$at_srcdir/glr-regression.at:553: \$BISON_C_WORKS"
   174895 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:553"
   174896 ( $at_check_trace; $BISON_C_WORKS
   174897 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174898 at_status=$? at_failed=false
   174899 $at_check_filter
   174900 echo stderr:; cat "$at_stderr"
   174901 echo stdout:; cat "$at_stdout"
   174902 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:553"
   174903 $at_failed && at_fn_log_failure
   174904 $at_traceon; }
   174905 
   174906 { set +x
   174907 $as_echo "$at_srcdir/glr-regression.at:553: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr6 glr-regr6.c \$LIBS"
   174908 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS" "glr-regression.at:553"
   174909 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS
   174910 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174911 at_status=$? at_failed=false
   174912 $at_check_filter
   174913 echo stderr:; cat "$at_stderr"
   174914 echo stdout:; cat "$at_stdout"
   174915 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:553"
   174916 $at_failed && at_fn_log_failure
   174917 $at_traceon; }
   174918 
   174919 
   174920 { set +x
   174921 $as_echo "$at_srcdir/glr-regression.at:555:  \$PREPARSER ./glr-regr6"
   174922 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:555"
   174923 ( $at_check_trace;  $PREPARSER ./glr-regr6
   174924 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174925 at_status=$? at_failed=false
   174926 $at_check_filter
   174927 echo stderr:; tee stderr <"$at_stderr"
   174928 echo >>"$at_stdout"; $as_echo "Destructor called.
   174929 " | \
   174930   $at_diff - "$at_stdout" || at_failed=:
   174931 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:555"
   174932 $at_failed && at_fn_log_failure
   174933 $at_traceon; }
   174934 
   174935 { set +x
   174936 $as_echo "$at_srcdir/glr-regression.at:555: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   174937 at_fn_check_prepare_trace "glr-regression.at:555"
   174938 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   174939 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   174940 at_status=$? at_failed=false
   174941 $at_check_filter
   174942 echo >>"$at_stderr"; $as_echo "syntax is ambiguous
   174943 " | \
   174944   $at_diff - "$at_stderr" || at_failed=:
   174945 at_fn_diff_devnull "$at_stdout" || at_failed=:
   174946 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:555"
   174947 $at_failed && at_fn_log_failure
   174948 $at_traceon; }
   174949 
   174950 
   174951 
   174952   set +x
   174953   $at_times_p && times >"$at_times_file"
   174954 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   174955 read at_status <"$at_status_file"
   174956 #AT_STOP_336
   174957 #AT_START_337
   174958 at_fn_group_banner 337 'glr-regression.at:569' \
   174959   "Duplicated user destructor for lookahead" "       " 22
   174960 at_xfail=no
   174961 (
   174962   $as_echo "337. $at_setup_line: testing $at_desc ..."
   174963   $at_traceon
   174964 
   174965 
   174966 
   174967 cat >glr-regr7.y <<'_ATEOF'
   174968 %code top {
   174969 #include <config.h>
   174970 /* We don't need perfect functions for these tests. */
   174971 #undef malloc
   174972 #undef memcmp
   174973 #undef realloc
   174974 }
   174975 
   174976 
   174977 %{
   174978   #include <stdio.h>
   174979   #include <stdlib.h>
   174980   static void yyerror ( const char *msg);
   174981   static int yylex (void);
   174982   #define YYSTACKEXPANDABLE 0
   174983   typedef struct count_node {
   174984     int count;
   174985     struct count_node *prev;
   174986   } count_node;
   174987   static count_node *tail;
   174988 %}
   174989 
   174990 %glr-parser
   174991 %union { count_node *node; }
   174992 %type <node> 'a'
   174993 
   174994 %destructor {
   174995   if ($$->count++)
   174996     fprintf (stderr, "Destructor called on same value twice.\n");
   174997 } 'a'
   174998 
   174999 %%
   175000 
   175001 start:
   175002     stack1 start
   175003   | stack2 start
   175004   | /* empty */
   175005   ;
   175006 stack1: 'a' ;
   175007 stack2: 'a' ;
   175008 
   175009 %%
   175010 
   175011 static int
   175012 yylex (void)
   175013 {
   175014   yylval.node = (count_node*) malloc (sizeof *yylval.node);
   175015   if (!yylval.node)
   175016     {
   175017       fprintf (stderr, "Test inconclusive.\n");
   175018       exit (EXIT_FAILURE);
   175019     }
   175020   yylval.node->count = 0;
   175021   yylval.node->prev = tail;
   175022   tail = yylval.node;
   175023   return 'a';
   175024 }
   175025 
   175026 #include <stdio.h>
   175027 /* A C error reporting function.  */
   175028 static
   175029 void yyerror ( const char *msg)
   175030 {
   175031   fprintf (stderr, "%s\n", msg);
   175032 }
   175033 int
   175034 main (void)
   175035 {
   175036   int status = yyparse ();
   175037   while (tail)
   175038     {
   175039       count_node *prev = tail->prev;
   175040       free (tail);
   175041       tail = prev;
   175042     }
   175043   return status;
   175044 }
   175045 _ATEOF
   175046 
   175047 
   175048 
   175049 
   175050 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   175051   at_save_special_files
   175052   mkdir xml-tests
   175053     # Don't combine these Bison invocations since we want to be sure that
   175054   # --report=all isn't required to get the full XML file.
   175055   { set +x
   175056 $as_echo "$at_srcdir/glr-regression.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   175057                   --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y"
   175058 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:639"
   175059 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   175060                   --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y
   175061 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175062 at_status=$? at_failed=false
   175063 $at_check_filter
   175064 echo stderr:; cat "$at_stderr"
   175065 echo stdout:; cat "$at_stdout"
   175066 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639"
   175067 $at_failed && at_fn_log_failure
   175068 $at_traceon; }
   175069 
   175070   { set +x
   175071 $as_echo "$at_srcdir/glr-regression.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y"
   175072 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" "glr-regression.at:639"
   175073 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y
   175074 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175075 at_status=$? at_failed=false
   175076 $at_check_filter
   175077 echo stderr:; cat "$at_stderr"
   175078 echo stdout:; cat "$at_stdout"
   175079 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639"
   175080 $at_failed && at_fn_log_failure
   175081 $at_traceon; }
   175082 
   175083     cp xml-tests/test.output expout
   175084   { set +x
   175085 $as_echo "$at_srcdir/glr-regression.at:639: \$XSLTPROC \\
   175086              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   175087              xml-tests/test.xml"
   175088 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:639"
   175089 ( $at_check_trace; $XSLTPROC \
   175090              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   175091              xml-tests/test.xml
   175092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175093 at_status=$? at_failed=false
   175094 $at_check_filter
   175095 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175096 $at_diff expout "$at_stdout" || at_failed=:
   175097 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639"
   175098 $at_failed && at_fn_log_failure
   175099 $at_traceon; }
   175100 
   175101   sort xml-tests/test.dot > expout
   175102   { set +x
   175103 $as_echo "$at_srcdir/glr-regression.at:639: \$XSLTPROC \\
   175104              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   175105              xml-tests/test.xml | sort"
   175106 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:639"
   175107 ( $at_check_trace; $XSLTPROC \
   175108              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   175109              xml-tests/test.xml | sort
   175110 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175111 at_status=$? at_failed=false
   175112 $at_check_filter
   175113 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175114 $at_diff expout "$at_stdout" || at_failed=:
   175115 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639"
   175116 $at_failed && at_fn_log_failure
   175117 $at_traceon; }
   175118 
   175119   rm -rf xml-tests expout
   175120   at_restore_special_files
   175121 fi
   175122 { set +x
   175123 $as_echo "$at_srcdir/glr-regression.at:639: bison -o glr-regr7.c glr-regr7.y"
   175124 at_fn_check_prepare_trace "glr-regression.at:639"
   175125 ( $at_check_trace; bison -o glr-regr7.c glr-regr7.y
   175126 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175127 at_status=$? at_failed=false
   175128 $at_check_filter
   175129 echo >>"$at_stderr"; $as_echo "glr-regr7.y: conflicts: 2 reduce/reduce
   175130 " | \
   175131   $at_diff - "$at_stderr" || at_failed=:
   175132 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175133 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639"
   175134 $at_failed && at_fn_log_failure
   175135 $at_traceon; }
   175136 
   175137 
   175138 { set +x
   175139 $as_echo "$at_srcdir/glr-regression.at:642: \$BISON_C_WORKS"
   175140 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:642"
   175141 ( $at_check_trace; $BISON_C_WORKS
   175142 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175143 at_status=$? at_failed=false
   175144 $at_check_filter
   175145 echo stderr:; cat "$at_stderr"
   175146 echo stdout:; cat "$at_stdout"
   175147 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:642"
   175148 $at_failed && at_fn_log_failure
   175149 $at_traceon; }
   175150 
   175151 { set +x
   175152 $as_echo "$at_srcdir/glr-regression.at:642: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr7 glr-regr7.c \$LIBS"
   175153 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS" "glr-regression.at:642"
   175154 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS
   175155 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175156 at_status=$? at_failed=false
   175157 $at_check_filter
   175158 echo stderr:; cat "$at_stderr"
   175159 echo stdout:; cat "$at_stdout"
   175160 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:642"
   175161 $at_failed && at_fn_log_failure
   175162 $at_traceon; }
   175163 
   175164 
   175165 { set +x
   175166 $as_echo "$at_srcdir/glr-regression.at:644:  \$PREPARSER ./glr-regr7"
   175167 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:644"
   175168 ( $at_check_trace;  $PREPARSER ./glr-regr7
   175169 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175170 at_status=$? at_failed=false
   175171 $at_check_filter
   175172 echo stderr:; tee stderr <"$at_stderr"
   175173 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175174 at_fn_check_status 2 $at_status "$at_srcdir/glr-regression.at:644"
   175175 $at_failed && at_fn_log_failure
   175176 $at_traceon; }
   175177 
   175178 { set +x
   175179 $as_echo "$at_srcdir/glr-regression.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   175180 at_fn_check_prepare_trace "glr-regression.at:644"
   175181 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   175182 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175183 at_status=$? at_failed=false
   175184 $at_check_filter
   175185 echo >>"$at_stderr"; $as_echo "memory exhausted
   175186 " | \
   175187   $at_diff - "$at_stderr" || at_failed=:
   175188 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175189 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:644"
   175190 $at_failed && at_fn_log_failure
   175191 $at_traceon; }
   175192 
   175193 
   175194 
   175195   set +x
   175196   $at_times_p && times >"$at_times_file"
   175197 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   175198 read at_status <"$at_status_file"
   175199 #AT_STOP_337
   175200 #AT_START_338
   175201 at_fn_group_banner 338 'glr-regression.at:658' \
   175202   "Incorrectly initialized location for empty right-hand side in GLR" "" 22
   175203 at_xfail=no
   175204 (
   175205   $as_echo "338. $at_setup_line: testing $at_desc ..."
   175206   $at_traceon
   175207 
   175208 
   175209 
   175210 cat >glr-regr8.y <<'_ATEOF'
   175211 %code top {
   175212 #include <config.h>
   175213 /* We don't need perfect functions for these tests. */
   175214 #undef malloc
   175215 #undef memcmp
   175216 #undef realloc
   175217 }
   175218 
   175219 
   175220 %{
   175221   #include <stdio.h>
   175222   #include <stdlib.h>
   175223   static void yyerror ( const char *msg);
   175224   static int yylex (void);
   175225 %}
   175226 
   175227 %token T_CONSTANT
   175228 %token T_PORT
   175229 %token T_SIGNAL
   175230 
   175231 %glr-parser
   175232 
   175233 %%
   175234 
   175235 
   175236 PortClause	: T_PORT InterfaceDeclaration T_PORT
   175237 		{ printf("%d/%d - %d/%d - %d/%d\n",
   175238 			 @1.first_column, @1.last_column,
   175239 			 @2.first_column, @2.last_column,
   175240 			 @3.first_column, @3.last_column); }
   175241 	;
   175242 
   175243 InterfaceDeclaration	: OptConstantWord	%dprec 1
   175244 	| OptSignalWord	%dprec 2
   175245 	;
   175246 
   175247 OptConstantWord	: /* empty */
   175248 	| T_CONSTANT
   175249 	;
   175250 
   175251 OptSignalWord	: /* empty */
   175252 		{ printf("empty: %d/%d\n", @$.first_column, @$.last_column); }
   175253 	| T_SIGNAL
   175254 	;
   175255 
   175256 %%
   175257 
   175258 #include <stdio.h>
   175259 /* A C error reporting function.  */
   175260 static
   175261 void yyerror ( const char *msg)
   175262 {
   175263   fprintf (stderr, "%s\n", msg);
   175264 }
   175265 static int lexIndex;
   175266 
   175267 int yylex (void)
   175268 {
   175269   lexIndex += 1;
   175270   switch (lexIndex)
   175271     {
   175272     default:
   175273       abort ();
   175274     case 1:
   175275       yylloc.first_column = 1;
   175276       yylloc.last_column = 9;
   175277       return T_PORT;
   175278     case 2:
   175279       yylloc.first_column = 13;
   175280       yylloc.last_column = 17;
   175281       return T_PORT;
   175282     case 3:
   175283       return 0;
   175284     }
   175285 }
   175286 
   175287 int
   175288 main (void)
   175289 {
   175290   yyparse();
   175291   return 0;
   175292 }
   175293 _ATEOF
   175294 
   175295 
   175296 
   175297 
   175298 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   175299   at_save_special_files
   175300   mkdir xml-tests
   175301     # Don't combine these Bison invocations since we want to be sure that
   175302   # --report=all isn't required to get the full XML file.
   175303   { set +x
   175304 $as_echo "$at_srcdir/glr-regression.at:733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   175305                   --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y"
   175306 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:733"
   175307 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   175308                   --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y
   175309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175310 at_status=$? at_failed=false
   175311 $at_check_filter
   175312 echo stderr:; cat "$at_stderr"
   175313 echo stdout:; cat "$at_stdout"
   175314 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733"
   175315 $at_failed && at_fn_log_failure
   175316 $at_traceon; }
   175317 
   175318   { set +x
   175319 $as_echo "$at_srcdir/glr-regression.at:733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y"
   175320 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" "glr-regression.at:733"
   175321 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y
   175322 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175323 at_status=$? at_failed=false
   175324 $at_check_filter
   175325 echo stderr:; cat "$at_stderr"
   175326 echo stdout:; cat "$at_stdout"
   175327 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733"
   175328 $at_failed && at_fn_log_failure
   175329 $at_traceon; }
   175330 
   175331     cp xml-tests/test.output expout
   175332   { set +x
   175333 $as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\
   175334              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   175335              xml-tests/test.xml"
   175336 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:733"
   175337 ( $at_check_trace; $XSLTPROC \
   175338              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   175339              xml-tests/test.xml
   175340 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175341 at_status=$? at_failed=false
   175342 $at_check_filter
   175343 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175344 $at_diff expout "$at_stdout" || at_failed=:
   175345 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733"
   175346 $at_failed && at_fn_log_failure
   175347 $at_traceon; }
   175348 
   175349   sort xml-tests/test.dot > expout
   175350   { set +x
   175351 $as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\
   175352              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   175353              xml-tests/test.xml | sort"
   175354 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:733"
   175355 ( $at_check_trace; $XSLTPROC \
   175356              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   175357              xml-tests/test.xml | sort
   175358 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175359 at_status=$? at_failed=false
   175360 $at_check_filter
   175361 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175362 $at_diff expout "$at_stdout" || at_failed=:
   175363 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733"
   175364 $at_failed && at_fn_log_failure
   175365 $at_traceon; }
   175366 
   175367   rm -rf xml-tests expout
   175368   at_restore_special_files
   175369 fi
   175370 { set +x
   175371 $as_echo "$at_srcdir/glr-regression.at:733: bison -o glr-regr8.c glr-regr8.y"
   175372 at_fn_check_prepare_trace "glr-regression.at:733"
   175373 ( $at_check_trace; bison -o glr-regr8.c glr-regr8.y
   175374 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175375 at_status=$? at_failed=false
   175376 $at_check_filter
   175377 echo >>"$at_stderr"; $as_echo "glr-regr8.y: conflicts: 1 reduce/reduce
   175378 " | \
   175379   $at_diff - "$at_stderr" || at_failed=:
   175380 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175381 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733"
   175382 $at_failed && at_fn_log_failure
   175383 $at_traceon; }
   175384 
   175385 
   175386 { set +x
   175387 $as_echo "$at_srcdir/glr-regression.at:736: \$BISON_C_WORKS"
   175388 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:736"
   175389 ( $at_check_trace; $BISON_C_WORKS
   175390 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175391 at_status=$? at_failed=false
   175392 $at_check_filter
   175393 echo stderr:; cat "$at_stderr"
   175394 echo stdout:; cat "$at_stdout"
   175395 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:736"
   175396 $at_failed && at_fn_log_failure
   175397 $at_traceon; }
   175398 
   175399 { set +x
   175400 $as_echo "$at_srcdir/glr-regression.at:736: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr8 glr-regr8.c \$LIBS"
   175401 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS" "glr-regression.at:736"
   175402 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS
   175403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175404 at_status=$? at_failed=false
   175405 $at_check_filter
   175406 echo stderr:; cat "$at_stderr"
   175407 echo stdout:; cat "$at_stdout"
   175408 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:736"
   175409 $at_failed && at_fn_log_failure
   175410 $at_traceon; }
   175411 
   175412 
   175413 { set +x
   175414 $as_echo "$at_srcdir/glr-regression.at:738:  \$PREPARSER ./glr-regr8"
   175415 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:738"
   175416 ( $at_check_trace;  $PREPARSER ./glr-regr8
   175417 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175418 at_status=$? at_failed=false
   175419 $at_check_filter
   175420 echo stderr:; tee stderr <"$at_stderr"
   175421 echo >>"$at_stdout"; $as_echo "empty: 9/9
   175422 1/9 - 9/9 - 13/17
   175423 " | \
   175424   $at_diff - "$at_stdout" || at_failed=:
   175425 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:738"
   175426 $at_failed && at_fn_log_failure
   175427 $at_traceon; }
   175428 
   175429 { set +x
   175430 $as_echo "$at_srcdir/glr-regression.at:738: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   175431 at_fn_check_prepare_trace "glr-regression.at:738"
   175432 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   175433 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175434 at_status=$? at_failed=false
   175435 $at_check_filter
   175436 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175437 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175438 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:738"
   175439 $at_failed && at_fn_log_failure
   175440 $at_traceon; }
   175441 
   175442 
   175443 
   175444   set +x
   175445   $at_times_p && times >"$at_times_file"
   175446 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   175447 read at_status <"$at_status_file"
   175448 #AT_STOP_338
   175449 #AT_START_339
   175450 at_fn_group_banner 339 'glr-regression.at:752' \
   175451   "No users destructors if stack 0 deleted" "        " 22
   175452 at_xfail=no
   175453 (
   175454   $as_echo "339. $at_setup_line: testing $at_desc ..."
   175455   $at_traceon
   175456 
   175457 
   175458 
   175459 cat >glr-regr9.y <<'_ATEOF'
   175460 %code top {
   175461 #include <config.h>
   175462 /* We don't need perfect functions for these tests. */
   175463 #undef malloc
   175464 #undef memcmp
   175465 #undef realloc
   175466 }
   175467 
   175468 
   175469 %{
   175470 # include <stdio.h>
   175471 # include <stdlib.h>
   175472   static void yyerror ( const char *msg);
   175473   static int yylex (void);
   175474 # define YYSTACKEXPANDABLE 0
   175475   static int tokens = 0;
   175476   static int destructors = 0;
   175477 # define USE(Var)
   175478 %}
   175479 
   175480 %glr-parser
   175481 %union { int dummy; }
   175482 %type <dummy> 'a'
   175483 
   175484 %destructor {
   175485   destructors += 1;
   175486 } 'a'
   175487 
   175488 %%
   175489 
   175490 start:
   175491     ambig0 'a'   { destructors += 2; USE ($2); }
   175492   | ambig1 start { destructors += 1; }
   175493   | ambig2 start { destructors += 1; }
   175494   ;
   175495 
   175496 ambig0: 'a' ;
   175497 ambig1: 'a' ;
   175498 ambig2: 'a' ;
   175499 
   175500 %%
   175501 
   175502 static int
   175503 yylex (void)
   175504 {
   175505   tokens += 1;
   175506   return 'a';
   175507 }
   175508 
   175509 #include <stdio.h>
   175510 /* A C error reporting function.  */
   175511 static
   175512 void yyerror ( const char *msg)
   175513 {
   175514   fprintf (stderr, "%s\n", msg);
   175515 }
   175516 int
   175517 main (void)
   175518 {
   175519   int exit_status;
   175520   exit_status = yyparse ();
   175521   if (tokens != destructors)
   175522     {
   175523       fprintf (stderr, "Tokens = %d, Destructors = %d\n", tokens, destructors);
   175524       return 1;
   175525     }
   175526   return !exit_status;
   175527 }
   175528 _ATEOF
   175529 
   175530 
   175531 
   175532 
   175533 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   175534   at_save_special_files
   175535   mkdir xml-tests
   175536     # Don't combine these Bison invocations since we want to be sure that
   175537   # --report=all isn't required to get the full XML file.
   175538   { set +x
   175539 $as_echo "$at_srcdir/glr-regression.at:813: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   175540                   --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y"
   175541 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:813"
   175542 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   175543                   --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y
   175544 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175545 at_status=$? at_failed=false
   175546 $at_check_filter
   175547 echo stderr:; cat "$at_stderr"
   175548 echo stdout:; cat "$at_stdout"
   175549 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813"
   175550 $at_failed && at_fn_log_failure
   175551 $at_traceon; }
   175552 
   175553   { set +x
   175554 $as_echo "$at_srcdir/glr-regression.at:813: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y"
   175555 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" "glr-regression.at:813"
   175556 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y
   175557 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175558 at_status=$? at_failed=false
   175559 $at_check_filter
   175560 echo stderr:; cat "$at_stderr"
   175561 echo stdout:; cat "$at_stdout"
   175562 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813"
   175563 $at_failed && at_fn_log_failure
   175564 $at_traceon; }
   175565 
   175566     cp xml-tests/test.output expout
   175567   { set +x
   175568 $as_echo "$at_srcdir/glr-regression.at:813: \$XSLTPROC \\
   175569              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   175570              xml-tests/test.xml"
   175571 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:813"
   175572 ( $at_check_trace; $XSLTPROC \
   175573              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   175574              xml-tests/test.xml
   175575 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175576 at_status=$? at_failed=false
   175577 $at_check_filter
   175578 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175579 $at_diff expout "$at_stdout" || at_failed=:
   175580 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813"
   175581 $at_failed && at_fn_log_failure
   175582 $at_traceon; }
   175583 
   175584   sort xml-tests/test.dot > expout
   175585   { set +x
   175586 $as_echo "$at_srcdir/glr-regression.at:813: \$XSLTPROC \\
   175587              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   175588              xml-tests/test.xml | sort"
   175589 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:813"
   175590 ( $at_check_trace; $XSLTPROC \
   175591              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   175592              xml-tests/test.xml | sort
   175593 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175594 at_status=$? at_failed=false
   175595 $at_check_filter
   175596 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175597 $at_diff expout "$at_stdout" || at_failed=:
   175598 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813"
   175599 $at_failed && at_fn_log_failure
   175600 $at_traceon; }
   175601 
   175602   rm -rf xml-tests expout
   175603   at_restore_special_files
   175604 fi
   175605 { set +x
   175606 $as_echo "$at_srcdir/glr-regression.at:813: bison -o glr-regr9.c glr-regr9.y"
   175607 at_fn_check_prepare_trace "glr-regression.at:813"
   175608 ( $at_check_trace; bison -o glr-regr9.c glr-regr9.y
   175609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175610 at_status=$? at_failed=false
   175611 $at_check_filter
   175612 echo >>"$at_stderr"; $as_echo "glr-regr9.y: conflicts: 1 reduce/reduce
   175613 " | \
   175614   $at_diff - "$at_stderr" || at_failed=:
   175615 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175616 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:813"
   175617 $at_failed && at_fn_log_failure
   175618 $at_traceon; }
   175619 
   175620 
   175621 { set +x
   175622 $as_echo "$at_srcdir/glr-regression.at:816: \$BISON_C_WORKS"
   175623 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:816"
   175624 ( $at_check_trace; $BISON_C_WORKS
   175625 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175626 at_status=$? at_failed=false
   175627 $at_check_filter
   175628 echo stderr:; cat "$at_stderr"
   175629 echo stdout:; cat "$at_stdout"
   175630 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:816"
   175631 $at_failed && at_fn_log_failure
   175632 $at_traceon; }
   175633 
   175634 { set +x
   175635 $as_echo "$at_srcdir/glr-regression.at:816: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr9 glr-regr9.c \$LIBS"
   175636 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS" "glr-regression.at:816"
   175637 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS
   175638 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175639 at_status=$? at_failed=false
   175640 $at_check_filter
   175641 echo stderr:; cat "$at_stderr"
   175642 echo stdout:; cat "$at_stdout"
   175643 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:816"
   175644 $at_failed && at_fn_log_failure
   175645 $at_traceon; }
   175646 
   175647 
   175648 { set +x
   175649 $as_echo "$at_srcdir/glr-regression.at:818:  \$PREPARSER ./glr-regr9"
   175650 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:818"
   175651 ( $at_check_trace;  $PREPARSER ./glr-regr9
   175652 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175653 at_status=$? at_failed=false
   175654 $at_check_filter
   175655 echo stderr:; tee stderr <"$at_stderr"
   175656 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175657 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:818"
   175658 $at_failed && at_fn_log_failure
   175659 $at_traceon; }
   175660 
   175661 { set +x
   175662 $as_echo "$at_srcdir/glr-regression.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   175663 at_fn_check_prepare_trace "glr-regression.at:818"
   175664 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   175665 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175666 at_status=$? at_failed=false
   175667 $at_check_filter
   175668 echo >>"$at_stderr"; $as_echo "memory exhausted
   175669 " | \
   175670   $at_diff - "$at_stderr" || at_failed=:
   175671 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175672 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:818"
   175673 $at_failed && at_fn_log_failure
   175674 $at_traceon; }
   175675 
   175676 
   175677 
   175678   set +x
   175679   $at_times_p && times >"$at_times_file"
   175680 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   175681 read at_status <"$at_status_file"
   175682 #AT_STOP_339
   175683 #AT_START_340
   175684 at_fn_group_banner 340 'glr-regression.at:829' \
   175685   "Corrupted semantic options if user action cuts parse" "" 22
   175686 at_xfail=no
   175687 (
   175688   $as_echo "340. $at_setup_line: testing $at_desc ..."
   175689   $at_traceon
   175690 
   175691 
   175692 
   175693 cat >glr-regr10.y <<'_ATEOF'
   175694 %code top {
   175695 #include <config.h>
   175696 /* We don't need perfect functions for these tests. */
   175697 #undef malloc
   175698 #undef memcmp
   175699 #undef realloc
   175700 }
   175701 
   175702 
   175703 %{
   175704 # include <stdlib.h>
   175705 # include <stdio.h>
   175706   static void yyerror ( const char *msg);
   175707   static int yylex (void);
   175708   #define GARBAGE_SIZE 50
   175709   static char garbage[GARBAGE_SIZE];
   175710 %}
   175711 
   175712 %glr-parser
   175713 %union { char *ptr; }
   175714 %type <ptr> start
   175715 
   175716 %%
   175717 
   175718 start:
   175719     %dprec 2 { $$ = garbage; YYACCEPT; }
   175720   | %dprec 1 { $$ = garbage; YYACCEPT; }
   175721   ;
   175722 
   175723 %%
   175724 #include <stdio.h>
   175725 /* A C error reporting function.  */
   175726 static
   175727 void yyerror ( const char *msg)
   175728 {
   175729   fprintf (stderr, "%s\n", msg);
   175730 }
   175731 #include <assert.h>
   175732 static
   175733 int yylex (void)
   175734 {
   175735   static char const input[] = "";
   175736   static size_t toknum = 0;
   175737   int res;
   175738   ;
   175739   assert (toknum < sizeof input / sizeof input[0]);
   175740   res = input[toknum++];
   175741   ;
   175742   return res;
   175743 }
   175744 
   175745 int
   175746 main (void)
   175747 {
   175748   int i;
   175749   for (i = 0; i < GARBAGE_SIZE; i+=1)
   175750     garbage[i] = 108;
   175751   return yyparse ();
   175752 }
   175753 _ATEOF
   175754 
   175755 
   175756 
   175757 
   175758 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   175759   at_save_special_files
   175760   mkdir xml-tests
   175761     # Don't combine these Bison invocations since we want to be sure that
   175762   # --report=all isn't required to get the full XML file.
   175763   { set +x
   175764 $as_echo "$at_srcdir/glr-regression.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   175765                   --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y"
   175766 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:869"
   175767 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   175768                   --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y
   175769 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175770 at_status=$? at_failed=false
   175771 $at_check_filter
   175772 echo stderr:; cat "$at_stderr"
   175773 echo stdout:; cat "$at_stdout"
   175774 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869"
   175775 $at_failed && at_fn_log_failure
   175776 $at_traceon; }
   175777 
   175778   { set +x
   175779 $as_echo "$at_srcdir/glr-regression.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y"
   175780 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" "glr-regression.at:869"
   175781 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y
   175782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175783 at_status=$? at_failed=false
   175784 $at_check_filter
   175785 echo stderr:; cat "$at_stderr"
   175786 echo stdout:; cat "$at_stdout"
   175787 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869"
   175788 $at_failed && at_fn_log_failure
   175789 $at_traceon; }
   175790 
   175791     cp xml-tests/test.output expout
   175792   { set +x
   175793 $as_echo "$at_srcdir/glr-regression.at:869: \$XSLTPROC \\
   175794              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   175795              xml-tests/test.xml"
   175796 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:869"
   175797 ( $at_check_trace; $XSLTPROC \
   175798              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   175799              xml-tests/test.xml
   175800 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175801 at_status=$? at_failed=false
   175802 $at_check_filter
   175803 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175804 $at_diff expout "$at_stdout" || at_failed=:
   175805 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869"
   175806 $at_failed && at_fn_log_failure
   175807 $at_traceon; }
   175808 
   175809   sort xml-tests/test.dot > expout
   175810   { set +x
   175811 $as_echo "$at_srcdir/glr-regression.at:869: \$XSLTPROC \\
   175812              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   175813              xml-tests/test.xml | sort"
   175814 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:869"
   175815 ( $at_check_trace; $XSLTPROC \
   175816              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   175817              xml-tests/test.xml | sort
   175818 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175819 at_status=$? at_failed=false
   175820 $at_check_filter
   175821 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175822 $at_diff expout "$at_stdout" || at_failed=:
   175823 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869"
   175824 $at_failed && at_fn_log_failure
   175825 $at_traceon; }
   175826 
   175827   rm -rf xml-tests expout
   175828   at_restore_special_files
   175829 fi
   175830 { set +x
   175831 $as_echo "$at_srcdir/glr-regression.at:869: bison -o glr-regr10.c glr-regr10.y"
   175832 at_fn_check_prepare_trace "glr-regression.at:869"
   175833 ( $at_check_trace; bison -o glr-regr10.c glr-regr10.y
   175834 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175835 at_status=$? at_failed=false
   175836 $at_check_filter
   175837 echo >>"$at_stderr"; $as_echo "glr-regr10.y: conflicts: 1 reduce/reduce
   175838 " | \
   175839   $at_diff - "$at_stderr" || at_failed=:
   175840 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175841 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:869"
   175842 $at_failed && at_fn_log_failure
   175843 $at_traceon; }
   175844 
   175845 
   175846 { set +x
   175847 $as_echo "$at_srcdir/glr-regression.at:872: \$BISON_C_WORKS"
   175848 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:872"
   175849 ( $at_check_trace; $BISON_C_WORKS
   175850 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175851 at_status=$? at_failed=false
   175852 $at_check_filter
   175853 echo stderr:; cat "$at_stderr"
   175854 echo stdout:; cat "$at_stdout"
   175855 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:872"
   175856 $at_failed && at_fn_log_failure
   175857 $at_traceon; }
   175858 
   175859 { set +x
   175860 $as_echo "$at_srcdir/glr-regression.at:872: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr10 glr-regr10.c \$LIBS"
   175861 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS" "glr-regression.at:872"
   175862 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS
   175863 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175864 at_status=$? at_failed=false
   175865 $at_check_filter
   175866 echo stderr:; cat "$at_stderr"
   175867 echo stdout:; cat "$at_stdout"
   175868 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:872"
   175869 $at_failed && at_fn_log_failure
   175870 $at_traceon; }
   175871 
   175872 
   175873 { set +x
   175874 $as_echo "$at_srcdir/glr-regression.at:874:  \$PREPARSER ./glr-regr10"
   175875 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr10" "glr-regression.at:874"
   175876 ( $at_check_trace;  $PREPARSER ./glr-regr10
   175877 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175878 at_status=$? at_failed=false
   175879 $at_check_filter
   175880 echo stderr:; tee stderr <"$at_stderr"
   175881 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175882 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:874"
   175883 $at_failed && at_fn_log_failure
   175884 $at_traceon; }
   175885 
   175886 { set +x
   175887 $as_echo "$at_srcdir/glr-regression.at:874: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   175888 at_fn_check_prepare_trace "glr-regression.at:874"
   175889 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   175890 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175891 at_status=$? at_failed=false
   175892 $at_check_filter
   175893 at_fn_diff_devnull "$at_stderr" || at_failed=:
   175894 at_fn_diff_devnull "$at_stdout" || at_failed=:
   175895 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:874"
   175896 $at_failed && at_fn_log_failure
   175897 $at_traceon; }
   175898 
   175899 
   175900 
   175901   set +x
   175902   $at_times_p && times >"$at_times_file"
   175903 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   175904 read at_status <"$at_status_file"
   175905 #AT_STOP_340
   175906 #AT_START_341
   175907 at_fn_group_banner 341 'glr-regression.at:883' \
   175908   "Undesirable destructors if user action cuts parse" "" 22
   175909 at_xfail=no
   175910 (
   175911   $as_echo "341. $at_setup_line: testing $at_desc ..."
   175912   $at_traceon
   175913 
   175914 
   175915 
   175916 cat >glr-regr11.y <<'_ATEOF'
   175917 %code top {
   175918 #include <config.h>
   175919 /* We don't need perfect functions for these tests. */
   175920 #undef malloc
   175921 #undef memcmp
   175922 #undef realloc
   175923 }
   175924 
   175925 
   175926 %{
   175927 # include <stdlib.h>
   175928   static void yyerror ( const char *msg);
   175929   static int yylex (void);
   175930   static int destructors = 0;
   175931 # define USE(val)
   175932 %}
   175933 
   175934 %glr-parser
   175935 %union { int dummy; }
   175936 %type <int> 'a'
   175937 %destructor { destructors += 1; } 'a'
   175938 
   175939 %%
   175940 
   175941 start:
   175942     'a' %dprec 2 { USE ($1); destructors += 1; YYACCEPT; }
   175943   | 'a' %dprec 1 { USE ($1); destructors += 1; YYACCEPT; }
   175944   ;
   175945 
   175946 %%
   175947 
   175948 #include <stdio.h>
   175949 /* A C error reporting function.  */
   175950 static
   175951 void yyerror ( const char *msg)
   175952 {
   175953   fprintf (stderr, "%s\n", msg);
   175954 }
   175955 #include <assert.h>
   175956 static
   175957 int yylex (void)
   175958 {
   175959   static char const input[] = "a";
   175960   static size_t toknum = 0;
   175961   int res;
   175962   ;
   175963   assert (toknum < sizeof input / sizeof input[0]);
   175964   res = input[toknum++];
   175965   ;
   175966   return res;
   175967 }
   175968 
   175969 int
   175970 main (void)
   175971 {
   175972   int exit_status = yyparse ();
   175973   if (destructors != 1)
   175974     {
   175975       fprintf (stderr, "Destructor calls: %d\n", destructors);
   175976       return 1;
   175977     }
   175978   return exit_status;
   175979 }
   175980 _ATEOF
   175981 
   175982 
   175983 
   175984 
   175985 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   175986   at_save_special_files
   175987   mkdir xml-tests
   175988     # Don't combine these Bison invocations since we want to be sure that
   175989   # --report=all isn't required to get the full XML file.
   175990   { set +x
   175991 $as_echo "$at_srcdir/glr-regression.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   175992                   --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y"
   175993 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:927"
   175994 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   175995                   --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y
   175996 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   175997 at_status=$? at_failed=false
   175998 $at_check_filter
   175999 echo stderr:; cat "$at_stderr"
   176000 echo stdout:; cat "$at_stdout"
   176001 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927"
   176002 $at_failed && at_fn_log_failure
   176003 $at_traceon; }
   176004 
   176005   { set +x
   176006 $as_echo "$at_srcdir/glr-regression.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y"
   176007 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" "glr-regression.at:927"
   176008 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y
   176009 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176010 at_status=$? at_failed=false
   176011 $at_check_filter
   176012 echo stderr:; cat "$at_stderr"
   176013 echo stdout:; cat "$at_stdout"
   176014 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927"
   176015 $at_failed && at_fn_log_failure
   176016 $at_traceon; }
   176017 
   176018     cp xml-tests/test.output expout
   176019   { set +x
   176020 $as_echo "$at_srcdir/glr-regression.at:927: \$XSLTPROC \\
   176021              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   176022              xml-tests/test.xml"
   176023 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:927"
   176024 ( $at_check_trace; $XSLTPROC \
   176025              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   176026              xml-tests/test.xml
   176027 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176028 at_status=$? at_failed=false
   176029 $at_check_filter
   176030 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176031 $at_diff expout "$at_stdout" || at_failed=:
   176032 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927"
   176033 $at_failed && at_fn_log_failure
   176034 $at_traceon; }
   176035 
   176036   sort xml-tests/test.dot > expout
   176037   { set +x
   176038 $as_echo "$at_srcdir/glr-regression.at:927: \$XSLTPROC \\
   176039              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   176040              xml-tests/test.xml | sort"
   176041 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:927"
   176042 ( $at_check_trace; $XSLTPROC \
   176043              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   176044              xml-tests/test.xml | sort
   176045 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176046 at_status=$? at_failed=false
   176047 $at_check_filter
   176048 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176049 $at_diff expout "$at_stdout" || at_failed=:
   176050 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927"
   176051 $at_failed && at_fn_log_failure
   176052 $at_traceon; }
   176053 
   176054   rm -rf xml-tests expout
   176055   at_restore_special_files
   176056 fi
   176057 { set +x
   176058 $as_echo "$at_srcdir/glr-regression.at:927: bison -o glr-regr11.c glr-regr11.y"
   176059 at_fn_check_prepare_trace "glr-regression.at:927"
   176060 ( $at_check_trace; bison -o glr-regr11.c glr-regr11.y
   176061 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176062 at_status=$? at_failed=false
   176063 $at_check_filter
   176064 echo >>"$at_stderr"; $as_echo "glr-regr11.y: conflicts: 1 reduce/reduce
   176065 " | \
   176066   $at_diff - "$at_stderr" || at_failed=:
   176067 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176068 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:927"
   176069 $at_failed && at_fn_log_failure
   176070 $at_traceon; }
   176071 
   176072 
   176073 { set +x
   176074 $as_echo "$at_srcdir/glr-regression.at:930: \$BISON_C_WORKS"
   176075 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:930"
   176076 ( $at_check_trace; $BISON_C_WORKS
   176077 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176078 at_status=$? at_failed=false
   176079 $at_check_filter
   176080 echo stderr:; cat "$at_stderr"
   176081 echo stdout:; cat "$at_stdout"
   176082 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:930"
   176083 $at_failed && at_fn_log_failure
   176084 $at_traceon; }
   176085 
   176086 { set +x
   176087 $as_echo "$at_srcdir/glr-regression.at:930: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr11 glr-regr11.c \$LIBS"
   176088 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS" "glr-regression.at:930"
   176089 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS
   176090 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176091 at_status=$? at_failed=false
   176092 $at_check_filter
   176093 echo stderr:; cat "$at_stderr"
   176094 echo stdout:; cat "$at_stdout"
   176095 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:930"
   176096 $at_failed && at_fn_log_failure
   176097 $at_traceon; }
   176098 
   176099 
   176100 { set +x
   176101 $as_echo "$at_srcdir/glr-regression.at:932:  \$PREPARSER ./glr-regr11"
   176102 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:932"
   176103 ( $at_check_trace;  $PREPARSER ./glr-regr11
   176104 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176105 at_status=$? at_failed=false
   176106 $at_check_filter
   176107 echo stderr:; tee stderr <"$at_stderr"
   176108 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176109 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:932"
   176110 $at_failed && at_fn_log_failure
   176111 $at_traceon; }
   176112 
   176113 { set +x
   176114 $as_echo "$at_srcdir/glr-regression.at:932: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   176115 at_fn_check_prepare_trace "glr-regression.at:932"
   176116 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   176117 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176118 at_status=$? at_failed=false
   176119 $at_check_filter
   176120 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176121 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176122 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:932"
   176123 $at_failed && at_fn_log_failure
   176124 $at_traceon; }
   176125 
   176126 
   176127 
   176128   set +x
   176129   $at_times_p && times >"$at_times_file"
   176130 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   176131 read at_status <"$at_status_file"
   176132 #AT_STOP_341
   176133 #AT_START_342
   176134 at_fn_group_banner 342 'glr-regression.at:941' \
   176135   "Leaked semantic values if user action cuts parse" "" 22
   176136 at_xfail=no
   176137 (
   176138   $as_echo "342. $at_setup_line: testing $at_desc ..."
   176139   $at_traceon
   176140 
   176141 
   176142 
   176143 cat >glr-regr12.y <<'_ATEOF'
   176144 %code top {
   176145 #include <config.h>
   176146 /* We don't need perfect functions for these tests. */
   176147 #undef malloc
   176148 #undef memcmp
   176149 #undef realloc
   176150 }
   176151 
   176152 
   176153 %glr-parser
   176154 %union { int dummy; }
   176155 %token PARENT_RHS_AFTER
   176156 %type <dummy> parent_rhs_before merged PARENT_RHS_AFTER
   176157 %destructor { parent_rhs_before_value = 0; } parent_rhs_before
   176158 %destructor { merged_value = 0; } merged
   176159 %destructor { parent_rhs_after_value = 0; } PARENT_RHS_AFTER
   176160 
   176161 %{
   176162 # include <stdlib.h>
   176163 # include <assert.h>
   176164   static int merge (YYSTYPE, YYSTYPE);
   176165   static void yyerror ( const char *msg);
   176166   static int yylex (void);
   176167   static int parent_rhs_before_value = 0;
   176168   static int merged_value = 0;
   176169   static int parent_rhs_after_value = 0;
   176170 # define USE(val)
   176171 %}
   176172 
   176173 %%
   176174 
   176175 start:
   176176   alt1 %dprec 1
   176177   | alt2 %dprec 2
   176178   ;
   176179 
   176180 alt1:
   176181   PARENT_RHS_AFTER {
   176182     USE ($1);
   176183     parent_rhs_after_value = 0;
   176184   }
   176185   ;
   176186 
   176187 alt2:
   176188   parent_rhs_before merged PARENT_RHS_AFTER {
   176189     USE (($1, $2, $3));
   176190     parent_rhs_before_value = 0;
   176191     merged_value = 0;
   176192     parent_rhs_after_value = 0;
   176193   }
   176194   ;
   176195 
   176196 parent_rhs_before:
   176197   {
   176198     USE ($$);
   176199     parent_rhs_before_value = 1;
   176200   }
   176201   ;
   176202 
   176203 merged:
   176204   %merge<merge> {
   176205     USE ($$);
   176206     merged_value = 1;
   176207   }
   176208   | cut %merge<merge> {
   176209     USE ($$);
   176210     merged_value = 1;
   176211   }
   176212   ;
   176213 
   176214 cut: { YYACCEPT; } ;
   176215 
   176216 %%
   176217 
   176218 static int
   176219 merge (YYSTYPE s1, YYSTYPE s2)
   176220 {
   176221   /* Not invoked. */
   176222   char dummy = s1.dummy + s2.dummy;
   176223   return dummy;
   176224 }
   176225 
   176226 #include <stdio.h>
   176227 /* A C error reporting function.  */
   176228 static
   176229 void yyerror ( const char *msg)
   176230 {
   176231   fprintf (stderr, "%s\n", msg);
   176232 }
   176233 #include <assert.h>
   176234 static
   176235 int yylex (void)
   176236 {
   176237   static int const input[] = { PARENT_RHS_AFTER, 0 };
   176238   static size_t toknum = 0;
   176239   int res;
   176240   ;
   176241   assert (toknum < sizeof input / sizeof input[0]);
   176242   res = input[toknum++];
   176243   if (res == PARENT_RHS_AFTER)
   176244     parent_rhs_after_value = 1;;
   176245   return res;
   176246 }
   176247 
   176248 int
   176249 main (void)
   176250 {
   176251   int exit_status = yyparse ();
   176252   if (parent_rhs_before_value)
   176253     {
   176254       fprintf (stderr, "`parent_rhs_before' destructor not called.\n");
   176255       exit_status = 1;
   176256     }
   176257   if (merged_value)
   176258     {
   176259       fprintf (stderr, "`merged' destructor not called.\n");
   176260       exit_status = 1;
   176261     }
   176262   if (parent_rhs_after_value)
   176263     {
   176264       fprintf (stderr, "`PARENT_RHS_AFTER' destructor not called.\n");
   176265       exit_status = 1;
   176266     }
   176267   return exit_status;
   176268 }
   176269 _ATEOF
   176270 
   176271 
   176272 
   176273 
   176274 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   176275   at_save_special_files
   176276   mkdir xml-tests
   176277     # Don't combine these Bison invocations since we want to be sure that
   176278   # --report=all isn't required to get the full XML file.
   176279   { set +x
   176280 $as_echo "$at_srcdir/glr-regression.at:1048: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   176281                   --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y"
   176282 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1048"
   176283 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   176284                   --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y
   176285 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176286 at_status=$? at_failed=false
   176287 $at_check_filter
   176288 echo stderr:; cat "$at_stderr"
   176289 echo stdout:; cat "$at_stdout"
   176290 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048"
   176291 $at_failed && at_fn_log_failure
   176292 $at_traceon; }
   176293 
   176294   { set +x
   176295 $as_echo "$at_srcdir/glr-regression.at:1048: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y"
   176296 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" "glr-regression.at:1048"
   176297 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y
   176298 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176299 at_status=$? at_failed=false
   176300 $at_check_filter
   176301 echo stderr:; cat "$at_stderr"
   176302 echo stdout:; cat "$at_stdout"
   176303 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048"
   176304 $at_failed && at_fn_log_failure
   176305 $at_traceon; }
   176306 
   176307     cp xml-tests/test.output expout
   176308   { set +x
   176309 $as_echo "$at_srcdir/glr-regression.at:1048: \$XSLTPROC \\
   176310              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   176311              xml-tests/test.xml"
   176312 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1048"
   176313 ( $at_check_trace; $XSLTPROC \
   176314              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   176315              xml-tests/test.xml
   176316 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176317 at_status=$? at_failed=false
   176318 $at_check_filter
   176319 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176320 $at_diff expout "$at_stdout" || at_failed=:
   176321 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048"
   176322 $at_failed && at_fn_log_failure
   176323 $at_traceon; }
   176324 
   176325   sort xml-tests/test.dot > expout
   176326   { set +x
   176327 $as_echo "$at_srcdir/glr-regression.at:1048: \$XSLTPROC \\
   176328              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   176329              xml-tests/test.xml | sort"
   176330 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1048"
   176331 ( $at_check_trace; $XSLTPROC \
   176332              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   176333              xml-tests/test.xml | sort
   176334 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176335 at_status=$? at_failed=false
   176336 $at_check_filter
   176337 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176338 $at_diff expout "$at_stdout" || at_failed=:
   176339 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048"
   176340 $at_failed && at_fn_log_failure
   176341 $at_traceon; }
   176342 
   176343   rm -rf xml-tests expout
   176344   at_restore_special_files
   176345 fi
   176346 { set +x
   176347 $as_echo "$at_srcdir/glr-regression.at:1048: bison -o glr-regr12.c glr-regr12.y"
   176348 at_fn_check_prepare_trace "glr-regression.at:1048"
   176349 ( $at_check_trace; bison -o glr-regr12.c glr-regr12.y
   176350 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176351 at_status=$? at_failed=false
   176352 $at_check_filter
   176353 echo >>"$at_stderr"; $as_echo "glr-regr12.y: conflicts: 1 shift/reduce, 1 reduce/reduce
   176354 " | \
   176355   $at_diff - "$at_stderr" || at_failed=:
   176356 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176357 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1048"
   176358 $at_failed && at_fn_log_failure
   176359 $at_traceon; }
   176360 
   176361 
   176362 { set +x
   176363 $as_echo "$at_srcdir/glr-regression.at:1051: \$BISON_C_WORKS"
   176364 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1051"
   176365 ( $at_check_trace; $BISON_C_WORKS
   176366 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176367 at_status=$? at_failed=false
   176368 $at_check_filter
   176369 echo stderr:; cat "$at_stderr"
   176370 echo stdout:; cat "$at_stdout"
   176371 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1051"
   176372 $at_failed && at_fn_log_failure
   176373 $at_traceon; }
   176374 
   176375 { set +x
   176376 $as_echo "$at_srcdir/glr-regression.at:1051: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr12 glr-regr12.c \$LIBS"
   176377 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS" "glr-regression.at:1051"
   176378 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS
   176379 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176380 at_status=$? at_failed=false
   176381 $at_check_filter
   176382 echo stderr:; cat "$at_stderr"
   176383 echo stdout:; cat "$at_stdout"
   176384 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1051"
   176385 $at_failed && at_fn_log_failure
   176386 $at_traceon; }
   176387 
   176388 
   176389 { set +x
   176390 $as_echo "$at_srcdir/glr-regression.at:1053:  \$PREPARSER ./glr-regr12"
   176391 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1053"
   176392 ( $at_check_trace;  $PREPARSER ./glr-regr12
   176393 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176394 at_status=$? at_failed=false
   176395 $at_check_filter
   176396 echo stderr:; tee stderr <"$at_stderr"
   176397 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176398 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1053"
   176399 $at_failed && at_fn_log_failure
   176400 $at_traceon; }
   176401 
   176402 { set +x
   176403 $as_echo "$at_srcdir/glr-regression.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   176404 at_fn_check_prepare_trace "glr-regression.at:1053"
   176405 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   176406 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176407 at_status=$? at_failed=false
   176408 $at_check_filter
   176409 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176410 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176411 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1053"
   176412 $at_failed && at_fn_log_failure
   176413 $at_traceon; }
   176414 
   176415 
   176416 
   176417   set +x
   176418   $at_times_p && times >"$at_times_file"
   176419 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   176420 read at_status <"$at_status_file"
   176421 #AT_STOP_342
   176422 #AT_START_343
   176423 at_fn_group_banner 343 'glr-regression.at:1064' \
   176424   "Incorrect lookahead during deterministic GLR" "   " 22
   176425 at_xfail=no
   176426 (
   176427   $as_echo "343. $at_setup_line: testing $at_desc ..."
   176428   $at_traceon
   176429 
   176430 
   176431 
   176432 cat >glr-regr13.y <<'_ATEOF'
   176433 %code top {
   176434 #include <config.h>
   176435 /* We don't need perfect functions for these tests. */
   176436 #undef malloc
   176437 #undef memcmp
   176438 #undef realloc
   176439 }
   176440 
   176441 
   176442 /* Tests:
   176443      - Defaulted state with initial yychar: yychar == YYEMPTY.
   176444      - Nondefaulted state: yychar != YYEMPTY.
   176445      - Defaulted state after lookahead: yychar != YYEMPTY.
   176446      - Defaulted state after shift: yychar == YYEMPTY.
   176447      - User action changing the lookahead.  */
   176448 
   176449 %{
   176450   #include <stdio.h>
   176451   #include <assert.h>
   176452   static void yyerror ( const char *msg);
   176453   static int yylex (void);
   176454   static void print_lookahead (char const *);
   176455   #define USE(value)
   176456 %}
   176457 
   176458 %union { char value; }
   176459 %type <value> 'a' 'b'
   176460 %glr-parser
   176461 %locations
   176462 
   176463 %%
   176464 
   176465 start:
   176466   defstate_init defstate_shift 'b' change_lookahead 'a' {
   176467     USE ($3);
   176468     print_lookahead ("start <- defstate_init defstate_shift 'b'");
   176469   }
   176470   ;
   176471 defstate_init:
   176472   {
   176473     print_lookahead ("defstate_init <- empty string");
   176474   }
   176475   ;
   176476 defstate_shift:
   176477   nondefstate defstate_look 'a' {
   176478     USE ($3);
   176479     print_lookahead ("defstate_shift <- nondefstate defstate_look 'a'");
   176480   }
   176481   ;
   176482 defstate_look:
   176483   {
   176484     print_lookahead ("defstate_look <- empty string");
   176485   }
   176486   ;
   176487 nondefstate:
   176488   {
   176489     print_lookahead ("nondefstate <- empty string");
   176490   }
   176491   | 'b' {
   176492     USE ($1);
   176493     print_lookahead ("nondefstate <- 'b'");
   176494   }
   176495   ;
   176496 change_lookahead:
   176497   {
   176498     yychar = 'a';
   176499   }
   176500   ;
   176501 
   176502 %%
   176503 
   176504 #include <stdio.h>
   176505 /* A C error reporting function.  */
   176506 static
   176507 void yyerror ( const char *msg)
   176508 {
   176509   fprintf (stderr, "%s\n", msg);
   176510 }
   176511 #include <assert.h>
   176512 static
   176513 int yylex (void)
   176514 {
   176515   static char const input[] = "ab";
   176516   static size_t toknum = 0;
   176517   int res;
   176518   ;
   176519   assert (toknum < sizeof input / sizeof input[0]);
   176520   res = input[toknum++];
   176521   yylval.value = res + 'A' - 'a';
   176522   return res;
   176523 }
   176524 
   176525 static void
   176526 print_lookahead (char const *reduction)
   176527 {
   176528   printf ("%s:\n  yychar=", reduction);
   176529   if (yychar == YYEMPTY)
   176530     printf ("YYEMPTY");
   176531   else if (yychar == YYEOF)
   176532     printf ("YYEOF");
   176533   else
   176534     {
   176535       printf ("'%c', yylval='", yychar);
   176536       if (yylval.value > ' ')
   176537 	printf ("%c", yylval.value);
   176538       printf ("', yylloc=(%d,%d),(%d,%d)",
   176539 	      yylloc.first_line, yylloc.first_column,
   176540 	      yylloc.last_line, yylloc.last_column);
   176541     }
   176542   printf ("\n");
   176543 }
   176544 
   176545 int
   176546 main (void)
   176547 {
   176548   yychar = '#'; /* Not a token in the grammar.  */
   176549   yylval.value = '!';
   176550   return yyparse ();
   176551 }
   176552 _ATEOF
   176553 
   176554 
   176555 
   176556 
   176557 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   176558   at_save_special_files
   176559   mkdir xml-tests
   176560     # Don't combine these Bison invocations since we want to be sure that
   176561   # --report=all isn't required to get the full XML file.
   176562   { set +x
   176563 $as_echo "$at_srcdir/glr-regression.at:1165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   176564                   --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y"
   176565 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1165"
   176566 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   176567                   --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y
   176568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176569 at_status=$? at_failed=false
   176570 $at_check_filter
   176571 echo stderr:; cat "$at_stderr"
   176572 echo stdout:; cat "$at_stdout"
   176573 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165"
   176574 $at_failed && at_fn_log_failure
   176575 $at_traceon; }
   176576 
   176577   { set +x
   176578 $as_echo "$at_srcdir/glr-regression.at:1165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y"
   176579 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" "glr-regression.at:1165"
   176580 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y
   176581 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176582 at_status=$? at_failed=false
   176583 $at_check_filter
   176584 echo stderr:; cat "$at_stderr"
   176585 echo stdout:; cat "$at_stdout"
   176586 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165"
   176587 $at_failed && at_fn_log_failure
   176588 $at_traceon; }
   176589 
   176590     cp xml-tests/test.output expout
   176591   { set +x
   176592 $as_echo "$at_srcdir/glr-regression.at:1165: \$XSLTPROC \\
   176593              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   176594              xml-tests/test.xml"
   176595 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1165"
   176596 ( $at_check_trace; $XSLTPROC \
   176597              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   176598              xml-tests/test.xml
   176599 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176600 at_status=$? at_failed=false
   176601 $at_check_filter
   176602 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176603 $at_diff expout "$at_stdout" || at_failed=:
   176604 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165"
   176605 $at_failed && at_fn_log_failure
   176606 $at_traceon; }
   176607 
   176608   sort xml-tests/test.dot > expout
   176609   { set +x
   176610 $as_echo "$at_srcdir/glr-regression.at:1165: \$XSLTPROC \\
   176611              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   176612              xml-tests/test.xml | sort"
   176613 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1165"
   176614 ( $at_check_trace; $XSLTPROC \
   176615              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   176616              xml-tests/test.xml | sort
   176617 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176618 at_status=$? at_failed=false
   176619 $at_check_filter
   176620 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176621 $at_diff expout "$at_stdout" || at_failed=:
   176622 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165"
   176623 $at_failed && at_fn_log_failure
   176624 $at_traceon; }
   176625 
   176626   rm -rf xml-tests expout
   176627   at_restore_special_files
   176628 fi
   176629 { set +x
   176630 $as_echo "$at_srcdir/glr-regression.at:1165: bison -o glr-regr13.c glr-regr13.y"
   176631 at_fn_check_prepare_trace "glr-regression.at:1165"
   176632 ( $at_check_trace; bison -o glr-regr13.c glr-regr13.y
   176633 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176634 at_status=$? at_failed=false
   176635 $at_check_filter
   176636 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176637 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176638 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1165"
   176639 $at_failed && at_fn_log_failure
   176640 $at_traceon; }
   176641 
   176642 
   176643 { set +x
   176644 $as_echo "$at_srcdir/glr-regression.at:1166: \$BISON_C_WORKS"
   176645 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1166"
   176646 ( $at_check_trace; $BISON_C_WORKS
   176647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176648 at_status=$? at_failed=false
   176649 $at_check_filter
   176650 echo stderr:; cat "$at_stderr"
   176651 echo stdout:; cat "$at_stdout"
   176652 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1166"
   176653 $at_failed && at_fn_log_failure
   176654 $at_traceon; }
   176655 
   176656 { set +x
   176657 $as_echo "$at_srcdir/glr-regression.at:1166: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr13 glr-regr13.c \$LIBS"
   176658 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS" "glr-regression.at:1166"
   176659 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS
   176660 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176661 at_status=$? at_failed=false
   176662 $at_check_filter
   176663 echo stderr:; cat "$at_stderr"
   176664 echo stdout:; cat "$at_stdout"
   176665 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1166"
   176666 $at_failed && at_fn_log_failure
   176667 $at_traceon; }
   176668 
   176669 
   176670 { set +x
   176671 $as_echo "$at_srcdir/glr-regression.at:1168:  \$PREPARSER ./glr-regr13"
   176672 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr13" "glr-regression.at:1168"
   176673 ( $at_check_trace;  $PREPARSER ./glr-regr13
   176674 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176675 at_status=$? at_failed=false
   176676 $at_check_filter
   176677 echo stderr:; tee stderr <"$at_stderr"
   176678 echo >>"$at_stdout"; $as_echo "defstate_init <- empty string:
   176679   yychar=YYEMPTY
   176680 nondefstate <- empty string:
   176681   yychar='a', yylval='A', yylloc=(1,1),(1,1)
   176682 defstate_look <- empty string:
   176683   yychar='a', yylval='A', yylloc=(1,1),(1,1)
   176684 defstate_shift <- nondefstate defstate_look 'a':
   176685   yychar=YYEMPTY
   176686 start <- defstate_init defstate_shift 'b':
   176687   yychar=YYEMPTY
   176688 " | \
   176689   $at_diff - "$at_stdout" || at_failed=:
   176690 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1168"
   176691 $at_failed && at_fn_log_failure
   176692 $at_traceon; }
   176693 
   176694 { set +x
   176695 $as_echo "$at_srcdir/glr-regression.at:1168: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   176696 at_fn_check_prepare_trace "glr-regression.at:1168"
   176697 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   176698 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176699 at_status=$? at_failed=false
   176700 $at_check_filter
   176701 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176702 at_fn_diff_devnull "$at_stdout" || at_failed=:
   176703 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1168"
   176704 $at_failed && at_fn_log_failure
   176705 $at_traceon; }
   176706 
   176707 
   176708 
   176709   set +x
   176710   $at_times_p && times >"$at_times_file"
   176711 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   176712 read at_status <"$at_status_file"
   176713 #AT_STOP_343
   176714 #AT_START_344
   176715 at_fn_group_banner 344 'glr-regression.at:1188' \
   176716   "Incorrect lookahead during nondeterministic GLR" "" 22
   176717 at_xfail=no
   176718 (
   176719   $as_echo "344. $at_setup_line: testing $at_desc ..."
   176720   $at_traceon
   176721 
   176722 
   176723 
   176724 cat >glr-regr14.y <<'_ATEOF'
   176725 %code top {
   176726 #include <config.h>
   176727 /* We don't need perfect functions for these tests. */
   176728 #undef malloc
   176729 #undef memcmp
   176730 #undef realloc
   176731 }
   176732 
   176733 
   176734 /* Tests:
   176735      - Conflicting actions (split-off parse, which copies lookahead need,
   176736        which is necessarily yytrue) and nonconflicting actions (non-split-off
   176737        parse) for nondefaulted state: yychar != YYEMPTY.
   176738      - Merged deferred actions (lookahead need and RHS from different stack
   176739        than the target state) and nonmerged deferred actions (same stack).
   176740      - Defaulted state after lookahead: yychar != YYEMPTY.
   176741      - Defaulted state after shift: yychar == YYEMPTY.
   176742      - yychar != YYEMPTY but lookahead need is yyfalse (a previous stack has
   176743        seen the lookahead but current stack has not).
   176744      - Exceeding stack capacity (stack explosion), and thus reallocating
   176745        lookahead need array.
   176746    Note that it does not seem possible to see the initial yychar value during
   176747    nondeterministic operation since:
   176748      - In order to preserve the initial yychar, only defaulted states may be
   176749        entered.
   176750      - If only defaulted states are entered, there are no conflicts, so
   176751        nondeterministic operation does not start.  */
   176752 
   176753 %union { char value; }
   176754 
   176755 %{
   176756   #include <stdlib.h>
   176757   #include <stdio.h>
   176758   #include <assert.h>
   176759   static void yyerror ( const char *msg);
   176760   static int yylex (void);
   176761   static void print_lookahead (char const *);
   176762   static char merge (union YYSTYPE, union YYSTYPE);
   176763   #define USE(value)
   176764 %}
   176765 
   176766 %type <value> 'a' 'b' 'c' 'd' stack_explosion
   176767 %glr-parser
   176768 %locations
   176769 
   176770 %%
   176771 
   176772 start:
   176773   merge 'c' stack_explosion {
   176774     USE ($2); USE ($3);
   176775     print_lookahead ("start <- merge 'c' stack_explosion");
   176776   }
   176777   ;
   176778 
   176779 /* When merging the 2 deferred actions, the lookahead needs are different.  */
   176780 merge:
   176781   nonconflict1 'a' 'b' nonconflict2 %dprec 1 {
   176782     USE ($2); USE ($3);
   176783     print_lookahead ("merge <- nonconflict1 'a' 'b' nonconflict2");
   176784   }
   176785   | conflict defstate_look 'a' nonconflict2 'b' defstate_shift %dprec 2 {
   176786     USE ($3); USE ($5);
   176787     print_lookahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'"
   176788 		      " defstate_shift");
   176789   }
   176790   ;
   176791 
   176792 nonconflict1:
   176793   {
   176794     print_lookahead ("nonconflict1 <- empty string");
   176795   }
   176796   ;
   176797 nonconflict2:
   176798   {
   176799     print_lookahead ("nonconflict2 <- empty string");
   176800   }
   176801   | 'a' {
   176802     USE ($1);
   176803     print_lookahead ("nonconflict2 <- 'a'");
   176804   }
   176805   ;
   176806 conflict:
   176807   {
   176808     print_lookahead ("conflict <- empty string");
   176809   }
   176810   ;
   176811 defstate_look:
   176812   {
   176813     print_lookahead ("defstate_look <- empty string");
   176814   }
   176815   ;
   176816 
   176817 /* yychar != YYEMPTY but lookahead need is yyfalse.  */
   176818 defstate_shift:
   176819   {
   176820     print_lookahead ("defstate_shift <- empty string");
   176821   }
   176822   ;
   176823 
   176824 stack_explosion:
   176825   { $$ = '\0'; }
   176826   | alt1 stack_explosion %merge<merge> { $$ = $2; }
   176827   | alt2 stack_explosion %merge<merge> { $$ = $2; }
   176828   | alt3 stack_explosion %merge<merge> { $$ = $2; }
   176829   ;
   176830 alt1:
   176831   'd' no_look {
   176832     USE ($1);
   176833     if (yychar != 'd' && yychar != YYEOF)
   176834       {
   176835 	fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
   176836       }
   176837   }
   176838   ;
   176839 alt2:
   176840   'd' no_look {
   176841     USE ($1);
   176842     if (yychar != 'd' && yychar != YYEOF)
   176843       {
   176844 	fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
   176845       }
   176846   }
   176847   ;
   176848 alt3:
   176849   'd' no_look {
   176850     USE ($1);
   176851     if (yychar != 'd' && yychar != YYEOF)
   176852       {
   176853 	fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
   176854       }
   176855   }
   176856   ;
   176857 no_look:
   176858   {
   176859     if (yychar != YYEMPTY)
   176860       {
   176861 	fprintf (stderr,
   176862 		 "Found lookahead where shouldn't during stack explosion.\n");
   176863       }
   176864   }
   176865   ;
   176866 
   176867 %%
   176868 
   176869 #include <stdio.h>
   176870 /* A C error reporting function.  */
   176871 static
   176872 void yyerror ( const char *msg)
   176873 {
   176874   fprintf (stderr, "%s\n", msg);
   176875 }
   176876 static int
   176877 yylex (void)
   176878 {
   176879   static char const input[] = "abcdddd";
   176880   static size_t toknum;
   176881   assert (toknum < sizeof input);
   176882   yylloc.first_line = yylloc.last_line = 1;
   176883   yylloc.first_column = yylloc.last_column = toknum + 1;
   176884   yylval.value = input[toknum] + 'A' - 'a';
   176885   return input[toknum++];
   176886 }
   176887 
   176888 static void
   176889 print_lookahead (char const *reduction)
   176890 {
   176891   printf ("%s:\n  yychar=", reduction);
   176892   if (yychar == YYEMPTY)
   176893     printf ("YYEMPTY");
   176894   else if (yychar == YYEOF)
   176895     printf ("YYEOF");
   176896   else
   176897     {
   176898       printf ("'%c', yylval='", yychar);
   176899       if (yylval.value > ' ')
   176900 	printf ("%c", yylval.value);
   176901       printf ("', yylloc=(%d,%d),(%d,%d)",
   176902 	      yylloc.first_line, yylloc.first_column,
   176903 	      yylloc.last_line, yylloc.last_column);
   176904     }
   176905   printf ("\n");
   176906 }
   176907 
   176908 static char
   176909 merge (union YYSTYPE s1, union YYSTYPE s2)
   176910 {
   176911   char dummy = s1.value + s2.value;
   176912   return dummy;
   176913 }
   176914 
   176915 int
   176916 main (void)
   176917 {
   176918   yychar = '#'; /* Not a token in the grammar.  */
   176919   yylval.value = '!';
   176920   return yyparse ();
   176921 }
   176922 _ATEOF
   176923 
   176924 
   176925 
   176926 
   176927 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   176928   at_save_special_files
   176929   mkdir xml-tests
   176930     # Don't combine these Bison invocations since we want to be sure that
   176931   # --report=all isn't required to get the full XML file.
   176932   { set +x
   176933 $as_echo "$at_srcdir/glr-regression.at:1378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   176934                   --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y"
   176935 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1378"
   176936 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   176937                   --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y
   176938 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176939 at_status=$? at_failed=false
   176940 $at_check_filter
   176941 echo stderr:; cat "$at_stderr"
   176942 echo stdout:; cat "$at_stdout"
   176943 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378"
   176944 $at_failed && at_fn_log_failure
   176945 $at_traceon; }
   176946 
   176947   { set +x
   176948 $as_echo "$at_srcdir/glr-regression.at:1378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y"
   176949 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" "glr-regression.at:1378"
   176950 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y
   176951 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176952 at_status=$? at_failed=false
   176953 $at_check_filter
   176954 echo stderr:; cat "$at_stderr"
   176955 echo stdout:; cat "$at_stdout"
   176956 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378"
   176957 $at_failed && at_fn_log_failure
   176958 $at_traceon; }
   176959 
   176960     cp xml-tests/test.output expout
   176961   { set +x
   176962 $as_echo "$at_srcdir/glr-regression.at:1378: \$XSLTPROC \\
   176963              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   176964              xml-tests/test.xml"
   176965 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1378"
   176966 ( $at_check_trace; $XSLTPROC \
   176967              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   176968              xml-tests/test.xml
   176969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176970 at_status=$? at_failed=false
   176971 $at_check_filter
   176972 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176973 $at_diff expout "$at_stdout" || at_failed=:
   176974 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378"
   176975 $at_failed && at_fn_log_failure
   176976 $at_traceon; }
   176977 
   176978   sort xml-tests/test.dot > expout
   176979   { set +x
   176980 $as_echo "$at_srcdir/glr-regression.at:1378: \$XSLTPROC \\
   176981              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   176982              xml-tests/test.xml | sort"
   176983 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1378"
   176984 ( $at_check_trace; $XSLTPROC \
   176985              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   176986              xml-tests/test.xml | sort
   176987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   176988 at_status=$? at_failed=false
   176989 $at_check_filter
   176990 at_fn_diff_devnull "$at_stderr" || at_failed=:
   176991 $at_diff expout "$at_stdout" || at_failed=:
   176992 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378"
   176993 $at_failed && at_fn_log_failure
   176994 $at_traceon; }
   176995 
   176996   rm -rf xml-tests expout
   176997   at_restore_special_files
   176998 fi
   176999 { set +x
   177000 $as_echo "$at_srcdir/glr-regression.at:1378: bison -o glr-regr14.c glr-regr14.y"
   177001 at_fn_check_prepare_trace "glr-regression.at:1378"
   177002 ( $at_check_trace; bison -o glr-regr14.c glr-regr14.y
   177003 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177004 at_status=$? at_failed=false
   177005 $at_check_filter
   177006 echo >>"$at_stderr"; $as_echo "glr-regr14.y: conflicts: 3 reduce/reduce
   177007 " | \
   177008   $at_diff - "$at_stderr" || at_failed=:
   177009 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177010 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1378"
   177011 $at_failed && at_fn_log_failure
   177012 $at_traceon; }
   177013 
   177014 
   177015 { set +x
   177016 $as_echo "$at_srcdir/glr-regression.at:1381: \$BISON_C_WORKS"
   177017 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1381"
   177018 ( $at_check_trace; $BISON_C_WORKS
   177019 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177020 at_status=$? at_failed=false
   177021 $at_check_filter
   177022 echo stderr:; cat "$at_stderr"
   177023 echo stdout:; cat "$at_stdout"
   177024 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1381"
   177025 $at_failed && at_fn_log_failure
   177026 $at_traceon; }
   177027 
   177028 { set +x
   177029 $as_echo "$at_srcdir/glr-regression.at:1381: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr14 glr-regr14.c \$LIBS"
   177030 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS" "glr-regression.at:1381"
   177031 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS
   177032 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177033 at_status=$? at_failed=false
   177034 $at_check_filter
   177035 echo stderr:; cat "$at_stderr"
   177036 echo stdout:; cat "$at_stdout"
   177037 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1381"
   177038 $at_failed && at_fn_log_failure
   177039 $at_traceon; }
   177040 
   177041 
   177042 { set +x
   177043 $as_echo "$at_srcdir/glr-regression.at:1383:  \$PREPARSER ./glr-regr14"
   177044 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1383"
   177045 ( $at_check_trace;  $PREPARSER ./glr-regr14
   177046 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177047 at_status=$? at_failed=false
   177048 $at_check_filter
   177049 echo stderr:; tee stderr <"$at_stderr"
   177050 echo >>"$at_stdout"; $as_echo "conflict <- empty string:
   177051   yychar='a', yylval='A', yylloc=(1,1),(1,1)
   177052 defstate_look <- empty string:
   177053   yychar='a', yylval='A', yylloc=(1,1),(1,1)
   177054 nonconflict2 <- empty string:
   177055   yychar='b', yylval='B', yylloc=(1,2),(1,2)
   177056 defstate_shift <- empty string:
   177057   yychar=YYEMPTY
   177058 merge <- conflict defstate_look 'a' nonconflict2 'b' defstate_shift:
   177059   yychar=YYEMPTY
   177060 start <- merge 'c' stack_explosion:
   177061   yychar=YYEOF
   177062 " | \
   177063   $at_diff - "$at_stdout" || at_failed=:
   177064 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1383"
   177065 $at_failed && at_fn_log_failure
   177066 $at_traceon; }
   177067 
   177068 { set +x
   177069 $as_echo "$at_srcdir/glr-regression.at:1383: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   177070 at_fn_check_prepare_trace "glr-regression.at:1383"
   177071 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   177072 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177073 at_status=$? at_failed=false
   177074 $at_check_filter
   177075 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177076 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177077 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1383"
   177078 $at_failed && at_fn_log_failure
   177079 $at_traceon; }
   177080 
   177081 
   177082 
   177083   set +x
   177084   $at_times_p && times >"$at_times_file"
   177085 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   177086 read at_status <"$at_status_file"
   177087 #AT_STOP_344
   177088 #AT_START_345
   177089 at_fn_group_banner 345 'glr-regression.at:1405' \
   177090   "Leaked semantic values when reporting ambiguity" "" 22
   177091 at_xfail=no
   177092 (
   177093   $as_echo "345. $at_setup_line: testing $at_desc ..."
   177094   $at_traceon
   177095 
   177096 
   177097 
   177098 cat >glr-regr15.y <<'_ATEOF'
   177099 %code top {
   177100 #include <config.h>
   177101 /* We don't need perfect functions for these tests. */
   177102 #undef malloc
   177103 #undef memcmp
   177104 #undef realloc
   177105 }
   177106 
   177107 
   177108 %glr-parser
   177109 %destructor { parent_rhs_before_value = 0; } parent_rhs_before
   177110 
   177111 %{
   177112 # include <stdlib.h>
   177113   static void yyerror ( const char *msg);
   177114   static int yylex (void);
   177115   static int parent_rhs_before_value = 0;
   177116 # define USE(val)
   177117 %}
   177118 
   177119 %%
   177120 
   177121 start:
   177122   alt1 %dprec 1
   177123   | alt2 %dprec 2
   177124   ;
   177125 
   177126 /* This stack must be merged into the other stacks *last* (added at the
   177127    beginning of the semantic options list) so that yyparse will choose to clean
   177128    it up rather than the tree for which some semantic actions have been
   177129    performed.  Thus, if yyreportAmbiguity longjmp's to yyparse, the values from
   177130    those other trees are not cleaned up.  */
   177131 alt1: ;
   177132 
   177133 alt2:
   177134   parent_rhs_before ambiguity {
   177135     USE ($1);
   177136     parent_rhs_before_value = 0;
   177137   }
   177138   ;
   177139 
   177140 parent_rhs_before:
   177141   {
   177142     USE ($$);
   177143     parent_rhs_before_value = 1;
   177144   }
   177145   ;
   177146 
   177147 ambiguity: ambiguity1 | ambiguity2 ;
   177148 ambiguity1: ;
   177149 ambiguity2: ;
   177150 
   177151 %%
   177152 #include <stdio.h>
   177153 /* A C error reporting function.  */
   177154 static
   177155 void yyerror ( const char *msg)
   177156 {
   177157   fprintf (stderr, "%s\n", msg);
   177158 }
   177159 #include <assert.h>
   177160 static
   177161 int yylex (void)
   177162 {
   177163   static char const input[] = "";
   177164   static size_t toknum = 0;
   177165   int res;
   177166   ;
   177167   assert (toknum < sizeof input / sizeof input[0]);
   177168   res = input[toknum++];
   177169   ;
   177170   return res;
   177171 }
   177172 
   177173 int
   177174 main (void)
   177175 {
   177176   int exit_status = yyparse () != 1;
   177177   if (parent_rhs_before_value)
   177178     {
   177179       fprintf (stderr, "`parent_rhs_before' destructor not called.\n");
   177180       exit_status = 1;
   177181     }
   177182   return exit_status;
   177183 }
   177184 _ATEOF
   177185 
   177186 
   177187 
   177188 
   177189 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   177190   at_save_special_files
   177191   mkdir xml-tests
   177192     # Don't combine these Bison invocations since we want to be sure that
   177193   # --report=all isn't required to get the full XML file.
   177194   { set +x
   177195 $as_echo "$at_srcdir/glr-regression.at:1471: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   177196                   --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y"
   177197 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1471"
   177198 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   177199                   --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y
   177200 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177201 at_status=$? at_failed=false
   177202 $at_check_filter
   177203 echo stderr:; cat "$at_stderr"
   177204 echo stdout:; cat "$at_stdout"
   177205 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471"
   177206 $at_failed && at_fn_log_failure
   177207 $at_traceon; }
   177208 
   177209   { set +x
   177210 $as_echo "$at_srcdir/glr-regression.at:1471: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y"
   177211 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" "glr-regression.at:1471"
   177212 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y
   177213 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177214 at_status=$? at_failed=false
   177215 $at_check_filter
   177216 echo stderr:; cat "$at_stderr"
   177217 echo stdout:; cat "$at_stdout"
   177218 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471"
   177219 $at_failed && at_fn_log_failure
   177220 $at_traceon; }
   177221 
   177222     cp xml-tests/test.output expout
   177223   { set +x
   177224 $as_echo "$at_srcdir/glr-regression.at:1471: \$XSLTPROC \\
   177225              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   177226              xml-tests/test.xml"
   177227 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1471"
   177228 ( $at_check_trace; $XSLTPROC \
   177229              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   177230              xml-tests/test.xml
   177231 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177232 at_status=$? at_failed=false
   177233 $at_check_filter
   177234 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177235 $at_diff expout "$at_stdout" || at_failed=:
   177236 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471"
   177237 $at_failed && at_fn_log_failure
   177238 $at_traceon; }
   177239 
   177240   sort xml-tests/test.dot > expout
   177241   { set +x
   177242 $as_echo "$at_srcdir/glr-regression.at:1471: \$XSLTPROC \\
   177243              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   177244              xml-tests/test.xml | sort"
   177245 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1471"
   177246 ( $at_check_trace; $XSLTPROC \
   177247              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   177248              xml-tests/test.xml | sort
   177249 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177250 at_status=$? at_failed=false
   177251 $at_check_filter
   177252 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177253 $at_diff expout "$at_stdout" || at_failed=:
   177254 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471"
   177255 $at_failed && at_fn_log_failure
   177256 $at_traceon; }
   177257 
   177258   rm -rf xml-tests expout
   177259   at_restore_special_files
   177260 fi
   177261 { set +x
   177262 $as_echo "$at_srcdir/glr-regression.at:1471: bison -o glr-regr15.c glr-regr15.y"
   177263 at_fn_check_prepare_trace "glr-regression.at:1471"
   177264 ( $at_check_trace; bison -o glr-regr15.c glr-regr15.y
   177265 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177266 at_status=$? at_failed=false
   177267 $at_check_filter
   177268 echo >>"$at_stderr"; $as_echo "glr-regr15.y: conflicts: 2 reduce/reduce
   177269 " | \
   177270   $at_diff - "$at_stderr" || at_failed=:
   177271 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177272 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1471"
   177273 $at_failed && at_fn_log_failure
   177274 $at_traceon; }
   177275 
   177276 
   177277 { set +x
   177278 $as_echo "$at_srcdir/glr-regression.at:1474: \$BISON_C_WORKS"
   177279 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1474"
   177280 ( $at_check_trace; $BISON_C_WORKS
   177281 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177282 at_status=$? at_failed=false
   177283 $at_check_filter
   177284 echo stderr:; cat "$at_stderr"
   177285 echo stdout:; cat "$at_stdout"
   177286 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1474"
   177287 $at_failed && at_fn_log_failure
   177288 $at_traceon; }
   177289 
   177290 { set +x
   177291 $as_echo "$at_srcdir/glr-regression.at:1474: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr15 glr-regr15.c \$LIBS"
   177292 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS" "glr-regression.at:1474"
   177293 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS
   177294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177295 at_status=$? at_failed=false
   177296 $at_check_filter
   177297 echo stderr:; cat "$at_stderr"
   177298 echo stdout:; cat "$at_stdout"
   177299 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1474"
   177300 $at_failed && at_fn_log_failure
   177301 $at_traceon; }
   177302 
   177303 
   177304 { set +x
   177305 $as_echo "$at_srcdir/glr-regression.at:1476:  \$PREPARSER ./glr-regr15"
   177306 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1476"
   177307 ( $at_check_trace;  $PREPARSER ./glr-regr15
   177308 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177309 at_status=$? at_failed=false
   177310 $at_check_filter
   177311 echo stderr:; tee stderr <"$at_stderr"
   177312 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177313 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1476"
   177314 $at_failed && at_fn_log_failure
   177315 $at_traceon; }
   177316 
   177317 { set +x
   177318 $as_echo "$at_srcdir/glr-regression.at:1476: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   177319 at_fn_check_prepare_trace "glr-regression.at:1476"
   177320 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   177321 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177322 at_status=$? at_failed=false
   177323 $at_check_filter
   177324 echo >>"$at_stderr"; $as_echo "syntax is ambiguous
   177325 " | \
   177326   $at_diff - "$at_stderr" || at_failed=:
   177327 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177328 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1476"
   177329 $at_failed && at_fn_log_failure
   177330 $at_traceon; }
   177331 
   177332 
   177333 
   177334   set +x
   177335   $at_times_p && times >"$at_times_file"
   177336 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   177337 read at_status <"$at_status_file"
   177338 #AT_STOP_345
   177339 #AT_START_346
   177340 at_fn_group_banner 346 'glr-regression.at:1487' \
   177341   "Leaked lookahead after nondeterministic parse syntax error" "" 22
   177342 at_xfail=no
   177343 (
   177344   $as_echo "346. $at_setup_line: testing $at_desc ..."
   177345   $at_traceon
   177346 
   177347 
   177348 
   177349 cat >glr-regr16.y <<'_ATEOF'
   177350 %code top {
   177351 #include <config.h>
   177352 /* We don't need perfect functions for these tests. */
   177353 #undef malloc
   177354 #undef memcmp
   177355 #undef realloc
   177356 }
   177357 
   177358 
   177359 %glr-parser
   177360 %destructor { lookahead_value = 0; } 'b'
   177361 
   177362 %{
   177363 # include <stdlib.h>
   177364 # include <assert.h>
   177365   static void yyerror ( const char *msg);
   177366   static int yylex (void);
   177367   static int lookahead_value = 0;
   177368 # define USE(val)
   177369 %}
   177370 
   177371 %%
   177372 
   177373 start: alt1 'a' | alt2 'a' ;
   177374 alt1: ;
   177375 alt2: ;
   177376 
   177377 %%
   177378 
   177379 #include <stdio.h>
   177380 /* A C error reporting function.  */
   177381 static
   177382 void yyerror ( const char *msg)
   177383 {
   177384   fprintf (stderr, "%s\n", msg);
   177385 }
   177386 #include <assert.h>
   177387 static
   177388 int yylex (void)
   177389 {
   177390   static char const input[] = "ab";
   177391   static size_t toknum = 0;
   177392   int res;
   177393   ;
   177394   assert (toknum < sizeof input / sizeof input[0]);
   177395   res = input[toknum++];
   177396   if (res == 'b')
   177397     lookahead_value = 1;
   177398   return res;
   177399 }
   177400 
   177401 int
   177402 main (void)
   177403 {
   177404   int exit_status = yyparse () != 1;
   177405   if (lookahead_value)
   177406     {
   177407       fprintf (stderr, "Lookahead destructor not called.\n");
   177408       exit_status = 1;
   177409     }
   177410   return exit_status;
   177411 }
   177412 _ATEOF
   177413 
   177414 
   177415 
   177416 
   177417 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   177418   at_save_special_files
   177419   mkdir xml-tests
   177420     # Don't combine these Bison invocations since we want to be sure that
   177421   # --report=all isn't required to get the full XML file.
   177422   { set +x
   177423 $as_echo "$at_srcdir/glr-regression.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   177424                   --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y"
   177425 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1531"
   177426 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   177427                   --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y
   177428 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177429 at_status=$? at_failed=false
   177430 $at_check_filter
   177431 echo stderr:; cat "$at_stderr"
   177432 echo stdout:; cat "$at_stdout"
   177433 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531"
   177434 $at_failed && at_fn_log_failure
   177435 $at_traceon; }
   177436 
   177437   { set +x
   177438 $as_echo "$at_srcdir/glr-regression.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y"
   177439 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" "glr-regression.at:1531"
   177440 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y
   177441 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177442 at_status=$? at_failed=false
   177443 $at_check_filter
   177444 echo stderr:; cat "$at_stderr"
   177445 echo stdout:; cat "$at_stdout"
   177446 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531"
   177447 $at_failed && at_fn_log_failure
   177448 $at_traceon; }
   177449 
   177450     cp xml-tests/test.output expout
   177451   { set +x
   177452 $as_echo "$at_srcdir/glr-regression.at:1531: \$XSLTPROC \\
   177453              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   177454              xml-tests/test.xml"
   177455 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1531"
   177456 ( $at_check_trace; $XSLTPROC \
   177457              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   177458              xml-tests/test.xml
   177459 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177460 at_status=$? at_failed=false
   177461 $at_check_filter
   177462 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177463 $at_diff expout "$at_stdout" || at_failed=:
   177464 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531"
   177465 $at_failed && at_fn_log_failure
   177466 $at_traceon; }
   177467 
   177468   sort xml-tests/test.dot > expout
   177469   { set +x
   177470 $as_echo "$at_srcdir/glr-regression.at:1531: \$XSLTPROC \\
   177471              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   177472              xml-tests/test.xml | sort"
   177473 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1531"
   177474 ( $at_check_trace; $XSLTPROC \
   177475              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   177476              xml-tests/test.xml | sort
   177477 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177478 at_status=$? at_failed=false
   177479 $at_check_filter
   177480 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177481 $at_diff expout "$at_stdout" || at_failed=:
   177482 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531"
   177483 $at_failed && at_fn_log_failure
   177484 $at_traceon; }
   177485 
   177486   rm -rf xml-tests expout
   177487   at_restore_special_files
   177488 fi
   177489 { set +x
   177490 $as_echo "$at_srcdir/glr-regression.at:1531: bison -o glr-regr16.c glr-regr16.y"
   177491 at_fn_check_prepare_trace "glr-regression.at:1531"
   177492 ( $at_check_trace; bison -o glr-regr16.c glr-regr16.y
   177493 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177494 at_status=$? at_failed=false
   177495 $at_check_filter
   177496 echo >>"$at_stderr"; $as_echo "glr-regr16.y: conflicts: 1 reduce/reduce
   177497 " | \
   177498   $at_diff - "$at_stderr" || at_failed=:
   177499 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177500 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1531"
   177501 $at_failed && at_fn_log_failure
   177502 $at_traceon; }
   177503 
   177504 
   177505 { set +x
   177506 $as_echo "$at_srcdir/glr-regression.at:1534: \$BISON_C_WORKS"
   177507 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1534"
   177508 ( $at_check_trace; $BISON_C_WORKS
   177509 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177510 at_status=$? at_failed=false
   177511 $at_check_filter
   177512 echo stderr:; cat "$at_stderr"
   177513 echo stdout:; cat "$at_stdout"
   177514 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1534"
   177515 $at_failed && at_fn_log_failure
   177516 $at_traceon; }
   177517 
   177518 { set +x
   177519 $as_echo "$at_srcdir/glr-regression.at:1534: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr16 glr-regr16.c \$LIBS"
   177520 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS" "glr-regression.at:1534"
   177521 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS
   177522 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177523 at_status=$? at_failed=false
   177524 $at_check_filter
   177525 echo stderr:; cat "$at_stderr"
   177526 echo stdout:; cat "$at_stdout"
   177527 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1534"
   177528 $at_failed && at_fn_log_failure
   177529 $at_traceon; }
   177530 
   177531 
   177532 { set +x
   177533 $as_echo "$at_srcdir/glr-regression.at:1536:  \$PREPARSER ./glr-regr16"
   177534 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1536"
   177535 ( $at_check_trace;  $PREPARSER ./glr-regr16
   177536 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177537 at_status=$? at_failed=false
   177538 $at_check_filter
   177539 echo stderr:; tee stderr <"$at_stderr"
   177540 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177541 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1536"
   177542 $at_failed && at_fn_log_failure
   177543 $at_traceon; }
   177544 
   177545 { set +x
   177546 $as_echo "$at_srcdir/glr-regression.at:1536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   177547 at_fn_check_prepare_trace "glr-regression.at:1536"
   177548 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   177549 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177550 at_status=$? at_failed=false
   177551 $at_check_filter
   177552 echo >>"$at_stderr"; $as_echo "syntax error
   177553 " | \
   177554   $at_diff - "$at_stderr" || at_failed=:
   177555 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177556 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1536"
   177557 $at_failed && at_fn_log_failure
   177558 $at_traceon; }
   177559 
   177560 
   177561 
   177562   set +x
   177563   $at_times_p && times >"$at_times_file"
   177564 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   177565 read at_status <"$at_status_file"
   177566 #AT_STOP_346
   177567 #AT_START_347
   177568 at_fn_group_banner 347 'glr-regression.at:1547' \
   177569   "Uninitialized location when reporting ambiguity" "" 22
   177570 at_xfail=no
   177571 (
   177572   $as_echo "347. $at_setup_line: testing $at_desc ..."
   177573   $at_traceon
   177574 
   177575 
   177576 
   177577 
   177578 cat >glr-regr17.y <<'_ATEOF'
   177579 %code top {
   177580 #include <config.h>
   177581 /* We don't need perfect functions for these tests. */
   177582 #undef malloc
   177583 #undef memcmp
   177584 #undef realloc
   177585 }
   177586 
   177587 
   177588 %glr-parser
   177589 %locations
   177590 %define api.pure
   177591 %error-verbose
   177592 
   177593 %union { int dummy; }
   177594 
   177595 %{
   177596   static void yyerror (YYLTYPE const * const llocp,  const char *msg);
   177597   static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   177598 %}
   177599 
   177600 %%
   177601 
   177602 /* Tests the case of an empty RHS that has inherited the location of the
   177603    previous nonterminal, which is unresolved.  That location is reported as the
   177604    last position of the ambiguity.  */
   177605 start: ambig1 empty1 | ambig2 empty2 ;
   177606 
   177607 /* Tests multiple levels of yyresolveLocations recursion.  */
   177608 ambig1: sub_ambig1 | sub_ambig2 ;
   177609 ambig2: sub_ambig1 | sub_ambig2 ;
   177610 
   177611 /* Tests the case of a non-empty RHS as well as the case of an empty RHS that
   177612    has inherited the initial location.  The empty RHS's location is reported as
   177613    the first position in the ambiguity.  */
   177614 sub_ambig1: empty1 'a' 'b' ;
   177615 sub_ambig2: empty2 'a' 'b' ;
   177616 empty1: ;
   177617 empty2: ;
   177618 
   177619 %%
   177620 # include <assert.h>
   177621 
   177622 #include <stdio.h>
   177623 /* A C error reporting function.  */
   177624 static
   177625 void yyerror (YYLTYPE const * const llocp,  const char *msg)
   177626 {
   177627   YY_LOCATION_PRINT (stderr, (*llocp));
   177628   fprintf (stderr, ": ");
   177629   fprintf (stderr, "%s\n", msg);
   177630 }
   177631 static int
   177632 yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   177633 {
   177634   static char const input[] = "ab";
   177635   static size_t toknum;
   177636   assert (toknum < sizeof input);
   177637   lvalp->dummy = 0;
   177638   llocp->first_line = llocp->last_line = 2;
   177639   llocp->first_column = toknum + 1;
   177640   llocp->last_column = llocp->first_column + 1;
   177641   return input[toknum++];
   177642 }
   177643 
   177644 int
   177645 main (void)
   177646 {
   177647   return yyparse () != 1;
   177648 }
   177649 _ATEOF
   177650 
   177651 
   177652 
   177653 
   177654 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   177655   at_save_special_files
   177656   mkdir xml-tests
   177657     # Don't combine these Bison invocations since we want to be sure that
   177658   # --report=all isn't required to get the full XML file.
   177659   { set +x
   177660 $as_echo "$at_srcdir/glr-regression.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   177661                   --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y"
   177662 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1609"
   177663 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   177664                   --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y
   177665 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177666 at_status=$? at_failed=false
   177667 $at_check_filter
   177668 echo stderr:; cat "$at_stderr"
   177669 echo stdout:; cat "$at_stdout"
   177670 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609"
   177671 $at_failed && at_fn_log_failure
   177672 $at_traceon; }
   177673 
   177674   { set +x
   177675 $as_echo "$at_srcdir/glr-regression.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y"
   177676 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" "glr-regression.at:1609"
   177677 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y
   177678 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177679 at_status=$? at_failed=false
   177680 $at_check_filter
   177681 echo stderr:; cat "$at_stderr"
   177682 echo stdout:; cat "$at_stdout"
   177683 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609"
   177684 $at_failed && at_fn_log_failure
   177685 $at_traceon; }
   177686 
   177687     cp xml-tests/test.output expout
   177688   { set +x
   177689 $as_echo "$at_srcdir/glr-regression.at:1609: \$XSLTPROC \\
   177690              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   177691              xml-tests/test.xml"
   177692 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1609"
   177693 ( $at_check_trace; $XSLTPROC \
   177694              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   177695              xml-tests/test.xml
   177696 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177697 at_status=$? at_failed=false
   177698 $at_check_filter
   177699 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177700 $at_diff expout "$at_stdout" || at_failed=:
   177701 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609"
   177702 $at_failed && at_fn_log_failure
   177703 $at_traceon; }
   177704 
   177705   sort xml-tests/test.dot > expout
   177706   { set +x
   177707 $as_echo "$at_srcdir/glr-regression.at:1609: \$XSLTPROC \\
   177708              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   177709              xml-tests/test.xml | sort"
   177710 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1609"
   177711 ( $at_check_trace; $XSLTPROC \
   177712              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   177713              xml-tests/test.xml | sort
   177714 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177715 at_status=$? at_failed=false
   177716 $at_check_filter
   177717 at_fn_diff_devnull "$at_stderr" || at_failed=:
   177718 $at_diff expout "$at_stdout" || at_failed=:
   177719 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609"
   177720 $at_failed && at_fn_log_failure
   177721 $at_traceon; }
   177722 
   177723   rm -rf xml-tests expout
   177724   at_restore_special_files
   177725 fi
   177726 { set +x
   177727 $as_echo "$at_srcdir/glr-regression.at:1609: bison -o glr-regr17.c glr-regr17.y"
   177728 at_fn_check_prepare_trace "glr-regression.at:1609"
   177729 ( $at_check_trace; bison -o glr-regr17.c glr-regr17.y
   177730 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177731 at_status=$? at_failed=false
   177732 $at_check_filter
   177733 echo >>"$at_stderr"; $as_echo "glr-regr17.y: conflicts: 3 reduce/reduce
   177734 " | \
   177735   $at_diff - "$at_stderr" || at_failed=:
   177736 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177737 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1609"
   177738 $at_failed && at_fn_log_failure
   177739 $at_traceon; }
   177740 
   177741 
   177742 { set +x
   177743 $as_echo "$at_srcdir/glr-regression.at:1612: \$BISON_C_WORKS"
   177744 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1612"
   177745 ( $at_check_trace; $BISON_C_WORKS
   177746 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177747 at_status=$? at_failed=false
   177748 $at_check_filter
   177749 echo stderr:; cat "$at_stderr"
   177750 echo stdout:; cat "$at_stdout"
   177751 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1612"
   177752 $at_failed && at_fn_log_failure
   177753 $at_traceon; }
   177754 
   177755 { set +x
   177756 $as_echo "$at_srcdir/glr-regression.at:1612: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr17 glr-regr17.c \$LIBS"
   177757 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS" "glr-regression.at:1612"
   177758 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS
   177759 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177760 at_status=$? at_failed=false
   177761 $at_check_filter
   177762 echo stderr:; cat "$at_stderr"
   177763 echo stdout:; cat "$at_stdout"
   177764 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1612"
   177765 $at_failed && at_fn_log_failure
   177766 $at_traceon; }
   177767 
   177768 
   177769 { set +x
   177770 $as_echo "$at_srcdir/glr-regression.at:1614:  \$PREPARSER ./glr-regr17"
   177771 at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1614"
   177772 ( $at_check_trace;  $PREPARSER ./glr-regr17
   177773 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177774 at_status=$? at_failed=false
   177775 $at_check_filter
   177776 echo stderr:; tee stderr <"$at_stderr"
   177777 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177778 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1614"
   177779 $at_failed && at_fn_log_failure
   177780 $at_traceon; }
   177781 
   177782 { set +x
   177783 $as_echo "$at_srcdir/glr-regression.at:1614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   177784 at_fn_check_prepare_trace "glr-regression.at:1614"
   177785 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   177786 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177787 at_status=$? at_failed=false
   177788 $at_check_filter
   177789 echo >>"$at_stderr"; $as_echo "1.1-2.2: syntax is ambiguous
   177790 " | \
   177791   $at_diff - "$at_stderr" || at_failed=:
   177792 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177793 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1614"
   177794 $at_failed && at_fn_log_failure
   177795 $at_traceon; }
   177796 
   177797 
   177798 
   177799   set +x
   177800   $at_times_p && times >"$at_times_file"
   177801 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   177802 read at_status <"$at_status_file"
   177803 #AT_STOP_347
   177804 #AT_START_348
   177805 at_fn_group_banner 348 'glr-regression.at:1625' \
   177806   "Missed %merge type warnings when LHS type is declared later" "" 22
   177807 at_xfail=no
   177808 (
   177809   $as_echo "348. $at_setup_line: testing $at_desc ..."
   177810   $at_traceon
   177811 
   177812 
   177813 
   177814 cat >glr-regr18.y <<'_ATEOF'
   177815 %code top {
   177816 #include <config.h>
   177817 /* We don't need perfect functions for these tests. */
   177818 #undef malloc
   177819 #undef memcmp
   177820 #undef realloc
   177821 }
   177822 
   177823 %glr-parser
   177824 
   177825 %{
   177826   #include <stdlib.h>
   177827   static void yyerror ( const char *msg);
   177828   static int yylex (void);
   177829 %}
   177830 
   177831 %union {
   177832   int type1;
   177833   int type2;
   177834   int type3;
   177835 }
   177836 
   177837 %%
   177838 
   177839 sym1: sym2 %merge<merge> { $$ = $1; } ;
   177840 sym2: sym3 %merge<merge> { $$ = $1; } ;
   177841 sym3: %merge<merge> { $$ = 0; } ;
   177842 
   177843 %type <type1> sym1;
   177844 %type <type2> sym2;
   177845 %type <type3> sym3;
   177846 
   177847 %%
   177848 #include <stdio.h>
   177849 /* A C error reporting function.  */
   177850 static
   177851 void yyerror ( const char *msg)
   177852 {
   177853   fprintf (stderr, "%s\n", msg);
   177854 }
   177855 #include <assert.h>
   177856 static
   177857 int yylex (void)
   177858 {
   177859   static char const input[] = "";
   177860   static size_t toknum = 0;
   177861   int res;
   177862   ;
   177863   assert (toknum < sizeof input / sizeof input[0]);
   177864   res = input[toknum++];
   177865   ;
   177866   return res;
   177867 }
   177868 int
   177869 main (void)
   177870 {
   177871   return yyparse ();
   177872 }
   177873 _ATEOF
   177874 
   177875 
   177876 
   177877 
   177878 
   177879 { set +x
   177880 $as_echo "$at_srcdir/glr-regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y"
   177881 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y" "glr-regression.at:1664"
   177882 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y
   177883 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177884 at_status=$? at_failed=false
   177885 $at_check_filter
   177886 echo >>"$at_stderr"; $as_echo "glr-regr18.y:26.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
   177887 glr-regr18.y:25.18-24:     previous declaration
   177888 glr-regr18.y:27.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
   177889 glr-regr18.y:26.18-24:     previous declaration
   177890 " | \
   177891   $at_diff - "$at_stderr" || at_failed=:
   177892 at_fn_diff_devnull "$at_stdout" || at_failed=:
   177893 at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1664"
   177894 $at_failed && at_fn_log_failure
   177895 $at_traceon; }
   177896 
   177897 
   177898 
   177899   set +x
   177900   $at_times_p && times >"$at_times_file"
   177901 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   177902 read at_status <"$at_status_file"
   177903 #AT_STOP_348
   177904 #AT_START_349
   177905 at_fn_group_banner 349 'glr-regression.at:1678' \
   177906   "Ambiguity reports" "                              " 22
   177907 at_xfail=no
   177908 (
   177909   $as_echo "349. $at_setup_line: testing $at_desc ..."
   177910   $at_traceon
   177911 
   177912 
   177913 
   177914 cat >input.y <<'_ATEOF'
   177915 %code top {
   177916 #include <config.h>
   177917 /* We don't need perfect functions for these tests. */
   177918 #undef malloc
   177919 #undef memcmp
   177920 #undef realloc
   177921 }
   177922 
   177923 
   177924 %{
   177925   #include <stdio.h>
   177926   #include <stdlib.h>
   177927   static void yyerror ( const char *msg);
   177928   static int yylex (void);
   177929 %}
   177930 
   177931 %debug
   177932 %glr-parser
   177933 
   177934 %%
   177935 start:
   177936   'a' b 'c' d
   177937 | 'a' b 'c' d
   177938 ;
   177939 b: 'b';
   177940 d: /* nada.  */;
   177941 %%
   177942 #include <assert.h>
   177943 static
   177944 int yylex (void)
   177945 {
   177946   static char const input[] = "abc";
   177947   static size_t toknum = 0;
   177948   int res;
   177949   ;
   177950   assert (toknum < sizeof input / sizeof input[0]);
   177951   res = input[toknum++];
   177952   ;
   177953   return res;
   177954 }
   177955 #include <stdio.h>
   177956 /* A C error reporting function.  */
   177957 static
   177958 void yyerror ( const char *msg)
   177959 {
   177960   fprintf (stderr, "%s\n", msg);
   177961 }
   177962 int
   177963 main (void)
   177964 {
   177965   yydebug = 1;
   177966   return !!yyparse ();
   177967 }
   177968 _ATEOF
   177969 
   177970 
   177971 
   177972 
   177973 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   177974   at_save_special_files
   177975   mkdir xml-tests
   177976     # Don't combine these Bison invocations since we want to be sure that
   177977   # --report=all isn't required to get the full XML file.
   177978   { set +x
   177979 $as_echo "$at_srcdir/glr-regression.at:1712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   177980                   --graph=xml-tests/test.dot -o input.c input.y"
   177981 at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1712"
   177982 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   177983                   --graph=xml-tests/test.dot -o input.c input.y
   177984 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177985 at_status=$? at_failed=false
   177986 $at_check_filter
   177987 echo stderr:; cat "$at_stderr"
   177988 echo stdout:; cat "$at_stdout"
   177989 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712"
   177990 $at_failed && at_fn_log_failure
   177991 $at_traceon; }
   177992 
   177993   { set +x
   177994 $as_echo "$at_srcdir/glr-regression.at:1712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   177995 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1712"
   177996 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   177997 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   177998 at_status=$? at_failed=false
   177999 $at_check_filter
   178000 echo stderr:; cat "$at_stderr"
   178001 echo stdout:; cat "$at_stdout"
   178002 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712"
   178003 $at_failed && at_fn_log_failure
   178004 $at_traceon; }
   178005 
   178006     cp xml-tests/test.output expout
   178007   { set +x
   178008 $as_echo "$at_srcdir/glr-regression.at:1712: \$XSLTPROC \\
   178009              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   178010              xml-tests/test.xml"
   178011 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1712"
   178012 ( $at_check_trace; $XSLTPROC \
   178013              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   178014              xml-tests/test.xml
   178015 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178016 at_status=$? at_failed=false
   178017 $at_check_filter
   178018 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178019 $at_diff expout "$at_stdout" || at_failed=:
   178020 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712"
   178021 $at_failed && at_fn_log_failure
   178022 $at_traceon; }
   178023 
   178024   sort xml-tests/test.dot > expout
   178025   { set +x
   178026 $as_echo "$at_srcdir/glr-regression.at:1712: \$XSLTPROC \\
   178027              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   178028              xml-tests/test.xml | sort"
   178029 at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1712"
   178030 ( $at_check_trace; $XSLTPROC \
   178031              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   178032              xml-tests/test.xml | sort
   178033 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178034 at_status=$? at_failed=false
   178035 $at_check_filter
   178036 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178037 $at_diff expout "$at_stdout" || at_failed=:
   178038 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712"
   178039 $at_failed && at_fn_log_failure
   178040 $at_traceon; }
   178041 
   178042   rm -rf xml-tests expout
   178043   at_restore_special_files
   178044 fi
   178045 { set +x
   178046 $as_echo "$at_srcdir/glr-regression.at:1712: bison -o input.c input.y"
   178047 at_fn_check_prepare_trace "glr-regression.at:1712"
   178048 ( $at_check_trace; bison -o input.c input.y
   178049 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178050 at_status=$? at_failed=false
   178051 $at_check_filter
   178052 echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
   178053 " | \
   178054   $at_diff - "$at_stderr" || at_failed=:
   178055 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178056 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1712"
   178057 $at_failed && at_fn_log_failure
   178058 $at_traceon; }
   178059 
   178060 
   178061 { set +x
   178062 $as_echo "$at_srcdir/glr-regression.at:1715: \$BISON_C_WORKS"
   178063 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1715"
   178064 ( $at_check_trace; $BISON_C_WORKS
   178065 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178066 at_status=$? at_failed=false
   178067 $at_check_filter
   178068 echo stderr:; cat "$at_stderr"
   178069 echo stdout:; cat "$at_stdout"
   178070 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1715"
   178071 $at_failed && at_fn_log_failure
   178072 $at_traceon; }
   178073 
   178074 { set +x
   178075 $as_echo "$at_srcdir/glr-regression.at:1715: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   178076 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "glr-regression.at:1715"
   178077 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   178078 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178079 at_status=$? at_failed=false
   178080 $at_check_filter
   178081 echo stderr:; cat "$at_stderr"
   178082 echo stdout:; cat "$at_stdout"
   178083 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1715"
   178084 $at_failed && at_fn_log_failure
   178085 $at_traceon; }
   178086 
   178087 
   178088 { set +x
   178089 $as_echo "$at_srcdir/glr-regression.at:1717:  \$PREPARSER ./input"
   178090 at_fn_check_prepare_dynamic " $PREPARSER ./input" "glr-regression.at:1717"
   178091 ( $at_check_trace;  $PREPARSER ./input
   178092 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178093 at_status=$? at_failed=false
   178094 $at_check_filter
   178095 echo stderr:; tee stderr <"$at_stderr"
   178096 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178097 at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1717"
   178098 $at_failed && at_fn_log_failure
   178099 $at_traceon; }
   178100 
   178101 { set +x
   178102 $as_echo "$at_srcdir/glr-regression.at:1717: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   178103 at_fn_check_prepare_trace "glr-regression.at:1717"
   178104 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   178105 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178106 at_status=$? at_failed=false
   178107 $at_check_filter
   178108 echo >>"$at_stderr"; $as_echo "Starting parse
   178109 Entering state 0
   178110 Reading a token: Next token is token 'a' ()
   178111 Shifting token 'a' ()
   178112 Entering state 1
   178113 Reading a token: Next token is token 'b' ()
   178114 Shifting token 'b' ()
   178115 Entering state 3
   178116 Reducing stack 0 by rule 3 (line 25):
   178117    \$1 = token 'b' ()
   178118 -> \$\$ = nterm b ()
   178119 Entering state 4
   178120 Reading a token: Next token is token 'c' ()
   178121 Shifting token 'c' ()
   178122 Entering state 6
   178123 Reducing stack 0 by rule 4 (line 26):
   178124 -> \$\$ = nterm d ()
   178125 Entering state 7
   178126 Reading a token: Now at end of input.
   178127 Stack 0 Entering state 7
   178128 Now at end of input.
   178129 Splitting off stack 1 from 0.
   178130 Reduced stack 1 by rule #2; action deferred.  Now in state 2.
   178131 Stack 1 Entering state 2
   178132 Now at end of input.
   178133 Reduced stack 0 by rule #1; action deferred.  Now in state 2.
   178134 Merging stack 0 into stack 1.
   178135 Stack 1 Entering state 2
   178136 Now at end of input.
   178137 Removing dead stacks.
   178138 Rename stack 1 -> 0.
   178139 On stack 0, shifting token \$end ()
   178140 Stack 0 now in state #5
   178141 Ambiguity detected.
   178142 Option 1,
   178143   start -> <Rule 1, tokens 1 .. 3>
   178144     'a' <tokens 1 .. 1>
   178145     b <tokens 2 .. 2>
   178146     'c' <tokens 3 .. 3>
   178147     d <empty>
   178148 
   178149 Option 2,
   178150   start -> <Rule 2, tokens 1 .. 3>
   178151     'a' <tokens 1 .. 1>
   178152     b <tokens 2 .. 2>
   178153     'c' <tokens 3 .. 3>
   178154     d <empty>
   178155 
   178156 syntax is ambiguous
   178157 Cleanup: popping token \$end ()
   178158 Cleanup: popping unresolved nterm start ()
   178159 Cleanup: popping nterm d ()
   178160 Cleanup: popping token 'c' ()
   178161 Cleanup: popping nterm b ()
   178162 Cleanup: popping token 'a' ()
   178163 " | \
   178164   $at_diff - "$at_stderr" || at_failed=:
   178165 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178166 at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1717"
   178167 $at_failed && at_fn_log_failure
   178168 $at_traceon; }
   178169 
   178170 
   178171 
   178172   set +x
   178173   $at_times_p && times >"$at_times_file"
   178174 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   178175 read at_status <"$at_status_file"
   178176 #AT_STOP_349
   178177 #AT_START_350
   178178 at_fn_group_banner 350 'push.at:24' \
   178179   "Memory Leak for Early Deletion" "                 " 23
   178180 at_xfail=no
   178181 (
   178182   $as_echo "350. $at_setup_line: testing $at_desc ..."
   178183   $at_traceon
   178184 
   178185 
   178186 # Requires Valgrind.
   178187 
   178188 cat >input.y <<'_ATEOF'
   178189 %code top {
   178190 #include <config.h>
   178191 /* We don't need perfect functions for these tests. */
   178192 #undef malloc
   178193 #undef memcmp
   178194 #undef realloc
   178195 }
   178196 
   178197 
   178198 %{
   178199   #include <assert.h>
   178200   #include <stdio.h>
   178201   #define YYINITDEPTH 1
   178202 static void yyerror ( const char *msg);
   178203 %}
   178204 
   178205 %define api.pure
   178206 %define api.push-pull push
   178207 
   178208 %%
   178209 
   178210 start: 'a' 'b' 'c' ;
   178211 
   178212 %%
   178213 
   178214 #include <stdio.h>
   178215 /* A C error reporting function.  */
   178216 static
   178217 void yyerror ( const char *msg)
   178218 {
   178219   fprintf (stderr, "%s\n", msg);
   178220 }
   178221 
   178222 int
   178223 main (void)
   178224 {
   178225   yypstate *ps;
   178226 
   178227   /* Make sure we don't try to free ps->yyss in this case.  */
   178228   ps = yypstate_new ();
   178229   yypstate_delete (ps);
   178230 
   178231   /* yypstate_delete used to leak ps->yyss if the stack was reallocated but the
   178232      parse did not return on success, syntax error, or memory exhaustion.  */
   178233   ps = yypstate_new ();
   178234   assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE);
   178235   yypstate_delete (ps);
   178236 
   178237   ps = yypstate_new ();
   178238   assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE);
   178239   assert (yypush_parse (ps, 'b', YY_NULL) == YYPUSH_MORE);
   178240   yypstate_delete (ps);
   178241 
   178242   return 0;
   178243 }
   178244 _ATEOF
   178245 
   178246 
   178247 
   178248 
   178249 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   178250   at_save_special_files
   178251   mkdir xml-tests
   178252     # Don't combine these Bison invocations since we want to be sure that
   178253   # --report=all isn't required to get the full XML file.
   178254   { set +x
   178255 $as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   178256                   --graph=xml-tests/test.dot -o input.c input.y"
   178257 at_fn_check_prepare_notrace 'an embedded newline' "push.at:73"
   178258 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   178259                   --graph=xml-tests/test.dot -o input.c input.y
   178260 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178261 at_status=$? at_failed=false
   178262 $at_check_filter
   178263 echo stderr:; cat "$at_stderr"
   178264 echo stdout:; cat "$at_stdout"
   178265 at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
   178266 $at_failed && at_fn_log_failure
   178267 $at_traceon; }
   178268 
   178269   { set +x
   178270 $as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   178271 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:73"
   178272 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   178273 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178274 at_status=$? at_failed=false
   178275 $at_check_filter
   178276 echo stderr:; cat "$at_stderr"
   178277 echo stdout:; cat "$at_stdout"
   178278 at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
   178279 $at_failed && at_fn_log_failure
   178280 $at_traceon; }
   178281 
   178282     cp xml-tests/test.output expout
   178283   { set +x
   178284 $as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\
   178285              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   178286              xml-tests/test.xml"
   178287 at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73"
   178288 ( $at_check_trace; $XSLTPROC \
   178289              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   178290              xml-tests/test.xml
   178291 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178292 at_status=$? at_failed=false
   178293 $at_check_filter
   178294 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178295 $at_diff expout "$at_stdout" || at_failed=:
   178296 at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
   178297 $at_failed && at_fn_log_failure
   178298 $at_traceon; }
   178299 
   178300   sort xml-tests/test.dot > expout
   178301   { set +x
   178302 $as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\
   178303              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   178304              xml-tests/test.xml | sort"
   178305 at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73"
   178306 ( $at_check_trace; $XSLTPROC \
   178307              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   178308              xml-tests/test.xml | sort
   178309 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178310 at_status=$? at_failed=false
   178311 $at_check_filter
   178312 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178313 $at_diff expout "$at_stdout" || at_failed=:
   178314 at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
   178315 $at_failed && at_fn_log_failure
   178316 $at_traceon; }
   178317 
   178318   rm -rf xml-tests expout
   178319   at_restore_special_files
   178320 fi
   178321 { set +x
   178322 $as_echo "$at_srcdir/push.at:73: bison -o input.c input.y"
   178323 at_fn_check_prepare_trace "push.at:73"
   178324 ( $at_check_trace; bison -o input.c input.y
   178325 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178326 at_status=$? at_failed=false
   178327 $at_check_filter
   178328 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178329 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178330 at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
   178331 $at_failed && at_fn_log_failure
   178332 $at_traceon; }
   178333 
   178334 
   178335 { set +x
   178336 $as_echo "$at_srcdir/push.at:74: \$BISON_C_WORKS"
   178337 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:74"
   178338 ( $at_check_trace; $BISON_C_WORKS
   178339 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178340 at_status=$? at_failed=false
   178341 $at_check_filter
   178342 echo stderr:; cat "$at_stderr"
   178343 echo stdout:; cat "$at_stdout"
   178344 at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
   178345 $at_failed && at_fn_log_failure
   178346 $at_traceon; }
   178347 
   178348 { set +x
   178349 $as_echo "$at_srcdir/push.at:74: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   178350 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:74"
   178351 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   178352 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178353 at_status=$? at_failed=false
   178354 $at_check_filter
   178355 echo stderr:; cat "$at_stderr"
   178356 echo stdout:; cat "$at_stdout"
   178357 at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
   178358 $at_failed && at_fn_log_failure
   178359 $at_traceon; }
   178360 
   178361 { set +x
   178362 $as_echo "$at_srcdir/push.at:75:  \$PREPARSER ./input"
   178363 at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:75"
   178364 ( $at_check_trace;  $PREPARSER ./input
   178365 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178366 at_status=$? at_failed=false
   178367 $at_check_filter
   178368 echo stderr:; tee stderr <"$at_stderr"
   178369 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178370 at_fn_check_status 0 $at_status "$at_srcdir/push.at:75"
   178371 $at_failed && at_fn_log_failure
   178372 $at_traceon; }
   178373 
   178374 { set +x
   178375 $as_echo "$at_srcdir/push.at:75: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   178376 at_fn_check_prepare_trace "push.at:75"
   178377 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   178378 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178379 at_status=$? at_failed=false
   178380 $at_check_filter
   178381 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178382 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178383 at_fn_check_status 0 $at_status "$at_srcdir/push.at:75"
   178384 $at_failed && at_fn_log_failure
   178385 $at_traceon; }
   178386 
   178387 
   178388 
   178389   set +x
   178390   $at_times_p && times >"$at_times_file"
   178391 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   178392 read at_status <"$at_status_file"
   178393 #AT_STOP_350
   178394 #AT_START_351
   178395 at_fn_group_banner 351 'push.at:83' \
   178396   "Multiple impure instances" "                      " 23
   178397 at_xfail=no
   178398 (
   178399   $as_echo "351. $at_setup_line: testing $at_desc ..."
   178400   $at_traceon
   178401 
   178402 
   178403 
   178404 
   178405 
   178406 
   178407 cat >input.y <<'_ATEOF'
   178408 %code top {
   178409 #include <config.h>
   178410 /* We don't need perfect functions for these tests. */
   178411 #undef malloc
   178412 #undef memcmp
   178413 #undef realloc
   178414 }
   178415 
   178416 
   178417 %{
   178418   #include <assert.h>
   178419   #include <stdio.h>
   178420 static void yyerror ( const char *msg);
   178421 static int yylex (void);
   178422 %}
   178423 
   178424 %define api.push-pull both
   178425 
   178426 %%
   178427 
   178428 start: ;
   178429 
   178430 %%
   178431 #include <stdio.h>
   178432 /* A C error reporting function.  */
   178433 static
   178434 void yyerror ( const char *msg)
   178435 {
   178436   fprintf (stderr, "%s\n", msg);
   178437 }
   178438 #include <assert.h>
   178439 static
   178440 int yylex (void)
   178441 {
   178442   static char const input[] = "";
   178443   static size_t toknum = 0;
   178444   int res;
   178445   ;
   178446   assert (toknum < sizeof input / sizeof input[0]);
   178447   res = input[toknum++];
   178448   ;
   178449   return res;
   178450 }
   178451 
   178452 int
   178453 main (void)
   178454 {
   178455   int i;
   178456   for (i = 0; i < 2; ++i)
   178457     {
   178458       yypstate *ps = yypstate_new ();
   178459       assert (ps);
   178460       assert (yypstate_new () == YY_NULL);
   178461       assert (yyparse () == 2);
   178462       yychar = 0;
   178463       assert (yypush_parse (ps) == 0);
   178464       assert (yypstate_new () == YY_NULL);
   178465       assert (yyparse () == 2);
   178466       yypstate_delete (ps);
   178467     }
   178468 
   178469   return 0;
   178470 }
   178471 _ATEOF
   178472 
   178473 
   178474 
   178475 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   178476   at_save_special_files
   178477   mkdir xml-tests
   178478     # Don't combine these Bison invocations since we want to be sure that
   178479   # --report=all isn't required to get the full XML file.
   178480   { set +x
   178481 $as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   178482                   --graph=xml-tests/test.dot -o input.c input.y"
   178483 at_fn_check_prepare_notrace 'an embedded newline' "push.at:133"
   178484 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   178485                   --graph=xml-tests/test.dot -o input.c input.y
   178486 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178487 at_status=$? at_failed=false
   178488 $at_check_filter
   178489 echo stderr:; cat "$at_stderr"
   178490 echo stdout:; cat "$at_stdout"
   178491 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178492 $at_failed && at_fn_log_failure
   178493 $at_traceon; }
   178494 
   178495   { set +x
   178496 $as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   178497 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:133"
   178498 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   178499 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178500 at_status=$? at_failed=false
   178501 $at_check_filter
   178502 echo stderr:; cat "$at_stderr"
   178503 echo stdout:; cat "$at_stdout"
   178504 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178505 $at_failed && at_fn_log_failure
   178506 $at_traceon; }
   178507 
   178508     cp xml-tests/test.output expout
   178509   { set +x
   178510 $as_echo "$at_srcdir/push.at:133: \$XSLTPROC \\
   178511              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   178512              xml-tests/test.xml"
   178513 at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:133"
   178514 ( $at_check_trace; $XSLTPROC \
   178515              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   178516              xml-tests/test.xml
   178517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178518 at_status=$? at_failed=false
   178519 $at_check_filter
   178520 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178521 $at_diff expout "$at_stdout" || at_failed=:
   178522 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178523 $at_failed && at_fn_log_failure
   178524 $at_traceon; }
   178525 
   178526   sort xml-tests/test.dot > expout
   178527   { set +x
   178528 $as_echo "$at_srcdir/push.at:133: \$XSLTPROC \\
   178529              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   178530              xml-tests/test.xml | sort"
   178531 at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:133"
   178532 ( $at_check_trace; $XSLTPROC \
   178533              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   178534              xml-tests/test.xml | sort
   178535 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178536 at_status=$? at_failed=false
   178537 $at_check_filter
   178538 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178539 $at_diff expout "$at_stdout" || at_failed=:
   178540 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178541 $at_failed && at_fn_log_failure
   178542 $at_traceon; }
   178543 
   178544   rm -rf xml-tests expout
   178545   at_restore_special_files
   178546 fi
   178547 { set +x
   178548 $as_echo "$at_srcdir/push.at:133: bison -o input.c input.y"
   178549 at_fn_check_prepare_trace "push.at:133"
   178550 ( $at_check_trace; bison -o input.c input.y
   178551 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178552 at_status=$? at_failed=false
   178553 $at_check_filter
   178554 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178555 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178556 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178557 $at_failed && at_fn_log_failure
   178558 $at_traceon; }
   178559 
   178560 
   178561 { set +x
   178562 $as_echo "$at_srcdir/push.at:133: \$BISON_C_WORKS"
   178563 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:133"
   178564 ( $at_check_trace; $BISON_C_WORKS
   178565 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178566 at_status=$? at_failed=false
   178567 $at_check_filter
   178568 echo stderr:; cat "$at_stderr"
   178569 echo stdout:; cat "$at_stdout"
   178570 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178571 $at_failed && at_fn_log_failure
   178572 $at_traceon; }
   178573 
   178574 { set +x
   178575 $as_echo "$at_srcdir/push.at:133: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   178576 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:133"
   178577 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   178578 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178579 at_status=$? at_failed=false
   178580 $at_check_filter
   178581 echo stderr:; cat "$at_stderr"
   178582 echo stdout:; cat "$at_stdout"
   178583 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178584 $at_failed && at_fn_log_failure
   178585 $at_traceon; }
   178586 
   178587 { set +x
   178588 $as_echo "$at_srcdir/push.at:133:  \$PREPARSER ./input"
   178589 at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:133"
   178590 ( $at_check_trace;  $PREPARSER ./input
   178591 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178592 at_status=$? at_failed=false
   178593 $at_check_filter
   178594 echo stderr:; tee stderr <"$at_stderr"
   178595 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178596 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178597 $at_failed && at_fn_log_failure
   178598 $at_traceon; }
   178599 
   178600 { set +x
   178601 $as_echo "$at_srcdir/push.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   178602 at_fn_check_prepare_trace "push.at:133"
   178603 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   178604 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178605 at_status=$? at_failed=false
   178606 $at_check_filter
   178607 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178608 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178609 at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
   178610 $at_failed && at_fn_log_failure
   178611 $at_traceon; }
   178612 
   178613 
   178614 
   178615 
   178616 
   178617 
   178618 cat >input.y <<'_ATEOF'
   178619 %code top {
   178620 #include <config.h>
   178621 /* We don't need perfect functions for these tests. */
   178622 #undef malloc
   178623 #undef memcmp
   178624 #undef realloc
   178625 }
   178626 
   178627 
   178628 %{
   178629   #include <assert.h>
   178630   #include <stdio.h>
   178631 static void yyerror ( const char *msg);
   178632 
   178633 %}
   178634 
   178635 %define api.push-pull push
   178636 
   178637 %%
   178638 
   178639 start: ;
   178640 
   178641 %%
   178642 #include <stdio.h>
   178643 /* A C error reporting function.  */
   178644 static
   178645 void yyerror ( const char *msg)
   178646 {
   178647   fprintf (stderr, "%s\n", msg);
   178648 }
   178649 
   178650 
   178651 int
   178652 main (void)
   178653 {
   178654   int i;
   178655   for (i = 0; i < 2; ++i)
   178656     {
   178657       yypstate *ps = yypstate_new ();
   178658       assert (ps);
   178659       assert (yypstate_new () == YY_NULL);
   178660       ;
   178661       yychar = 0;
   178662       assert (yypush_parse (ps) == 0);
   178663       assert (yypstate_new () == YY_NULL);
   178664       ;
   178665       yypstate_delete (ps);
   178666     }
   178667 
   178668   return 0;
   178669 }
   178670 _ATEOF
   178671 
   178672 
   178673 
   178674 if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
   178675   at_save_special_files
   178676   mkdir xml-tests
   178677     # Don't combine these Bison invocations since we want to be sure that
   178678   # --report=all isn't required to get the full XML file.
   178679   { set +x
   178680 $as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\
   178681                   --graph=xml-tests/test.dot -o input.c input.y"
   178682 at_fn_check_prepare_notrace 'an embedded newline' "push.at:134"
   178683 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \
   178684                   --graph=xml-tests/test.dot -o input.c input.y
   178685 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178686 at_status=$? at_failed=false
   178687 $at_check_filter
   178688 echo stderr:; cat "$at_stderr"
   178689 echo stdout:; cat "$at_stdout"
   178690 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178691 $at_failed && at_fn_log_failure
   178692 $at_traceon; }
   178693 
   178694   { set +x
   178695 $as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y"
   178696 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:134"
   178697 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y
   178698 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178699 at_status=$? at_failed=false
   178700 $at_check_filter
   178701 echo stderr:; cat "$at_stderr"
   178702 echo stdout:; cat "$at_stdout"
   178703 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178704 $at_failed && at_fn_log_failure
   178705 $at_traceon; }
   178706 
   178707     cp xml-tests/test.output expout
   178708   { set +x
   178709 $as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\
   178710              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
   178711              xml-tests/test.xml"
   178712 at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134"
   178713 ( $at_check_trace; $XSLTPROC \
   178714              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
   178715              xml-tests/test.xml
   178716 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178717 at_status=$? at_failed=false
   178718 $at_check_filter
   178719 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178720 $at_diff expout "$at_stdout" || at_failed=:
   178721 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178722 $at_failed && at_fn_log_failure
   178723 $at_traceon; }
   178724 
   178725   sort xml-tests/test.dot > expout
   178726   { set +x
   178727 $as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\
   178728              \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
   178729              xml-tests/test.xml | sort"
   178730 at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134"
   178731 ( $at_check_trace; $XSLTPROC \
   178732              `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
   178733              xml-tests/test.xml | sort
   178734 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178735 at_status=$? at_failed=false
   178736 $at_check_filter
   178737 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178738 $at_diff expout "$at_stdout" || at_failed=:
   178739 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178740 $at_failed && at_fn_log_failure
   178741 $at_traceon; }
   178742 
   178743   rm -rf xml-tests expout
   178744   at_restore_special_files
   178745 fi
   178746 { set +x
   178747 $as_echo "$at_srcdir/push.at:134: bison -o input.c input.y"
   178748 at_fn_check_prepare_trace "push.at:134"
   178749 ( $at_check_trace; bison -o input.c input.y
   178750 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178751 at_status=$? at_failed=false
   178752 $at_check_filter
   178753 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178754 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178755 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178756 $at_failed && at_fn_log_failure
   178757 $at_traceon; }
   178758 
   178759 
   178760 { set +x
   178761 $as_echo "$at_srcdir/push.at:134: \$BISON_C_WORKS"
   178762 at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:134"
   178763 ( $at_check_trace; $BISON_C_WORKS
   178764 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178765 at_status=$? at_failed=false
   178766 $at_check_filter
   178767 echo stderr:; cat "$at_stderr"
   178768 echo stdout:; cat "$at_stdout"
   178769 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178770 $at_failed && at_fn_log_failure
   178771 $at_traceon; }
   178772 
   178773 { set +x
   178774 $as_echo "$at_srcdir/push.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   178775 at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:134"
   178776 ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
   178777 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178778 at_status=$? at_failed=false
   178779 $at_check_filter
   178780 echo stderr:; cat "$at_stderr"
   178781 echo stdout:; cat "$at_stdout"
   178782 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178783 $at_failed && at_fn_log_failure
   178784 $at_traceon; }
   178785 
   178786 { set +x
   178787 $as_echo "$at_srcdir/push.at:134:  \$PREPARSER ./input"
   178788 at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:134"
   178789 ( $at_check_trace;  $PREPARSER ./input
   178790 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178791 at_status=$? at_failed=false
   178792 $at_check_filter
   178793 echo stderr:; tee stderr <"$at_stderr"
   178794 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178795 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178796 $at_failed && at_fn_log_failure
   178797 $at_traceon; }
   178798 
   178799 { set +x
   178800 $as_echo "$at_srcdir/push.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
   178801 at_fn_check_prepare_trace "push.at:134"
   178802 ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
   178803 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178804 at_status=$? at_failed=false
   178805 $at_check_filter
   178806 at_fn_diff_devnull "$at_stderr" || at_failed=:
   178807 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178808 at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
   178809 $at_failed && at_fn_log_failure
   178810 $at_traceon; }
   178811 
   178812 
   178813 
   178814 
   178815 
   178816 
   178817 
   178818   set +x
   178819   $at_times_p && times >"$at_times_file"
   178820 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   178821 read at_status <"$at_status_file"
   178822 #AT_STOP_351
   178823 #AT_START_352
   178824 at_fn_group_banner 352 'push.at:144' \
   178825   "Unsupported Skeletons" "                          " 23
   178826 at_xfail=no
   178827 (
   178828   $as_echo "352. $at_setup_line: testing $at_desc ..."
   178829   $at_traceon
   178830 
   178831 
   178832 
   178833 cat >input.y <<'_ATEOF'
   178834 %glr-parser
   178835 %define api.push-pull push
   178836 %%
   178837 start: ;
   178838 _ATEOF
   178839 
   178840 
   178841 
   178842 
   178843 { set +x
   178844 $as_echo "$at_srcdir/push.at:155: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
   178845 at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "push.at:155"
   178846 ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
   178847 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
   178848 at_status=$? at_failed=false
   178849 $at_check_filter
   178850 echo >>"$at_stderr"; $as_echo "input.y:2.9-21: error: %define variable 'api.push-pull' is not used
   178851 " | \
   178852   $at_diff - "$at_stderr" || at_failed=:
   178853 at_fn_diff_devnull "$at_stdout" || at_failed=:
   178854 at_fn_check_status 1 $at_status "$at_srcdir/push.at:155"
   178855 $at_failed && at_fn_log_failure
   178856 $at_traceon; }
   178857 
   178858 
   178859 
   178860   set +x
   178861   $at_times_p && times >"$at_times_file"
   178862 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
   178863 read at_status <"$at_status_file"
   178864 #AT_STOP_352
   178865